Skip to content

[sentry:7854620512] Implemented the saved plan. StrataProcessJournal.open no longer lets a raw filesystem error escape core startup: the three root-preparation calls (`mkdir(root, { recurs - #128

Open
Ooooze wants to merge 1 commit into
mainfrom
codex/sentry-fix/7854620512
Open

Ooooze wants to merge 1 commit into
mainfrom
codex/sentry-fix/7854620512

Conversation

@Ooooze

@Ooooze Ooooze commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Implemented the saved plan. StrataProcessJournal.open no longer lets a raw filesystem error escape core startup: the three root-preparation calls (mkdir(root, { recursive: true, mode: 0o700 }), lstat(root), realpath(root)) are wrapped in a try/catch that rethrows an existing AtomicCoreError unchanged (so corrupt() keeps its message) and otherwise throws AtomicCoreError('IO_ERROR', 'Strata process journal is unavailable; GPU ownership remains blocked.', undefined, { cause }). Fatal startup and the GPU-ownership guarantee are unchanged; the boundary now carries a wire code, and errorChain keeps the native error as cause. Verified in this Linux sandbox: the carried regression test src/runtime/strata/strata-process-journal-open.test.ts (link to a missing target as the journal root) passes with the patch (code: 0, 1/1, 'reports a journal root that cannot be prepared as a coded core error'); on base it failed with the raw Error: ENOENT: no such file or directory… escaping, per the saved evidence. Added ADR docs/decisions/2026-11-20-code-strata-journal-root-failures.md and its INDEX bullet. Telemetry consequence recorded in the ADR: the startup event's error_code tag moves from ENOENT to IO_ERROR and the exception type from Error to IO_ERROR; cause_code stays ENOENT, failure_category/failure_reason stay unknown (neither ENOENT nor IO_ERROR is mapped), severity stays fatal, and report frequency is unchanged. The host-specific Windows trigger (journal root left as a junction or link to a missing target) is not reproduced here; only the untyped escape is.

Evidence:
Event c442ccc3be9347dfa82094ead74893ff (atomic-chat-core@0.24.7, dist 2072fa6) and a02e4f45b0164b0eb737347fd468f3d4 (atomic-chat-core@0.24.4, dist b54b603): fatal core startup: unknown, error_code=ENOENT, cause_code=ENOENT, failure_category=unknown, failure_reason=unknown, os.name win32, x64.
Both stacks: src/host/app-daemon.ts:165 runAppDaemon → src/core/create.ts:872/880 createAtomicCore → src/core/strata.ts:93/94 wireStrata → src/runtime/strata/strata-process-journal.ts:125 open.
Base src/core/strata.ts: const root = join(await realpath(layout.core.dir), 'strata') then const journal = await StrataProcessJournal.open(root, 'strata-v1') — no try/catch, so any failure in open aborts wireStrata and core startup.
Base src/runtime/strata/strata-process-journal.ts open: await mkdir(root, { recursive: true, mode: 0o700 }), if (!(await lstat(root)).isDirectory()) corrupt(), const canonical = await realpath(root) were the only unguarded filesystem calls; every later step maps failures through corrupt() (IO_ERROR).
src/contracts/errors.ts: AtomicCoreError(code, message, details?, options?) passes { cause } to Error, so errorChain/cause_code still see ENOENT; IO_ERROR is in ERROR_CODES.
src/telemetry/policy.ts REPORTABLE_CODES includes ENOENT, so the base event reports error_code=ENOENT; src/telemetry/diagnostics.ts OPERATIONAL maps neither ENOENT nor IO_ERROR, so classifyFailure returns unknown/unknown before and after the patch.
src/telemetry/diagnostics.ts reportDiagnostic maps source startup to { component: 'core', operation: 'startup' }; src/telemetry/reports.ts makes every startup error fatal, so the early-phase event and grouping behaviour are unchanged apart from the error code tag and exception type.
Patch applied to src/runtime/strata/strata-process-journal.ts (root preparation wrapped; existing AtomicCoreError rethrown).
Check run on the patch: src/runtime/strata/strata-process-journal-open.test.ts → code 0, 1 test passed, 'reports a journal root that cannot be prepared as a coded core error'. The same test failed on base with expected Error: ENOENT: no such file or directory,… to be an instance of AtomicCoreError (saved evidence from the diagnose phase).

Regression tests: src/runtime/strata/strata-process-journal-open.test.ts

Full CI and human review are required.

Report: http://127.0.0.1:8080/tenants/707d0855-80ab-4e1f-a156-f1c4546cbf52/runs/4a81a71f-9b3b-4059-b447-52a6e3ae0a51

Sentry: https://atomic-chat.sentry.io/issues/7854620512/

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