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 |
| unless no_backend_evidence | ||
| return blocked_result( | ||
| "typed no-backend coordination evidence is absent or invalid", | ||
| source_input: input | ||
| ) | ||
| end | ||
|
|
||
| authenticated_status = coordination_verifier&.call(backend:, batch_id:) | ||
| unless authenticated_status.is_a?(Hash) | ||
| return blocked_result(COORDINATION_BACKEND_ACTIVATION_BLOCKER, source_input: input) | ||
| end |
There was a problem hiding this comment.
These two early return blocked_result(...) calls break the fail-closed-with-full-detail pattern used everywhere else in assess. Every other failure path (invalid batch_id, invalid expected_targets, coordination drift, etc.) keeps accumulating into the shared blockers array and lets the method fall through to build a complete snapshot, so a blocked receipt still reports batch_id, coordination_backend, and every blocker that was found.
Here, if no_backend_evidence or authenticated_status resolution fails, the method instead returns a bare blocked_result, which:
- Discards any blockers already pushed earlier in this call (e.g.
"publication batch id is invalid","configured coordination backend is unavailable", orvalidated_target_seterrors onexpected_targets), replacing them with only the single new message. - Hardcodes
batch_id/coordination_backendtonilin the returned receipt even though both were already resolved successfully at this point (batch_idon line 71-72,backendon line 68), so an auditor looking at this blocked receipt can't tell which batch/backend it was even for.
Since this is fail-closed either way (eligible stays false), it's not exploitable, but it does make this one failure mode uniquely opaque compared to every other blocked outcome in this file, and could hide unrelated pre-existing validation problems in the same request. Consider passing the already-resolved batch_id: / coordination_backend: backend into blocked_result, and/or accumulating this new blocker into blockers and letting the method continue instead of returning early.
Review summaryReviewed the new no-backend → active-backend transition handling in Overall: the design is sound and fails closed — a batch that started under One correctness/quality issue (left as an inline comment): the two new early No other correctness, security, or performance concerns found. Nice test coverage for both the happy-path transition and the fail-closed case. |
Why
In-flight batches can start under
coordination_backend: n/aand later refresh onto a private backend. The preflight now reconciles that seam explicitly instead of inventing a retroactive backend history.What changed
n/aworkflow revision and later private-backend revision.completed-batch-publication-preflightto either authenticate a no-backend -> active-backend reconciliation into an explicit transition snapshot, or stop early with one precise activation blocker.How to verify
ruby skills/post-merge-audit/bin/completed-batch-publication-preflight-test.rb -n '/test_trusted_base_refresh_/'ruby skills/pr-batch/bin/goal-completion-contract-test.rb -n '/coordination_backend_doc_requires_explicit_transition_handoff_on_trusted_base_refresh/'git diff --check.agents/bin/lint(passes rubocop and markdownlint; stops becauseyamllintis not installed in this workspace)Fixes #455
deferred_to_update_changelog