CardDAV Source with sync-token delta and a Radicale integration test #5

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

Parent: #1. Records: ADR 0004.

What to build

The Source that frees peoplemind from the Mac. One CardDAV account per config block, read-only credential in a file, with a separate optional write-back credential file left unused in Phase A.

  • Discovery of the address book collections, sync-token delta on every pass after the first, full fetch when the server rejects the token.
  • Each vCard becomes asserted fields with this Source as author; groups become Tags; an upstream deletion tombstones the link, never the Person.
  • Runs as a thread in the sync process on a configurable interval. The sync worker is the only client of the CardDAV server.
  • Integration target: Radicale in a container, started by a script in the repo.

Acceptance criteria

  • Radicale integration: 50 synthetic vCards sync; a second pass by sync-token moves only the changed records, asserted by counting fetched resources.
  • A rejected sync-token falls back to a full fetch and the result equals a fresh import.
  • An upstream deletion tombstones the link and leaves the Person.
  • Credentials are read from files only; the log-scan test covers a sync pass.
  • Live iCloud and Fastmail checks are a manual gate step on the Phase A gate issue, not CI.

Blocked by

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

Parent: #1. Records: ADR 0004. ## What to build The Source that frees peoplemind from the Mac. One CardDAV account per config block, read-only credential in a file, with a separate optional write-back credential file left unused in Phase A. - Discovery of the address book collections, sync-token delta on every pass after the first, full fetch when the server rejects the token. - Each vCard becomes asserted fields with this Source as author; groups become Tags; an upstream deletion tombstones the link, never the Person. - Runs as a thread in the sync process on a configurable interval. The sync worker is the only client of the CardDAV server. - Integration target: Radicale in a container, started by a script in the repo. ## Acceptance criteria - Radicale integration: 50 synthetic vCards sync; a second pass by sync-token moves only the changed records, asserted by counting fetched resources. - A rejected sync-token falls back to a full fetch and the result equals a fresh import. - An upstream deletion tombstones the link and leaves the Person. - Credentials are read from files only; the log-scan test covers a sync pass. - Live iCloud and Fastmail checks are a manual gate step on the Phase A gate issue, not CI. ## Blocked by - #3 Filed under: operator word "go. compelling public-facing README.md as A0" sha256:3f9e946994fa
Collaborator

⏸ SVD architect gate: dev/peoplemind-mcp#5 carddav-source-with-sync-token-delta-and-a-radicale-integrat

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: 20261101T031042Z-b474b03f

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

Open risks:

  1. What does a link tombstone retire? Lean: set source_links.deleted_at only; the Person keeps the deleted record's names, asserted fields, Tags and Handles. Alternative: also delete that (source, source_record)'s names/fields/tags (never Handles or the Person). ADR 0004 §6 says only 'its source link is tombstoned and the Person stays'. Question: retain or retire the record's asserted rows? [decision]
  2. Where does the CardDAV username live? Lean: username in config, and only the password or app password in credential_file. The README's provisional block names only url and credential_file, and for iCloud and Fastmail the username is the account email (PII in config, never logged). Question: keep username in config, or put username:password in one credential file? [decision]
  3. sync without --once. Lean: run vCard sources once at startup, then one thread per CardDAV source on interval_seconds; with no CardDAV source, exit 2 with 'Error: sync without --once needs a carddav source'. This replaces today's 'only --once is supported' refusal and its test. Question: accept, or also give vCard sources an interval and loop them (widens VCardSourceConfig beyond the issue text)? [decision]
  4. Radicale test placement. The repo has no CI config, so the Radicale tests skip unless PEOPLEMIND_RADICALE_URL is set and run on the host after scripts/radicale.sh up. Question: is a host run pasted into the PR enough for this issue, or must a CI pipeline that runs -m radicale land first (a separate issue, not absorbed here)? [decision]
  5. Deletion tombstoning outside CardDAV deltas. ADR 0004 §6 covers every Source, but this spec tombstones links only for CardDAV. The vCard Source has no deletion detection, and collections that vanish from discovery or the addressbooks filter keep their members' links active (lean: a transient discovery gap must not tombstone a whole address book). Question: file a follow-up issue for vCard deletion and orphaned-collection handling, or widen this unit? [decision]
  6. XML parser. Lean: stdlib ElementTree.fromstring with a justified # noqa: S314 (CPython expat ≥2.4.1 rejects entity-expansion blowups; ElementTree does not fetch external entities), adding no dependency. Alternative: add defusedxml, a new locked dependency that needs network for uv lock. Question: accept the stdlib lean? [decision]
  7. Radicale behaviour and live servers are unverified at spec time (no container engine, no network in Half-A). Unverified: Radicale 3 answers an unknown sync token with 403 + valid-sync-token; it accepts extended MKCOL with C:addressbook; it serves addressbook-home-set on the principal; the python:3.12-slim + pip radicale container starts within 60 s. Check on host: eval "$(scripts/radicale.sh up)" && uv run python3 -m pytest -q -p no:cacheprovider --basetemp "$(mktemp -d)/r" -m radicale tests/test_carddav_radicale.py reports 3 passed, 0 skipped; paste the line into the PR. iCloud and Fastmail (cross-origin redirects, rejection codes, 507 paging) are a manual gate step on the Phase A gate issue: peoplemind sync --once against each account twice, confirming full=0 on the second run and a clean log scan. [verification]
  8. Lock regeneration: uv lock must resolve in the dispatch worktree (httpx 0.28.1 is already locked transitively). Check: uv lock --check passes, and git diff --stat uv.lock shows only the peoplemind-mcp package block changed. [verification]

Change: Add CardDAVSource in sources/carddav.py, shaped like VCardSource (sources/vcard.py:116-179). It reuses vcard.py's _parse/_record/_kind/_values/_first/_uid (37-113) unchanged and uses httpx with follow_redirects=False. It does manual discovery (current-user-principal → addressbook-home-set → Depth:1 addressbook collections, with an optional addressbooks filter). Each pass runs an RFC 6578 sync-collection REPORT for getetag, then addressbook-multiget in batches of 100. A token rejection (409/410/412, or 403 with valid-sync-token) triggers one full fetch, and full-fetch deletions are computed from a per-source JSON state blob (token, href→record map, group map). A group change refetches only the affected members. All network I/O finishes before the store transaction opens. A new sync.run_pass, moved from cli._sync (cli.py:44-62), applies ingest_record, a new graph.tombstone_link (sets source_links.deleted_at and emits an 'update' change; the Person and its rows stay) and the source_state upsert in one transaction. Additive migration 2 (store.py:20-70) adds source_links.deleted_at and a source_state table. ingest_record (graph.py:242-250, 309-320) revives a tombstoned link. CardDAVSourceConfig joins the config union (config.py:60-81) with url (https, or loopback http), username, credential_file, an unused write_credential_file, addressbooks and interval_seconds≥60. cli makes the path check vCard-only, checks the credential file, and in non---once mode runs one thread per CardDAV source, each with its own writer connection. scripts/radicale.sh up/down starts Radicale in a container. The Radicale tests skip unless PEOPLEMIND_RADICALE_URL is set. httpx and httpcore loggers are pinned to WARNING.

Files: src/peoplemind_mcp/sources/carddav.py · src/peoplemind_mcp/sync.py · src/peoplemind_mcp/sources/__init__.py · src/peoplemind_mcp/config.py · src/peoplemind_mcp/store.py · src/peoplemind_mcp/graph.py · src/peoplemind_mcp/cli.py · pyproject.toml · uv.lock · scripts/radicale.sh · tests/conftest.py · tests/test_carddav.py · tests/test_carddav_radicale.py · tests/test_config_cli.py · tests/test_identity.py
Derived artifacts: uv.lock

Decision: accept the 8 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-carddav-source-with-sync-token-delta-and-a-radicale-integrat.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-01-carddav-source-with-sync-token-delta-and-a-radicale-integrat.md

