people_related links every blank-organisation Person as a colleague #64
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#64
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?
Symptom
people_relatedon a Person whose asserted organisation is blank returns every other Person with a blank organisation as acolleague. Each row has an empty label andviaorg:with nothing after it.Seen on peoplemind-piers, 0.1.0-rc.7, 2026-11-04:
people_relatedfor one Person returned 137 such rows.Cause
src/people_mind_mcp/views.pyatv0.1.0-rc.7:MEMBERSHIPS(line 39) selects every assertedorganisationfield, including an empty or whitespace-onlyvalue, with a NULL org id.related(line 195) compares a membership pair asorg_id == own_id if org_id and own_id else name == own_name. When both org ids are NULL and both names are"","" == ""is true, so every blank-organisation Person matches.Data on piers
Read-only query:
organisationfields, of which 140 are blank, on 138 Persons.ORGas a blank asserted field. Those Persons link to Sources fastmail (140), icloud (40) and mail (23).Expected
A blank organisation is not a shared organisation and creates no
colleaguerelation.Possible fixes, for triage:
related, skip a membership whose name is empty after trimming and whose org id is NULL, on both sides of the comparison.ORGas an assertedorganisationfield at import; existing blank rows would also need cleaning.Option 1 alone fixes the read. Option 2 also stops the blank value from feeding other views and organisation derivation.
Test
Two Persons with
ORG:empty and one withORG:Acme:people_relatedon either blank Person returns nocolleaguerows.Second symptom (triage, 2026-11-04)
A blank asserted
organisationalso shadows a derived Organisation on the default row._field(src/people_mind_mcp/views.py:66-69atb698c2e) returns the first asserted value throughASSERTED_FIELD(views.py:15), which has no blank filter. So a Person with an empty vCardORGand a work-domain email shows an empty organisation instead of the derived one.Decision
Fix both reads and the import (operator, triage 2026-11-04). No schema migration.
MEMBERSHIPS(views.py:39) and inASSERTED_FIELD(views.py:15), for example withAND trim(value) != ''. Keep the derived branches unchanged.ASSERTED_FIELDalso serves the optional fields (views.py:98), so a blanktitleornoteis skipped as well, which is intended.sources/vcard.py:98-101, do not append anorganisationfield whose value is empty after trimming.DELETE_RECORD_FIELDS(graph.py:98) removes them when each record is next re-ingested.Acceptance criteria
ORGand one withORG:Acme:people_relatedon either blank Person returns nocolleaguerows.ORGand an email on a non-public domain shows the derived Organisation on the default row.ORGyields noorganisationfield at import.make checkpasses.Agent brief
Category: bug. State: ready-for-agent (CONV-40 rule 2: three bounded files plus tests).
Verified at
b698c2e:sources/vcard.py:98-101appends anorganisationfield with no blank guard.views.py:39(MEMBERSHIPS) selects that blank value with a NULL org id, andviews.py:195matches"" == "".ASSERTED_FIELD(views.py:15) has no blank filter, so a blank assertedorganisationshadows a derived Organisation on the default row (views.py:66-69).Decision (operator): filter blanks in both reads and skip blank
ORGat import, with no schema migration. Existing blank rows stay inert and go when each record is next re-ingested (graph.py:340). The body's## Decisionand## Acceptance criteriasections are the contract.Out of scope: a cleanup migration; case or whitespace normalisation of non-blank organisation names.
⏸ SVD architect gate: dev/people-mind-mcp#64 people-related-links-every-blank-organisation-person-as-a-co
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 effortmediumRun:
20261104T035302Z-a0e63f4cHeld because: CLEAN but 1 open risk(s) (1 verification) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
SELECT COUNT(*) FROM fields WHERE name='organisation' AND kind='asserted' AND trim(value)=''(140 on 2026-11-04 per the issue). After the first full fastmail/icloud/mail sync it should fall toward 0. people_related on the Person from the issue report should return 0 rows whose via is 'org:'. Rows from a source that does not re-yield unchanged records stay until that record changes, but they are inert under the read fix. [verification]Change: views.py:15 ASSERTED_FIELD: add
AND trim(value) != ''beforeORDER BY id LIMIT 1. _field (views.py:66-75) then falls through to DERIVED_FIELD unchanged, and the optional-field branch (views.py:97-99) inherits the filter. views.py:39-43 MEMBERSHIPS: addAND trim(value) != ''to the first (asserted) SELECT only. The derived UNION branch is unchanged, the parameter count stays 1, and related() (views.py:181-212) needs no edit. vcard.py:98-101 _record: keep the existing ORG loop and guard the append withif org.strip():. CardDAV reuses _record (carddav.py:17,236,291), so one guard covers both. No graph.py/store.py edit and no migration: legacy blank rows are inert after the read filter and are removed by DELETE_RECORD_FIELDS (graph.py:98/340) when rec_hash (graph.py:269-277) changes on next re-ingest. Tests mirror test_server.py:186-215 (direct INSERT INTO fields plus views.default_row) and test_vcard_sync.py:71-84 / 313-336 (make_cards().replace plus extra_public plus sync; VCardSource.records()).Files:
src/people_mind_mcp/views.py·src/people_mind_mcp/sources/vcard.py·tests/test_server.py·tests/test_vcard_sync.pyDecision: accept the 1 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-04-people-related-links-every-blank-organisation-person-as-a-co.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-04-people-related-links-every-blank-organisation-person-as-a-co.mdspec-verify-dispatch Half B for dev/people-mind-mcp#64 people-related-links-every-blank-organisation-person-as-a-co completed integration verify.
6b567cdf786b567cd; re-poll before merge.codex-svd ship --run-id 20261104T041946Z-3ec8eea4 --confirm-merge)