Skip to content

release(control): verify ancestry-preserving back-sync - #3103

Merged
EffortlessSteven merged 18 commits into
mainfrom
codex/back-sync-verify-3100
Aug 10, 2026
Merged

EffortlessSteven merged 18 commits into
mainfrom
codex/back-sync-verify-3100

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

  • Add cargo xtask back-sync verify for read-only exact-K post-publication back-sync verification.
  • Emit deterministic JSON/Markdown input, release, ancestry, and temporary-policy evidence.
  • Add spec, traceability, command catalog, operator documentation, and synthetic Git graph tests.

Swarm / Source Boundary

This PR targets EffortlessMetrics/ripr-swarm and keeps source publication authority in EffortlessMetrics/ripr.

  • swarm-only source-of-truth, release-control, and operator surface

Source-of-truth Links

Spec: docs/specs/RIPR-SPEC-0149-back-sync-verifier.md
Issue: #3100
Related: docs/RELEASE.md, docs/swarm-development.md, RIPR-SPEC-0148

Scope

The verifier requires exact 40-character SWARM_BEFORE, SOURCE_RELEASE_HEAD, reviewed tree, and K inputs; checks ordered two-parent ancestry, tree equality, source release tag target, current-head guard, retained swarm surfaces, source publication ancestry-only evidence, and deterministic policy/release manifests. It never constructs K or mutates refs/settings/publication.

Single acceptance criterion: a stale, substituted, reversed, single-parent, wrong-tree, or tree-equivalent-squash candidate fails closed while a correctly ordered K can produce a receipt in either transport phase.

Non-goals: merge construction, transport, force-push, branch settings mutation, J verification, publication, signing, metadata mutation, or release correctness claims.

Support-tier Impact

  • none

Policy Impact

  • doc artifacts
  • process/network (read-only evidence only)

The before/temporary-exception/after policy files are read and hashed; the tool does not mutate branch protection or repository settings.

Proof

cargo fmt --all -- --check
git diff --check --ignore-cr-at-eol
cargo test -p xtask back_sync -- --nocapture

cargo fmt and git diff --check passed. The focused Cargo test was attempted repeatedly with an isolated CARGO_TARGET_DIR and CARGO_BUILD_JOBS=1, but the Windows checkout had extensive concurrent Cargo contention and each bounded attempt timed out before producing a test result; this remains unverified for hosted CI.

Claim Boundary

This PR supports read-only exact-input K ancestry/tree/current-head and evidence-manifest verification. It does not prove release correctness, artifact adequacy, semantic equivalence, publication success, or that a policy exception was authorized; those remain operator/hosted evidence.

Rollback

Revert the single commit; no refs, settings, tags, releases, or publication channels are changed by the verifier.

Spec-Test-Code Traceability

  • Spec: docs/specs/RIPR-SPEC-0149-back-sync-verifier.md
  • Tests: xtask/src/reports/back_sync.rs synthetic graph and exact-input tests
  • Code: xtask/src/reports/back_sync.rs, xtask/src/command.rs, xtask/src/dispatch.rs
  • Metrics: unit test pass rate

Static Language Check

  • Static output avoids prohibited mutation-testing claims.
  • Unknown policy/release evidence is represented as unsupplied/unknown.

CI Economics

  • LEM impact: n/a; no workflow changes.
  • Workflows touched: none.
  • Branch protection impact: none; policy evidence is read-only.

Engineering Check

  • No new panic-family calls in production or tests.
  • Errors include actionable context.
  • JSON/report contract is documented.

Gates

  • cargo fmt --check
  • git diff --check --ignore-cr-at-eol
  • focused Cargo proof (timed out/unverified under Windows Cargo contention)
  • hosted exact-head CI and substantive review

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@EffortlessSteven, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2c7451b7-b879-479c-b93b-4af6a311e7da

📥 Commits

Reviewing files that changed from the base of the PR and between 748b6cf and 7306fbc.

📒 Files selected for processing (1)
  • xtask/src/reports/back_sync.rs

Summary by CodeRabbit

  • New Features

    • Added the read-only cargo xtask back-sync verify command.
    • Validates repository state, commit history, expected heads, policy evidence, and transport inputs.
    • Generates deterministic JSON and Markdown verification receipts.
    • Fails safely on unexpected repository conditions and performs no mutations.
  • Documentation

    • Added usage guidance, limitations, verification procedures, and receipt details.
    • Added the back-sync verifier specification and linked it from the documentation indexes.

