Repository navigation
[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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented the saved plan.
StrataProcessJournal.openno 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 existingAtomicCoreErrorunchanged (socorrupt()keeps its message) and otherwise throwsAtomicCoreError('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, anderrorChainkeeps the native error ascause. Verified in this Linux sandbox: the carried regression testsrc/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 rawError: ENOENT: no such file or directory…escaping, per the saved evidence. Added ADRdocs/decisions/2026-11-20-code-strata-journal-root-failures.mdand its INDEX bullet. Telemetry consequence recorded in the ADR: the startup event'serror_codetag moves fromENOENTtoIO_ERRORand the exception type fromErrortoIO_ERROR;cause_codestaysENOENT,failure_category/failure_reasonstayunknown(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')thenconst journal = await StrataProcessJournal.open(root, 'strata-v1')— no try/catch, so any failure inopenabortswireStrataand core startup.Base
src/runtime/strata/strata-process-journal.tsopen: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 throughcorrupt()(IO_ERROR).src/contracts/errors.ts:AtomicCoreError(code, message, details?, options?)passes{ cause }toError, soerrorChain/cause_codestill see ENOENT;IO_ERRORis inERROR_CODES.src/telemetry/policy.tsREPORTABLE_CODESincludesENOENT, so the base event reportserror_code=ENOENT;src/telemetry/diagnostics.tsOPERATIONALmaps neitherENOENTnorIO_ERROR, soclassifyFailurereturnsunknown/unknownbefore and after the patch.src/telemetry/diagnostics.tsreportDiagnosticmaps sourcestartupto{ component: 'core', operation: 'startup' };src/telemetry/reports.tsmakes 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; existingAtomicCoreErrorrethrown).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 withexpected 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/