11# Review Cache
22
3- Scheduled keep-open reviews use three independent cache stages.
3+ Scheduled keep-open reviews use two exact-input cache stages. Codex judges
4+ changed content; ClawSweeper does not infer source equivalence.
45
56## Structural Stage
67
@@ -48,49 +49,9 @@ review always disables reuse. ClawSweeper then refreshes target and release stat
4849and repeats the bounded metadata and check-state probes under that lease; any
4950intervening drift forces full hydration.
5051
51- ## Semantic Stage
52-
53- After hydration, pull requests can reuse a prior completed keep-open report when
54- the code is semantically unchanged even if the head SHA or ordinary formatting
55- changed. TypeScript and JavaScript patches are parsed through the TypeScript
56- compiler AST service. Whitespace and ordinary comments are ignored where
57- lexical state is established, while every non-trivia syntax fragment,
58- ` @ts-* ` , triple-slash reference, source-map, source URL, shebang, legal
59- ` /*! ` /` //! ` , global declarations, coverage/static-analysis suppressions,
60- formatter controls, and tooling directives remain part of the digest at their
61- exact syntax attachment. Complete JSON hunks are parsed and compacted without
62- reordering object keys. Scheduled shards receive a bounded shared runtime
63- archive, then install the exact TypeScript native package for their own platform
64- and architecture only after its tarball matches the committed lockfile SRI and
65- every installation parent is proven to be a real directory.
66-
67- Semantic reuse requires:
68-
69- - complete bounded patches for every changed file;
70- - exact base/head Git tree modes for regular blobs, included in the code digest;
71- - a supported modified or added TypeScript, JavaScript, or complete JSON file;
72- - unchanged title, body, human discussion, relations, reviews, review threads,
73- labels including maintainer proof overrides, base and target state, release
74- state from a complete lookup, full commit-message revision, merge readiness,
75- checks, policy, and model;
76- - a prior completed keep-open report within the normal 14-day ceiling; and
77- - the normal durable review lease.
78-
79- Unsupported languages, isolated mid-file or multi-hunk compiler patches,
80- compiler parse failures, deletions, renames, binary or missing patches, prompt
81- truncation, malformed hunks, lexical ambiguity, partial JSON, missing or
82- unsupported Git tree modes, incomplete check state, and truncated commit
83- context retain an exact digest for audit but cannot use semantic reuse.
84-
85- Before carrying a semantic hit, ClawSweeper repeats the target, release,
86- structural metadata, and check-state probes under the lease. Any drift or
87- incomplete release lookup releases the lease and defers the item for a fresh
88- hydrated review. Full cache-only patches are never included in the model prompt,
89- report frontmatter, or metrics.
90-
9152## Content Stage
9253
93- When the structural and semantic stages miss , the existing exact content digest
54+ When the structural stage misses , the exact content digest
9455may still reuse an unchanged keep-open verdict after the full context is
9556proven.
9657
@@ -99,16 +60,29 @@ No cache stage can promote a report to close.
9960Every reused review passes the host-owned scan preflight before checkout
10061inspection. Structural reuse scans current reuse metadata and the pinned source
10162delta against the base/head pair from the same fresh structural probe; hydrated
102- semantic/content reuse also scans current context. Complete raw before/after blobs
103- are scanned even when the AST digest ignores a comment-only change. Historical
63+ content reuse also scans current context and complete raw before/after blobs. Historical
10464outcomes predating scan admission are rejected by the review policy version.
10565Scan refusal cannot return a cached success or launch a fallback reviewer.
10666
67+ ## Changed Input and Runtime
68+
69+ Changed PR content, including source comments and formatting, goes to Codex.
70+ Git history and blob hydration still make both sides of the PR available in
71+ the restricted review checkout. There is no compiler-backed cache, separate
72+ cache-only patch payload, or source-equivalence revalidation path.
73+
74+ The deployed review artifact contains compiled JavaScript, runtime libraries,
75+ and matching configuration, prompts, and schemas. TypeScript is a build
76+ dependency; review shards neither load nor install a compiler. Historical
77+ ` review_semantic_* ` report fields are ignored and disappear when a full review
78+ replaces the report. Existing reports keep their normal freshness deadline;
79+ this change does not trigger a fleet-wide re-review.
80+
10781## Metrics
10882
10983Each review run writes ` review-cache-metrics.json ` in its artifact directory.
11084It reports structural checks, hits, probe failures, probe time, miss reasons,
111- semantic eligibility and miss reasons, post-lease revalidation results,
85+ post-lease revalidation results,
11286content-cache hits, and full hydration count. The final review log emits the
11387same high-level counters. Metrics contain only counts, timings, and bounded
11488reason names.
0 commit comments