Correct Organisations, aliases and domain associations #106

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

Parent

#96

What to build

Correct an Organisation from Person context and make rejected domain-derived associations stay corrected.

Acceptance criteria

  • Names, aliases and explicit domain corrections retain asserted/derived provenance and rejected claims remain suppressed after sync.
  • Conflicting domain ownership is reported for review; do not automatically transfer domains or merge Persons.
  • Related-person/search results refresh while previous facts remain attributable.
  • Use existing works_at labels for role distinctions; no new Relation type or cross-provider identity rule is invented.
  • Test domain rejection, alias lookup, collision refusal, undo and orphan Organisation erasure.
  • 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 Correct an Organisation from Person context and make rejected domain-derived associations stay corrected. ## Acceptance criteria - [ ] Names, aliases and explicit domain corrections retain asserted/derived provenance and rejected claims remain suppressed after sync. - [ ] Conflicting domain ownership is reported for review; do not automatically transfer domains or merge Persons. - [ ] Related-person/search results refresh while previous facts remain attributable. - [ ] Use existing works_at labels for role distinctions; no new Relation type or cross-provider identity rule is invented. - [ ] Test domain rejection, alias lookup, collision refusal, undo and orphan Organisation erasure. - [ ] 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#106 correct-organisations-aliases-and-domain-associations

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: 20261107T013311Z-6cf6151b

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

Open risks:

  1. D1: What does 'reported for review' mean for a domain conflict? Lean: org.domain.assign of a domain another Organisation holds ends failed reason=domain-owned org=, visible in people_actions and the App status; nothing moves or merges, and sync cannot create a conflict because org_domains.domain is the primary key. Question: is a failed Action naming the owner enough, or must a conflict also persist as a review-queue item (a new surface this slice does not build)? [decision]
  2. D2: What does a rejection suppress? Lean: a rejected domain that no Organisation owns derives no Organisation for anyone (_derived_orgs skips it), rather than sync creating a fresh Organisation on the next changed record; assigning the domain elsewhere re-enables derivation for that Organisation. Question: should a rejection instead suppress only the (domain, Organisation) pair and let sync derive a new Organisation for the domain? [decision]
  3. D3: Name and alias collisions across Organisations. Lean: only domain collisions refuse; an alias duplicating this Organisation's own name or alias refuses alias-present; two Organisations may share a name or alias (no Organisation-merge kind exists), so alias lookup returns both sets of members. Question: should org.alias and org.rename also refuse alias-owned org= on a cross-Organisation match? [decision]
  4. D4: Lean: org.alias carries an expected revision, because ADR 0005 Am.1 ruling 10 lists the pure additions exhaustively and org.alias is not one. Question: confirm, or treat it as a revision-free pure addition like link.alias (Am.2 r2)? [decision]
  5. D5: The Forget orphan rule. Lean: an asserted name, an asserted domain, any alias or any rejection keeps the Organisation (ADR 0003 Am.1 r5, read literally); the has-a-domain precondition is dropped so a domain-less shell named after a forgotten domain is erased; rejections and undo records for domains no remaining Handle carries are erased; derived domains on a surviving Organisation stay, as today. Question: should Forget also strip derived domains that only the forgotten Person carried from an Organisation that survives because of an asserted name or a Relation? That changes behaviour that predates this slice. [decision]
  6. V1: Blocker #98 closed on the forge. Git shows #98's surface on main (726d113, 297468f, the suggestions table, review.accept), but this sandbox cannot read issue state. Check: gh issue view 98 -R dev/people-mind-mcp --json state -q .state returns CLOSED on git.groupthink.asia. [verification]
  7. V2: Repository checks green after the change. No numeric baseline was measured (Half A is read-only and pytest writes caches). Check: in the dispatch worktree, record make check and the focused pytest command on pristine f616f5a before the first edit; after the change both pass and the failure set is unchanged except for the new passing tests. [verification]

Change: Mirror #102 (commit f616f5a) across the same file set. Schema 19 in store.py follows the UPGRADES/TABLES/INDEXES pattern (store.py:95-157): organisations.revision/name_author/name_action_id, org_aliases author/action_id/created_at, org_domains kind/author/action_id, and a new org_domain_rejections table. actions.py adds ORG_KINDS to KIND_BUCKET (organisations) and UNDOABLE. graph.py gains _apply_org/_undo_org, copying _apply_relation/_undo_relation (graph.py:1585-1684) and routed beside graph.py:2313 and :2510. They implement org.rename, org.alias, org.domain.assign (refuses domain-owned org=, public-domain, domain-present) and org.domain.reject, with content-checked undo; the _derive_domain/_underive helpers refresh derived rows and Suggestions and emit update per member. _derived_orgs (graph.py:446-464) skips a rejected, unowned domain. drain_actions (:2696) falls back to org_id for undo_records.person_id. Forget (graph.py:1041-1135) gets a provenance-aware ORPHAN_DERIVED_ORGANISATION without the EXISTS-domain precondition, and erases rejections and undo records for domains no remaining Handle holds. views.py: _organisation_candidates matches aliases; card_suggestions adds an organisation_details key (the organisations key is unchanged); card() adds Organisation rows only with revisions=true. server.py: people_org/people_card_org copy the people_relation pair (server.py:633-744) and are mounted in build_app. card.html copies the relation App section (card.html:221-331).

Files: src/people_mind_mcp/store.py · src/people_mind_mcp/actions.py · src/people_mind_mcp/graph.py · src/people_mind_mcp/views.py · src/people_mind_mcp/server.py · src/people_mind_mcp/card.html · README.md · tests/test_organisations.py · tests/test_actions.py · tests/test_card_app.py · tests/test_relations.py

Decision: accept the 7 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-07-correct-organisations-aliases-and-domain-associations.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-07-correct-organisations-aliases-and-domain-associations.md

### ⏸ SVD architect gate: dev/people-mind-mcp#106 correct-organisations-aliases-and-domain-associations **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:** `20261107T013311Z-6cf6151b` **Held because:** CLEAN but 7 open risk(s) (2 verification · 5 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. D1: What does 'reported for review' mean for a domain conflict? Lean: org.domain.assign of a domain another Organisation holds ends failed reason=domain-owned org=<owner id>, visible in people_actions and the App status; nothing moves or merges, and sync cannot create a conflict because org_domains.domain is the primary key. Question: is a failed Action naming the owner enough, or must a conflict also persist as a review-queue item (a new surface this slice does not build)? [decision] 2. D2: What does a rejection suppress? Lean: a rejected domain that no Organisation owns derives no Organisation for anyone (_derived_orgs skips it), rather than sync creating a fresh Organisation on the next changed record; assigning the domain elsewhere re-enables derivation for that Organisation. Question: should a rejection instead suppress only the (domain, Organisation) pair and let sync derive a new Organisation for the domain? [decision] 3. D3: Name and alias collisions across Organisations. Lean: only domain collisions refuse; an alias duplicating this Organisation's own name or alias refuses alias-present; two Organisations may share a name or alias (no Organisation-merge kind exists), so alias lookup returns both sets of members. Question: should org.alias and org.rename also refuse alias-owned org=<other> on a cross-Organisation match? [decision] 4. D4: Lean: org.alias carries an expected revision, because ADR 0005 Am.1 ruling 10 lists the pure additions exhaustively and org.alias is not one. Question: confirm, or treat it as a revision-free pure addition like link.alias (Am.2 r2)? [decision] 5. D5: The Forget orphan rule. Lean: an asserted name, an asserted domain, any alias or any rejection keeps the Organisation (ADR 0003 Am.1 r5, read literally); the has-a-domain precondition is dropped so a domain-less shell named after a forgotten domain is erased; rejections and undo records for domains no remaining Handle carries are erased; derived domains on a surviving Organisation stay, as today. Question: should Forget also strip derived domains that only the forgotten Person carried from an Organisation that survives because of an asserted name or a Relation? That changes behaviour that predates this slice. [decision] 6. V1: Blocker #98 closed on the forge. Git shows #98's surface on main (726d113, 297468f, the suggestions table, review.accept), but this sandbox cannot read issue state. Check: gh issue view 98 -R dev/people-mind-mcp --json state -q .state returns CLOSED on git.groupthink.asia. [verification] 7. V2: Repository checks green after the change. No numeric baseline was measured (Half A is read-only and pytest writes caches). Check: in the dispatch worktree, record make check and the focused pytest command on pristine f616f5a before the first edit; after the change both pass and the failure set is unchanged except for the new passing tests. [verification] **Change:** Mirror #102 (commit f616f5a) across the same file set. Schema 19 in store.py follows the UPGRADES/TABLES/INDEXES pattern (store.py:95-157): organisations.revision/name_author/name_action_id, org_aliases author/action_id/created_at, org_domains kind/author/action_id, and a new org_domain_rejections table. actions.py adds ORG_KINDS to KIND_BUCKET (organisations) and UNDOABLE. graph.py gains _apply_org/_undo_org, copying _apply_relation/_undo_relation (graph.py:1585-1684) and routed beside graph.py:2313 and :2510. They implement org.rename, org.alias, org.domain.assign (refuses domain-owned org=<other>, public-domain, domain-present) and org.domain.reject, with content-checked undo; the _derive_domain/_underive helpers refresh derived rows and Suggestions and emit update per member. _derived_orgs (graph.py:446-464) skips a rejected, unowned domain. drain_actions (:2696) falls back to org_id for undo_records.person_id. Forget (graph.py:1041-1135) gets a provenance-aware ORPHAN_DERIVED_ORGANISATION without the EXISTS-domain precondition, and erases rejections and undo records for domains no remaining Handle holds. views.py: _organisation_candidates matches aliases; card_suggestions adds an organisation_details key (the organisations key is unchanged); card() adds Organisation rows only with revisions=true. server.py: people_org/people_card_org copy the people_relation pair (server.py:633-744) and are mounted in build_app. card.html copies the relation App section (card.html:221-331). **Files:** `src/people_mind_mcp/store.py` · `src/people_mind_mcp/actions.py` · `src/people_mind_mcp/graph.py` · `src/people_mind_mcp/views.py` · `src/people_mind_mcp/server.py` · `src/people_mind_mcp/card.html` · `README.md` · `tests/test_organisations.py` · `tests/test_actions.py` · `tests/test_card_app.py` · `tests/test_relations.py` **Decision:** accept the 7 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-07-correct-organisations-aliases-and-domain-associations.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-07-correct-organisations-aliases-and-domain-associations.md`</sub>
Collaborator

spec-verify-dispatch Half B for dev/people-mind-mcp#106 correct-organisations-aliases-and-domain-associations completed integration verify.

  • PR: #153
  • Branch: feat/svd-dev-people-mind-mcp-106-correct-organisations-aliase-33fda8c4
  • Commit: b08dd5f2a2
  • 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/124/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • Warning: The two test_embed.py failures the subagent reported are fixed by head commit b08dd5f, which corrects the embedding fixtures for schema 19. tests/test_embed.py is not a file the spec named for edits, but the change is a small fixture fix.
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Rework: 1 round(s), outcome converged
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261107T015733Z-33fda8c4 --confirm-merge)
spec-verify-dispatch Half B for dev/people-mind-mcp#106 correct-organisations-aliases-and-domain-associations completed integration verify. - PR: https://git.groupthink.asia/dev/people-mind-mcp/pulls/153 - Branch: feat/svd-dev-people-mind-mcp-106-correct-organisations-aliase-33fda8c4 - Commit: b08dd5f2a2427201b2a44f3c4a5fb6cdefd69dd0 - 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/124/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - Warning: The two test_embed.py failures the subagent reported are fixed by head commit b08dd5f, which corrects the embedding fixtures for schema 19. tests/test_embed.py is not a file the spec named for edits, but the change is a small fixture fix. - CI wait: ci/woodpecker/pr/validation -> pass - Rework: 1 round(s), outcome converged - Decision: review the PR and merge? (`codex-svd ship --run-id 20261107T015733Z-33fda8c4 --confirm-merge`)
svc-svd-writer 2026-11-07 02:25:22 +00:00
  • closed this issue
  • removed the
    svd:go
    label
