fix(review): shared-code evidence gathering is read-only (index-flags flaky, gate 40619718717)

The failing assume-unchanged trial ran git update-index --really-refresh while gathering evidence, which cleared the flag the checker reads. Step 1 now says the read is read-only and names that command; nearby prose tightened so the section stays byte-identical in size (no pin or ledger move).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-28 16:35:19 +00:00
1 parent 61e201ec08
commit ebbdf33354
4 files changed
+73 -30

No files matched your search

+11 -10
View File
@@ -133,11 +133,12 @@ or missing-reviewer rules.`;
export function generateSharedCodeReuse(ctx: TemplateContext): string {
return `**Reuse a skipped shared-code advisory only with complete structural evidence:**
1. **Read the evidence.** Read all supporting callers and the helper destination.
Establish first-party authored provenance and whether the current extraction
is worthwhile; the checker cannot decide that. Retain \`evidence_paths\`/\`helper_target\`.
1. **Read the evidence.** Read all supporting callers and the helper target
read-only: \`git update-index\`, even \`--really-refresh\`, clears the index flags
the checker reads. Establish first-party authored provenance and whether this
extraction is worthwhile; the checker cannot. Retain \`evidence_paths\`/\`helper_target\`.
2. **Run the checker.** From the repository root, pass the current finding as
literal JSON on stdin. Replace REVIEW_START with this pass's captured token
literal JSON on stdin. Replace REVIEW_START with this pass's token
and the example paths/symbol with actual evidence. Keep the quoted delimiter.
\`\`\`bash
@@ -146,17 +147,17 @@ export function generateSharedCodeReuse(ctx: TemplateContext): string {
GSTACK_SHARED_LIBS_REUSE_JSON
\`\`\`
3. **Act on its result.** Read the JSON. Only \`reusable: true\` permits suppression.
3. **Act on its result.** Only \`reusable: true\` permits suppression.
False, command failure or unreadable output requires fresh source review and a
new decision, never suppression. Do not supply your own snapshot, prior record or coverage.
4. **Persist through the logger.** The logger recomputes final coverage; never
supply proof yourself. Real defects retain normal Fix-First handling independently.
4. **Persist through the logger.** The logger recomputes coverage; never supply
proof. Real defects retain normal Fix-First handling.
**What a reusable result proves (do not reconstruct these checks yourself):**
- Identity: \`sharedLibsFingerprint\` plus the actual repo, raw branch and current snapshot.
**What a reusable result proves (never reconstruct these checks):**
- Identity: \`sharedLibsFingerprint\` plus the repo, raw branch and current snapshot.
The checker reads REVIEW_START without consuming/replacing it. Sanitized branch names are not identity.
- Prior decision: completed/converged review, verified binding, explicit Skip and
logger-versioned \`snapshot_covered_paths\`; older unversioned coverage needs a fresh decision.
logger-versioned \`snapshot_covered_paths\`; unversioned coverage needs a fresh decision.
- Source: \`canReuseSharedLibsAdvisory\` requires every supporting path's raw file
byte-for-byte with its blob. Exclude assume-unchanged, skip-worktree and sparse index
entries; symlinks/ancestors, submodules, ignored/outside or unreadable files;