Store, config, identity model and the vCard Source #3

Closed
opened 2026-11-01 01:59:21 +00:00 by svc-agent-writer · 2 comments

Parent: #1. Records: ADR 0001, 0002, 0003, 0004 and GLOSSARY.md.

What to build

The foundation every other Phase A slice sits on. A Python 3.12 package with FastMCP 3.x pinned, mypy --strict, ruff with S, line length 120, mirroring mailmind's conventions.

  • Config: TOML parsed with pydantic. Every secret is a file path. Sections for the owner ([owner], the flagged Owner Person), default_region for E.164, the field list for the default row, the confidence threshold (default 0.7), and one block per Source. No env-var credentials.
  • Store: one SQLite database with a writer mode and a reader mode. Tables for Persons with opaque p_ ids, Organisations with o_ ids, Handles (email, phone, URL, plus-tag aware), asserted and derived fields with author, Source, evidence reference, confidence and time, Relations from the closed set plus a free label, Tags, Interactions as rows with channel and direction, Tombstones with salted SHA-256 hashes, a change log of add, update, merge, del events, and Consumer positions.
  • Identity and merge (ADR 0002): silent merge only on an exact Handle; name matches produce ranked Candidates with reasons; the survivor is the Person with more asserted fields and the loser id redirects; a plus-tagged address is its own Handle; phones normalised to E.164 with default_region; Organisations derived from non-public domains only.
  • Forget (ADR 0003): a Forget removes the Person, writes a Tombstone per Handle, and a later sync of the same Handle is refused. No undo.
  • The vCard Source: a folder or file of vCards, imported as asserted fields with the Source as author. CardDAV groups and vCard categories become Tags. Re-import is idempotent.
  • CLI: peoplemind check (config and store health, offline), peoplemind sync --once for the vCard Source.

Acceptance criteria

  • Resolution tests: an exact Handle returns one Person; two same-name Persons return ranked Candidates with reasons; a plus-tagged address is a Candidate, never a merge; a merge redirects the loser id.
  • Phone normalisation tests with at least two regions.
  • Forget tests: a Forget tombstones every Handle; a re-import of a tombstoned Handle creates nothing; the Tombstone stores a salted hash, never the Handle.
  • Field provenance: every stored field carries author, Source, confidence and time; a Source-supplied field is asserted.
  • Log scan: a fixture import's log output contains no address, phone or name. A test asserts it.
  • vCard import of 50 synthetic cards is idempotent: a second import changes nothing and the change log gains no events.
  • Tests run with python3 -m pytest and a --basetemp under mktemp -d, never inside the worktree.

Blocked by

  • none

Filed under: operator word "go. compelling public-facing README.md as A0" sha256:3f9e946994fa