Author
Member

This was generated by AI during triage.

SVD gate and ship record: #106 (einfari gate 2026-11-07, merge 13:24 AEDT)

Measured facts

  • Half-A 20261107T013311Z-6cf6151b: CLEAN, class substrate, 11 Primary Files, base f616f5a, 22 source hashes. Schema 19 is additive: organisations gains revision, name_author and name_action_id, and a new org_domain_rejections table holds rejected domains.
  • The spec left five decisions open (D1 to D5). The operator accepted every lean.
  • Dispatch 20261107T015733Z-33fda8c4 on codex/gpt-6.1-sol committed 8bbe792 and opened PR #153. Its own make check gave 781 passed and 2 failed. Both failures are in tests/test_embed.py, outside the Primary Files: two fixtures run a positional three-column INSERT INTO organisations, which the schema-19 table refuses. The agent left them unedited, as rider 4 told it to.
  • Gate rider 7 (below) named that edit. Integrate ran one rework round on sol, which changed only those two fixture lines and committed b08dd5f. Integrate: readyForMerge true, rework converged, CI ci/woodpecker/pr/validation success.
  • Own execution at b08dd5f: make check gave 783 passed, 5 skipped, 0 failed. The base gave 769 passed. The Python 3.12 import of people_mind_mcp.cli and people_mind_mcp.server succeeds. test_forget_removes_only_orphaned_derived_organisations passes, and tests/test_identity.py is unchanged.
  • The 12 changed files are the Primary Files exactly, with tests/test_embed.py added by rider 7. All spec-named tests are present. No nested .git. card.html adds no innerHTML, no http(s):// and no eval(.
  • Merged as a4a6754.

