Add repo work map gate lens

This commit is contained in:
Meta Vens 2026-06-21 00:37:42 +01:00
commit a8f6c30297
6 changed files with 164 additions and 1 deletions

View file

@ -622,6 +622,38 @@ fn run_smoke(args: Args) -> Result<Value> {
"Gjallar TUI rows did not expose repo map stage lens sight"
));
}
require_u64(&gjallar, &["repoWorkMapGateLensCount"], 1)?;
let gate_lens_rows = value_at_path(&gjallar, &["repoWorkMapGateLensRows"])
.and_then(Value::as_array)
.ok_or_else(|| anyhow!("Gjallar output had no repoWorkMapGateLensRows array"))?;
let gate_lens_row = gate_lens_rows
.iter()
.find(|row| row.get("publicationGate").and_then(Value::as_str) == Some("Bifrost"))
.ok_or_else(|| anyhow!("Gjallar output had no repo map gate lens row"))?;
require_eq_value(gate_lens_row, &["owner"], "Bifrost")?;
require_eq_value(gate_lens_row, &["latestItem"], item)?;
require_eq_value(
gate_lens_row,
&["latestMindStateCommitReceiptId"],
&map_entry.mind_state_commit_receipt_id,
)?;
require_bool_value(gate_lens_row, &["sightOnly"], true)?;
require_bool_value(gate_lens_row, &["privateStateExposed"], false)?;
let gate_lens_tui_rows = value_at_path(&gjallar, &["repoWorkMapGateLensTuiRows"])
.and_then(Value::as_array)
.ok_or_else(|| anyhow!("Gjallar output had no repoWorkMapGateLensTuiRows array"))?;
if !gate_lens_tui_rows.iter().any(|row| {
row.as_str().is_some_and(|row| {
row.contains("REPO-WORK-MAP-GATE")
&& row.contains("gate=Bifrost")
&& row.contains("owner=Bifrost")
&& row.contains("sightOnly=true")
})
}) {
return Err(anyhow!(
"Gjallar TUI rows did not expose repo map gate lens sight"
));
}
let summary = json!({
"schemaVersion": "epiphany.repo_close_mind_adoption_guard_smoke.v0",
@ -646,6 +678,7 @@ fn run_smoke(args: Args) -> Result<Value> {
"gjallarRepoWorkMapPathLensCount": gjallar["repoWorkMapPathLensCount"],
"gjallarRepoWorkMapBranchLensCount": gjallar["repoWorkMapBranchLensCount"],
"gjallarRepoWorkMapStageLensCount": gjallar["repoWorkMapStageLensCount"],
"gjallarRepoWorkMapGateLensCount": gjallar["repoWorkMapGateLensCount"],
"publicationAuthorized": false,
"privateStateExposed": false
});

View file

@ -4083,6 +4083,8 @@ struct SwarmOverviewReport {
repo_work_map_branch_lens_tui_rows: Vec<String>,
repo_work_map_stage_lens_rows: Vec<RepoWorkMapStageLensRow>,
repo_work_map_stage_lens_tui_rows: Vec<String>,
repo_work_map_gate_lens_rows: Vec<RepoWorkMapGateLensRow>,
repo_work_map_gate_lens_tui_rows: Vec<String>,
repo_work_overview_rows: Vec<RepoWorkOverviewRow>,
repo_work_overview_tui_rows: Vec<String>,
repo_work_public_proof_rows: Vec<RepoWorkPublicProofRow>,
@ -4199,6 +4201,22 @@ struct RepoWorkMapStageLensRow {
private_state_exposed: bool,
}
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase")]
struct RepoWorkMapGateLensRow {
publication_gate: String,
owner: String,
item_count: usize,
changed_path_count: usize,
stages: Vec<String>,
safe_action_families: Vec<String>,
latest_item: String,
latest_commit_sha: String,
latest_mind_state_commit_receipt_id: String,
sight_only: bool,
private_state_exposed: bool,
}
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase")]
struct RepoWorkPublicProofRow {
@ -4334,6 +4352,9 @@ struct SwarmOverviewOutput {
repo_work_map_stage_lens_count: usize,
repo_work_map_stage_lens_rows: Vec<RepoWorkMapStageLensRow>,
repo_work_map_stage_lens_tui_rows: Vec<String>,
repo_work_map_gate_lens_count: usize,
repo_work_map_gate_lens_rows: Vec<RepoWorkMapGateLensRow>,
repo_work_map_gate_lens_tui_rows: Vec<String>,
repo_work_overview_count: usize,
repo_work_overview_rows: Vec<RepoWorkOverviewRow>,
repo_work_overview_tui_rows: Vec<String>,
@ -4426,6 +4447,9 @@ impl SwarmOverviewOutput {
repo_work_map_stage_lens_count: report.repo_work_map_stage_lens_rows.len(),
repo_work_map_stage_lens_rows: report.repo_work_map_stage_lens_rows,
repo_work_map_stage_lens_tui_rows: report.repo_work_map_stage_lens_tui_rows,
repo_work_map_gate_lens_count: report.repo_work_map_gate_lens_rows.len(),
repo_work_map_gate_lens_rows: report.repo_work_map_gate_lens_rows,
repo_work_map_gate_lens_tui_rows: report.repo_work_map_gate_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,
@ -4510,6 +4534,9 @@ struct SwarmTriageOutput {
repo_work_map_stage_lens_count: usize,
repo_work_map_stage_lens_rows: Vec<RepoWorkMapStageLensRow>,
repo_work_map_stage_lens_tui_rows: Vec<String>,
repo_work_map_gate_lens_count: usize,
repo_work_map_gate_lens_rows: Vec<RepoWorkMapGateLensRow>,
repo_work_map_gate_lens_tui_rows: Vec<String>,
repo_work_overview_count: usize,
repo_work_overview_rows: Vec<RepoWorkOverviewRow>,
repo_work_overview_tui_rows: Vec<String>,
@ -4597,6 +4624,9 @@ impl SwarmTriageOutput {
repo_work_map_stage_lens_count: report.repo_work_map_stage_lens_rows.len(),
repo_work_map_stage_lens_rows: report.repo_work_map_stage_lens_rows,
repo_work_map_stage_lens_tui_rows: report.repo_work_map_stage_lens_tui_rows,
repo_work_map_gate_lens_count: report.repo_work_map_gate_lens_rows.len(),
repo_work_map_gate_lens_rows: report.repo_work_map_gate_lens_rows,
repo_work_map_gate_lens_tui_rows: report.repo_work_map_gate_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,
@ -5487,6 +5517,87 @@ fn repo_work_map_stage_lens_tui_row(row: &RepoWorkMapStageLensRow) -> String {
)
}
fn repo_work_map_gate_lens_rows(
repo_work_map_entries: &[EpiphanyCultMeshRepoWorkMapEntry],
) -> (Vec<RepoWorkMapGateLensRow>, Vec<String>) {
let mut by_gate = BTreeMap::<String, RepoWorkMapGateLensRow>::new();
for entry in repo_work_map_entries {
let gate = entry.publication_gate.clone();
let row = by_gate
.entry(gate.clone())
.or_insert_with(|| RepoWorkMapGateLensRow {
publication_gate: gate.clone(),
owner: repo_work_gate_owner(&gate),
item_count: 0,
changed_path_count: 0,
stages: Vec::new(),
safe_action_families: Vec::new(),
latest_item: String::new(),
latest_commit_sha: String::new(),
latest_mind_state_commit_receipt_id: String::new(),
sight_only: true,
private_state_exposed: false,
});
let (stage, _) = repo_work_stage_for_family(&entry.safe_action_family);
row.item_count += 1;
row.changed_path_count += entry.changed_paths.len();
if !row.stages.iter().any(|candidate| candidate == &stage) {
row.stages.push(stage);
row.stages.sort();
}
if !row
.safe_action_families
.iter()
.any(|family| family == &entry.safe_action_family)
{
row.safe_action_families
.push(entry.safe_action_family.clone());
row.safe_action_families.sort();
}
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();
}
}
let rows = by_gate.into_values().collect::<Vec<_>>();
let tui_rows = rows
.iter()
.map(repo_work_map_gate_lens_tui_row)
.collect::<Vec<_>>();
(rows, tui_rows)
}
fn repo_work_gate_owner(publication_gate: &str) -> String {
match publication_gate {
"Bifrost" => "Bifrost",
"Maintainer" => "Maintainer",
"Idunn" => "Idunn",
"Mind" => "Mind",
"Soul" => "Soul",
_ => "Unknown",
}
.to_string()
}
fn repo_work_map_gate_lens_tui_row(row: &RepoWorkMapGateLensRow) -> String {
format!(
"REPO-WORK-MAP-GATE | gate={} | owner={} | items={} | paths={} | stages={} | families={} | latestItem={} | latestCommit={} | latestMind={} | sightOnly={} | private={}",
row.publication_gate,
row.owner,
row.item_count,
row.changed_path_count,
row.stages.join(","),
row.safe_action_families.join(","),
row.latest_item,
short_commit(&row.latest_commit_sha),
row.latest_mind_state_commit_receipt_id,
row.sight_only,
row.private_state_exposed
)
}
fn repo_work_peer_tui_rows(rows: &[RepoWorkOverviewRow]) -> Vec<String> {
rows.iter()
.map(|row| {
@ -6396,6 +6507,8 @@ fn load_swarm_overview_report(args: &Args) -> Result<SwarmOverviewReport> {
repo_work_map_branch_lens_rows(&repo_work_map_entries);
let (repo_work_map_stage_lens_rows, repo_work_map_stage_lens_tui_rows) =
repo_work_map_stage_lens_rows(&repo_work_map_entries);
let (repo_work_map_gate_lens_rows, repo_work_map_gate_lens_tui_rows) =
repo_work_map_gate_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 (idunn_deployment_receipt_rows, idunn_deployment_receipt_tui_rows) =
@ -6437,6 +6550,9 @@ fn load_swarm_overview_report(args: &Args) -> Result<SwarmOverviewReport> {
|| repo_work_map_stage_lens_rows
.iter()
.any(|row| row.private_state_exposed)
|| repo_work_map_gate_lens_rows
.iter()
.any(|row| row.private_state_exposed)
|| repo_work_public_proofs
.iter()
.any(|proof| proof.private_state_exposed)
@ -6503,6 +6619,8 @@ fn load_swarm_overview_report(args: &Args) -> Result<SwarmOverviewReport> {
repo_work_map_branch_lens_tui_rows,
repo_work_map_stage_lens_rows,
repo_work_map_stage_lens_tui_rows,
repo_work_map_gate_lens_rows,
repo_work_map_gate_lens_tui_rows,
repo_work_overview_rows,
repo_work_overview_tui_rows,
repo_work_public_proof_rows,

View file

@ -1338,6 +1338,17 @@ the same Mind-admitted map entries, grouping safe families into stages such as
`privateStateExposed=false`. This is semantic sight only; it does not schedule,
publish, merge, deploy, keep daemons alive, or admit Mind state.
The next gate lens names who owns the publication gate without turning Gjallar
into that owner: `.epiphany-smoke\repo-close-mind-adoption-guard-20260620-233353`
proves Gjallar now derives `repoWorkMapGateLensRows` and
`REPO-WORK-MAP-GATE` TUI rows from Mind-admitted map entries. The proof row for
the accepted planning-note work reports `gate=Bifrost`, `owner=Bifrost`,
`sightOnly=true`, latest item/commit/Mind commit receipt, and
`privateStateExposed=false`; the smoke summary reports
`gjallarRepoWorkMapGateLensCount=1` while `publicationAuthorized=false`. This
is next-gate sight only. Bifrost still owns publication/credit/upstream gates,
and Gjallar does not schedule, publish, merge, deploy, or admit state.
`epiphany-work overview` is the first compact repo work sight/proof surface:
```powershell

View file

@ -157,6 +157,7 @@ remembers doctrine; the branch remembers the blade.
- 2026-06-20: `derive-plan` action-item receipts now carry richer model-authored planning facets without widening command authority, and `adopt --from-plan` now preserves the chosen Imagination action item in the Mind adoption receipt. New CLI fields `--assumption`, `--constraint`, `--non-goal`, `--open-question`, `--decision-point`, and `--evidence-need` are recorded under `planningFacets` in `epiphany.repo_work_imagination_action_items_receipt.v0`, mirrored into the plan derivation's `actionItemReceipt`, then copied into `epiphany.repo_work_adoption_receipt.v0` as `adoptedActionItem`; deterministic defaults are emitted when a model does not supply them. Focused smoke `.epiphany-smoke\repo-planning-facets-20260620-164958` ran init -> online -> accept -> model-authored `derive-plan --action-family planning-note` with all facet fields -> tick run/adopt/execute/close; the action-item receipt preserved assumptions, constraints, non-goals, open questions, decision points, and evidence needs while `handsAuthorityGranted=false`, `durableStateAdmitted=false`, `handsCommandAuthority=false`, `durableStateAuthority=false`, and `privateStateExposed=false`; the adoption receipt preserved `adoptedActionItem.safeActionFamily=repo.markdown_planning_note`, planning facets, `adoptedActionItem.handsCommandAuthority=false`, `adoptedActionItem.durableStateAuthority=false`, `adoptedActionItem.publicationAuthorized=false`, `authority.handsAuthorityGranted=true`, `authority.durableStateAdmitted=false`, and `privateStateExposed=false`; Soul closure passed with family assertions and path scope matched. 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: `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/<item>.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: 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/<item>.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.

Binary file not shown.

File diff suppressed because one or more lines are too long