feat(bap): classify crash-recovery side-effect outcomes - #214
Draft
seonghobae wants to merge 26 commits into
Draft
feat(bap): classify crash-recovery side-effect outcomes#214seonghobae wants to merge 26 commits into
seonghobae wants to merge 26 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Bounded partial implementation of #200, stacked on canonical BAP idempotency owner PR #211. This Draft makes crash-recovery side-effect ambiguity explicit, binds every classification to the exact accepted command receipt and a canonical SHA-256 recovery-evidence identity, and keeps redispatch eligibility fail closed. It does not authenticate recovery evidence, prove that an external side effect occurred, provide durable deduplication, persist evidence, or grant tenant, policy, destination, secret, browser, approval, dispatch, or release authority.
Recovery contract
BapExternalSideEffectOutcomedistinguishesConfirmedNoSideEffect,ConfirmedSideEffect,UnknownOutcome, andReconciliationRequired.BapCommandRecoveryretains the exact immutableBapCommandReceipt, the external side-effect classification, and a validatedBapRecoveryEvidenceDigestin exactsha256:+ 64-lowercase-hex form. The digest identifies the durable evidence object supporting the classification; possession of that identity does not authenticate the evidence, prove the classification, or authorize retry.permits_redispatch()first validates the receipt against the lifecycle's exact latest accepted transition. Stale, foreign, state-only restored, or divergent-history receipts fail closed through the typed receipt contract. Terminal lifecycle states returnOk(false)even forConfirmedNoSideEffect. An exact receipt whose accepted lifecycle state isReconciliationRequiredalso returnsOk(false): an explicit reconciliation hold cannot be bypassed merely because later recovery evidence classifies the interrupted external operation as having caused no side effect. Resolving the hold is a separate lifecycle transition, which makes the retained hold receipt stale for subsequent replay. AnyOk(true)remains only an eligibility signal requiring independent evidence authentication and complete current-authority revalidation before dispatch.Test-first repair lineage
Earlier stale-receipt, terminal-state, and recovery-evidence binding RED/repair heads on this canonical branch remain historical regression lineage only.
The current run reproduced a further recovery-integrity defect on exact head
be3186e1a016275fbf67c7a3da278b11d73a6b87: after an acceptedRequireReconciliationtransition,ConfirmedNoSideEffectcould still makepermits_redispatch()return true becauseReconciliationRequiredis intentionally non-terminal. The realistic regressionreconciliation_hold_never_signals_redispatch_before_explicit_resolutionfailed in CI run32909362190, Rust contracts job98000207386, at the test boundary after compilation/formatting had succeeded.The smallest production repair keeps an exact
ReconciliationRequiredlifecycle non-replayable while preserving typed stale/foreign receipt errors and all existing terminal-state behavior. The repaired exact head is8a3463bdb224f1c1226811f88c3d6f3a15d96f8f.The current stack remains based directly on live #211 head
6ce74587dcfeede71ad6ceea94fe5c72dc0f244a; fresh comparison reports merge base exactly #211, 26 commits ahead / 0 behind. No parent/predecessor evidence transfers.Exact-current verification
On unchanged exact head
8a3463bdb224f1c1226811f88c3d6f3a15d96f8fagainst exact live base6ce74587dcfeede71ad6ceea94fe5c72dc0f244a:main:b05d5acca82b9d916ada2c8e82f59f92a89817e1;32909622402/ Rust contracts job98001004079: success, including repository contracts, formatting, workspace check, tests, Clippy, and public API documentation;32909622402/ Production coverage job98001003929: success;9586099099, digestsha256:8862dd2cfa54ae3fc56f996dfe505dd790fe9c03ddc0ce777f273bd99e3e2c9f;Same-head SAST, Security Scan, Manifest V3, Noema, Strix, Dependabot, and any other absent gate are not claimed. Historical predecessor checks/reviews/statuses/comments/model output are not promoted to this head.
Stack / authority
This PR remains Draft while #211/#208 remain active. Parent/predecessor checks and reviews do not transfer to this child. Protected-main
AGENTS.mdremains authoritative: this scheduled writer does not merge, self-approve, force-push, destructively rebase, alter workflows/rulesets/secrets, tag, release, or publish.