Walkthrough

Added a read-only cargo xtask back-sync verify command. It validates exact Git inputs, commit ancestry, ordered join parents, tree state, repository and policy evidence, then writes deterministic JSON and Markdown receipts. Added its specification, documentation, command wiring, and tests.

Changes

Back-sync verifier

Layer / File(s) Summary
Verifier contract and operator documentation
docs/specs/RIPR-SPEC-0149-back-sync-verifier.md, docs/BACK_SYNC_VERIFIER.md, docs/swarm-development.md, docs/DOCUMENTATION.md, docs/specs/README.md, .ripr/traceability.toml, policy/doc-artifacts.toml
Defines the accepted verifier contract, evidence requirements, prohibited operations, operator procedure, documentation links, and traceability artifacts.
Back-sync command wiring
xtask/src/command.rs, xtask/src/dispatch.rs, xtask/src/reports/mod.rs, policy/process_allowlist.txt
Adds XtaskCommand::BackSync, parses its arguments, catalogs and dispatches the command, exports the report handler, and allowlists bounded Git probes.
Input and history verification
xtask/src/reports/back_sync.rs
Parses exact inputs and validates repositories, revisions, remotes, ordered parents, trees, ancestry, heads, development surfaces, release evidence, policy evidence, and source authority.
Receipts and synthetic graph tests
xtask/src/reports/back_sync.rs, docs/BACK_SYNC_VERIFIER.md
Writes deterministic JSON and Markdown receipts. Tests cover abbreviated SHA rejection, remote validation, digest determinism, valid graphs, and adversarial commit and evidence cases.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

Suggested labels: enhancement

Poem

I check each parent, tree, and head,
Then write exact receipts instead.
No refs are changed, no joins are made,
Git evidence is neatly displayed.
I hop away when checks are through.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.90% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: adding a verifier for ancestry-preserving back-sync.
Description check ✅ Passed The description covers the change, scope, proof status, claim boundary, rollback, traceability, policy impact, and relevant checks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/back-sync-verify-3100

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EffortlessSteven
EffortlessSteven force-pushed the codex/back-sync-verify-3100 branch from 7b80425 to d78a49f Compare August 10, 2026 02:57

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 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 @.ripr/traceability.toml:
- Around line 6521-6523: Update the traceability entries for
synthetic_graph_rejects_single_parent_repair_and_squash and
synthetic_graph_preserves_required_parent_order_and_tree only if those tests
invoke the verifier and assert its rejection or receipt result; otherwise remove
them as verifier evidence. Preserve the
spec-to-test-to-code-to-output-contract-to-metric chain, while retaining
abbreviated_inputs_are_rejected if it provides executable verifier evidence.

In `@xtask/src/command.rs`:
- Line 392: Add a matching external_state_read entry for back-sync verify in
command_catalog(), using the exact syntax exposed by known_commands() and
including the relevant receipt paths. Ensure check-command-catalog recognizes
the command and its declared contract matches the command’s required inputs.

In `@xtask/src/reports/back_sync.rs`:
- Line 187: Make --source-release-tag mandatory in the back-sync argument
handling: validate that it is provided, store it as a non-optional value, and
update usage() and known_commands() to remove optional syntax. Ensure the
verifier always receives a concrete source_release_tag for published-tag
validation.
- Around line 360-365: Update the release-evidence construction around
ReleaseEvidence so publication_receipt_reachable and related evidence are
resolved from the verified join K (swarm_root/options.join), then validated
against release_receipt and options.version rather than only checking
docs/RELEASE.md existence. Ensure stale or unrelated receipts cannot pass
verification, and preserve real producer-derived evidence instead of fabricating
fallback values.
- Around line 664-676: The synthetic graph tests currently validate only fixture
construction, not production behavior. In
xtask/src/reports/back_sync.rs:664-676, update
synthetic_graph_rejects_single_parent_repair_and_squash to pass the parsed
parents to validate_join and assert rejection; in
xtask/src/reports/back_sync.rs:680-710, use validate_join to assert exact parent
order and that K^{tree} matches the reviewed tree, then add a two-repository
build_receipt test covering the complete contract.
- Around line 291-295: Update the verification flow around development_surfaces
and source_publication_paths to require every declared swarm development
surface—runner workflow, process policy, and swarm development guide—instead of
accepting any non-empty result. Inspect K for source workflow and settings
authority before setting source_publication_is_ancestry_only, and only report
that claim when the evidence confirms no such authority is retained.
🪄 Autofix

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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 993520ff-17bb-45b0-990a-a0b7c7bda343

