Repository navigation
fix(ci): measure the PR candidate in the fork drift receipt and record tip SHAs (CLO-1117) - #243
nullStack65 wants to merge 1 commit into
Conversation
…d tip SHAs (CLO-1117) The fork drift receipt measured only the target branch, so a pull request that syncs upstream reported the same drift as the line it targets. It also named refs but no SHAs, so once the branches moved nobody could reproduce its numbers. The receipt now resolves base, head and upstream to commit SHAs once and computes everything from those SHAs. With --head, the candidate is the merge of base and head: commits in either tip but not upstream are ahead, upstream commits in neither are behind, and the merge base pairs upstream with that hypothetical merge. Without --head the candidate is base, and the numbers match the old receipt exactly (checked on the live release line: ahead 238, behind 670, 1576 files). Each receipt carries baseSha, headSha, upstreamSha and a reproduce command. ARC CI passes the PR head SHA (the pushed SHA on a push). Audit item T1-03 of the T3 Code factory audit. Model: claude-opus-5-5 Task: CLO-1117 Agent: claude-code Harness: t3/claude-code Model-family: claude Model-generation: 5 Skills-SHA: 22a90292e171517bd204efcea6e4ee03965caec9 Deploy: none Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Reviewed exactly head e74b9a2 (base 53ae52a, unchanged). R1–R4 hold. The receipt resolves base, head and upstream to one tip SHA each and derives ahead, behind and the changed-file count from those SHAs, so the printed No findings. {"reviewed_base": "53ae52a745a55ba295151a915132cda2963031ab", "reviewed_head": "e74b9a2f79391e5d8043de598b7e22167fa40ea4", "reviewer": "Grok 4.7, T3 Magpie route", "reviewer_family": "grok", "author_session": "claudeAgent claude-opus-5-5 mcp:6da90aa2-5851-447a-843b-d1c06e77acfc", "reviewer_session": "thread:delegated-task:command%3Amcp%3A2b632ee4-6554-4fd4-872c-5d8d6105eba4%3Adelegate-task%3A311e7c56-5618-445f-b928-fd0902356142", "fresh_context": true, "review_kind": "full", "round_id": "thread:delegated-task:command%3Amcp%3A2b632ee4-6554-4fd4-872c-5d8d6105eba4%3Adelegate-task%3A311e7c56-5618-445f-b928-fd0902356142", "intent": ["R1", "R2", "R3", "R4"], "prior_findings": [], "findings": []} |
Addresses the T3 Code factory audit item T1-03 in the t3code CI guard and hygiene issue (CLO-1117).
Problem
The ARC CI "Fork drift receipt" step measured
origin/<target branch>againstupstream/main. In a pull request it reported the target branch's drift, not the candidate's, so an upstream-sync PR looked exactly as far behind as the line it fixes. The receipt also printed ref names but no SHAs, so its numbers could not be reproduced once the refs moved.Change
scripts/fork-drift-receipt.mjsresolves base, head and upstream to commit SHAs once and computes every number from those SHAs.--head <ref>: the candidate is the merge of base and head. Ahead = commits in either tip not in upstream; behind = upstream commits in neither tip; the merge base pairs upstream with that hypothetical merge (git merge-base upstream base head). Without--headthe candidate is base, so the weekly run is unchanged.--upstream <ref>(defaultupstream/main), and every receipt carriesbaseSha,headSha,upstreamShaand areproducecommand.closura-arc-ci.ymlpasses--head= PR head SHA (the pushed SHA on a push) through an env var. The head is a parent of the merge ref, so it is already in the checkout.docs/operations/fork-sync.mddocuments the replay.Evidence
node --test scripts/fork-drift-receipt.test.mjs scripts/fork-sync-plan.test.mjs: 11/11 pass. New tests:rev-parse);mergeBase/ahead/behind/changedFiles;--all) is refused.origin/release/native-0.1.10(53ae52a) vsupstream/main(63a7126): old and new scripts both report ahead 238, behind 670, 1576 files, merge base 3418648.node .github/scripts/arc-ci-coverage.cjspasses; coverage, trust-gate and no-hosted-runner tests 39/39 pass.vp fmt --checkclean after formatting.vp lintcould not load the repo's TypeScript lint plugin in this local checkout; CI lint is the check of record.Prior art
Searched: 2026-11-27, git docs and the existing script.
git merge-base A B C(stock git): used as-is to get the merge base of upstream and the candidate merge without creating a merge commit.git rev-list --countwith negated tips (stock git): used for ahead/behind across two tips.refs/pull/N/mergedirectly: rejected, that merge commit is not durable, so the receipt would not be reproducible.Model: claude-opus-5-5
Task: CLO-1117
Agent: claude-code
Harness: t3/claude-code
Model-family: claude
Model-generation: 5
Skills-SHA: 22a90292e171517bd204efcea6e4ee03965caec9
Deploy: none
🤖 Generated with Claude Code