HOMELAB-1534: fix(reviewer): authenticate all git calls in the review workdir (private repos) + claim-verification verdict policy #504
No reviewers
Labels
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Homelab/infra-core!504
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "plane/HOMELAB-1534-reviewer-fetch-auth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Two reviewer fixes from the HOMELAB-1526 demo post-mortem (HOMELAB-1534):
Private repos were never reviewable.
http.extraHeaderauth is per-invocation, so in the review workdir:git fetchfor the base ref ran unauthenticated, and--filter=blob:none), the lazy blob fetch duringgit diffdid too.Public repos (infra-core) masked both; every Homelab/prod PR failed with
could not read Username(36/36 in 3 days). NowauthEnv(token)is passed to clone, fetch and diff.Claim-verification verdict policy in the review prompt:
CHANGES-REQUESTEDwhenever a claimed outcome is unverifiable from the diff (runtime/deploy claims like "deployed", "pod Ready", "verified E2E", "reachable at URL") or an acceptance criterion is marked ✅ without a citable artifact. This is the HOMELAB-1526 canary class (fabricated E2E claims were approved as "nits").Verification
Homelab/prod, PR #541's branch): clone + fetch + diff = 46 files / 84KB diff, 3/3 runs OK.Related: HOMELAB-1526 (canary origin), HOMELAB-1527.
AI Review (HOMELAB-1534)
Verdict: PASS-WITH-NITS
The code change correctly implements the diagnosed root cause (per-invocation
http.extraHeader+ blobless-clone lazy fetches), and the verdict-policy prompt addition matches the ticket scope item. Nits are below; the ticket's runtime verification items remain outstanding and are tracked as ⚠️, not ✅ — merging this PR does not close HOMELAB-1534.Acceptance Criteria (HOMELAB-1534)
authEnv()(review.js:46-55) now applied to clone (review.js:64), base fetch (review.js:81), andgit difflazy blob fetch (review.js:82). But "prod clone works" is a runtime outcome — no canary replay or prod-PR review log cited in the diff.list_ci_runs, swarm-suite contract, project skill, rehearsal/export)Design Doc Citations
read:repositoryonclaude-agent. Note the runbook names the accountclaude-agentwhileauthEnvdefaultsFORGEJO_CLONE_USERto"ci-bot"— pre-existing, but the env var must be set insecrets.envfor the default not to silently produce wrong Basic-auth credentials on private repos.Open Issues
cloneShallowscrubs the token from error messages (review.js:66-68) butfetchDiffdoes not. Git stderr rarely echoeshttp.extraHeadervalues, so this is low-risk defense-in-depth, but the two paths should behave identically — wrap fetch/diff errors with the samesplit(token).join("***")scrub.authEnvreturns bareprocess.envwhentokenis empty —fetchDiffthen silently degrades to unauthenticated fetch/diff (the pre-fix behavior). For private repos this fails late with "could not read Username" instead of a clear config error. Consider failing fast whenFORGEJO_CLONE_TOKEN/FORGEJO_COMMENT_TOKENresolve empty.buildCuratedContextruns afterfetchDiffin the same workdir; if it ever shells out to git (e.g.,git log, reading non-checked-out blobs from the blobless clone), it would hit the same unauthenticated lazy-fetch path. Not visible in this diff — confirm it only reads the materialized working tree, or threadauthEnvthrough.Powered by Kimi k3 · advisory.
Review nits addressed in
28e894c:scrubToken()helper applied to bothcloneShallowandfetchDifferror paths (fetch/diff previously masked nothing).runReviewnow logsclone_token_missingloudly when neitherFORGEJO_CLONE_TOKENnorFORGEJO_COMMENT_TOKENresolves; we kept it a warning (not fail-fast) so public-only deployments keep working.context.jsaudit — verified it does not shell out to git (grep for spawn/exec/git: empty), so the blobless lazy-fetch exposure is confined tofetchDiff, which now carriesauthEnv.Re: runbook account naming —
FORGEJO_CLONE_USERis set explicitly (homelab-bot) in the receiver'ssecrets.env, so theci-botfallback is not in play; flagged to update the runbook when convenient.Per your own recommendation: the ticket-level runtime verifications (preflight GO, decoy #501-style replay evidence) remain open on HOMELAB-1534 and will be evidenced there before the ticket moves to Done. The receiver has been restarted with this code and both commits are live (canary run earlier today: Homelab/prod#618 → CHANGES-REQUESTED in 104s).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.