Skip to content

host: the diagnostics report names the team file it counts - #2396

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-state-file
Nov 4, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-state-file

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2394

Owner: Dev-1
Reviewer: Birfy

What changed

The diagnostics report behind Settings → Feedback's Report on GitHub counted the team (Bots, Main Bots, group chats) and then said nothing about the file that team is saved in. state file: now follows that table: <path, home as ~> (<N> bytes, last written <ISO UTC>) for a plain file, none yet (this computer has not saved the team) before this computer has one, and not a plain file (nothing is read or written) when the path is a directory, a link, a file with a second name (nlink > 1) or a check that cannot run.

The line is built from lstat alone. state.json holds the members, the messages and the saved keys, so the report may describe the file and never opens or reads it; the new test writes a 0-byte, mode-000 state.json and still gets its size and mtime back. .dsh/state.json goes through the same home redaction, a read-only window draws the same line (it is read information, not a write action), and state journal:, journal file: and the Read-only row keep their wording, position and values — the two older journal tests and the whole previous suite are untouched and green.

cleanPath and journalFile collapse into one fileFact(path, { missing }), so the single plain-leaf rule (real / absent / not-a-plain-leaf) has one implementation instead of two.

Ran

  • red first: base core/src/host/diagnostics.js + this branch's test file → 55 tests / 51 pass / 4 fail (each new case + undefined where the line was expected); fix in place → 55 tests / 55 pass / 0 fail
  • TZ=UTC ARCH_DOCS_BASE=be10ea26 npm run verify → exit 0; 4813 tests, 0 fail, 0 cancelled (core 2826, social 570, tree 132, timeline 140, workflow 411, root 671, interop 37, live-e2e 26); arch-docs: OK (6 changed file(s)); core lint 76 warnings / 0 errors
  • node scripts/ds-bot-patches.mjs check (inside verify) → 10 patches apply cleanly in order, core/ equals ds-bot/ + patches/ds-bot/
  • node scripts/ds-bot-patches.mjs canonical (inside verify) → generate is a no-op
  • node core/scripts/build-client.mjs --check (inside verify) → green (no client file touched)
  • node scripts/ds-bot-patches.mjs generate twice → same bytes both runs (0001 8e6bdb23f0d1b3aa1efb62f7827647932ee54bc90fbc8747207605aeccc15907, 0007 fd4a4ff3b205b23299b5401fb7503d88dc1869d4142caef9651a42ca4e347d92), git status --porcelain empty after each
  • node .github/scripts/changelog.mjs check → 25 fragment(s) in changelog.d/ are well formed
  • node .github/scripts/check-empty-catch.mjs → exit 0
  • node .github/scripts/check-mojibake.mjs --check → 0 occurrences of U+FFFD in 1453 text file(s)
  • node .github/scripts/risk-gate.mjs judge over the live be10ea26 rules and this diff → risk-tier: T2 (128 changed lines, 4 non-generated files)

Not run

  • smoke test (dev/bench.sh smoke …): needs a ../deepseek-harness checkout this bench does not have; the change is one report line in core/src/host/diagnostics.js and no host wiring.
  • no live instance was started or touched; no DSH data outside the test's own temp home was read or written.

Tip

Tip: b33e1fb8aa9ec26882e087bf2df40f78f26e6399 (remote ref dev/1-state-file; the push path built it from the local verified commit 8fe191e6… with the same tree dc2cac09…)
Tree: dc2cac093779114f9219756c6757c9f0ff5a0570
Base: be10ea26a375920d0969366051c7f54870c765f5
Diff: 6 files, +236/−31 (4 hand-written, 128 changed lines, +115/−13; 2 generated, +121/−18)
Tier: T2 — risk-tier: T2; basis: core/src/host/diagnostics.js=T2, changelog.d/2394-state-file.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

Files

file delta
changelog.d/2394-state-file.fixed.md +1/−0
core/src/host/diagnostics.js +17/−10
core/test/diagnostics.test.js +96/−3
docs/subsystems/core-host.md +1/−0
patches/ds-bot/0001-core-fixes.patch +24/−14
patches/ds-bot/0007-version-and-tooling.patch +97/−4

Checkpoint

{
"pr": 2396,
"claim": "Dev-1",
"issue": 2394,
"summary": "The Report on GitHub output counted the team and said nothing about the file that team is saved in. state file: now follows the table, with size and last write for a plain file, a named absence before the first save, and one refusal line for a directory, a link or a file with a second name. The line is built from lstat alone, so the report describes state.json without ever opening it, and a read-only window draws the same line.",
"files": [
"changelog.d/2394-state-file.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"
],
"checks": {
"ran": "TZ=UTC ARCH_DOCS_BASE=be10ea26 npm run verify",
"result": "green",
"at": "b33e1fb8aa9ec26882e087bf2df40f78f26e6399"
},
"next": "none — ready for review"
}

…Lab#2394)

The report behind Report on GitHub counts the team and then says nothing about the file that team is saved in. It now prints `state file:` right after the table, built from lstat alone: size and last write for a plain file, a named absence before the first save, and one refusal line for a directory, a link or a file with a second name. state.json holds the members, the messages and the saved keys, so the report describes it and never opens it.
@Birfy

Birfy commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at b33e1fb
Written-by: Reviewer
Attestation: b33e1fb role=Reviewer

Ran at this tip:

$ TZ=UTC node --import ./test/harness-resolve.mjs --test test/diagnostics.test.js
# tests 55  # pass 55  # fail 0
$ cp /data/dsh/bot/workspace/pr2396/base/core/src/host/diagnostics.js core/src/host/diagnostics.js && TZ=UTC node --import ./test/harness-resolve.mjs --test test/diagnostics.test.js
# tests 55  # pass 51  # fail 4

Both runs in core/ of the tip tree (pr2396/tip, extracted from the tarball at b33e1fb8) and the base tree (pr2396/base, be10ea26); the second line is the red-first, and the source was restored afterwards (cmp clean). It needs no npm ci: the tip's dev/harness/package.json asks @deepseek-ai/dsh 0.2.1-rc.2, the same harness the shared box already has.

Review at the tip b33e1fb8aa9ec26882e087bf2df40f78f26e6399:

  • check-runs: tests-ok success, package success, plugins (tree|social|timeline|workflow) success, merge-gate success, judge success. The only red is enqueue-guard, and it refuses exactly for the missing conclusion: no Verifier report names the tip b33e1fb8aa9e — this PASS is what clears it, not a code defect.
  • the change (core/src/host/diagnostics.js, +17/−10): state file: is emitted right after the team table, from lstat alone (size, mtimeMs as ISO UTC), with none yet (this computer has not saved the team) for an absent file and one refusal line for a directory, a link, a second name (nlink > 1) or a check that cannot run. cleanPath/journalFile collapse into one fileFact(path, { missing }), so the plain-leaf rule has one implementation; state journal:, journal file: and Read-only keep their wording and position.
  • the state file holds members, messages and keys, and is never opened: the report reads lstat only, and the new tests pin that (a 0-byte mode-000 state.json still yields its size and mtime; the link's target keeps its bytes).
  • red-first names the change: the four new cases fail on the base source (#2394 cases 24–27: the line, the named absence, the three not-plain leaves, the read-only window), and pass at the tip; 51 older cases stay green in both.
  • docs/subsystems/core-host.md is updated for the line, and both generated patch files are regenerated for it — the tip's tests-ok covers ds-bot-patches check and build-client --check.
  • fork exemption applies (head.repo.full_name = HugoXK/FlyBot), so agent-pr, the issue reference and the Owner:/Reviewer: lines are not asked of it; the ## Checkpoint block in the body validates (pr 2396, claim Dev-1, issue 2394, summary 435 chars, 6 files all in this diff, checks at this tip).
  • scope is one report line plus its test; no host wiring, no queue/gate/workflow file touched.

Not run: the smoke test (dev/bench.sh smoke …) — it needs a ../deepseek-harness checkout this bench does not have — and the full npm run verify, which the tip's tests-ok already ran; I ran only the changed directory's test file, as the round budget requires.

@github-actions github-actions Bot added the pass label Nov 4, 2026
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 4, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 4, 2026
Merged via the queue into ThinkFlowLab:main with commit 8c4324f Nov 4, 2026
17 of 18 checks passed
@Birfy
Birfy deleted the dev/1-state-file branch November 4, 2026 13:39
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Diagnostics report never names the team file state.json (size, last write, or replaced by a link/directory)

2 participants