Create a Person before a contact or email exists #103

Closed
opened 2026-11-05 07:52:50 +00:00 by svc-agent-writer · 3 comments

Parent

#96

What to build

Remember someone by name and context without requiring a Handle, then associate later evidence through normal identity resolution.

Acceptance criteria

  • Create a stable locally owned Person without a Source link; retry produces one Person and restart preserves it.
  • Same-name evidence is a Candidate rather than an automatic merge; adding an exclusive Handle validates ownership.
  • Later Source ingestion preserves local facts and resolves exact exclusive Handles correctly.
  • Text and creation-form flows work; creation undo refuses to delete subsequent unrelated contributions.
  • Run the required repository checks and the focused public-MCP/worker tests for this behaviour; use the existing temporary-store and Source fixtures.
  • For every new mutation, enforce the approved write contract, expected revisions, attribution, idempotent retry and safe undo; extend applicable read projections/change feeds.
  • For every new person-associated value, extend the existing erasure path and tests; keep personal values out of logs/audit detail.

Blocked by

Filed under: operator word "ok" sha256:2689367b205c

## Parent https://git.groupthink.asia/dev/people-mind-mcp/issues/96 ## What to build Remember someone by name and context without requiring a Handle, then associate later evidence through normal identity resolution. ## Acceptance criteria - [ ] Create a stable locally owned Person without a Source link; retry produces one Person and restart preserves it. - [ ] Same-name evidence is a Candidate rather than an automatic merge; adding an exclusive Handle validates ownership. - [ ] Later Source ingestion preserves local facts and resolves exact exclusive Handles correctly. - [ ] Text and creation-form flows work; creation undo refuses to delete subsequent unrelated contributions. - [ ] Run the required repository checks and the focused public-MCP/worker tests for this behaviour; use the existing temporary-store and Source fixtures. - [ ] For every new mutation, enforce the approved write contract, expected revisions, attribution, idempotent retry and safe undo; extend applicable read projections/change feeds. - [ ] For every new person-associated value, extend the existing erasure path and tests; keep personal values out of logs/audit detail. ## Blocked by - https://git.groupthink.asia/dev/people-mind-mcp/issues/98 Filed under: operator word "ok" sha256:2689367b205c
Collaborator

⏸ SVD architect gate: dev/people-mind-mcp#103 create-a-person-before-a-contact-or-email-exists

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 effort high

Run: 20261105T233851Z-66edb6fc

Held because: CLEAN but 5 open risk(s) (1 verification · 4 decision) — HOLD-ALL parks everything. The risks, verbatim:

