You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(test-classifier): update onboarding to the passthrough wrapper + complete --help (#63)
The LOCAL_TEST_CLASSIFIER.md onboarding doc still shipped the old 22-line
three-branch zshrc function, which a developer would paste and get the stale
wrapper that drifts on re-vendor. Update it to the 5-line passthrough that
matches the dispatcher now owning all arg defaulting (#62), and describe the
no-arg/bare-ref/flags behavior as the dispatcher's.
Since the doc now points developers at `test-classifier --help`, make that help
actually complete: add an AI_REVIEW_HELP_ADDENDUM hook to the shared lib's
print_help (printed only if a dispatcher sets it — security dispatcher
unaffected) and have the test-classifier dispatcher document its own flags
(--pr/--post-comment/--submit/--gate/--json-only), the no-arg/bare-ref defaults,
and AI_RUN_SUITE / metricsai env.
Also fix the troubleshooting row for the dropped `[ -x ]` guard: a missing
dispatcher now surfaces as the shell's own no-such-file/permission-denied.
1.**Confirms you're in a git repo** — `git rev-parse --show-toplevel` doubles as
99
-
the repo check (empty → not a repo) and gives the authoritative root, so the
100
-
function works from any subdirectory.
101
-
2.**Locates the dispatcher** under `testing/classifier/` and confirms it's
102
-
executable.
103
-
3.**Runs the classifier** by calling the dispatcher:
104
-
-**no argument** → `--unpushed`: everything not yet pushed (committed +
105
-
staged). The base is your branch's upstream, falling back to the merge-base
106
-
with the remote default branch. If neither can be determined (e.g. a
107
-
brand-new branch with no remote), it errors and asks for an explicit ref
108
-
rather than silently classifying less than you expect.
109
-
-**a bare ref** → `--against <ref>`: the committed range `<ref>..HEAD`.
110
-
-**anything starting with `-`** → passed straight through to the dispatcher.
111
-
This is how you post to a PR — `test-classifier --pr 42 --post-comment`
112
-
(or just `--post-comment` to auto-discover the current branch's PR), plus
113
-
any other dispatcher flag (`--dry-run`, `--json-only`, …). You can combine a
114
-
ref with flags too: `test-classifier origin/main --post-comment`.
72
+
The function is a thin passthrough: it finds the repo root and forwards every
73
+
argument to the dispatcher. **All argument handling lives in the dispatcher**
74
+
(versioned with the bundle), so the function never goes stale when you re-vendor.
75
+
It forwards args verbatim, and the dispatcher applies these defaults:
76
+
77
+
-**no argument** → `--unpushed`: everything not yet pushed (committed +
78
+
staged). The base is your branch's upstream, falling back to the merge-base
79
+
with the remote default branch. If neither can be determined (e.g. a
80
+
brand-new branch with no remote), it errors and asks for an explicit ref
81
+
rather than silently classifying less than you expect.
82
+
-**a bare ref** (e.g. `test-classifier origin/main`) → `--against <ref>`: the
83
+
committed range `<ref>..HEAD`.
84
+
-**any flags** → used directly. This is how you post to a PR —
85
+
`test-classifier --pr 42 --post-comment` (or just `--post-comment` to
86
+
auto-discover the current branch's PR), plus any other dispatcher flag
87
+
(`--dry-run`, `--json-only`, …). You can combine a ref with flags too:
88
+
`test-classifier origin/main --post-comment`.
89
+
90
+
Prefix `AI_RUN_SUITE=1` to run the suite locally (OBSERVED) instead of inferring
91
+
from the diff: `AI_RUN_SUITE=1 test-classifier`.
115
92
116
93
---
117
94
@@ -232,7 +209,7 @@ run (Path B) is still the recorded, metrics-feeding pass; this is your preview.
232
209
| Symptom | Cause / fix |
233
210
|---|---|
234
211
|`✗ not inside a git repository`| You're not in a git work tree. `cd` into the repo. |
235
-
|`✗ test-classifier dispatcher not found/executable`| The bundle isn't installed under `testing/classifier/`, or the script lost its `+x` bit. Re-install / `chmod +x`. |
212
+
|`no such file or directory` / `permission denied` on the dispatcher path| The bundle isn't installed under `testing/classifier/`, or the script lost its `+x` bit. Re-install / `chmod +x`. |
236
213
|`--unpushed: couldn't determine what's been pushed`| No upstream and no remote default branch (e.g. brand-new branch, no remote). Pass an explicit base: `test-classifier origin/main`. |
237
214
|`AI_REVIEW_TOOL … not set`| Export `AI_REVIEW_TOOL=claude` (or `codex`/`copilot`); see `README.md`. |
238
215
| Classification seems to miss recent edits |`--unpushed` excludes *unstaged* changes. `git add` or commit them first. |
0 commit comments