📥 Commits

Reviewing files that changed from the base of the PR and between 88743db and 7b80425.

📒 Files selected for processing (10)
  • .ripr/traceability.toml
  • docs/BACK_SYNC_VERIFIER.md
  • docs/DOCUMENTATION.md
  • docs/specs/README.md
  • docs/specs/RIPR-SPEC-0149-back-sync-verifier.md
  • docs/swarm-development.md
  • xtask/src/command.rs
  • xtask/src/dispatch.rs
  • xtask/src/reports/back_sync.rs
  • xtask/src/reports/mod.rs

Comment thread .ripr/traceability.toml Resolved
Comment thread xtask/src/command.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7b80425d7f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread xtask/src/command.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPAIR_REQUIRED — exact-head substantive review

reviewed_head_sha: c0945bb
integration_basis: main at 88743db
claim_boundary: read-only exact-K post-publication back-sync verification; no K construction, transport, publication, settings mutation, or release-correctness claim.

Findings emitted: 6 blocking findings and 1 non-blocking formatting suggestion.

[P1] Process-policy gate fails on this exact head

Failure mode: xtask/src/reports/back_sync.rs adds use std::process::Command and three Command::new sites, but policy/process_allowlist.txt has no entries. Exact-head hosted run 31351778529 fails tests::count_policy_gates_have_no_stale_bounds with allowed 0, so the required Rust test lane cannot pass.
Why here: AGENTS.md and cargo xtask check-process-policy require every process surface to be narrowly owned and receipted.
Fix direction: add narrow entries for the import and the three bounded Git probes/test-repository operations, with owner/reason, or refactor through an already allowlisted adapter.
Validation: cargo xtask check-process-policy; cargo test --workspace --all-targets; exact-head routed result.
Confidence: High; reproduced in the hosted log for c0945bb.

[P1] Merge-policy before/exception/restoration proof is optional and fail-open

Failure mode: policy-before, policy-exception, and policy-after are all optional. build_receipt succeeds with none supplied, emits policy_restored: null, and hashes arbitrary exception bytes without validating their meaning. policy_disabled also maps unreadable/malformed files to false instead of failing. A successful receipt therefore does not establish the required before/temporary-exception/after restoration evidence.
Why here: the accepted spec and operator command make these policy states part of the back-sync proof; the receipt must not turn missing or malformed evidence into a successful boundary.
Fix direction: require all three evidence inputs for the applicable transport proof, parse/validate the policy snapshots and exception scope, and fail closed on unreadable/malformed/not-restored evidence. Add accept/reject tests.
Validation: focused back_sync tests with missing, malformed, false, and restored policy fixtures; inspect JSON/Markdown receipt fields.
Confidence: High; direct control-flow inspection at back_sync.rs:314-333 and 523-546.

[P1] Retained swarm surfaces and source-authority separation are not verified

Failure mode: build_receipt fails only when development_surfaces is empty, so a K tree retaining one path passes while the routed workflow, process policy, or development guide is absent. source_publication_paths only lists source-tree paths whose names contain publish/release, and source_publication_is_ancestry_only is set unconditionally; K is never inspected for source workflow/settings becoming active authority.
Why here: the spec and docs/swarm-development.md require all swarm settings/checks/runner/development surfaces and require source publication surfaces to remain ancestry-only.
Fix direction: require every declared retained swarm surface, report missing surfaces, inspect K’s tree/configuration for source publication workflows/settings, and set the ancestry-only field only from that negative evidence. Add a synthetic K that removes all but one surface and another that imports a source workflow.
Validation: cargo test -p xtask back_sync -- --nocapture; cargo xtask check-pr and receipt inspection.
Confidence: High; direct inspection at back_sync.rs:285-289, 513-521, and 354-359.

[P1] Release receipt and release-version evidence are not bound to K

Failure mode: the supplied release_receipt is optional and only hashed. publication_receipt_reachable is merely cat-file existence of docs/RELEASE.md in K; no receipt contents, release version, or version-specific changelog/publication identity is checked. A stale/unrelated receipt and generic RELEASE.md can produce a successful verification.
Why here: the command claims release/changelog/publication evidence, while the implementation reports only path existence and an unbound digest.
Fix direction: require a K-reachable, version-bound receipt and changelog evidence, validate its schema/identity against --version and the released source head, and reject stale/unrelated bytes.
Validation: positive receipt plus stale/wrong-version/wrong-head negative fixtures; focused verifier test.
Confidence: High; direct inspection at back_sync.rs:290 and 357-359.