Parent: #1. Records: ADR 0001, 0002, 0003, 0004 and GLOSSARY.md. ## What to build The foundation every other Phase A slice sits on. A Python 3.12 package with FastMCP 3.x pinned, `mypy --strict`, ruff with `S`, line length 120, mirroring mailmind's conventions. - Config: TOML parsed with pydantic. Every secret is a file path. Sections for the owner (`[owner]`, the flagged Owner Person), `default_region` for E.164, the field list for the default row, the confidence threshold (default 0.7), and one block per Source. No env-var credentials. - Store: one SQLite database with a writer mode and a reader mode. Tables for Persons with opaque `p_` ids, Organisations with `o_` ids, Handles (email, phone, URL, plus-tag aware), asserted and derived fields with author, Source, evidence reference, confidence and time, Relations from the closed set plus a free label, Tags, Interactions as rows with channel and direction, Tombstones with salted SHA-256 hashes, a change log of `add`, `update`, `merge`, `del` events, and Consumer positions. - Identity and merge (ADR 0002): silent merge only on an exact Handle; name matches produce ranked Candidates with reasons; the survivor is the Person with more asserted fields and the loser id redirects; a plus-tagged address is its own Handle; phones normalised to E.164 with `default_region`; Organisations derived from non-public domains only. - Forget (ADR 0003): a Forget removes the Person, writes a Tombstone per Handle, and a later sync of the same Handle is refused. No undo. - The vCard Source: a folder or file of vCards, imported as asserted fields with the Source as author. CardDAV groups and vCard categories become Tags. Re-import is idempotent. - CLI: `peoplemind check` (config and store health, offline), `peoplemind sync --once` for the vCard Source. ## Acceptance criteria - Resolution tests: an exact Handle returns one Person; two same-name Persons return ranked Candidates with reasons; a plus-tagged address is a Candidate, never a merge; a merge redirects the loser id. - Phone normalisation tests with at least two regions. - Forget tests: a Forget tombstones every Handle; a re-import of a tombstoned Handle creates nothing; the Tombstone stores a salted hash, never the Handle. - Field provenance: every stored field carries author, Source, confidence and time; a Source-supplied field is `asserted`. - Log scan: a fixture import's log output contains no address, phone or name. A test asserts it. - vCard import of 50 synthetic cards is idempotent: a second import changes nothing and the change log gains no events. - Tests run with `python3 -m pytest` and a `--basetemp` under `mktemp -d`, never inside the worktree. ## Blocked by - none Filed under: operator word "go. compelling public-facing README.md as A0" sha256:3f9e946994fa
Collaborator

⏸ SVD architect gate: dev/peoplemind-mcp#3 store-config-identity-model-and-the-vcard-source

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: 20261101T020828Z-e88ed999

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

Open risks:

  1. The issue says to mirror mailmind's conventions, but every read of /Users/piers/src/imap-mailmind-mcp returned EPERM in the Half-A sandbox, so the spec sets its own defaults: hatchling, the src layout, the import name peoplemind, an argparse CLI, vobject for parsing, and the ruff rules E/F/W/I/B/UP/S at line length 120. Question: accept these defaults, or require dispatch to adopt mailmind's exact pyproject tool tables and CLI library, with a diff in the PR body? [decision]
  2. Tombstones are per-Handle only (ADR 0003 §8). If a Forgotten Person's vCard has a name but no email, phone or URL, the next sync recreates them. Question: should Forget also tombstone a salted hash of each (source, source_record) link? That would need an ADR 0003 amendment. Or is handle-only correct as written? [decision]
  3. Under the lean, any Source record carrying an Owner Handle is skipped whole (skipped_owner) and never merged into the Owner, per ADR 0002 §6. As a result, the vCard's title or organisation for the Owner is dropped. Question: confirm skipping the whole record, or attach the record's asserted fields (never its Handles) to the Owner Person? [decision]
  4. The FastMCP 3.x pin was not resolved at spec time because the sandbox has neither network nor uv. Check at dispatch: uv lock succeeds, uv tree --depth 1 | grep fastmcp shows a 3.x version, and uv lock --check passes. If no 3.x release resolves, halt and report rather than pin 2.x. [verification]
  5. libphonenumber validity of the AU and GB fixture numbers is unverified because phonenumbers is not installed in the sandbox. Check: uv run python3 -m pytest tests/test_identity.py -k phone --basetemp "$(mktemp -d)/pt" passes. The make_cards fixture asserts is_valid_number on every number, so an invalid fixture number fails loudly. [verification]