### ⏸ SVD architect gate: dev/peoplemind-mcp#5 carddav-source-with-sync-token-delta-and-a-radicale-integrat **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:** `20261101T031042Z-b474b03f` **Held because:** CLEAN but 8 open risk(s) (2 verification · 6 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. What does a link tombstone retire? Lean: set source_links.deleted_at only; the Person keeps the deleted record's names, asserted fields, Tags and Handles. Alternative: also delete that (source, source_record)'s names/fields/tags (never Handles or the Person). ADR 0004 §6 says only 'its source link is tombstoned and the Person stays'. Question: retain or retire the record's asserted rows? [decision] 2. Where does the CardDAV username live? Lean: `username` in config, and only the password or app password in credential_file. The README's provisional block names only url and credential_file, and for iCloud and Fastmail the username is the account email (PII in config, never logged). Question: keep username in config, or put username:password in one credential file? [decision] 3. `sync` without --once. Lean: run vCard sources once at startup, then one thread per CardDAV source on interval_seconds; with no CardDAV source, exit 2 with 'Error: sync without --once needs a carddav source'. This replaces today's 'only --once is supported' refusal and its test. Question: accept, or also give vCard sources an interval and loop them (widens VCardSourceConfig beyond the issue text)? [decision] 4. Radicale test placement. The repo has no CI config, so the Radicale tests skip unless PEOPLEMIND_RADICALE_URL is set and run on the host after scripts/radicale.sh up. Question: is a host run pasted into the PR enough for this issue, or must a CI pipeline that runs -m radicale land first (a separate issue, not absorbed here)? [decision] 5. Deletion tombstoning outside CardDAV deltas. ADR 0004 §6 covers every Source, but this spec tombstones links only for CardDAV. The vCard Source has no deletion detection, and collections that vanish from discovery or the addressbooks filter keep their members' links active (lean: a transient discovery gap must not tombstone a whole address book). Question: file a follow-up issue for vCard deletion and orphaned-collection handling, or widen this unit? [decision] 6. XML parser. Lean: stdlib ElementTree.fromstring with a justified `# noqa: S314` (CPython expat ≥2.4.1 rejects entity-expansion blowups; ElementTree does not fetch external entities), adding no dependency. Alternative: add defusedxml, a new locked dependency that needs network for uv lock. Question: accept the stdlib lean? [decision] 7. Radicale behaviour and live servers are unverified at spec time (no container engine, no network in Half-A). Unverified: Radicale 3 answers an unknown sync token with 403 + valid-sync-token; it accepts extended MKCOL with C:addressbook; it serves addressbook-home-set on the principal; the python:3.12-slim + pip radicale container starts within 60 s. Check on host: eval "$(scripts/radicale.sh up)" && uv run python3 -m pytest -q -p no:cacheprovider --basetemp "$(mktemp -d)/r" -m radicale tests/test_carddav_radicale.py reports 3 passed, 0 skipped; paste the line into the PR. iCloud and Fastmail (cross-origin redirects, rejection codes, 507 paging) are a manual gate step on the Phase A gate issue: peoplemind sync --once against each account twice, confirming full=0 on the second run and a clean log scan. [verification] 8. Lock regeneration: `uv lock` must resolve in the dispatch worktree (httpx 0.28.1 is already locked transitively). Check: `uv lock --check` passes, and `git diff --stat uv.lock` shows only the peoplemind-mcp package block changed. [verification] **Change:** Add CardDAVSource in sources/carddav.py, shaped like VCardSource (sources/vcard.py:116-179). It reuses vcard.py's _parse/_record/_kind/_values/_first/_uid (37-113) unchanged and uses httpx with follow_redirects=False. It does manual discovery (current-user-principal → addressbook-home-set → Depth:1 addressbook collections, with an optional addressbooks filter). Each pass runs an RFC 6578 sync-collection REPORT for getetag, then addressbook-multiget in batches of 100. A token rejection (409/410/412, or 403 with valid-sync-token) triggers one full fetch, and full-fetch deletions are computed from a per-source JSON state blob (token, href→record map, group map). A group change refetches only the affected members. All network I/O finishes before the store transaction opens. A new sync.run_pass, moved from cli._sync (cli.py:44-62), applies ingest_record, a new graph.tombstone_link (sets source_links.deleted_at and emits an 'update' change; the Person and its rows stay) and the source_state upsert in one transaction. Additive migration 2 (store.py:20-70) adds source_links.deleted_at and a source_state table. ingest_record (graph.py:242-250, 309-320) revives a tombstoned link. CardDAVSourceConfig joins the config union (config.py:60-81) with url (https, or loopback http), username, credential_file, an unused write_credential_file, addressbooks and interval_seconds≥60. cli makes the path check vCard-only, checks the credential file, and in non---once mode runs one thread per CardDAV source, each with its own writer connection. scripts/radicale.sh up/down starts Radicale in a container. The Radicale tests skip unless PEOPLEMIND_RADICALE_URL is set. httpx and httpcore loggers are pinned to WARNING. **Files:** `src/peoplemind_mcp/sources/carddav.py` · `src/peoplemind_mcp/sync.py` · `src/peoplemind_mcp/sources/__init__.py` · `src/peoplemind_mcp/config.py` · `src/peoplemind_mcp/store.py` · `src/peoplemind_mcp/graph.py` · `src/peoplemind_mcp/cli.py` · `pyproject.toml` · `uv.lock` · `scripts/radicale.sh` · `tests/conftest.py` · `tests/test_carddav.py` · `tests/test_carddav_radicale.py` · `tests/test_config_cli.py` · `tests/test_identity.py` **Derived artifacts:** `uv.lock` **Decision:** accept the 8 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-carddav-source-with-sync-token-delta-and-a-radicale-integrat.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-01-carddav-source-with-sync-token-delta-and-a-radicale-integrat.md`</sub>
Owner

