Skip to content

feat: clean up R2 event-system CLI cluster#74

Merged
Grivn merged 117 commits into
masterfrom
feat/productization-cleanup
Jun 30, 2026
Merged

feat: clean up R2 event-system CLI cluster#74
Grivn merged 117 commits into
masterfrom
feat/productization-cleanup

Conversation

@Grivn

@Grivn Grivn commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Keep root mnemon CLI untouched while clarifying the harness command cluster boundaries.
  • Preserve mnemond as the local event node, mnemon-hub as the remote exchange backend, mnemon-multica-runtime as the Multica adapter, and mnemon-acceptance as test-only orchestration.
  • Add readiness/config/daemon/boundary coverage, structured daemon role details, managed wake context handling, and Multica hub-flow prerequisite guards.
  • Remove tracked .mnemon-dev notes from the repository index so local planning docs stay ignored.

Validation

  • go test ./harness/...
  • real Multica r2-readiness hub-flow run passed: TEA-133 with child issues TEA-134 and TEA-135
  • real mnemonhub managed-runtime acceptance passed with 5 per-hostagent mnemond instances and sentinel-only managed wakes

Notes

  • Dedicated live GitHub mesh testing was intentionally skipped for this pass; GitHub mesh coverage remains logical/boundary oriented per scope.

Grivn added 30 commits June 29, 2026 13:14
Move Codex-managed runtime trace conversion, redaction, and bounding into a dedicated activationtrace package while keeping the existing driver API as a compatibility facade for current callers.

Validation: go test ./harness/internal/activationtrace ./harness/internal/driver ./harness/cmd/mnemon-multica-runtime
Move managed wake candidates, ledgers, render client, and Codex appserver turn driver into a dedicated drive package while keeping driver as a facade for existing callers.

Validation: go test ./harness/internal/drive ./harness/internal/driver ./harness/cmd/mnemond ./harness/cmd/mnemon-multica-runtime ./harness/cmd/mnemon-acceptance
Move Multica participant registry state into the surface/multica adapter package while keeping driver facade functions for existing command and runtime callers.

Validation: go test ./harness/internal/surface/multica ./harness/internal/driver ./harness/cmd/mnemon-harness ./harness/cmd/mnemon-multica-runtime ./harness/cmd/mnemon-acceptance
Move Multica hub metadata, assignment fingerprints, and projection ledger state into the surface/multica adapter package while keeping driver facade helpers for existing issue types.

Validation: go test ./harness/internal/surface/multica ./harness/internal/driver ./harness/cmd/mnemon-multica-runtime ./harness/cmd/mnemon-acceptance ./harness/cmd/mnemon-harness
Add an interaction package for EventMaterial and rule/narrative/refs payload construction, then route Multica issue observed drafts through that boundary.

Validation: go test ./harness/internal/interaction ./harness/internal/surface/multica ./harness/internal/driver ./harness/cmd/mnemon-harness ./harness/cmd/mnemon-multica-runtime ./harness/cmd/mnemon-acceptance
Add a config-first harness product schema with validation, roundtrip persistence, and a read-only bridge from existing local and remote workspace config files.

Validation: go test ./harness/internal/productconfig ./harness/internal/interaction ./harness/internal/drive ./harness/internal/activationtrace ./harness/internal/surface/multica ./harness/internal/driver
Add an internal daemon supervisor for long-running interaction, drive, projection, and status workers with lifecycle reporting and status snapshots.

Validation: go test ./harness/internal/daemon ./harness/internal/productconfig ./harness/internal/interaction ./harness/internal/drive ./harness/internal/activationtrace ./harness/internal/surface/multica ./harness/internal/driver
Expose thin experimental config and daemon command surfaces backed by productconfig and the existing Local Mnemon serve path, without touching the root mnemon CLI.

Validation: go test ./harness/cmd/mnemon-harness ./harness/cmd/mnemond ./harness/cmd/mnemon-multica-runtime ./harness/cmd/mnemon-acceptance ./harness/internal/productconfig ./harness/internal/daemon
Keep Multica import and projection one-shot commands available as hidden debug paths while removing them from the public harness help surface. Projection remains a projector/surface adapter responsibility.

