fix(hooks): mark a pre-sourcing Trunk chain as outdated #31
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.45) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 432 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.363
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #31"
general
weight: 0.35
greptile-apps[bot]
Fork-only PR so the review bots can run on the exact head that would go on upstream
clipull request 3051 (plain text on purpose, so nothing links there). Nothing is opened or updated upstream from this. Base is fork branchbase-main-1ffd771ed, which equals upstream main1ffd771ed.This is Soph's requested follow-up on that pull request: existing installs should pick up the new Trunk chain without the user running
entire enableagain.What it does
hookStateIntreated an already-chained hook as Current because it carries Entire's marker, soReinstallGitHooksleft the pre-sourcing chain in place. After an upgrade, Trunk still saw the callback<hook>.pre-entireand exited 2 on every commit and push.When a hook carries Entire's marker, chains to
<hook>.pre-entire, does not contain the sourcing branch (shellQuote(trunkHookCallback)), and that backup contains thetrunkHookCallbackline as a whole line (the same match the chain'sgrep -qxFuses), it now reports Outdated. EnsureSetup then rewrites the chain on the next agent turn.The check is Trunk-specific and only reads the backup for hooks that already chain. A broad "any old-format chain is Outdated" check would rewrite a hook that carries Entire's marker without a backup, and would discard lines users added.
The new test plants the pre-sourcing chain with Trunk's launcher as the backup, asserts
CheckGitHookStatereports Outdated, runsReinstallGitHooks, and checks thatpre-pushreaches Trunk aspre-push. Extra cases pin that a non-Trunk backup, a callback mentioned only in a comment, and the current chain stay Current, and that a backup that is a symlink to Trunk's launcher still reads Outdated.Commits:
ffc689652(source the launcher under the hook's own name),aaeb04aa9(run it with/bin/bash --norc),f750a98b4(mark the old chain Outdated),f6540dc4c(bound the backup read; skip FIFO/device targets),d27e8edda(bound the in-root read too; move the FIFO test behind a unix build tag so Windows compiles).Checks on head
d27e8edda(Go 1.27.3, git 2.47.3)TestReinstallGitHooks_Pre3051TrunkChainIsOutdatedand the "symlinked Trunk launcher" case fail before the Outdated check (CheckGitHookStatewas Current) and pass after it.go build ./...,go vet ./...,gofmt -l -sof the changed files: clean.go test ./cmd/entire/cli/strategy/ -run 'Hook|Trunk|GitHook|Reinstall|Chain'passes, including with-race.go test ./cmd/entire/cli/ -run 'Hook|Doctor'passes.go test -tags=integration ./cmd/entire/cli/integration_test/ -run 'Hook|Chain|Overwrite|LocalDev'passes.golangci-lint run ./...(v2.15.0) reports 0 issues.go vetandgo test -cof thestrategypackage succeed.The full
strategypackage also has two pre-existing reftable failures on this box (TestLocalRefReads_ReftableProcessCount,TestReplacedCommits_ReftableRepository):git refs migrateexits 255 with "migrating reflogs is not supported yet" on git 2.47.3. They fail the same way without this change.The commits have no
Entire-Checkpointtrailer. The first commit's message still contains the original closing keyword from when the upstream pull request was opened; this follow-up commit does not add another.