Skip to content

Make pmctl memory canonical across hosts#399

Merged
screenleon merged 3 commits into
mainfrom
agent/cc-483-canonical-memory-provider
Jul 14, 2026
Merged

Make pmctl memory canonical across hosts#399
screenleon merged 3 commits into
mainfrom
agent/cc-483-canonical-memory-provider

Conversation

@screenleon

Copy link
Copy Markdown
Owner

What changed

  • Route Claude, Codex, and OpenCode preparation/session memory through the strict pmctl resolver and writer.
  • Surface canonical provider, project key, memory directory, resolution source, and hit information in prepare/run artifacts.
  • Add locked, atomic episode appends and harden both target-file and lock-directory handling against symlink races.
  • Add Codex UserPromptSubmit/Stop wiring, shared host naming, documentation, and cross-host regression coverage.
  • Track the existing direct-impact planner issue separately as CC-486 instead of mixing it into CC-483.

Why

CC-483 requires one project-owned canonical memory substrate across hosts. Host-native memory may remain auxiliary, but it must not silently override or split the project memory path.

Impact

  • Cross-host PM workflows now resolve and write the same canonical store.
  • Invalid explicit memory configuration fails closed.
  • Prepare and run artifacts make memory resolution observable for debugging and audits.

Root cause and security hardening

Legacy hooks had separate resolver/write paths. During review, the first append implementation was also found to have a symlink TOCTOU window between validation and pathname append. The final implementation uses a protected work directory, hard-link snapshot, temporary file, and atomic rename so a raced symlink is never followed during commit.

Validation

  • Authoritative full suite: 77 passed, 0 failed, 0 skipped.
  • Focused suites: memory 69/69, PM 30/30, guards 296/296, commands 276/276, Codex host write 36/36.
  • Codex full-tier gate identified the append race; the implementation and race tests were updated.
  • Claude full-tier gate then returned final GO, with critic, QA, architecture, security, and risk reviewers all approving/passing.

Ticket: CC-483

@screenleon screenleon marked this pull request as ready for review July 14, 2026 01:32
@screenleon screenleon merged commit 0b66f1f into main Jul 14, 2026
49 checks passed
@screenleon screenleon deleted the agent/cc-483-canonical-memory-provider branch July 14, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant