Skip to content

Commit c776012

Browse files
committed
docs(review): describe exact-input cache ownership
1 parent 2611a42 commit c776012

2 files changed

Lines changed: 23 additions & 64 deletions

File tree

‎docs/review-cache.md‎

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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
4849
and repeats the bounded metadata and check-state probes under that lease; any
4950
intervening 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
9455
may still reuse an unchanged keep-open verdict after the full context is
9556
proven.
9657

@@ -99,16 +60,29 @@ No cache stage can promote a report to close.
9960
Every reused review passes the host-owned scan preflight before checkout
10061
inspection. Structural reuse scans current reuse metadata and the pinned source
10162
delta 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
10464
outcomes predating scan admission are rejected by the review policy version.
10565
Scan 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

10983
Each review run writes `review-cache-metrics.json` in its artifact directory.
11084
It 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,
11286
content-cache hits, and full hydration count. The final review log emits the
11387
same high-level counters. Metrics contain only counts, timings, and bounded
11488
reason names.

‎docs/scheduler.md‎

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,10 @@ continuations: due items win first, and if fewer than 38 items are due, the
3838
planner fills the floor with the stalest currently-reviewed eligible items so
3939
review capacity stays warm around the clock.
4040

41-
## Review reuse
42-
43-
ClawSweeper reuses a completed kept-open review only when its exact inputs
44-
remain unchanged. A structural probe can avoid full hydration; otherwise the
45-
hydrated content digest can avoid a model call. Both paths retain their
46-
policy, freshness, durable-comment identity, checkout-access, and lease checks.
47-
Explicit reviews and maintainer re-review requests bypass these caches.
48-
49-
Changed PR content, including comments and formatting in source files, goes to
50-
Codex. ClawSweeper does not parse source syntax to infer that two revisions
51-
mean the same thing. Git history and blob hydration still make both sides of
52-
the PR available inside the restricted review checkout.
53-
54-
The deployed review artifact contains compiled JavaScript, runtime libraries,
55-
and the matching configuration, prompts, and schemas. TypeScript is a build dependency; review shards neither load nor
56-
install a compiler. Historical `review_semantic_*` report fields are ignored
57-
and disappear when a full review replaces the report. Existing reports keep
58-
their normal freshness deadline; this change does not trigger a fleet-wide
59-
re-review.
41+
Scheduled reviews can reuse exact unchanged inputs through structural or
42+
content caches. Changed PR content goes to Codex, including source comments
43+
and formatting. See [Review Cache](review-cache.md) for admission, freshness,
44+
and runtime packaging rules.
6045

6146
## Workflow
6247

0 commit comments

Comments
 (0)