Skip to content

fix: results check reads the env session as gate run does - #540

Merged
juzser merged 2 commits into
mainfrom
fix/results-check-env-session
Nov 4, 2026
Merged

juzser merged 2 commits into
mainfrom
fix/results-check-env-session

Conversation

@juzser

@juzser juzser commented Nov 4, 2026

Copy link
Copy Markdown
Owner

This fixes a follow-up gap in #533's envelope defaults.

Bug

bs results check passed {sessionId: flags.session} to checkPaperwork. When the session came from CLAUDE_CODE_SESSION_ID, that value was undefined. The preflight then silently skipped its session-scoped reads (judges, uiux, mcp override) and passed, while gate run in the same environment blocked. The preflight exists to name the same first defect the gate would.

The /bs do playbook review found this by driving the commands for real.

Change

  • runResultsCheck now resolves the session with effectiveSession(flags), as gate run does.
  • With neither flag nor env set, behaviour is unchanged.
  • I swept the other verbs that read flags.session raw. None of them makes a decision on it:
    • stats, db rebuild, lessons candidates, lessons compile and epic width read it as an optional "all sessions" scope.
    • uiux check and queue run already used the env session.
  • The usage.ts text and CHANGELOG are updated.

Tests

cliResultsCheck.test.ts gains 5 tests under "a session taken from CLAUDE_CODE_SESSION_ID". Three of them failed before the fix:

  • gate judges-outstanding;
  • gate uiux-visual-missing;
  • a coder mcp override read;
  • no flag and no env, for both the coder and the gate.

Verification

  • Full suite under heavy run: 10894 passed, 2 skipped.
  • typecheck, typecheck:test and biome at error level are clean.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juzser
juzser enabled auto-merge November 4, 2026 07:08
…-session

# Conflicts:
#	factory/orchestrator/src/usage.ts
@juzser
juzser merged commit ea0b3ee into main Nov 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant