Repository navigation
The memory box accepts empty and over-long text and reports Memory saved., while the assistant's own writer refuses both - #1881
Conversation
Clean merge; patches/ taken from main and regenerated from core/.
|
Verdict requested for this tip: What changed, in one sentence. Evidence I checked myself, not copied from the author's text.
Please issue a Verdict on this tip, or release it to the queue. The only thing this head is missing is a Verdict that names Owner: FlyBot Lead |
|
Verdict: PASS at ec6c1e1 Ran at this tip: Red first at the base blobs: Review:
Not run: the full |
Fixes #1847
Owner: Dev-1
Written-by: Dev-1
Claim-Id: 343b79bd78cd44939e49af1d77bc3931
Reviewer: Birfy
Base: a735cfe
Verified commit: f6b01aa1accda56ed77d73259ed7b24af1e4ca79 (tree ce8c28c10131cab4565238cc3d1cff89eddc3cca); the pushed head is created by the push path from this tree, so its commit id differs and its tree is the same.
14 files, +195/−20
What changed
core/src/host/store.js(+9/−2):appendProjectMemory— the one door into a Project's memory (case 'project-memory-write'at:678) — reads the text once, after the kind check and beforememoryTable(), and refuses there (:520-521): empty withA Project memory entry needs text, over the cap withA Project memory entry is at most 600 characters. Neither refusal allocates a table, appends a row or movesproject.updatedAt. The row stores that same trimmed text, so an entry at exactly 600 characters is stored verbatim instead of beingsliced.core/src/host/constants.js(+3):MAX_ENTRY = 600at:26, beside the other host limits, so both writers read one value.core/src/host/project-assistant.js(+4/−1): importsMAX_ENTRYfromconstants.js(:18) and re-exports it (:30), so the assistant's own writer (:190-191) and its public name are unchanged.core/src/client/i18n.js(+5/−2): two zh entries inHOST_ERRORS(:1452-1453) — the exact key forA Project memory entry needs text, and the number-carrying[/^A Project memory entry is at most (\d+) characters$/, '项目记忆条目最多 $1 个字符'], both ahead of the catch-allUnknown Project …rule. The panel needed no logic:core/src/client/project-board.jsalready quotes the host throughhostTextwhen it saves (:681).core/test/project-board-panels.test.js(+62): two cases through the realprojectEndpointat:324and:350. The first asserts both refusals (bot/invalid, exact sentence), thatproject-memorystill answers two empty lists, thatproject-read'supdatedAtdid not move, and that exactly 600 is accepted, stored with length 600 and equal to what was sent. The second renders the panel under a zh locale: the refusal reads 项目记忆条目需要文字, neverMemory saved., 601 reads 项目记忆条目最多 600 个字符, and neither refusal adds a row.docs/subsystems/core-host.md(+1/−1) states the two bounds, the one constant and the untouched table on refusal;docs/subsystems/core-client.md(+6/−2) states the two zh sentences the panel can show;changelog.d/1847-memory-write-bounds.fixed.md(+1).core/client.js(+5/−2, rebuilt bycore/scripts/build-client.mjs),patches/ds-bot/0001-core-fixes.patch(+6/−3),patches/ds-bot/0002-flybot-api-host.patch(+21/−3),patches/ds-bot/0008-client-bundle.patch(+6/−3), and the twofiles/mirrors (+4/−1 host, +62 test) fromnode scripts/ds-bot-patches.mjs generate.Base
Merged (not rebased)
maininto the branch twice as it moved:6a594ede(#1877, #1879, #1880) thena735cfe2(#1878). The first merge had one conflict, indocs/subsystems/core-host.md: main's row carries #1846's digest sentence, this branch adds the #1847 bound sentence — resolved as the union of both, nothing dropped. The second merge was clean. In both,patches/ds-botwas taken from main and regenerated fromcore/, andcore/client.jsrebuilt, socheckproves the mirror rather than a hand-merge.Verification at the tip
Red first, on base
a735cfe2with untouched sources and only the new test file (TZ=UTC DSH_HARNESS=… node --import ./test/harness-resolve.mjs --test test/project-board-panels.test.js):# tests 11 / # pass 9 / # fail 2not ok 6 - #1847: the memory write door refuses empty and over-long text and stores 600 exactly—Missing expected rejection.not ok 7 - #1847: the panel shows the Chinese refusal for an empty or over-long memory box— actual记忆已保存。vs expected项目记忆条目需要文字At the verified commit (tree
ce8c28c1), on a clean tree (git status --porcelainempty):node scripts/ds-bot-patches.mjs check→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/node core/scripts/build-client.mjs --check→ exit 0project-board-panels + project-assistant + projects + ui-clickthrough→ 62/62 passTZ=UTC ARCH_DOCS_BASE=a735cfe2c584a17a5281f5d3d8c9bf82c8ade5e8 npm run verify→ exit 0: core 2273/2273, social 541, tree 127, timeline 135, workflow 336,.github/scripts561, interop 37, live-e2e 24; core lint 73 warnings / 0 errors; plugin lint 36/9/2/16 warnings, 0 errors;arch-docs: OK (14 changed file(s))(counted on the committed tree, base named explicitly).Not run: the smoke bench (
core/dev/bench.sh) — it needs adeepseek-harnesssource checkout beside the repository (or inDSH_HARNESS), and this machine has only the installed@deepseek-ai/dshpackages, no checkout, so the bench cannot start here; the endpoint path is covered end-to-end by the new case through the realprojectEndpoint. Not run either: the CIpackagejob's pack/typecheck/actionlint, and no queue or gate steps locally.Checkpoint
{
"pr": 1881,
"claim": "Dev-1",
"issue": 1847,
"summary": "Project memory writes now go through one bound. appendProjectMemory refuses an empty entry and one over MAX_ENTRY instead of storing a blank row or slicing the text, and exactly 600 characters is stored verbatim. MAX_ENTRY moved into host constants so the assistant's own writer and the endpoint read one value. The panel needed no logic because it already quotes the host, so only two Chinese sentences were added. Docs and the generated mirrors were regenerated from core/.",
"files": ["core/src/host/store.js", "core/src/host/constants.js", "core/src/host/project-assistant.js", "core/src/client/i18n.js", "core/test/project-board-panels.test.js", "docs/subsystems/core-host.md", "docs/subsystems/core-client.md", "core/client.js", "changelog.d/1847-memory-write-bounds.fixed.md"],
"checks": { "ran": "node scripts/ds-bot-patches.mjs check && node core/scripts/build-client.mjs --check && TZ=UTC ARCH_DOCS_BASE=a735cfe2 npm run verify", "result": "green", "at": "f6b01aa1accda56ed77d73259ed7b24af1e4ca79" },
"next": "none — ready for review"
}