Skip to content

Skill: verify cache dependency from the log #188

Description

@koriym

A skill that answers "is the cache dependency actually working?" by reading a session, rather than by reasoning about the code.

Why a skill

The failure is a set-intersection that nobody can see: a parent is stored under the tags of the children it embeds, a write invalidates some tags, and if the two sets do not meet, the parent keeps serving stale content. Nothing throws. docs/reading-the-log.md states the rule; this skill applies it.

Procedure

  1. Install DevQueryRepositoryLogModule (recording is off by default), then exercise the flow: read the parent, write the child, read the parent again.
  2. Read the resulting sessions and check, in order:
    • the cold read recorded depends_on edges for every embedded child — a missing edge is the bug, before any tag comparison
    • the parent's save_* tags include each child's URI tag
    • the write's session contains an invalidate that is not marker-preceded (a pre_write_cleanup immediately before it makes it the writer clearing its own entry, not a bust)
    • that invalidate's tags intersect the parent's stored tags
    • the second parent read is a cache_miss, not a hit
  3. Report the first link that breaks, with the two tag sets side by side.

Acceptance

  • Distinguishes the four ways this fails, because the fix differs: no dependency edge recorded; edge recorded but the tag absent from the parent's save; a bust that only cleaned up before its own write; tags that never intersect.
  • Distinguishes cdn: skipped (no purger configured) from purged and failed — a local pass with a failed CDN purge is still stale at the edge.
  • Says explicitly when the log cannot answer: with ProdQueryRepositoryLogModule the healthy read that stored the parent may have been dropped by the retention policy, leaving only the purge side of the intersection.

Notes

demo/run-dependency.php is a working example of the whole flow and its expected log; tests/CACHE_DEPENDENCY_TESTS.md documents what the test suite already pins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions