fix: auto authority under lock; strict blocked_indices (#31/#32 follow-up) - #33
Merged
JustinJLeopard merged 1 commit intoAug 10, 2026
Merged
Conversation
…_indices types (#31/#32 follow-up) PR #31 P1s (Codex 2238): - run(auto=...) is now AUTHORITATIVE: exports JUSTAI_AUTO_MODE='1'/'0' for the whole run, so explicit auto=False overrides an inherited '1' at the point the checkpoint actually reads it; exact prior state restored on every return path. - Env-dependent run serialized under a reentrant lock: overlapping runs cannot interleave save/restore and corrupt the shared variable; nested runs on the same thread still work. - RED-first effect tests: inherited-1 + explicit-false; auto-true -> nested auto-false; two overlapping runs with in-flight + final-state observations. PR #32 P2 (Codex 2250): - _normalize_blocked_indices: only None means omitted; falsy malformed values (False, 0, '', [], ()) and unsupported iterables now raise ValueError instead of silently meaning 'nothing blocked'. - RED-first tests: parametrized malformed rejection; None/empty/valid semantics. RED verified pre-fix (4 auto + 8 P2 failures); full suite 521 passed + 14 subtests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VPortjb8U5oteKxppGuVDQ
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Follow-up fix to harden orchestration “auto mode” behavior and dependency-indexing validation, addressing prior review findings from PRs #31 and #32. It makes auto authoritative for checkpoint reads (without env leakage or concurrency races) and tightens blocked_indices normalization to reject malformed/unsupported inputs rather than silently treating them as “nothing blocked.”
Changes:
- Serialize
JUSTAI_AUTO_MODEsave/set/restore for the fullrun()execution under a re-entrant lock; export"1"forauto=Trueand"0"forauto=False, restoring the exact prior state afterward. - Enforce strict type discipline in
_normalize_blocked_indices: onlyNonemeans “omitted”; non-set/dictinputs now raiseValueError. - Add regression tests covering explicit-false authority, nested runs, overlapping runs, and
blocked_indicestype/normalization behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
justai/orchestrator.py |
Adds _RUN_ENV_LOCK and scopes JUSTAI_AUTO_MODE under lock for the entire run with exact restoration. |
justai/agent_dispatch.py |
Tightens _normalize_blocked_indices to treat only None as omitted and reject unsupported types early. |
tests/test_auto_mode_scope.py |
Adds tests for authoritative auto=false behavior, nested runs, lock holding, and overlapping run serialization. |
tests/test_completion_integrity.py |
Adds tests asserting strict blocked_indices type/normalization rules. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bounded follow-up preserving both outstanding items per Codex 2238/2250 reviews.
PR #31 P1s — explicit-false authority + concurrent env restoration:
run()exportsJUSTAI_AUTO_MODE='1'/'0'for the whole run under a reentrant lock; exact prior restored on every path.PR #32 P2 —
_normalize_blocked_indicestype discipline:None= omitted; falsy malformed (False, 0, '', [], ()) and unsupported iterables raiseValueError.Evidence: RED pre-fix (4 auto + 8 P2 failures) → GREEN; full suite 521 passed + 14 subtests.
Reviewer: Desktop Codex (exact-head review per writer-lease protocol).
🤖 Generated with Claude Code
https://claude.ai/code/session_01VPortjb8U5oteKxppGuVDQ