Open risks:

  1. D1: Should person.create accept Handles in its payload? The lean says no: Handles are added afterwards through the existing link.alias, which already enforces handle-owned, owner and tombstoned and charges the links bucket. The App view reaches it through the card's existing Attach control. The alternative folds alias ownership rules into create, so a create fails whole when a Handle is already held. Architect: confirm 'no Handles in create'. [decision]
  2. D2: Where does the creation form start? The lean puts a 'New person' control inside the existing Person Card App view, shown when create_writable. That needs no new read tool and no change to ADR 0001 Amendment 1. The cost is that a host must already be showing some Person's card. The alternative is a dedicated read tool bound to CARD_URI that opens a create mode; it changes the fixed eleven-tool read surface (tests/test_server.py:105) and needs an ADR amendment. Is the in-card control acceptable for the issue's 'creation-form flows'? [decision]
  3. D3: The 'context' fields on create are limited to organisation and title, stored as action-keyed asserted fields. A free-text context note would be note.add, a separate epic #96 kind that has no table today. Is this the intended reading of 'remember someone by name and context'? [decision]
  4. D4 (pre-existing, not absorbed): actions.payload_digest keeps an unsalted SHA-256 of the canonical payload after apply and after Forget. For person.create that is a guessable digest of the name, organisation and title; link.alias and review.edit already leave the same residue. ADR 0003 Am.1 rule 7 accepts salted hashes only. Should Forget clear or re-key the digests of Actions on a forgotten Person (a #114 concern), or is this accepted residue? [decision]
  5. V1: The suite asserts only logical absence (iterdump) of a forgotten created name; physical erasure relies on secure_delete=ON (store.py:176). Post-merge check: on a test copy, create 'Dr Bruce', alias a Handle, run graph.forget, run PRAGMA wal_checkpoint(TRUNCATE), then grep -c 'Dr Bruce' pm.db must return 0. This is not asserted in-suite because ADR 0003 Am.1 forbids an application checkpoint. [verification]

Change: Add the Action kind person.create (create bucket, cap 50) through the existing outbox, worker and undo pipeline.

  1. actions.py:23-30: add "person.create": "create" to KIND_BUCKET and add the kind to UNDOABLE.

  2. graph.py: add a new create_person() beside assert_field (:631-649). It mirrors the new-Person branch of ingest_record (:371-377): INSERT_PERSON, then INSERT_NAME keyed ('action', str(action_id)) with kind primary, then INSERT_FIELD asserted rows for organisation and title whose Author is the token label (read as at :727), then _change(conn, 'add', pid).

  3. graph.py, _apply_action: put the person.create branch BEFORE the undo fall-through at :743. It returns detail person= and the undo record {person_id, revision}.

  4. graph.py, undo dispatcher: add an elif before the merge else at :789.

  • If the Person was merged away (canonical_id differs), answer conflict reason=redirected.
  • If any row reaches the Person other than the create action's own rows, answer conflict reason=contributions person= revision=. Such rows are handles, source_links (live or retired), interactions, names/fields/tags not keyed to the action, relations on either side, suggestions, and redirects into the Person.
  • Otherwise run DELETE_PERSON (FK cascade) and _change 'del', mirroring forget at :526,530.
  1. server.py: add people_create and the app-only people_card_create.
  • They share _create, which mirrors _review (:425-443): _author('create'), name stripped with a non-empty name_key and at most 200 chars, optional organisation and title, then _queue('person.create').
  • Register both in build_app (:528-554), with people_card_create app-visible.
  • people_card_suggestions gains create_writable.
  1. card.html: add a "New person" form inside load() (Edit-form pattern :95-107) that calls people_card_create. When the create is applied, call setPerson(new id); the card's existing Attach control then adds a Handle through link.alias, which already validates ownership.

  2. Read projections need no change; views already render action-sourced names and fields.

  3. Update README.md:80.

No schema change.

Files: src/people_mind_mcp/actions.py · src/people_mind_mcp/graph.py · src/people_mind_mcp/server.py · src/people_mind_mcp/card.html · tests/test_create.py · tests/test_actions.py · tests/test_card_app.py · README.md

Decision: accept the 5 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):

  • add label svd:go — approve; Half-B dispatch accepts exactly this spec (open risks accepted)
  • add label svd:fire beside svd:go — approve AND authorise the Half-B fire from the phone; never on its own
  • add label svd:skip — park it; dispatch refuses it and the issue stays for a human
  • add label svd:respec — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context

Spec: /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-05-create-a-person-before-a-contact-or-email-exists.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-05-create-a-person-before-a-contact-or-email-exists.md

### ⏸ SVD architect gate: dev/people-mind-mcp#103 create-a-person-before-a-contact-or-email-exists **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 effort `high` **Run:** `20261105T233851Z-66edb6fc` **Held because:** CLEAN but 5 open risk(s) (1 verification · 4 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. D1: Should person.create accept Handles in its payload? The lean says no: Handles are added afterwards through the existing link.alias, which already enforces handle-owned, owner and tombstoned and charges the links bucket. The App view reaches it through the card's existing Attach control. The alternative folds alias ownership rules into create, so a create fails whole when a Handle is already held. Architect: confirm 'no Handles in create'. [decision] 2. D2: Where does the creation form start? The lean puts a 'New person' control inside the existing Person Card App view, shown when create_writable. That needs no new read tool and no change to ADR 0001 Amendment 1. The cost is that a host must already be showing some Person's card. The alternative is a dedicated read tool bound to CARD_URI that opens a create mode; it changes the fixed eleven-tool read surface (tests/test_server.py:105) and needs an ADR amendment. Is the in-card control acceptable for the issue's 'creation-form flows'? [decision] 3. D3: The 'context' fields on create are limited to organisation and title, stored as action-keyed asserted fields. A free-text context note would be note.add, a separate epic #96 kind that has no table today. Is this the intended reading of 'remember someone by name and context'? [decision] 4. D4 (pre-existing, not absorbed): actions.payload_digest keeps an unsalted SHA-256 of the canonical payload after apply and after Forget. For person.create that is a guessable digest of the name, organisation and title; link.alias and review.edit already leave the same residue. ADR 0003 Am.1 rule 7 accepts salted hashes only. Should Forget clear or re-key the digests of Actions on a forgotten Person (a #114 concern), or is this accepted residue? [decision] 5. V1: The suite asserts only logical absence (iterdump) of a forgotten created name; physical erasure relies on secure_delete=ON (store.py:176). Post-merge check: on a test copy, create 'Dr Bruce', alias a Handle, run graph.forget, run PRAGMA wal_checkpoint(TRUNCATE), then `grep -c 'Dr Bruce' pm.db` must return 0. This is not asserted in-suite because ADR 0003 Am.1 forbids an application checkpoint. [verification] **Change:** Add the Action kind person.create (create bucket, cap 50) through the existing outbox, worker and undo pipeline. 1. actions.py:23-30: add "person.create": "create" to KIND_BUCKET and add the kind to UNDOABLE. 2. graph.py: add a new create_person() beside assert_field (:631-649). It mirrors the new-Person branch of ingest_record (:371-377): INSERT_PERSON, then INSERT_NAME keyed ('action', str(action_id)) with kind primary, then INSERT_FIELD asserted rows for organisation and title whose Author is the token label (read as at :727), then _change(conn, 'add', pid). 3. graph.py, _apply_action: put the person.create branch BEFORE the undo fall-through at :743. It returns detail person=<pid> and the undo record {person_id, revision}. 4. graph.py, undo dispatcher: add an elif before the merge else at :789. - If the Person was merged away (canonical_id differs), answer conflict reason=redirected. - If any row reaches the Person other than the create action's own rows, answer conflict reason=contributions person=<pid> revision=<current>. Such rows are handles, source_links (live or retired), interactions, names/fields/tags not keyed to the action, relations on either side, suggestions, and redirects into the Person. - Otherwise run DELETE_PERSON (FK cascade) and _change 'del', mirroring forget at :526,530. 5. server.py: add people_create and the app-only people_card_create. - They share _create, which mirrors _review (:425-443): _author('create'), name stripped with a non-empty name_key and at most 200 chars, optional organisation and title, then _queue('person.create'). - Register both in build_app (:528-554), with people_card_create app-visible. - people_card_suggestions gains create_writable. 6. card.html: add a "New person" form inside load() (Edit-form pattern :95-107) that calls people_card_create. When the create is applied, call setPerson(new id); the card's existing Attach control then adds a Handle through link.alias, which already validates ownership. 7. Read projections need no change; views already render action-sourced names and fields. 8. Update README.md:80. No schema change. **Files:** `src/people_mind_mcp/actions.py` · `src/people_mind_mcp/graph.py` · `src/people_mind_mcp/server.py` · `src/people_mind_mcp/card.html` · `tests/test_create.py` · `tests/test_actions.py` · `tests/test_card_app.py` · `README.md` **Decision:** accept the 5 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`): - add label `svd:go` — approve; Half-B dispatch accepts exactly this spec (open risks accepted) - add label `svd:fire` **beside** `svd:go` — approve AND authorise the Half-B fire from the phone; never on its own - add label `svd:skip` — park it; dispatch refuses it and the issue stays for a human - add label `svd:respec` — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context <sub>Spec: `/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-05-create-a-person-before-a-contact-or-email-exists.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-05-create-a-person-before-a-contact-or-email-exists.md`</sub>
Collaborator

spec-verify-dispatch Half B for dev/people-mind-mcp#103 create-a-person-before-a-contact-or-email-exists completed integration verify.

  • PR: #135
  • Branch: feat/svd-dev-people-mind-mcp-103-create-a-person-before-a-con-55c5b375
  • Commit: 81fec5d272
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/73/pipeline/90/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • Warning: Bare python3 -m pytest lacks project deps (No module named phonenumbers); collection and tests were run through uv run / make check, which provisions them.
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261105T235237Z-55c5b375 --confirm-merge)
spec-verify-dispatch Half B for dev/people-mind-mcp#103 create-a-person-before-a-contact-or-email-exists completed integration verify. - PR: https://git.groupthink.asia/dev/people-mind-mcp/pulls/135 - Branch: feat/svd-dev-people-mind-mcp-103-create-a-person-before-a-con-55c5b375 - Commit: 81fec5d272d07c67a9a7cbeb6db6383676542e3c - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/73/pipeline/90/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - Warning: Bare python3 -m pytest lacks project deps (No module named phonenumbers); collection and tests were run through uv run / make check, which provisions them. - CI wait: ci/woodpecker/pr/validation -> pass - Decision: review the PR and merge? (`codex-svd ship --run-id 20261105T235237Z-55c5b375 --confirm-merge`)
svc-svd-writer 2026-11-06 00:05:47 +00:00
  • closed this issue
  • removed the
    svd:go
    label
