Skip to content

tools/shepherd: bind W7 always() session-log verdicts to job.status - #4500

Open
romanfjose wants to merge 1 commit into
limitlessprojects:mainfrom
romanfjose:fix/shepherd-w7-honest-job-verdict
Open

romanfjose wants to merge 1 commit into
limitlessprojects:mainfrom
romanfjose:fix/shepherd-w7-honest-job-verdict

Conversation

@romanfjose

Copy link
Copy Markdown

Problem

In .github/workflows/shepherd-board.yml, .github/workflows/shepherd-dup.yml, and .github/workflows/shepherd-rebase.yml, the final W7 session log step executes under if: always() with static completion claims (--verdict "ok" --note "board + labels refreshed", --note "phase A/B pass complete", --note "rebase shepherd tick").

When an earlier step fails or is cancelled???as observed live on main (b1627e8) in shepherd-board run 43752174585, where Scan exited 1 and Rewrite board / Sync tier labels were skipped???W7 session log still runs and writes verdict: "ok" + "board + labels refreshed" into logs/SESSION.jsonl.

Changes

  • tools/shepherd.py:
    • Added resolve_log_outcome(verdict, note, job_status=None) and --job-status on shepherd.py log.
    • Preserves existing direct CLI behavior when --job-status is omitted.
    • Preserves "ok" + completion note when --job-status is "success".
    • Overrides optimistic completion claims when --job-status is non-"success" ("failure", "cancelled", etc.), recording verdict=<status> and note="job <status> before completion (intended: <note>)".
  • .github/workflows/shepherd-{board,dup,rebase}.yml:
    • Bound all if: always() W7 session log steps to --verdict "ok" and --job-status "${{ job.status }}".
  • tools/test_shepherd_gate.py:
    • Added W7LogOutcomeTests (4 unit tests covering success, failure, cancelled, and omitted job_status).
    • Added WorkflowWorkspacePaths.test_always_w7_session_logs_bind_job_status scanning .github/workflows/shepherd-*.yml so no if: always() session-log step can omit --job-status "${{ job.status }}".

Verification

python3 -m unittest discover -s tools -p test_shepherd_gate.py -v
python3 tools/check_test_registration.py
python3 tools/check_conflict_markers.py
python3 tools/check_guarantees.py
python3 tools/check_claims_links.py

Fixes #4499

@github-actions github-actions Bot added the bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) label Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify())

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tools/shepherd: W7 if: always() session-log steps record verdict='ok' on failed workflow runs

1 participant