[P1] --source-release-tag is not actually tag-bound

Failure mode: exact_rev accepts any commit-ish. Supplying SOURCE_RELEASE_HEAD itself, or a branch resolving to it, as --source-release-tag passes the target comparison even though no release tag exists. The receipt therefore cannot establish the published tag target required by the contract.
Why here: the option is documented as a tag and the spec requires the exact source release tag target, not merely another reference to the same commit.
Fix direction: resolve an explicit immutable tag ref, require tag-object/refs/tags identity as appropriate, compare its peeled target to SOURCE_RELEASE_HEAD, and add a branch/SHA substitution rejection test.
Validation: synthetic source repo with valid tag, branch-only, and SHA-only inputs; focused verifier tests.
Confidence: High; direct inspection at back_sync.rs:235 and 477-484.

[P1] Adversarial graph tests do not exercise the verifier

Failure mode: synthetic_graph_rejects_single_parent_repair_and_squash only proves that its fixture has one parent, and the ordered-tree test only inspects raw Git output. Neither calls build_receipt or even asserts validate_join for the first two fixtures. Removing or weakening production validation would leave the traceability tests green.
Why here: .ripr/traceability.toml claims these tests as proof for RIPR-SPEC-0149, but they do not discriminate the production command’s behavior.
Fix direction: invoke the production verifier on two distinct temporary repositories and assert success/failure for single-parent, reversed, substituted, appended, wrong-tree, expected-head, policy, source-tag, and authority cases; then keep traceability aligned with executable proof.
Validation: cargo test -p xtask back_sync -- --nocapture; mutation/removal challenge against validate_join/build_receipt.
Confidence: High; direct inspection at back_sync.rs:658-721 and traceability entries RIPR-SPEC-0149.

[P2] Markdown receipt uses Debug formatting for the tag target

render_markdown prints source_release_tag_target with {:?}, producing quoted SHA text unlike the other receipt fields. Use display formatting and add a Markdown projection assertion so deterministic output matches the documented contract.

Changed surfaces and semantic owners inspected: xtask/src/reports/back_sync.rs, command dispatch/catalog, policy/doc-artifacts.toml, .ripr/traceability.toml, docs/specs/RIPR-SPEC-0149-back-sync-verifier.md, docs/BACK_SYNC_VERIFIER.md, and the back-sync section of docs/swarm-development.md; Git ancestry/ref/tree/policy/release receipt paths and hosted routed/test/coverage/source-of-truth checks.

Proof and CI observed:

  • Exact PR head is c0945bb.
  • source-of-truth is terminal success on run 31351778542 after the spec registration repair.
  • rust-tests-junit is terminal failure on run 31351778529 due to the missing process allowlist entries above.
  • At review time, rust-coverage, Ripr Rust Small on GitHub Hosted, and ub-review remained pending; therefore the protected Ripr Rust Small Result was not established.
  • Live main protection requires Ripr Rust Small Result; the active ruleset requires review-thread resolution. Seven review threads remain unresolved.

Missing proof / residual assumptions: no exact-head successful focused Cargo result, no complete two-repository end-to-end verifier fixture, no semantic policy/release-evidence validation, no proof that source publication workflows/settings are inactive authority in K, and no terminal exact-head hosted routed/coverage/UB result.

disposition: REPAIR_REQUIRED

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPAIR_REQUIRED — exact-head substantive review

reviewed_head_sha: b4562cc
integration_basis: main at 88743db
claim_boundary: read-only exact-K post-publication back-sync verification; no K construction, transport, publication, settings mutation, or release-correctness claim.

The latest commit only adds the process-policy entries for the new Git probes. I refreshed the full current diff and re-read the verifier/spec/docs at b4562cc; the following blocking semantic findings remain.

[P1] Merge-policy before/exception/restoration proof is optional and fail-open