Validation: go test ./harness/cmd/mnemon-harness ./harness/cmd/mnemon-multica-runtime ./harness/cmd/mnemon-acceptance; go run ./harness/cmd/mnemon-harness multica --help
Add config-first mnemon-harness agent/connect commands so participants and external surfaces are maintained through product configuration rather than old Multica-specific command paths. Keep Multica registry/provision commands available only as internal/debug surfaces and build the independent mnemon-multica-runtime adapter from harness-build.

Validation: go test ./harness/cmd/mnemon-harness ./harness/cmd/mnemond ./harness/cmd/mnemon-multica-runtime ./harness/cmd/mnemon-acceptance ./harness/internal/productconfig ./harness/internal/daemon; make harness-build
Move Mnemon projection comment formatting into internal/projection so hidden CLI shims and the Multica runtime share the same projection material path. Keep the driver helper as a compatibility facade instead of letting command handlers own projection semantics.

Validation: go test ./harness/internal/projection ./harness/internal/driver ./harness/cmd/mnemon-harness ./harness/cmd/mnemon-multica-runtime
Expose Multica runtime and participant provisioning through mnemon-acceptance as a test-only orchestration command. The command delegates to the hidden mnemon-harness Multica provision bridge, keeping provision out of the user-facing harness product path while preserving the real setup needed by acceptance runs.

Validation: go test ./harness/cmd/mnemon-acceptance ./harness/cmd/mnemon-harness
Extend the coreguard main-axis inventory to cover the R2 external interaction layers introduced during productization cleanup: interaction points, drive sources, projection surfaces, product config, daemon supervision, and Multica surface primitives.

Validation: go test ./harness/internal/coreguard ./harness/internal/projection ./harness/internal/productconfig ./harness/internal/daemon ./harness/internal/drive ./harness/internal/interaction ./harness/internal/activationtrace ./harness/internal/surface/multica
Move assignment mailbox text, progress comment text, and Multica status mapping into internal/surface/multica. The runtime now maps accepted Mnemon view items into surface material instead of owning Multica UI policy directly.

Validation: go test ./harness/internal/surface/multica ./harness/cmd/mnemon-multica-runtime ./harness/cmd/mnemon-acceptance ./harness/internal/coreguard
Resolve Multica issue context from daemon-provided ids, standard issue mention links, and narrow issue-key tags before querying the issue through the CLI. Treat root-session metadata writes as projection warnings so transient Multica surface failures do not block Mnemon ingest.

Validation: go test ./harness/cmd/mnemon-multica-runtime ./harness/internal/driver ./harness/internal/surface/multica; go test ./harness/...; make harness-build.
Query Multica issue metadata after issue get so runtime classification uses the authoritative metadata surface with a fallback to the embedded issue payload.

Render assignment mailbox issues and runtime comments as structured Markdown with issue mentions while keeping mnemon.* routing and dedupe fields in metadata. Validated with go test -count=1 ./harness/....
Move Multica issue status normalization and progress-to-status decisions into the surface/multica projection layer so the runtime adapter consumes projection policy instead of owning it inline.

Cover waiting, in-progress, review, done, blocked, and canceled mappings, and derive root issue status from feedback semantics instead of marking every progress digest as review. Validated with go test -count=1 ./harness/....
Audit Multica CLI availability and participant registry presence before prod-sim creates external issues, and record both conditions as acceptance assertions.

This keeps real Multica validation failures diagnosable when local CLI/auth or registry setup is missing. Validated with go test -count=1 ./harness/....
Teach productconfig.FromLegacy to read the existing Multica participant registry as a legacy bridge for connections, participants, daemon roles, and the primary activation carrier.

This keeps the experimental config surface authoritative without discarding existing Multica setup files. Validated with go test -count=1 ./harness/....
Report configured watcher, drive, and projection-surface role counts from product config or legacy bridges in mnemon-harness daemon status.

