Keep one link per Person on a manual event #147
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:fire
svd:go
svd:hold
svd:respec
svd:skip
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/people-mind-mcp#147
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
Make "one link per Person on a manual event" a store rule instead of a read-time collapse.
At the #105 gate (ruling D4, operator word "Accept"), a merge folds a Person's two links on one event into one, and
interaction.attributeonto a Person already on the event fails withparticipant-present. Three paths can still leave two links for one Person:endpoint.unshare, the undo ofendpoint.share, andhandle.move.people_recentcollapses those into one row on read.Acceptance criteria
interactions(event_id, person_id)where both are set, added through migrate-on-open in the next free schema version (ADR 0005 Amendment 5 ruling 15).endpoint.unshare, share undo andhandle.movefold or refuse instead of creating a second link, with the reason named; their undo restores the prior rows.people_recentis removed, and a test proves no path creates a second link.Blocked by
Agent Brief
Category: enhancement
Summary: The store enforces at most one link per Person on a manual event, instead of collapsing duplicates on read.
Current behavior:
The index on
interactions(event_id, person_id)exists but is not unique. At the #105 gate (ruling D4), a merge folds a Person's two links on one event into one, andinteraction.attributeonto a Person already on the event fails withparticipant-present. Three paths can still leave two links for one Person on one event:endpoint.unshare;endpoint.share;handle.move.people_recenthides the duplicates with aDISTINCTon read.Desired behavior:
interactions(event_id, person_id), where both are set, replaces the existing index. It is added by migrate-on-open in the next free schema version (v21 today; take the next free number if another slice merges first). This follows ADR 0005 Amendment 5 ruling 15.people_recentis removed.Key interfaces:
endpoint.unshare,endpoint.shareundo andhandle.move.people_recentparticipant projection.Acceptance criteria:
people_recentno longer de-duplicates, and its existing tests still pass.Out of scope:
interaction.attribute. Both already behave as ruled at #105.event_id, such as mail evidence.Sequencing:
This slice bumps the schema and touches manual events. Do not run it in parallel with another schema-bumping slice, or with #113.
⏸ SVD architect gate: dev/people-mind-mcp#147 keep-one-link-per-person-on-a-manual-event
Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
substrate· dispatch efforthighRun:
20261108T021548Z-50bea2a7Held because: CLEAN but 4 open risk(s) (4 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
Change: Schema 22 in store.open_writer: set SCHEMA_VERSION to 22 and rename SCHEMA_21 to SCHEMA_22. Add an EVENT_LINK_FOLDS tuple that runs after the UPGRADES loop and before INDEXES (store.py:352-357). It deletes duplicate (event_id, person_id) links, keeping MIN(id), and drops interactions_event. Replace INDEXES[3] (store.py:188) with CREATE UNIQUE INDEX IF NOT EXISTS interactions_event_person ON interactions(event_id, person_id) WHERE event_id IS NOT NULL; SQLite treats NULLs as distinct, so this enforces 'both set' and keeps the event_id-only query plans. In graph.py, add _fold_endpoint_links shaped like _fold_events (graph.py:417-425). endpoint.unshare folds after the would-remerge checks (between :2482 and :2483) and records 'folded' in its undo record. Unshare undo re-inserts the folded rows under their original ids, mirroring the unmerge event_links restore (graph.py:1266-1276). The share undo's exclusive sweep (graph.py:2570-2577) folds before its UPDATE. handle.move refuses 'failed reason=participant-present item=interaction:' through a new split_plan 'participant_present' list and a new entry in the refusal loop (graph.py:2829-2834); split_preview_text surfaces it (views.py:643,687). handle.move undo answers 'conflict reason=participant-present interaction=' before _move_allocation (graph.py:3053-3062), mirroring the handle-present undo conflict. Remove the MIN(j.id) collapse from views.RECENT (views.py:89-90). Replace the test_duplicate_links_collapse_on_read test that pins two links, and add the migration test (mirror test_archive.py:350-366) and the path tests.
Files:
src/people_mind_mcp/store.py·src/people_mind_mcp/graph.py·src/people_mind_mcp/views.py·tests/test_interactions.pyDecision: accept the 4 open risk(s) above and dispatch this spec (
svd:go), or park (svd:skip) / re-spec (svd:respec)?Your call (when this issue is held at the gate via
svd:hold):svd:go— approve; Half-B dispatch accepts exactly this spec (open risks accepted)svd:firebesidesvd:go— approve AND authorise the Half-B fire from the phone; never on its ownsvd:skip— park it; dispatch refuses it and the issue stays for a humansvd:respec— discard this spec; the next Half-A run re-produces it with this record as prior-attempt contextSpec:
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-08-keep-one-link-per-person-on-a-manual-event.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-08-keep-one-link-per-person-on-a-manual-event.mdspec-verify-dispatch Half B for dev/people-mind-mcp#147 keep-one-link-per-person-on-a-manual-event completed integration verify.
18c4d8928acodex-svd ship --run-id 20261108T052624Z-a0330141 --confirm-merge)