Failure mode: policy-before, policy-exception, and policy-after are optional. build_receipt succeeds with none supplied, emits policy_restored: null, and hashes arbitrary exception bytes without validating their meaning. policy_disabled maps unreadable/malformed files to false instead of failing. A successful receipt therefore does not establish the required before/temporary-exception/after restoration evidence.
Why here: RIPR-SPEC-0149 and docs/swarm-development.md make these policy states part of the back-sync proof.
Fix direction: require the three evidence inputs for the applicable transport proof, parse/validate policy snapshots and exception scope, and fail closed on unreadable/malformed/not-restored evidence. Add missing/malformed/false/restored fixtures.
Validation: cargo test -p xtask back_sync -- --nocapture; inspect JSON/Markdown policy fields.
Confidence: High; xtask/src/reports/back_sync.rs:314-333,523-546.

[P1] Retained swarm surfaces and source-authority separation are not verified

Failure mode: the verifier fails only when development_surfaces is empty, so a K tree retaining one path passes while the routed workflow, process policy, or swarm-development guide is absent. source_publication_paths only lists source paths whose names contain publish/release, and source_publication_is_ancestry_only is set unconditionally; K is never inspected for source workflow/settings becoming active authority.
Why here: the accepted spec and docs/swarm-development.md require all swarm settings/checks/runner/development surfaces and source publication surfaces to remain ancestry-only.
Fix direction: require every declared retained swarm surface, report missing paths, inspect K for source publication workflows/settings, and set the ancestry-only field only from that evidence. Add negative synthetic K cases.
Validation: focused back-sync tests and cargo xtask check-pr with receipt inspection.
Confidence: High; back_sync.rs:285-289,513-521,354-359.

[P1] Release receipt and release-version evidence are not bound to K

Failure mode: release_receipt is optional and only hashed. publication_receipt_reachable is merely existence of docs/RELEASE.md in K; no receipt contents, release version, or version-specific changelog/publication identity is checked. A stale/unrelated receipt and generic RELEASE.md can produce a successful verification.
Why here: the command claims release/changelog/publication evidence, while implementation reports only path existence and an unbound digest.
Fix direction: require a K-reachable, version-bound receipt and changelog evidence, validate its identity against --version and the released source head, and reject stale/unrelated bytes.
Validation: positive plus stale/wrong-version/wrong-head receipt fixtures.
Confidence: High; back_sync.rs:290,357-359,523-537.

[P1] --source-release-tag is not actually tag-bound

Failure mode: exact_rev accepts any commit-ish. Supplying SOURCE_RELEASE_HEAD itself, or a branch resolving to it, as --source-release-tag passes the target comparison even though no release tag exists. The receipt cannot establish the published tag target required by the contract.
Why here: the option is documented as a tag and the spec requires the exact source release tag target.
Fix direction: resolve an explicit immutable tag ref, require tag-object/refs/tags identity as appropriate, compare its peeled target to SOURCE_RELEASE_HEAD, and add branch/SHA substitution rejection tests.
Validation: synthetic source repo with valid tag, branch-only, and SHA-only inputs.
Confidence: High; back_sync.rs:235,477-484.

[P1] Adversarial graph tests do not exercise the verifier

Failure mode: synthetic_graph_rejects_single_parent_repair_and_squash only proves that its fixture has one parent, and the ordered-tree test only inspects raw Git output. Neither calls build_receipt or asserts validate_join for the first two fixtures. Removing or weakening production validation would leave the traceability tests green.
Why here: .ripr/traceability.toml claims these tests as RIPR-SPEC-0149 proof, but they do not discriminate the production command.
Fix direction: invoke the production verifier on two distinct temporary repositories and assert success/failure for single-parent, reversed, substituted, appended, wrong-tree, expected-head, policy, source-tag, and authority cases; then keep traceability aligned.
Validation: cargo test -p xtask back_sync -- --nocapture; mutation/removal challenge against validate_join/build_receipt.
Confidence: High; back_sync.rs:658-721 and traceability RIPR-SPEC-0149 entries.

[P2] Markdown receipt uses Debug formatting for the tag target

render_markdown prints source_release_tag_target with {:?}, producing quoted SHA text unlike the other receipt fields. Use display formatting and add a projection assertion for the documented deterministic output.

Changed surfaces and owners inspected: verifier, command dispatch/catalog, traceability, process/doc-artifact policy, spec, operator docs, swarm-development back-sync procedure, Git ancestry/ref/tree/policy/release evidence paths, and current hosted checks.

Proof and CI observed:

  • Exact current head is b4562cc.
  • The prior missing doc-artifact and command-catalog registrations are present; current source-of-truth was observed passing on run 31352081181.
  • The process allowlist repair is present for the import and three Git call sites; its exact-head test result was not yet terminal at review time.
  • rust-tests-junit, rust-coverage, Ripr Rust Small on GitHub Hosted, and ub-review remain pending on the current head, so Ripr Rust Small Result is not established.
  • Main protection requires Ripr Rust Small Result; the active ruleset requires review-thread resolution. Existing unresolved threads remain review debt, not acceptance.

Missing proof / residual assumptions: no complete two-repository end-to-end verifier fixture, no semantic policy/release-evidence validation, no proof that source publication workflows/settings are inactive authority in K, no tag-substitution negative test, and no terminal exact-head hosted routed/coverage/UB result.

disposition: REPAIR_REQUIRED

@codecov

codecov Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.26891% with 264 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
xtask/src/reports/back_sync.rs 72.36% 262 Missing ⚠️
xtask/src/command.rs 66.66% 1 Missing ⚠️
xtask/src/dispatch.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread xtask/src/reports/back_sync.rs Resolved

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPAIR_REQUIRED — substantive exact-head review

Reviewed head: 870505f
Base: 88743db

Blocking findings

[P1] Exact head does not compile. xtask/src/reports/back_sync.rs:1001 returns git(...) (Result<String, String>) from init_repo declared Result<(), String>, producing hosted E0308 failures. This is confirmed by rust-tests-junit run 31352963337 and rust-coverage run 31352963323. Map/discard the output (or otherwise return the declared unit type), then rerun the exact-head tests and routed checks.

[P1] Release-receipt evidence is still not semantically bound to K. build_receipt reads an arbitrary external --release-receipt file and accepts it when four substrings (version, source head, join, tree) are present. The verifier separately checks only that K contains version-bearing CHANGELOG/RELEASE paths. A stale or unrelated receipt containing those tokens can therefore pass without being the receipt produced for this K/release. Use structured identity/content validation tied to the requested version, source release head, K, and reviewed tree, and add a negative test with a stale/unrelated token-bearing receipt.

[P1] Policy evidence is required but not actually parsed. read_policy_state accepts raw substring occurrences such as merge_commits = false in comments/strings, and read_policy_exception accepts any text containing “temporary”, “exception”, and “approved”. This does not meet the spec’s parseable policy-before / temporary-approved-exception / restoration evidence contract. Parse the policy/evidence format structurally and add malformed/comment-only fixtures that must reject.

[P1] Source-publication authority coverage remains hard-coded and incomplete. The verifier only checks five fixed paths in the before-to-K diff. An authority workflow/settings path that already exists before SWARM_BEFORE, or a newly activated path outside that list, is not detected. Enumerate/derive the complete governed settings, workflow, and runner surfaces from the repo policy/spec and prove that publication remains ancestry-only; add tests for pre-existing active authority and an out-of-list publication path.

[P1] The adversarial verifier matrix is improved but still misses required head/transport and evidence-failure cases. It now invokes build_receipt and covers parent order, tree, tag substitution, receipt version, policy, and one authority path. It does not reject a swarm whose current main is neither SWARM_BEFORE nor K, and has no negative post-transport/current-head reachability test; it also lacks malformed policy and token-coincidence receipt cases. Add these end-to-end fixtures so the production verifier, not only helpers, proves the requested expected-head and post-transport claims.

Prior findings rechecked

The following earlier blockers are refuted/stale at this head: actual-tag enforcement now verifies refs/tags/<tag> and rejects branch substitution; policy arguments are mandatory; all four required development surfaces are required; the adversarial test invokes build_receipt; and the Markdown source-tag rendering no longer uses debug formatting.

Current proof/CI state

  • Exact head is confirmed above; worktree is clean.
  • Source-of-truth check passed (run 31352963316).
  • Hosted Rust tests and coverage fail at the compile error above; routed Ripr Rust Small on GitHub Hosted and protected result are failing (run 31352963321).
  • ub-review remains in progress (run 31352963330).
  • PR merge state is BLOCKED.

Disposition: REPAIR_REQUIRED.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPAIR_REQUIRED — exact-head re-review

Reviewed head: d2b10ea
Prior review: 4893541288

[P1] The exact head still fails to compile. Hosted rust-tests-junit run 31353519649 fails with E0382 at xtask/src/reports/back_sync.rs:866:59: tree is moved into options.tree = tree after it was borrowed/moved by the authority fixture construction. The same test-target compilation blocks hosted proof. Clone or reorder the fixture value, then rerun the exact-head test, coverage, and routed hosted checks.

