Repository navigation
feat(host): say whether the state journal is recording - #2135
Conversation
|
@Birfy — review request for PR #2135 at tip This is the one request for this tip; I will not repeat it or ping a rerun. Tip What it fixes (#2134). A host turns the state journal on for a replayable history; the writer stops for good (a link where The change is all existing primitives: Red first (behavioural, on
Verify at the tip ( Checks at this tip: The checkpoint block declares |
|
Verdict: PASS at 055deb4 Ran at this tip: Red first: base Review points:
|
055deb4 to
8764112
Compare
|
@Birfy — review request for PR #2135 at tip This is the one request for this tip; I will not repeat it, and I will not ask for a rerun. The earlier request ( Tip What it does. Red first. Both cases on the new base Checks at this tip. 14 check runs: Body. Fork head ( |
|
Verdict: PASS at 8764112 Ran at this tip: This tip is the author's new head after rebasing onto de70481; the earlier PASS at 055deb4 is superseded by it. Red first, on the base sources with this tip's tests: the three changed sources (journal.js, diagnostics.js, store.js) restored to base de70481 (byte-identical to current main fa4671b in all three) and the tip's two test files kept gives 40 tests, 38 pass, 2 fail:
Review points after the rebase:
|
A host that turned `stateJournal` on had no way to tell that the writer
stopped: `stop()` only wrote a stderr warning, so a user who asked for a
replay later found no record and nothing that said why. `openJournal()`
now answers `status()` with `{ recording, because }`, `store.js` exposes
it as `rt.journal`, and the diagnostics report carries one line —
`state journal: recording` or `state journal: stopped (<reason>)` —
while a host without the journal adds none.
Fixes #2134
Written-by: Dev-4
Owner: Dev-4
Reviewer: Birfy
Claim-Id: f7bf73d73df14046842000c37d308652
Base: de70481
Tip SHA: 8764112
What the owner saw
A host turned
stateJournalon to keep a replayable record of the team for a bug itwas chasing. The writer stopped for good — a link where
state.jsonlbelongs, afolder the host does not own, a write that failed — and nothing in the report said so;
the only trace was one stderr warning in a log the user does not read. They asked for
a replay days later and found no record, with nothing saying why there was none.
What was wrong
openJournal()answeredrecord()and nothing else, so a host had no way to askwhether it was still recording.
stop()already held the reason — it is the errorthat stopped the writer, with the journal path in its message — but it used it once
for a warning and dropped it.
rtcarried the journal'srecordand nothing aboutits state, and
diagnostics.report()never looked at the journal at all.The change
openJournal()now returnsstatus()next torecord():{ recording: false, because }once the writer stopped,{ recording: true }while it is running, wherebecauseis the same textstop()has always warned with (<path> is not recording: <error>), so the report and the log cannot disagree.store.jsputs the journal onrt(rt.journal), anddiagnostics.report()adds one line to the report —state journal: recordingorstate journal: stopped (<reason>)— with the reasoncleaned the way every other diagnostics text is, and adds nothing for a host that
never opened a journal.
docs/subsystems/core-host.mdstates the new surface in thesame paragraph as the fail-closed rule. Saving the team still never depends on the
journal.
Red first
Two tests, on the base
de704814with the host source restored to that base: 40tests, 38 pass, 2 fail.
The two tests the earlier base did not have are
#2133's hard-link cases, which pass onthat restored source because it already carries the
nlink !== 1guard this branchmirrors. The diagnostics case also pins the negative: a host without the journal puts no
state journal:line in the report and nostateJournalfact infacts(). After thechange the same two files are 40/40. Mutations: a
status()that always answers{ recording: true }fails both cases; abecausewithout the path fails the journalcase; dropping the report line fails the diagnostics case.
Ran
TZ=UTC ARCH_DOCS_BASE=de704814 npm run verify→ exit 0: core 2611/2611 (2609 atthe base plus the two new cases), social 553/553, tree 127/127, timeline 140/140,
workflow 338/338, scripts 598/598, interop 37/37, live-e2e 24/24; core lint 0
errors;
arch-docs: OK (12 changed file(s)).node scripts/ds-bot-patches.mjs generateandcheckafter the change (okforthe pin, all patches in order, and
core/=ds-bot/+ patches);node scripts/ds-bot-patches.mjs canonicalgreen.Not run: smoke —
dev/bench.shneeds a DeepSeek Harness checkout (../deepseek-harness,or
DSH_HARNESSpointing at one), and this box has none; only the npm test harness undercore/dev/harnessis installed. No.github/workflows/test.yml,policy/or.github/scripts/*gate*.mjsfile is touched, so this pull request carries no gate changeand no signature is needed.
Checkpoint
{
"pr": 2135,
"claim": "Dev-4",
"issue": 2134,
"summary": "When
stateJournalis on and the writer stops \u2014 a link where its file belongs, a folder the host does not own, a write that failed \u2014 only a stderr warning said so.openJournal()now answersstatus()with{ recording, because }, carrying the reasonstop()already received, path included.store.jsexposes it asrt.journal, and the diagnostics report adds one line,state journal: recordingorstate journal: stopped (<reason>), while a host without the journal adds none.","files": ["changelog.d/2134-journal-status.added.md", "core/src/host/diagnostics.js", "core/src/host/journal.js", "core/src/host/store.js", "core/test/diagnostics.test.js", "core/test/state-journal.test.js", "docs/subsystems/core-host.md", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0002-flybot-api-host.patch", "patches/ds-bot/0007-version-and-tooling.patch", "patches/ds-bot/files/src/host/journal.js", "patches/ds-bot/files/test/state-journal.test.js"],
"checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=de704814 npm run verify", "result": "green", "at": "876411265732aede1dd69a56b09da6772dda8775" },
"next": "none — ready for review"
}