Skip to content

Verify content-addressed Issue lifecycle evidence - #621

Merged
proerror77 merged 7 commits into
mainfrom
codex/issue-lifecycle-evidence-verify
Aug 2, 2026
Merged

proerror77 merged 7 commits into
mainfrom
codex/issue-lifecycle-evidence-verify

Conversation

@proerror77

@proerror77 proerror77 commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Change contract

Add a read-only verifier for #607 evidence bundles that fails closed on file, digest, schema, scope, graph, pagination/header, and optional live-state drift.

Issue relationship

Closes #608

Out of scope

Executing a full repository capture or live verification; producing restoration plans; mutating Issue/PR metadata; reconciling the 54 legacy violations; changing #460, required checks, branch protection, deployment, runtime, or Agent-led research scope.

Dependencies and merge order

#607 merged first in PR #615 at 20ca2a1c04094455a31d5c3c5076e031c56e7140. No remaining stacked dependency.

Focused validation

  • bash .github/scripts/test-issue-lifecycle-preflight.sh
  • .github/scripts/test-issue-lifecycle-audit.sh
  • .github/scripts/test-issue-lifecycle-contract.sh
  • ruby .github/scripts/test-issue-lifecycle-workflow.rb
  • ruby .github/scripts/test-issue-lifecycle-reconcile-workflow.rb
  • .github/scripts/test-issue-lifecycle-status-reconcile.sh
  • .github/scripts/test-select-rust-ci-scope.sh
  • Ruby/Bash syntax, shellcheck, scoped actionlint, and git diff --check
  • Counterexamples cover re-signed missing pages, invalid object identities and cross-repository associations, false Link provenance, native cursor-chain truncation, and per_page=1 substitution.
  • Two bounded single-page GitHub header reads confirmed the native repositories/<id> cursor form; no full live capture/readback was executed.

Rollout and rollback

No deployment or runtime mutation. Merge adds only the verifier and its fixture coverage; rollback is a revert of this PR.

Scope exception

None.

Summary by CodeRabbit

  • New Features

    • Added bundle capture and verification workflows with optional live validation.
    • Added checks for data integrity, provenance, pagination, relationships, issue and pull-request details, and consistency.
  • Bug Fixes

    • Improved handling and validation of pagination links and API URLs.
    • Added safeguards against malformed, tampered, incomplete, or out-of-scope bundles.
  • Tests

    • Expanded coverage for bundle validation, hashing, schema compliance, pagination, metadata, and live-readback stability.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 6 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d21c8823-9e21-4185-acdc-11871e799d62

📥 Commits

Reviewing files that changed from the base of the PR and between 4ae900c and 071a219.

📒 Files selected for processing (2)
  • .github/scripts/issue-lifecycle-preflight.rb
  • .github/scripts/test-issue-lifecycle-preflight.sh
📝 Walkthrough

Walkthrough

The PR adds strict pagination parsing and provenance capture, comprehensive local bundle and graph validation, and a verify CLI operation with optional live GitHub readback. Tests cover canonical data, digests, scope, pagination, tampering, and live drift.

Changes

Issue lifecycle bundle verification

Layer / File(s) Summary
Pagination and provenance
.github/scripts/issue-lifecycle-preflight.rb, .github/scripts/test-issue-lifecycle-preflight.sh
Pagination now validates API hosts and Link relations. Captured REST pages retain Link-header metadata. Fixtures cover repository-style paths and paginated labels.
Local bundle validation
.github/scripts/issue-lifecycle-preflight.rb
Verification checks required files, canonical JSON, SHA-256 sidecars, manifest scope, page inventories, API metadata, timestamps, and preflight digests.
Graph and object validation
.github/scripts/issue-lifecycle-preflight.rb
Validation checks repository-scoped issues, pull requests, relationships, comments, events, reviews, commits, files, statuses, checks, identities, and counts.
Verification command and coverage
.github/scripts/issue-lifecycle-preflight.rb, .github/scripts/test-issue-lifecycle-preflight.sh
The CLI adds verify, --bundle, and --live. Tests cover tampering, schema and scope failures, pagination gaps, metadata drift, live readback drift, and bundle immutability.

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

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant VerifyCLI
  participant BundleVerifier
  participant GitHubReadOnly
  participant GitHubAPI
  Operator->>VerifyCLI: run verify with bundle and optional live
  VerifyCLI->>BundleVerifier: validate local bundle
  BundleVerifier-->>VerifyCLI: local validation result
  opt live verification
    VerifyCLI->>GitHubReadOnly: re-read captured graph
    GitHubReadOnly->>GitHubAPI: fetch current pages and objects
    GitHubAPI-->>GitHubReadOnly: current GitHub data
    GitHubReadOnly-->>VerifyCLI: live comparison result
  end
  VerifyCLI-->>Operator: verification result
Loading