Architect gate, 2026-11-01. Half-A on this issue returned CLEAN (batch 2ea1fb72b7224dc392e1f77559e88868), but the spec collides with the #4 spec: both set the store schema to version 2 with different migrations and both rewrite the sync loop in cli.py. #4 dispatches first. This issue is held and re-specced with /svd dev/peoplemind-mcp#5 after #4 merges. The rulings below bind that re-spec.

Sequencing: migration 3, not 2 (source_links.deleted_at, source_state). sync.run_pass takes over the per-source loop from cli._sync including the sync_log insert #4 adds there.

  1. A link tombstone sets source_links.deleted_at only; the Person keeps the record's names, asserted fields, Tags and Handles.
  2. username lives in the [[sources]] block; only the password or app password in credential_file, as mailmind's AccountConfig.username.
  3. sync without --once: vCard sources once at startup, one thread per CardDAV source on interval_seconds, exit 2 when no CardDAV source is configured. vCard sources get no interval.
  4. Radicale tests skip without PEOPLEMIND_RADICALE_URL; a host run pasted into the PR is required, and the architect repeats it before merge. CI is a separate architect follow-up.
  5. vCard deletion detection and vanished-collection handling are #14, blocked by this issue. Do not widen this unit.
  6. Parse XML with defusedxml (>=0.7,<1, mypy override as mailmind), not ElementTree with noqa: S314.
  7. iCloud and Fastmail stay a manual step on #10.
  8. httpx 0.28.1 is already locked; uv lock --check at dispatch.
Architect gate, 2026-11-01. Half-A on this issue returned CLEAN (batch 2ea1fb72b7224dc392e1f77559e88868), but the spec collides with the #4 spec: both set the store schema to version 2 with different migrations and both rewrite the sync loop in `cli.py`. #4 dispatches first. This issue is held and re-specced with `/svd dev/peoplemind-mcp#5` after #4 merges. The rulings below bind that re-spec. Sequencing: migration 3, not 2 (`source_links.deleted_at`, `source_state`). `sync.run_pass` takes over the per-source loop from `cli._sync` including the `sync_log` insert #4 adds there. 1. A link tombstone sets `source_links.deleted_at` only; the Person keeps the record's names, asserted fields, Tags and Handles. 2. `username` lives in the `[[sources]]` block; only the password or app password in `credential_file`, as mailmind's `AccountConfig.username`. 3. `sync` without `--once`: vCard sources once at startup, one thread per CardDAV source on `interval_seconds`, exit 2 when no CardDAV source is configured. vCard sources get no interval. 4. Radicale tests skip without `PEOPLEMIND_RADICALE_URL`; a host run pasted into the PR is required, and the architect repeats it before merge. CI is a separate architect follow-up. 5. vCard deletion detection and vanished-collection handling are #14, blocked by this issue. Do not widen this unit. 6. Parse XML with `defusedxml` (`>=0.7,<1`, mypy override as mailmind), not `ElementTree` with `noqa: S314`. 7. iCloud and Fastmail stay a manual step on #10. 8. httpx 0.28.1 is already locked; `uv lock --check` at dispatch.
Collaborator

⏸ SVD architect gate: dev/peoplemind-mcp#5 carddav-source-with-sync-token-delta-and-a-radicale-integrat

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: 20261101T035937Z-2154d00e

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

