Overview
autonomy_log_body() in scripts/spawn.py reads the live autonomy_log.md and copies lines until one starts with |---. That is the same "trust the live file's shape" pattern that made empty_body() stamp live registry entries into the public templates (#118) — it just has not fired yet.
Pre-existing; surfaced by the independent Codex review of #118. Sibling half of #121.
for line in lines:
kept.append(line)
if line.startswith("|---"):
break
Both failure modes reproduced against the real ledger
| hazard |
result |
| a task row inserted above the separator |
that row is copied into the template |
separator reformatted to | --- | (a cosmetic edit any markdown formatter makes) |
the break never fires — 231 live task records copied |
And the canary scan does not save us. A leaked row containing no dataset or person token returns zero hits — verified. The full-ledger case happens to be caught today only because some rows mention slacs1430 / B1938 / cosmos_web_ring. That is luck, not a guarantee, and it is precisely the reasoning that made the #118 leak invisible.
Fix
Same shape as #118: generate the schema header as a constant asset instead of parsing it out of the live ledger. No source bytes, no shape assumptions — the file is never opened.
The header is entirely generic (title, the prose explaining the log, the Outcome ∈ … legend, the table header and separator) and references only PyAutoBrain/AUTONOMY.md, which a fresh org has. The constant reproduces the currently-published bytes exactly, so this introduces no gratuitous template drift.
Detailed implementation plan
Affected Repositories
Branch Survey
| Repository |
Current Branch |
Dirty? |
| ./PyAutoMind |
main |
clean |
Suggested branch: feature/spawn-autonomy-log-generated
Implementation Steps
docs/pyautobrain/spawn_spec.md — state that the autonomy_log skeleton is GENERATED, not parsed, with the same wording discipline as rule 5 (edit spec first).
scripts/spawn.py — add AUTONOMY_LOG_TEMPLATE beside the other generated assets; replace autonomy_log_body()'s parse loop so it never reads src.
tests/test_spawn_privacy.py — extend test_generated_tree_contains_no_live_content fixtures with (a) a row above the separator and (b) a | --- | separator; both must still yield a clean template. Add a direct test that the function does not open the source.
Key Files
scripts/spawn.py — autonomy_log_body() (~line 535), generated-assets block
docs/pyautobrain/spawn_spec.md — Mind table rule 5
tests/test_spawn_privacy.py
Original Prompt
Click to expand starting prompt
draft/bug/pyautomind/spawn_autonomy_log_parses_live_bytes.md — split from the bundled instance-state prompt filed during the #118 review.
Overview
autonomy_log_body()inscripts/spawn.pyreads the liveautonomy_log.mdand copies lines until one starts with|---. That is the same "trust the live file's shape" pattern that madeempty_body()stamp live registry entries into the public templates (#118) — it just has not fired yet.Pre-existing; surfaced by the independent Codex review of #118. Sibling half of #121.
Both failure modes reproduced against the real ledger
| --- |(a cosmetic edit any markdown formatter makes)And the canary scan does not save us. A leaked row containing no dataset or person token returns zero hits — verified. The full-ledger case happens to be caught today only because some rows mention
slacs1430/B1938/cosmos_web_ring. That is luck, not a guarantee, and it is precisely the reasoning that made the #118 leak invisible.Fix
Same shape as #118: generate the schema header as a constant asset instead of parsing it out of the live ledger. No source bytes, no shape assumptions — the file is never opened.
The header is entirely generic (title, the prose explaining the log, the
Outcome ∈ …legend, the table header and separator) and references onlyPyAutoBrain/AUTONOMY.md, which a fresh org has. The constant reproduces the currently-published bytes exactly, so this introduces no gratuitous template drift.Detailed implementation plan
Affected Repositories
Branch Survey
Suggested branch:
feature/spawn-autonomy-log-generatedImplementation Steps
docs/pyautobrain/spawn_spec.md— state that the autonomy_log skeleton is GENERATED, not parsed, with the same wording discipline as rule 5 (edit spec first).scripts/spawn.py— addAUTONOMY_LOG_TEMPLATEbeside the other generated assets; replaceautonomy_log_body()'s parse loop so it never readssrc.tests/test_spawn_privacy.py— extendtest_generated_tree_contains_no_live_contentfixtures with (a) a row above the separator and (b) a| --- |separator; both must still yield a clean template. Add a direct test that the function does not open the source.Key Files
scripts/spawn.py—autonomy_log_body()(~line 535), generated-assets blockdocs/pyautobrain/spawn_spec.md— Mind table rule 5tests/test_spawn_privacy.pyOriginal Prompt
Click to expand starting prompt
draft/bug/pyautomind/spawn_autonomy_log_parses_live_bytes.md— split from the bundled instance-state prompt filed during the #118 review.