Cut remaining Bifrost receipt counterfeits

This commit is contained in:
Meta Vens 2026-07-12 20:13:49 +01:00
commit c9faff92f2
7 changed files with 78 additions and 192 deletions

View file

@ -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,
}))?
);
}

View file

@ -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`.

View file

@ -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.

View file

@ -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.

Binary file not shown.

View file

@ -70,7 +70,7 @@ data_flow:
- move historical proof to git, commits, smoke artifacts, or distilled evidence rather than plan prose
active_subgoals:
- Use `notes/conceptual-substitution-audit-2026-07-12.md` as the current authority-corrosion audit. Diagnostics no longer manufacture missing truth. Bifrost body-change/public-proof submission, daemon tools, Eve connection, daemon poke, and Persona collaboration feedback are requester-only. The public-proof command selects an existing redacted proof, reports `pending-bifrost`, rejects ledger/review/credit/destination/publication/receipt results, and cannot write the publication receipt. Generic daemon-status is deleted; cluster-daemon owns heartbeat creation. `epiphany-eve-provider` owns connection acceptance. Next cut artifact acceptance, metrics, and audit remaining response writers.
- Use `notes/conceptual-substitution-audit-2026-07-12.md` and its resolution ledger as the current authority-corrosion map. Every confirmed caller/provider dual writer in that audit is cut from caller-facing production paths. Artifact-acceptance and metrics commands now surface admitted repo requests, report pending named owners, reject all acceptance/accounting result fields, and write no receipts. Next perform a production call-site provenance audit of every response-receipt writer, then distill obsolete contaminated authority claims from this historical map.
- `swarm-overview` is an Epiphany-local, renderer-neutral diagnostic projection over provider-owned typed state. It owns no lifecycle, discovery, composition, or mutation authority. Epiphany publishes clean provider-owned Eve surfaces; Odin may discover them; downstream lowerers and compositors remain outside Epiphany's concern.
- Idunn owns daemon survival and service lifecycle physiology. Codex/operator sessions may inspect, generate runbooks, and route explicit operator authority, but keeping daemons alive belongs to Idunn-owned service lifecycle receipts, scheduler policy, audits, and aftercare. Do not let Self, diagnostic projections, or ad hoc wrapper summaries become a second daemon-keeper. Global tool readbacks for Self `service-health`, `service-policy-directory`, and `swarm-online-runbook` state `lifecycleOwner=Idunn` and `hostedBody=Epiphany` without service mutation or private-state exposure.
- Use `notes/epiphany-cultmesh-dreaming-roadmap.md` as the design authority for distributed Epiphany dreaming. Public dreams are separately authored typed documents distributed through CultMesh/CultNet; private state remains local and cannot be shared by flipping a visibility flag. Foreign dreams are external thought weather until a reviewed local adoption receipt digests them into memory, planning, doctrine, or governance.

View file

@ -1033,24 +1033,10 @@ if ($Mode -eq "bifrost-artifact-acceptance") {
$receiptArgs = @(
"bifrost-artifact-acceptance",
"--store", $repoLocalVerseStore,
"--runtime-id", $RepoWorkRuntimeId,
"--artifact-ref", $BifrostArtifactRef,
"--ledger-entry-id", $BifrostLedgerEntryId,
"--review-receipt", $BifrostArtifactAcceptanceReviewReceipt,
"--source-agent-id", $BifrostArtifactAcceptedBy
"--runtime-id", $RepoWorkRuntimeId
)
if ($BifrostArtifactAcceptanceReceiptId -ne "") {
$receiptArgs += @("--receipt-id", $BifrostArtifactAcceptanceReceiptId)
}
if ($BifrostPublicProofId -ne "") {
$receiptArgs += @("--public-proof-ref", $BifrostPublicProofId)
} elseif ($RepoWorkPublicProof -ne "") {
$receiptArgs += @("--public-proof-ref", $RepoWorkPublicProof)
} else {
$receiptArgs += @("--public-proof-ref", "repo-work-public-proof:latest")
}
Invoke-Checked `
-Label "record Bifrost artifact acceptance receipt" `
-Label "submit artifact acceptance request to Bifrost" `
-FilePath $verseQueryExe `
-Arguments $receiptArgs `
-WorkingDirectory $Root `
@ -1066,27 +1052,10 @@ if ($Mode -eq "bifrost-metrics") {
$receiptArgs = @(
"bifrost-metrics",
"--store", $repoLocalVerseStore,
"--runtime-id", $RepoWorkRuntimeId,
"--model-spend-receipt", $BifrostModelSpendReceipt,
"--review-load-receipt", $BifrostReviewLoadReceipt,
"--credit-receipt", $BifrostCreditReadbackReceipt,
"--metrics-summary", $BifrostMetricsSummary
"--runtime-id", $RepoWorkRuntimeId
)
if ($BifrostMetricsReceiptId -ne "") {
$receiptArgs += @("--receipt-id", $BifrostMetricsReceiptId)
}
if ($BifrostArtifactAcceptanceReceiptId -ne "") {
$receiptArgs += @("--accepted-artifact-receipt-id", $BifrostArtifactAcceptanceReceiptId)
}
if ($BifrostPublicProofId -ne "") {
$receiptArgs += @("--public-proof-ref", $BifrostPublicProofId)
} elseif ($RepoWorkPublicProof -ne "") {
$receiptArgs += @("--public-proof-ref", $RepoWorkPublicProof)
} else {
$receiptArgs += @("--public-proof-ref", "repo-work-public-proof:latest")
}
Invoke-Checked `
-Label "record Bifrost metrics receipt" `
-Label "submit metrics request to Bifrost and Maintainer" `
-FilePath $verseQueryExe `
-Arguments $receiptArgs `
-WorkingDirectory $Root `
@ -2823,7 +2792,7 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) {
if ($null -ne $result.reviewReceiptIds -and $result.reviewReceiptIds.Count -gt 0) {
$reviewReceipts = ($result.reviewReceiptIds -join ",")
}
Write-Host "Bifrost artifact acceptance: status=$($result.status), item=$($result.item), receipt=$($result.receiptId), branch=$($result.sourceBranch), commit=$($result.commitSha), artifact=$($result.artifactRef), publicProof=$($result.publicProofRef), ledger=$($result.ledgerEntryId), acceptedBy=$($result.acceptedBy), review=$reviewReceipts, changedPaths=$changedPaths, privateStateExposed=$($result.privateStateExposed)"
Write-Host "Artifact acceptance request: status=$($result.status), item=$($result.item), branch=$($result.sourceBranch), commit=$($result.commitSha), responseOwner=$($result.responseOwner), changedPaths=$changedPaths, privateStateExposed=$($result.privateStateExposed)"
} elseif ($Mode -eq "bifrost-metrics") {
$modelSpend = "none"
if ($null -ne $result.modelSpendReceiptIds -and $result.modelSpendReceiptIds.Count -gt 0) {
@ -2837,7 +2806,7 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) {
if ($null -ne $result.creditReadbackReceiptIds -and $result.creditReadbackReceiptIds.Count -gt 0) {
$creditReadback = ($result.creditReadbackReceiptIds -join ",")
}
Write-Host "Bifrost metrics: status=$($result.status), item=$($result.item), receipt=$($result.receiptId), branch=$($result.sourceBranch), artifactAcceptance=$($result.artifactAcceptanceReceiptId), publicProof=$($result.publicProofRef), modelSpend=$modelSpend, reviewLoad=$reviewLoad, creditReadback=$creditReadback, summary=$($result.metricsSummary), privateStateExposed=$($result.privateStateExposed)"
Write-Host "Metrics request: status=$($result.status), item=$($result.item), branch=$($result.sourceBranch), responseOwner=$($result.responseOwner), privateStateExposed=$($result.privateStateExposed)"
} elseif ($Mode -eq "daemon-survival-rehearsal") {
Write-Host "Daemon survival rehearsal: status=$($result.status), daemon=$($result.daemonId), scheduler=$($result.schedulerId), policy=$($result.policyStatus), serve=$($result.serveStatus), iterations=$($result.serveIterations), schedulerReceipt=$($result.schedulerReceiptId), serviceManagerMutated=$($result.serviceManagerMutated), elevated=$($result.requiresElevatedAuthority), privateStateExposed=$($result.privateStateExposed), smokeDir=$($result.smokeDir)"
} elseif ($Mode -eq "repo-swarm-mvp-gate") {