Reserve action and config as Source names #148

Closed
opened 2026-11-06 21:50:27 +00:00 by svc-agent-writer · 3 comments

This was generated by AI during an SVD gate.

What to build

Reserve action and config as names a Source cannot take.

Local rows use source='action', and Owner configuration rows use config. config.py:165 and :172 accept any name that matches the Source-name pattern, so a Source named action is possible. The #105 gate (ruling D6, operator word "Accept") found that manual Interactions are still safe, because their event: ref, NULL source_record and the message: scope keep every Source-keyed delete away from them. Other local rows rely on the name alone.

Acceptance criteria

  • Configuration refuses a Source named action or config with a clear error at load.
  • A test covers both names; existing configuration tests still pass.

Blocked by

None.

> *This was generated by AI during an SVD gate.* ## What to build Reserve `action` and `config` as names a Source cannot take. Local rows use `source='action'`, and Owner configuration rows use `config`. `config.py:165` and `:172` accept any name that matches the Source-name pattern, so a Source named `action` is possible. The #105 gate (ruling D6, operator word "Accept") found that manual Interactions are still safe, because their `event:` ref, NULL `source_record` and the `message:` scope keep every Source-keyed delete away from them. Other local rows rely on the name alone. ## Acceptance criteria - [ ] Configuration refuses a Source named `action` or `config` with a clear error at load. - [ ] A test covers both names; existing configuration tests still pass. ## Blocked by None.
Author
Member

This was generated by AI during triage.

Agent Brief

Category: enhancement
Summary: Configuration refuses a Source named action or config.

Current behavior:
Every Source kind (vcard, carddav, mailmind) accepts any name that matches the Source-name pattern ^[a-z0-9][a-z0-9_-]{0,31}$. Two names already have a meaning in the store. Local rows written by Actions use source = 'action'. Owner Handles from configuration use source = 'config'. A Source with either name would share rows with them, and a Source-keyed delete or re-sync could remove local or Owner rows.

The issue body names only the vcard and carddav models. The mailmind Source model uses the same pattern, so it needs the same rule.

Desired behavior:
Loading a configuration with a Source named action or config, of any kind, fails with a ConfigError. The error names the offending sources.<i>.name location, in the same style as the existing configuration errors. Every other valid name still loads.

Key interfaces:

  • SourceConfig, the discriminated union of the three Source models: one shared reserved-name rule that covers all three kinds.
  • A single constant that holds the reserved names, so a later reserved name is added in one place.

Acceptance criteria:

  • A vcard, carddav or mailmind Source named action or config is refused at load with a clear error that names the location.
  • Tests cover both names on each Source kind.
  • Existing configuration tests still pass, and the required repository checks are green.

Out of scope:

  • Renaming the store's own action and config source values.
  • Migrating any existing database. No deployed configuration uses either name.
  • Manual Interactions. The #105 gate (ruling D6) found them safe by other means.
> *This was generated by AI during triage.* ## Agent Brief **Category:** enhancement **Summary:** Configuration refuses a Source named `action` or `config`. **Current behavior:** Every Source kind (`vcard`, `carddav`, `mailmind`) accepts any name that matches the Source-name pattern `^[a-z0-9][a-z0-9_-]{0,31}$`. Two names already have a meaning in the store. Local rows written by Actions use `source = 'action'`. Owner Handles from configuration use `source = 'config'`. A Source with either name would share rows with them, and a Source-keyed delete or re-sync could remove local or Owner rows. The issue body names only the `vcard` and `carddav` models. The `mailmind` Source model uses the same pattern, so it needs the same rule. **Desired behavior:** Loading a configuration with a Source named `action` or `config`, of any kind, fails with a `ConfigError`. The error names the offending `sources.<i>.name` location, in the same style as the existing configuration errors. Every other valid name still loads. **Key interfaces:** - `SourceConfig`, the discriminated union of the three Source models: one shared reserved-name rule that covers all three kinds. - A single constant that holds the reserved names, so a later reserved name is added in one place. **Acceptance criteria:** - [ ] A `vcard`, `carddav` or `mailmind` Source named `action` or `config` is refused at load with a clear error that names the location. - [ ] Tests cover both names on each Source kind. - [ ] Existing configuration tests still pass, and the required repository checks are green. **Out of scope:** - Renaming the store's own `action` and `config` source values. - Migrating any existing database. No deployed configuration uses either name. - Manual Interactions. The #105 gate (ruling D6) found them safe by other means.
Collaborator

⏸ SVD architect gate: dev/people-mind-mcp#148 reserve-action-and-config-as-source-names

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 additive · dispatch effort low

Run: 20261107T215718Z-1745f447

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

Open risks:

  1. Should README.md document that action and config are reserved Source names? Neither the issue nor the triage brief asks for it, and the README has no Source-name rules section today. The spec leaves the README out; approving a doc line adds README.md as a third Primary File. [decision]
  2. No test baseline was measured in the Half-A sandbox (.venv/bin/python denied). Check: on pristine base 6aaedf9, before the first edit, run uv run python3 -m pytest tests/test_config_cli.py tests/test_carddav.py tests/test_server.py -m 'not integration' and then make check. After the change the failure set must be unchanged except for the new passing tests, and CI check must be green on the PR. [verification]
  3. The triage brief says no deployed config uses a reserved Source name; only checked-in configs were grepped. Check before rollout: peoplemind check --config exits 0 on each deployment. Exit 2 with at=sources...name means rename that Source first. [verification]

