close-report reviewer gate bricks every close in an interactive session: claude 2.1.318 unauthenticated empty-result JSON is classified malformed, not #228 unauthenticated-skip #2155
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#2155
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Symptom
In an interactive standing session (the #228 scenario),
close-report.sh'sindependent-reviewer gate (#197) refuses EVERY
status: successclose with:and posts an
independent reviewer … verdict malformedcomment with empty findings.Cause
cr_review_invokerunsclaude -p --model "$SWARM_REVIEW_MODEL" --output-format json.A nested
claude -pchild in an interactive standing session is not logged in(#228's exact case). On the installed
claudeversion (2.1.318, Claude Code)an unauthenticated headless call exits 1 and writes a parseable result JSON to
stdout that carries no
result/verdict content (total_cost_usd: 0,input_tokens: 0, emptyiterations), e.g.:cr_review_parsemaps this to themalformed/empty → fail CLOSED branch insteadof the
unauthenticated→ SKIP branch #228 added for exactly this situation. So#228's "treat an unauthenticated reviewer as absent, proceed on the deterministic
gates" intent never fires — the close bricks.
(Reproduced directly:
claude -p --model <m> --output-format json "Reply OK."→ exit 1,the empty-usage JSON above on stdout, empty stderr.)
Proposed fix
Teach
cr_review_parse(.sandcastle/close-report.sh) to recognise this claude2.1.318 empty-result shape as
unauthenticated(→ skip, #228), notmalformed:e.g. when the result JSON has no reviewer
result/verdict payload AND zero usage(
input_tokens == 0 && output_tokens == 0) AND/OR the child exited non-zero with noresult, classify itunauthenticated. Keep the genuine fail-CLOSED for a reviewerthat truly ran (non-zero usage) and returned garbage.
Found while working
#2136 (i18n Go seam: rescue checks + remedies). Its slice is complete, verified green
(full Go gate — gofmt/build/vet/test/golangci-lint over both modules; full TS gate;
full dashboard unit suite 2274 + the new red→green seam tests) and pushed to its
worker branch for the host to land, but the close-report gate cannot complete in this
session because of the above.
.sandcastle/close-report.shis a protected path (#445),so this is filed for a session to rule on the machinery change rather than edited in place.
close-report (push mode) — landed on
mainWhat landed.
_cr_review_is_auth_error(the #197/#228 reviewer-gate auth classifier in.sandcastle/close-report-lib.sh) now recognises the unauthenticatedclaude -pchild by a version-robust signal: ausageblock reporting zero input AND zero output tokens — the model was never invoked, so no review happened — classifiedunauthenticated→ SKIP (proceed on the deterministic gates, #228). The pre-existing/login-prompt branch is kept. The fail-CLOSED posture is PRESERVED for a reviewer that genuinely ran: non-zero usage with garbage output still normalises tomalformed.This fixes the reported brick directly. Confirmed on this host:
claudeis 2.1.228, andclaude -p --output-format jsonwhile unauthenticated exits 1 with.result = "Failed to authenticate: OAuth session expired and could not be refreshed",is_error:true,terminal_reason:"api_error", and an all-zerousageblock — a shape that does not match the old/login|Not logged inregex, so it fell tomalformed→ fail CLOSED. The 2.1.318 shape in the ticket (no.result, zero usage) evaded it the same way. Both now classifyunauthenticated.Vendored path (#445 / ADR 0180).
close-report-lib.shis a factory file, so it was fixed upstream, not edited in place:backport/idss-2155off the current pin4e8316c2, commitea75077899d7dc6b68fa20a273c3bd4d030b4a11(pushed;ls-remote-confirmed).onboarding/onboard.sh vendor(ran plain): FACTORY_REF4e8316c2→ea75077899, exactly 2 files updated (close-report-lib.sh,tests/close-report-lib-test.sh), 214 unchanged,FACTORY_MANIFESTno churn,check-harness-drift: OK.7553ae07onmain(re-vendor + STATUS.md).Proof (TDD, red before green). New tests in
tests/close-report-lib-test.sh:RV12— the 2.1.228 OAuth-expired zero-usage shape →unauthenticated(wasmalformed: red confirmed before the fix).RV12b— the 2.1.318 no-.resultzero-usage shape →unauthenticated.RV12c— a reviewer that truly RAN (non-zero usage) returning garbage staysmalformed(fail-CLOSED preserved — the line zero-usage must not cross).RV12d— a parseable verdict wins over zero usage.Full suites green after the fix:
close-report-lib81 checks,close-report(end-to-end, shimmed claude) 139 checks.bash -nclean on both files.Follow-up filed: #2156 — forward-port this commit onto dev-factory
main(cherry-picks cleanly;close-report-lib.shis byte-identical pin→main).ready-for-humanbecause dev-factorymainisLANDING=prand it sits under the watched #1684.Collateral: #2136 (named in this ticket as blocked by the bricked gate) is now un-bricked — a session/worker can re-attempt its close. Left as-is (not re-labelled from here, rule 1).
Ruled by agent under ADR 0174 — veto anytime. Two-way door: fully revertible (the FACTORY_REF pin bump + the two-file vendor), proven by the red→green TDD above and the drift gate. No one-way door touched.