Open risks:

  1. Radicale behaviour and live servers can't be checked in Half-A: there is no container engine and no network. Carried from prior OR7. What changed: R4/R7 now require the architect to repeat the host run before merge, and iCloud/Fastmail move to #10. Unverified: Radicale 3 answers an unknown token with 403 + valid-sync-token; it accepts extended MKCOL with C:addressbook; it serves addressbook-home-set on the principal; the python:3.12-slim + pip radicale container answers within 60 s. Host check: eval "$(scripts/radicale.sh up)" && uv run python3 -m pytest -q -p no:cacheprovider --basetemp "$(mktemp -d)/r" -m radicale tests/test_carddav_radicale.py. Every test must pass and none may skip; paste the summary line into the PR. #10 manual step: peoplemind sync --once against iCloud and Fastmail, twice each; the second run shows full=0 and the log scan is clean. [verification]
  2. Lock regeneration needs PyPI. Carried from prior OR8. What changed: R6 adds defusedxml, which is not in uv.lock at 3c252f7 (grep 'name = "defusedxml"' uv.lock finds nothing), so the prior 'already locked, no new download' premise is false. Check in the dispatch worktree: uv lock succeeds, uv lock --check passes, and git diff uv.lock shows only the peoplemind-mcp block gaining defusedxml and httpx plus one new defusedxml package block (expected 0.7.1). [verification]

Change: Re-spec on post-#4 main (3c252f7), bound by gate rulings R1-R8. CardDAVSource in sources/carddav.py follows the shape of VCardSource (sources/vcard.py:116-179) and reuses the vcard.py helpers at 37-113 unchanged. It uses httpx (follow_redirects=False, httpx/httpcore loggers pinned to WARNING as server.py:175-176 does) and defusedxml.ElementTree.fromstring (R6). It does manual discovery, then an RFC 6578 sync-collection REPORT and addressbook-multiget in batches of 100, with one full fetch when the token is rejected (409/410/412, or 403 with valid-sync-token). Its state blob holds token, href→record and group map; the state of a vanished collection is left untouched (R5→#14). New sync.run_pass takes the per-source loop from cli._sync (cli.py:53-87), including #4's sync_log success and failure rows (cli.py:69-82). It fetches outside the transaction, then commits ingest_record, the new graph.tombstone_link (sets deleted_at only, emits an 'update' change; R1), the source_state upsert and the sync_log row in one transaction. On failure it writes a sync_log row with code SourceError.code or sync-failed. Additive migration 3 (store.py:20, appended after 70-75) adds source_links.deleted_at and a source_state table. ingest_record (graph.py:79, 246-250, 309-320) revives a tombstoned link. CardDAVSourceConfig joins the union (config.py:94-117) with fields url (https, or loopback-only http), username (R2), credential_file, an unused write_credential_file, addressbooks and interval_seconds≥60. cli makes the path check vCard-only and reads the CardDAV credential file. Without --once, cli runs vCard sources once and then one thread per CardDAV source, and exits 2 if no CardDAV source is configured (R3). scripts/radicale.sh up/down manages the container, and the Radicale tests skip without PEOPLEMIND_RADICALE_URL (R4).

Files: src/peoplemind_mcp/sources/carddav.py · src/peoplemind_mcp/sync.py · src/peoplemind_mcp/sources/__init__.py · src/peoplemind_mcp/config.py · src/peoplemind_mcp/store.py · src/peoplemind_mcp/graph.py · src/peoplemind_mcp/cli.py · pyproject.toml · uv.lock · scripts/radicale.sh · tests/conftest.py · tests/test_carddav.py · tests/test_carddav_radicale.py · tests/test_config_cli.py · tests/test_identity.py
Derived artifacts: uv.lock

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-01-carddav-source-with-sync-token-delta-and-a-radicale-integrat.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-01-carddav-source-with-sync-token-delta-and-a-radicale-integrat.md