Possibly related issues

  • #608 — Directly tracks the read-only bundle verification and optional live validation implemented here.
  • #607 — Provides the capture bundle format and provenance that this verification flow consumes.
  • #609 — Covers the downstream zero-write restoration flow that depends on verified evidence.

Possibly related PRs

  • proerror77/monday#610 — Adds the capture implementation that this PR extends with verification and stricter validation.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 main change: verification of content-addressed Issue lifecycle evidence.
Description check ✅ Passed The description follows the required template and documents scope, dependencies, validation, rollout, rollback, and excluded work.
Linked Issues check ✅ Passed The verifier and tests address the linked issue requirements for local validation, live drift detection, fail-closed checks, and read-only behavior.
Out of Scope Changes check ✅ Passed The changes are limited to the requested verifier and its focused fixture and test coverage.
✨ 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/issue-lifecycle-evidence-verify

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.

@proerror77
proerror77 force-pushed the codex/issue-lifecycle-evidence-verify branch from 4ae900c to 00ecda9 Compare August 2, 2026 16:48

@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: 1

🧹 Nitpick comments (1)
.github/scripts/test-issue-lifecycle-preflight.sh (1)

198-233: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the expected verifier error, not only the generic prefix.

verify_fails accepts any failure that prints ERROR issue lifecycle preflight:. resign_preflight and set_json_field rewrite the JSON with JSON.generate(object) + "\n", which is not guaranteed to reproduce Canonical.dump byte-for-byte. If a rewrite produces non-canonical JSON, the verifier fails with "is not canonical JSON" and the test still passes. Each negative test then proves nothing about the behaviour it targets.

Add an expected-message argument so each scenario asserts its own failure reason.

♻️ Proposed refactor
 verify_fails() {
-  local name="$1" bundle="$2"
-  shift 2
+  local name="$1" bundle="$2" expected="$3"
+  shift 3
   set +e
   output="$(verify "$bundle" "$@" 2>&1)"
   exit_code=$?
   set -e
   test "$exit_code" -eq 2
-  grep -Fq "ERROR issue lifecycle preflight:" <<<"$output" || {
-    echo "$name did not report a verifier error" >&2
+  grep -Fq "ERROR issue lifecycle preflight:" <<<"$output" && grep -Fq "$expected" <<<"$output" || {
+    echo "$name did not report the expected verifier error: $output" >&2
     exit 1
   }
 }

Then pass the expected fragment at each call site, for example verify_fails digest "$tmp_dir/verify-digest" "preflight.json digest mismatch".

🤖 Prompt for 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.

In @.github/scripts/test-issue-lifecycle-preflight.sh around lines 198 - 233,
Update verify_fails to accept an expected error-message fragment and assert that
the verifier output contains both the generic prefix and that fragment. Modify
every verify_fails call site to pass the failure reason specific to its
scenario, such as the digest mismatch message, so canonical-JSON failures cannot
satisfy unrelated negative tests.
🤖 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 @.github/scripts/issue-lifecycle-preflight.rb:
- Around line 494-502: Update read_canonical_json so the canonicality check
compares the raw bytes of contents and Canonical.dump(object), rather than
relying on encoding-aware string equality. Preserve the existing parsing and
error behavior while ensuring valid canonical JSON containing non-ASCII
characters is accepted.

---

Nitpick comments:
In @.github/scripts/test-issue-lifecycle-preflight.sh:
- Around line 198-233: Update verify_fails to accept an expected error-message
fragment and assert that the verifier output contains both the generic prefix
and that fragment. Modify every verify_fails call site to pass the failure
reason specific to its scenario, such as the digest mismatch message, so
canonical-JSON failures cannot satisfy unrelated negative tests.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b272243-d2ab-4082-9418-78846cb524ff

📥 Commits

Reviewing files that changed from the base of the PR and between 28277c5 and 4ae900c.

📒 Files selected for processing (2)
  • .github/scripts/issue-lifecycle-preflight.rb
  • .github/scripts/test-issue-lifecycle-preflight.sh

Comment thread .github/scripts/issue-lifecycle-preflight.rb

@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: 4ae900c115

ℹ️ 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 .github/scripts/issue-lifecycle-preflight.rb
Comment thread .github/scripts/issue-lifecycle-preflight.rb Outdated
Comment thread .github/scripts/issue-lifecycle-preflight.rb
Comment thread .github/scripts/issue-lifecycle-preflight.rb Outdated
Comment thread .github/scripts/issue-lifecycle-preflight.rb
@proerror77
proerror77 force-pushed the codex/issue-lifecycle-evidence-verify branch from 00ecda9 to 071a219 Compare August 2, 2026 17:39
@proerror77
proerror77 merged commit 612d0f9 into main Aug 2, 2026
46 of 47 checks passed
@proerror77
proerror77 deleted the codex/issue-lifecycle-evidence-verify branch August 2, 2026 17:45
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.

Verify content-addressed Issue lifecycle preflight evidence

1 participant