WS-ART-001-02C3: add artifact recovery attempt chain#174
Merged
abiorh-claw merged 10 commits intoJul 22, 2026
Conversation
…-recovery-attempt-idempotency
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughIntroduces immutable recovery-attempt storage, verification retry lineage, authorization-bound recovery creation, idempotent replay, terminal recovery updates, audit events, migration safeguards, and PostgreSQL-backed integration tests. ChangesArtifact recovery and retry lineage
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant ArtifactRecoveryService
participant ArtifactRepository
participant PostgreSQL
participant VerificationService
Caller->>ArtifactRecoveryService: submit recovery request
ArtifactRecoveryService->>ArtifactRepository: lock source and recovery rows
ArtifactRepository->>PostgreSQL: create or replay recovery attempt
ArtifactRecoveryService->>PostgreSQL: persist retry job and initiation audit
VerificationService->>ArtifactRecoveryService: report retry terminal outcome
ArtifactRecoveryService->>PostgreSQL: persist completion audit and terminal state
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks 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 |
abiorh-claw
self-requested a review
July 22, 2026 02:06
abiorh-claw
approved these changes
Jul 22, 2026
abiorh-claw
deleted the
codex/ws-art-001-02c3-recovery-attempt-idempotency
branch
July 22, 2026 02:30
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.
PR Trust Bundle: WS-ART-001-02C3
Chunk
WS-ART-001-02C3— Recovery Attempt And Idempotency Chain (L1)Goal And Human-Approved Intent
Add the durable, read-only provider-observation recovery envelope and exact
source-job to retry-job chain. The signed loop-memory start authorized this ART
chunk to run concurrently with AUTH; it does not activate Operator routes.
What Changed And Why
0032for recovery envelopes and immutable verificationlineage;
artifacts;
linear retry ancestry, and atomic terminal finalization;
denies until the later AUTH-owned activation;
replay, with bounded authorization evidence in the initiation audit;
terminal-outcome tests.
Design And Alternatives
The verification job remains the sole executable lease owner. Recovery is an
envelope, not a second worker lease. PostgreSQL uniqueness and custody triggers
enforce one lifetime source owner and immediate-parent chaining. Provider
mutation replay and a task-only recovery abstraction were rejected because
both violate the initiative contract.
Scope And Product Behavior
No routes, provider mutation, guide/task/submission lifecycle transitions,
review decisions, payment, reputation, dependencies, CI workflow changes, or
coverage reductions are included. Recovery remains infrastructure state and
does not introduce product decisions beyond
accept,needs_revision, andreject.Acceptance Evidence
audit;
provider_unavailablework is recoverable;the verification transaction;
Tests And CI Integrity
Local focused evidence:
ruff check app tests alembic/versions/0032_artifact_recovery_attempts.py;authority drift, and sampled failed outcome;
python3 scripts/check_stale_artifact_contracts.py;python3 scripts/test_agent_gates.py— 89 passed;git diff --check.The expensive full backend suite, remaining parameter combinations, global
78% coverage, and cumulative artifact 90% coverage are intentionally delegated
to the existing sharded GitHub Actions. No CI or package-script file changed.
No tests were removed, skipped, or weakened.
Reviewer Results
External review and hosted CI are pending publication of the PR.
Remaining Risks And Follow-Up
Low risks: legacy terminal audit metadata describes the verifier imperfectly,
the audit builder has private cross-class ownership, and human-proof validation
has small domain-specific duplication. The later typed Operator audit surface
may clean these up. Successor
WS-ART-001-02Downs Operator routes and real AUTHactivation; it must not start automatically before this chunk merges and the
signed successor event is approved.
Human Review Focus And Merge Ownership
Verify that no source can own two recoveries, no replay can bypass fresh
authority, and recovery stays separate from provider mutation and product
lifecycle state. A human owns the merge decision; Codex must not merge without
explicit approval for this PR.
Summary by CodeRabbit
New Features
Bug Fixes
Tests