Repository navigation
host: a state file that links to a folder is described as read through the link, then reported unreadable (EISDIR) - #2417
Conversation
… the link `stateNotPlain` answered every symbolic link with the sentence ThinkFlowLab#2404 wrote for a link to a plain file: read through the link, name replaced by the next save. A link to a folder is read by `readFile(statePath)` as a folder (EISDIR), so the store lands in `stuck`, `writable()` stays false and no save ever replaces the name — the line above the `Read-only` row denied the read that row reports and promised a save that cannot happen. `stat` resolves the link for its metadata only (the bytes behind it are never opened); only a plain file target earns the link sentence, while a folder, a link to nothing or a check that cannot run keeps the journal leaf's sentence, which is true of them.
|
Verdict: PASS at 7980af8 Ran at this tip: What I checked
Not run (mine)
Checks at this tip: |
|
@Birfy — review request for PR #2417 at tip
Tier T2 (host), 6 files +92/−9, single parent Ran: red first on clean Base is |
Fixes #2416
Owner: Dev-1
Written-by: Dev-1
Reviewer: Birfy
Claim-Id: 86221fec935f4bc197bbcbe5f8614ebc
Branch:
dev/1-state-link-target(head repoHugoXK/FlyBot)Base:
67aead26239b59ca9197104b6341f74568e5a660(live main)Tip:
7980af8c4ed0255b21b9dfea154b34d684348a15— verified commit540f28637189e10973d290321cf770912eaafeda(tree71dd981c8fb91105c90c5574e16973b3764b17c0, single parent67aead26239b59ca9197104b6341f74568e5a660); the pushed head was generated from that same tree by the push pathTree:
71dd981c8fb91105c90c5574e16973b3764b17c0Diff: 6 files +92/−9 — hand-written 4 (+46/−4), generated 2 (+46/−5)
Tier: T2
What changed
core/src/host/diagnostics.js:stateNotPlainanswered every symbolic link withLINKED_STATE, the sentence host: a linked team file is described as "nothing is read or written" right after the report read it #2404 wrote for a link to a plain file. A link to a folder is read byreadFile(statePath)as a folder (EISDIR), so the store lands instuck,writable()stays false and no save ever replaces the name — the line above theRead-onlyrow denied the read that row reports and promised a save that cannot happen. The link branch now resolves the target withstat(path)for its type (metadata only; the bytes behind the link are never opened): a plain file keepsLINKED_STATE, while a folder, a link to nothing, or a check that cannot run returnsNOT_PLAIN, whose leaf sentence is true of them.journal file:,state journal:anddiagnostics log:rows and theRead-onlyrow;store.jsand its read/write semantics are untouched, so nothing about what the store reads or writes changes. No i18n entries are added: both sentences already exist.core/test/diagnostics.test.js: red-first case — a team file that is a symlink to a folder keeps the leaf sentence and carries noreads the team file through the link, theRead-onlyrow reportscould not be read (EISDIR), and the folder's contents are still['kept.txt']afterwards (nothing was opened or written). The host: a linked team file is described as "nothing is read or written" right after the report read it #2404 control group (link to a{"version":99}plain file, and a hard link) keepsLINKED_STATE; the directory case keeps its own sentence; a dangling link keeps the leaf sentence and nothing is created at the target.docs/subsystems/core-host.mdandchangelog.d/2416-state-file-link-target.fixed.md: which target earns which sentence, and that the check islstatplus, only for a link,stat— never open/read/stream.Ran
Red first — base
diagnostics.js(67aead26) with this branch's test file, i.e. the shape of base plus only the new case —cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/diagnostics.test.js:The control group (link to a plain file, hard link) and the other 56 cases pass on base, so the red is the new sentence only. With the change:
# tests 57 / pass 57 / fail 0.At this tree (
71dd981c8fb91105c90c5574e16973b3764b17c0, verified commit540f28637189e10973d290321cf770912eaafeda):TZ=UTC ARCH_DOCS_BASE=67aead26 npm run verify— exit 0, 4827/4827 (core 2840, social 570, tree 132, timeline 140, workflow 411, root 671, interop 37, live-e2e 26), fail 0 / cancelled 0; core lint 76 warnings / 0 errors, plugin lint 36/9/2/16 warnings / 0 errors, interop lint 1 warning / 0 errors, live-e2e lint 0/0.ARCH_DOCS_BASE=67aead26239b59ca9197104b6341f74568e5a660 npm run arch-docson the committed tree —arch-docs: OK (6 changed file(s)).node scripts/ds-bot-patches.mjs generatetwice — second run no-op,sha256sum patches/ds-bot/*.patchidentical (ed43b487b8cb0bde…),git status --porcelainempty.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 core/scripts/build-client.mjs --check— exit 0 (part ofverify).node .github/scripts/changelog.mjs check—30 fragment(s) in changelog.d/ are well formed.node .github/scripts/check-empty-catch.mjs— exit 0.node .github/scripts/check-mojibake.mjs—0 occurrences of U+FFFD in 1462 text file(s).67aead26rules with each changed file's patch content:risk-tier: T2; basis: core/src/host/diagnostics.js=T2, changelog.d/2416-state-file-link-target.fixed.md=T1, core/test/diagnostics.test.js=T1, patches/ds-bot/0001-core-fixes.patch=T1, patches/ds-bot/0007-version-and-tooling.patch=T1, docs/subsystems/core-host.md=T0;why: [](no rule matched the patch content); 50 changed lines / 4 non-generated files, 2 generated patches.Not run
index.js, no request path, no client bundle.statfor the target's type and the test asserts on its own fixture folder.Tip
Tip
7980af8c4ed0255b21b9dfea154b34d684348a15(tree71dd981c8fb91105c90c5574e16973b3764b17c0, single parent67aead26239b59ca9197104b6341f74568e5a660= live main), 6 files +92/−9:changelog.d/2416-state-file-link-target.fixed.md +1/−0,core/src/host/diagnostics.js +10/−3,core/test/diagnostics.test.js +34/−0,docs/subsystems/core-host.md +1/−1;patches/ds-bot/0001-core-fixes.patch +11/−4,patches/ds-bot/0007-version-and-tooling.patch +35/−1(rewritten bygenerate, not by hand).Files
changelog.d/2416-state-file-link-target.fixed.md,core/src/host/diagnostics.js,core/test/diagnostics.test.js,docs/subsystems/core-host.md,patches/ds-bot/0001-core-fixes.patch,patches/ds-bot/0007-version-and-tooling.patch.Checkpoint
{
"pr": 2417,
"claim": "Dev-1",
"issue": 2416,
"summary": "The
state file:row no longer says a linked team file is read through the link when the link points at a folder:readFilefails on a folder (EISDIR), the store lands instuckand no save replaces the name.stateNotPlainresolves a symbolic link withstatfor its metadata only, never the bytes behind it, and keeps the read-through-the-link sentence only for a link to a plain file; a folder, a link to nothing or a failed check keepsnot a plain file (nothing is read or written). Both sentences and the rows around them are unchanged, andstore.jsis untouched.","files": [
"core/src/host/diagnostics.js",
"core/test/diagnostics.test.js",
"docs/subsystems/core-host.md",
"changelog.d/2416-state-file-link-target.fixed.md",
"patches/ds-bot/0001-core-fixes.patch",
"patches/ds-bot/0007-version-and-tooling.patch"
],
"checks": {
"ran": "TZ=UTC ARCH_DOCS_BASE=67aead26 npm run verify (4827/4827) + arch-docs + patches check/canonical + generate no-op + changelog/empty-catch/mojibake",
"result": "green",
"at": "7980af8c4ed0255b21b9dfea154b34d684348a15"
},
"next": "waiting on Test's independent run and Birfy's Verdict: PASS at this tip; then the Lead sends the queue request"
}