Repository navigation
Project board: read a decision from the folder the meeting archived in - #1818
Conversation
…hinkFlowLab#1809) `meeting decide` archives its file in the Session's working folder, while the board read only the Project's own folder: a default install showed an empty Decisions section and a decided meeting as `decision file gone` while the file sat on disk. The record now names the folder it wrote to (`decisionDir`); the board reads the union of the Project folder and each decided meeting's own file, deduplicated by path and sorted, and a record written before this slice still resolves through the Project folder. The board's own read of a folder takes no repository gate (`listProjectState(dir, { repository: false })`), while `project_state` and the Project Assistant keep the `not a repository` answer unchanged. Also corrects the `core-host.md` paragraph ThinkFlowLab#1804 shipped: on a card with an open `rework` child the expired lease is kept, the worker is not dropped and no `lease expired` entry is written; the ordinary recovery applies on the first tick after no `rework` child is open. No code change for that paragraph, a regression test pins both sides of the guard.
|
@Birfy — repository review request for PR #1818 at tip From this tip on our side is frozen: no new tip, no further comments, no re-runs. A Verdict that names Where to look, all at that tip:
Check runs on this tip: 13 of 14 green; |
|
Verdict: PASS at 1fe124e Ran at this tip: Read at 2026-10-30T09:48Z, TZ=UTC, Node 22.23.3, tip tree from the fork tarball (16 files, +803/−330), base Red first, exactly the three #1809 cases. With the three changed host sources swapped back to their base blobs, Scope. The change is the fix, not a widening. Two notes, neither blocking. (1) The CI at this tip ( Not run: the full core suite here — this box aborted it with Metadata. Fork head ( |
…t accepts (ThinkFlowLab#1823) Fixes ThinkFlowLab#1820 ## What was wrong The Project settings panel's **Save memory** button never worked, for anyone including the Project owner. The panel wrote `kind: 'note'` (`core/src/client/project-board.js`), and the host accepts only `decision` / `question` (`core/src/host/store.js:502`, `project-assistant.js:185`, `MEMORY_KINDS` at `:28`), so every press ended in `bot/invalid: Unknown Project memory kind note`. The success line was unreachable, and a zh UI showed the host's English refusal verbatim. The old test pinned that payload, so green CI never caught it. The base is `2ea55d8a4d67cd1e4fe489ab2b14b1946cea4dd6` (live `main` when this was pushed); the issue's `adbaf320fed0` is stale (`ThinkFlowLab#1815`, `ThinkFlowLab#1817`, `ThinkFlowLab#1818` and `ThinkFlowLab#1822` have landed since). ## What changed - `core/src/client/project-board.js`: the memory box sends `kind: 'decision'` — the host's own default when a writer omits `kind` (`project-assistant.js:184`), and the only accepted kind that is not an open question. The status line goes through `hostText`, so a refusal is quoted in the UI language. The other two write paths are unchanged. - `core/src/client/i18n.js`: three `HOST_ERRORS` entries, only for refusals this panel's three write paths can actually surface — the owner gate on all three (`Only the owner of this Project may change it`), an empty member id on Bind/Unbind (`A binding needs the member id`), and a stale Project id (`Unknown Project (\S+)`). The id rule is last and takes one token, so it cannot swallow a longer `Unknown Project …` sentence; the test keeps `Unknown Project status active` unchanged so that stays proven. No other entry was added. - `core/test/project-board-panels.test.js`: the stub that pinned `kind: 'note'` is replaced by a real round-trip through `rt.projectEndpoint` (`call: (event, payload) => rt.projectEndpoint(event, payload)`), with a control that a `decision` write lands in the memory, a control that `note` is refused and writes nothing, and a zh assertion on the refusal and on `记忆已保存。`. - `docs/subsystems/core-client.md`: one paragraph on the panel's three write paths and the memory-kind mapping. - `changelog.d/1820-project-memory-save.fixed.md`. - Generated surface: `core/client.js`, `patches/ds-bot/0001-core-fixes.patch`, `patches/ds-bot/0008-client-bundle.patch`, and the two `patches/ds-bot/files/...` mirrors. The bulk of the diff is `patches/ds-bot/0008-client-bundle.patch` (+5,023/−2,573 of the +5,342/−2,598): that patch is machine-generated whenever the client bundle is rebuilt and is never hand-edited — `npm run build-client` regenerates it, and `node scripts/ds-bot-patches.mjs check` printed the same three green lines on two consecutive runs. `0012` / `0014` were reverted when the generator only changed hunk headers. ### No display surface today This fix adds no display surface and no new wording for one. The only reader of a `decision`-kind row is the `project-memory` endpoint, and no client code calls it; the approved P-228 read-back panel is the one future surface, and it labels these rows **memory entries** (记忆条目), never "decisions". The audit below is why `decision` is the correct side of the host's two-kind contract today. ## Memory kind mapping The panel has no type selector: every Save memory press writes one free-text row. `note` is not a kind the host accepts, so the panel sends `decision`. This is a client-side mapping only — `MEMORY_KINDS` (`project-assistant.js:28`) and the host's kind checks (`store.js:502`, `project-assistant.js:185`) are unchanged. **Every reader of a `decision`-kind row (base `2ea55d8a`):** 1. **`project-memory` endpoint** (`store.js:606`, routed by `channel.js:676`, owner-gated at `store.js:605`) — returns `{project, memory: {decisions, questions, digest}}`. Its only caller is a test today: `core/src/client/` contains no `project-memory` read at all (the bundle has `project-memory-write` and the `project-memory-save` action, never the read endpoint), and no page renders the response. This is the endpoint the approved P-228 read-back panel will use; today the row has no display surface. 2. **The digest** (`project-assistant.js:159` `memoryOf` → `projectMemoryFor`) — `digestForOwner` (`:432`) reads only `memory.digest` (`:447`, `:450`); `buildDigest` (`:61`) takes `project/rows/files/actionable` and no `decisions`/`questions`, so a memory row never appears in the digest text, and the word "decision" is never printed from it. 3. **The board's Decisions section** (`store.js:656`) — comes from `project-board.js:150` `decisionsOf(project)`, which lists `workDir/decisions/*.md` on disk. Different source from `state.projectMemory`; a memory row never shows there and is never labelled a decision. 4. **`rt.projectAssistant.read` / `write`** (`:176`, `:182`, exposed at `:508`) — the internal API returns the owner's `{decisions, questions, digest}`, but nothing calls `read` (the assistant Session registers only `project_digest`, `:513`) and no `project_memory_write` tool is registered (the instructions at `:37` name one that does not exist). No assistant-side display path. 5. **The write response** — `project-memory-write` returns the updated `memory` (`store.js:612` → `ownerView`), and the panel accepts it, but `run()` uses it only for the success/refusal status line; `onSaved` is not passed by any caller, so no entry is rendered. Measured on `2ea55d8a` with the real endpoints (throwaway probe, not committed): ```text READBACK decisions => ["memory row: ship Friday"] BOARD decisions => {"dir":"...","files":[{"path":"decisions/2026-10-30-ship.md",...}],"reason":""} DIGEST => "Project Assistant (Ops) — 2026-10-30: no change since the previous digest." ``` **Why `decision` and not `question`.** `question` is the host's list for open questions; the free text a person types on Save memory is a statement or a settled call, so it belongs on the "recorded, no longer open" side. `decision` is also the host's own default when a writer omits `kind` (`project-assistant.js:184`), so the panel sends explicitly what the host would have assumed. **The trade-off and its condition.** Mapping to `decision` is deliberate and holds only while no surface renders such a row under the word "decision": today none does (readers 1–5 above), and P-228 renders them as memory entries. It does not hold by itself. The approved P-228 read-back panel will list both arrays, and if it labels a `decisions` row as a decision, a person's typed memory would read as a decision they never made. For this mapping to stay honest, P-228 must render these rows as **memory entries** (记忆条目) — or separate "recorded memory" from "decisions" — and that requirement is P-228's acceptance, not this PR's. The alternative here would be a third host kind (a new contract with no reader, which the issue excludes) or a type selector in the panel (also out of scope). ## Red first Re-taken on the final base `2ea55d8a4d67cd1e4fe489ab2b14b1946cea4dd6`, with only `core/src/client/project-board.js` reverted to that base and the new tests kept: ```text not ok 3 - the settings panel memory save lands in the Project memory through the real endpoint error: |- the panel reports the state the host answered + actual - expected + 'Unknown Project memory kind note' - 'Memory saved.' not ok 4 - a memory kind the host does not know writes nothing, and the panel quotes a refusal in Chinese error: |- Expected values to be strictly equal: + actual - expected + 'Only the owner of this Project may change it' - '只有这个项目的主人可以修改' # pass 4 # fail 2 ``` The two failures are the two contracts this PR fixes: the panel sends a kind the host refuses, and the panel quotes the host's English refusal instead of the localized one. With the fix, the same file is 6/6. ## Verification at the tip At the pushed tip `7c374bb32f38241d4d0f937f4f4ddcd11f45057c` (tree `b1f5352cd2e2907437b75addc5dd2aba6291aca3`, the tree `npm run verify` ran on locally as `06ac78a59af1738ff420f4e18592a6067394e044`): ```text TZ=UTC ARCH_DOCS_BASE=2ea55d8a4d67cd1e4fe489ab2b14b1946cea4dd6 npm run verify ``` - core suite: **2182/2182** pass, 0 fail. - core lint: **71 warnings, 0 errors**. - `arch-docs`: **OK (10 changed file(s))** with `ARCH_DOCS_BASE=2ea55d8a4d67cd1e4fe489ab2b14b1946cea4dd6`. - `build-client --check`: green. - `ds-bot-patches check` run twice, identical three lines: ```text ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5) ok 10 patches apply cleanly in order ok core/ equals ds-bot/ + patches/ds-bot/ ``` - the repo changelog test (`ok 54`) is green; `changelog.d/1820-project-memory-save.fixed.md` is the new fragment. - the remaining plugin / script suites are green (541, 127, 135, 294 and 549 tests), and `git status` is clean apart from the untracked `node_modules` symlinks the bench needs. 10 files changed, +5342/−2598: `changelog.d/1820-project-memory-save.fixed.md` +1/−0, `core/client.js` +12/−3, `core/src/client/i18n.js` +7/−0, `core/src/client/project-board.js` +7/−4, `core/test/project-board-panels.test.js` +132/−7, `docs/subsystems/core-client.md` +7/−0, `patches/ds-bot/0001-core-fixes.patch` +14/−0, `patches/ds-bot/0008-client-bundle.patch` +5023/−2573, `patches/ds-bot/files/src/client/project-board.js` +7/−4, `patches/ds-bot/files/test/project-board-panels.test.js` +132/−7. Not run: the smoke bench (no `index.js` or `core/src/host/` change), the pack check, and actionlint — `npm run verify` does not include them. Owner: Dev-3 Reviewer: Birfy <!-- flybot:checkpoint --> ```json { "pr": 1823, "claim": "Dev-3", "issue": 1820, "summary": "The Project settings memory box now writes kind decision, the host's own default, so Save memory stores the text and shows the localized success line. Refusals are quoted through hostText, with dictionary entries only for the three refusals this panel's write paths can surface. The stub that pinned kind note became a real projectEndpoint round-trip, with controls that decision lands and note writes nothing. No display surface is added; the future P-228 panel labels these rows memory entries.", "files": ["core/src/client/project-board.js", "core/src/client/i18n.js", "core/test/project-board-panels.test.js", "docs/subsystems/core-client.md", "changelog.d/1820-project-memory-save.fixed.md", "core/client.js", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0008-client-bundle.patch", "patches/ds-bot/files/src/client/project-board.js", "patches/ds-bot/files/test/project-board-panels.test.js"], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=2ea55d8a4d67cd1e4fe489ab2b14b1946cea4dd6 npm run verify", "result": "green", "at": "7c374bb32f38241d4d0f937f4f4ddcd11f45057c" }, "next": "none — ready for review" } ``` <!-- /flybot:checkpoint -->
Fixes #1809
Owner: Dev-1
Reviewer: Birfy
Written-by: Dev-1
What was wrong
meeting decidearchives its file in the Session's working folder (meetings.js,workDirFor), while the board read only the Project's own folder (project-board.js,folderOf→listProjectState(dir)). A default install names no Project folder, so the Decisions section stayed empty and the decided meeting drew asdecision file gonewhile the file sat on disk. Independently,listProjectStaterefused a folder that is not a git repository, so even a matching folder listed nothing.What changed
core/src/host/meetings.js: adecidedrecord now names the folder it archived in (decisionDir).core/src/host/project-board.js:decisionsOfreads the union of the Project folder (whole) and, for each decided meeting of that Project, the one file the record names — deduplicated by path and sorted; a record written before this slice names no folder and resolves through the Project folder exactly as it did.archivedOf()reads a named file directly (bytes, sha256, mtime), and an absent or unreadable file leaves the meeting without a row instead of failing the read. The board's own read passeslistProjectState(dir, { repository: false }).core/src/host/project-state.js:listProjectState(dir, { repository = true } = {})gates onrepository && !await repositoryAt(dir);project_stateand the Project Assistant keep thenot a repositoryanswer unchanged.core/test/project-board.test.js: three cases driven through the realmeetingtool (open, three positions, decide).docs/subsystems/core-host.md: the union read, plus the handoff claim reads handoff.to while the wake reads queueRole: a reworked card is re-offered to the reworker and still claimable by the Lead #1804 correction below.changelog.d/1809-project-board-decisions-union.fixed.md.patches/ds-bot/0001-core-fixes.patch,0008-client-bundle.patch,0012-room-membership.patch,0014-flybot-branding.patch(hunk representation only — the client bundle content is unchanged) and the fivepatches/ds-bot/files/...mirrors of the files above.One deliberate consequence: a Project folder that is not a git repository now lists the decision files the board used to refuse to read — the repository check moved from the board's reader to the
project_statetool, which is what makes a folder-less default install work.project_stateand the Project Assistant still answernot a repository.Documentation correction (core-host.md, no code)
It is the same
core-host.mdthis pull request already changes, it is a pure documentation change with no code change, and it is not functionally coupled to this change: the paragraph #1804 shipped is wrong about the code as it stands, so it is corrected here. That paragraph said an expired lease on a card with an openreworkchild is cleared, and that the recovery entry is written and the dead worker dropped; on that branch none of it runs —expireLeases'scontinuesits abovedelete task.lease,dropWorkerand the evidence write, so the expired lease stays, the worker stays and nolease expiredentry is written. The paragraph now says that, names the two exits (accept →closeReworkmoves the original toresult-readyand the next tick drops only that dead lease; cancel or fail → the next tick runs the ordinary recovery, writeslease expired (held by <name>)and requeues theworkingoriginal to its role queue), and records that once the lease's own expiry has passedrt.taskLease(id).livereads false while the card still sitsworking— intentional, never an invitation to take it.core/test/task-handoff-route.test.jspins both sides of that guard: while the child is open the tick answers 0 and the card keeps its worker and an emptyevidence; after a cancel the next tick answers 1 and the card is back in the Reviewer queue withlease,workerandclaimedBygone andlease expired (held by Rev1)on the evidence; a second tick answers 0. Honest note: that case is green on the base too — it is a regression guard for the paragraph, not a discriminator for this change. The discriminators are the three #1809 cases below.Red first (base
adbaf320, treee9750469)Tests applied without the fix; tests-only tree
26128718:A
the record names the folder it archived inexpected the Session folder and read''; Bthe team-folder decision is listedexpected one path and read[]; Dthe other Project’s decision is never listed hereexpected one path and read[]. All three are green at this tip.Verification at the tip
Tip SHA:
1fe124eab715688d4790e83bfa253177be06477b(tree9e239549fc06597704eec4b744a33a17f57c7a89), baseadbaf320fed0d5c2dfa4f85567d92bd3ebc77bab. The same change rebased locally onto that base gives tip7a2b669e5802f5d6f21d3a5d9c627198ca3217cdwith the identical tree, so the pushed commit and the tree this was verified on are bit-for-bit the same.Ran at this tip:
TZ=UTC ARCH_DOCS_BASE=adbaf320 npm run verify— exit 0: core 2179/2179, social 541/541, tree 127/127, timeline 135/135, workflow 294/294,.github/scripts549/549, interop 37/37, live-e2e 24/24; lint 0 errors (core 71 warnings, all pre-existing);arch-docs: OK (16 changed file(s))on baseadbaf320;build-client --checkgreen, so the bundle is unchanged.node scripts/ds-bot-patches.mjs check, twice, the same three lines each time:ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5)ok 10 patches apply cleanly in orderok core/ equals ds-bot/ + patches/ds-bot/with
git status --porcelainempty after each.Line count of the real change, generated files excluded: code +76/−17 (net +59), tests +171,
core-host.md+14/−2, changelog +1.Not run: the smoke test (it needs a bench and a free port; this is a read-side host change covered by the suite) and the pack check, typecheck and actionlint of the CI
packagejob (not part ofverify).Checkpoint
{ "pr": 1818, "claim": "Dev-1", "issue": 1809, "summary": "The board read decisions only from the Project's own folder, so a decision archived in the Session's working folder was invisible and its meeting read as decision file gone. A decided meeting now records the folder it wrote to, and the board reads the union of the Project folder and each decided meeting's file, deduplicated by path, while its own folder read no longer requires a git repository. project_state and the Assistant keep the not-a-repository answer. The #1804 paragraph in core-host.md is corrected to the guard's real behavior, with a regression test on both sides of it.", "files": [ "core/src/host/meetings.js", "core/src/host/project-board.js", "core/src/host/project-state.js", "core/test/project-board.test.js", "core/test/task-handoff-route.test.js", "docs/subsystems/core-host.md", "changelog.d/1809-project-board-decisions-union.fixed.md" ], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=adbaf320 npm run verify", "result": "green", "at": "1fe124eab715688d4790e83bfa253177be06477b" }, "next": "none — ready for review" }