This gives the experimental daemon surface a concrete status snapshot over config-owned workers. Validated with go test -count=1 ./harness/....
Add coreguard tests proving projection surfaces cannot import mnemond ingest/write paths and activationtrace cannot depend on EventEnvelope material packages.

This pins the R2 rule that projection and trace are derived external surfaces, not canonical event writers. Validated with go test -count=1 ./harness/....
Introduce file-backed cursor storage, bounded retry backoff, and an in-flight guard for harness daemon workers.

These primitives cover the R2 daemon requirements for cursor resume, retry/backoff, and duplicate-work suppression. Validated with go test -count=1 ./harness/....
Move Multica runtime update comment rendering out of mnemon-multica-runtime and into surface/multica projection material.

The runtime adapter now maps import results into surface material while the Multica projection package owns the visible Markdown. Validated with go test -count=1 ./harness/....
Move Multica issue-to-teamwork_signal rule/narrative/refs construction from the legacy driver facade into surface/multica.

The driver keeps a compatibility wrapper, while the Multica adapter surface now owns interaction intake material. Validated with go test -count=1 ./harness/....
Extract Multica runtime RPC item material for user, agent, command, and managed trace events into the surface/multica package. The runtime entrypoint now only converts those surface messages into its JSON-RPC envelope.

Validation: go test -count=1 ./harness/internal/surface/multica; go test -count=1 ./harness/cmd/mnemon-multica-runtime; go test -count=1 ./harness/...
Extract render-response candidate selection and stable issue/assignment match-term handling from the Multica runtime entrypoint into the drive layer. The runtime now only maps its import result into drive material before waking the managed agent.

Validation: go test -count=1 ./harness/internal/drive; go test -count=1 ./harness/cmd/mnemon-multica-runtime; go test -count=1 ./harness/...
Move the runtime issue metadata overlay rule into surface/multica so issue get metadata and issue metadata list results are merged consistently, with listed values taking precedence over embedded issue metadata.

Validation: go test -count=1 ./harness/internal/surface/multica; go test -count=1 ./harness/cmd/mnemon-multica-runtime; go test -count=1 ./harness/...
Add a file-backed daemon status snapshot store and have mnemon-harness daemon status read the default snapshot path when present. This gives interaction, drive, projection, and status workers a durable readiness surface without mutating missing config.

Validation: go test -count=1 ./harness/internal/daemon; go test -count=1 ./harness/cmd/mnemon-harness; go test -count=1 ./harness/...
Add a file-backed daemon work ledger keyed by work kind and target so projection and wake workers can record idempotent progress across restarts. The ledger preserves created timestamps, updates status in place, and exposes filtered records for worker status or retry policy.

Validation: go test -count=1 ./harness/internal/daemon; go test -count=1 ./harness/...
Update mnemon-harness top-level help to describe Mnemon as an event-driven collaboration substrate and Teamwork as a profile on top of it. The help tests now assert that terminology while continuing to guard against internal command leaks.

Validation: go test -count=1 ./harness/cmd/mnemon-harness; go test -count=1 ./harness/...
Grivn added 28 commits June 30, 2026 03:47
Move the fallback participant-with-agent selection into the Multica surface registry helpers and have the real Multica acceptance flow reuse those semantics. This keeps acceptance orchestration aligned with the runtime adapter registry rules instead of carrying a local traversal copy.

Validation: go test -count=1 ./harness/internal/surface/multica ./harness/cmd/mnemon-acceptance ./harness/internal/coreguard; go test -count=1 ./...
Have the real Multica runtime acceptance evidence path resolve child hub metadata through the driver helper used by the runtime adapter. The hub-flow fixture now covers partial child metadata from issue children with authoritative metadata list fallback.

Validation: go test -count=1 ./harness/cmd/mnemon-acceptance ./harness/internal/driver ./harness/internal/coreguard; go test -count=1 ./...
Pin the Multica runtime adapter command name in the Multica surface layer and reuse it through driver, product config, harness provisioning, acceptance provisioning, and runtime self-description. This keeps the existing mnemon-multica-runtime binary name explicit while preventing default drift across CLI cluster surfaces.

Validation: go test -count=1 ./harness/internal/surface/multica ./harness/internal/driver ./harness/internal/productconfig ./harness/cmd/mnemon-harness ./harness/cmd/mnemon-acceptance ./harness/cmd/mnemon-multica-runtime ./harness/internal/coreguard; go test -count=1 ./...
Pin the default Multica runtime profile display name beside the adapter command name and reuse it from harness and acceptance provisioning. This removes another default naming copy from the CLI cluster without changing the registered profile value.

Validation: go test -count=1 ./harness/internal/surface/multica ./harness/internal/driver ./harness/cmd/mnemon-harness ./harness/cmd/mnemon-acceptance ./harness/cmd/mnemon-multica-runtime ./harness/internal/coreguard; go test -count=1 ./...
Return nil for mnemon-hub --help so the remote exchange backend command exposes normal CLI help without an error exit. Tighten command and transitive boundary guards so mnemonhub does not drift into local mnemond access, admission, presentation, daemon, or driver behavior layers.

Validation: go test -count=1 ./harness/cmd/mnemon-hub ./harness/internal/mnemonhub ./harness/internal/coreguard; go run ./harness/cmd/mnemon-hub --help; go run ./harness/cmd/mnemon-hub --dev-selfsigned <tmpdir>; go test -count=1 ./...
Add a CLI-level sync round trip that points mnemon-harness push and pull at an in-process mnemonhub HTTP handler. The case proves local progress is acked by the hub, foreign hub material imports through Local Mnemon, and the pull cursor remains idempotent.

Validation: go test -count=1 ./harness/cmd/mnemon-harness ./harness/internal/mnemonhub ./harness/internal/app ./harness/cmd/mnemon-hub; go test -count=1 ./...
Capture child run and projection snapshots when Multica hub-flow acceptance fails before all expected assignment mailboxes or active agents arrive. This keeps failed complex teamwork runs useful for diagnosing which Multica artifacts already materialized.

Validation: go test -count=1 ./harness/cmd/mnemon-acceptance ./harness/cmd/mnemon-harness ./harness/internal/mnemonhub ./harness/internal/app ./harness/internal/coreguard; go test -count=1 ./...
Run mnemon-acceptance commands with a signal-aware Cobra context so Ctrl-C cancels waits through cmd.Context instead of bypassing report finalization paths. This pairs with Multica partial evidence snapshots for long hub-flow runs.

Validation: go test -count=1 ./harness/cmd/mnemon-acceptance; git diff --check; go test -count=1 ./...
Add a daemon snapshot guard proving mnemonhub produces only an interaction watcher and never a projection worker. This reinforces the R2 boundary that mnemonhub is the remote exchange backend, not an activation carrier or projection surface.

Validation: go test -count=1 ./harness/cmd/mnemon-harness; git diff --check; go test -count=1 ./harness/cmd/mnemon-harness ./harness/internal/productconfig ./harness/internal/daemon ./harness/internal/coreguard; go test -count=1 ./...
Normalize local registry, managed workspace, and inferred control token file paths before writing Multica participant env. Live protocol-react validation showed relative token paths are resolved from the Multica runtime cwd and can prevent Local Mnemon ingest.

Validation: go test -count=1 ./harness/cmd/mnemon-harness; git diff --check; go test -count=1 ./harness/cmd/mnemon-harness ./harness/cmd/mnemon-acceptance ./harness/cmd/mnemon-multica-runtime ./harness/internal/surface/multica; go test -count=1 ./...
Move product-configured daemon worker snapshot construction out of the mnemon-harness command layer and into harness/internal/daemon, keeping the command focused on loading config and reporting status.

Validation: go test -count=1 ./...; go test -count=1 ./harness/internal/daemon ./harness/cmd/mnemon-harness ./harness/internal/coreguard; git diff --check.
Extend the root CLI boundary guard to scan root command string literals for R2 harness cluster surface names, so mnemond, mnemonhub, and Multica runtime naming stays out of the root mnemon CLI during this phase.