### ⏸ SVD architect gate: dev/peoplemind-mcp#5 carddav-source-with-sync-token-delta-and-a-radicale-integrat **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:** `20261101T035937Z-2154d00e` **Held because:** CLEAN but 2 open risk(s) (2 verification) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. Radicale behaviour and live servers can't be checked in Half-A: there is no container engine and no network. Carried from prior OR7. What changed: R4/R7 now require the architect to repeat the host run before merge, and iCloud/Fastmail move to #10. Unverified: Radicale 3 answers an unknown token with 403 + valid-sync-token; it accepts extended MKCOL with C:addressbook; it serves addressbook-home-set on the principal; the python:3.12-slim + pip radicale container answers within 60 s. Host check: eval "$(scripts/radicale.sh up)" && uv run python3 -m pytest -q -p no:cacheprovider --basetemp "$(mktemp -d)/r" -m radicale tests/test_carddav_radicale.py. Every test must pass and none may skip; paste the summary line into the PR. #10 manual step: peoplemind sync --once against iCloud and Fastmail, twice each; the second run shows full=0 and the log scan is clean. [verification] 2. Lock regeneration needs PyPI. Carried from prior OR8. What changed: R6 adds defusedxml, which is not in uv.lock at 3c252f7 (grep 'name = "defusedxml"' uv.lock finds nothing), so the prior 'already locked, no new download' premise is false. Check in the dispatch worktree: uv lock succeeds, uv lock --check passes, and git diff uv.lock shows only the peoplemind-mcp block gaining defusedxml and httpx plus one new defusedxml package block (expected 0.7.1). [verification] **Change:** Re-spec on post-#4 main (3c252f7), bound by gate rulings R1-R8. CardDAVSource in sources/carddav.py follows the shape of VCardSource (sources/vcard.py:116-179) and reuses the vcard.py helpers at 37-113 unchanged. It uses httpx (follow_redirects=False, httpx/httpcore loggers pinned to WARNING as server.py:175-176 does) and defusedxml.ElementTree.fromstring (R6). It does manual discovery, then an RFC 6578 sync-collection REPORT and addressbook-multiget in batches of 100, with one full fetch when the token is rejected (409/410/412, or 403 with valid-sync-token). Its state blob holds token, href→record and group map; the state of a vanished collection is left untouched (R5→#14). New sync.run_pass takes the per-source loop from cli._sync (cli.py:53-87), including #4's sync_log success and failure rows (cli.py:69-82). It fetches outside the transaction, then commits ingest_record, the new graph.tombstone_link (sets deleted_at only, emits an 'update' change; R1), the source_state upsert and the sync_log row in one transaction. On failure it writes a sync_log row with code SourceError.code or sync-failed. Additive migration 3 (store.py:20, appended after 70-75) adds source_links.deleted_at and a source_state table. ingest_record (graph.py:79, 246-250, 309-320) revives a tombstoned link. CardDAVSourceConfig joins the union (config.py:94-117) with fields url (https, or loopback-only http), username (R2), credential_file, an unused write_credential_file, addressbooks and interval_seconds≥60. cli makes the path check vCard-only and reads the CardDAV credential file. Without --once, cli runs vCard sources once and then one thread per CardDAV source, and exits 2 if no CardDAV source is configured (R3). scripts/radicale.sh up/down manages the container, and the Radicale tests skip without PEOPLEMIND_RADICALE_URL (R4). **Files:** `src/peoplemind_mcp/sources/carddav.py` · `src/peoplemind_mcp/sync.py` · `src/peoplemind_mcp/sources/__init__.py` · `src/peoplemind_mcp/config.py` · `src/peoplemind_mcp/store.py` · `src/peoplemind_mcp/graph.py` · `src/peoplemind_mcp/cli.py` · `pyproject.toml` · `uv.lock` · `scripts/radicale.sh` · `tests/conftest.py` · `tests/test_carddav.py` · `tests/test_carddav_radicale.py` · `tests/test_config_cli.py` · `tests/test_identity.py` **Derived artifacts:** `uv.lock` **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-01-carddav-source-with-sync-token-delta-and-a-radicale-integrat.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-01-carddav-source-with-sync-token-delta-and-a-radicale-integrat.md`</sub>
Owner

Architect gate on the re-spec, 2026-11-01 04:10Z (run 20261101T035937Z-2154d00e, base 3c252f7).

The spec honours rulings 1 to 8 from the comment above: migration 3 (source_links.deleted_at, source_state), sync.run_pass carries the sync_log insert, deleted_at only, username in [[sources]], defusedxml, Radicale tests skip without PEOPLEMIND_RADICALE_URL. It also found that tests/test_identity.py:396 hard-codes user_version == 2 and amends it.

Both open risks are verification-class and keep their checks: the architect runs scripts/radicale.sh up and the -m radicale tests on the host before merge, and uv lock runs in the dispatch worktree because defusedxml is not yet locked. Riders are appended to the spec as Agent Adjustments. Released for svd:go.

