Skip to content

CI pre-commit hook job; owner labeling tool for real-history flags - #4

Merged
Shriram28Baskar merged 2 commits into
mainfrom
ci-precommit-and-labeling
Nov 22, 2026
Merged

Shriram28Baskar merged 2 commits into
mainfrom
ci-precommit-and-labeling

Conversation

@Shriram28Baskar

@Shriram28Baskar Shriram28Baskar commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Two additions after 0.2.1. No engine source changed, so the benchmark artifacts are untouched.

CI: the pre-commit hook on Linux

  • A new precommit job runs .github/scripts/precommit_smoke.sh. It uses pre-commit try-repo to install this repository exactly as a user's repo: .../provecode would, then checks that a staged test weakening is blocked (S2) and a staged honest change passes.
  • I checked locally that the script fails against a copy of the repository whose hook entry is broken ("did not block a staged test weakening").

Research: docs/research/scripts/label.py (brief Phase 6 tooling)

  • For each commit the real-history scan flagged (179), it shows the findings and the diff of the flagged files from the scan's own clone cache. It records the owner's weakening / legit / unsure and an optional reason in docs/research/labels/real_history_scan_v2.jsonl, which is append-only and resumable.
  • --sample N gives a fixed, reproducible sample per rule; 75 commits for N = 10.
  • --summary reports per-rule precision with Wilson 95% intervals.
  • It writes a label only after a keypress at an interactive terminal and refuses piped input (exit 2, nothing written). No label is included in this PR.
  • 12 tests (engine/tests/test_label_tool.py).

Verified locally

  • pytest engine/tests benchmark/test_benchmark.py: 672 passed, 14 skipped.
  • ruff on the new files: clean.
  • On the real data, --summary lists 10 rules and 179 flagged commits, with "not measured until labels exist". Piped input is refused. show() displays a real commit's findings and diff.

Also checked tonight (in the demo repository, not in this PR)

  • The GitHub Action @v0.2.1 on provecode-action-demo, in both modes:
    • the weakening PR fails, and in contract mode it is FAILED with S2 blocking on C1;
    • the honest PR passes;
    • a PR that deletes C1 from the contract and loosens its test fails in contract mode (FAILED, CONTRACT_TOUCHED, and S2 still on C1), while the repository's own tests pass.
  • uv tool install and pipx installs of v0.2.1 print provecode 0.2.1 and block a weakening.

… checks it blocks a staged weakening and passes an honest change
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
provecode Ready Ready Preview Nov 22, 2026 5:08pm UTC

…iff and findings per commit, append-only JSONL labels, reproducible per-rule sample, Wilson precision summary; refuses non-interactive input); tests
@Shriram28Baskar
Shriram28Baskar marked this pull request as ready for review November 22, 2026 17:08
@Shriram28Baskar
Shriram28Baskar merged commit 42008a5 into main Nov 22, 2026
9 checks passed
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