Validation: go test -count=1 ./...; go test -count=1 ./harness/internal/coreguard; git diff --check.
Add a structured Cobra command-tree guard for mnemon-harness internal and debug commands so control, loop, Multica provisioning/import/projection shims, token, and tower remain hidden from the public product surface.

Validation: go test -count=1 ./...; go test -count=1 ./harness/cmd/mnemon-harness ./harness/internal/coreguard; git diff --check.
Replace stale runtime progress pseudo-commands that implied a root mnemon multica command surface with mnemon-multica-runtime adapter labels, and guard the runtime command tree against reintroducing those shapes.

Validation: go test -count=1 ./...; go test -count=1 ./harness/cmd/mnemon-multica-runtime ./harness/internal/coreguard; git diff --check.
Move local and sync out of the mnemon-harness public product help while keeping the commands callable as hidden debug/service verbs. This keeps the visible harness surface aligned with setup, config, daemon, doctor, agent, connect, session, and status.

Validation: go test -count=1 ./...; go test -count=1 ./harness/cmd/mnemon-harness ./harness/internal/coreguard; git diff --check.
Add an exact root command whitelist for the R2 product harness surface, keeping agent/config/connect/daemon/doctor/session/setup/status as the only visible commands while hidden internals remain callable by explicit path.

Validation: go test -count=1 ./harness/cmd/mnemon-harness; go test -count=1 ./harness/cmd/mnemon-harness ./harness/internal/coreguard; go test -count=1 ./...; git diff --check.
Treat flag.ErrHelp as a successful service help path for the local event node and its local managed-drive command, matching the exchange hub behavior while keeping other flag errors fail-closed.

Validation: go test -count=1 ./harness/cmd/mnemond; go run ./harness/cmd/mnemond --help; go run ./harness/cmd/mnemond agent run --help; go test -count=1 ./harness/cmd/mnemond ./harness/cmd/mnemon-hub ./harness/internal/coreguard; go test -count=1 ./...; git diff --check.
Add a successful help path for mnemon-multica-runtime, including probe help, so the independent adapter advertises its stdio runtime boundary, mnemond ingest path, local [mnemon:wake] behavior, activation trace, and Multica projection role without naming root or harness Multica command shapes.

Validation: go test -count=1 ./harness/cmd/mnemon-multica-runtime; go run ./harness/cmd/mnemon-multica-runtime --help; go run ./harness/cmd/mnemon-multica-runtime --probe --help; go test -count=1 ./harness/cmd/mnemon-multica-runtime ./harness/internal/surface/multica ./harness/internal/coreguard; go test -count=1 ./...; git diff --check.
Expand mnemond help so the local event node exposes its service commands and local managed-agent drive-source subcommand, and align the command comment with the event-node boundary.

Validation: go test -count=1 ./harness/cmd/mnemond; go run ./harness/cmd/mnemond --help; go run ./harness/cmd/mnemond agent --help; go test -count=1 ./harness/cmd/mnemond ./harness/cmd/mnemon-hub ./harness/internal/coreguard; go test -count=1 ./...; git diff --check.
Add serve/help command-shape handling around the remote event exchange backend while preserving the existing flag parser and sync wire. The serve alias now parses the same store, replicas, and TLS flags as the previous direct invocation.

Validation: go test -count=1 ./harness/cmd/mnemon-hub; go run ./harness/cmd/mnemon-hub help; go run ./harness/cmd/mnemon-hub serve --store x.db --replicas r.json --tls-cert c.pem; go test -count=1 ./harness/cmd/mnemon-hub ./harness/cmd/mnemond ./harness/internal/coreguard ./harness/internal/mnemonhub ./harness/internal/mnemonhub/exchange; go test -count=1 ./...; git diff --check.
Add a read-only mnemond doctor command for the local event node. It reports local setup config, boot-chain readiness, background daemon pid state, and Remote Workspace status without crossing into product config or hub/projection ownership.

Validation: go test -count=1 ./harness/cmd/mnemond; go run ./harness/cmd/mnemond doctor --root <temp>; go run ./harness/cmd/mnemond help; go test -count=1 ./harness/cmd/mnemond ./harness/cmd/mnemon-hub ./harness/internal/coreguard ./harness/internal/app; go test -count=1 ./...; git diff --check.
Treat lifecycle subcommand help as a successful service path for mnemond and give root-only lifecycle verbs command-specific help names. This keeps serve/up/reload/down/status/logs/doctor consistent with the local event-node service surface without changing normal execution behavior.

Validation: go test -count=1 ./harness/cmd/mnemond; go run ./harness/cmd/mnemond <serve|up|reload|down|status|logs|doctor> --help; go test -count=1 ./harness/cmd/mnemond ./harness/cmd/mnemon-hub ./harness/internal/coreguard ./harness/internal/app; go test -count=1 ./...; git diff --check.
Add a Multica runtime context model that normalizes daemon-provided environment fields, structured issue mentions/tags, workspace/server metadata, and Mnemon control routing before the adapter imports an issue. The runtime import path now consumes that context for issue lookup, principal resolution, rule refs, CLI workspace/server routing, and assignment-mailbox correlation.

Validation: go test -count=1 ./harness/internal/surface/multica; go test -count=1 ./harness/cmd/mnemon-multica-runtime; go test -count=1 ./harness/internal/coreguard ./harness/internal/surface/multica ./harness/cmd/mnemon-multica-runtime ./harness/cmd/mnemon-harness ./harness/cmd/mnemond ./harness/cmd/mnemon-hub ./harness/internal/daemon ./harness/internal/productconfig; go test -count=1 ./...; git diff --check.
Preflight the mnemond background listen address before detaching the child process. This prevents mnemond up from treating an unrelated listener on the configured port as its own readiness signal and leaving a misleading pidfile path.

Validation: go test -count=1 ./harness/cmd/mnemond; go test -count=1 ./harness/internal/coreguard ./harness/cmd/mnemond ./harness/cmd/mnemon-hub ./harness/internal/daemon; temporary setup/up/status/doctor/down lifecycle on a free loopback port; go test -count=1 ./...; git diff --check.
Require the live Multica hub-flow acceptance gate to prove participant agents have a managed runtime capable of driving teamwork before creating the root issue. This prevents noop-configured runtime agents from being mistaken for a valid multi-agent hub-flow environment and keeps failed prerequisite checks from polluting the workspace with impossible acceptance issues.

Validation: go test -count=1 ./harness/cmd/mnemon-acceptance; go test -count=1 ./harness/internal/driver ./harness/cmd/mnemon-acceptance; live multica-runtime-prod-sim --require-hub-flow prerequisite check against the current workspace failed before issue creation because all five participants are configured with MNEMON_MANAGED_RUNTIME=noop; go test -count=1 ./...; git diff --check.
Codex app-server no longer accepts turn/start additionalContext, so pass the rendered Mnemon hook context through thread developerInstructions while preserving the sentinel-only user input contract.

Validation: go test ./harness/internal/drive ./harness/internal/driver ./harness/cmd/mnemon-multica-runtime ./harness/cmd/mnemon-acceptance ./harness/cmd/mnemond; live Multica hub-flow TEA-133 passed with child mailboxes and multi-agent runs.
Expose normalized daemon role details in mnemon-harness daemon status so configured Multica, GitHub, mnemonhub, managed-drive, and projection roles are visible without relying on prose-only summaries. The detail view marks mnemonhub as a remote exchange boundary while Multica remains the activation carrier/projection surface.

Validation: go test ./harness/internal/daemon ./harness/cmd/mnemon-harness; go test ./harness/internal/productconfig ./harness/internal/coreguard; git diff --check.
Remove the accidentally tracked .mnemon-dev note from the repository index while leaving the local ignored workspace notes intact.
@Grivn Grivn merged commit 1d81815 into master Jun 30, 2026
1 check passed
@Grivn Grivn deleted the feat/productization-cleanup branch June 30, 2026 01:13
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