From e6bdab1a7facc89da0500ca0a378b62de8cf93be Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 13 Jul 2026 03:44:43 +0100 Subject: [PATCH] Separate readiness routing authority --- ...o-readiness-review-request-family-smoke.rs | 4 +- epiphany-core/src/bin/epiphany-work.rs | 110 +++--------- .../closure_contracts/external_governance.rs | 162 ++++++++++++++++++ .../external_governance_tests.rs | 36 ++++ ...onceptual-substitution-audit-2026-07-12.md | 15 ++ notes/epiphany-current-algorithmic-map.md | 2 +- notes/fresh-workspace-handoff.md | 7 + state/ledgers.msgpack | Bin 470633 -> 471090 bytes state/map.yaml | 2 +- 9 files changed, 251 insertions(+), 87 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-repo-readiness-review-request-family-smoke.rs b/epiphany-core/src/bin/epiphany-repo-readiness-review-request-family-smoke.rs index a1edbed6..f0e461ff 100644 --- a/epiphany-core/src/bin/epiphany-repo-readiness-review-request-family-smoke.rs +++ b/epiphany-core/src/bin/epiphany-repo-readiness-review-request-family-smoke.rs @@ -215,10 +215,12 @@ fn run_smoke(args: Args) -> Result { )?; require_text(&request_text, "[request]")?; require_text(&request_text, "status = \"awaiting-mvp-readiness-review\"")?; + require_text(&request_text, "routing_owner = \"Self\"")?; require_text( &request_text, - "requested_owner = \"Maintainer/Soul/Mind/Bifrost\"", + "required_reviewers = [\"Maintainer\", \"Soul\", \"Mind\", \"Bifrost\"]", )?; + require_text(&request_text, "readiness_approval_owner = \"none\"")?; require_text( &request_text, "requested_effect = \"review-redacted-repo-swarm-mvp-proof-bundle\"", diff --git a/epiphany-core/src/bin/epiphany-work.rs b/epiphany-core/src/bin/epiphany-work.rs index 94896a66..bd042e6f 100644 --- a/epiphany-core/src/bin/epiphany-work.rs +++ b/epiphany-core/src/bin/epiphany-work.rs @@ -5529,7 +5529,9 @@ fn derive_repo_readiness_review_request_plan( "[request]".to_string(), format!("id = {}", toml_basic_string(&request_id)), "status = \"awaiting-mvp-readiness-review\"".to_string(), - "requested_owner = \"Maintainer/Soul/Mind/Bifrost\"".to_string(), + "routing_owner = \"Self\"".to_string(), + "required_reviewers = [\"Maintainer\", \"Soul\", \"Mind\", \"Bifrost\"]".to_string(), + "readiness_approval_owner = \"none\"".to_string(), "requested_effect = \"review-redacted-repo-swarm-mvp-proof-bundle\"".to_string(), "readiness_scope = \"fresh repo init, online swarm, Persona intake, Imagination planning, Self queue-run, Hands branch work, Soul closure, Modeling map update, Mind admission, Bifrost public proof, upstream-main sync, Idunn lifecycle, global tool directory, and private-state redaction\"".to_string(), "review_is_advisory_until_maintainer_or_bifrost_acceptance = true".to_string(), @@ -8121,138 +8123,77 @@ fn closure_family_assertions( ); } "repo.readiness_review_request" => { + let request = parse_repo_readiness_review_request(&content).ok(); push_assertion( &mut assertions, "readiness-review-request-schema-present", - content.contains("schema_version = \"epiphany.repo_readiness_review_request.v0\""), + request + .as_ref() + .is_some_and(RepoReadinessReviewRequest::has_canonical_identity), "Committed readiness review request carries the schema version.".to_string(), ); push_assertion( &mut assertions, "readiness-review-request-family-present", - content.contains("safe_action_family = \"repo.readiness_review_request\""), + request + .as_ref() + .is_some_and(RepoReadinessReviewRequest::has_canonical_identity), "Committed readiness review request carries the safe action family.".to_string(), ); push_assertion( &mut assertions, "readiness-review-request-summary-present", - content.contains(&compact_summary), + request + .as_ref() + .is_some_and(|value| value.summary == compact_summary), "Committed readiness review request contains the accepted pressure summary." .to_string(), ); push_assertion( &mut assertions, "readiness-review-request-awaits-review", - content.contains("[request]") - && content.contains("status = \"awaiting-mvp-readiness-review\"") - && content.contains("requested_owner = \"Maintainer/Soul/Mind/Bifrost\"") - && content.contains( - "requested_effect = \"review-redacted-repo-swarm-mvp-proof-bundle\"", - ) - && content.contains( - "review_is_advisory_until_maintainer_or_bifrost_acceptance = true", - ), + request.as_ref().is_some_and(RepoReadinessReviewRequest::has_coherent_routing), "Committed readiness review request waits for maintainer/Soul/Mind/Bifrost review before consequence." .to_string(), ); push_assertion( &mut assertions, "readiness-review-request-antecedents-present", - content.contains("[antecedents]") - && content.contains("repo_init_required = true") - && content.contains("swarm_online_required = true") - && content.contains("persona_intake_required = true") - && content.contains("imagination_plan_required = true") - && content.contains("self_queue_run_required = true") - && content.contains("hands_commit_required = true") - && content.contains("soul_closure_required = true") - && content.contains("modeling_map_update_required = true") - && content.contains("mind_admission_required = true") - && content.contains("public_proof_required = true") - && content.contains("bifrost_publication_required = true") - && content.contains("upstream_main_sync_required = true") - && content.contains("idunn_lifecycle_readiness_required = true") - && content.contains("tool_directory_readiness_required = true") - && content.contains("private_state_redaction_required = true"), + request + .as_ref() + .is_some_and(RepoReadinessReviewRequest::has_antecedent_contract), "Committed readiness review request requires all repo-swarm MVP organ proofs." .to_string(), ); push_assertion( &mut assertions, "readiness-review-request-receipt-contract", - content.contains("[required_receipts]") - && content.contains("repo_init = \"epiphany.repo_swarm_init_receipt.v0\"") - && content - .contains("swarm_online = \"epiphany.repo_swarm_online_receipt.v0\"") - && content - .contains("persona_speech_audit = \"epiphany.persona_speech_audit.v0\"") - && content.contains("imagination_action_items = \"epiphany.repo_work_imagination_action_items_receipt.v0\"") - && content.contains("queue_run = \"epiphany.repo_work_queue_run_receipt.v0\"") - && content.contains("hands_commit = \"epiphany.hands.commit_receipt\"") - && content - .contains("closure_review = \"epiphany.repo_work_closure_review.v0\"") - && content - .contains("soul_verdict = \"epiphany.soul.verification_verdict\"") - && content.contains("modeling_map = \"epiphany.repo_work_map_entry.v0\"") - && content.contains("mind_commit = \"epiphany.mind.state_commit_receipt\"") - && content.contains( - "public_proof = \"epiphany.repo_work_public_proof_bundle.v0\"", - ) - && content.contains("bifrost_publication = \"gamecult.bifrost.public_proof_publication_receipt.v0\"") - && content.contains( - "upstream_sync = \"epiphany.repo_work_upstream_sync_receipt.v0\"", - ) - && content.contains("idunn_lifecycle = \"epiphany.repo_work_service_audit.v0\"") - && content.contains("tool_directory = \"epiphany.cultmesh.daemon_tool_directory.v0\""), + request + .as_ref() + .is_some_and(RepoReadinessReviewRequest::has_receipt_contract), "Committed readiness review request names the MVP proof receipt contract." .to_string(), ); push_assertion( &mut assertions, "readiness-review-request-packet-contract", - content.contains("[readiness_packet]") - && content.contains("requires_proof_bundle_ref = true") - && content.contains("requires_changed_path_list = true") - && content.contains("requires_branch_name = true") - && content.contains("requires_upstream_main_ref = true") - && content.contains("requires_public_proof_ref = true") - && content.contains("requires_bifrost_ledger_ref = true") - && content.contains("requires_idunn_lifecycle_ref = true") - && content.contains("requires_tool_directory_ref = true") - && content.contains("requires_redaction_report = true") - && content.contains("requires_reviewer_identity = true") - && content.contains( - "allowed_verdicts = [\"ready\", \"ready-with-caveats\", \"not-ready\", \"needs-human-review\"]", - ), + request.as_ref().is_some_and(RepoReadinessReviewRequest::has_packet_contract), "Committed readiness review request names proof bundle, branch, upstream, Bifrost, Idunn, tool, redaction, reviewer, and verdict requirements." .to_string(), ); push_assertion( &mut assertions, "readiness-review-request-authority-seals", - content.contains("[authority]") - && content.contains("readiness_approval_authorized = false") - && content.contains("durable_state_commit_authorized = false") - && content.contains("publication_authorized = false") - && content.contains("bifrost_publication_authorized = false") - && content.contains("github_pr_authorized = false") - && content.contains("merge_authorized = false") - && content.contains("upstream_sync_authorized = false") - && content.contains("deployment_authority = false") - && content.contains("service_lifecycle_authority = false") - && content.contains("hands_action_authorized = false") - && content.contains("cross_body_mutation_authorized = false") - && content.contains("private_verse_rummaging = false") - && content.contains( - "maintainer_soul_mind_or_bifrost_review_required = true", - ), + request.as_ref().is_some_and(RepoReadinessReviewRequest::has_authority_seals), "Committed readiness review request denies readiness/state/publication/PR/merge/sync/deploy/service/Hands/cross-body authority." .to_string(), ); push_assertion( &mut assertions, "readiness-review-request-private-seal", - content.contains("private_state_exposed = false"), + request + .as_ref() + .is_some_and(|value| !value.private_state_exposed), "Committed readiness review request preserves the private-state seal.".to_string(), ); } @@ -15348,6 +15289,7 @@ idunn_deployment_authority_required = true "repo.credit_request", "repo.artifact_acceptance_request", "repo.metrics_request", + "repo.readiness_review_request", "repo.secret_policy_request", "repo.dependency_policy_request", "repo.deployment_config", diff --git a/epiphany-core/src/bin/epiphany_work/closure_contracts/external_governance.rs b/epiphany-core/src/bin/epiphany_work/closure_contracts/external_governance.rs index 6c966979..34b61b0f 100644 --- a/epiphany-core/src/bin/epiphany_work/closure_contracts/external_governance.rs +++ b/epiphany-core/src/bin/epiphany_work/closure_contracts/external_governance.rs @@ -1011,4 +1011,166 @@ pub(super) fn parse_repo_maintainer_review_request( toml::from_str(text).context("maintainer review request is not valid typed TOML") } +#[derive(Debug, Deserialize)] +pub(super) struct RepoReadinessReviewRequest { + pub(super) schema_version: String, + pub(super) safe_action_family: String, + pub(super) summary: String, + pub(super) private_state_exposed: bool, + request: RepoReadinessReviewBody, + antecedents: std::collections::BTreeMap, + required_receipts: std::collections::BTreeMap, + readiness_packet: RepoReadinessPacket, + authority: std::collections::BTreeMap, +} + +impl RepoReadinessReviewRequest { + pub(super) fn has_canonical_identity(&self) -> bool { + self.schema_version == "epiphany.repo_readiness_review_request.v0" + && self.safe_action_family == "repo.readiness_review_request" + } + + pub(super) fn has_coherent_routing(&self) -> bool { + let r = &self.request; + r.status == "awaiting-mvp-readiness-review" + && r.routing_owner == "Self" + && r.required_reviewers == ["Maintainer", "Soul", "Mind", "Bifrost"] + && r.readiness_approval_owner == "none" + && r.requested_effect == "review-redacted-repo-swarm-mvp-proof-bundle" + && r.review_is_advisory_until_maintainer_or_bifrost_acceptance + } + + pub(super) fn has_antecedent_contract(&self) -> bool { + [ + "repo_init_required", + "swarm_online_required", + "persona_intake_required", + "imagination_plan_required", + "self_queue_run_required", + "hands_commit_required", + "soul_closure_required", + "modeling_map_update_required", + "mind_admission_required", + "public_proof_required", + "bifrost_publication_required", + "upstream_main_sync_required", + "idunn_lifecycle_readiness_required", + "tool_directory_readiness_required", + "private_state_redaction_required", + ] + .iter() + .all(|key| self.antecedents.get(*key) == Some(&true)) + } + + pub(super) fn has_receipt_contract(&self) -> bool { + [ + ("repo_init", "epiphany.repo_swarm_init_receipt.v0"), + ("swarm_online", "epiphany.repo_swarm_online_receipt.v0"), + ("persona_speech_audit", "epiphany.persona_speech_audit.v0"), + ( + "imagination_action_items", + "epiphany.repo_work_imagination_action_items_receipt.v0", + ), + ("queue_run", "epiphany.repo_work_queue_run_receipt.v0"), + ("hands_commit", "epiphany.hands.commit_receipt"), + ("closure_review", "epiphany.repo_work_closure_review.v0"), + ("soul_verdict", "epiphany.soul.verification_verdict"), + ("modeling_map", "epiphany.repo_work_map_entry.v0"), + ("mind_commit", "epiphany.mind.state_commit_receipt"), + ("public_proof", "epiphany.repo_work_public_proof_bundle.v0"), + ( + "bifrost_publication", + "gamecult.bifrost.public_proof_publication_receipt.v0", + ), + ( + "upstream_sync", + "epiphany.repo_work_upstream_sync_receipt.v0", + ), + ("idunn_lifecycle", "epiphany.repo_work_service_audit.v0"), + ( + "tool_directory", + "epiphany.cultmesh.daemon_tool_directory.v0", + ), + ] + .iter() + .all(|(key, value)| self.required_receipts.get(*key).is_some_and(|v| v == value)) + } + + pub(super) fn has_packet_contract(&self) -> bool { + let p = &self.readiness_packet; + p.requires_proof_bundle_ref + && p.requires_changed_path_list + && p.requires_branch_name + && p.requires_upstream_main_ref + && p.requires_public_proof_ref + && p.requires_bifrost_ledger_ref + && p.requires_idunn_lifecycle_ref + && p.requires_tool_directory_ref + && p.requires_redaction_report + && p.requires_reviewer_identity + && p.allowed_verdicts + == [ + "ready", + "ready-with-caveats", + "not-ready", + "needs-human-review", + ] + } + + pub(super) fn has_authority_seals(&self) -> bool { + let denied = [ + "readiness_approval_authorized", + "durable_state_commit_authorized", + "publication_authorized", + "bifrost_publication_authorized", + "github_pr_authorized", + "merge_authorized", + "upstream_sync_authorized", + "deployment_authority", + "service_lifecycle_authority", + "hands_action_authorized", + "cross_body_mutation_authorized", + "private_verse_rummaging", + ]; + denied + .iter() + .all(|key| self.authority.get(*key) == Some(&false)) + && self + .authority + .get("maintainer_soul_mind_or_bifrost_review_required") + == Some(&true) + } +} + +#[derive(Debug, Deserialize)] +struct RepoReadinessReviewBody { + status: String, + routing_owner: String, + required_reviewers: Vec, + readiness_approval_owner: String, + requested_effect: String, + review_is_advisory_until_maintainer_or_bifrost_acceptance: bool, +} + +#[derive(Debug, Deserialize)] +struct RepoReadinessPacket { + requires_proof_bundle_ref: bool, + requires_changed_path_list: bool, + requires_branch_name: bool, + requires_upstream_main_ref: bool, + requires_public_proof_ref: bool, + requires_bifrost_ledger_ref: bool, + requires_idunn_lifecycle_ref: bool, + requires_tool_directory_ref: bool, + requires_redaction_report: bool, + requires_reviewer_identity: bool, + allowed_verdicts: Vec, +} + +pub(super) fn parse_repo_readiness_review_request( + text: &str, +) -> Result { + toml::from_str(text).context("readiness review request is not valid typed TOML") +} + include!("external_governance_tests.rs"); diff --git a/epiphany-core/src/bin/epiphany_work/closure_contracts/external_governance_tests.rs b/epiphany-core/src/bin/epiphany_work/closure_contracts/external_governance_tests.rs index 6ecccee5..38e8bb9b 100644 --- a/epiphany-core/src/bin/epiphany_work/closure_contracts/external_governance_tests.rs +++ b/epiphany-core/src/bin/epiphany_work/closure_contracts/external_governance_tests.rs @@ -2,6 +2,42 @@ mod external_governance_tests { use super::*; + #[test] + fn readiness_comment_cannot_counterfeit_approval_seal() { + let text = r#" +schema_version = "epiphany.repo_readiness_review_request.v0" +safe_action_family = "repo.readiness_review_request" +summary = "summary" +private_state_exposed = false +[request] +status = "awaiting-mvp-readiness-review" +routing_owner = "Self" +required_reviewers = ["Maintainer", "Soul", "Mind", "Bifrost"] +readiness_approval_owner = "none" +requested_effect = "review-redacted-repo-swarm-mvp-proof-bundle" +review_is_advisory_until_maintainer_or_bifrost_acceptance = true +[antecedents] +[required_receipts] +[readiness_packet] +requires_proof_bundle_ref = false +requires_changed_path_list = false +requires_branch_name = false +requires_upstream_main_ref = false +requires_public_proof_ref = false +requires_bifrost_ledger_ref = false +requires_idunn_lifecycle_ref = false +requires_tool_directory_ref = false +requires_redaction_report = false +requires_reviewer_identity = false +allowed_verdicts = [] +[authority] +# readiness_approval_authorized = false +readiness_approval_authorized = true +"#; + let request = parse_repo_readiness_review_request(text).expect("fixture is typed TOML"); + assert!(!request.has_authority_seals()); + } + #[test] fn comment_cannot_counterfeit_direct_execution_seal() { let text = r#" diff --git a/notes/conceptual-substitution-audit-2026-07-12.md b/notes/conceptual-substitution-audit-2026-07-12.md index 7db985ed..b4ff83d7 100644 --- a/notes/conceptual-substitution-audit-2026-07-12.md +++ b/notes/conceptual-substitution-audit-2026-07-12.md @@ -1090,6 +1090,21 @@ grant. Mind, Self, Hands, and Bifrost remain downstream gates. Seventeen high-authority closure families are typed. The source-derived residual is 426 substring occurrences across sixteen families. +## Reviewer coalition as one readiness owner + +Readiness request cargo named `Maintainer/Soul/Mind/Bifrost` as one +`requested_owner`. That was not harmless display text: an earlier deleted +command accepted four caller strings and minted aggregate approval, exactly the +failure this ownership fiction invites. Readiness routing now has one owner: +Self. Maintainer, Soul, Mind, and Bifrost are an explicit ordered reviewer set, +and `readiness_approval_owner = "none"` records that no local aggregate may +turn their unresolved evidence into approval. The request is typed inside +external governance; its actual antecedents, receipts, packet, authority seals, +and privacy field replace substring recognition. + +Eighteen high-authority closure families are typed. Direct source inventory now +reports 363 substring occurrences across fifteen remaining families. + 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/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index 74933b17..fc26c62c 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -51,7 +51,7 @@ - Daemon-tool invocation requests likewise remain pending until the advertised host daemon or authenticated ingest boundary supplies the typed response. Local response construction/writing/validation is test-only; aggregate smoke and receipt-directory projection prove intent-present/receipt-missing instead of manufacturing host acceptance. - Idunn deployment and aftercare outcomes have no local production writer. The synthetic deployment-config family smoke and its green aggregate MVP-gate handoff are deleted; config audit/runbook remain pre-deployment surfaces, while typed Idunn readers await genuine daemon-authored ingest. - Bifrost artifact-acceptance and metrics requests remain open until actual Bifrost/Maintainer receipts are ingested. The stale response-closing request-family smokes, accounting bundle, wrapper mode, and aggregate green gate are deleted. -- Repo-work readiness reports are sight only. The generic readiness-review approval command and writer are deleted because one caller supplied four unresolved reviewer labels; `repo.readiness_review_request` is the remaining request path, and typed review readers await genuine multi-organ/provider evidence. +- Repo-work readiness reports are sight only. The generic readiness-review approval command and writer are deleted because one caller supplied four unresolved reviewer labels. `repo.readiness_review_request` now assigns routing to Self, lists Maintainer/Soul/Mind/Bifrost as independent required reviewers, and names no readiness-approval owner; typed review readers await genuine multi-organ/provider evidence. - There is no aggregate repo-swarm MVP gate. The former smoke manually aggregated fixture summaries into green rows and `demoReady=true`; it and its wrapper are deleted. Whole-organism readiness requires a live-fire path whose claimed consequences are observed at their owning boundaries. - Persona owner: `collaboration-feedback` writes public, bounded feedback only after that provider receipt exists. - Imagination owner: consensus participant selection, packet reference, receipt status/id, and adoption gate. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index ba90bc03..33e23fe2 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -353,6 +353,13 @@ commented adoption denial from hiding a real grant. Seventeen high-authority families are typed. Continue from the source-derived family inventory, not the historical counter. +The readiness-review hydra is cut. Self owns routing; Maintainer, Soul, Mind, +and Bifrost are independent required reviewers; `readiness_approval_owner` is +explicitly `none` because no local aggregate writer exists. Typed external- +governance closure and a counterfeit-approval fixture protect that boundary. +Eighteen high-authority families are typed; direct source inventory reports 363 +substring occurrences across fifteen remaining families. + The latest structural count is 32 closure family branches, 744 remaining substring assertions in the closure region, and 1,284 lines in `closure_contracts.rs`. Do not blindly generate a struct forest for every diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 2a6494ec1e97bdf58c9793ee80e0aa009d59dcb4..4838992338d621ca126012bf71ebb203cbc730c6 100644 GIT binary patch delta 423 zcmYL^u}T9$5Qe=Z=D~w${FYb0S#$JF^4xfB$@a)Sf?UPn*F?yVGu-zb%EkYcE^DGzc#57Nz?| zDPR?~%&M@KS=HA?DSY3_Ps-tHrP*n>^J%YKyA2+Wy#r|`nIYv6EQ&~JBmy(nXlbmn z1`IHbL7RCoBe2FhrIRl7h0>0Nwhja1(>nB(j_M$E1V<{ih8zfsz(dTCAMMzG>XpTa zo0-D-86&#?(4ojOYi1%H{?b7aV>QAErSOFOfz(Kmf=CjJiQvF<%dsuswIW9iIK9a* z${*LmjlD`{GG;bUWon