Repository navigation
Add advisory review and risk checks for the shadow week - #58
Conversation
…from the title only
The review job ran on pull_request, so the PR's own workflow ran with the ANTHROPIC, OAuth and TypeSafe secrets. Nothing in that file is left without those secrets, so the workflow is gone. general_review.py stays on disk; no job runs it. Closes gabe4coding/puredori#12 Co-authored-by: Gabe <gpavanello@thefork.com>
Port the risk-gate hardening. The tier job runs on pull_request_target with the workflow, rules and classifier from the base branch. The PR head is fetched as data and never executed. Python runs with -I and uv with --no-config. The classifier tests job has contents: read only and no stored git credentials. Paths come from git diff --name-status -z. The diff uses --text and --no-textconv, and lines split at newlines only. A test-only change that edits an assertion or adds skip, only or todo is T1. A file list that disagrees with the diff is T2-hard. The reviewer signal is only the Greptile Review check from greptile-apps on the current head SHA. A failed, missing, pending or stale check, or a check from another app, has not passed and raises the tier one step, never past T2-hard. A pass never lowers a tier. greptile.json, .greptile/**, .coderabbit.yaml and .coderabbit.yml are T2-hard. Co-authored-by: Gabe <gpavanello@thefork.com>
|
@greptileai review |
[Critical impact] Adds infrastructure that gates pull request merges. Satisfy the required slow-test markers before merging; the workflow-tier classification issue is a non-blocking advisory defect.
|
| 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.
Disabled tests get weaker tiers
Adding continue-on-error: true or if: false to an existing test job produces no removed lines, so workflow_reason returns T2-soft. Either addition can weaken the test job in .github/workflows/test.yml, yet the advisory report treats it like a new job rather than a change that always requires owner review. Check these additions before returning T2-soft, and add regression tests.
| def test_cli_on_a_git_repo(tmp_path): | ||
| def git(*args): | ||
| subprocess.run(["git", "-c", "user.name=t", "-c", "user.email=t@t", *args], cwd=tmp_path, check=True, | ||
| capture_output=True) |
There was a problem hiding this comment.
Process tests lack slow markers
test_cli_on_a_git_repo and the tests that call _pr_repo start Git without @pytest.mark.slow. The repository requires that marker, or a module-level equivalent, on every test that starts a process. Mark these tests before merging; the same pattern appears in the quoted-path and .gitattributes tests.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
A pass also needs the latest greptile-apps[bot] summary on this head with Confidence Score at least 4/5, and no P0 or P1 inline comment from that bot on this commit. Missing, unparseable, another author, or another SHA is not a pass and still raises the tier one step, never past T2-hard. The claude-code-mode#47 review (score 0/5, three P1 comments) is the fixture and does not pass. The tier job fetches the check, the issue comments and the review comments with GET. issues: read is the new scope. 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 #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.bin/kb-guard,src/kb/redact.py,gitleaks_fetch.py,install.shandtemplates/data/.github/.tests/conftest.pyandtests/fixtures.pycount as code, not tests..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.scripts/testpasses (1177 tests).T2-hard(hard paths:.github/risk.yml, the scripts and both workflows).bin/kb-guard.github/workflows/test.yml: additive edit or pinned version bumpbin/kb-guardinstall.shinstall.shbin/kb-guardinstall.sh; sensitive-path: touchessrc/kb/gitleaks_fetch.pyTotals: T0 1, T1 12, T2-soft 7.
Things to compare by hand this week: whether each T2-soft really needed you, and whether any T1 should have been T2.