The prior semantic blockers were rechecked and are now materially addressed:

  • Release receipt is parsed as structured JSON and exact-matches version, SOURCE_RELEASE_HEAD, K, and reviewed tree; the adversarial test mutates the receipt and rejects the wrong version.
  • Policy-before/after and temporary exception are parsed as structured JSON with typed boolean fields and required scope; missing/non-disabled evidence is rejected.
  • Authority detection now scans changed .github workflow paths and publication/release/signing keywords rather than only five fixed filenames.
  • The production verifier now rejects a current swarm main that is neither SWARM_BEFORE nor K, and the adversarial fixture exercises that guard.
  • Actual tag enforcement, ordered parents, tree identity, ancestry, retained development surfaces, source-main binding, and source-publication ancestry checks remain present.

Current hosted state: source-of-truth and several metadata/security checks passed, but rust-tests-junit failed on the compile error above; coverage/routed hosted proof is therefore not yet a passing exact-head qualification. PR merge state remains BLOCKED.

Disposition: REPAIR_REQUIRED.

Comment thread policy/doc-artifacts.toml Resolved

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPAIR_REQUIRED — exact-head re-review

Reviewed head: 58a09f9

The prior E0382 at back_sync.rs:866 is repaired in this head. The verifier also retains the reviewed semantic repairs: structured exact release-receipt binding, parsed policy evidence, dynamic changed-workflow authority detection, expected-head guard with adversarial coverage, exact tags, ordered K parents, tree/ancestry checks, and retained-surface checks.

However, exact-head hosted qualification is not complete: rust-tests-junit, rust-coverage, and ub-review remain IN_PROGRESS after the refresh (run 31353654640; coverage run 31353654629). The PR remains BLOCKED, so I cannot mark REVIEW_READY until those exact-head checks complete successfully. No new source defect is evidenced yet; this is an exact-head proof gate.

Disposition: REPAIR_REQUIRED pending completed passing hosted proof.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPAIR_REQUIRED — exact-head re-review

Reviewed head: eb20ca7

The retained-error-context fix addresses the prior E0382 compile failure, and the reviewed verifier semantics remain intact. However, required exact-head hosted proof is still incomplete: rust-tests-junit, rust-coverage, and ub-review remain IN_PROGRESS (runs 31354014733, 31354014758, and the corresponding current-head UB job). The PR remains BLOCKED. I cannot mark REVIEW_READY until these checks complete successfully.

Optional Codecov patch/report status is not treated as a blocker or qualification substitute.

Disposition: REPAIR_REQUIRED pending completed passing hosted proof.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🤖 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 `@policy/doc-artifacts.toml`:
- Line 675: The status for RIPR-SPEC-0149 must match in both locations: update
policy/doc-artifacts.toml lines 675-675 and
docs/specs/RIPR-SPEC-0149-back-sync-verifier.md lines 3-3 to the intended shared
value, preserving consistency between the artifact ledger and spec front matter.

In `@xtask/src/reports/back_sync.rs`:
- Around line 402-404: Replace the literal true assignments in the report
construction with values produced directly by the corresponding validation
checks. Update swarm_before_reachable, source_release_reachable,
tree_matches_reviewed, source_publication_is_ancestry_only, and
source_authority_separation_verified, reusing each check’s result or binding it
before constructing the report so the evidence fields remain coupled to actual
verification.
- Around line 330-340: The version-retention checks in the back_sync validation
must require a delimited, version-bound match rather than any unanchored
occurrence. Update the `path_contains_at` calls for `CHANGELOG.md` and
`docs/RELEASE.md` so the version token is matched at the expected entry or
heading boundary, preventing matches inside other versions or historical
sections.
- Around line 836-838: Update the back-sync test flow containing commit_tree and
the later ?-propagating operations so the temporary root is always removed,
including when any helper returns an error. Use an inner function whose result
is captured before calling cleanup(&root), or an equivalent drop guard, then
perform cleanup on both success and failure paths while preserving existing
error propagation.
- Line 203: Update the usage string returned by back_sync::usage in
xtask/src/reports/back_sync.rs:203-203 to show --release-receipt,
--policy-before, --policy-exception, and --policy-after as required, followed by
the optional --swarm-main and --source-main arguments. Replace the
known_commands() entry in xtask/src/command.rs:392-392 with the exact matching
syntax string from command_catalog() at Line 1003.
- Around line 585-617: Update source_authority_paths_changed to use git diff
--name-status and distinguish deleted paths from added or modified paths.
Exclude entries with status D, including .github/settings.yml, and only apply
the existing workflow-content keyword check to paths present at join; do not
treat git show failures for deleted workflows as authority activation.
- Around line 553-563: Update is_ancestor and path_contains_at to return
distinct results for successful verification, source-negative results, and
infrastructure/instrument failures instead of collapsing all errors to false.
Classify git spawn failures and unexpected command exits as instrument state,
while preserving normal non-ancestor and absent-path outcomes as source results;
update their callers to report the corresponding state rather than a
source-verification failure.
- Around line 159-168: Update the argument validation around the join and tree
lookups to reject conflicting alias values when both --join and --k, or both
--tree and --back-sync-tree, are supplied with different values. Preserve
accepting either single alias and equivalent duplicate values, but fail before
selection so no alias is silently discarded.
- Around line 822-935: Update synthetic_graph_adversarial_cases_invoke_verifier
so each negative build_receipt case asserts the returned error text identifies
the intended validation failure, rather than only checking is_ok(). In
particular, use a valid, resolvable alternate tree for the wrong-tree case so
rejection reaches tree comparison, then verify the expected reason for that and
every other adversarial case before cleanup.
🪄 Autofix

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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d064901f-9a26-4f2a-97ea-022909f8801f

