Skip to content

feat(ci): PR evidence extractor, schema and controls (S1) - #192

Merged
hyperpolymath merged 3 commits into
mainfrom
ci/s1-evidence-extractor
Nov 30, 2026
Merged

hyperpolymath merged 3 commits into
mainfrom
ci/s1-evidence-extractor

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

What

S1 of the W49 CI programme (design: #189, section 6.1): a read-only evidence extractor.

  • scripts/pr-evidence.sh OWNER/REPO PR writes one replayable evidence record (proven/pr-evidence/v1) for a pull request: head, base-tip, merge-base and nearest-completed-base observations per required context, workflow runs (including zero-job and startup_failure), masked failure signatures (strong or weak), mergeability, reviews, ruleset and profile required set, superseded inputs. It derives no verdict.
  • docs/design/pr-verdict/evidence.schema.json and scripts/json-schema-lite.jq (schema validator for the subset used; no Python, no new dependency).
  • tests/pr-evidence.sh (added to tests/unit.list): fake-gh controls.

Evidence

Check Result
bash tests/pr-evidence.sh 27 groups ok
bash tests/unit.sh 27 tests run, 0 failed
bash tests/smoke.sh passed
bash tests/inspect-pr-ci.sh ok (unchanged)
Live: extractor on open PRs #188, #189, #190, #191 of this repository rc 0, all four schema-valid, 0 violations
Live: #188 mergeable_state: blocked, changes_requested: true, all 12 required contexts Pass (matches the NEEDS-REVIEW reading in #189)
Live: #190, #191 touch gate files (7 each, reported in touches_gate_files); one required context Pending
shellcheck NOT RUN (not installable in this session)
Live validation on 3 other fixture repos NOT RUN: add_repo was refused for cicd-squabbler and proven-tests-and-benches; reported to the hub

Findings for the design owner

  1. Strong signature is ambiguous in 3.2. "a non-empty annotation message" counts Process completed with exit code 1., which every failed step emits, so any two red checks would have "equal strong signatures" and be treated as inherited (breaks property 3 / 3.8). Implemented: boilerplate (exit code N, The operation was canceled) is never an identity. Please confirm.
  2. Review-thread resolution needs GraphQL. Unavailable from agent sessions; recorded as null plus the reason, never as zero. The verdict's NEEDS-REVIEW arm on unresolved threads cannot fire from such a record.
  3. Producer map (Appendix A step 9) is not computed by the extractor; --producers FILE accepts it, and profile entries give a producer workflow for their own contexts. Without it Phantom and TriggerGap are not derivable from the record. Follow-up work package.

Not in this PR

S2 fixtures follow as a separate PR. No gate file, ruleset or workflow is touched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01J4QvDjgxz1iRFdu63KxE1K

Update: signature strength now follows 7208a2e (complete failing-test set: reported count n > 0 and exactly n identities; annotations alone weak); failed_count and pull.owner_acts added to the schema; tests 28 groups ok. Finding 1 above is superseded by that revision.


Generated by Claude Code

@gitnotebooks

gitnotebooks Bot commented Nov 30, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9075f586-6b3e-4d70-bb86-8e7bdf9f69da
Commits

Reviewing files that changed from the base of the PR and between 2bcb46f and eef3453.

Files selected for processing: 6

  • docs/design/pr-verdict/README.adoc
  • docs/design/pr-verdict/evidence.schema.json
  • scripts/json-schema-lite.jq
  • scripts/pr-evidence.sh
  • tests/pr-evidence.sh
  • tests/unit.list
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-30T16:37:38.391931Z
We couldn’t complete this review. Comment @codex review to try again.
c057cf5 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@hyperpolymath
hyperpolymath added this pull request to stack #196 November 30, 2026 16:37
scripts/pr-evidence.sh collects the replayable evidence record of design
section 3.2 for one pull request through the gate's REST layer
(conditional reads, Link paging, bounded back-off). docs/design/pr-verdict
holds the JSON Schema; scripts/json-schema-lite.jq validates it without
Python. tests/pr-evidence.sh drives a fake gh through startup_failure,
zero-job runs, billing, 304, pagination, null mergeable, fail-closed
reads, read-only calls and the validator's own negative controls.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDjgxz1iRFdu63KxE1K
A signature is strong only when the run reports a failing-test count n > 0
and exactly n distinct identities were found; annotations alone are weak.
failed_count joins the schema; the controls gain an incomplete-count case.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDjgxz1iRFdu63KxE1K
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDjgxz1iRFdu63KxE1K
@hyperpolymath
hyperpolymath force-pushed the ci/s1-evidence-extractor branch from c057cf5 to eef3453 Compare November 30, 2026 16:38
@hyperpolymath
hyperpolymath enabled stacked auto-merge (squash) November 30, 2026 16:38
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit 1b4d0d5 into main Nov 30, 2026
37 checks passed
@hyperpolymath
hyperpolymath deleted the ci/s1-evidence-extractor branch November 30, 2026 16:57
hyperpolymath added a commit that referenced this pull request Nov 30, 2026
## What

S2 of the W49 CI programme (design: #189, section 6.1). Stacked on #192
(S1): the base is the S1 branch and retargets when #192 merges.

55 golden fixtures in `docs/design/pr-verdict/fixtures/`, one per
verdict arm, per `BrokenCause`, per Infra kind and per section 3.6
property witness or counter-example. Each is a complete
`proven/pr-evidence/v1` record plus the verdict section 3.3 assigns.
They are generated (`gen-fixtures.jq`, `gen-fixtures.sh`) and the test
fails if a committed file differs from the generator. Expected values
are hand-written from section 3.3; there is deliberately no second
implementation. squabble-core's conformance test (S3) is what will
confirm or refute them.

## Evidence

| Check | Result |
|---|---|
| `bash tests/pr-verdict-fixtures.sh` | 12 groups ok: 55 fixtures;
generator equality; every fixture and its evidence schema-valid; arms,
causes, Infra kinds, derivation steps 1-9 and properties 1,2,3,5,6,7
covered; expected values consistent with evidence; controls shown able
to fail |
| `bash tests/unit.sh` | 28 tests run, 0 failed |
| Corpus run through the verdict function | NOT RUN (S3 does not exist
yet). The expected verdicts are unverified against any implementation. |
| Property 4 (replay) | not a fixture matter; belongs to the archive
test |

## Ambiguities in the design found while writing the corpus (to resolve
before S3)

1. Several owner acts in step 7 ("a question to the owner in the PR's
latest steward note", "a ruleset, secret, tag or settings change named
in the PR") have no field in the evidence record; only draft and
gate-file label are derivable. No fixtures for them.
2. If `review_threads` is `null` (unreadable) and the ruleset requires
resolution, 3.3 does not say what happens. No fixture.
3. `CI-BROKEN { cause, checks }` has a single cause, but different
required checks can have different causes. Fixtures avoid mixing;
proposal: report the cause of the first matching clause in the order
listed in step 4.
4. NEEDS-REVIEW `ReviewBlocker` values are not enumerated; the corpus
uses `changes-requested`, `unresolved-threads`, `approvals-missing`,
`blocked-unexplained`. SUPERSEDED reasons used: `head-already-landed`,
`empty-diff`, `newer-duplicate`, `base-branch-gone`,
`base-not-default-or-release`, `bump-superseded`.
5. Step 3 with a head `Fail` and an `Absent` base tip is neither
introduced nor inherited; the corpus follows the doc (falls to
`NeverOnBase`).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01J4QvDjgxz1iRFdu63KxE1K

**Update (after architect 7208a2e and hub provisional rulings):**
signatures are now complete-set (failed_count == identities; subset
inheritance); new fixtures for complete-subset inherited, new test in
red check, count != identities, generic-annotation weak, first-clause
cause order, threads-unknown, named owner act. Still unverified against
any verdict implementation (S3).

---
_Generated by [Claude Code](https://claude.ai/code)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants