Repository navigation
host: the diagnostics report never says whether its own log file could be written - #2384
Conversation
28d8e64 to
d38a93f
Compare
`leafRefusedNow` was cleared only when an append landed, so the failure branch left it as the first refusal had set it: a host whose linked leaf became a plain `0444` file met `EACCES` on the next append while the report still said `not written (not a plain file of its own)` -- a claim about a file the leaf no longer is. The flag now starts each attempt false and `refuseLeaf()` sets it again, so the line describes the last attempt: a `0444` leaf reads `not written (EACCES)`, a leaf that lands reads `recording`, and a leaf that is a link reads the guard's sentence. `refusedLeaf` and its one stderr line per host are untouched (ThinkFlowLab#2089), and `clear()` keeps its three answers (ThinkFlowLab#2364).
d38a93f to
442e2fe
Compare
|
@Birfy — ready for a Verdict on this tip:
Please answer with |
|
Verdict: PASS at 442e2fe Ran at this tip: CI at this head. 14 success + 1 failure on Red first. With What I read. No conclusion named this tip before this one. |
Fixes #2383
Owner: Dev-1
Reviewer: Birfy
Claim-Id: ed1a3c323b00419480add1d6fd531964
Branch: dev/1-diag-log-write-failure
Tip: 442e2fe
Tree: 0abd306775432c5806481d9abc5dc466a373d57b
Base: 1848d0d
Diff: 6 files, +393/−9 (hand-written 4 files, +189/−3; generated 2 files, +204/−6)
Tier: T3
why:
core/test/diagnostics.test.jsmatches/\.(only|skip)\(/(the root-onlyt.skipof the 0444 leaf case); basis:diagnostics.js=T2, test/changelog/patches=T1,docs/subsystems/core-host.md=T0; 192 changed lines in 4 non-generated files.What changed
The report behind Settings → Feedback's Report on GitHub never said that this host's own log file could not be written. The reason was already computed for stderr (
fileFailure,refusedLeaf) and never reachedfacts()orreportMarkdown(), so a bundle could list recent errors while saying nothing about the file holding them.The report now carries that one fact, in the shape the
state journal:line already has (#2134):diagnostics log: recordingwhile appends land,not written (<code>)after an append the host could not make, andnot written (not a plain file of its own)when the leaf guard refused the write (#2089, so a link or another file's second name is named as the refusal it is and never as a folder). A host whose log is off (diagnosticsFile: false) adds no line at all — the answer is not "not written", there is no file to write.The value describes the last append attempt, not the first refusal. The stderr refusal is a latch — one line per host however many entries the guard drops (#2089) — so
refusedLeafnever clears. A report reading it would keep sayingnot written (not a plain file of its own)after the host put a plain file back and the next entry landed in it, or after the leaf became a plain0444file whose append fails for a different reason; either way it would describe a file the leaf no longer is.leafRefusedNowis cleared when an attempt starts and set again by a refusal,fileFailureis cleared by the append that lands, and the report reads both. So a leaf that is still a link reads the guard's sentence, a plain0444leaf readsnot written (EACCES)even after an earlier refusal, and a leaf that landed readsrecording; the latch keeps its single stderr line.Unchanged, and the point of the slice:
clear()'s three states (absent/kept/truncated) and #2364's guarantee that a real truncate failure is named on exactly one[ds-bot] diagnostics log not truncated: EACCESstderr line.core/src/client/feedback.js,core/client.jsandpatches/ds-bot/0008are untouched — the client's sentences are another change's surface.Docs:
docs/subsystems/core-host.md, at the end of the diagnostics-log bullet, gets the sentence that says the report names whether that same file is being written, with the three values, the no-line case, and that the value follows the last append attempt while the guard's stderr line stays one per host, linked to this issue.Tests — red first
On the base with only
core/test/diagnostics.test.jsfrom this branch:44 tests / 41 pass / 3 fail / 0 cancelled.not ok 14,15and16each diff+ undefinedagainst the expectednot written (EACCES),not written (not a plain file of its own)andrecording; the runner itself printed[ds-bot] diagnostics log is not a plain file of its own; nothing was written thereon stderr while the report carried nothing.The first precision case has its own red at the tree before its commit, with only that case taken:
1 test / 0 pass / 1 fail. The assertion isreport.facts.diagnosticsLog:+ 'not written (not a plain file of its own)'against- 'recording', while the leaf already held the one line that landed in it and the file behind the old link kept its bytes.The second precision case has the same shape: a link refused, then the leaf replaced by a
0444plain file whose append fails, red at the tree before this commit with only that case taken:1 test / 0 pass / 1 fail. The assertion isreport.facts.diagnosticsLog:+ 'not written (not a plain file of its own)'against- 'not written (EACCES)'.After the fixes:
core/test/diagnostics.test.js→46 tests / 46 pass / 0 fail / 0 cancelled.Ran
TZ=UTC ARCH_DOCS_BASE=1848d0df npm run verify→ green; 4794 tests (2807 core + 570 social + 132 tree + 140 timeline + 411 workflow + 671 root scripts/policy + 37 interop + 26 live-e2e), 0 fail, 0 cancelled;arch-docs: OK (6 changed file(s))node scripts/ds-bot-patches.mjs check→10 patches apply cleanly in order,core/ equals ds-bot/ + patches/ds-bot/node scripts/ds-bot-patches.mjs canonical→patches/ds-bot/ is what generate writes (generate is a no-op)node scripts/ds-bot-patches.mjs generatetwice → exit 0, identical patch hashes, clean worktreenode core/scripts/build-client.mjs --check→ exit 0node .github/scripts/changelog.mjs check→20 fragment(s) … well formednode .github/scripts/check-empty-catch.mjs→ exit 0node .github/scripts/check-mojibake.mjs --check→ exit 0cd core && npm run lint→ exit 0Not run
index.jsand nosrc/host/wiring beyond one module's own facts)packagejob (pack check, typecheck, actionlint) and the merge queue — no queue action was taken.Checkpoint
{
"pr": 2384, "claim": "Dev-1", "issue": 2383,
"summary": "The diagnostics report now says whether FlyBot's own error log is being written: facts() carries diagnosticsLog and the markdown prints a diagnostics log line in the state journal's shape — recording, not written (
), or not written (not a plain file of its own); a log-off host adds no line. The value describes the last append attempt: a landed append reads recording, a plain 0444 leaf reads EACCES even after an earlier refusal, and a link reads the guard sentence. The one-line stderr refusal stays a per-host latch (#2089); clear()'s three states and #2364 are untouched.","files": ["core/src/host/diagnostics.js", "core/test/diagnostics.test.js", "docs/subsystems/core-host.md", "changelog.d/2383-diag-log-write-failure.fixed.md", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0007-version-and-tooling.patch"],
"checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=1848d0df npm run verify", "result": "green", "at": "442e2feb14d9ca9a77dca467e9129b71723e82bb" },
"next": "none — ready for review"
}