Change: Greenfield: the repo at d1bdf43 holds only the glossary and the ADRs, so there is no in-tree pattern to mirror, and mailmind was EPERM in the sandbox (no mailmind line was cited). The lean follows the ADRs read this session: ADR 0002 lines 11-18 (identity, merge, resolution tiers), ADR 0003 lines 11-18 (provenance, confidence, log discipline, Forget and Tombstones) and ADR 0004 lines 11-12 (Source protocol, field vocabulary). Layout: store.py (one SQLite file; open_writer migrates by user_version, open_reader is mode=ro and query_only) → handles.py (the single normaliser: lowercased email with a plus-stripped candidate form, E.164 via phonenumbers with raw-unmatchable fallback, HMAC-SHA256 tombstone hash, public-domain list) → graph.py (the only writer: ensure_owner, ingest_record with tombstone/owner/unchanged short-circuits and per-(source, source_record) row replacement, derived Organisation at 0.75 or 0.9, merge_persons with the survivor rule and a flattened redirect, forget with confirm/owner refusals and a cascade delete) → identity.py (resolve: tiers 1-5, Exact short-circuit, ranked Candidates with reasons; canonical_id follows redirects) → sources/{init,vcard}.py (SourceRecord protocol; vobject parsing with group/CATEGORIES mapped to source-prefixed Tags) → cli.py (argparse check offline and sync --once, key=value counts-only output) → config.py (pydantic v2 extra=forbid, secrets as file paths, errors without input echo).

Files: pyproject.toml · uv.lock · src/peoplemind/__init__.py · src/peoplemind/config.py · src/peoplemind/store.py · src/peoplemind/handles.py · src/peoplemind/identity.py · src/peoplemind/graph.py · src/peoplemind/sources/__init__.py · src/peoplemind/sources/vcard.py · src/peoplemind/cli.py · tests/conftest.py · tests/test_identity.py · tests/test_vcard_sync.py · tests/test_config_cli.py
Derived artifacts: uv.lock (unattested — exists claim failed)

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-01-store-config-identity-model-and-the-vcard-source.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-01-store-config-identity-model-and-the-vcard-source.md

### ⏸ SVD architect gate: dev/peoplemind-mcp#3 store-config-identity-model-and-the-vcard-source **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:** `20261101T020828Z-e88ed999` **Held because:** CLEAN but 5 open risk(s) (2 verification · 3 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. The issue says to mirror mailmind's conventions, but every read of /Users/piers/src/imap-mailmind-mcp returned EPERM in the Half-A sandbox, so the spec sets its own defaults: hatchling, the src layout, the import name peoplemind, an argparse CLI, vobject for parsing, and the ruff rules E/F/W/I/B/UP/S at line length 120. Question: accept these defaults, or require dispatch to adopt mailmind's exact pyproject tool tables and CLI library, with a diff in the PR body? [decision] 2. Tombstones are per-Handle only (ADR 0003 §8). If a Forgotten Person's vCard has a name but no email, phone or URL, the next sync recreates them. Question: should Forget also tombstone a salted hash of each (source, source_record) link? That would need an ADR 0003 amendment. Or is handle-only correct as written? [decision] 3. Under the lean, any Source record carrying an Owner Handle is skipped whole (skipped_owner) and never merged into the Owner, per ADR 0002 §6. As a result, the vCard's title or organisation for the Owner is dropped. Question: confirm skipping the whole record, or attach the record's asserted fields (never its Handles) to the Owner Person? [decision] 4. The FastMCP 3.x pin was not resolved at spec time because the sandbox has neither network nor uv. Check at dispatch: `uv lock` succeeds, `uv tree --depth 1 | grep fastmcp` shows a 3.x version, and `uv lock --check` passes. If no 3.x release resolves, halt and report rather than pin 2.x. [verification] 5. libphonenumber validity of the AU and GB fixture numbers is unverified because phonenumbers is not installed in the sandbox. Check: `uv run python3 -m pytest tests/test_identity.py -k phone --basetemp "$(mktemp -d)/pt"` passes. The make_cards fixture asserts is_valid_number on every number, so an invalid fixture number fails loudly. [verification] **Change:** Greenfield: the repo at d1bdf43 holds only the glossary and the ADRs, so there is no in-tree pattern to mirror, and mailmind was EPERM in the sandbox (no mailmind line was cited). The lean follows the ADRs read this session: ADR 0002 lines 11-18 (identity, merge, resolution tiers), ADR 0003 lines 11-18 (provenance, confidence, log discipline, Forget and Tombstones) and ADR 0004 lines 11-12 (Source protocol, field vocabulary). Layout: store.py (one SQLite file; open_writer migrates by user_version, open_reader is mode=ro and query_only) → handles.py (the single normaliser: lowercased email with a plus-stripped candidate form, E.164 via phonenumbers with raw-unmatchable fallback, HMAC-SHA256 tombstone hash, public-domain list) → graph.py (the only writer: ensure_owner, ingest_record with tombstone/owner/unchanged short-circuits and per-(source, source_record) row replacement, derived Organisation at 0.75 or 0.9, merge_persons with the survivor rule and a flattened redirect, forget with confirm/owner refusals and a cascade delete) → identity.py (resolve: tiers 1-5, Exact short-circuit, ranked Candidates with reasons; canonical_id follows redirects) → sources/{__init__,vcard}.py (SourceRecord protocol; vobject parsing with group/CATEGORIES mapped to source-prefixed Tags) → cli.py (argparse `check` offline and `sync --once`, key=value counts-only output) → config.py (pydantic v2 extra=forbid, secrets as file paths, errors without input echo). **Files:** `pyproject.toml` · `uv.lock` · `src/peoplemind/__init__.py` · `src/peoplemind/config.py` · `src/peoplemind/store.py` · `src/peoplemind/handles.py` · `src/peoplemind/identity.py` · `src/peoplemind/graph.py` · `src/peoplemind/sources/__init__.py` · `src/peoplemind/sources/vcard.py` · `src/peoplemind/cli.py` · `tests/conftest.py` · `tests/test_identity.py` · `tests/test_vcard_sync.py` · `tests/test_config_cli.py` **Derived artifacts:** `uv.lock` (unattested — exists claim failed) **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-01-store-config-identity-model-and-the-vcard-source.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-01-store-config-identity-model-and-the-vcard-source.md`</sub>
Collaborator