Change: In src/people_mind_mcp/config.py, add RESERVED_SOURCE_NAMES = frozenset({"action", "config"}), a typed _unreserved_source_name(value: str) -> str that raises ValueError("reserved-source-name"), and SourceName = Annotated[str, Field(pattern=LABEL_PATTERN), AfterValidator(_unreserved_source_name)]. This mirrors the FeedConfig.consumers Annotated[str, Field(pattern=LABEL_PATTERN)] shape at config.py:146. Use name: SourceName in VCardSourceConfig (:165), CardDAVSourceConfig (:172) and MailmindSourceConfig (:191); the literal regexes at :165 and :172 are identical to LABEL_PATTERN. Import AfterValidator on the pydantic line at :9. A field-level validator puts the error at sources...name, which load_config (:242-255) already turns into ConfigError('config-validation', locations). load_config, cli, the store and every Source-name reader stay unchanged.

Files: src/people_mind_mcp/config.py · tests/test_config_cli.py

Decision: accept the 3 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-reserve-action-and-config-as-source-names.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-07-reserve-action-and-config-as-source-names.md

### ⏸ SVD architect gate: dev/people-mind-mcp#148 reserve-action-and-config-as-source-names **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 `additive` · dispatch effort `low` **Run:** `20261107T215718Z-1745f447` **Held because:** CLEAN but 3 open risk(s) (2 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. Should README.md document that action and config are reserved Source names? Neither the issue nor the triage brief asks for it, and the README has no Source-name rules section today. The spec leaves the README out; approving a doc line adds README.md as a third Primary File. [decision] 2. No test baseline was measured in the Half-A sandbox (.venv/bin/python denied). Check: on pristine base 6aaedf9, before the first edit, run uv run python3 -m pytest tests/test_config_cli.py tests/test_carddav.py tests/test_server.py -m 'not integration' and then make check. After the change the failure set must be unchanged except for the new passing tests, and CI check must be green on the PR. [verification] 3. The triage brief says no deployed config uses a reserved Source name; only checked-in configs were grepped. Check before rollout: peoplemind check --config <live config> exits 0 on each deployment. Exit 2 with at=sources.<i>.<kind>.name means rename that Source first. [verification] **Change:** In src/people_mind_mcp/config.py, add RESERVED_SOURCE_NAMES = frozenset({"action", "config"}), a typed _unreserved_source_name(value: str) -> str that raises ValueError("reserved-source-name"), and SourceName = Annotated[str, Field(pattern=LABEL_PATTERN), AfterValidator(_unreserved_source_name)]. This mirrors the FeedConfig.consumers Annotated[str, Field(pattern=LABEL_PATTERN)] shape at config.py:146. Use name: SourceName in VCardSourceConfig (:165), CardDAVSourceConfig (:172) and MailmindSourceConfig (:191); the literal regexes at :165 and :172 are identical to LABEL_PATTERN. Import AfterValidator on the pydantic line at :9. A field-level validator puts the error at sources.<i>.<kind>.name, which load_config (:242-255) already turns into ConfigError('config-validation', locations). load_config, cli, the store and every Source-name reader stay unchanged. **Files:** `src/people_mind_mcp/config.py` · `tests/test_config_cli.py` **Decision:** accept the 3 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-reserve-action-and-config-as-source-names.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-07-reserve-action-and-config-as-source-names.md`</sub>
Collaborator

spec-verify-dispatch Half B for dev/people-mind-mcp#148 reserve-action-and-config-as-source-names completed integration verify.

  • PR: #159
  • Branch: feat/svd-dev-people-mind-mcp-148-reserve-action-and-config-as-c6701772
  • Commit: 1fa1c736a8
  • 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/138/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • Warning: Bare python3 -m pytest fails collection without the project env (No module named phonenumbers); verified through uv run, which provisions it.
  • Warning: The PR body and the commit carry a Co-Authored-By: gpt-6.1-terra trailer. This is not a blocker.
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261107T222932Z-c6701772 --confirm-merge)
spec-verify-dispatch Half B for dev/people-mind-mcp#148 reserve-action-and-config-as-source-names completed integration verify. - PR: https://git.groupthink.asia/dev/people-mind-mcp/pulls/159 - Branch: feat/svd-dev-people-mind-mcp-148-reserve-action-and-config-as-c6701772 - Commit: 1fa1c736a8041934d67d20a19c5c13f6a63bd723 - 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/138/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - Warning: Bare `python3 -m pytest` fails collection without the project env (No module named phonenumbers); verified through `uv run`, which provisions it. - Warning: The PR body and the commit carry a `Co-Authored-By: gpt-6.1-terra` trailer. This is not a blocker. - CI wait: ci/woodpecker/pr/validation -> pass - Decision: review the PR and merge? (`codex-svd ship --run-id 20261107T222932Z-c6701772 --confirm-merge`)
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#148
No description provided.