Buckets

  • Already decided:
    • ADR 0002 decision 8 and Amendment 4 (pending as PR #152).
    • ADR 0003 Amendment 1 ruling 5 (derived-Organisation orphan erasure).
    • ADR 0005 Amendment 1: the inventory rows and rulings 8 to 15.
    • Amendment 5 ruling 15.
  • Decided at this gate (operator "proceed"):
    • D1: a domain-owned refusal is the report. It makes no review-queue item.
    • D2: a rejected domain that no Organisation owns derives no Organisation.
    • D3: only domains collide across Organisations. alias-present applies within one Organisation.
    • D4: org.alias carries a revision.
    • D5: an asserted name, an asserted domain, any alias or any rejection keeps an Organisation through Forget. Forget erases a rejection whose domain no remaining Handle carries. Forget does not strip derived domains from a surviving Organisation; that residue is logged on #114.
  • Decided at the Half-B gate (no new design): rider 7 adds tests/test_embed.py to the Primary Files and names one edit, which gives the two fixture INSERTs explicit columns. It changes no behaviour.
  • Verification (post-merge operator checks):
    • The Card App Organisation flow in an MCP Apps host: rename, alias, domain assign and reject, then stale-view.

Ruling

  • Migration: test_schema_19_migrates_on_writer_open covers the upgrade from user_version=18.
  • GO with rider 7, then merge.

Drafted line

codex-svd ship --run-id 20261107T015733Z-33fda8c4 --confirm-merge (run, exit 0).

Delegation

"this session is an einfari. you merge through 19:00", extended by "extend grant through 19:00" (gate, svd:go and merge). "proceed" (D1 to D5). Standing pick "Throughput is more important than cost" (sol on substrate dispatch).

Spec: 2026-11-07-correct-organisations-aliases-and-domain-associations.md, Agent Adjustments, riders 1 to 7. Ledger: 2026-W45-arch.

> *This was generated by AI during triage.* **SVD gate and ship record: #106** (einfari gate 2026-11-07, merge 13:24 AEDT) **Measured facts** - Half-A `20261107T013311Z-6cf6151b`: CLEAN, class `substrate`, 11 Primary Files, base `f616f5a`, 22 source hashes. Schema 19 is additive: `organisations` gains `revision`, `name_author` and `name_action_id`, and a new `org_domain_rejections` table holds rejected domains. - The spec left five decisions open (D1 to D5). The operator accepted every lean. - Dispatch `20261107T015733Z-33fda8c4` on `codex/gpt-6.1-sol` committed `8bbe792` and opened PR #153. Its own `make check` gave 781 passed and 2 failed. Both failures are in `tests/test_embed.py`, outside the Primary Files: two fixtures run a positional three-column `INSERT INTO organisations`, which the schema-19 table refuses. The agent left them unedited, as rider 4 told it to. - Gate rider 7 (below) named that edit. Integrate ran one rework round on sol, which changed only those two fixture lines and committed `b08dd5f`. Integrate: `readyForMerge` true, rework `converged`, CI `ci/woodpecker/pr/validation` success. - Own execution at `b08dd5f`: `make check` gave 783 passed, 5 skipped, 0 failed. The base gave 769 passed. The Python 3.12 import of `people_mind_mcp.cli` and `people_mind_mcp.server` succeeds. `test_forget_removes_only_orphaned_derived_organisations` passes, and `tests/test_identity.py` is unchanged. - The 12 changed files are the Primary Files exactly, with `tests/test_embed.py` added by rider 7. All spec-named tests are present. No nested `.git`. `card.html` adds no `innerHTML`, no `http(s)://` and no `eval(`. - Merged as `a4a6754`. **Buckets** - Already decided: - ADR 0002 decision 8 and Amendment 4 (pending as PR #152). - ADR 0003 Amendment 1 ruling 5 (derived-Organisation orphan erasure). - ADR 0005 Amendment 1: the inventory rows and rulings 8 to 15. - Amendment 5 ruling 15. - Decided at this gate (operator "proceed"): - D1: a `domain-owned` refusal is the report. It makes no review-queue item. - D2: a rejected domain that no Organisation owns derives no Organisation. - D3: only domains collide across Organisations. `alias-present` applies within one Organisation. - D4: `org.alias` carries a revision. - D5: an asserted name, an asserted domain, any alias or any rejection keeps an Organisation through Forget. Forget erases a rejection whose domain no remaining Handle carries. Forget does not strip derived domains from a surviving Organisation; that residue is logged on #114. - Decided at the Half-B gate (no new design): rider 7 adds `tests/test_embed.py` to the Primary Files and names one edit, which gives the two fixture INSERTs explicit columns. It changes no behaviour. - Verification (post-merge operator checks): - The Card App Organisation flow in an MCP Apps host: rename, alias, domain assign and reject, then stale-view. **Ruling** - Migration: `test_schema_19_migrates_on_writer_open` covers the upgrade from `user_version=18`. - GO with rider 7, then merge. **Drafted line** `codex-svd ship --run-id 20261107T015733Z-33fda8c4 --confirm-merge` (run, exit 0). **Delegation** "this session is an einfari. you merge through 19:00", extended by "extend grant through 19:00" (gate, `svd:go` and merge). "proceed" (D1 to D5). Standing pick "Throughput is more important than cost" (sol on substrate dispatch). Spec: `2026-11-07-correct-organisations-aliases-and-domain-associations.md`, Agent Adjustments, riders 1 to 7. 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#106
No description provided.