From 40df0c4cd94c07b475622e2257b0bb1d1cc90dd7 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 19 Jun 2026 23:30:18 +0100 Subject: [PATCH] Document repo swarm MVP migration state --- notes/epiphany-repo-swarm-mvp-contract.md | 111 ++++++++++++++++++++++ notes/fresh-workspace-handoff.md | 2 +- state/ledgers.msgpack | Bin 303200 -> 303515 bytes state/map.yaml | 4 +- 4 files changed, 114 insertions(+), 3 deletions(-) diff --git a/notes/epiphany-repo-swarm-mvp-contract.md b/notes/epiphany-repo-swarm-mvp-contract.md index faa5229f..40b6865e 100644 --- a/notes/epiphany-repo-swarm-mvp-contract.md +++ b/notes/epiphany-repo-swarm-mvp-contract.md @@ -454,6 +454,117 @@ work through Self, executes through Hands, verifies through Soul, admits state through Mind, and publishes reviewed outcomes through Bifrost while private state stays sealed. +### Current State: The Blessed Chain + +The repo swarm can already prove the following chain on a fresh repo Body: + +```text +repo birth + -> local Verse online + -> Persona/Bifrost work intake + -> Imagination/Self action plan receipt + -> Substrate Gate + Hands queued run packet + -> plan-backed branch-local Hands adoption + -> plan-backed branch-local execution and commit + -> Bifrost/GitHub publication receipts + -> upstream-main ancestry proof after explicit merge receipt +``` + +The chain is typed and sealed enough to be useful: + +- `epiphany-repo init` writes the repo swarm birth receipt, local state layout, + and branch workbench plan. +- `epiphany-swarm online` seeds repo-local CultMesh state, standing-faculty SoA, + topology, liveness, daemon tool directory, and private-state seals. +- `epiphany-work accept` records Persona/Bifrost pressure without granting + Hands, durable-state, publication, or merge authority. +- `epiphany-work plan` records the first typed Imagination/Self action plan: + objective, command, changed paths, commit message, verification asks, stop + conditions, and rollback hints. +- `epiphany-work run` opens the Substrate Gate and queues a Hands packet, but + leaves mutation blocked until adoption. +- `epiphany-work adopt --from-plan` converts the queued packet into + branch-local Hands authority using typed plan evidence. +- `epiphany-work execute --from-plan` consumes that authority on an + `epiphany/*` branch, runs the planned command, stages only planned paths, + commits, and records Hands patch/command/commit receipts. +- `epiphany-work publish` requires Hands commit proof plus Soul and Mind/review + refs before routing Bifrost/GitHub publication receipts; it does not claim + merge or upstream sync. +- `epiphany-work sync` requires an explicit maintainer/Bifrost merge receipt + and writes `upstreamMainSynced=true` only after git proves the published + commit is contained by upstream main. + +The scar is equally important: this is still a manually pulsed chain. The +operator can prove each organ, but the swarm does not yet breathe on its own. + +### Remaining MVP Organs + +The remaining migration is not "add more CLI commands until it looks alive." +The remaining migration is to replace manual stepping with organ-owned +physiology while preserving the same authority receipts. + +Required organs before MVP: + +- Scheduler physiology: Self or heartbeat can advance one safe branch-local + step when typed receipts make that step legal, and can refuse or sleep when + they do not. +- Persona-to-plan automation: repo Persona input becomes candidate action + pressure, Mind/Interpreter extracts work-shaped intent, and Imagination + writes the plan packet without the operator hand-authoring shell details. +- Soul/Modeling/Mind closure: a Hands commit is verified, modeled, and admitted + before Self schedules another implementation turn. +- Repo work overview: the current item, branch, receipts, blocker, next safe + action, and publication/sync state are visible through compact CultMesh/Eve + surfaces without opening private thought. +- Proof bundle: maintainers and future agents can inspect operator-safe receipt + chains, commit refs, verification verdicts, map admission, Bifrost/GitHub + refs, credit refs, and sync state. + +Scheduler authority is intentionally narrow for the first cut. It may advance +`accept -> plan -> run -> adopt -> execute` only when each upstream receipt +exists, the repo is on an owned `epiphany/*` branch for mutation, the planned +paths stay inside the Hands gate, and no brake or active turn blocks the lane. +It may not publish, merge, install services, mutate another repo, expose +private state, or impersonate Idunn's daemon lifecycle authority. + +### MVP Runbook Shape + +The intended MVP runbook is: + +```powershell +epiphany-repo init --workspace --switch-branch +epiphany-swarm online --workspace +epiphany-persona intake --workspace --persona --message +epiphany-swarm run --workspace --until blocked-or-published +epiphany-work publish --workspace --item ... +epiphany-work sync --workspace --item --upstream-ref origin/main --merge-receipt +``` + +Under that short operator surface, the swarm must still emit the same typed +chain: + +```text +Persona speech audit + -> candidate action extraction + -> work accept receipt + -> Imagination action plan receipt + -> Self scheduler tick receipt + -> Substrate Gate grant + -> Hands intent/review/adoption receipts + -> Hands patch/command/commit receipts + -> Soul verification receipt + -> Modeling map update proposal + -> Mind state-admission receipt + -> Bifrost publication and credit receipts + -> GitHub/PR receipt + -> upstream-main sync receipt +``` + +This is the difference between a demo and a repo swarm: the human talks to the +project, the project forms a plan, the branch work happens inside its owned +Body, and the proof bundle tells the truth without leaking the private mind. + ### Phase 0: Authority Freeze Owner: Self, with Mind as the durable-state gate. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index afc557fa..9102ebee 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -102,7 +102,7 @@ remembers doctrine; the branch remembers the blade. - Edge JSON is allowed for schema description, hostile ingress before immediate typed parsing, sealed forensic artifacts, or named quarantine experiments. When both subsystems are ours, runtime data must remain typed CultCache documents and move over CultNet typed contracts. Generic `serde_json::Value` in worker launch/result/selfPatch/runtime flow is contamination until classified and replaced. - Hands now has a first executable action receipt spine. `epiphany-core::hands_gateway` owns `HandsActionIntent`, `HandsActionReview`, `HandsPatchReceipt`, `HandsCommandReceipt`, and `HandsCommitReceipt`; runtime-spine can persist/reread them; `runtime_spine_persists_mind_gateway_review_receipts` includes the Hands chain beside Mind/Eyes/Substrate/Soul/Continuity proofs and proves the post-timestamp Hands receipt-chain detector; `epiphany-hands-action-smoke` emits intent/review/patch/command/commit receipt ids from `.epiphany-smoke\runtime-spine\hands-action-smoke.msgpack`; and the repo-action launch proof profile now requires action intent, action review, and patch receipt together. `epiphany-mvp-coordinator` now turns `continueImplementation` into a persisted Substrate Gate grant plus Hands intent/review gate and includes the receipt ids in the operator step. `epiphany-hands-action` is the native consequence recorder for that gate: `record-patch`, `record-command`, `record-commit`, and turn-level `record-pass` load the stored intent/review or `finalAction.handsActionGate` from `coordinator-summary.json`, require an approved matching review, enforce allowed operations, and keep patch/commit changed paths inside the requested scope. `epiphany-mvp-coordinator-smoke` includes the deterministic Hands pass proof. The coordinator now treats a complete Hands receipt chain after an accepted Soul result as new implementation evidence, launches Soul again, and routes a passing accepted Soul result to Modeling/modeling before another Hands turn. Work-loop telemetry is now typed internal CultMesh state: Verification role launches write `epiphany.cultmesh.work_loop_telemetry.v0` beside runtime-spine, render that packet for Soul with resolved receipt bodies, commit diff preview, source proof notes, verification assertions, and stdout/stderr previews, and Modeling launches read/enrich the latest packet with Soul acceptance receipt ids before Modeling updates the map. Local Verse prompt context now exposes only a sealed `latest_work_loop_summary` digest with telemetry id, Hands receipt ids, path/source/assertion counts, and Soul receipt ids; receipt payload previews, artifact previews, and commit diff previews remain internal telemetry and are leak-guarded by tests plus `epiphany-verse-query -- smoke`. - `notes/epiphany-swarm-readiness-plan.md` is the current live-fire direction gate. The local runner proves startup/status/coordinator wiring; it does not authorize unattended swarm operation. Carry VoidBot's lessons forward: one CTB-style initiative scheduler, typed pause/brake, active-turn freeze, cooldown after completion, stale active-turn recovery receipts, parent-side speech eligibility, memory lifecycle phases, and typed operation proposals instead of prompt-owned governance. `epiphany-verse-query swarm-brake --brake-status engaged|released` can now write the local Verse brake document, and `tools/epiphany_local_run.ps1` refuses live `plan`/`run`/`mvp` modes when that brake is engaged while keeping `status` readable. `epiphany-mvp-coordinator` also checks `--local-verse-store` before app-server startup, and `epiphany-heartbeat-store` guards tick/pump/heat/queue-mention/routine when passed `--local-verse-store`. Daemon tool invocation, daemon lifecycle poke, and `epiphany-daemon-supervisor` restart/tick/serve/service-plan/service-launch/service-runbook/windows-service-install/windows-service-status/windows-service-reconcile/windows-service-execution-readiness/start/stop attempts now fail closed under a matching engaged brake; supervisor restart now has durable per-daemon policy with cooldown/backoff, explicit scheduled tick pulses, latest scheduler receipts, typed service lifecycle plan/launch/runbook/install/status/reconcile/readiness/start/stop receipts, and local operator wrapper modes that write runbook/install/status/reconcile/readiness/control-plan/execution artifacts plus operator run receipts. The installed-service read path, read-only service-policy reconciliation path, execution-readiness path, non-mutating start/stop control-plan path, and non-elevated execution refusal path have been proved against real Windows `EventLog` service-manager state or safe missing-service targets through local Verse receipts, including explicit wrapper install/start/stop execution modes. The next cut is actual elevated install/start/stop execution proof under operator authority. -- `notes/epiphany-repo-swarm-mvp-contract.md` corrects the repo-swarm MVP authority boundary: autonomous branch-local work inside the owned repo Body is in scope and desired; Bifrost gates publication/merge/escalation, not every local edit. Nine native repo-swarm front doors are now live: `epiphany-repo init --workspace ` writes the repo-swarm init receipt and branch workbench plan; `epiphany-swarm online --workspace ` seeds repo-local `.epiphany/local-verse.ccmp`, standing-faculty SoA, topology/liveness/tool/overview proof, and `.epiphany/swarm-online/repo-swarm-online-receipt.json`; `epiphany-work accept --workspace --from persona-or-bifrost --item ` routes a Persona/Bifrost item through CultMesh collaboration feedback into Imagination consensus discovery and writes `.epiphany/work/work-accept-.json` with no Hands, durable-state, or publication authority granted; `epiphany-work plan --workspace --item ...` writes a typed Imagination/Self action-plan receipt with objective, command, changed paths, commit message, verification asks, stop conditions, and rollback hints; `epiphany-work run --workspace [--item ]` persists a repo-local runtime-spine Substrate Gate read/snapshot grant, Hands intent, and Hands review with `decision=queued-for-adoption`; `epiphany-work adopt --workspace --item --from-plan ` promotes that queued review to an approved branch-local Hands gate using the typed plan evidence; `epiphany-work execute --workspace --item --from-plan ` consumes the approved gate on an `epiphany/*` branch, runs the planned command in the repo Body, captures stdout/stderr artifacts, stages only planned changed paths, commits, and records Hands patch/command/commit receipts; `epiphany-work publish --workspace --item ...` requires Hands commit proof plus Soul verification and Mind/review refs, routes Bifrost publication/GitHub publication receipts, records a Hands PR receipt, and keeps `upstreamMainSynced=false` / `mergeAuthorized=false`; `epiphany-work sync --workspace --item --upstream-ref origin/main --merge-receipt ` requires an explicit maintainer/Bifrost merge receipt, verifies the published commit is an ancestor of upstream main, and writes the sync receipt with `upstreamMainSynced=true` only after git proves it. Fresh-repo smokes proved init, online, accept, plan, run, adopt-from-plan, execute-from-plan, publish, and sync with `privateStateExposed=false`; the plan smoke proved `execute --from-plan` created a branch-local commit from the typed plan packet, and the sync smoke proved `upstream-main-not-synced` before fast-forwarding main and `upstream-main-synced` after `git merge --ff-only`. Pre-adoption gates still refuse record-pass. Next missing organ: scheduler physiology for advancing safe branch-local work without manual CLI stepping, then deeper Persona-to-plan automation so plan packets are model/Imagination-authored rather than operator-authored. +- `notes/epiphany-repo-swarm-mvp-contract.md` is the repo-swarm MVP authority map and migration plan. It states the live nine-front-door chain from `epiphany-repo init` through `epiphany-work sync`, documents the operator-safe proof receipts already proved with `privateStateExposed=false`, and names the remaining MVP organs: scheduler physiology, Persona-to-plan automation, Soul/Modeling/Mind closure, repo work overview, and proof bundles. Autonomous branch-local work inside the owned repo Body is in scope and desired; Bifrost gates publication/merge/escalation, Idunn owns daemon lifecycle, and the scheduler may only advance safe receipt-backed branch-local steps. - `service-execution-runbook` makes that next cut repeatable: it generates the exact elevated wrapper command sequence without mutating the service manager, continues after per-step failure to preserve more receipts, runs `service-execution-audit` in `finally`, exits nonzero if any step failed, and seals a typed runbook lifecycle receipt. Run the generated artifact only with explicit operator authority. - `service-execution-audit` is the non-mutating acceptance proof after the elevated rite: it reports `complete` only when typed lifecycle receipts prove the runbook witness plus expected elevated chain, and otherwise reports the missing/failed sealed checks. - `service-tick` is the non-elevated scheduler pulse proof: it writes the latest daemon scheduler receipt through durable policy ownership and local wrapper receipts. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 5195c22a113dd9b8f447f859dd6572b7dc7c661a..48528e404f40bf6ee6e0c19cd1fb29d55fee8f4d 100644 GIT binary patch delta 281 zcmYL@KTE_w6vQuoDy_WEZo$%96Jm9#Z4VT+vD<83ZiAcm!pjCtWnp1!6AlzXtSk>K zYz09Czk!t>#l*&9m}Y)6^Yb>nf1j?my^VRgpPYS6!pF;(9k2HMU~=92H@)u-8a;UJ z{qXByb$b+S%K1r>q{)cv#&H_Q&kPMH*5--MzrC#k(rpFkAQ#TS>hmr` writes the repo-swarm init receipt and branch workbench plan; `epiphany-swarm online --workspace ` seeds repo-local `.epiphany/local-verse.ccmp`, standing-faculty SoA, topology/liveness/tool/overview proof, and `.epiphany/swarm-online/repo-swarm-online-receipt.json`; `epiphany-work accept --workspace --from persona-or-bifrost --item ` routes a Persona/Bifrost item through CultMesh collaboration feedback into Imagination consensus discovery and writes `.epiphany/work/work-accept-.json` with no Hands, durable-state, or publication authority granted; `epiphany-work plan --workspace --item ...` writes a typed Imagination/Self action-plan receipt with objective, command, changed paths, commit message, verification asks, stop conditions, and rollback hints; `epiphany-work run --workspace [--item ]` persists a repo-local runtime-spine Substrate Gate read/snapshot grant, Hands intent, and Hands review with `decision=queued-for-adoption`; `epiphany-work adopt --workspace --item --from-plan ` promotes that queued review to an approved branch-local Hands gate using typed plan evidence; `epiphany-work execute --workspace --item --from-plan ` consumes the approved gate on an `epiphany/*` branch, runs the planned command in the repo Body, captures stdout/stderr artifacts, stages only planned changed paths, commits, and records Hands patch/command/commit receipts; `epiphany-work publish --workspace --item ...` requires Hands commit proof plus Soul verification and Mind/review refs, routes Bifrost publication/GitHub publication receipts, records a Hands PR receipt, and keeps `upstreamMainSynced=false` / `mergeAuthorized=false`; `epiphany-work sync --workspace --item --upstream-ref origin/main --merge-receipt ` requires an explicit maintainer/Bifrost merge receipt, verifies the published commit is an ancestor of upstream main, and writes `upstreamMainSynced=true` only after git proves it. Fresh-repo smokes proved init, online, accept, plan, run, adopt-from-plan, execute-from-plan, publish, and sync with `privateStateExposed=false`; the plan smoke proved `execute --from-plan` creates a branch-local commit from the typed plan packet, and the sync smoke proved `upstream-main-not-synced` before fast-forwarding main and `upstream-main-synced` after `git merge --ff-only`. Pre-adoption gates still refuse record-pass. Next missing organ is scheduler physiology for advancing safe branch-local work without manual CLI stepping, then deeper Persona-to-plan automation so plan packets are model/Imagination-authored rather than operator-authored. + - Use `notes/epiphany-repo-swarm-mvp-contract.md` as the authority correction and migration plan for repo-swarm autonomy. Autonomous branch-local work inside an Epiphany-owned repo Body is in scope and desired; the safety boundary is typed authority, branch containment, interruptibility, receipts, private-state sealing, and Bifrost-gated publication/merge/escalation, not asking a human before every local edit. Nine native repo-swarm front doors are live and documented there: `epiphany-repo init`, `epiphany-swarm online`, `epiphany-work accept`, `epiphany-work plan`, `epiphany-work run`, `epiphany-work adopt --from-plan`, `epiphany-work execute --from-plan`, `epiphany-work publish`, and `epiphany-work sync`. Fresh-repo smokes proved the chain with `privateStateExposed=false`, including plan-backed branch-local commit creation and upstream-main ancestry proof after explicit merge receipt. Remaining MVP organs are scheduler physiology, Persona-to-plan automation, Soul/Modeling/Mind closure after Hands commits, compact repo work overview, and operator-safe proof bundles; the first scheduler cut may advance only safe receipt-backed branch-local steps and must not publish, merge, mutate services, cross repo boundaries, expose private state, or impersonate Idunn. - Agent memory lifecycle now has a first typed v0 operation surface in `epiphany-core::agent_memory`: `AgentMemoryLifecycleOperation` can revise, retire, crystallize, prune, and merge bounded memory records after role/agent review, and `epiphany-agent-memory-store review-lifecycle|apply-lifecycle` exposes the path at the operator edge. This closes the first explicit lifecycle-operation slice from the swarm-readiness gate; it does not yet make sleep silently mutate identity or project truth. - Persona public speech now has a parent-side eligibility receipt at the Discord/Aquarium mouth edge. `epiphany.persona_speech_audit.v0` records action kind, content fingerprint, opening/topic keys, recent-window counts, repeated opening/topic counts, channel saturation, and allow/block reasons. `epiphany-persona-discord post` blocks repeated public openings before token/webhook work; draft and bubble still emit audit receipts for operator inspection. The compatibility JSON artifact remains for display, but the durable witness is now `epiphany.cultmesh.persona_speech_audit.v0` in CultMesh with latest-key projection through local Verse context. Local MVP Persona bubbles now write that durable witness to `.epiphany-run/cultmesh/local-verse.ccmp`, not a separate mouth-side store. This is posting-edge policy, not a Persona prompt wish. - Grow the VoidBot repo-Persona pattern into Epiphany's product direction: each Epiphany owns one or more repos, has one or more Personas, and exposes project-native conversation through Aquarium, Discord, voice/WebRTC, stream surfaces, CLI, and CultNet clients so humans can talk to projects instead of pre-authoring complete implementation briefs. Persona is special because Imagination acts as Projector, turning typed state into narrative context before the Persona thinks, and Mind acts as Interpreter, turning natural Persona output into reviewed state/side-effect intents after the Persona thinks. @@ -633,4 +633,4 @@ current_status: - `tools/epiphany_local_run.ps1 -Mode swarm-online-runbook` now emits an explicit Idunn preflight summary before the operator elevation boundary. Its JSON and one-line summary report `preflightStatus`, child artifact present/hash-verified/mismatch/missing counts, aggregate service execution failed/missing check counts, child preflight rows with expected/actual SHA-256s, and private-state exposure. Live proof `local-20260619-025627-410-9724e2f6` generated the non-mutating parent artifact with `preflightStatus=ready-for-elevated-operator`, two child runbooks present, two hashes verified, zero mismatches, zero missing artifacts, eleven failed sealed service checks, zero missing checks, explicit aftercare audits, and `privateStateExposed=false`. The remaining scar is still explicit elevated operator execution followed by complete Idunn audits, not missing parent/child artifact readiness. - Service lifecycle receipt history is now event-only: `load_epiphany_cultmesh_daemon_service_lifecycle_receipts` filters out the `epiphany-local/daemon-service-lifecycle-receipt/latest` mirror, while `load_latest_epiphany_cultmesh_daemon_service_lifecycle_receipt` remains the latest-state reader. Focused unit test `service_lifecycle_receipt_history_excludes_latest_mirror` proves two per-receipt writes return exactly two history records and latest points at the second. Fresh smoke `verse-query-lifecycle-history-filter-smoke` and live overview/triage `local-20260618-145632-497-efac6f0d` / `local-20260618-145632-321-867947af` prove compact swarm sights still expose service lifecycle attention plus the present elevated runbook artifact without daemon pokes or service mutation. Do not use a broad unscoped cargo test filter for this check on Windows; it fans out across bin harnesses and hit a broken pipe during this pass. - `epiphany-verse-query seed-compact` is the compact seed receipt for wrappers and read-only rites. The older `seed` command still prints the full local Verse context for explicit debugging, but compact wrapper modes now avoid full `seed`/final `query` readback after the combined overview proof exposed Windows debug stack overflow from full-context serialization pressure. - next_action: Continue repo-swarm MVP work from the nine live front doors. The current native chain proves `epiphany-repo init`, `epiphany-swarm online`, `epiphany-work accept`, `epiphany-work plan`, `epiphany-work run`, `epiphany-work adopt --from-plan`, `epiphany-work execute --from-plan`, `epiphany-work publish`, and `epiphany-work sync` through typed Imagination/Self plan receipts, branch-local Hands receipts, Bifrost/GitHub publication receipts, and upstream-main ancestry proof with private state sealed. Next build scheduler physiology for advancing safe branch-local work without manual CLI stepping, then deeper Persona-to-plan automation so plan packets are model/Imagination-authored rather than operator-authored. Preserve Idunn service lifecycle surfaces and the existing CultMesh/Odin/Eve tool directories while doing so; service install/start execution still requires explicit elevated operator authority. + next_action: Continue repo-swarm MVP work from the documented nine-front-door chain. Build scheduler physiology for advancing safe receipt-backed branch-local work without manual CLI stepping; then build deeper Persona-to-plan automation so plan packets are model/Imagination-authored rather than operator-authored. Preserve Idunn service lifecycle surfaces and existing CultMesh/Odin/Eve tool directories; service install/start execution still requires explicit elevated operator authority.