I3416 — The episode boundary is proven to give one candidate for an observation recorded twice, none for a partial task, and one file per episode when two episodes close at once
Extend the idempotency case so that it proves three behaviours the deriver has by construction and no case asserts. An identical observation recorded twice in one episode derives one file. A task finished partial yields no candidate, while knowledge.derived is still written. Two episodes of one checkout closing concurrently each write their own candidate once, knowledge check passes, and no staging file is left.
BLOCKED wave 0 · p2 · implementation profile · parallel safe
Blocked. This issue cannot start until milestone:knowledge-is-reconciled-before-it-is-reviewed is done. The status is derived from that, not declared.
Objective
Extend the idempotency case so that it proves three behaviours the deriver has by construction and no case asserts. An identical observation recorded twice in one episode derives one file. A task finished partial yields no candidate, while knowledge.derived is still written. Two episodes of one checkout closing concurrently each write their own candidate once, knowledge check passes, and no staging file is left.
Why
The owner's 2026-10-19 Cognitive Fabric pack lists the same observation twice, a partial task and a multi-peer race among its verification cases (campaigns/prismatic-way-cognitive-fabric-prompt-pack/prompts/03_KNOWLEDGE.md). verification/ACCEPTANCE.md asks for the same canonical state after a duplicate replay. This is wave 0: a change to tests only.
Current state
lib/knowledge.sh:1118-1129 digests kind, subject and statement, so a repeated observation maps to one id. :1105-1113 maps no partial outcome, and :1259-1273 stages and renames atomically. Case 564 proves the rerun idempotent and case 981:59-61 proves replay. No case records an observation twice, finishes a partial task or closes two episodes concurrently.
Desired state
Case 564 asserts the three behaviours and fails when any of them breaks.
Scope
- test/cases/564_knowledge_derivation_is_idempotent.sh
- .ai/repo/project/intents
Out of scope
- Changing the deriver
- A new case number
- Cross-checkout evolve races (I3163)
Dependencies
None. This issue is a root of the graph.
What waits on this
Acceptance criteria
- Two identical knowledge observe calls in one episode leave one candidate file and two observation.recorded lines
- A task finished with outcome partial yields no candidate, and the episode's knowledge.derived line is written
- Two episodes closed in parallel in one checkout each leave exactly their own candidate, knowledge check exits 0, and no .tmp. file remains under candidates/
- The case fails when the canonical evidence of an observation is changed to include its timestamp (shown once by a local mutation, then reverted)
Validation
- bash test/run.sh 564_knowledge_derivation_is_idempotent
- majordomus plan validate
Evidence required
- case_the_knowledge_boundary_holds_under_repetition_and_race
Evidence
None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.
Timeline
- started
- —
- verified
- —
- completed
- —
Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.
Canonical record: .ai/repo/project/issues/I3416.yaml. Read it back with majordomus plan show I3416.