Skip to content

feat(memory): add ccc-piri node-global Piri memory launcher - #960

Merged
jinon86 merged 1 commit into
mainfrom
feat/ccc-piri-memory-wrapper
Aug 5, 2026
Merged

feat(memory): add ccc-piri node-global Piri memory launcher#960
jinon86 merged 1 commit into
mainfrom
feat/ccc-piri-memory-wrapper

Conversation

@jinon86

@jinon86 jinon86 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Node-global counterpart of ccc-codex: ccc-piri materializes the shared ccc-node memory snapshot into the Piri global context file (<piri-agent-dir>/AGENTS.md) before every Piri launch, closing the gap where node-global Piri sessions (bridge RPC, print-mode, interactive) started with no memory injection — only audience-scoped sessions had a runtime bootstrap.

This completes the "one snapshot spec + per-provider adapter" convergence: Claude (SessionStart hook), Codex (ccc-codex → global AGENTS.md), Piri (ccc-piri → global AGENTS.md) all start from the same bounded load-memory.sh policy + managed nunchi merge.

Mechanism

  • The shared materializer resolves its output as <CODEX_HOME>/AGENTS.md; the launcher runs it with CODEX_HOME pointed at the Piri agent dir (${PIRI_CODING_AGENT_DIR:-~/.piri/agent}) and CCC_MEMORY_MATERIALIZER_PROVIDER=piri, then execs the real CLI (argv/cwd/stdio/exit/signals preserved).
  • Same fail-closed contract as ccc-codex: refresh failure may proceed on a structurally valid private last snapshot, otherwise exit 78.

Guards (non-user runs stay memory-free)

  • PIRI_CODING_AGENT_SESSION_DIR under .piri-feed-extractor-sessions → nunchi piri-feed extractor bypasses the bootstrap entirely
  • CCC_MEMORY_AUDIENCE_SCOPED truthy → skipped (audience-scoped sessions are bootstrapped by the bridge runtime via --no-context-files --append-system-prompt)
  • CCC_PIRI_MEMORY_SKIP=1 → operator kill-switch

Live verification (soonwook/vps6)

  • Spy-tested all 4 guard paths; real end-to-end: a new Piri session launched through the wrapper confirms the injected snapshot (MEMORY_OK)
  • Bridge drop-in now points CCC_PIRI_CLI_PATH at the wrapper with CCC_PIRI_REAL_CLI_PATH=/opt/piri/piri-ccc.sh; service restarted clean, error log empty

Changes

  • scripts/ccc-piri (new), scripts/ccc-piri.test.sh (new, 13 hermetic tests incl. all guards)
  • setup.sh: installs the launcher beside ccc-codex; summary prints CCC_PIRI_CLI_PATH
  • scripts/setup.test.sh: install + dry-run assertions for ccc-piri
  • scripts/validate-harness.sh: registers the new test
  • docs/memory.md: "Piri global snapshot materializer (ccc-piri)" section

Test plan

  • scripts/ccc-piri.test.sh 13/13
  • scripts/ccc-codex.test.sh 9/9 (no regression)
  • scripts/setup.test.sh 69/69
  • scripts/validate-harness.sh full PASS
  • Live smoke on vps6 (materialize + wrapper E2E + bridge restart)

Rollback

Restore zz-piri.conf.bak-pre-ccc-piri-20260805 drop-in on the node and restart the bridge; the wrapper is inert unless CCC_PIRI_CLI_PATH points at it.

@jinon86
jinon86 requested a review from seoseo-ai as a code owner August 5, 2026 11:06

@seoseo-ai seoseo-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after explicit operator authorization using the local seoseo-ai credential.

Node-global counterpart of ccc-codex: materializes the shared ccc-node
snapshot into the Piri global context file (<piri-agent-dir>/AGENTS.md,
via CODEX_HOME indirection + CCC_MEMORY_MATERIALIZER_PROVIDER=piri) before
exec'ing the real Piri CLI. Closes the injection gap where node-global
Piri sessions (bridge RPC, print-mode, interactive) started with no
memory while audience-scoped sessions already had a runtime bootstrap.

Guards keep non-user runs memory-free: the nunchi piri-feed extractor
session dir, CCC_MEMORY_AUDIENCE_SCOPED (runtime-owned bootstrap), and
the CCC_PIRI_MEMORY_SKIP kill-switch. Shares the ccc-codex fail-closed
contract (exit 78, last-valid-snapshot fallback, argv/cwd/stdio/signal
preservation via final exec).

Deployed and live-verified on soonwook (vps6): new Piri sessions through
the wrapper confirm the injected snapshot (MEMORY_OK round-trip).

- setup.sh installs the launcher beside ccc-codex; summary prints
  CCC_PIRI_CLI_PATH
- scripts/ccc-piri.test.sh: 13 hermetic launch-surface + guard tests
- docs/memory.md: Piri global snapshot materializer section
@jinon86
jinon86 force-pushed the feat/ccc-piri-memory-wrapper branch from a8b1714 to efbd773 Compare August 5, 2026 11:18
@jinon86
jinon86 merged commit 630aba8 into main Aug 5, 2026
8 checks passed
@jinon86
jinon86 deleted the feat/ccc-piri-memory-wrapper branch August 5, 2026 11:27
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.

2 participants