Delete producerless Hands PR receipts
This commit is contained in:
parent
d6340f2a0d
commit
11d99de10a
4 changed files with 15 additions and 111 deletions
|
|
@ -7,7 +7,6 @@ pub const HANDS_ACTION_REVIEW_TYPE: &str = "epiphany.hands.action_review";
|
|||
pub const HANDS_COMMAND_RECEIPT_TYPE: &str = "epiphany.hands.command_receipt";
|
||||
pub const HANDS_PATCH_RECEIPT_TYPE: &str = "epiphany.hands.patch_receipt";
|
||||
pub const HANDS_COMMIT_RECEIPT_TYPE: &str = "epiphany.hands.commit_receipt";
|
||||
pub const HANDS_PR_RECEIPT_TYPE: &str = "epiphany.hands.pr_receipt";
|
||||
pub const HANDS_ROLLBACK_RECEIPT_TYPE: &str = "epiphany.hands.rollback_receipt";
|
||||
pub const HANDS_ACTION_REFUSAL_RECEIPT_TYPE: &str = "epiphany.hands.action_refusal_receipt";
|
||||
pub const HANDS_ACTION_INTENT_SCHEMA_VERSION: &str = "epiphany.hands.action_intent.v1";
|
||||
|
|
@ -15,7 +14,6 @@ pub const HANDS_ACTION_REVIEW_SCHEMA_VERSION: &str = "epiphany.hands.action_revi
|
|||
pub const HANDS_COMMAND_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.command_receipt.v0";
|
||||
pub const HANDS_PATCH_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.patch_receipt.v0";
|
||||
pub const HANDS_COMMIT_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.commit_receipt.v0";
|
||||
pub const HANDS_PR_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.pr_receipt.v0";
|
||||
pub const HANDS_ROLLBACK_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.rollback_receipt.v0";
|
||||
pub const HANDS_ACTION_REFUSAL_RECEIPT_SCHEMA_VERSION: &str =
|
||||
"epiphany.hands.action_refusal_receipt.v1";
|
||||
|
|
@ -201,43 +199,6 @@ pub struct HandsCommitReceipt {
|
|||
pub contract: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(type = "epiphany.hands.pr_receipt", schema = "HandsPrReceipt")]
|
||||
pub struct HandsPrReceipt {
|
||||
#[cultcache(key = 0)]
|
||||
pub schema_version: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub receipt_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub intent_id: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub review_id: String,
|
||||
#[cultcache(key = 4)]
|
||||
pub runtime_job_id: String,
|
||||
#[cultcache(key = 5)]
|
||||
pub commit_receipt_id: String,
|
||||
#[cultcache(key = 6)]
|
||||
pub commit_sha: String,
|
||||
#[cultcache(key = 7)]
|
||||
pub branch: String,
|
||||
#[cultcache(key = 8)]
|
||||
pub pull_request_url: String,
|
||||
#[cultcache(key = 9)]
|
||||
pub pull_request_number: String,
|
||||
#[cultcache(key = 10)]
|
||||
pub pull_request_title: String,
|
||||
#[cultcache(key = 11)]
|
||||
pub changed_paths: Vec<String>,
|
||||
#[cultcache(key = 12)]
|
||||
pub bifrost_publication_receipt_id: String,
|
||||
#[cultcache(key = 13)]
|
||||
pub summary: String,
|
||||
#[cultcache(key = 14)]
|
||||
pub emitted_at: String,
|
||||
#[cultcache(key = 15)]
|
||||
pub contract: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct HandsCultNetContract {
|
||||
|
|
@ -271,12 +232,11 @@ pub fn default_hands_cultnet_contracts() -> Vec<HandsCultNetContract> {
|
|||
HANDS_COMMAND_RECEIPT_TYPE.to_string(),
|
||||
HANDS_PATCH_RECEIPT_TYPE.to_string(),
|
||||
HANDS_COMMIT_RECEIPT_TYPE.to_string(),
|
||||
HANDS_PR_RECEIPT_TYPE.to_string(),
|
||||
HANDS_ROLLBACK_RECEIPT_TYPE.to_string(),
|
||||
HANDS_ACTION_REFUSAL_RECEIPT_TYPE.to_string(),
|
||||
],
|
||||
notes: vec![
|
||||
"Hands is the action organ: commands, patches, commits, PRs, and rollbacks enter here as bounded action intents.".to_string(),
|
||||
"Hands is the action organ: commands, patches, commits, and rollbacks enter here as bounded action intents.".to_string(),
|
||||
"Hands does not grant repo access; Substrate Gate grants substrate access before Hands mutates, and Soul verifies the result after.".to_string(),
|
||||
],
|
||||
},
|
||||
|
|
@ -320,16 +280,16 @@ pub fn default_hands_cultnet_contracts() -> Vec<HandsCultNetContract> {
|
|||
],
|
||||
},
|
||||
HandsCultNetContract {
|
||||
contract_id: "epiphany.hands.commit_and_pr.receipts".to_string(),
|
||||
contract_id: "epiphany.hands.commit.receipts".to_string(),
|
||||
verse_id: "epiphany-internal".to_string(),
|
||||
document_type: HANDS_COMMIT_RECEIPT_TYPE.to_string(),
|
||||
payload_schema_version: HANDS_COMMIT_RECEIPT_SCHEMA_VERSION.to_string(),
|
||||
authority: "readOnly".to_string(),
|
||||
operations: vec!["snapshot".to_string(), "receiptWatch".to_string()],
|
||||
intent_document_types: Vec::new(),
|
||||
receipt_document_types: vec![HANDS_PR_RECEIPT_TYPE.to_string()],
|
||||
receipt_document_types: Vec::new(),
|
||||
notes: vec![
|
||||
"Commit and PR receipts preserve publication consequences after Soul verification and operator policy allow them.".to_string(),
|
||||
"Commit receipts preserve repository consequences after Soul verification and operator policy allow them.".to_string(),
|
||||
],
|
||||
},
|
||||
HandsCultNetContract {
|
||||
|
|
@ -441,6 +401,6 @@ pub fn hands_commit_receipt_for_review(
|
|||
changed_paths,
|
||||
summary,
|
||||
emitted_at,
|
||||
contract: "Hands commit receipt proves source publication consequences after a reviewed action; it is still subject to Soul verification and Mind admission.".to_string(),
|
||||
contract: "Hands commit receipt proves a repository commit consequence after a reviewed action; it is still subject to Soul verification and Mind admission.".to_string(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -505,8 +505,6 @@ pub use runtime_spine::put_hands_action_review;
|
|||
pub use runtime_spine::put_hands_command_receipt;
|
||||
pub use runtime_spine::put_hands_commit_receipt;
|
||||
pub use runtime_spine::put_hands_patch_receipt;
|
||||
#[cfg(test)]
|
||||
pub use runtime_spine::put_hands_pr_receipt;
|
||||
pub use runtime_spine::put_repo_frontier_hands_authority;
|
||||
pub use runtime_spine::put_repo_frontier_verification_request;
|
||||
pub use runtime_spine::put_repo_frontier_work_proposal;
|
||||
|
|
@ -534,7 +532,6 @@ pub use runtime_spine::runtime_hands_action_review;
|
|||
pub use runtime_spine::runtime_hands_command_receipt;
|
||||
pub use runtime_spine::runtime_hands_commit_receipt;
|
||||
pub use runtime_spine::runtime_hands_patch_receipt;
|
||||
pub use runtime_spine::runtime_hands_pr_receipt;
|
||||
pub use runtime_spine::runtime_hands_receipt_chain_after;
|
||||
pub use runtime_spine::runtime_hands_receipt_chain_matches_current_model;
|
||||
pub use runtime_spine::runtime_has_actionable_eyes_frontier;
|
||||
|
|
|
|||
|
|
@ -1137,7 +1137,6 @@ pub fn runtime_spine_cache(store_path: impl AsRef<Path>) -> Result<CultCache> {
|
|||
cache.register_entry_type::<HandsPatchReceipt>()?;
|
||||
cache.register_entry_type::<HandsCommandReceipt>()?;
|
||||
cache.register_entry_type::<HandsCommitReceipt>()?;
|
||||
cache.register_entry_type::<HandsPrReceipt>()?;
|
||||
cache.register_entry_type::<SoulVerdictReceipt>()?;
|
||||
cache.register_entry_type::<ContinuityRecoveryReceipt>()?;
|
||||
cache.register_entry_type::<EpiphanyOpenAiAdapterStatus>()?;
|
||||
|
|
@ -9888,10 +9887,6 @@ pub fn relinquish_repo_frontier_hands_route(
|
|||
.get_all::<HandsCommitReceipt>()?
|
||||
.iter()
|
||||
.any(|receipt| receipt.intent_id == intent_id)
|
||||
|| cache
|
||||
.get_all::<HandsPrReceipt>()?
|
||||
.iter()
|
||||
.any(|receipt| receipt.intent_id == intent_id)
|
||||
{
|
||||
return Err(anyhow!("Hands cannot relinquish after consequences exist"));
|
||||
}
|
||||
|
|
@ -10960,44 +10955,6 @@ pub fn runtime_hands_commit_receipt(
|
|||
cache.get::<HandsCommitReceipt>(receipt_id)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn put_hands_pr_receipt(store_path: impl AsRef<Path>, receipt: &HandsPrReceipt) -> Result<()> {
|
||||
validate_non_empty(&receipt.receipt_id, "Hands PR receipt id")?;
|
||||
validate_non_empty(&receipt.intent_id, "Hands PR intent")?;
|
||||
validate_non_empty(&receipt.review_id, "Hands PR review")?;
|
||||
validate_non_empty(&receipt.runtime_job_id, "Hands PR runtime job")?;
|
||||
validate_non_empty(&receipt.commit_receipt_id, "Hands PR commit receipt")?;
|
||||
validate_non_empty(&receipt.commit_sha, "Hands PR commit sha")?;
|
||||
validate_non_empty(&receipt.branch, "Hands PR branch")?;
|
||||
validate_non_empty(&receipt.pull_request_url, "Hands PR url")?;
|
||||
validate_non_empty(&receipt.pull_request_number, "Hands PR number")?;
|
||||
validate_non_empty(&receipt.pull_request_title, "Hands PR title")?;
|
||||
validate_non_empty(
|
||||
&receipt.bifrost_publication_receipt_id,
|
||||
"Hands PR Bifrost publication receipt",
|
||||
)?;
|
||||
validate_non_empty(&receipt.summary, "Hands PR summary")?;
|
||||
validate_non_empty(&receipt.emitted_at, "Hands PR timestamp")?;
|
||||
if receipt.changed_paths.is_empty() {
|
||||
return Err(anyhow!("Hands PR receipt must name changed paths"));
|
||||
}
|
||||
let mut cache = runtime_spine_cache(store_path)?;
|
||||
cache.pull_all_backing_stores()?;
|
||||
require_identity(&cache)?;
|
||||
cache.put(&receipt.receipt_id, receipt)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn runtime_hands_pr_receipt(
|
||||
store_path: impl AsRef<Path>,
|
||||
receipt_id: &str,
|
||||
) -> Result<Option<HandsPrReceipt>> {
|
||||
validate_non_empty(receipt_id, "Hands PR receipt id")?;
|
||||
let mut cache = runtime_spine_cache(store_path)?;
|
||||
cache.pull_all_backing_stores()?;
|
||||
cache.get::<HandsPrReceipt>(receipt_id)
|
||||
}
|
||||
|
||||
pub fn runtime_hands_receipt_chain_after(
|
||||
store_path: impl AsRef<Path>,
|
||||
after_timestamp: &str,
|
||||
|
|
@ -13466,12 +13423,11 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
|
|||
HANDS_COMMAND_RECEIPT_TYPE,
|
||||
HANDS_PATCH_RECEIPT_TYPE,
|
||||
HANDS_COMMIT_RECEIPT_TYPE,
|
||||
HANDS_PR_RECEIPT_TYPE,
|
||||
HANDS_ROLLBACK_RECEIPT_TYPE,
|
||||
HANDS_ACTION_REFUSAL_RECEIPT_TYPE,
|
||||
],
|
||||
vec![
|
||||
"Hands is the action organ: commands, patches, commits, PRs, and rollbacks enter as bounded action intents.",
|
||||
"Hands is the action organ: commands, patches, commits, and rollbacks enter as bounded action intents.",
|
||||
"Substrate Gate grants substrate access before Hands mutates; Soul verifies consequences after.",
|
||||
],
|
||||
),
|
||||
|
|
@ -13520,20 +13476,8 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
|
|||
],
|
||||
CultNetMutationAuthority::ReadOnly,
|
||||
vec![],
|
||||
vec![HANDS_PR_RECEIPT_TYPE],
|
||||
vec!["Commit receipts preserve publication consequences after verification."],
|
||||
),
|
||||
mutation_contract(
|
||||
HANDS_PR_RECEIPT_TYPE,
|
||||
HANDS_PR_RECEIPT_SCHEMA_VERSION,
|
||||
vec![
|
||||
CultNetDocumentOperation::Snapshot,
|
||||
CultNetDocumentOperation::ReceiptWatch,
|
||||
],
|
||||
CultNetMutationAuthority::ReadOnly,
|
||||
vec![],
|
||||
vec![],
|
||||
vec!["PR receipts preserve outward publication consequences for operator review."],
|
||||
vec!["Commit receipts preserve repository consequences after verification."],
|
||||
),
|
||||
mutation_contract(
|
||||
HANDS_ROLLBACK_RECEIPT_TYPE,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Hands CultNet Contracts
|
||||
|
||||
Objective: make Hands the action organ. Commands, patches, commits, PRs, and
|
||||
Objective: make Hands the action organ. Commands, patches, commits, and
|
||||
rollbacks are consequences, not thoughts. They enter as bounded action intents
|
||||
and leave receipts that can be verified, refused, or admitted into Mind state.
|
||||
|
||||
|
|
@ -11,14 +11,14 @@ and leave receipts that can be verified, refused, or admitted into Mind state.
|
|||
patches, current repo policy, Soul verification requirements, and coordinator
|
||||
authority.
|
||||
- Outputs: Hands action reviews, command receipts, patch receipts, commit
|
||||
receipts, PR receipts, rollback receipts, and action refusal receipts.
|
||||
- Derived state: diffs, command logs, commits, PR URLs, and rollback notes are
|
||||
receipts, rollback receipts, and action refusal receipts.
|
||||
- Derived state: diffs, command logs, commits, and rollback notes are
|
||||
action receipts. They are not durable Mind state until Mind admits them.
|
||||
- Forbidden writers: raw workers, Persona, Eyes, Imagination, Self, compatibility
|
||||
JSON-RPC routes, and bridge tools must not execute repo-affecting commands,
|
||||
edit files, commit, publish, or roll back without the Hands path after Body
|
||||
access.
|
||||
- Shared path: file edits, shell commands, commits, PRs, and rollbacks should
|
||||
- Shared path: file edits, shell commands, commits, and rollbacks should
|
||||
share Hands action intent/review/receipt semantics.
|
||||
- Deletion line: Substrate Gate grants access; it does not execute. Soul verifies; it
|
||||
does not execute. Mind records durable state; it does not execute.
|
||||
|
|
@ -30,7 +30,6 @@ and leave receipts that can be verified, refused, or admitted into Mind state.
|
|||
- `epiphany.hands.command_receipt`: proof of command execution.
|
||||
- `epiphany.hands.patch_receipt`: proof of file mutation.
|
||||
- `epiphany.hands.commit_receipt`: proof of commit creation.
|
||||
- `epiphany.hands.pr_receipt`: proof of pull-request publication.
|
||||
- `epiphany.hands.rollback_receipt`: proof that failed action was unwound.
|
||||
- `epiphany.hands.action_refusal_receipt`: proof that Hands refused to act.
|
||||
|
||||
|
|
@ -43,6 +42,10 @@ Mind admits durable state after the action and verification receipts exist.
|
|||
Hands is not a permission organ. It is the actuator. The wrench does not bless
|
||||
itself.
|
||||
|
||||
Pull-request or other remote publication is not an Epiphany-owned Hands receipt.
|
||||
The remote provider/Bifrost crossing owns its exact publication evidence;
|
||||
Epiphany may consume that provider-owned receipt after the local commit exists.
|
||||
|
||||
## Executable Slice
|
||||
|
||||
The first runtime-spine proof chain now exists:
|
||||
|
|
|
|||
Reference in a new issue