📥 Commits

Reviewing files that changed from the base of the PR and between 7b80425 and eb20ca7.

📒 Files selected for processing (7)
  • .ripr/traceability.toml
  • docs/BACK_SYNC_VERIFIER.md
  • docs/specs/RIPR-SPEC-0149-back-sync-verifier.md
  • policy/doc-artifacts.toml
  • policy/process_allowlist.txt
  • xtask/src/command.rs
  • xtask/src/reports/back_sync.rs

Comment thread policy/doc-artifacts.toml Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved
Comment thread xtask/src/reports/back_sync.rs Resolved

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPAIR_REQUIRED — exact-head substantive re-review

Reviewed head: 74dbd57

The prior E0382 compile failure is repaired: rust-tests-junit passed (run 31354665628). However, the exact-head required hosted gate fails on the spec contract. Routed run 31354665804 / GitHub-hosted job 93352069858 reports:

  • docs/specs/RIPR-SPEC-0149-back-sync-verifier.md is missing ## Non-Goals
  • missing ## Acceptance Examples
  • missing ## Test Mapping
  • missing ## Implementation Mapping
  • missing ## Metrics

This is emitted by cargo xtask check-spec-format and causes Required Rust gates to fail; the protected Ripr Rust Small Result also fails. The current change repaired only some headings, so the exact-head proof is not ready. Coverage and ub-review were still pending at review time, but the routed hosted gate already provides a concrete blocker.

Disposition: REPAIR_REQUIRED.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPAIR_REQUIRED — exact-head re-review

Reviewed head: 3ebf385

The new spec adds the mandatory sections requested by the prior review. Source-of-truth, dependency, plan, routed selector, and security checks are passing. However, the required exact-head hosted qualification has not settled: rust-tests-junit, rust-coverage, ub-review, and the GitHub-hosted routed job remain pending. The protected PR remains BLOCKED, so I cannot responsibly post REVIEW_READY until the current-head spec-format and required hosted gates complete.

No new source defect is evidenced at this time; disposition is gated on current-head proof.

Disposition: REPAIR_REQUIRED pending completed exact-head hosted proof.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW_READY — substantive exact-head review

Reviewed head: 3ebf385.

Required exact-head proof is now green:

  • GitHub-hosted routed Rust gates: pass
  • protected Ripr Rust Small Result: pass
  • rust-tests-junit: pass
  • rust-coverage: pass
  • ub-review: pass
  • source-of-truth: pass
  • process/security/dependency/planning checks: pass

The verifier semantics were reviewed across the prior repair sequence and remain sound at this head: exact SHA/tag/source-head binding, ordered K parents and ancestry, reviewed-tree identity, expected-head guard, retained development surfaces, structured release receipt binding, parsed policy before/exception/restoration evidence, dynamic publication-authority detection, deterministic/local-path-free receipts, and adversarial production-verifier tests. No semantic blocker remains from this review.

Optional status: codecov/patch is failing. It is not a required protected gate and does not invalidate the passing required test/coverage proof; its patch-coverage signal should be disclosed separately rather than treated as release or review qualification.

Disposition: REVIEW_READY.

This was referenced Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant