From 011ffef22e024e181e6689670221d1aa27ae9676 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 20 Jun 2026 21:54:44 +0100 Subject: [PATCH] Add repo work map family lens --- ...ny-repo-close-mind-adoption-guard-smoke.rs | 47 ++++++++++ epiphany-core/src/bin/epiphany-verse-query.rs | 84 ++++++++++++++++++ notes/epiphany-repo-swarm-mvp-contract.md | 13 ++- notes/fresh-workspace-handoff.md | 1 + state/ledgers.msgpack | Bin 352607 -> 352894 bytes state/map.yaml | 3 +- 6 files changed, 145 insertions(+), 3 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-repo-close-mind-adoption-guard-smoke.rs b/epiphany-core/src/bin/epiphany-repo-close-mind-adoption-guard-smoke.rs index d2251717..cbdf88e4 100644 --- a/epiphany-core/src/bin/epiphany-repo-close-mind-adoption-guard-smoke.rs +++ b/epiphany-core/src/bin/epiphany-repo-close-mind-adoption-guard-smoke.rs @@ -503,6 +503,36 @@ fn run_smoke(args: Args) -> Result { "Gjallar TUI rows did not expose compact repo map sight" )); } + require_u64(&gjallar, &["repoWorkMapFamilyLensCount"], 1)?; + let family_lens_rows = value_at_path(&gjallar, &["repoWorkMapFamilyLensRows"]) + .and_then(Value::as_array) + .ok_or_else(|| anyhow!("Gjallar output had no repoWorkMapFamilyLensRows array"))?; + let family_lens_row = family_lens_rows + .iter() + .find(|row| { + row.get("safeActionFamily").and_then(Value::as_str) + == Some("repo.markdown_planning_note") + }) + .ok_or_else(|| anyhow!("Gjallar output had no repo map family lens row"))?; + require_eq_value(family_lens_row, &["latestItem"], item)?; + require_eq_value( + family_lens_row, + &["latestMindStateCommitReceiptId"], + &map_entry.mind_state_commit_receipt_id, + )?; + require_bool_value(family_lens_row, &["privateStateExposed"], false)?; + let family_lens_tui_rows = value_at_path(&gjallar, &["repoWorkMapFamilyLensTuiRows"]) + .and_then(Value::as_array) + .ok_or_else(|| anyhow!("Gjallar output had no repoWorkMapFamilyLensTuiRows array"))?; + if !family_lens_tui_rows.iter().any(|row| { + row.as_str().is_some_and(|row| { + row.contains("REPO-WORK-MAP-LENS") && row.contains("repo.markdown_planning_note") + }) + }) { + return Err(anyhow!( + "Gjallar TUI rows did not expose repo map family lens sight" + )); + } let summary = json!({ "schemaVersion": "epiphany.repo_close_mind_adoption_guard_smoke.v0", @@ -523,6 +553,7 @@ fn run_smoke(args: Args) -> Result { "repoMapDurableStateAdmitted": map_entry.durable_state_admitted, "repoMapLocalVerseProjected": true, "gjallarLatestRepoWorkMapEntry": gjallar["latestRepoWorkMapEntry"], + "gjallarRepoWorkMapFamilyLensCount": gjallar["repoWorkMapFamilyLensCount"], "publicationAuthorized": false, "privateStateExposed": false }); @@ -660,6 +691,22 @@ fn require_bool(value: &Value, path: &[&str], expected: bool) -> Result<()> { } } +fn require_u64(value: &Value, path: &[&str], expected: u64) -> Result<()> { + let actual = value_at_path(value, path) + .and_then(Value::as_u64) + .ok_or_else(|| anyhow!("missing unsigned integer at {}", path.join(".")))?; + if actual == expected { + Ok(()) + } else { + Err(anyhow!( + "expected {} to be {}, got {}", + path.join("."), + expected, + actual + )) + } +} + fn require_eq_value(value: &Value, path: &[&str], expected: &str) -> Result<()> { let actual = value_at_path(value, path) .and_then(Value::as_str) diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index 0ca3360e..8464e007 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -4069,6 +4069,8 @@ struct SwarmOverviewReport { service_execution_failed_check_tui_rows: Vec, repo_work_map_rows: Vec, repo_work_map_tui_rows: Vec, + repo_work_map_family_lens_rows: Vec, + repo_work_map_family_lens_tui_rows: Vec, repo_work_overview_rows: Vec, repo_work_overview_tui_rows: Vec, repo_work_public_proof_rows: Vec, @@ -4126,6 +4128,19 @@ struct RepoWorkMapRow { private_state_exposed: bool, } +#[derive(Clone, Serialize)] +#[serde(rename_all = "camelCase")] +struct RepoWorkMapFamilyLensRow { + safe_action_family: String, + item_count: usize, + changed_path_count: usize, + latest_item: String, + latest_commit_sha: String, + latest_mind_state_commit_receipt_id: String, + publication_gate: String, + private_state_exposed: bool, +} + #[derive(Clone, Serialize)] #[serde(rename_all = "camelCase")] struct RepoWorkPublicProofRow { @@ -4231,6 +4246,9 @@ struct SwarmOverviewOutput { repo_work_map_count: usize, repo_work_map_rows: Vec, repo_work_map_tui_rows: Vec, + repo_work_map_family_lens_count: usize, + repo_work_map_family_lens_rows: Vec, + repo_work_map_family_lens_tui_rows: Vec, repo_work_overview_count: usize, repo_work_overview_rows: Vec, repo_work_overview_tui_rows: Vec, @@ -4306,6 +4324,9 @@ impl SwarmOverviewOutput { repo_work_map_count: report.repo_work_map_rows.len(), repo_work_map_rows: report.repo_work_map_rows, repo_work_map_tui_rows: report.repo_work_map_tui_rows, + repo_work_map_family_lens_count: report.repo_work_map_family_lens_rows.len(), + repo_work_map_family_lens_rows: report.repo_work_map_family_lens_rows, + repo_work_map_family_lens_tui_rows: report.repo_work_map_family_lens_tui_rows, repo_work_overview_count: report.repo_work_overview_rows.len(), repo_work_overview_rows: report.repo_work_overview_rows, repo_work_overview_tui_rows: report.repo_work_overview_tui_rows, @@ -4373,6 +4394,9 @@ struct SwarmTriageOutput { repo_work_map_count: usize, repo_work_map_rows: Vec, repo_work_map_tui_rows: Vec, + repo_work_map_family_lens_count: usize, + repo_work_map_family_lens_rows: Vec, + repo_work_map_family_lens_tui_rows: Vec, repo_work_overview_count: usize, repo_work_overview_rows: Vec, repo_work_overview_tui_rows: Vec, @@ -4443,6 +4467,9 @@ impl SwarmTriageOutput { repo_work_map_count: report.repo_work_map_rows.len(), repo_work_map_rows: report.repo_work_map_rows, repo_work_map_tui_rows: report.repo_work_map_tui_rows, + repo_work_map_family_lens_count: report.repo_work_map_family_lens_rows.len(), + repo_work_map_family_lens_rows: report.repo_work_map_family_lens_rows, + repo_work_map_family_lens_tui_rows: report.repo_work_map_family_lens_tui_rows, repo_work_overview_count: report.repo_work_overview_rows.len(), repo_work_overview_rows: report.repo_work_overview_rows, repo_work_overview_tui_rows: report.repo_work_overview_tui_rows, @@ -5044,6 +5071,56 @@ fn repo_work_map_tui_row(row: &RepoWorkMapRow) -> String { ) } +fn repo_work_map_family_lens_rows( + repo_work_map_entries: &[EpiphanyCultMeshRepoWorkMapEntry], +) -> (Vec, Vec) { + let mut by_family = BTreeMap::::new(); + for entry in repo_work_map_entries { + let family = entry.safe_action_family.clone(); + let row = by_family + .entry(family.clone()) + .or_insert_with(|| RepoWorkMapFamilyLensRow { + safe_action_family: family, + item_count: 0, + changed_path_count: 0, + latest_item: String::new(), + latest_commit_sha: String::new(), + latest_mind_state_commit_receipt_id: String::new(), + publication_gate: entry.publication_gate.clone(), + private_state_exposed: false, + }); + row.item_count += 1; + row.changed_path_count += entry.changed_paths.len(); + row.private_state_exposed |= entry.private_state_exposed; + if row.latest_item.is_empty() { + row.latest_item = entry.item.clone(); + row.latest_commit_sha = entry.commit_sha.clone(); + row.latest_mind_state_commit_receipt_id = entry.mind_state_commit_receipt_id.clone(); + row.publication_gate = entry.publication_gate.clone(); + } + } + let rows = by_family.into_values().collect::>(); + let tui_rows = rows + .iter() + .map(repo_work_map_family_lens_tui_row) + .collect::>(); + (rows, tui_rows) +} + +fn repo_work_map_family_lens_tui_row(row: &RepoWorkMapFamilyLensRow) -> String { + format!( + "REPO-WORK-MAP-LENS | family={} | items={} | paths={} | latestItem={} | latestCommit={} | latestMind={} | gate={} | private={}", + row.safe_action_family, + row.item_count, + row.changed_path_count, + row.latest_item, + short_commit(&row.latest_commit_sha), + row.latest_mind_state_commit_receipt_id, + row.publication_gate, + row.private_state_exposed + ) +} + fn repo_work_peer_tui_rows(rows: &[RepoWorkOverviewRow]) -> Vec { rows.iter() .map(|row| { @@ -5871,6 +5948,8 @@ fn load_swarm_overview_report(args: &Args) -> Result { let (repo_work_overview_rows, repo_work_overview_tui_rows) = repo_work_overview_rows(&repo_work_overviews); let (repo_work_map_rows, repo_work_map_tui_rows) = repo_work_map_rows(&repo_work_map_entries); + let (repo_work_map_family_lens_rows, repo_work_map_family_lens_tui_rows) = + repo_work_map_family_lens_rows(&repo_work_map_entries); let (repo_work_public_proof_rows, repo_work_public_proof_tui_rows) = repo_work_public_proof_rows(&repo_work_public_proofs); let (swarm_action_rows, swarm_action_tui_rows) = swarm_action_rows( @@ -5895,6 +5974,9 @@ fn load_swarm_overview_report(args: &Args) -> Result { || repo_work_map_entries .iter() .any(|entry| entry.private_state_exposed) + || repo_work_map_family_lens_rows + .iter() + .any(|row| row.private_state_exposed) || repo_work_public_proofs .iter() .any(|proof| proof.private_state_exposed) @@ -5944,6 +6026,8 @@ fn load_swarm_overview_report(args: &Args) -> Result { service_execution_failed_check_tui_rows, repo_work_map_rows, repo_work_map_tui_rows, + repo_work_map_family_lens_rows, + repo_work_map_family_lens_tui_rows, repo_work_overview_rows, repo_work_overview_tui_rows, repo_work_public_proof_rows, diff --git a/notes/epiphany-repo-swarm-mvp-contract.md b/notes/epiphany-repo-swarm-mvp-contract.md index 4babef6a..ef410257 100644 --- a/notes/epiphany-repo-swarm-mvp-contract.md +++ b/notes/epiphany-repo-swarm-mvp-contract.md @@ -1175,6 +1175,15 @@ source map store ref, and `privateStateExposed=false`. The cargo-run smoke itself completed and wrote `summary.json` after the outer tool timeout, so the independent Gjallar readback is the clean terminal proof. +The next smoke tightened that map sight into the first semantic lens: +`.epiphany-smoke\repo-close-mind-adoption-guard-20260620-205055` proves Gjallar +now derives `repoWorkMapFamilyLensRows` and `REPO-WORK-MAP-LENS` TUI rows from +Mind-admitted map entries, grouping by safe action family with item count, +changed-path count, latest item, latest commit, latest Mind commit receipt, +Bifrost gate, and `privateStateExposed=false`. This lens is still read-only +Gjallar sight; it does not own scheduling, publication, merge, deployment, or +Mind admission. + `epiphany-work overview` is the first compact repo work sight/proof surface: ```powershell @@ -1524,7 +1533,7 @@ temptation wearing clean robes. | Self scheduling | `tick` and `serve` prove one-step branch-local advancement, brake refusal, active-turn refusal, cooldown, and stale-turn recovery; `tick` now routes executed branch-local work through the existing Soul/Modeling/Mind `close` gate; `queue-run` selects tick-actionable rows from the typed repo-work queue and delegates to `tick`; `epiphany-swarm run` is the bounded operator mouth over that queue/tick physiology; `repo-work-service-plan` and `repo-work-service-runbook` write Idunn lifecycle receipts/artifacts for the same queue-run command without launching it. | Keep any future queue-run service launch/install behind Idunn and explicit operator authority. | | Branch-local Hands work | `adopt` and `execute` create approved Hands gates, run planned commands, stage declared paths, commit on `epiphany/*`, and write receipts. | Keep mutation branch-contained and receipt-backed; broaden only through typed plan families, not ad hoc shell freedom. | | Soul/Modeling/Mind closure | `close` verifies the Hands commit, writes `epiphany.repo_work_closure_review.v0`, refuses path-scope mismatches, refuses missing/tampered/non-affirmative Mind adoption proof, runs known safe-family content assertions, optionally gates on model-authored closure verdicts, writes Soul/Modeling/Mind receipts, admits a compact typed repo map entry into `.epiphany/state/repo-work-map.msgpack`, and mirrors that admitted fact into local Verse as `epiphany.cultmesh.repo_work_map_entry.v0`. | Keep extending closure toward source-grounded semantic review and richer semantic map lenses, while preserving deterministic local closure for simple mechanical work. | -| Repo work sight | `overview` emits compact proof rows and mirrors typed `epiphany.cultmesh.repo_work_overview.v0` event documents plus a latest key; `close` mirrors Mind-admitted map facts as `epiphany.cultmesh.repo_work_map_entry.v0`; Gjallar enumerates overview history, map rows, and public-proof rows without private-state exposure; Persona's Eve surface and Eve connection readbacks expose peer-readable gate/blocker/next-action rows; `queue-run` consumes the same overview queue for branch-local scheduler pulses. | Deepen the Persona-to-plan loop and semantic map readback without moving action authority out of Hands/Self/Bifrost. | +| Repo work sight | `overview` emits compact proof rows and mirrors typed `epiphany.cultmesh.repo_work_overview.v0` event documents plus a latest key; `close` mirrors Mind-admitted map facts as `epiphany.cultmesh.repo_work_map_entry.v0`; Gjallar enumerates overview history, map rows, family lens rows, and public-proof rows without private-state exposure; Persona's Eve surface and Eve connection readbacks expose peer-readable gate/blocker/next-action rows; `queue-run` consumes the same overview queue for branch-local scheduler pulses. | Deepen the Persona-to-plan loop and semantic map readback without moving action authority out of Hands/Self/Bifrost. | | Publication | `publish` routes Bifrost/GitHub receipts from closure or explicit Soul/Mind refs. | Keep publication Bifrost-owned; do not let scheduler publish. | | Upstream main sync | `sync` proves the published commit is contained by upstream main after explicit merge/sync authority. | Treat upstream-main sync as a required final proof for published work. | | Daemon survival | Idunn service lifecycle receipts and runbooks exist outside repo-work tick authority. | Preserve Idunn as lifecycle owner; repo swarm may request or inspect service state, not impersonate daemon keeping. | @@ -2029,7 +2038,7 @@ Required organs before MVP: `gamecult.bifrost.public_proof_publication_receipt.v0` with public Verse target, public room, ledger, review, credit, proof ref, and SHA-256 readback. Remaining work is deeper semantic review and richer map updates/lenses beyond - latest work-item consequence; it is not basic safe-family planning cargo, + latest work-item consequence and family-level aggregation; it is not basic safe-family planning cargo, local public-proof export, local CultMesh readback, Bifrost/GitHub/sync row visibility, public-proof publication closure, Mind-adoption closure proof, first durable repo-map admission, first durable repo-map local Verse diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 4cf1fd85..2015edc4 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -123,6 +123,7 @@ remembers doctrine; the branch remembers the blade. - 2026-06-20: `notes/epiphany-repo-swarm-mvp-contract.md` now has the explicit functional-swarm answer. The current seventeen front doors are real proof surfaces, not decorative wrapper smoke, but Epiphany is not fully online until the typed artery can run as a living repo organism: deeper model-authored closure review, further non-planning action classes, Idunn-owned queue-run service lifecycle under explicit operator authority. Use that section when answering whether Epiphany is headed toward a functional swarm. - 2026-06-20: Gjallar/swarm-overview now exposes repo-work overview history as first-class compact sight, Persona's public Eve surface lowers the same queue for peer-readable collaboration, and Self has a first runnable queue surface over it. `SwarmOverviewOutput` and `SwarmTriageOutput` include `repoWorkOverviewCount`, `repoWorkOverviewRows`, `repoWorkOverviewTuiRows`, `latestRepoWorkOverview`, `latestRepoWorkGate`, `latestRepoWorkBlocker`, and `latestRepoWorkNextSafeMove`; the shared `swarmActionRows` queue gets priority 35 `repo-work-overview` rows owned by Gjallar, hosted body `repo-work`, authority gate `repo.work.overview`, effect class `repo-work-readback`, no mutation, no elevation, proof-bundle ref, and private-state seal. `eve-surfaces`, direct `connect-eve`, and the globally invokable Persona `eve-connect` daemon tool readback expose public `REPO-WORK-PEER` rows with item, gate, blocker, next safe move, branch, publication, sync, and `private=false`. `epiphany-work queue-run` reads the same typed queue, selects current-repo rows at `ready-to-run`, `ready-to-adopt`, `ready-to-execute`, or `awaiting-closure`, delegates to `tick`, refreshes overview after real advancement, and wrapper `repo-work-queue-run` exposes the operator surface. Disposable proofs `.epiphany-smoke\gjallar-repo-work-queue-20260620-012027`, `.epiphany-smoke\eve-repo-work-queue-20260620-013322`, `.epiphany-smoke\queue-run-20260620-014314`, and wrapper artifact `local-20260620-014627-174-aada0241` prove two-item queue sight, Eve lowering, direct queue-run advancement, and wrapper dry-run without publication, merge, service lifecycle mutation, elevation, cross-repo mutation, or private-state exposure. The next cut is deeper model-authored closure review, further non-planning action classes, or Idunn-owned queue-run service execution; not another queue display surface. - 2026-06-20: Durable repo-work map admission now has local Verse/Gjallar sight. `epiphany-work close` still admits the accepted latest-per-item map into `.epiphany/state/repo-work-map.msgpack` only after Soul and Mind pass, then mirrors the accepted fact as `epiphany.cultmesh.repo_work_map_entry.v0` under `gamecult-local/repo-work-map/latest`. `epiphany-verse-query gjallar` now returns `repoWorkMapCount`, `repoWorkMapRows`, `repoWorkMapTuiRows`, and `latestRepoWorkMapEntry`, sealed to safe family, changed-path count, Soul/Mind ids, Bifrost gate, source map store ref, and `privateStateExposed=false`. Proof `.epiphany-smoke\repo-close-mind-adoption-guard-20260620-203717` shows counterfeit Mind adoption refused without map write, successful close projected the map row, and independent Gjallar readback returned one `REPO-WORK-MAP` row. The outer cargo-run smoke timed out just before child return, but `summary.json` is `status=ok` and the direct Gjallar readback is the terminal proof. The next repo-map work is richer semantic review/map lenses, not first projection. +- 2026-06-20: The first repo-work map semantic lens is live in Gjallar. `epiphany-verse-query gjallar` now derives `repoWorkMapFamilyLensCount`, `repoWorkMapFamilyLensRows`, and `repoWorkMapFamilyLensTuiRows` from Mind-admitted `epiphany.cultmesh.repo_work_map_entry.v0` rows, grouping by safe action family with item/path counts, latest item/commit/Mind commit, Bifrost gate, and private-state seal. Smoke `.epiphany-smoke\repo-close-mind-adoption-guard-20260620-205055` reran the counterfeit-adoption guard and proved `gjallarRepoWorkMapFamilyLensCount=1` plus `privateStateExposed=false`. The next map work is deeper source-grounded semantic lenses beyond safe-family aggregation, not basic Gjallar map visibility. - 2026-06-20: Deeper model-authored closure review is now live. `epiphany-work close` accepts `--closure-model-verdict passed|failed|needs-work|blocked`, `--closure-model-finding`, and `--require-closure-model-verdict`; the close review embeds `epiphany.repo_work_model_closure_review.v0` under `modelingReview.closureReview`, records reviewed inputs and gate enforcement, and Soul refuses closure when a supplied or required model verdict does not pass. Focused smoke `.epiphany-smoke\closure-model-gate-20260620-135103` created a disposable repo, ran two `repo.status_section` items through public front doors, closed one with required model verdict `passed`, and blocked one with `needs-work` while `familyAssertions.status=passed`, `pathScopeMatched=true`, and `privateStateExposed=false`. Current remaining repo-swarm MVP organs are deeper interpreter/adoption semantics, more useful repo-owned configuration/action families, and Idunn-owned queue-run service lifecycle under explicit operator authority. - 2026-06-20: Mind adoption/interpreter depth now has a concrete interpretation packet. `epiphany-work adopt` writes `epiphany.repo_work_mind_adoption_decision.v0` before the main adoption receipt, embeds `epiphany.repo_work_mind_interpretation.v0` with input summary, safe-family recognition, requested-path classification, allowed branch-local Hands transition, and forbidden durable-state/publication/service/private transitions, then records Self presentation, Mind evidence review, safe-family requirement, branch-local scope, Bifrost publication gate, Soul closure requirement, and no Hands/durable-state/publication/merge/service/cross-body/private authority inside the Mind decision; the main adoption receipt cites that decision before granting branch-local Hands authority. Focused smoke `.epiphany-smoke\repo-planning-facets-20260620-175503` proves model-authored planning facets survive into Imagination, plan derivation, Mind interpretation, Mind decision, and adoption, while close still passes Soul/family/path checks with `privateStateExposed=false`. Current remaining repo-swarm MVP organs are deeper interpreter semantics beyond the first Mind interpretation packet, more useful repo-owned configuration/action families, and Idunn-owned queue-run service lifecycle under explicit operator authority. - 2026-06-20: `repo-manifest` is now the next non-planning safe family. `epiphany-work derive-plan --action-family repo-manifest` lowers accepted pressure into a structured `epiphany.toml` Body manifest with safe family `repo.body_manifest`, body domain, private/local/public Verse ids, Eve surface id, receipt-required capability hints, arbitrary shell sealed false, and private-state seals. Soul closure assertions now inspect the committed manifest for schema, safe family, summary, body domain, Verse ids, Eve surface, receipt requirement, no arbitrary shell, and private-state seals. Focused smoke `.epiphany-smoke\repo-manifest-family-20260620-141552` ran a disposable repo through init -> online -> accept -> repo-manifest derive-plan -> tick run/adopt/execute/close; Hands committed only `epiphany.toml`, Soul passed with `pathScopeMatched=true`, `familyAssertions.status=passed`, and `privateStateExposed=false`. Current remaining repo-swarm MVP organs are deeper interpreter/adoption semantics, additional useful repo-owned config/action families, and Idunn-owned queue-run service lifecycle under explicit operator authority. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 155b15fcb4ea280efccc8b67a7c2efb53e13a009..2b570f118cd2018adb14d54657ad20550a8838c2 100644 GIT binary patch delta 247 zcmcbANc7(k(G3!e+@{7>CMHqG7+4ddH!Cw1GBO4C7G;*D7Aq8`7Ub)e z=NDxw`A(u(qP6?`-EQgjnjax+UxQd1Oi@{<#D6v9%A zic`UQQu9iRGE=8-xXdCseM2NG>-7I|tg0ra2BxM81&PJQKpo|oB^e6o5X*yr_Jsqj a^Gz&p16$?;w97faG_S