From 438767690628394132759bdeb410c84d8661eb5d Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 21 Jun 2026 00:45:14 +0100 Subject: [PATCH] Add repo work map semantic readback --- ...ny-repo-close-mind-adoption-guard-smoke.rs | 37 ++++++ epiphany-core/src/bin/epiphany-verse-query.rs | 108 ++++++++++++++++++ notes/epiphany-repo-swarm-mvp-contract.md | 12 ++ notes/fresh-workspace-handoff.md | 1 + state/ledgers.msgpack | Bin 358667 -> 359075 bytes state/map.yaml | 2 +- 6 files changed, 159 insertions(+), 1 deletion(-) 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 dfc13c4f..a84d89ad 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 @@ -27,6 +27,7 @@ struct RepoWorkMapEntry { changed_paths: Vec, commit_sha: String, safe_action_family: String, + modeling_summary: String, soul_verdict_receipt_id: String, mind_gateway_review_id: String, mind_state_commit_receipt_id: String, @@ -503,6 +504,41 @@ fn run_smoke(args: Args) -> Result { "Gjallar TUI rows did not expose compact repo map sight" )); } + require_u64(&gjallar, &["repoWorkMapSemanticCount"], 1)?; + let semantic_rows = value_at_path(&gjallar, &["repoWorkMapSemanticRows"]) + .and_then(Value::as_array) + .ok_or_else(|| anyhow!("Gjallar output had no repoWorkMapSemanticRows array"))?; + let semantic_row = semantic_rows + .iter() + .find(|row| row.get("item").and_then(Value::as_str) == Some(item)) + .ok_or_else(|| anyhow!("Gjallar output had no repo map semantic row for {item}"))?; + require_eq_value(semantic_row, &["stage"], "imagination-planning")?; + require_eq_value(semantic_row, &["stageOwner"], "Imagination")?; + require_eq_value(semantic_row, &["publicationGate"], "Bifrost")?; + require_eq_value(semantic_row, &["gateOwner"], "Bifrost")?; + require_eq_value( + semantic_row, + &["modelingSummary"], + &map_entry.modeling_summary, + )?; + require_bool_value(semantic_row, &["sightOnly"], true)?; + require_bool_value(semantic_row, &["privateStateExposed"], false)?; + let semantic_tui_rows = value_at_path(&gjallar, &["repoWorkMapSemanticTuiRows"]) + .and_then(Value::as_array) + .ok_or_else(|| anyhow!("Gjallar output had no repoWorkMapSemanticTuiRows array"))?; + if !semantic_tui_rows.iter().any(|row| { + row.as_str().is_some_and(|row| { + row.contains("REPO-WORK-MAP-SEMANTIC") + && row.contains("stage=imagination-planning") + && row.contains("stageOwner=Imagination") + && row.contains("gateOwner=Bifrost") + && row.contains("sightOnly=true") + }) + }) { + return Err(anyhow!( + "Gjallar TUI rows did not expose repo map semantic sight" + )); + } require_u64(&gjallar, &["repoWorkMapFamilyLensCount"], 1)?; let family_lens_rows = value_at_path(&gjallar, &["repoWorkMapFamilyLensRows"]) .and_then(Value::as_array) @@ -674,6 +710,7 @@ fn run_smoke(args: Args) -> Result { "repoMapDurableStateAdmitted": map_entry.durable_state_admitted, "repoMapLocalVerseProjected": true, "gjallarLatestRepoWorkMapEntry": gjallar["latestRepoWorkMapEntry"], + "gjallarRepoWorkMapSemanticCount": gjallar["repoWorkMapSemanticCount"], "gjallarRepoWorkMapFamilyLensCount": gjallar["repoWorkMapFamilyLensCount"], "gjallarRepoWorkMapPathLensCount": gjallar["repoWorkMapPathLensCount"], "gjallarRepoWorkMapBranchLensCount": gjallar["repoWorkMapBranchLensCount"], diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index 05abafc6..391ba574 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -4075,6 +4075,8 @@ struct SwarmOverviewReport { service_execution_failed_check_tui_rows: Vec, repo_work_map_rows: Vec, repo_work_map_tui_rows: Vec, + repo_work_map_semantic_rows: Vec, + repo_work_map_semantic_tui_rows: Vec, repo_work_map_family_lens_rows: Vec, repo_work_map_family_lens_tui_rows: Vec, repo_work_map_path_lens_rows: Vec, @@ -4146,6 +4148,24 @@ struct RepoWorkMapRow { private_state_exposed: bool, } +#[derive(Clone, Serialize)] +#[serde(rename_all = "camelCase")] +struct RepoWorkMapSemanticRow { + item: String, + branch: String, + stage: String, + stage_owner: String, + publication_gate: String, + gate_owner: String, + safe_action_family: String, + changed_path_count: usize, + latest_commit_sha: String, + latest_mind_state_commit_receipt_id: String, + modeling_summary: String, + sight_only: bool, + private_state_exposed: bool, +} + #[derive(Clone, Serialize)] #[serde(rename_all = "camelCase")] struct RepoWorkMapFamilyLensRow { @@ -4340,6 +4360,9 @@ struct SwarmOverviewOutput { repo_work_map_count: usize, repo_work_map_rows: Vec, repo_work_map_tui_rows: Vec, + repo_work_map_semantic_count: usize, + repo_work_map_semantic_rows: Vec, + repo_work_map_semantic_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, @@ -4435,6 +4458,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_semantic_count: report.repo_work_map_semantic_rows.len(), + repo_work_map_semantic_rows: report.repo_work_map_semantic_rows, + repo_work_map_semantic_tui_rows: report.repo_work_map_semantic_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, @@ -4522,6 +4548,9 @@ struct SwarmTriageOutput { repo_work_map_count: usize, repo_work_map_rows: Vec, repo_work_map_tui_rows: Vec, + repo_work_map_semantic_count: usize, + repo_work_map_semantic_rows: Vec, + repo_work_map_semantic_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, @@ -4612,6 +4641,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_semantic_count: report.repo_work_map_semantic_rows.len(), + repo_work_map_semantic_rows: report.repo_work_map_semantic_rows, + repo_work_map_semantic_tui_rows: report.repo_work_map_semantic_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, @@ -5234,6 +5266,59 @@ fn repo_work_map_tui_row(row: &RepoWorkMapRow) -> String { ) } +fn repo_work_map_semantic_rows( + repo_work_map_entries: &[EpiphanyCultMeshRepoWorkMapEntry], +) -> (Vec, Vec) { + let rows = repo_work_map_entries + .iter() + .map(repo_work_map_semantic_row) + .collect::>(); + let tui_rows = rows + .iter() + .map(repo_work_map_semantic_tui_row) + .collect::>(); + (rows, tui_rows) +} + +fn repo_work_map_semantic_row( + entry: &EpiphanyCultMeshRepoWorkMapEntry, +) -> RepoWorkMapSemanticRow { + let (stage, stage_owner) = repo_work_stage_for_family(&entry.safe_action_family); + RepoWorkMapSemanticRow { + item: entry.item.clone(), + branch: entry.branch.clone(), + stage, + stage_owner, + publication_gate: entry.publication_gate.clone(), + gate_owner: repo_work_gate_owner(&entry.publication_gate), + safe_action_family: entry.safe_action_family.clone(), + changed_path_count: entry.changed_paths.len(), + latest_commit_sha: entry.commit_sha.clone(), + latest_mind_state_commit_receipt_id: entry.mind_state_commit_receipt_id.clone(), + modeling_summary: entry.modeling_summary.clone(), + sight_only: true, + private_state_exposed: entry.private_state_exposed, + } +} + +fn repo_work_map_semantic_tui_row(row: &RepoWorkMapSemanticRow) -> String { + format!( + "REPO-WORK-MAP-SEMANTIC | item={} | stage={} | stageOwner={} | gate={} | gateOwner={} | family={} | paths={} | latestCommit={} | latestMind={} | summary={} | sightOnly={} | private={}", + row.item, + row.stage, + row.stage_owner, + row.publication_gate, + row.gate_owner, + row.safe_action_family, + row.changed_path_count, + short_commit(&row.latest_commit_sha), + row.latest_mind_state_commit_receipt_id, + compact_tui_text(&row.modeling_summary, 160), + row.sight_only, + row.private_state_exposed + ) +} + fn repo_work_map_family_lens_rows( repo_work_map_entries: &[EpiphanyCultMeshRepoWorkMapEntry], ) -> (Vec, Vec) { @@ -6499,6 +6584,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_semantic_rows, repo_work_map_semantic_tui_rows) = + repo_work_map_semantic_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_map_path_lens_rows, repo_work_map_path_lens_tui_rows) = @@ -6538,6 +6625,9 @@ fn load_swarm_overview_report(args: &Args) -> Result { || repo_work_map_entries .iter() .any(|entry| entry.private_state_exposed) + || repo_work_map_semantic_rows + .iter() + .any(|row| row.private_state_exposed) || repo_work_map_family_lens_rows .iter() .any(|row| row.private_state_exposed) @@ -6611,6 +6701,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_semantic_rows, + repo_work_map_semantic_tui_rows, repo_work_map_family_lens_rows, repo_work_map_family_lens_tui_rows, repo_work_map_path_lens_rows, @@ -7938,6 +8030,22 @@ fn compact_tui_list(values: &[String]) -> String { } } +fn compact_tui_text(value: &str, max_chars: usize) -> String { + let collapsed = value + .split_whitespace() + .collect::>() + .join(" ") + .replace('|', "/"); + if collapsed.chars().count() <= max_chars { + return collapsed; + } + collapsed + .chars() + .take(max_chars.saturating_sub(3)) + .collect::() + + "..." +} + fn write_daemon_poke_receipts( args: &Args, context: &EpiphanyLocalVerseContext, diff --git a/notes/epiphany-repo-swarm-mvp-contract.md b/notes/epiphany-repo-swarm-mvp-contract.md index deff7017..ef4714f1 100644 --- a/notes/epiphany-repo-swarm-mvp-contract.md +++ b/notes/epiphany-repo-swarm-mvp-contract.md @@ -1349,6 +1349,18 @@ the accepted planning-note work reports `gate=Bifrost`, `owner=Bifrost`, is next-gate sight only. Bifrost still owns publication/credit/upstream gates, and Gjallar does not schedule, publish, merge, deploy, or admit state. +The next per-entry semantic row gives agents one compact accepted-work readback: +`.epiphany-smoke\repo-close-mind-adoption-guard-20260620-234131` proves Gjallar +now derives `repoWorkMapSemanticRows` and `REPO-WORK-MAP-SEMANTIC` TUI rows from +Mind-admitted map entries. The proof row mirrors the durable modeling summary, +safe family, stage `imagination-planning`, `stageOwner=Imagination`, +`gate=Bifrost`, `gateOwner=Bifrost`, latest commit/Mind commit receipt, +`sightOnly=true`, and `privateStateExposed=false`; the smoke summary reports +`gjallarRepoWorkMapSemanticCount=1` while closure still refuses counterfeit Mind +adoption and keeps `publicationAuthorized=false`. This is compact meaning +readback only, not a scheduler, publisher, merge gate, deployment actor, daemon +keeper, or Mind admission path. + `epiphany-work overview` is the first compact repo work sight/proof surface: ```powershell diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 13ad6e2c..e61a28b2 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -158,6 +158,7 @@ remembers doctrine; the branch remembers the blade. - 2026-06-20: `repo-planning-brief` is now live as the family-friendly Imagination decomposition cargo. `epiphany-work derive-plan --action-family repo-planning-brief` writes `.epiphany/planning-briefs/.toml` with safe family `repo.planning_brief`, status `draft`, candidate next safe families, requested-path / verification-ask / evidence-need requirements, and Mind/Self/Substrate/Hands/Soul/Bifrost/Idunn gate ordering while denying objective adoption, scheduling, substrate access, Hands action, shell, commit, publication, deployment execution, service lifecycle, cross-body mutation, private transcripts, raw-result payloads, and private-state exposure. Soul closure assertions inspect schema, family, summary, decomposition contract, gate order, authority seals, and private-state seals. Focused smoke `.epiphany-smoke\repo-planning-brief-family-20260620-231539` ran init -> online -> accept -> repo-planning-brief derive-plan -> tick run/adopt/execute/close; Hands committed only `.epiphany/planning-briefs/repo-planning-brief-family.toml`, Soul passed with `pathScopeMatched=true`, `familyAssertions.status=passed`, `mindInterpreterRequired=true`, `soulEvidenceNeedsRequired=true`, `idunnDeploymentExecutionRequired=true`, and `privateStateExposed=false`. Current remaining repo-swarm MVP organs are deeper interpreter semantics, richer closure/map readback, and Idunn-owned queue-run service lifecycle under explicit operator authority. - 2026-06-20: Gjallar repo-work map sight now includes semantic stage lenses. `epiphany-verse-query gjallar`, swarm overview, and swarm triage expose `repoWorkMapStageLensRows` plus `REPO-WORK-MAP-STAGE` rows derived from Mind-admitted local Verse map entries, grouping safe families into stages and owning organs such as `imagination-planning` / `Imagination`, `hands-execution-request` / `Hands`, `soul-verification-request` / `Soul`, `bifrost-publication-accounting` / `Bifrost`, and `idunn-deployment` / `Idunn`. Focused smoke `.epiphany-smoke\repo-close-mind-adoption-guard-20260620-232414` proves the stage lens for accepted `repo.markdown_planning_note` work reports `stage=imagination-planning`, `owner=Imagination`, latest item/commit/Mind commit receipt, Bifrost gate, and `privateStateExposed=false`. This is sight only; Gjallar still does not schedule, publish, merge, deploy, keep daemons alive, or admit Mind state. - 2026-06-20: Gjallar repo-work map sight now includes next-publication-gate lenses. `epiphany-verse-query gjallar`, swarm overview, and swarm triage expose `repoWorkMapGateLensRows` plus `REPO-WORK-MAP-GATE` rows derived from the same Mind-admitted local Verse map entries, grouping accepted consequences by publication gate and naming the owning gate organ. Focused smoke `.epiphany-smoke\repo-close-mind-adoption-guard-20260620-233353` proves accepted `repo.markdown_planning_note` work reports `gate=Bifrost`, `owner=Bifrost`, latest item/commit/Mind commit receipt, `sightOnly=true`, `publicationAuthorized=false`, and `privateStateExposed=false`. This is sight only; Bifrost still owns publication/credit/upstream review and Gjallar does not schedule, publish, merge, deploy, keep daemons alive, or admit Mind state. +- 2026-06-20: Gjallar repo-work map sight now includes per-entry semantic readback rows. `epiphany-verse-query gjallar`, swarm overview, and swarm triage expose `repoWorkMapSemanticRows` plus `REPO-WORK-MAP-SEMANTIC` rows derived from Mind-admitted local Verse map entries, combining durable modeling summary, safe family, stage owner, publication gate owner, latest commit, and Mind commit receipt for each accepted item. Focused smoke `.epiphany-smoke\repo-close-mind-adoption-guard-20260620-234131` proves accepted `repo.markdown_planning_note` work reports `stage=imagination-planning`, `stageOwner=Imagination`, `gateOwner=Bifrost`, the durable modeling summary, `sightOnly=true`, `publicationAuthorized=false`, and `privateStateExposed=false` while counterfeit Mind adoption is still refused. This is compact meaning readback only; Gjallar still does not schedule, publish, merge, deploy, keep daemons alive, or admit Mind state. - 2026-06-20: Mind now has explicit repo-work safe-family and requested-path guards before branch-local Hands authority. `adopt --from-plan` treats unsupported plan-derived safe-family labels as refused interpreter decisions, writes `epiphany.repo_work_mind_adoption_decision.v0` with `status=refused-unsupported-safe-family`, keeps `actionItemAccepted=false` and `safeFamilyRecognized=false`, grants no Hands/durable-state/service/publication/cross-body/private-state authority, and writes no normal adoption receipt. It also compares the sorted action-item `requestedPaths` against the sorted plan action `changedPaths`; mismatches write `status=refused-requested-path-mismatch`, keep `safeFamilyRecognized=true` but `requestedPathsMatchPlan=false`, point the next gate at `imagination.replan_with_matching_requested_paths`, and grant no Hands/durable-state/service/publication/cross-body/private-state authority. Focused smokes `.epiphany-smoke\repo-mind-safe-family-guard-20260620-194425` and `.epiphany-smoke\repo-mind-path-guard-20260620-194239` prove both refusal paths; earlier positive smokes `.epiphany-smoke\repo-planning-facets-20260620-190916` and `.epiphany-smoke\closure-model-gate-20260620-190916` prove recognized planning facets and closure model gates still pass. Current remaining repo-swarm MVP organs are deeper interpreter semantics beyond adoption refusal, more useful repo-owned configuration/action families, richer closure depth, and Idunn-owned queue-run service lifecycle under explicit operator authority. - 2026-06-20: Mind now also refuses plan-derived repo work that is not evidence-ready. `derive-plan` embeds verification asks in the Imagination action-item receipt, `adopt --from-plan` records verification asks and planning evidence needs in `epiphany.repo_work_mind_interpretation.v0`, and empty verification asks or evidence needs write `status=refused-missing-evidence-needs` with next gate `imagination.replan_with_explicit_soul_evidence_needs`. The refusal grants no Hands, durable-state, service, publication, cross-body, or private-state authority and writes no adoption receipt. Focused proof `.epiphany-smoke\repo-mind-evidence-guard-20260620-224426` tampers both arrays empty and proves the refusal; regression `.epiphany-smoke\repo-planning-facets-20260620-224428` proves normal planning facets still close through Soul/Modeling/Mind. - 2026-06-20: `repo-eve-surface` is now live as repo-owned Eve/CultUI surface contract cargo. `epiphany-work derive-plan --action-family repo-eve-surface` writes `.epiphany/eve-surfaces/.toml` with safe family `repo.eve_surface`, compact agent TUI and GUI lowering contracts, local/public Verse routing, Odin discovery, provider-owned surface identity, Persona/human collaboration flags, feedback routing to Imagination, and denials for renderer ownership, rendering/state/publication/service/cross-body authority, private Verse rummaging, and private-state exposure. Soul closure assertions inspect schema, family, summary, surface routing, Verse routing, CultUI contracts, collaboration route, authority seals, and private-state seal. Focused smoke `.epiphany-smoke\repo-eve-surface-family-20260620-165927` ran init -> online -> accept -> repo-eve-surface derive-plan -> tick run/adopt/execute/close; Hands committed only `.epiphany/eve-surfaces/repo-eve-surface-family.toml`, Soul passed with `pathScopeMatched=true`, `familyAssertions.status=passed`, `hasCultUiContracts=true`, `hasVerseRouting=true`, `odinDiscoverable=true`, `feedbackRoutesToImagination=true`, `rendererOwnsTruth=false`, `renderingAuthority=false`, `stateAuthority=false`, `publicationAuthority=false`, `serviceLifecycleAuthority=false`, `crossBodyMutationAuthority=false`, `privateVerseRummaging=false`, 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. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 0f1312af1424545f35f43309893cbeb0b3e30f0b..b388c43b81981a13edbda807719c8e987b267187 100644 GIT binary patch delta 286 zcmeDFB)a&k=mrT!ZW9wLL(8aR46Kz6o0S<085!f7r!uuqWnu(k5X}t4EZe6tv6huh zUvPy?M@pMM$%FQe)$}cKbNGUB!Ov*`B z$jwhl&B@G5S12yc%}p$-)KMrdNlZ`mFV9OYvh~bOOwY_qEXmBz(@{uIEP)C;Wu_J7 z7ncB)W~OJ9Og~z|>N-7lJ~O*ka(-!ENorAAYG#RoZ)RSKLSjmO0Z2E{{@ldOyka1o KR$82zq6Yxk4P)Q{ delta 53 zcmZ4dRkZt)=mrVK>F3K?S=pkFF|d}u*sRQ0$jBJiJe8?^Dib3RgJ@