A vCard whose FN is only whitespace gives a Person the display name ' ' #72

Closed
opened 2026-11-04 06:38:11 +00:00 by svc-svd-writer · 3 comments
Collaborator

Outcome

No Person has a blank display name such as ' '.

Context

Live store, starbase-syd, 2026-11-04: Person p_KGE17BFD3K has display_name = ' ', a single space. Its Handles come from the fastmail and icloud CardDAV Sources. It is a real contact with 3,843 mail interactions. The likely cause is a vCard whose name parts are empty, joined with a space, but this is not confirmed.

Scope

  • Reproduce from a vCard with empty FN and empty N parts.
  • If confirmed, trim the joined name, and fall back to the next display-name source (for example the primary email Handle) when the result is blank. Check what the other Sources do.
  • Count the live Persons whose trim(display_name) = ''.

Acceptance criteria

  • A test with an empty-name vCard yields a non-blank display name.
  • After the next release, SELECT COUNT(*) FROM persons WHERE trim(display_name) = '' returns 0.

Filed under: operator word "file them." sha256:237e55ef9da1 (People Mind mail cross-check, test 5)

## Outcome No Person has a blank display name such as `' '`. ## Context Live store, starbase-syd, 2026-11-04: Person `p_KGE17BFD3K` has `display_name = ' '`, a single space. Its Handles come from the `fastmail` and `icloud` CardDAV Sources. It is a real contact with 3,843 mail interactions. The likely cause is a vCard whose name parts are empty, joined with a space, but this is not confirmed. ## Scope - Reproduce from a vCard with empty `FN` and empty `N` parts. - If confirmed, trim the joined name, and fall back to the next display-name source (for example the primary email Handle) when the result is blank. Check what the other Sources do. - Count the live Persons whose `trim(display_name) = ''`. ## Acceptance criteria - [ ] A test with an empty-name vCard yields a non-blank display name. - [ ] After the next release, `SELECT COUNT(*) FROM persons WHERE trim(display_name) = ''` returns 0. Filed under: operator word "file them." sha256:237e55ef9da1 (People Mind mail cross-check, test 5)
Author
Collaborator

This was generated by AI during triage.

Agent Brief

Category: bug
Summary: A vCard whose FN is only whitespace gives its Person the display name ' ', and nothing repairs it.

Current behavior:

Live store (starbase-syd, 2026-11-04): 29 Persons have display_name = ' '. All come from Fastmail cards whose FN is a single space. The cause is not empty N parts, as the body first said.

  • The vCard reader takes FN as it is. A single space is truthy, so it never falls back to the N components. The record's first name is ' '.
  • ingest_record creates a new Person with the record's first name as the display name. So the first blank card to arrive sets ' '.
  • A later merge keeps the survivor's display name. The only display-name update (UPDATE_MAIL_DISPLAY_NAME) replaces a name only when it equals an email Handle and the Person has no names, so ' ' stays.
  • A names row with name = ' ' and name_key = '' is stored. Example: p_KGE17BFD3K has two "Adelicia Harding" rows (Fastmail and iCloud) and one ' ' row from a second Fastmail card. Its display name is ' '.

Desired behavior:

  • The vCard reader strips FN and each N component. A blank FN falls back to N. A card with no non-blank name yields a record with no names.
  • No names row is stored with a blank name or an empty name_key, from any Source.
  • A Person whose display name is blank gets the best non-blank name, in the existing order: the primary name, then (for a mail record) the email address, then (unnamed). This repair also covers the existing blank Persons, either on their next ingest or through a one-time store update. Choose one and say which in the PR.

Key interfaces:

  • The vCard record builder (_record and its _first / _components helpers): returns SourceRecord.names with no blank entries.
  • ingest_record: the display name chosen at creation and at update, and the names rows it writes.
  • The fallback order already in ingest_record (rec.names[0], else the email for a record with interactions, else (unnamed)). Keep it; do not invent a new order.

Acceptance criteria:

  • A test ingests a vCard with FN: (a single space) and empty N, and the Person's display name is not blank.
  • A test ingests that blank card first and a named card for the same Handle second, and the merged Person shows the named card's name.
  • A test proves that no names row with an empty name_key is written.
  • Existing blank Persons are repaired. After the next release, SELECT COUNT(*) FROM persons WHERE trim(display_name) = '' on the live store returns 0 (29 today).
  • make check passes.

