Execute basis-bound workspace patches - #712
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@coderabbitai review |
|
@codex please review |
✅ Action performedReview finished.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 21 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughEcho now consumes independently verified Edict patch requests through a capability-rooted adapter that validates paths, bases, identities, budgets, and filesystem types before atomic replacement. It durably settles outcomes and reconciles retries by observing postconditions without reapplying writes. ChangesValidated workspace patch execution
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Edict
participant ExternalActionCoordinatorV1
participant ValidatedWorkspacePatchAdapterV1
participant WorkspaceFilesystem
Edict->>ExternalActionCoordinatorV1: submit admitted patch request
ExternalActionCoordinatorV1->>ValidatedWorkspacePatchAdapterV1: provide claim grant
ValidatedWorkspacePatchAdapterV1->>WorkspaceFilesystem: validate basis and replace target atomically
WorkspaceFilesystem-->>ValidatedWorkspacePatchAdapterV1: resulting basis and content identities
ValidatedWorkspacePatchAdapterV1->>ExternalActionCoordinatorV1: admit terminal settlement
ExternalActionCoordinatorV1-->>Edict: durable settlement
Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
There was a problem hiding this comment.
Actionable comments posted: 10
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/warp-core/src/external_action_adapter.rs`:
- Line 52: The request-only settlement floor lacks an enforced relationship with
the canonical pathless obstruction settlement encoding. Add a test near the
external-action adapter logic that builds the worst-case pathless obstruction
settlement through validated_workspace_patch::build_candidate and asserts its
encoded size is at most MIN_REQUEST_ONLY_SETTLEMENT_BYTES_V1; add a concise
comment above that constant documenting this dependency.
- Around line 207-212: Update the operation-profile validation in
verify_target_derivation to reject COMPATIBILITY_READ_ONLY_REQUEST_PROFILE when
the core or intent requires EXTERNAL_REQUEST_OPERATION_PROFILE/request-only
semantics. Allow the compatibility profile only when the relevant artifact
configuration explicitly permits it, while preserving existing acceptance for
canonical request-only profiles and the ArtifactShape error for disallowed
values.
In `@crates/warp-core/src/validated_workspace_patch.rs`:
- Around line 449-467: In the reconciliation success branch around
validated_workspace_patch_basis_v1, stop recording input.expected_content_digest
as witnessed before_content_digest and emit None because the pre-state was not
observed. Update validate_candidate to allow a missing before_content_digest for
reconciled Succeeded settlements while preserving the requirement for applied
successes.
- Around line 154-229: Update the module documentation near the top of
validated_workspace_patch.rs to state that the adapter guarantees no write when
the observed basis is already stale, but does not guarantee serializability
against concurrent external writers during the check-then-rename window. Clarify
that before_content_digest reflects the earlier observation and should not be
interpreted as proof that no intermediate write occurred.
- Around line 316-341: Update the obstruction method’s observed branch so the
basis hash is wrapped or mixed through the PATCH_EXTERNAL_EVIDENCE_DOMAIN before
assigning it to SettlementEvidenceV1.evidence, while preserving the existing
external_evidence(code, path) behavior when observed is absent. Apply the same
domain separation to the corresponding obstruction construction at the
additional location.
- Around line 723-738: The non-success admission branch currently accepts
arbitrary non-empty values for `evidence.obstruction`; update the validation
around `ValidatedWorkspacePatchErrorV1::SchemaAdmissionFailed` to require an
explicit allowlist of the obstruction codes produced by this module, rejecting
unknown values while preserving the existing path and evidence-field rules.
- Around line 1115-1121: Update reconciliation for the relevant attempt to
remove its deterministic staging artifact generated by temporary_name, including
artifacts left after a process crash between stage_replacement and rename.
Perform targeted cleanup using the attempt_id-derived name only, without
sweeping unrelated workspace files, while preserving normal replacement
behavior.
In `@crates/warp-core/tests/bounded_workspace_patch_tests.rs`:
- Around line 599-632: Add focused tests for the validate_candidate settlement
boundary through admit_settlement, covering tampered attempt_id, Succeeded
evidence paths outside permitted_paths, a zero external_evidence_digest, and a
recomputed schema_admission_evidence_digest. Assert each candidate is rejected
with the corresponding validation error and that workspace state remains
unchanged, using the existing setup helpers and symbols in the bounded workspace
patch tests.
- Around line 488-551: Extend stale_basis_and_path_policy_refuse_before_mutation
to verify cleanup of the staged workspace artifact after each rejected
adapter.apply call. Use the same staged-name construction or helper used by the
success test, and assert the corresponding path under root.path() does not
exist; ensure the assertions cover the stale pre-rename and failed-rename
rejection paths without changing the existing content and obstruction checks.
In `@crates/warp-core/tests/fixtures/external_action_patch/SOURCE.md`:
- Around line 6-16: Update SOURCE.md to document the provenance of
apply-validated-patch.core.sha256 and apply-validated-patch.target-ir.sha256,
including whether Edict supplies them or Echo computes them and whether cargo
xtask lawpack-goldens --write regenerates them. Define the expected refresh
procedure for these digest fixtures alongside the existing .cbor artifact
provenance.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: edb93e1d-6a98-474a-a00b-baf5c6edb612
📒 Files selected for processing (13)
CHANGELOG.mdREADME.mdcrates/warp-core/src/external_action_adapter.rscrates/warp-core/src/lib.rscrates/warp-core/src/validated_workspace_patch.rscrates/warp-core/tests/bounded_workspace_patch_tests.rscrates/warp-core/tests/fixtures/external_action_patch/SOURCE.mdcrates/warp-core/tests/fixtures/external_action_patch/apply-validated-patch.core.cborcrates/warp-core/tests/fixtures/external_action_patch/apply-validated-patch.core.sha256crates/warp-core/tests/fixtures/external_action_patch/apply-validated-patch.target-ir.cborcrates/warp-core/tests/fixtures/external_action_patch/apply-validated-patch.target-ir.sha256docs/adr/0026-durable-external-action-settlement.mddocs/topics/ExternalActions.md
|
Merge gate at ce21333:
Administrative merge authority will be used only to satisfy that metadata gate; no technical gate is bypassed. |
Admit, execute, settle, reconcile, recover, and replay compiler-authored validated workspace patches through an exact capability-rooted aperture.
Closes #711.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation