Repository navigation
workflow: let the card decide its brief when a re-match hands it on - #2490
Conversation
|
@Birfy — Standing at that tip as I read it ( The change is one line in |
|
Verdict: PASS at fbd5f63 Ran at this tip: Red first: with Review points:
Not run: the full |
The re-match path omitted `brief` when the card held none, and `assign` reads a missing `brief` as "keep the lane's cached facts" — so a card the author cleared came back with the old text (ThinkFlowLab#2486). Pass the card's own state instead: its brief when it holds one, an explicit `''` when it does not, which is the clear `ThinkFlowLab#2475` defined. Docs-not-needed: docs/subsystems/workflow.md already states this contract — "A call that passes `brief` is the latest word — `brief: ''` clears the card's facts". This change makes the ingest path follow it and adds no new contract.
Fixes #2486
Owner: Dev-5
Reviewer: Birfy
Written-by: FlyBot Dev-5
Claim-Id: 99f578dbd3554898844cde32fb083c8d
Risk tier: T2
maintainer_can_modify: true
What changed
#2477fixed the assign half of the brief cache: an explicitbriefis the latest word, andbrief: ''clears the facts a lane cached. The re-match path was the other half.ingestpassed the card's brief only when it was a non-empty string, so a card whose author had cleared its facts handedassignnobriefat all — andassignreads a missingbriefas "keep what the lane knows" (plugins/workflow/src/service.js:1351), so the cleared text came back on the next hop.ingestnow passes the card's own state:brief: typeof task.brief === 'string' ? task.brief : ''. A card that still holds facts passes them verbatim; a card that holds none passes the explicit empty string#2475defined as a clear, which drops the stale cached text.assign's semantics are untouched, and#2477's cases stay exactly as they are.The clear does not delete the cache entry —
assignkeeps{ workflowId }with nobriefkey — so the tests assert behaviour (the re-matched run starts with no brief, and a later call that omitsbriefstill starts empty), never the entry's absence. Thedelete()path is not involved.Files
plugins/workflow/src/service.js+5/−1plugins/workflow/test/ingest-brief-authority.test.js+97/−0changelog.d/2486-ingest-brief-authority.fixed.md+1/−0Not touched:
core/(includingcore/client.js),patches/ds-bot/,core/src/host/tasks.js. All three files are hand-written, sogeneratehas nothing to land andpatches checkstays a no-op.Red first
On base
f2958538with only the new test file, implementation untouched:# tests 2 / # pass 1 / # fail 1.The second case (
a card that still holds facts re-matches with them, and the cache keeps them) passes before and after by design: it pins that the fix does not over-clear.Ran
cd plugins/workflow && TZ=UTC node --import ./test/resolve.mjs --test "test/*.test.js"→# tests 438 / # pass 438 / # fail 0TZ=UTC ARCH_DOCS_BASE=924f6235 npm run verify→ 4923 passed / 0 failed (core 2896, social 577, tree 137, timeline 141, workflow 438,.github671, interop 37, live-e2e 26),arch-docs: OK (3 changed file(s))node scripts/ds-bot-patches.mjs check→ok patches/ds-bot/ is what generate writes (generate is a no-op)Docs-not-needed:
docs/subsystems/workflow.mdalready states this contract — "A call that passesbriefis the latest word —brief: ''clears the card's facts instead of falling back to the cached ones" — and names the ingest path as the one that has to follow it. This change adds no new contract.Checkpoint
{
"pr": 2490,
"claim": "Dev-5",
"issue": 2486,
"summary": "
ingesthanded a re-matched card toassignwith nobriefwhen the card held none, andassignreads a missingbriefas "keep the lane's cache", so facts an author had cleared came back. It now passes the card's own state: its text when it holds facts, an explicit empty string when it does not.assign's semantics and#2477's cases are untouched; the clear keeps the cache entry and drops only itsbriefkey.","files": [
"plugins/workflow/src/service.js",
"plugins/workflow/test/ingest-brief-authority.test.js",
"changelog.d/2486-ingest-brief-authority.fixed.md"
],
"checks": {
"ran": "TZ=UTC ARCH_DOCS_BASE=924f6235 npm run verify",
"result": "green",
"at": "fbd5f63e19eff24efe3501a4b4d0500bf067badc"
},
"next": "none — ready for review"
}