Type verification request closure semantics
This commit is contained in:
parent
09085d4c26
commit
7e2e2de3ea
6 changed files with 59 additions and 42 deletions
|
|
@ -7555,96 +7555,81 @@ fn closure_family_assertions(
|
|||
);
|
||||
}
|
||||
"repo.verification_request" => {
|
||||
let request = parse_repo_verification_request(&content).ok();
|
||||
push_assertion(
|
||||
&mut assertions,
|
||||
"verification-request-schema-present",
|
||||
content.contains("schema_version = \"epiphany.repo_verification_request.v0\""),
|
||||
request
|
||||
.as_ref()
|
||||
.is_some_and(RepoVerificationRequest::has_canonical_identity),
|
||||
"Committed verification request carries the schema version.".to_string(),
|
||||
);
|
||||
push_assertion(
|
||||
&mut assertions,
|
||||
"verification-request-family-present",
|
||||
content.contains("safe_action_family = \"repo.verification_request\""),
|
||||
request
|
||||
.as_ref()
|
||||
.is_some_and(RepoVerificationRequest::has_canonical_identity),
|
||||
"Committed verification request carries the safe action family.".to_string(),
|
||||
);
|
||||
push_assertion(
|
||||
&mut assertions,
|
||||
"verification-request-summary-present",
|
||||
content.contains(&compact_summary),
|
||||
request
|
||||
.as_ref()
|
||||
.is_some_and(|request| request.summary == compact_summary),
|
||||
"Committed verification request contains the accepted pressure summary."
|
||||
.to_string(),
|
||||
);
|
||||
push_assertion(
|
||||
&mut assertions,
|
||||
"verification-request-awaits-soul-review",
|
||||
content.contains("[request]")
|
||||
&& content.contains("status = \"awaiting-soul-review\"")
|
||||
&& content.contains("requested_owner = \"Soul\"")
|
||||
&& content.contains("requested_effect = \"verify-branch-local-hands-work\"")
|
||||
&& content.contains("work_order_ref = "),
|
||||
request
|
||||
.as_ref()
|
||||
.is_some_and(RepoVerificationRequest::awaits_soul_review),
|
||||
"Committed verification request waits for Soul review before proof consequence."
|
||||
.to_string(),
|
||||
);
|
||||
push_assertion(
|
||||
&mut assertions,
|
||||
"verification-request-antecedents-present",
|
||||
content.contains("[antecedents]")
|
||||
&& content.contains("substrate_gate_required = true")
|
||||
&& content.contains("hands_intent_required = true")
|
||||
&& content.contains("hands_review_required = true")
|
||||
&& content.contains("hands_patch_required = true")
|
||||
&& content.contains("hands_command_required = true")
|
||||
&& content.contains("hands_commit_required = true")
|
||||
&& content.contains("work_order_required = true"),
|
||||
request
|
||||
.as_ref()
|
||||
.is_some_and(RepoVerificationRequest::has_antecedent_contract),
|
||||
"Committed verification request requires Substrate and Hands antecedents."
|
||||
.to_string(),
|
||||
);
|
||||
push_assertion(
|
||||
&mut assertions,
|
||||
"verification-request-receipt-contract",
|
||||
content.contains("[required_receipts]")
|
||||
&& content.contains("hands_patch = \"epiphany.hands.patch_receipt\"")
|
||||
&& content.contains("hands_command = \"epiphany.hands.command_receipt\"")
|
||||
&& content.contains("hands_commit = \"epiphany.hands.commit_receipt\"")
|
||||
&& content.contains("soul_verdict = \"epiphany.soul.verification_verdict\"")
|
||||
&& content
|
||||
.contains("closure_review = \"epiphany.repo_work_closure_review.v0\"")
|
||||
&& content.contains("mind_review = \"epiphany.mind.gateway_review\"")
|
||||
&& content.contains("mind_commit = \"epiphany.mind.state_commit_receipt\""),
|
||||
request
|
||||
.as_ref()
|
||||
.is_some_and(RepoVerificationRequest::has_receipt_contract),
|
||||
"Committed verification request names Hands/Soul/closure/Mind receipt chain."
|
||||
.to_string(),
|
||||
);
|
||||
push_assertion(
|
||||
&mut assertions,
|
||||
"verification-request-checks-present",
|
||||
content.contains("[checks]")
|
||||
&& content.contains("\"declared-paths-match-commit\"")
|
||||
&& content.contains("\"hands-receipts-present\"")
|
||||
&& content.contains("\"visible-diff-supports-summary\"")
|
||||
&& content.contains("\"no-private-state-exposure\"")
|
||||
&& content.contains("\"publication-remains-gated\"")
|
||||
&& content.contains("failure_blocks_mind_admission = true"),
|
||||
request
|
||||
.as_ref()
|
||||
.is_some_and(RepoVerificationRequest::has_check_contract),
|
||||
"Committed verification request names the closure checks that Soul should run."
|
||||
.to_string(),
|
||||
);
|
||||
push_assertion(
|
||||
&mut assertions,
|
||||
"verification-request-authority-seals",
|
||||
content.contains("[authority]")
|
||||
&& content.contains("soul_verdict_authorized = false")
|
||||
&& content.contains("state_commit_authorized = false")
|
||||
&& content.contains("hands_action_authorized = false")
|
||||
&& content.contains("rerun_authorized = false")
|
||||
&& content.contains("publication_authorized = false")
|
||||
&& content.contains("cross_body_mutation_authorized = false")
|
||||
&& content.contains("bifrost_publication_required = true"),
|
||||
request.as_ref().is_some_and(RepoVerificationRequest::has_authority_seals),
|
||||
"Committed verification request denies verdict/state/action/rerun/publication/cross-body authority."
|
||||
.to_string(),
|
||||
);
|
||||
push_assertion(
|
||||
&mut assertions,
|
||||
"verification-request-private-seal",
|
||||
content.contains("private_state_exposed = false"),
|
||||
request
|
||||
.as_ref()
|
||||
.is_some_and(|request| !request.private_state_exposed),
|
||||
"Committed verification request preserves the private-state seal.".to_string(),
|
||||
);
|
||||
}
|
||||
|
|
@ -15395,6 +15380,7 @@ idunn_deployment_authority_required = true
|
|||
"repo.sync_request",
|
||||
"repo.pr_request",
|
||||
"repo.maintainer_review_request",
|
||||
"repo.verification_request",
|
||||
"repo.credit_request",
|
||||
"repo.artifact_acceptance_request",
|
||||
"repo.metrics_request",
|
||||
|
|
|
|||
|
|
@ -704,4 +704,21 @@ pub(super) fn has_authority_seals(&self)->bool{let a=&self.authority;a.branch_lo
|
|||
#[derive(Debug,Deserialize)]struct RepoMaintainerReviewAuthority{branch_local_only:bool,maintainer_approval_authorized:bool,merge_authorized:bool,push_authorized:bool,publication_authorized:bool,upstream_sync_authorized:bool,hands_action_authorized:bool,service_lifecycle_authority:bool,cross_body_mutation_authorized:bool,private_verse_rummaging:bool,human_or_maintainer_response_required:bool}
|
||||
pub(super) fn parse_repo_maintainer_review_request(text:&str)->Result<RepoMaintainerReviewRequest>{toml::from_str(text).context("maintainer review request is not valid typed TOML")}
|
||||
|
||||
#[derive(Debug,Deserialize)]
|
||||
pub(super) struct RepoVerificationRequest{pub(super)schema_version:String,pub(super)safe_action_family:String,pub(super)summary:String,pub(super)private_state_exposed:bool,request:RepoVerificationBody,antecedents:RepoVerificationAntecedents,required_receipts:RepoVerificationReceipts,checks:RepoVerificationChecks,authority:RepoVerificationAuthority}
|
||||
impl RepoVerificationRequest{
|
||||
pub(super)fn has_canonical_identity(&self)->bool{self.schema_version=="epiphany.repo_verification_request.v0"&&self.safe_action_family=="repo.verification_request"}
|
||||
pub(super)fn awaits_soul_review(&self)->bool{let r=&self.request;r.status=="awaiting-soul-review"&&r.requested_owner=="Soul"&&r.requested_effect=="verify-branch-local-hands-work"&&!r.work_order_ref.is_empty()}
|
||||
pub(super)fn has_antecedent_contract(&self)->bool{let a=&self.antecedents;a.substrate_gate_required&&a.hands_intent_required&&a.hands_review_required&&a.hands_patch_required&&a.hands_command_required&&a.hands_commit_required&&a.work_order_required}
|
||||
pub(super)fn has_receipt_contract(&self)->bool{let r=&self.required_receipts;r.hands_patch=="epiphany.hands.patch_receipt"&&r.hands_command=="epiphany.hands.command_receipt"&&r.hands_commit=="epiphany.hands.commit_receipt"&&r.soul_verdict=="epiphany.soul.verification_verdict"&&r.closure_review=="epiphany.repo_work_closure_review.v0"&&r.mind_review=="epiphany.mind.gateway_review"&&r.mind_commit=="epiphany.mind.state_commit_receipt"}
|
||||
pub(super)fn has_check_contract(&self)->bool{self.checks.required==["declared-paths-match-commit","hands-receipts-present","visible-diff-supports-summary","no-private-state-exposure","publication-remains-gated"]&&self.checks.model_verdict_allowed&&self.checks.failure_blocks_mind_admission}
|
||||
pub(super)fn has_authority_seals(&self)->bool{let a=&self.authority;a.branch_local_only&&!a.soul_verdict_authorized&&!a.state_commit_authorized&&!a.hands_action_authorized&&!a.rerun_authorized&&!a.publication_authorized&&!a.merge_authorized&&!a.service_lifecycle_authority&&!a.cross_body_mutation_authorized&&!a.private_verse_rummaging&&a.bifrost_publication_required}
|
||||
}
|
||||
#[derive(Debug,Deserialize)]struct RepoVerificationBody{status:String,requested_owner:String,requested_effect:String,work_order_ref:String}
|
||||
#[derive(Debug,Deserialize)]struct RepoVerificationAntecedents{substrate_gate_required:bool,hands_intent_required:bool,hands_review_required:bool,hands_patch_required:bool,hands_command_required:bool,hands_commit_required:bool,work_order_required:bool}
|
||||
#[derive(Debug,Deserialize)]struct RepoVerificationReceipts{hands_patch:String,hands_command:String,hands_commit:String,soul_verdict:String,closure_review:String,mind_review:String,mind_commit:String}
|
||||
#[derive(Debug,Deserialize)]struct RepoVerificationChecks{required:Vec<String>,model_verdict_allowed:bool,failure_blocks_mind_admission:bool}
|
||||
#[derive(Debug,Deserialize)]struct RepoVerificationAuthority{branch_local_only:bool,soul_verdict_authorized:bool,state_commit_authorized:bool,hands_action_authorized:bool,rerun_authorized:bool,publication_authorized:bool,merge_authorized:bool,service_lifecycle_authority:bool,cross_body_mutation_authorized:bool,private_verse_rummaging:bool,bifrost_publication_required:bool}
|
||||
pub(super)fn parse_repo_verification_request(text:&str)->Result<RepoVerificationRequest>{toml::from_str(text).context("verification request is not valid typed TOML")}
|
||||
|
||||
include!("external_governance_tests.rs");
|
||||
|
|
|
|||
Reference in a new issue