Repository navigation
Add advisory review and risk checks for the shadow week - #34
Conversation
The hosted reviewer is Greptile, so the review job and its secret references go. Nothing else in the file was left. Closes gabe4coding/puredori#12. Co-authored-by: Gabe <gpavanello@thefork.com>
Run the tier job on pull_request_target from the base branch, with the PR head fetched as data. Python runs isolated and uv ignores repo config. The reviewer signal is the Greptile Review check from greptile-apps on the current head SHA, and it can only raise a tier. Reviewer config is T2-hard. Closes #46. Co-authored-by: Gabe <gpavanello@thefork.com>
|
@greptileai review |
A missing, failed, pending, stale or wrong-app check lifts the deterministic tier one step: T0 to T1, T1 to T2-soft, T2-soft to T2-hard. It stops at T2-hard and leaves HOLD alone. A pass still does not lower a tier. Co-authored-by: Gabe <gpavanello@thefork.com>
[Critical impact] Adds the risk classification system and CI gates. Fix the stale review tiers and the classification of weakened CI before merging.
|
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review, edited] | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened, ready_for_review, edited] |
There was a problem hiding this comment.
Review results leave stale tiers
If risk reads a missing or pending Greptile review after a push, it posts T2-soft. A later successful review does not trigger another run, so the label and check stay wrong until someone edits or updates the PR. This makes the shadow-week results misleading. Recompute the tier when the review finishes, while keeping the classifier on trusted base-branch code.
| added_keys = {_key(l) for l in _meaningful(f.added)} | ||
| for line in _meaningful(f.removed): | ||
| if not (BUMPABLE.search(_key(line)) and _key(line) in added_keys): | ||
| return Reason("T2-hard", "workflow-weakened", f"`{f.path}` removes `{line.strip()[:80]}`") | ||
| return Reason("T2-soft", "workflow-additive", f"`{f.path}`: additive edit or pinned version bump") |
There was a problem hiding this comment.
Weakened checks get lower tiers
workflow_reason treats every addition-only edit as T2-soft. Adding continue-on-error: true to the existing sandbox test, or adding if: false to skip it, removes no lines and reaches this return. Those edits weaken CI but receive the tier intended for additive jobs instead of T2-hard. Check where added lines land and whether they disable existing checks.
A successful check is not enough. The latest greptile-apps[bot] summary must review this head at 4/5 or 5/5, and that bot must have no P0 or P1 inline comment on the head. The PR 47 review is the non-pass fixture. Co-authored-by: Gabe <gpavanello@thefork.com>
Intent
Start the shadow week of the validation loop on this repo, the same setup as gabe4coding/puredori#10 and gabe4coding/retroagent#58. Two new checks run on every PR. Both are advisory: they are not required, they never fail a PR, and nothing here merges, approves or changes repo settings.
review(.github/workflows/review.yml): two passes in one job.ci/github/shall-review.yml..github/scripts/general_review.py): one tool-less, isolatedclaude -pcall that checks for bugs, missing or weaker tests, silent behavior changes, PR body vs diff drift and irreversible changes. The PR text is passed as untrusted data. It also records the risk-judgment JSON from the design, which does not change the tier yet.::noticethat names the secret.risk(.github/workflows/risk.yml,.github/scripts/risk_tier.py,.github/risk.yml): the deterministic tiers HOLD / T2-hard / T2-soft / T1 / T0.risk tiercheck run (success for T0/T1, neutral for T2/HOLD, never failure) and as arisk:*label.AUTOMERGEisoff, every PR becomes T2-hard. It is read only.runtime/runner.mjs(the sandbox) andtests/runner.integration.mjs, the test that proves the sandbox layers. I added the test because weakening it weakens the sandbox guarantee.tests/*.check.mjsandtests/check.mjsare CI gates, so they count as code, not tests.scripts/format.sh, so theformatjob passes. No plugin files change, so no version bump..github/scripts/test_risk_tier.pyandtest_general_review.py, run by therisk (classifier tests)job.Secrets to add (Settings > Secrets and variables > Actions):
TYPESAFE_API_KEY: needed for shall's Jev rule selection.ANTHROPIC_API_KEYorCLAUDE_CODE_OAUTH_TOKEN: needed forclaude -pin both passes.This PR is T2-hard by its own rules, because it adds
.github/risk.ymland the review and risk workflows. Gabe reviews and merges it.Evidence
uv run --no-project --python 3.12 --with pyyaml==6.0.2 --with pytest -- python -m pytest -q .github/scriptspasses. actionlint is clean on both workflows.sh scripts/format.sh --check .,node tests/code.check.mjs,node tests/docs.check.mjsandnode tests/version.check.mjs origin/mainall pass ("no plugin files changed").T2-hard(hard paths:.github/risk.yml, the scripts and both workflows).runtime/runner.mjs; sensitive-path: touchestests/runner.integration.mjs.githooks/pre-commit; workflow-weakened:.github/workflows/test.ymlremoves- cron: "0 6 * * 1".github/workflows/test.yml: additive edit or pinned version bump; sensitive-path: touchestests/runner.integration.mjsruntime/runner.mjs; sensitive-path: touchestests/runner.integration.mjstests/runner.integration.mjs.github/workflows/test.yml: additive edit or pinned version bump; sensitive-path: touchesruntime/runner.mjsruntime/runner.mjs; sensitive-path: touchestests/runner.integration.mjsruntime/runner.mjs; sensitive-path: touchestests/runner.integration.mjsTotals: T0 3, T1 9, T2-soft 7, T2-hard 1.
Things to compare by hand this week: whether each T2-soft really needed you, and whether any T1 should have been T2.