Author
Member

This was generated by AI during triage.

SVD gate and ship record: #103 (architect gate 2026-11-06, merge 11:05 AEDT)

Measured facts

  • Half-A run 20261105T233851Z-66edb6fc: CLEAN, 0 blocking defects, class substrate, 8 primary files, 28 of 28 source hashes matched 96f0dd8.
  • Half-B run 20261105T235237Z-55c5b375: PR #135 at 81fec5d, CI ci/woodpecker/pr/validation pass, no rework, integrate head equal to the dispatch commit, all 13 spec-named tests in tests/test_create.py present.
  • Merged as 2ba707e; svd:go stripped by ship.

Buckets

  • Already decided: creation undo, by ADR 0005 Amendment 1 inventory row person.create | create | undo; conflict if later contributions exist; key-only idempotency (ruling 9); no expected revision (ruling 10); feed add and del (ruling 18).
  • Verification: V1, physical erasure of a created name after Forget and PRAGMA wal_checkpoint(TRUNCATE). This is a post-merge operator check on a test copy, because ADR 0003 Amendment 1 forbids an application checkpoint.
  • Genuinely open: D4, the unsalted actions.payload_digest residue. It is pre-existing and routes to #114 and #55.

Ruling

  • D1: person.create takes no Handles. link.alias adds them afterwards and validates ownership.
  • D2: the creation form is a "New person" control in the Person Card App view. No new read tool.
  • D3: context on create is organisation and title. Free-text notes stay with #100.
  • D4: not absorbed; routed to #114.
  • GO, then merge.

Drafted line

codex-svd ship --run-id 20261105T235237Z-55c5b375 --confirm-merge (run, exit 0).

Delegation

"go 103 auto-gate" (gate); "I auth this session T4 merge and svd:go write, through 14:00aedt" (merge and label).

Spec: 2026-11-05-create-a-person-before-a-contact-or-email-exists.md, Agent Adjustments. Ledger: 2026-W45-arch.

> *This was generated by AI during triage.* **SVD gate and ship record: #103** (architect gate 2026-11-06, merge 11:05 AEDT) **Measured facts** - Half-A run `20261105T233851Z-66edb6fc`: CLEAN, 0 blocking defects, class `substrate`, 8 primary files, 28 of 28 source hashes matched `96f0dd8`. - Half-B run `20261105T235237Z-55c5b375`: PR #135 at `81fec5d`, CI `ci/woodpecker/pr/validation` pass, no rework, integrate head equal to the dispatch commit, all 13 spec-named tests in `tests/test_create.py` present. - Merged as `2ba707e`; `svd:go` stripped by ship. **Buckets** - Already decided: creation undo, by ADR 0005 Amendment 1 inventory row `person.create | create | undo; conflict if later contributions exist`; key-only idempotency (ruling 9); no expected revision (ruling 10); feed `add` and `del` (ruling 18). - Verification: V1, physical erasure of a created name after Forget and `PRAGMA wal_checkpoint(TRUNCATE)`. This is a post-merge operator check on a test copy, because ADR 0003 Amendment 1 forbids an application checkpoint. - Genuinely open: D4, the unsalted `actions.payload_digest` residue. It is pre-existing and routes to #114 and #55. **Ruling** - D1: `person.create` takes no Handles. `link.alias` adds them afterwards and validates ownership. - D2: the creation form is a "New person" control in the Person Card App view. No new read tool. - D3: context on create is organisation and title. Free-text notes stay with #100. - D4: not absorbed; routed to #114. - GO, then merge. **Drafted line** `codex-svd ship --run-id 20261105T235237Z-55c5b375 --confirm-merge` (run, exit 0). **Delegation** "go 103 auto-gate" (gate); "I auth this session T4 merge and svd:go write, through 14:00aedt" (merge and label). Spec: `2026-11-05-create-a-person-before-a-contact-or-email-exists.md`, Agent Adjustments. Ledger: `2026-W45-arch`.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
dev/people-mind-mcp#103
No description provided.