Repository navigation
databases/Frontier.root is stale (pre-#621, doubled-brace corruption); source of #866 false diagnosis #877
Copy link
Copy link
Open
Labels
priority/p1High priority - address soonHigh priority - address soonscope/quick-win< 4 hours, obvious solution< 4 hours, obvious solutiontype/bugDefect in existing functionality, needs fixDefect in existing functionality, needs fixworkstream/database-architectureDatabase format, migration, serializationDatabase format, migration, serialization
Description
Rationale
databases/Frontier.root is STALE and ships pre-#621 doubled-brace script corruption. Untouched since PR #594, its system.startup.startupScript does NOT compile as-shipped (carries pre-#621 damage signature: comment nodes with 0 proper 0xC7 markers, 74 literal "//", 61 ";;"). Virgin.root's copy is clean. The stale Frontier.root is almost certainly the source of the misleading "opcode-0" report in #866's original text (the false root-cause about codegen defects). ~13 test/tool scripts reference it (run_headless_tests.sh checks its v7 magic; bisect and CLI tests use it).
Current State
Stale copy identified (2026-08-10):
- databases/Frontier.root: last touched PR repl: collapse hybrid dispatch — set accepts_args=true on List/Jump menubar leaves #594 (pre-langstripstructuremarkers + oplangtextvisit round-trip drops a closing brace on multi-level outlines #621)
- system.startup.startupScript does NOT compile in place
- Pre-langstripstructuremarkers + oplangtextvisit round-trip drops a closing brace on multi-level outlines #621 corruption signature: 0 proper 0xC7 markers, 74 literal "//", 61 ";;"
- Virgin.root's copy is clean (post-langstripstructuremarkers + oplangtextvisit round-trip drops a closing brace on multi-level outlines #621, compiles fine)
References to stale copy:
- run_headless_tests.sh checks v7 magic number on Frontier.root
- bisect tests use it
- CLI tests reference it
- ~13 test/tool scripts depend on it
Impact:
- Stale scripts shipped
- Tests may be validating against corrupted state
- langscan comment-strip scanner ignored single-quoted char constants: 0xC7 inside 'x' literals corrupts scripts cumulatively on install (was misattributed to newScriptObject size/reinstall) #866's original false root-cause ("codegen destroys large scripts") was likely triggered by this stale copy's pre-langstripstructuremarkers + oplangtextvisit round-trip drops a closing brace on multi-level outlines #621 corruption
- Misleading diagnosis delayed root-cause isolation
Desired Outcome
Refresh databases/Frontier.root to current state:
- Rebuild from Virgin.root (make dist does this for dist/ — apply same to checked-in copy)
- OR re-evaluate whether checked-in copy should exist (CLAUDE.md says edits are local-only anyway)
- Verify: all scripts in Frontier.root compile and match Virgin.root post-langstripstructuremarkers + oplangtextvisit round-trip drops a closing brace on multi-level outlines #621 state
Recommendation
Option A (recommended):
- Run: make clean && make dist (rebuilds dist/Frontier.root)
- Copy to databases/Frontier.root:
cp dist/Frontier.root databases/Frontier.root - Commit the refreshed copy
- Verify: run_headless_tests.sh passes with new copy
Option B (structural):
- Remove checked-in databases/Frontier.root from repo
- Rebuild from Virgin.root at test time (make dist step)
- Update tests to use dist/Frontier.root or rebuild on the fly
- Rationale: CLAUDE.md says local edits only; checked-in copy is not the source of truth
Exit Criteria
- databases/Frontier.root is post-langstripstructuremarkers + oplangtextvisit round-trip drops a closing brace on multi-level outlines #621 (no doubled-brace corruption)
- system.startup.startupScript compiles in place
- All 13 test/tool scripts pass with refreshed Frontier.root
- run_headless_tests.sh validates magic number correctly
- Commit message notes refresh from Virgin.root (post-langstripstructuremarkers + oplangtextvisit round-trip drops a closing brace on multi-level outlines #621 baseline)
Related Context
- Found by: langscan comment-strip scanner ignored single-quoted char constants: 0xC7 inside 'x' literals corrupts scripts cumulatively on install (was misattributed to newScriptObject size/reinstall) #866 investigation, 2026-08-10
- Related issues: langscan comment-strip scanner ignored single-quoted char constants: 0xC7 inside 'x' literals corrupts scripts cumulatively on install (was misattributed to newScriptObject size/reinstall) #866 (false root-cause from stale corruption), db.compactDatabase() SIGABRTs headless and corrupts source database in place on failure #854 (byte-level remanence), langstripstructuremarkers + oplangtextvisit round-trip drops a closing brace on multi-level outlines #621 (doubled-brace fix)
- Code: databases/Frontier.root, PR repl: collapse hybrid dispatch — set accepts_args=true on List/Jump menubar leaves #594 (last touch), PR langstripstructuremarkers + oplangtextvisit round-trip drops a closing brace on multi-level outlines #621 (fix)
- Damage signature: 0xC7 markers missing, 74 literal "//", 61 ";;"
- Impact on langscan comment-strip scanner ignored single-quoted char constants: 0xC7 inside 'x' literals corrupts scripts cumulatively on install (was misattributed to newScriptObject size/reinstall) #866: The stale copy's pre-langstripstructuremarkers + oplangtextvisit round-trip drops a closing brace on multi-level outlines #621 corruption likely triggered the false "newScriptObject destroys scripts" diagnosis
- Tests: run_headless_tests.sh, bisect, CLI tests, ~13 tool scripts depend on this file
Metadata
Metadata
Assignees
Labels
priority/p1High priority - address soonHigh priority - address soonscope/quick-win< 4 hours, obvious solution< 4 hours, obvious solutiontype/bugDefect in existing functionality, needs fixDefect in existing functionality, needs fixworkstream/database-architectureDatabase format, migration, serializationDatabase format, migration, serialization
Activity