From c9faff92f263fc7a17e66b6d055f7f6e8347ece7 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 12 Jul 2026 20:13:49 +0100 Subject: [PATCH] Cut remaining Bifrost receipt counterfeits --- epiphany-core/src/bin/epiphany-verse-query.rs | 208 +++++------------- ...onceptual-substitution-audit-2026-07-12.md | 5 + notes/epiphany-current-algorithmic-map.md | 8 + notes/fresh-workspace-handoff.md | 4 + state/ledgers.msgpack | Bin 431003 -> 431492 bytes state/map.yaml | 2 +- tools/epiphany_local_run.ps1 | 43 +--- 7 files changed, 78 insertions(+), 192 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index 28ad62b2..7eda779d 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -5,12 +5,10 @@ use cultmesh_rs::CultMeshRudpDocumentPublishOptions; 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; -use epiphany_core::epiphany_cultmesh_bifrost_artifact_acceptance_receipt_for_map_entry; use epiphany_core::epiphany_cultmesh_bifrost_body_change_publication_intent; use epiphany_core::epiphany_cultmesh_bifrost_body_change_publication_receipt_for_intent; use epiphany_core::epiphany_cultmesh_bifrost_collaboration_feedback; use epiphany_core::epiphany_cultmesh_bifrost_github_publication_receipt_for_publication; -use epiphany_core::epiphany_cultmesh_bifrost_metrics_receipt_for_map_entry; use epiphany_core::epiphany_cultmesh_daemon_poke_intent_from_status; use epiphany_core::epiphany_cultmesh_daemon_poke_receipt_for_intent; use epiphany_core::epiphany_cultmesh_daemon_tool_invocation_intent_from_capability; @@ -59,12 +57,10 @@ use epiphany_core::open_epiphany_cultmesh_node; use epiphany_core::query_epiphany_local_verse_context; use epiphany_core::seed_epiphany_local_verse_context; use epiphany_core::write_epiphany_cultmesh_agent_state_soa_summary; -use epiphany_core::write_epiphany_cultmesh_bifrost_artifact_acceptance_receipt; use epiphany_core::write_epiphany_cultmesh_bifrost_body_change_publication_intent; use epiphany_core::write_epiphany_cultmesh_bifrost_body_change_publication_receipt; use epiphany_core::write_epiphany_cultmesh_bifrost_collaboration_feedback; use epiphany_core::write_epiphany_cultmesh_bifrost_github_publication_receipt; -use epiphany_core::write_epiphany_cultmesh_bifrost_metrics_receipt; use epiphany_core::write_epiphany_cultmesh_daemon_poke_intent; use epiphany_core::write_epiphany_cultmesh_daemon_poke_receipt; use epiphany_core::write_epiphany_cultmesh_daemon_restart_policy; @@ -1036,6 +1032,19 @@ fn run_cli() -> Result<()> { ); } "bifrost-artifact-acceptance" | "artifact-acceptance" => { + if args.artifact_ref.is_some() + || args.public_proof_id.is_some() + || args.result_ref.is_some() + || args.review_receipts.is_some() + || args.ledger_entry_id.is_some() + || args.receipt_id.is_some() + || args.receipt_status.is_some() + || args.source_agent_id.is_some() + { + anyhow::bail!( + "bifrost-artifact-acceptance inspects a pending repo request only; Maintainer/Bifrost owns artifact, proof, review, ledger, acceptance identity/status, and accepted-by result fields" + ); + } seed_epiphany_local_verse_context( &args.store, args.runtime_id.clone(), @@ -1049,91 +1058,49 @@ fn run_cli() -> Result<()> { .context( "bifrost-artifact-acceptance requires a repo.artifact_acceptance_request map entry", )?; - let artifact_ref = args - .artifact_ref - .clone() - .context("bifrost-artifact-acceptance requires --artifact-ref")?; - let public_proof_ref = args - .public_proof_id - .clone() - .or_else(|| args.result_ref.clone()) - .context( - "bifrost-artifact-acceptance requires --public-proof-ref or --result-ref", - )?; - let review_receipts = required_list( - &args.review_receipts, - "bifrost-artifact-acceptance requires --review-receipt", - )?; - let ledger_entry_id = args - .ledger_entry_id - .clone() - .unwrap_or_else(|| map_entry.publication_gate.clone()); - let receipt_id = args - .receipt_id - .clone() - .unwrap_or_else(|| format!("bifrost-artifact-acceptance-{}", map_entry.item)); - let receipt_status = args - .receipt_status - .clone() - .unwrap_or_else(|| "accepted-artifact-recorded".to_string()); - let accepted_by = args - .source_agent_id - .clone() - .unwrap_or_else(|| "Maintainer/Bifrost".to_string()); - let receipt = epiphany_cultmesh_bifrost_artifact_acceptance_receipt_for_map_entry( - receipt_id, - &map_entry, - artifact_ref, - public_proof_ref, - review_receipts, - ledger_entry_id, - receipt_status, - accepted_by, - ); - let written = write_epiphany_cultmesh_bifrost_artifact_acceptance_receipt( - &args.store, - args.runtime_id.clone(), - receipt, - )?; - let latest = load_latest_epiphany_cultmesh_bifrost_artifact_acceptance_receipt( - &args.store, - args.runtime_id.clone(), - )?; - if latest.as_ref().map(|receipt| receipt.receipt_id.as_str()) - != Some(written.receipt_id.as_str()) - { - anyhow::bail!( - "local Verse query lost Bifrost artifact acceptance receipt after write" - ); - } println!( "{}", serde_json::to_string_pretty(&json!({ "schemaVersion": "epiphany.local_verse_bifrost_artifact_acceptance.v0", - "status": "ok", + "status": "pending-maintainer-bifrost", "store": args.store, "runtimeId": args.runtime_id, - "receiptId": written.receipt_id, - "item": written.item, - "sourceWorkspace": written.source_workspace, - "sourceBranch": written.source_branch, - "commitSha": written.commit_sha, - "changedPaths": written.changed_paths, - "artifactRef": written.artifact_ref, - "publicProofRef": written.public_proof_ref, - "ledgerEntryId": written.bifrost_ledger_entry_id, - "reviewReceiptIds": written.maintainer_review_receipt_ids, - "acceptedBy": written.accepted_by, + "receiptId": null, + "item": map_entry.item, + "sourceWorkspace": map_entry.workspace, + "sourceBranch": map_entry.branch, + "commitSha": map_entry.commit_sha, + "changedPaths": map_entry.changed_paths, + "artifactRef": null, + "publicProofRef": null, + "ledgerEntryId": null, + "reviewReceiptIds": [], + "acceptedBy": null, + "responseOwner": "Maintainer/Bifrost", "commands": { "swarmOverview": WRAPPER_OVERVIEW_COMMAND, "bifrostArtifactAcceptance": WRAPPER_BIFROST_ARTIFACT_ACCEPTANCE_COMMAND, "bifrostLedger": WRAPPER_BIFROST_LEDGER_COMMAND }, - "privateStateExposed": written.private_state_exposed, + "privateStateExposed": false, }))? ); } "bifrost-metrics" | "metrics-receipt" => { + if args.artifact_ref.is_some() + || args.verification_receipts.is_some() + || args.review_receipts.is_some() + || args.credit_receipt_ids.is_some() + || args.public_proof_id.is_some() + || args.result_ref.is_some() + || args.receipt_summary.is_some() + || args.receipt_id.is_some() + || args.receipt_status.is_some() + { + anyhow::bail!( + "bifrost-metrics inspects a pending repo request only; Bifrost/Maintainer owns accepted artifact, spend, review load, credit, proof, summary, and receipt result fields" + ); + } seed_epiphany_local_verse_context( &args.store, args.runtime_id.clone(), @@ -1143,97 +1110,30 @@ fn run_cli() -> Result<()> { let map_entry = latest_repo_work_map_entry_for_family(&map_entries, "repo.metrics_request") .context("bifrost-metrics requires a repo.metrics_request map entry")?; - let latest_artifact_acceptance = - load_latest_epiphany_cultmesh_bifrost_artifact_acceptance_receipt( - &args.store, - args.runtime_id.clone(), - )?; - let artifact_acceptance_receipt_id = args - .artifact_ref - .clone() - .or_else(|| { - latest_artifact_acceptance - .as_ref() - .map(|receipt| receipt.receipt_id.clone()) - }) - .context("bifrost-metrics requires --accepted-artifact-receipt-id or a latest artifact acceptance receipt")?; - let model_spend_receipts = required_list( - &args.verification_receipts, - "bifrost-metrics requires --model-spend-receipt", - )?; - let review_load_receipts = required_list( - &args.review_receipts, - "bifrost-metrics requires --review-load-receipt", - )?; - let credit_readback_receipts = required_list( - &args.credit_receipt_ids, - "bifrost-metrics requires --credit-receipt", - )?; - let public_proof_ref = args - .public_proof_id - .clone() - .or_else(|| args.result_ref.clone()) - .context("bifrost-metrics requires --public-proof-ref or --result-ref")?; - let metrics_summary = args.receipt_summary.clone().unwrap_or_else(|| { - "model spend, review load, accepted artifact, and credit readback recorded" - .to_string() - }); - let receipt_id = args - .receipt_id - .clone() - .unwrap_or_else(|| format!("bifrost-metrics-{}", map_entry.item)); - let receipt_status = args - .receipt_status - .clone() - .unwrap_or_else(|| "metrics-recorded".to_string()); - let receipt = epiphany_cultmesh_bifrost_metrics_receipt_for_map_entry( - receipt_id, - &map_entry, - artifact_acceptance_receipt_id, - model_spend_receipts, - review_load_receipts, - credit_readback_receipts, - public_proof_ref, - metrics_summary, - receipt_status, - ); - let written = write_epiphany_cultmesh_bifrost_metrics_receipt( - &args.store, - args.runtime_id.clone(), - receipt, - )?; - let latest = load_latest_epiphany_cultmesh_bifrost_metrics_receipt( - &args.store, - args.runtime_id.clone(), - )?; - if latest.as_ref().map(|receipt| receipt.receipt_id.as_str()) - != Some(written.receipt_id.as_str()) - { - anyhow::bail!("local Verse query lost Bifrost metrics receipt after write"); - } println!( "{}", serde_json::to_string_pretty(&json!({ "schemaVersion": "epiphany.local_verse_bifrost_metrics.v0", - "status": "ok", + "status": "pending-bifrost-maintainer", "store": args.store, "runtimeId": args.runtime_id, - "receiptId": written.receipt_id, - "item": written.item, - "sourceWorkspace": written.source_workspace, - "sourceBranch": written.source_branch, - "artifactAcceptanceReceiptId": written.artifact_acceptance_receipt_id, - "modelSpendReceiptIds": written.model_spend_receipt_ids, - "reviewLoadReceiptIds": written.review_load_receipt_ids, - "creditReadbackReceiptIds": written.credit_readback_receipt_ids, - "publicProofRef": written.public_proof_ref, - "metricsSummary": written.metrics_summary, + "receiptId": null, + "item": map_entry.item, + "sourceWorkspace": map_entry.workspace, + "sourceBranch": map_entry.branch, + "artifactAcceptanceReceiptId": null, + "modelSpendReceiptIds": [], + "reviewLoadReceiptIds": [], + "creditReadbackReceiptIds": [], + "publicProofRef": null, + "metricsSummary": null, + "responseOwner": "Bifrost/Maintainer", "commands": { "swarmOverview": WRAPPER_OVERVIEW_COMMAND, "bifrostMetrics": WRAPPER_BIFROST_METRICS_COMMAND, "bifrostLedger": WRAPPER_BIFROST_LEDGER_COMMAND }, - "privateStateExposed": written.private_state_exposed, + "privateStateExposed": false, }))? ); } diff --git a/notes/conceptual-substitution-audit-2026-07-12.md b/notes/conceptual-substitution-audit-2026-07-12.md index 1396d531..22122134 100644 --- a/notes/conceptual-substitution-audit-2026-07-12.md +++ b/notes/conceptual-substitution-audit-2026-07-12.md @@ -73,3 +73,8 @@ the receipts and projections without first separating those writers. 5. Make provider-owned Eve publication explicit; remove generated fallback surfaces from discovery loaders. +## Resolution ledger + +All confirmed substitutions above have now been structurally cut from their caller-facing production paths. Diagnostics preserve absence; bootstrap does not seed liveness; cluster-daemon owns first heartbeat; discovery loaders do not synthesize providers; tool, Eve, poke, body-change, public-proof, artifact-acceptance, metrics, and Persona-feedback commands write or select requests only; provider/result fields are rejected. `epiphany-eve-provider` is the first narrow provider receipt mouth. Receipt constructors and writers remain available to owning provider binaries and focused contract tests; their mere existence is no longer caller authority. + +Remaining audit work is provenance rather than this original dual-writer cluster: identify every production call site of response-receipt writers, ensure it belongs to a named provider executable or ingest boundary, and distill contaminated historical claims from `state/map.yaml`. diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index 75c4db51..dab546b6 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -62,6 +62,14 @@ - Forbidden writers: the caller-facing command rejects all Bifrost result fields and leaves publication coordinates null. - Negative check: absence of a pending proof fails without writing a publication receipt; response-shaped fields are rejected before mutation. +## Bifrost accounting request boundaries (2026-07-12) + +- Artifact acceptance source: Mind-admitted `repo.artifact_acceptance_request`; caller output is pending `Maintainer/Bifrost` with null acceptance coordinates. +- Metrics source: Mind-admitted `repo.metrics_request`; caller output is pending `Bifrost/Maintainer` with null accounting coordinates. +- Forbidden artifact writers: caller cannot provide artifact/proof/review/ledger/receipt/status/accepted-by results. +- Forbidden metrics writers: caller cannot provide accepted artifact, model spend, review load, credit, proof, summary, receipt, or status results. +- Negative proof: missing requests fail without receipt mutation and response-shaped arguments fail before lookup or write. + 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 9aa3e08a..3a92f198 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -28,6 +28,10 @@ Single poke, batch poke, and swarm triage now write only `epiphany.cultmesh.daem `bifrost-public-proof` and its wrapper now select an already persisted redacted repo-work public proof and report `pending-bifrost`. They do not construct or write `gamecult.bifrost.public_proof_publication_receipt`. Caller-supplied ledger attribution, reviewers, credit receipts, public room/destination, publication URL, receipt id, and receipt status are rejected as Bifrost-owned result fields. Output publication and receipt coordinates remain null. The current canonical `state/local-verse.ccmp` contains no repo-work public proof fixture, so the physical negative proof covered refusal before any receipt mutation plus rejection of counterfeit result fields; full behavior remains covered by typed public-proof storage tests and compilation. Next split artifact acceptance and metrics the same way or move their receipt writers into a narrow Bifrost provider executable. +## 2026-07-12 artifact acceptance and metrics request split + +`bifrost-artifact-acceptance` and `bifrost-metrics`, plus their wrappers, now inspect the latest Mind-admitted `repo.artifact_acceptance_request` / `repo.metrics_request` map entry and report `pending-maintainer-bifrost` / `pending-bifrost-maintainer`. They write no provider receipts. Artifact/proof/review/ledger/accepted-by/status fields and accepted-artifact/spend/review-load/credit/proof/summary/status fields are rejected respectively. The canonical local Verse currently contains neither request family, so negative proof showed clean missing-request failure, no receipt mutation, and rejection of counterfeit result fields. The original conceptual-substitution audit now records all confirmed substitutions as structurally cut; next audit every remaining production receipt-writer call site for provider provenance. + 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 5a6d06d49a7dd1ec6988f1c05c64e3e399aa30f5..9bdea4f053ecced5f34220811f80f0a75da55c3a 100644 GIT binary patch delta 465 zcmXw#u}&O842H88*d|RHBy<$#h$cmj6ObyYlGG$U-DJnRGVIRGjXigY6zPh9Xb@7A zoUTZbG6fA11>yyGgFFv-R!~?omVf*I>_7j8Czr#k&Em!G{=2t(hj-7)-{yL|m=?wT zkLBQOIVd#p`&?s9WBq11D9fL#?-%9EU$6d;7Pp_0KuylHaP0it!AGj2X8}`HJ~<)R zfK6JRM-q&@10SMLZK_^@L5!;qjI+?8M5-7n-*uWZ=r|z90abfI&W?@kNCYiJoF-&p z@C(;|d!u>qQ6QkR*)K#tBa0D~M=f*xC=W4ht6vV@F;4W8+Ki5^RY@l35!F^j6;cp| z{fvzfnjv(=th2|D))VK)T@te=C6c+5R#