Skip to content

fix(checkpoints): import shared helpers by location - #20

Merged
yuema137 merged 2 commits into
mainfrom
fix/checkpoints-import
Sep 10, 2026
Merged

yuema137 merged 2 commits into
mainfrom
fix/checkpoints-import

Conversation

@yuema137

Copy link
Copy Markdown
Owner

Why

checkpoints.py reaches continuity.py through a bare from continuity import …, which works only because the script's own directory happens to be sys.path[0]. Under python3 -P that entry is absent:

ModuleNotFoundError: No module named 'continuity'

For a hook this is worse than an ordinary failure. The import sits above main()'s try, so the usual fail-open never runs: the process exits non-zero without printing the empty result a hook is required to return, and the host sees a broken handler rather than a quiet one.

standards.py already avoided this by inserting its own directory explicitly, and recorded the older form as debt not to imitate. Two lines pay it.

Validation

Ran 166 tests ... OK (skipped=1); --check PASS on all five checks.

A new test runs all three runtime scripts under python3 -P, so a fourth cannot reintroduce this.

Also: the backward update the workflow asks for

The rollout record now lists the standards work (#13, #15, #17, #18, #19), the portable registration (#11) and the Codex trust finding (#16), and keeps the two open items visible: PostToolUse delivery under an authenticated turn is still not directly observed, and merge-guard is still unimplemented.

It also restates the standing instruction to keep this lightweight, which already changed one decision in flight — Step 4b went from five commits to two by dropping a Stop mapping onto an event that does not mean what the trigger meant.

🤖 Generated with Claude Code

https://claude.ai/code/session_016cCs5DdUjLDkP8V3Z5x6XH

yuema137 and others added 2 commits September 9, 2026 22:24
…ath[0]

checkpoints.py reached continuity.py through a bare import that only works
because the script's own directory happens to be sys.path[0]. Under python3 -P
that entry is absent and the import raises ModuleNotFoundError.

For a hook that is worse than an ordinary failure. The import sits above main()'s
try, so the usual fail-open never runs: the process exits non-zero without
printing the empty result a hook is required to return, and the host sees a
broken handler rather than a quiet one.

standards.py already avoided this by inserting its own directory explicitly, and
recorded the older form as debt not to imitate. This pays that debt with the same
two lines, and a test now runs all three runtime scripts under -P so a fourth
cannot reintroduce it.

The planning records are updated as the workflow requires after a merge: the
rollout record now lists the standards work, the portable registration and the
Codex trust finding, keeps the two open items visible, and restates the operator's
standing instruction to keep this lightweight, which already changed one decision
in flight.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016cCs5DdUjLDkP8V3Z5x6XH
-P and PYTHONSAFEPATH arrived in Python 3.11, and 3.9 answers -P with
"Unknown option", which failed both 3.9 jobs while both 3.12 jobs passed.

Skipping is correct rather than a weakening: without a safe-path mode there is no
sys.path[0] to be absent, so the failure the test guards against cannot arise on
those interpreters. CI still runs it on 3.12.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016cCs5DdUjLDkP8V3Z5x6XH
@yuema137
yuema137 merged commit 3b4cdac into main Sep 10, 2026
4 checks passed
@yuema137
yuema137 deleted the fix/checkpoints-import branch September 10, 2026 03:53
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