From a130258e40d217233afa083a5d2188baf890e1c5 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 12 Jul 2026 19:45:56 +0100 Subject: [PATCH] Split Bifrost request from provider receipts --- epiphany-core/src/bin/epiphany-verse-query.rs | 239 +++++------------- notes/epiphany-current-algorithmic-map.md | 10 + notes/fresh-workspace-handoff.md | 4 + state/ledgers.msgpack | Bin 428323 -> 428763 bytes state/map.yaml | 2 +- tools/epiphany_local_run.ps1 | 11 +- 6 files changed, 81 insertions(+), 185 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index 15102a78..0e0b467e 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -2,41 +2,6 @@ use anyhow::Context; use anyhow::Result; use chrono::Utc; use cultmesh_rs::CultMeshRudpDocumentPublishOptions; -use epiphany_core::EPIPHANY_CULTMESH_DAEMON_RESTART_POLICY_SCHEMA_VERSION; -use epiphany_core::EPIPHANY_CULTMESH_DAEMON_SERVICE_LIFECYCLE_RECEIPT_SCHEMA_VERSION; -use epiphany_core::EPIPHANY_CULTMESH_GLOBAL_VERSE_ID; -use epiphany_core::EPIPHANY_CULTMESH_INTERNAL_VERSE_ID; -use epiphany_core::EPIPHANY_CULTMESH_WORK_LOOP_TELEMETRY_SCHEMA_VERSION; -use epiphany_core::EpiphanyAgentStateSoaEntry; -use epiphany_core::EpiphanyCultMeshAgentStateSoaSummaryEntry; -use epiphany_core::EpiphanyCultMeshBifrostArtifactAcceptanceReceiptEntry; -use epiphany_core::EpiphanyCultMeshBifrostBodyChangePublicationIntentEntry; -use epiphany_core::EpiphanyCultMeshBifrostBodyChangePublicationReceiptEntry; -use epiphany_core::EpiphanyCultMeshBifrostCollaborationFeedbackEntry; -use epiphany_core::EpiphanyCultMeshBifrostGithubPublicationReceiptEntry; -use epiphany_core::EpiphanyCultMeshBifrostMetricsReceiptEntry; -use epiphany_core::EpiphanyCultMeshBifrostPublicProofPublicationReceiptEntry; -use epiphany_core::EpiphanyCultMeshClusterTopologyEntry; -use epiphany_core::EpiphanyCultMeshDaemonPokeReceiptEntry; -use epiphany_core::EpiphanyCultMeshDaemonRestartPolicyEntry; -use epiphany_core::EpiphanyCultMeshDaemonServiceLifecycleReceiptEntry; -use epiphany_core::EpiphanyCultMeshDaemonStatusEntry; -use epiphany_core::EpiphanyCultMeshDaemonToolCapabilityEntry; -use epiphany_core::EpiphanyCultMeshEveSurfaceStateEntry; -use epiphany_core::EpiphanyCultMeshIdunnAftercareAuditReceiptEntry; -use epiphany_core::EpiphanyCultMeshIdunnDeploymentReceiptEntry; -use epiphany_core::EpiphanyCultMeshImaginationConsensusReceiptEntry; -use epiphany_core::EpiphanyCultMeshManagedServicePolicyEntry; -use epiphany_core::EpiphanyCultMeshOdinAdvertisementEntry; -use epiphany_core::EpiphanyCultMeshRepoWorkMapEntry; -use epiphany_core::EpiphanyCultMeshRepoWorkOverviewEntry; -use epiphany_core::EpiphanyCultMeshRepoWorkPublicProofEntry; -use epiphany_core::EpiphanyCultMeshRepoWorkReadinessEntry; -use epiphany_core::EpiphanyCultMeshRepoWorkReadinessReviewEntry; -use epiphany_core::EpiphanyCultMeshSwarmBrakeEntry; -use epiphany_core::EpiphanyCultMeshWorkLoopTelemetryEntry; -use epiphany_core::EpiphanyLocalVerseContext; -use epiphany_core::EpiphanyServiceExecutionAuditCheck; use epiphany_core::default_epiphany_cultmesh_swarm_brake; use epiphany_core::epiphany_cluster_service_execution_audit_report; use epiphany_core::epiphany_cultmesh_agent_state_soa_summary_from_entry; @@ -115,6 +80,41 @@ use epiphany_core::write_epiphany_cultmesh_eve_connection_receipt; use epiphany_core::write_epiphany_cultmesh_imagination_consensus_receipt; use epiphany_core::write_epiphany_cultmesh_swarm_brake; use epiphany_core::write_epiphany_cultmesh_work_loop_telemetry; +use epiphany_core::EpiphanyAgentStateSoaEntry; +use epiphany_core::EpiphanyCultMeshAgentStateSoaSummaryEntry; +use epiphany_core::EpiphanyCultMeshBifrostArtifactAcceptanceReceiptEntry; +use epiphany_core::EpiphanyCultMeshBifrostBodyChangePublicationIntentEntry; +use epiphany_core::EpiphanyCultMeshBifrostBodyChangePublicationReceiptEntry; +use epiphany_core::EpiphanyCultMeshBifrostCollaborationFeedbackEntry; +use epiphany_core::EpiphanyCultMeshBifrostGithubPublicationReceiptEntry; +use epiphany_core::EpiphanyCultMeshBifrostMetricsReceiptEntry; +use epiphany_core::EpiphanyCultMeshBifrostPublicProofPublicationReceiptEntry; +use epiphany_core::EpiphanyCultMeshClusterTopologyEntry; +use epiphany_core::EpiphanyCultMeshDaemonPokeReceiptEntry; +use epiphany_core::EpiphanyCultMeshDaemonRestartPolicyEntry; +use epiphany_core::EpiphanyCultMeshDaemonServiceLifecycleReceiptEntry; +use epiphany_core::EpiphanyCultMeshDaemonStatusEntry; +use epiphany_core::EpiphanyCultMeshDaemonToolCapabilityEntry; +use epiphany_core::EpiphanyCultMeshEveSurfaceStateEntry; +use epiphany_core::EpiphanyCultMeshIdunnAftercareAuditReceiptEntry; +use epiphany_core::EpiphanyCultMeshIdunnDeploymentReceiptEntry; +use epiphany_core::EpiphanyCultMeshImaginationConsensusReceiptEntry; +use epiphany_core::EpiphanyCultMeshManagedServicePolicyEntry; +use epiphany_core::EpiphanyCultMeshOdinAdvertisementEntry; +use epiphany_core::EpiphanyCultMeshRepoWorkMapEntry; +use epiphany_core::EpiphanyCultMeshRepoWorkOverviewEntry; +use epiphany_core::EpiphanyCultMeshRepoWorkPublicProofEntry; +use epiphany_core::EpiphanyCultMeshRepoWorkReadinessEntry; +use epiphany_core::EpiphanyCultMeshRepoWorkReadinessReviewEntry; +use epiphany_core::EpiphanyCultMeshSwarmBrakeEntry; +use epiphany_core::EpiphanyCultMeshWorkLoopTelemetryEntry; +use epiphany_core::EpiphanyLocalVerseContext; +use epiphany_core::EpiphanyServiceExecutionAuditCheck; +use epiphany_core::EPIPHANY_CULTMESH_DAEMON_RESTART_POLICY_SCHEMA_VERSION; +use epiphany_core::EPIPHANY_CULTMESH_DAEMON_SERVICE_LIFECYCLE_RECEIPT_SCHEMA_VERSION; +use epiphany_core::EPIPHANY_CULTMESH_GLOBAL_VERSE_ID; +use epiphany_core::EPIPHANY_CULTMESH_INTERNAL_VERSE_ID; +use epiphany_core::EPIPHANY_CULTMESH_WORK_LOOP_TELEMETRY_SCHEMA_VERSION; use serde::Serialize; use serde_json::json; use sha2::Digest; @@ -937,6 +937,16 @@ fn run_cli() -> Result<()> { ); } "bifrost-publication" | "publish-body-change" => { + if args.receipt_id.is_some() + || args.receipt_status.is_some() + || args.ledger_entry_id.is_some() + || args.publication_url.is_some() + || args.credit_receipt_ids.is_some() + { + anyhow::bail!( + "bifrost-publication accepts requester intent fields only; Bifrost and the GitHub publication adapter own receipt, ledger, credit, and publication-result fields" + ); + } seed_epiphany_local_verse_context( &args.store, args.runtime_id.clone(), @@ -946,14 +956,6 @@ fn run_cli() -> Result<()> { .intent_id .clone() .unwrap_or_else(|| "bifrost-publication-intent".to_string()); - let publication_receipt_id = args - .receipt_id - .clone() - .unwrap_or_else(|| "bifrost-publication-receipt".to_string()); - let github_receipt_id = args - .github_receipt_id - .clone() - .unwrap_or_else(|| "github-publication-receipt".to_string()); let target_repository = args.target_repository.clone().with_context(|| { "bifrost-publication requires --target-repository, for example repo:E:/Projects/EpiphanyAgent" })?; @@ -989,26 +991,6 @@ fn run_cli() -> Result<()> { &args.credit_subjects, "bifrost-publication requires --credit-subject", )?; - let ledger_entry_id = args - .ledger_entry_id - .clone() - .context("bifrost-publication requires --ledger-entry-id")?; - let hands_pr_receipt_id = args - .hands_pr_receipt_id - .clone() - .context("bifrost-publication requires --hands-pr-receipt-id")?; - let publication_url = args - .publication_url - .clone() - .context("bifrost-publication requires --publication-url")?; - let pull_request_number = args - .pull_request_number - .clone() - .unwrap_or_else(|| "unknown".to_string()); - let commit_sha = args - .commit_sha - .clone() - .unwrap_or_else(|| "dry-run-no-commit".to_string()); let source_cluster_id = args .source_cluster_id .clone() @@ -1021,24 +1003,6 @@ fn run_cli() -> Result<()> { .body_domain .clone() .unwrap_or_else(|| target_repository.clone()); - let publication_status = args - .receipt_status - .clone() - .unwrap_or_else(|| "accepted-for-github-publication".to_string()); - let credit_receipts = args.credit_receipt_ids.clone().unwrap_or_else(|| { - credit_subjects - .iter() - .map(|subject| { - format!( - "credit-receipt-{}", - subject - .chars() - .map(|ch| if ch.is_ascii_alphanumeric() { ch } else { '-' }) - .collect::() - ) - }) - .collect() - }); let intent = epiphany_cultmesh_bifrost_body_change_publication_intent( intent_id, source_cluster_id, @@ -1050,7 +1014,7 @@ fn run_cli() -> Result<()> { justification, changed_paths, verification_receipts, - review_receipts.clone(), + review_receipts, authors, credit_subjects, ); @@ -1059,81 +1023,33 @@ fn run_cli() -> Result<()> { args.runtime_id.clone(), intent.clone(), )?; - let publication_receipt = - epiphany_cultmesh_bifrost_body_change_publication_receipt_for_intent( - publication_receipt_id, - &intent, - publication_status, - ledger_entry_id, - github_receipt_id.clone(), - credit_receipts, - review_receipts, - publication_url, - ); - let written_publication = - write_epiphany_cultmesh_bifrost_body_change_publication_receipt( - &args.store, - args.runtime_id.clone(), - publication_receipt.clone(), - )?; - let github_receipt = - epiphany_cultmesh_bifrost_github_publication_receipt_for_publication( - github_receipt_id, - &publication_receipt, - hands_pr_receipt_id, - target_repository, - target_branch, - pull_request_number, - commit_sha, - source_agent_id, - ); - let written_github = write_epiphany_cultmesh_bifrost_github_publication_receipt( - &args.store, - args.runtime_id.clone(), - github_receipt, - )?; let latest_intent = load_latest_epiphany_cultmesh_bifrost_body_change_publication_intent( &args.store, args.runtime_id.clone(), )?; - let latest_publication = - load_latest_epiphany_cultmesh_bifrost_body_change_publication_receipt( - &args.store, - args.runtime_id.clone(), - )?; - let latest_github = load_latest_epiphany_cultmesh_bifrost_github_publication_receipt( - &args.store, - args.runtime_id.clone(), - )?; if latest_intent .as_ref() .map(|intent| intent.intent_id.as_str()) != Some(written_intent.intent_id.as_str()) - || latest_publication - .as_ref() - .map(|receipt| receipt.receipt_id.as_str()) - != Some(written_publication.receipt_id.as_str()) - || latest_github - .as_ref() - .map(|receipt| receipt.receipt_id.as_str()) - != Some(written_github.receipt_id.as_str()) { - anyhow::bail!("local Verse query lost Bifrost publication chain after write"); + anyhow::bail!("local Verse query lost Bifrost publication intent after write"); } println!( "{}", serde_json::to_string_pretty(&json!({ - "status": "ok", + "status": "pending-bifrost", "store": args.store, "runtimeId": args.runtime_id, "intentId": written_intent.intent_id, - "publicationReceiptId": written_publication.receipt_id, - "githubPublicationReceiptId": written_github.receipt_id, - "ledgerEntryId": written_publication.bifrost_ledger_entry_id, - "pullRequestUrl": written_github.pull_request_url, - "changedPaths": written_github.changed_paths, - "creditReceiptIds": written_github.credit_receipt_ids, + "publicationReceiptId": null, + "githubPublicationReceiptId": null, + "ledgerEntryId": null, + "pullRequestUrl": null, + "changedPaths": written_intent.changed_paths, + "creditSubjects": written_intent.credit_subjects, + "responseOwner": "Bifrost", + "githubReceiptOwner": "GitHub publication adapter", "commands": { "swarmOverview": WRAPPER_OVERVIEW_COMMAND, "toolDirectory": "tools/epiphany_local_run.ps1 -Mode tool-directory", @@ -1141,7 +1057,7 @@ fn run_cli() -> Result<()> { "bifrostLedger": WRAPPER_BIFROST_LEDGER_COMMAND }, "privateStateIncluded": written_intent.private_state_included, - "privateStateExposed": written_github.private_state_exposed, + "privateStateExposed": false, }))? ); } @@ -9078,7 +8994,7 @@ fn bifrost_ledger_report( &mut tui_rows, BifrostLedgerRow { document_kind: "body-change-intent".to_string(), - owner: "Bifrost".to_string(), + owner: intent.source_agent_id.clone(), id: intent.intent_id.clone(), status: status.to_string(), route: intent.target_repository.clone(), @@ -9805,7 +9721,11 @@ fn bifrost_accounting_status(closed: bool, present: bool, private_state_exposed: } fn present_word(present: bool) -> &'static str { - if present { "present" } else { "missing" } + if present { + "present" + } else { + "missing" + } } fn collaboration_feedback_tui_rows( @@ -10916,7 +10836,6 @@ struct Args { invocation_ref: Option, result_ref: Option, receipt_summary: Option, - github_receipt_id: Option, target_repository: Option, target_branch: Option, change_summary: Option, @@ -10928,11 +10847,8 @@ struct Args { credit_subjects: Option>, credit_receipt_ids: Option>, ledger_entry_id: Option, - hands_pr_receipt_id: Option, publication_url: Option, public_proof_id: Option, - pull_request_number: Option, - commit_sha: Option, source_cluster_id: Option, source_agent_id: Option, body_domain: Option, @@ -10981,7 +10897,6 @@ impl Args { let mut invocation_ref = None; let mut result_ref = None; let mut receipt_summary = None; - let mut github_receipt_id = None; let mut target_repository = None; let mut target_branch = None; let mut change_summary = None; @@ -10993,11 +10908,8 @@ impl Args { let mut credit_subjects = Vec::new(); let mut credit_receipt_ids = Vec::new(); let mut ledger_entry_id = None; - let mut hands_pr_receipt_id = None; let mut publication_url = None; let mut public_proof_id = None; - let mut pull_request_number = None; - let mut commit_sha = None; let mut source_cluster_id = None; let mut source_agent_id = None; let mut body_domain = None; @@ -11116,10 +11028,6 @@ impl Args { receipt_summary = Some(values.next().context("missing --receipt-summary value")?); } - "--github-receipt-id" => { - github_receipt_id = - Some(values.next().context("missing --github-receipt-id value")?); - } "--target-repository" => { target_repository = Some(values.next().context("missing --target-repository value")?); @@ -11181,13 +11089,6 @@ impl Args { ledger_entry_id = Some(values.next().context("missing --ledger-entry-id value")?); } - "--hands-pr-receipt-id" => { - hands_pr_receipt_id = Some( - values - .next() - .context("missing --hands-pr-receipt-id value")?, - ); - } "--publication-url" => { publication_url = Some(values.next().context("missing --publication-url value")?); @@ -11196,16 +11097,6 @@ impl Args { public_proof_id = Some(values.next().context("missing --public-proof-id value")?); } - "--pull-request-number" => { - pull_request_number = Some( - values - .next() - .context("missing --pull-request-number value")?, - ); - } - "--commit-sha" => { - commit_sha = Some(values.next().context("missing --commit-sha value")?); - } "--source-cluster-id" => { source_cluster_id = Some(values.next().context("missing --source-cluster-id value")?); @@ -11328,7 +11219,6 @@ impl Args { invocation_ref, result_ref, receipt_summary, - github_receipt_id, target_repository, target_branch, change_summary, @@ -11340,11 +11230,8 @@ impl Args { credit_subjects: some_if_not_empty(credit_subjects), credit_receipt_ids: some_if_not_empty(credit_receipt_ids), ledger_entry_id, - hands_pr_receipt_id, publication_url, public_proof_id, - pull_request_number, - commit_sha, source_cluster_id, source_agent_id, body_domain, diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index 584ddb02..30c31fa6 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -9,6 +9,16 @@ - Forbidden writers removed in this pass: read-command calls to `seed_epiphany_local_verse_context`, loader fallback constructors, and bootstrap's default-ready daemon-status loop. - Next authority cut: requester commands may author intents, but Bifrost, GitHub, tool providers, Eve providers, and daemon lifecycle owners must author their own response receipts. +## Bifrost body-change request path (2026-07-12) + +- Owner: the calling Hands/requester owns the body-change intent. +- Inputs: repository, branch, change summary, justification, changed paths, verification/review receipt references, authors, and credit subjects. +- Output: one persisted `gamecult.bifrost.body_change_publication_intent`; command status is `pending-bifrost`. +- Derived sight: the Bifrost ledger shows the open request and attributes the intent row to `source_agent_id`. +- Forbidden writers: the requester CLI no longer constructs or writes Bifrost acceptance, ledger attribution, GitHub publication, PR, commit, publication URL, or credit receipts. +- Response owners: Bifrost may answer with its publication receipt; the GitHub publication adapter may answer only after real substrate evidence exists. +- Negative proof: after request submission, latest intent is present while latest Bifrost publication and GitHub publication receipts are absent. + This is the source-grounded map of the live machine. Historical route and bridge anatomy belongs in git history and evidence ledgers, not here. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 9f572edb..14ebf6af 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -4,6 +4,10 @@ The conceptual-substitution audit found observation manufacturing the body it claimed to inspect. The current local pass removes seeding from read-only Verse commands; persisted topology now bounds liveness, restart-policy, Eve-surface, and tool-directory loaders; absent documents remain empty or unknown; and explicit local bootstrap no longer counterfeits daemon-ready heartbeats. Negative proof covers a nonexistent CultCache path and all 249 library tests pass. Next cut the local CLI's requester/provider collapse: Bifrost/GitHub publication, tool invocation, Eve connection, and daemon poke commands must stop authoring both intent and accepted response receipt. +## 2026-07-12 Bifrost requester/provider split + +`epiphany-verse-query bifrost-publication` and its wrapper now submit only `gamecult.bifrost.body_change_publication_intent`. The requester can describe the body change, evidence, review, authorship, and credit subjects; it can no longer supply a Bifrost ledger result, Hands PR receipt, GitHub receipt, commit, PR number, or publication URL and have the local CLI bless them. Output is `pending-bifrost` with null response receipt ids. A physical CultCache proof shows the intent row open while both Bifrost publication and GitHub publication receipts remain absent. Ledger intent rows name the requesting agent as author; Bifrost remains the response lane owner. Next apply this ownership split to tool invocation, Eve connection, daemon poke, and the remaining Bifrost accounting commands. + This is the re-entry rite for `E:\Projects\EpiphanyAgent`: the waking chant for the local machine-spirit before it touches the forge. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index aecf1a5ef1a42011199495609f7a849ec0252749..d377151939fcbf80007a623dca0619f568a15c73 100644 GIT binary patch delta 428 zcmX|7%`Rm@5O%I{HWoG{LL`;gItMq`{|2)ddsY&QKIas-Xx**44!J84!q`|$+}sE7 z0ul?nfUO7MMeL@Sn8lZ>>eTnsb@ylNtvhxJ z_EA<~{a-Wvi)5oNbgx7T0#rrq4-GjmMO2k3uvqPB09L~&rlW2ucKW4mM3{RWgUO2&%R$TNhxuv8i$?=r?%TY+6dtDy{| pGWW3*ta4aOt%YW5sW)_yj!%?rEDs=<7_nM`6E;CFqcca0`Co