Out of scope:

  • Merging duplicate Persons (#70).
  • Any change to name matching tiers or name_key rules beyond refusing an empty key.
  • Mail-sourced display names (#68).
> *This was generated by AI during triage.* ## Agent Brief **Category:** bug **Summary:** A vCard whose `FN` is only whitespace gives its Person the display name `' '`, and nothing repairs it. **Current behavior:** Live store (starbase-syd, 2026-11-04): 29 Persons have `display_name = ' '`. All come from Fastmail cards whose `FN` is a single space. The cause is not empty `N` parts, as the body first said. - The vCard reader takes `FN` as it is. A single space is truthy, so it never falls back to the `N` components. The record's first name is `' '`. - `ingest_record` creates a new Person with the record's first name as the display name. So the first blank card to arrive sets `' '`. - A later merge keeps the survivor's display name. The only display-name update (`UPDATE_MAIL_DISPLAY_NAME`) replaces a name only when it equals an email Handle and the Person has no names, so `' '` stays. - A `names` row with `name = ' '` and `name_key = ''` is stored. Example: `p_KGE17BFD3K` has two "Adelicia Harding" rows (Fastmail and iCloud) and one `' '` row from a second Fastmail card. Its display name is `' '`. **Desired behavior:** - The vCard reader strips `FN` and each `N` component. A blank `FN` falls back to `N`. A card with no non-blank name yields a record with no names. - No `names` row is stored with a blank name or an empty `name_key`, from any Source. - A Person whose display name is blank gets the best non-blank name, in the existing order: the primary name, then (for a mail record) the email address, then `(unnamed)`. This repair also covers the existing blank Persons, either on their next ingest or through a one-time store update. Choose one and say which in the PR. **Key interfaces:** - The vCard record builder (`_record` and its `_first` / `_components` helpers): returns `SourceRecord.names` with no blank entries. - `ingest_record`: the display name chosen at creation and at update, and the `names` rows it writes. - The fallback order already in `ingest_record` (`rec.names[0]`, else the email for a record with interactions, else `(unnamed)`). Keep it; do not invent a new order. **Acceptance criteria:** - [ ] A test ingests a vCard with `FN: ` (a single space) and empty `N`, and the Person's display name is not blank. - [ ] A test ingests that blank card first and a named card for the same Handle second, and the merged Person shows the named card's name. - [ ] A test proves that no `names` row with an empty `name_key` is written. - [ ] Existing blank Persons are repaired. After the next release, `SELECT COUNT(*) FROM persons WHERE trim(display_name) = ''` on the live store returns 0 (29 today). - [ ] `make check` passes. **Out of scope:** - Merging duplicate Persons (#70). - Any change to name matching tiers or `name_key` rules beyond refusing an empty key. - Mail-sourced display names (#68).
svc-svd-writer changed title from A vCard with empty name parts gives a Person the display name ' ' to A vCard whose FN is only whitespace gives a Person the display name ' ' 2026-11-04 06:41:04 +00:00
Author
Collaborator

⏸ SVD architect gate: dev/people-mind-mcp#72 a-vcard-whose-fn-is-only-whitespace-gives-a-person-the-displ

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 standard · dispatch effort medium

Run: 20261104T064531Z-c211b4a5

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

Open risks:

  1. The live repair can only be proven after release. After deploying to starbase-syd and restarting the sync service once, run sqlite3 <live store> "SELECT COUNT(*) FROM persons WHERE trim(display_name) = ''"; expect 0 (29 per the triage brief, not measured this session because the live store is unreachable from Half A). Also run "SELECT COUNT(*) FROM names WHERE name_key = ''"; expect 0. Spot check: p_KGE17BFD3K should show 'Adelicia Harding'. [verification]
  2. Possible overlap with #68 (mail-sourced display names), whose state could not be read here (gh is denied; the issue context covers #72 only). Before dispatch, check whether #68 has an open or merged PR editing graph.py:76-80 or 313-314. If it does, rebase onto it and keep both the email-Handle branch and the new blank/'(unnamed)' branches in UPDATE_DISPLAY_NAME. [verification]

Change: (1) vcard.py _record (86-114): keep fn and the UID-less hash input (87-90, 94-96) byte-identical. Derive a separate name = _first(card,"fn").strip() or " ".join(N parts[0].split()) and strip NICKNAME aliases, dropping blanks. Follow the blank-ORG guard at vcard.py:98-102. Shared helpers _first/_components do not change. (2) graph.py ingest_record (243-369): kept = tuple(v for v in rec.names if name_key(v)), used in the empty check (255), the creation display name (305, same fallback order), the update (313-314) and the names rows (320). rec_hash keeps hashing rec.names. (3) Rename UPDATE_MAIL_DISPLAY_NAME (76-80) to UPDATE_DISPLAY_NAME and widen it so a real name always replaces a blank (trim='') or (unnamed) display name. The email-Handle + NOT EXISTS names branch stays. This is required for AC2, because a blank card now creates (unnamed). (4) New graph.repair_display_names(conn, *, now), mirroring the ensure_owner shape (169-187): delete names rows with name_key=''; set every whitespace-only display name to the best name (embed.py:19 ordering), else the email for a Person with interactions, else (unnamed); emit _change 'update' + updated_at for each touched Person; idempotent and select-only when clean. (5) Call it right after ensure_owner at cli.py:50 and sync.py:664, printing nothing. No schema bump: CardDAV sync-token never re-delivers unchanged cards, so repair-on-ingest cannot reach the 29 live Persons, and a schema 8 would ripple into the schema-7 special case and 6+ test/README sites.

Files: src/people_mind_mcp/sources/vcard.py · src/people_mind_mcp/graph.py · src/people_mind_mcp/cli.py · src/people_mind_mcp/sync.py · tests/test_vcard_sync.py

Decision: accept the 2 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-04-a-vcard-whose-fn-is-only-whitespace-gives-a-person-the-displ.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-04-a-vcard-whose-fn-is-only-whitespace-gives-a-person-the-displ.md

### ⏸ SVD architect gate: dev/people-mind-mcp#72 a-vcard-whose-fn-is-only-whitespace-gives-a-person-the-displ **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 `standard` · dispatch effort `medium` **Run:** `20261104T064531Z-c211b4a5` **Held because:** CLEAN but 2 open risk(s) (2 verification) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. The live repair can only be proven after release. After deploying to starbase-syd and restarting the sync service once, run `sqlite3 <live store> "SELECT COUNT(*) FROM persons WHERE trim(display_name) = ''"`; expect 0 (29 per the triage brief, not measured this session because the live store is unreachable from Half A). Also run `"SELECT COUNT(*) FROM names WHERE name_key = ''"`; expect 0. Spot check: p_KGE17BFD3K should show 'Adelicia Harding'. [verification] 2. Possible overlap with #68 (mail-sourced display names), whose state could not be read here (gh is denied; the issue context covers #72 only). Before dispatch, check whether #68 has an open or merged PR editing graph.py:76-80 or 313-314. If it does, rebase onto it and keep both the email-Handle branch and the new blank/'(unnamed)' branches in UPDATE_DISPLAY_NAME. [verification] **Change:** (1) vcard.py `_record` (86-114): keep `fn` and the UID-less hash input (87-90, 94-96) byte-identical. Derive a separate `name = _first(card,"fn").strip() or " ".join(N parts[0].split())` and strip NICKNAME aliases, dropping blanks. Follow the blank-ORG guard at vcard.py:98-102. Shared helpers `_first`/`_components` do not change. (2) graph.py `ingest_record` (243-369): `kept = tuple(v for v in rec.names if name_key(v))`, used in the empty check (255), the creation display name (305, same fallback order), the update (313-314) and the names rows (320). `rec_hash` keeps hashing `rec.names`. (3) Rename `UPDATE_MAIL_DISPLAY_NAME` (76-80) to `UPDATE_DISPLAY_NAME` and widen it so a real name always replaces a blank (`trim=''`) or `(unnamed)` display name. The email-Handle + NOT EXISTS names branch stays. This is required for AC2, because a blank card now creates `(unnamed)`. (4) New `graph.repair_display_names(conn, *, now)`, mirroring the `ensure_owner` shape (169-187): delete `names` rows with `name_key=''`; set every whitespace-only display name to the best name (embed.py:19 ordering), else the email for a Person with interactions, else `(unnamed)`; emit `_change` 'update' + updated_at for each touched Person; idempotent and select-only when clean. (5) Call it right after `ensure_owner` at cli.py:50 and sync.py:664, printing nothing. No schema bump: CardDAV sync-token never re-delivers unchanged cards, so repair-on-ingest cannot reach the 29 live Persons, and a schema 8 would ripple into the schema-7 special case and 6+ test/README sites. **Files:** `src/people_mind_mcp/sources/vcard.py` · `src/people_mind_mcp/graph.py` · `src/people_mind_mcp/cli.py` · `src/people_mind_mcp/sync.py` · `tests/test_vcard_sync.py` **Decision:** accept the 2 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-04-a-vcard-whose-fn-is-only-whitespace-gives-a-person-the-displ.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-04-a-vcard-whose-fn-is-only-whitespace-gives-a-person-the-displ.md`</sub>
Author
Collaborator

spec-verify-dispatch Half B for dev/people-mind-mcp#72 a-vcard-whose-fn-is-only-whitespace-gives-a-person-the-displ completed integration verify.

  • PR: #76
  • Branch: feat/svd-dev-people-mind-mcp-72-a-vcard-whose-fn-is-only-whit-da0c4034
  • Commit: ad6b1c4789
  • 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/36/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • Warning: Remote check ci/woodpecker/pr/validation is still pending on ad6b1c4; re-poll before merge.
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261104T084555Z-da0c4034 --confirm-merge)
spec-verify-dispatch Half B for dev/people-mind-mcp#72 a-vcard-whose-fn-is-only-whitespace-gives-a-person-the-displ completed integration verify. - PR: https://git.groupthink.asia/dev/people-mind-mcp/pulls/76 - Branch: feat/svd-dev-people-mind-mcp-72-a-vcard-whose-fn-is-only-whit-da0c4034 - Commit: ad6b1c4789a51e7979637d7b5e60bd86f05ebbdb - 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/36/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - Warning: Remote check ci/woodpecker/pr/validation is still pending on ad6b1c4; re-poll before merge. - CI wait: ci/woodpecker/pr/validation -> pass - Decision: review the PR and merge? (`codex-svd ship --run-id 20261104T084555Z-da0c4034 --confirm-merge`)
svc-svd-writer 2026-11-04 09:02:38 +00:00
  • closed this issue
  • removed the
    svd:go
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#72
No description provided.