Architect gate on the re-spec, 2026-11-01 04:10Z (run `20261101T035937Z-2154d00e`, base `3c252f7`). The spec honours rulings 1 to 8 from the comment above: migration 3 (`source_links.deleted_at`, `source_state`), `sync.run_pass` carries the `sync_log` insert, `deleted_at` only, `username` in `[[sources]]`, `defusedxml`, Radicale tests skip without `PEOPLEMIND_RADICALE_URL`. It also found that `tests/test_identity.py:396` hard-codes `user_version == 2` and amends it. Both open risks are verification-class and keep their checks: the architect runs `scripts/radicale.sh up` and the `-m radicale` tests on the host before merge, and `uv lock` runs in the dispatch worktree because `defusedxml` is not yet locked. Riders are appended to the spec as Agent Adjustments. Released for `svd:go`.
Owner

Spec Amendment 1, 2026-11-01 04:25Z. The first dispatch (run 20261101T041547Z-669961c2) stopped with no commit: tests/test_server.py:275 and :369 read cfg.sources[0].path, which fails mypy --strict once Config.sources is a union. Verified at 3c252f7. The file joins the write set for two type-narrowing edits (16 files, at the ceiling). Dispatch re-fired on the amended spec.

Spec Amendment 1, 2026-11-01 04:25Z. The first dispatch (run `20261101T041547Z-669961c2`) stopped with no commit: `tests/test_server.py:275` and `:369` read `cfg.sources[0].path`, which fails `mypy --strict` once `Config.sources` is a union. Verified at `3c252f7`. The file joins the write set for two type-narrowing edits (16 files, at the ceiling). Dispatch re-fired on the amended spec.
Collaborator

spec-verify-dispatch Half B for dev/peoplemind-mcp#5 carddav-source-with-sync-token-delta-and-a-radicale-integrat completed integration verify.

  • PR: dev/peoplemind-mcp#16
  • Branch: feat/svd-dev-peoplemind-mcp-5-carddav-source-with-sync-token-55f25c8a
  • Commit: db5047d8eb
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Check forgejo-commit-statuses: absent
  • Checks: PR #16 head db5047d: no Forgejo commit statuses (absent). Local: 153 passed, 3 skipped (Radicale); mypy --strict, ruff check/format, uv lock --check clean.
  • Warning: Radicale integration tests (tests/test_carddav_radicale.py) were collected but skipped because PEOPLEMIND_RADICALE_URL is unset; the architect must run them on the host pre-merge and paste the pytest summary line into the PR (R4).
  • Warning: No remote CI statuses exist on PR head db5047d; remote CI evidence is absent.
  • Warning: Live iCloud/Fastmail check is a manual gate step on #10 (R7), not covered here.
  • Warning: no CI for forgejo-commit-statuses: PR head db5047d has no commit statuses on Forgejo (empty list); no CI run in history. No tracking pointer found. — reported as absent, not blocking (gh#633)
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261101T041917Z-55f25c8a --confirm-merge)
spec-verify-dispatch Half B for dev/peoplemind-mcp#5 carddav-source-with-sync-token-delta-and-a-radicale-integrat completed integration verify. - PR: https://git.groupthink.asia/dev/peoplemind-mcp/pulls/16 - Branch: feat/svd-dev-peoplemind-mcp-5-carddav-source-with-sync-token-55f25c8a - Commit: db5047d8ebe3b225b2f6bfc74a5d1f8935341763 - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Check forgejo-commit-statuses: absent - Checks: PR #16 head db5047d: no Forgejo commit statuses (absent). Local: 153 passed, 3 skipped (Radicale); mypy --strict, ruff check/format, uv lock --check clean. - Warning: Radicale integration tests (tests/test_carddav_radicale.py) were collected but skipped because PEOPLEMIND_RADICALE_URL is unset; the architect must run them on the host pre-merge and paste the pytest summary line into the PR (R4). - Warning: No remote CI statuses exist on PR head db5047d; remote CI evidence is absent. - Warning: Live iCloud/Fastmail check is a manual gate step on #10 (R7), not covered here. - Warning: no CI for forgejo-commit-statuses: PR head db5047d has no commit statuses on Forgejo (empty list); no CI run in history. No tracking pointer found. — reported as absent, not blocking (gh#633) - Decision: review the PR and merge? (`codex-svd ship --run-id 20261101T041917Z-55f25c8a --confirm-merge`)
piers closed this issue 2026-11-01 04:33:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 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#5
No description provided.