Skip to content

Tests: read the live ledger through ledger_records (CI flake); AGENTS.md's worktree gate puts the venv on PATH - #726

Merged
LoopGlitch26 merged 1 commit into
mainfrom
agent/ledger-complete-lines
Nov 11, 2026
Merged

LoopGlitch26 merged 1 commit into
mainfrom
agent/ledger-complete-lines

Conversation

@LoopGlitch26

Copy link
Copy Markdown
Member

What and why

tests/test_capture.py::Proxy::test_hooks_disabled_mid_session_detected failed on py3.12 ubuntu (#719's run 42985927432) with JSONDecodeError: Unterminated string. Its events() parsed ledger.jsonl line by line while the signer was still appending, so a half-written last line reached json.loads. Four other tests read the live ledger the same way (test_known_gaps.py, and three in test_v02.py).

tests/factories.py already has ledger_records(home), which reads through tracekit.ledger.read_records and skips a line that doesn't parse. All five now use it. No product code changes.

AGENTS.md: the worktree gate command ran test-ts with the system python3. The TypeScript tests use $TRACEKIT_PYTHON, else python3 from PATH (sdk/typescript/test/v2.test.mjs L18), so the command now puts the venv first on PATH. Reported by the 11-11 upkeep run.

How I ran it

pytest tests/test_capture.py tests/test_known_gaps.py tests/test_v02.py: 86 passed, 2 skipped, 10 xfailed. pyflakes is clean on the three files. The race needs the signer to be mid-write when the test reads, so there's no deterministic reproduction; the fix removes the parse of an unfinished line.

…ee gate puts the venv on PATH

Five tests parsed ledger.jsonl line by line while the signer appended to it,
so a half-written last line failed json.loads (test_capture's
test_hooks_disabled_mid_session_detected on py3.12 ubuntu, CI run
42985927432). factories.ledger_records already skips a line that doesn't
parse; use it.

The worktree gate command ran test-ts with the system python3 (TS tests use
$TRACEKIT_PYTHON, else python3 from PATH).

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
@LoopGlitch26
LoopGlitch26 merged commit a68af55 into main Nov 11, 2026
59 of 60 checks passed
@LoopGlitch26
LoopGlitch26 deleted the agent/ledger-complete-lines branch November 11, 2026 17:38
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