From d263b809938fcb50fe605af2b99ca0fcda7fcec0 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 13 Jul 2026 02:59:05 +0100 Subject: [PATCH] Name provider context by arrival order --- epiphany-core/src/bin/epiphany-verse-query.rs | 48 ++++++++++-------- epiphany-core/src/cultmesh_integration.rs | 22 ++++---- epiphany-core/src/prompt_context.rs | 8 +-- ...onceptual-substitution-audit-2026-07-12.md | 6 +++ notes/fresh-workspace-handoff.md | 2 + state/ledgers.msgpack | Bin 465615 -> 465916 bytes state/map.yaml | 2 +- 7 files changed, 51 insertions(+), 37 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index 1919ee0f..fbc5cf8c 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -2592,7 +2592,7 @@ fn run_cli() -> Result<()> { write_epiphany_cultmesh_agent_state_soa_summary(&args.store, agent_state_summary)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; if context - .latest_bifrost_body_change_publication_intent + .arrival_latest_bifrost_body_change_publication_intent .is_none() || context.eve_surface_states.len() != context.odin_advertisements.len() || context.daemon_statuses.len() != context.cluster_topology.len() @@ -2604,10 +2604,14 @@ fn run_cli() -> Result<()> { .as_ref() .is_some_and(|brake| brake.private_state_exposed) || context - .latest_bifrost_body_change_publication_receipt + .arrival_latest_bifrost_body_change_publication_receipt .is_some() - || context.latest_bifrost_github_publication_receipt.is_some() - || context.latest_bifrost_collaboration_feedback.is_none() + || context + .arrival_latest_bifrost_github_publication_receipt + .is_some() + || context + .arrival_latest_bifrost_collaboration_feedback + .is_none() || context.latest_imagination_consensus_receipt.is_some() || context.latest_work_loop_summary.is_none() || context.latest_agent_state_soa_summary.is_none() @@ -2914,10 +2918,10 @@ fn run_cli() -> Result<()> { "latestToolInvocationReceipt": context.latest_daemon_tool_invocation_receipt.as_ref().map(|receipt| receipt.receipt_id.clone()), "latestDaemonPokeIntent": context.latest_daemon_poke_intent.as_ref().map(|intent| intent.intent_id.clone()), "latestDaemonPokeReceipt": context.latest_daemon_poke_receipt.as_ref().map(|receipt| receipt.receipt_id.clone()), - "arrivalLatestBifrostPublicationIntent": context.latest_bifrost_body_change_publication_intent.as_ref().map(|intent| intent.intent_id.clone()), - "arrivalLatestBifrostPublicationReceipt": context.latest_bifrost_body_change_publication_receipt.as_ref().map(|receipt| receipt.receipt_id.clone()), - "arrivalLatestBifrostGithubReceipt": context.latest_bifrost_github_publication_receipt.as_ref().map(|receipt| receipt.receipt_id.clone()), - "arrivalLatestBifrostCollaborationFeedback": context.latest_bifrost_collaboration_feedback.as_ref().map(|feedback| feedback.feedback_id.clone()), + "arrivalLatestBifrostPublicationIntent": context.arrival_latest_bifrost_body_change_publication_intent.as_ref().map(|intent| intent.intent_id.clone()), + "arrivalLatestBifrostPublicationReceipt": context.arrival_latest_bifrost_body_change_publication_receipt.as_ref().map(|receipt| receipt.receipt_id.clone()), + "arrivalLatestBifrostGithubReceipt": context.arrival_latest_bifrost_github_publication_receipt.as_ref().map(|receipt| receipt.receipt_id.clone()), + "arrivalLatestBifrostCollaborationFeedback": context.arrival_latest_bifrost_collaboration_feedback.as_ref().map(|feedback| feedback.feedback_id.clone()), "latestImaginationConsensusReceipt": context.latest_imagination_consensus_receipt.as_ref().map(|receipt| receipt.receipt_id.clone()), "latestWorkLoopTelemetry": context.latest_work_loop_summary.as_ref().map(|summary| summary.telemetry_id.clone()), "latestAgentStateSoaSummary": context.latest_agent_state_soa_summary.as_ref().map(|summary| summary.summary_id.clone()), @@ -6776,17 +6780,17 @@ fn receipt_directory_report( owner: "Bifrost".to_string(), document_kind: "gamecult.bifrost.github_publication_receipt.v0".to_string(), latest_id: context - .latest_bifrost_github_publication_receipt + .arrival_latest_bifrost_github_publication_receipt .as_ref() .map(|receipt| receipt.receipt_id.clone()) .unwrap_or_else(|| "missing".to_string()), status: context - .latest_bifrost_github_publication_receipt + .arrival_latest_bifrost_github_publication_receipt .as_ref() .map(|receipt| receipt.publication_status.clone()) .unwrap_or_else(|| "missing".to_string()), route: context - .latest_bifrost_github_publication_receipt + .arrival_latest_bifrost_github_publication_receipt .as_ref() .map(|receipt| receipt.pull_request_url.clone()) .unwrap_or_else(|| "none".to_string()), @@ -6796,9 +6800,11 @@ fn receipt_directory_report( artifact_ref: "none".to_string(), artifact_status: "none".to_string(), artifact_sha256: "none".to_string(), - present: context.latest_bifrost_github_publication_receipt.is_some(), + present: context + .arrival_latest_bifrost_github_publication_receipt + .is_some(), private_state_exposed: context - .latest_bifrost_github_publication_receipt + .arrival_latest_bifrost_github_publication_receipt .as_ref() .map(|receipt| receipt.private_state_exposed) .unwrap_or(false), @@ -6812,17 +6818,17 @@ fn receipt_directory_report( owner: "Bifrost".to_string(), document_kind: "gamecult.bifrost.public_proof_publication_receipt.v0".to_string(), latest_id: context - .latest_bifrost_public_proof_publication_receipt + .arrival_latest_bifrost_public_proof_publication_receipt .as_ref() .map(|receipt| receipt.receipt_id.clone()) .unwrap_or_else(|| "missing".to_string()), status: context - .latest_bifrost_public_proof_publication_receipt + .arrival_latest_bifrost_public_proof_publication_receipt .as_ref() .map(|receipt| receipt.status.clone()) .unwrap_or_else(|| "missing".to_string()), route: context - .latest_bifrost_public_proof_publication_receipt + .arrival_latest_bifrost_public_proof_publication_receipt .as_ref() .map(|receipt| receipt.publication_url.clone()) .unwrap_or_else(|| "none".to_string()), @@ -6830,12 +6836,12 @@ fn receipt_directory_report( service_route: "none".to_string(), follow_up_command: WRAPPER_BIFROST_LEDGER_COMMAND.to_string(), artifact_ref: context - .latest_bifrost_public_proof_publication_receipt + .arrival_latest_bifrost_public_proof_publication_receipt .as_ref() .map(|receipt| receipt.public_proof_ref.clone()) .unwrap_or_else(|| "none".to_string()), artifact_status: context - .latest_bifrost_public_proof_publication_receipt + .arrival_latest_bifrost_public_proof_publication_receipt .as_ref() .map(|receipt| { if receipt.public_proof_ref == "none" { @@ -6846,15 +6852,15 @@ fn receipt_directory_report( }) .unwrap_or_else(|| "none".to_string()), artifact_sha256: context - .latest_bifrost_public_proof_publication_receipt + .arrival_latest_bifrost_public_proof_publication_receipt .as_ref() .map(|receipt| receipt.public_proof_sha256.clone()) .unwrap_or_else(|| "none".to_string()), present: context - .latest_bifrost_public_proof_publication_receipt + .arrival_latest_bifrost_public_proof_publication_receipt .is_some(), private_state_exposed: context - .latest_bifrost_public_proof_publication_receipt + .arrival_latest_bifrost_public_proof_publication_receipt .as_ref() .map(|receipt| receipt.private_state_exposed) .unwrap_or(false), diff --git a/epiphany-core/src/cultmesh_integration.rs b/epiphany-core/src/cultmesh_integration.rs index ce3f3020..40f6c933 100644 --- a/epiphany-core/src/cultmesh_integration.rs +++ b/epiphany-core/src/cultmesh_integration.rs @@ -2426,15 +2426,15 @@ pub struct EpiphanyLocalVerseContext { Option, pub latest_daemon_tool_invocation_receipt: Option, - pub latest_bifrost_body_change_publication_intent: + pub arrival_latest_bifrost_body_change_publication_intent: Option, - pub latest_bifrost_body_change_publication_receipt: + pub arrival_latest_bifrost_body_change_publication_receipt: Option, - pub latest_bifrost_github_publication_receipt: + pub arrival_latest_bifrost_github_publication_receipt: Option, - pub latest_bifrost_public_proof_publication_receipt: + pub arrival_latest_bifrost_public_proof_publication_receipt: Option, - pub latest_bifrost_collaboration_feedback: + pub arrival_latest_bifrost_collaboration_feedback: Option, pub latest_imagination_consensus_receipt: Option, @@ -6098,15 +6098,15 @@ pub fn query_epiphany_local_verse_context( .get(EPIPHANY_CULTMESH_DAEMON_TOOL_INVOCATION_INTENT_LATEST_KEY)?, latest_daemon_tool_invocation_receipt: node .get(EPIPHANY_CULTMESH_DAEMON_TOOL_INVOCATION_RECEIPT_LATEST_KEY)?, - latest_bifrost_body_change_publication_intent: node + arrival_latest_bifrost_body_change_publication_intent: node .get(EPIPHANY_CULTMESH_BIFROST_BODY_CHANGE_PUBLICATION_INTENT_LATEST_KEY)?, - latest_bifrost_body_change_publication_receipt: node + arrival_latest_bifrost_body_change_publication_receipt: node .get(EPIPHANY_CULTMESH_BIFROST_BODY_CHANGE_PUBLICATION_RECEIPT_LATEST_KEY)?, - latest_bifrost_github_publication_receipt: node + arrival_latest_bifrost_github_publication_receipt: node .get(EPIPHANY_CULTMESH_BIFROST_GITHUB_PUBLICATION_RECEIPT_LATEST_KEY)?, - latest_bifrost_public_proof_publication_receipt: node + arrival_latest_bifrost_public_proof_publication_receipt: node .get(EPIPHANY_CULTMESH_BIFROST_PUBLIC_PROOF_PUBLICATION_RECEIPT_LATEST_KEY)?, - latest_bifrost_collaboration_feedback: node + arrival_latest_bifrost_collaboration_feedback: node .get(EPIPHANY_CULTMESH_BIFROST_COLLABORATION_FEEDBACK_LATEST_KEY)?, latest_imagination_consensus_receipt: node .get(EPIPHANY_CULTMESH_IMAGINATION_CONSENSUS_RECEIPT_LATEST_KEY)?, @@ -9883,7 +9883,7 @@ mod tests { let context = query_epiphany_local_verse_context(&store, "epiphany-test")?; assert_eq!( context - .latest_bifrost_collaboration_feedback + .arrival_latest_bifrost_collaboration_feedback .as_ref() .map(|feedback| feedback.requested_consensus_route.as_str()), Some("imagination.consensus_discovery") diff --git a/epiphany-core/src/prompt_context.rs b/epiphany-core/src/prompt_context.rs index c6d422bb..b3177197 100644 --- a/epiphany-core/src/prompt_context.rs +++ b/epiphany-core/src/prompt_context.rs @@ -208,7 +208,7 @@ pub fn render_epiphany_prompt_context(input: &EpiphanyPromptContextInput) -> Str if let Some(intent) = input .local_verse - .latest_bifrost_body_change_publication_intent + .arrival_latest_bifrost_body_change_publication_intent .as_ref() { lines.push("## Bifrost Publication Gate".to_string()); @@ -224,7 +224,7 @@ pub fn render_epiphany_prompt_context(input: &EpiphanyPromptContextInput) -> Str )); if let Some(receipt) = input .local_verse - .latest_bifrost_body_change_publication_receipt + .arrival_latest_bifrost_body_change_publication_receipt .as_ref() .filter(|receipt| receipt.intent_id == intent.intent_id) { @@ -238,7 +238,7 @@ pub fn render_epiphany_prompt_context(input: &EpiphanyPromptContextInput) -> Str )); if let Some(github) = input .local_verse - .latest_bifrost_github_publication_receipt + .arrival_latest_bifrost_github_publication_receipt .as_ref() .filter(|github| github.bifrost_publication_receipt_id == receipt.receipt_id) { @@ -664,7 +664,7 @@ mod tests { .intent_id = "another-eve-intent".to_string(); prompt_input .local_verse - .latest_bifrost_body_change_publication_receipt + .arrival_latest_bifrost_body_change_publication_receipt .as_mut() .expect("Bifrost receipt remains available for mismatch probe") .intent_id = "another-bifrost-intent".to_string(); diff --git a/notes/conceptual-substitution-audit-2026-07-12.md b/notes/conceptual-substitution-audit-2026-07-12.md index 9d49813b..529e2a9e 100644 --- a/notes/conceptual-substitution-audit-2026-07-12.md +++ b/notes/conceptual-substitution-audit-2026-07-12.md @@ -948,6 +948,12 @@ and JSON surface: provider-derived IDs use `arrival_latest_*` and while locally ordered Imagination consensus retains its legitimate `latest` name. +`EpiphanyCultMeshContext` now completes the correction: its five provider +mirror fields use `arrival_latest_bifrost_*`, and prompt-context plus Verse +consumers read those names directly. The only remaining Bifrost `LATEST_KEY` +identifiers describe persisted `/latest` compatibility keys, not chronology +claims in typed runtime state. + The same inspection found 33 consecutive duplicate `#[cfg(test)]` attributes on provider constructors/writers and their re-exports. One gate already makes each item test-only; the second owned nothing. The duplicates are removed. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 4842e6cd..efd26e38 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -292,6 +292,8 @@ persisted `/latest` key spelling is retained as external storage compatibility, not interpreted as provider chronology. The Bifrost ledger report also uses `arrival_latest_*` typed fields and `arrivalLatestBifrost*` JSON keys; no old report aliases remain. +`EpiphanyCultMeshContext`, prompt assembly, and Verse consumers now also use +`arrival_latest_bifrost_*`; only persisted key constants retain `LATEST_KEY`. The latest structural count is 32 closure family branches, 744 remaining substring assertions in the closure region, and 1,284 lines in diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 2efd63d995fe0efdf9136a91f00a816411321dd9..739e4442b84b4a99e0c72858edc97d661e6df38c 100644 GIT binary patch delta 265 zcmX@VRp!rjnGKSRT$WY_CQ-*2*rjf6R%R?@WQ=Z}%G5rUi4llFG&2yh05K~Nvu&Ts z#BL=q{oO(~Zg%4k14AoQ%jpLd*kla;1*PUC=BB17xE5plhugG1uIT_eGYOA_-+iWQ1d sOA<5l6o59T7Ud=8C={3E7bT{rDwO3XCnlBVBo