Repository navigation
host: a Clear with no log on disk prints "not truncated: ENOENT" while the window says Cleared - #2380
Conversation
ENOENT from the truncate means the folder is not there, so there was nothing on disk to empty: the answer is already `absent` and the window reads "Cleared the error log.". Printing "not truncated" for it was a false alarm that reached support bundles and could not be told apart from a leaf that really refused the truncate. Only a non-ENOENT code prints the line now, on exactly one line, and ThinkFlowLab#2364's guarantee is unchanged. Docs-not-needed: the core-host page already says `absent` means nothing was on disk to clear and names the one line for a refused leaf (`EACCES`); it never described an ENOENT line, so the sentence it writes is unchanged.
|
@Birfy — review request for the queue (one comment, this tip only).
Request: a formal Verdict: PASS naming The contract this changes, in one line: Evidence to re-run if you want it: on clean base After the fix the same file is 41/41 and the two #2364 regression cases stay green (a Documentation: unchanged on purpose and stated in the body — |
|
Verdict: PASS at f70a950 Ran at this tip: Red first (base The single failure is Review at the tip:
Not run: Reviewer: Reviewer Checkpoint{
"pr": 2380,
"claim": "Dev-1",
"issue": 2379,
"summary": "Review of the Clear-on-a-home-with-no-log fix. The host function now answers 'absent' and stays silent for ENOENT, and only a leaf that exists and refuses the truncate answers 'kept' with one EACCES line; #2364's guarantee is unchanged. Both halves are pinned by tests that capture console.error themselves. At f70a9506 the changed test file is 41/41 green, and swapping the base host file back turns it into 40/1 with the ENOENT failure. Tip checks are green; a PASS stands at this sha.",
"files": ["core/src/host/diagnostics.js", "core/test/diagnostics.test.js", "changelog.d/2379-clear-enoent-quiet.fixed.md"],
"checks": { "ran": "TZ=UTC node --import ./test/harness-resolve.mjs --test test/diagnostics.test.js (green 41/41; red-first 40/1)", "result": "green", "at": "f70a9506621275b24483992f3dba8b34c402e5da" },
"next": "PASS posted at this tip; Reviewer enqueues through the merge queue."
} |
Fixes #2379
Branch: dev/1-clear-enoent-quiet
Owner: Dev-1
Claim-Id: a575b70efc6a44c6bd2eba764db93030
Reviewer: Birfy
Tip: f70a950
Tree: 095d1c2b5497546a68b5446cb2f846f5175c5859
Base: 205bd44
Diff: 5 files, +115/−12
Tier: T3
why:
core/test/diagnostics.test.js: /\.(only|skip)\(/(thet.skip('root truncates a leaf without its write bit')line);core/src/host/diagnostics.jsis T2 by path, the rest T1What changed
Settings → Feedback's Clear on a home whose
logs/folder does not exist used to print[ds-bot] diagnostics log not truncated: ENOENTon the host's stderr while the window saidCleared the error log.— one click, two opposite reports, and the line went into support bundles where it could not be told apart from a leaf that really refused the truncate. The repository's own "no log folder" case (core/test/diagnostics.test.js) asserted{leaf:'absent',rotated:'none'}and passed while printing that line.absentvskept, in one line:ENOENTmeans there was nothing on disk to empty, soclear()answers{leaf:'absent',rotated:'none'}and prints nothing (the window'sCleared the error log.is what happened); any other code means the answer wanted to clear and could not, so it answers{leaf:'kept',…}, prints exactly one[ds-bot] diagnostics log not truncated:line carrying that code (EACCESfor0444), and leaves the bytes alone.The
0444leaf is unchanged: exactly one[ds-bot] diagnostics log not truncated: EACCESline,{leaf:'kept',rotated:'none'}, bytes kept — #2364's guarantee is not weakened.core/src/client/feedback.jsis untouched, and so iscore/client.js/patches/ds-bot/0008-client-bundle.patch.The two tests now pin both halves: the no-log Clear asserts
{leaf:'absent',rotated:'none'}with zero capturedconsole.errorlines and nologs/folder created, and the0444Clear keeps its one-lineEACCESassertion.console.erroris captured in the test itself; no production code was changed to make it testable.Verification at the tip
Verified tree: 095d1c2b5497546a68b5446cb2f846f5175c5859 — the push path rebuilt the head f70a950 from this same tree, and only that tree is what was checked here.
Ran:
205bd44fcheckout with only the new tests:core/test/diagnostics.test.js→41 tests / 40 pass / 1 fail;not ok 40 - a clear with no log on disk stays quiet/a Clear with nothing to empty does not claim it could not truncate/+ '[ds-bot] diagnostics log not truncated: ENOENT'vs- []41 / 41 pass / 0 failTZ=UTC ARCH_DOCS_BASE=205bd44f npm run verify→ exit 0, 4786 tests / 4786 pass / 0 fail / 0 cancelled,arch-docs: OK (5 changed file(s))node scripts/ds-bot-patches.mjs check→ exit 0,10 patches apply cleanly in order,core/ equals ds-bot/ + patches/ds-bot/node scripts/ds-bot-patches.mjs canonical→ exit 0,generate is a no-opnode scripts/ds-bot-patches.mjs generatetwice → exit 0, patch sha256 identical both runs, working tree cleannode core/scripts/build-client.mjs --check→ exit 0node .github/scripts/changelog.mjs check→ exit 0,18 fragment(s) well formednode .github/scripts/check-empty-catch.mjs→ exit 0;node .github/scripts/check-mojibake.mjs --check→ exit 0, 0 occurrences of U+FFFDnpm --prefix core run lint→ exit 0 (part ofverify)Not run: the live endpoint (
GET /api/diagnostics+ Clear) against a running instance — no instance was started for this slice; the host function and the window's note are covered by the two unit tests above. No merge queue run was attempted.Scope:
core/src/host/diagnostics.js,core/test/diagnostics.test.js,changelog.d/2379-clear-enoent-quiet.fixed.md, plus the two regenerated patchespatches/ds-bot/0001-core-fixes.patchandpatches/ds-bot/0007-version-and-tooling.patch. Nothing else.Docs-not-needed:
docs/core-host.mdalready saysabsentmeans there was nothing on disk to clear (not a refusal) and names the one line a refused leaf prints (EACCES); it never described an ENOENT line, so no documentation sentence changes with this fix.Checkpoint
{ "pr": 2380, "claim": "Dev-1", "issue": 2379, "summary": "Clear on a home with no log file no longer prints `[ds-bot] diagnostics log not truncated: ENOENT`: the truncate's ENOENT means there was nothing on disk to empty, so the host stays silent and the window's `Cleared the error log.` is what happened. A leaf that is there and refuses the truncate (`0444` → `EACCES`) still prints exactly one line and still answers `leaf: 'kept'`, so #2364's guarantee holds. Both halves are pinned by tests that capture `console.error` themselves, and the two affected patches are the output of `generate`.", "files": ["core/src/host/diagnostics.js", "core/test/diagnostics.test.js", "changelog.d/2379-clear-enoent-quiet.fixed.md", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0007-version-and-tooling.patch"], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=205bd44f npm run verify; ds-bot-patches check/canonical; generate x2; build-client --check; changelog check; check-empty-catch; check-mojibake", "result": "green", "at": "f70a9506621275b24483992f3dba8b34c402e5da" }, "next": "none — ready for review at the pushed tip" }