spec-verify-dispatch Half B for dev/peoplemind-mcp#3 store-config-identity-model-and-the-vcard-source completed integration verify.

  • PR: dev/peoplemind-mcp#12
  • Branch: feat/svd-dev-peoplemind-mcp-3-store-config-identity-model-and-334c8ca4
  • Commit: 15663e389e
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Checks: PR #12 head 15663e3: no commit statuses, no required checks (none to report). Local: 53 pytest passed, mypy --strict clean, ruff check and format clean.
  • Warning: No commit statuses exist on PR head 15663e3 and the repo has no required checks, so remote CI is absent and not evidence either way.
  • Warning: The plus-tag test description conflicts with tier-1 Exact short-circuiting. The subagent kept Exact for stored Handles and tested stripped candidates when no exact Handle exists. Review this at the architect gate.
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261101T022918Z-334c8ca4 --confirm-merge)
spec-verify-dispatch Half B for dev/peoplemind-mcp#3 store-config-identity-model-and-the-vcard-source completed integration verify. - PR: https://git.groupthink.asia/dev/peoplemind-mcp/pulls/12 - Branch: feat/svd-dev-peoplemind-mcp-3-store-config-identity-model-and-334c8ca4 - Commit: 15663e389ed9d54be3e1e9762decabdbeea5af01 - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Checks: PR #12 head 15663e3: no commit statuses, no required checks (none to report). Local: 53 pytest passed, mypy --strict clean, ruff check and format clean. - Warning: No commit statuses exist on PR head 15663e3 and the repo has no required checks, so remote CI is absent and not evidence either way. - Warning: The plus-tag test description conflicts with tier-1 Exact short-circuiting. The subagent kept Exact for stored Handles and tested stripped candidates when no exact Handle exists. Review this at the architect gate. - Decision: review the PR and merge? (`codex-svd ship --run-id 20261101T022918Z-334c8ca4 --confirm-merge`)
piers closed this issue 2026-11-01 02:46:24 +00:00
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.

Dependencies

No dependencies set.

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