claude-dev-env 8.11.1 → 8.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/e-code-review/SKILL.md +24 -71
- package/.agents/skills/e-code-review/reference/fix.md +7 -78
- package/.agents/skills/e-code-review/reference/high.md +129 -0
- package/.agents/skills/e-code-review/reference/low.md +20 -51
- package/.agents/skills/e-code-review/reference/max.md +169 -0
- package/.agents/skills/e-code-review/reference/medium.md +7 -191
- package/.agents/skills/e-code-review/reference/xhigh.md +47 -91
- package/.agents/skills/pull-request/scripts/test_pull_request.py +1 -1
- package/.agents/skills-archived/pr-converge/scripts/test_check_convergence.py +4 -4
- package/_shared/advisor/reference/astra-rung.md +7 -7
- package/_shared/advisor/reference/third-party-bind.md +2 -2
- package/_shared/advisor/scripts/codex_astra_advisor.py +33 -26
- package/_shared/advisor/scripts/codex_astra_preflight.py +57 -55
- package/_shared/advisor/scripts/config/advisor_scripts_constants/astra_advisor_constants.py +8 -8
- package/_shared/advisor/scripts/tests/test_codex_astra_advisor.py +69 -23
- package/_shared/advisor/scripts/tests/test_codex_astra_preflight.py +4 -4
- package/_shared/pr-loop/scripts/check_convergence.py +54 -49
- package/_shared/pr-loop/scripts/codex_review_scripts_constants/run_constants.py +4 -0
- package/_shared/pr-loop/scripts/pr_converge_scripts_constants/convergence_gate_constants.py +10 -1
- package/_shared/pr-loop/scripts/run_codex_review.py +4 -6
- package/_shared/pr-loop/scripts/test_check_convergence.py +6 -6
- package/_shared/pr-loop/scripts/test_check_convergence_codex.py +73 -31
- package/_shared/pr-loop/scripts/test_check_convergence_contract.py +2 -2
- package/_shared/pr-loop/scripts/tests/test__claude_permissions_common.py +2 -2
- package/bin/git_hooks_installer.test.mjs +1 -1
- package/bin/install-constants.mjs +1 -6
- package/bin/install.agents-home.test.mjs +9 -9
- package/bin/install.cursor-rules.test.mjs +24 -51
- package/bin/install.mjs +16 -70
- package/commands/sr-loop.md +3 -1
- package/docs/codex-accounts.md +79 -0
- package/hooks/blocking/test_duplicate_rmtree_helper_blocker.py +5 -5
- package/hooks/blocking/test_pii_scanner.py +1 -1
- package/hooks/blocking/test_pytest_testpaths_orphan_blocker.py +2 -2
- package/hooks/git-hooks/conftest.py +16 -0
- package/hooks/git-hooks/git_hooks_constants/verification_notice_constants.py +1 -1
- package/hooks/git-hooks/test_post_commit.py +1 -1
- package/hooks/git-hooks/test_pre_commit.py +1 -1
- package/hooks/git-hooks/test_pre_push.py +2 -2
- package/hooks/git-hooks/test_verification_start.py +1 -1
- package/hooks/git-hooks/verification_notice.py +2 -2
- package/hooks/git-hooks/verification_notice_context.py +21 -2
- package/hooks/git-hooks/verification_start.py +2 -3
- package/hooks/hooks_constants/code_rules_path_utils_constants.py +0 -1
- package/package.json +1 -1
- package/rules/durable-post-artifacts.md +4 -3
- package/scripts/claude_account_profile.py +21 -9
- package/scripts/codex_account_choice.py +396 -0
- package/scripts/codex_account_meters.py +372 -0
- package/scripts/dev_env_scripts_constants/codex_account_constants.py +141 -0
- package/scripts/dev_env_scripts_constants/private_term_constants.py +17 -2
- package/scripts/private_term_scan.py +6 -2
- package/scripts/repository_checks/config/constants.py +1 -0
- package/scripts/repository_checks/tracked_private_terms.py +7 -0
- package/scripts/test_claude_account_profile.py +12 -0
- package/scripts/test_codex_account_choice.py +276 -0
- package/scripts/test_codex_account_meters.py +205 -0
- package/scripts/tests/test_automatic_advisory.py +3 -3
- package/scripts/tests/test_automatic_advisory_polling.py +1 -1
- package/scripts/tests/test_automatic_advisory_recovery.py +1 -1
- package/scripts/tests/test_closed_pr_label.py +1 -1
- package/scripts/tests/test_private_term_scan.py +28 -0
- package/scripts/tests/test_review_closure.py +2 -2
- package/scripts/tests/test_review_closure_model.py +2 -2
- package/scripts/tests/test_rules.py +2 -83
- package/scripts/tests/test_tracked_private_terms.py +15 -0
- package/scripts/tests/test_verification_notice.py +29 -13
- package/.agents/skills/cert-classification-rule/SKILL.md +0 -224
- package/.agents/skills/cert-classification-rule/scripts/resort_cert_folders.py +0 -158
- package/.agents/skills/e-code-review/preflight-proposal.contract.test.mjs +0 -20
- package/.agents/skills/e-code-review/reference/effort-evaluation.md +0 -35
- package/.agents/skills/e-code-review/reference/loop.md +0 -261
- package/.agents/skills/e-code-review/reference/mode-contract.test.mjs +0 -67
- package/.agents/skills/e-code-review/reference/preflight-proposal.md +0 -75
- package/.agents/skills/e-code-review/reference/runner-selection.md +0 -40
- package/.agents/skills/e-code-review/scripts/config/e_code_review_effort_constants/__init__.py +0 -41
- package/.agents/skills/e-code-review/scripts/config/e_code_review_effort_constants/effort_constants.py +0 -40
- package/.agents/skills/e-code-review/scripts/e_code_review_scripts_constants/__init__.py +0 -1
- package/.agents/skills/e-code-review/scripts/e_code_review_scripts_constants/finding_pipeline_constants.py +0 -49
- package/.agents/skills/e-code-review/scripts/e_code_review_scripts_constants/grok_code_review_constants.py +0 -55
- package/.agents/skills/e-code-review/scripts/effort_defaults_evidence.json +0 -186
- package/.agents/skills/e-code-review/scripts/effort_evaluation.py +0 -362
- package/.agents/skills/e-code-review/scripts/finding_pipeline.py +0 -140
- package/.agents/skills/e-code-review/scripts/fixtures/demanding.json +0 -26
- package/.agents/skills/e-code-review/scripts/fixtures/easy.json +0 -14
- package/.agents/skills/e-code-review/scripts/fixtures/medium.json +0 -20
- package/.agents/skills/e-code-review/scripts/grok_code_review.py +0 -230
- package/.agents/skills/e-code-review/scripts/test_effort_evaluation.py +0 -180
- package/.agents/skills/e-code-review/scripts/test_finding_pipeline.py +0 -197
- package/.agents/skills/e-code-review/scripts/test_grok_code_review.py +0 -289
- package/_shared/pr-loop/scripts/codex_review_scripts_constants/codex_usage_probe_constants.py +0 -82
- package/_shared/pr-loop/scripts/codex_usage_probe.py +0 -573
- package/_shared/pr-loop/scripts/test_codex_usage_probe.py +0 -683
- package/scripts/sync_to_cursor/AGENTS.md +0 -1
- package/scripts/sync_to_cursor/CLAUDE.md +0 -1
- package/scripts/sync_to_cursor/__init__.py +0 -13
- package/scripts/sync_to_cursor/canonical_docs.py +0 -66
- package/scripts/sync_to_cursor/config/__init__.py +0 -8
- package/scripts/sync_to_cursor/engine.py +0 -219
- package/scripts/sync_to_cursor/hashing.py +0 -7
- package/scripts/sync_to_cursor/paths.py +0 -18
- package/scripts/sync_to_cursor/rules.py +0 -494
- package/scripts/sync_to_cursor.py +0 -22
- package/scripts/tests/test_engine.py +0 -101
- package/scripts/tests/test_sync_to_cursor.py +0 -315
|
@@ -1,198 +1,14 @@
|
|
|
1
|
-
`
|
|
1
|
+
`minimal prompt → single careful diff pass → ≤15 findings`
|
|
2
2
|
|
|
3
|
-
You are reviewing for
|
|
4
|
-
so a later consumer can select maintainer-action findings. **Collection
|
|
5
|
-
reports every finding** (including `low` and `nit`); do not drop by
|
|
6
|
-
severity during collection. Severity filtering is a separate consumer stage
|
|
7
|
-
after the collection record is complete.
|
|
8
|
-
|
|
9
|
-
## Phase 0 — Gather the diff
|
|
10
|
-
|
|
11
|
-
Run `git diff @{upstream}...HEAD` (or `git diff main...HEAD` / `git diff HEAD~1`
|
|
3
|
+
You are reviewing a pull request for bugs. Run `git diff @{upstream}...HEAD` (or `git diff main...HEAD` / `git diff HEAD~1`
|
|
12
4
|
if there's no upstream) to get the unified diff under review. If there are
|
|
13
5
|
uncommitted changes, or the range diff is empty, also run `git diff HEAD` and
|
|
14
6
|
include the working-tree changes in scope — the review often runs before the
|
|
15
|
-
commit. If a
|
|
16
|
-
|
|
17
|
-
`default-range` — the diff this phase gathers when no target is passed — and it
|
|
18
|
-
may mix those forms. A loop round widens a target by adding a path to whatever
|
|
19
|
-
it started as, and it names `default-range` as an item whenever the round it
|
|
20
|
-
widened was given no target argument, so the original scope stays under review.
|
|
21
|
-
When a target names more than one item, gather each item's diff and take their
|
|
22
|
-
union — a shared hunk counted once, an empty one adding nothing — as the
|
|
23
|
-
target's diff. Treat this diff as the review scope.
|
|
24
|
-
|
|
25
|
-
## Phase 1 — Find candidates (3 correctness angles + 3 cleanup angles + 1 altitude angle + 1 conventions angle)
|
|
26
|
-
|
|
27
|
-
Run **8 independent finder angles** via the Agent tool. Each surfaces
|
|
28
|
-
candidate findings with `file`, `line`, a one-line `summary`, and a concrete
|
|
29
|
-
`failure_scenario`. If the Agent tool is not available in your current tool
|
|
30
|
-
set, do not error — perform each angle (and each verification) yourself,
|
|
31
|
-
sequentially, in this context.
|
|
32
|
-
|
|
33
|
-
### Angle A — line-by-line diff scan
|
|
34
|
-
|
|
35
|
-
Read every hunk in the diff, line by line. Then Read the enclosing function for
|
|
36
|
-
each hunk — bugs in unchanged lines of a touched function are in scope (the PR
|
|
37
|
-
re-exposes or fails to fix them). For every line ask: what input, state, timing,
|
|
38
|
-
or platform makes this line wrong? Look for inverted/wrong conditions,
|
|
39
|
-
off-by-one, null/undefined deref, missing `await`, falsy-zero checks,
|
|
40
|
-
wrong-variable copy-paste, error swallowed in catch, unescaped regex metachars.
|
|
41
|
-
|
|
42
|
-
### Angle B — removed-behavior auditor
|
|
43
|
-
|
|
44
|
-
For every line the diff DELETES or replaces, name the invariant or behavior it
|
|
45
|
-
enforced, then search the new code for where that invariant is re-established.
|
|
46
|
-
If you can't find it, that's a candidate: a removed guard, a dropped error
|
|
47
|
-
path, a narrowed validation, a deleted test that was covering a case.
|
|
48
|
-
|
|
49
|
-
### Angle C — cross-file tracer
|
|
50
|
-
|
|
51
|
-
For each function the diff changes, find its callers (Grep for the symbol) and
|
|
52
|
-
check whether the change breaks any call site: a new precondition, a changed
|
|
53
|
-
return shape, a new exception, a timing/ordering dependency. Also check callees:
|
|
54
|
-
does a parallel change in the same PR make a call unsafe?
|
|
55
|
-
|
|
56
|
-
### Reuse
|
|
57
|
-
|
|
58
|
-
The angles above hunt for bugs; this one and the next two hunt for cleanup in
|
|
59
|
-
the changed code. Flag new code that re-implements something the codebase
|
|
60
|
-
already has — Grep shared/utility modules and files adjacent to the change,
|
|
61
|
-
and name the existing helper to call instead.
|
|
62
|
-
|
|
63
|
-
### Simplification
|
|
64
|
-
|
|
65
|
-
Flag unnecessary complexity the diff adds: redundant or derivable state,
|
|
66
|
-
copy-paste with slight variation, deep nesting, dead code left behind. Name
|
|
67
|
-
the simpler form that does the same job.
|
|
68
|
-
|
|
69
|
-
### Efficiency
|
|
70
|
-
|
|
71
|
-
Flag wasted work the diff introduces: redundant computation or repeated I/O,
|
|
72
|
-
independent operations run sequentially, blocking work added to startup or
|
|
73
|
-
hot paths. Also flag long-lived objects built from closures or captured
|
|
74
|
-
environments — they keep the entire enclosing scope alive for the object's
|
|
75
|
-
lifetime (a memory leak when that scope holds large values); prefer a
|
|
76
|
-
class/struct that copies only the fields it needs. Name the cheaper
|
|
77
|
-
alternative.
|
|
78
|
-
|
|
79
|
-
### Altitude
|
|
80
|
-
|
|
81
|
-
Check that each change is implemented at the right depth, not as a fragile
|
|
82
|
-
bandaid. Special cases layered on shared infrastructure are a sign the fix
|
|
83
|
-
isn't deep enough — prefer generalizing the underlying mechanism over adding
|
|
84
|
-
special cases.
|
|
85
|
-
|
|
86
|
-
### Conventions (CLAUDE.md)
|
|
87
|
-
|
|
88
|
-
Find the CLAUDE.md files that govern the changed code: the user-level
|
|
89
|
-
~/.claude/CLAUDE.md, the repo-root CLAUDE.md, plus any CLAUDE.md or
|
|
90
|
-
CLAUDE.local.md in a directory that is an ancestor of a changed file (a
|
|
91
|
-
directory's CLAUDE.md only applies to files at or below it). Read each one
|
|
92
|
-
that exists, then check the diff for clear violations of the rules they state.
|
|
93
|
-
|
|
94
|
-
Only flag a violation when you can quote the exact rule and the exact line
|
|
95
|
-
that breaks it — no style preferences, no vague "spirit of the doc"
|
|
96
|
-
inferences. In the finding, name the CLAUDE.md path and quote the rule so the
|
|
97
|
-
report can cite it. If no CLAUDE.md applies, return nothing for this angle.
|
|
98
|
-
|
|
99
|
-
Cleanup, altitude, and conventions candidates use the same
|
|
100
|
-
`file`/`line`/`summary` shape; in `failure_scenario`, state the concrete
|
|
101
|
-
cost (what is duplicated, wasted, harder to maintain, or which CLAUDE.md rule
|
|
102
|
-
is broken) instead of a crash. Correctness bugs always outrank cleanup,
|
|
103
|
-
altitude, and conventions findings.
|
|
104
|
-
|
|
105
|
-
Pass every candidate with a nameable failure scenario through — finders that
|
|
106
|
-
silently drop half-believed candidates bypass the verify step and are the
|
|
107
|
-
dominant cause of misses.
|
|
108
|
-
|
|
109
|
-
## Phase 2 — Verify (1-vote, 3-state)
|
|
110
|
-
|
|
111
|
-
Dedup candidates that point at the same line/mechanism, keeping the one with
|
|
112
|
-
the most concrete failure scenario. For each remaining candidate, run **one
|
|
113
|
-
verifier** via the Agent tool: give it the diff, the relevant
|
|
114
|
-
file(s), and the candidate, and have it return exactly one of:
|
|
115
|
-
|
|
116
|
-
- **CONFIRMED** — can name the inputs/state that trigger it and the wrong
|
|
117
|
-
output or crash. Quote the line.
|
|
118
|
-
- **PLAUSIBLE** — mechanism is present in the code, trigger is uncertain (timing, env,
|
|
119
|
-
config). State what would confirm it.
|
|
120
|
-
- **REFUTED** — factually wrong (code doesn't say that) or guarded elsewhere.
|
|
121
|
-
Quote the line that proves it.
|
|
122
|
-
|
|
123
|
-
Keep candidates where the vote is CONFIRMED or PLAUSIBLE.
|
|
124
|
-
|
|
125
|
-
## Output
|
|
126
|
-
|
|
127
|
-
**Collection stage first.** Keep every CONFIRMED or PLAUSIBLE finding in the
|
|
128
|
-
collection record, including `low` and `nit`. Drop only REFUTED candidates.
|
|
129
|
-
Do not drop a finding because its severity is low.
|
|
130
|
-
|
|
131
|
-
Report this review's results — `{level, findings}` — through the structured
|
|
132
|
-
findings-report call: the mechanism that renders a review's results as a typed
|
|
133
|
-
list in the host UI, ranked most-severe first. Each **retained** entry carries
|
|
134
|
-
every field below. Do not emit a finding that lacks `severity` or `verdict`.
|
|
135
|
-
|
|
136
|
-
**Severity filter stage (later consumer).** After the collection record is
|
|
137
|
-
complete, a separate consumer may filter by minimum severity for action or
|
|
138
|
-
display. That filter must not rewrite or discard fields on the collection
|
|
139
|
-
record itself.
|
|
140
|
-
|
|
141
|
-
| Field | Required | Value |
|
|
142
|
-
|---|---|---|
|
|
143
|
-
| `file` | yes | path under review |
|
|
144
|
-
| `line` | yes | 1-based line number |
|
|
145
|
-
| `summary` | yes | full claim |
|
|
146
|
-
| `short_summary` | yes | claim compressed to ≤60 characters, no rationale or consequence clause |
|
|
147
|
-
| `failure_scenario` | yes | concrete trigger and wrong outcome, or concrete cost for cleanup |
|
|
148
|
-
| `category` | yes | short kebab-case slug for the angle (`correctness`, `simplification`, `efficiency`, `reuse`, `altitude`, `conventions`, or a tighter slug like `test-coverage`) |
|
|
149
|
-
| `severity` | yes | one of `blocker`, `high`, `medium`, `low`, `nit` |
|
|
150
|
-
| `verdict` | yes | `CONFIRMED` or `PLAUSIBLE` from Phase 2 |
|
|
151
|
-
|
|
152
|
-
**Severity rules.** Assign exactly one token from the frozen set above. Use
|
|
153
|
-
`nit` only when all five hold: the change is localized clarity, formatting, or
|
|
154
|
-
a typo; correctness, security, data, and API behavior stay identical; test
|
|
155
|
-
coverage and operability stay identical; dependencies and rollout stay
|
|
156
|
-
identical; the fix is mechanical and bounded. Any other retained finding is
|
|
157
|
-
`low` or higher. Correctness bugs outrank cleanup, altitude, and conventions.
|
|
158
|
-
|
|
159
|
-
If nothing survives verification, make that call with an empty array. Do not
|
|
160
|
-
also print the findings as text, and do not create or publish an artifact of
|
|
161
|
-
the review — the structured call is the report.
|
|
162
|
-
|
|
163
|
-
## Applying fixes (--fix)
|
|
164
|
-
|
|
165
|
-
The `--fix` flag was passed. Follow `reference\fix.md` (relative
|
|
166
|
-
to this skill's folder) for the exact fix, code-rules-gate, and skip-handling
|
|
167
|
-
behavior — it governs which agent applies each fix, how the code-rules gate
|
|
168
|
-
runs, how a skip is logged, and how outcomes get reported. Do not repeat the
|
|
169
|
-
findings as text; follow that document's reporting rules once fixes land.
|
|
170
|
-
|
|
171
|
-
When `loop` is also set, skip this section.
|
|
172
|
-
|
|
173
|
-
## If findings are fixed later
|
|
174
|
-
|
|
175
|
-
Whenever a reported finding is fixed later in this session — the user asks you
|
|
176
|
-
to fix it, or later work fixes it incidentally — follow `reference\fix.md`'s
|
|
177
|
-
reporting rules again: report the same findings through the structured
|
|
178
|
-
findings-report call, each carrying an `outcome`. Do not repeat the findings
|
|
179
|
-
as text. Make that call immediately after the fixes land, before any prose
|
|
180
|
-
summary; the host UI's per-finding status updates only from that call.
|
|
181
|
-
|
|
182
|
-
## Looping (`loop`)
|
|
7
|
+
commit. If a PR number, branch name, or file path was passed as an argument,
|
|
8
|
+
review that target instead. Treat this diff as the review scope.
|
|
183
9
|
|
|
184
|
-
|
|
185
|
-
skill's folder) for how to re-run Phases 0–2 and Output repeatedly — including
|
|
186
|
-
its exit condition and re-invocation rules. Schedule no fix pass of your own
|
|
187
|
-
here: when `--fix` is also present, `reference\loop.md`'s gate sequence owns the
|
|
188
|
-
round's fixing and loads `reference\fix.md` for the mechanics. Do not treat a
|
|
189
|
-
single pass through this document as complete while `loop` is active; hand
|
|
190
|
-
control to that document, and do not stop at Output.
|
|
10
|
+
Review the diff as a careful senior engineer would: read every hunk, open the surrounding files for context as needed (Read, Grep, git log/blame/show), and hunt for correctness issues — wrong or inverted conditions, off-by-one, null/undefined dereference, missing `await`, dropped error handling, removed guards or validations, broken callers of changed functions, races. Report failure modes and leave style out; every finding needs a concrete scenario in which the code misbehaves.
|
|
191
11
|
|
|
192
|
-
|
|
193
|
-
is already running and has handed this document its target, the round owns the
|
|
194
|
-
loop: end at Output with the findings report and return those findings to
|
|
195
|
-
`reference\loop.md`'s gate sequence, rather than handing control to that
|
|
196
|
-
document again from here.
|
|
12
|
+
When you are done, submit at most 15 findings via the ReportFindings tool, filling its fields as defined — for each: the file path and start line, a severity, and a comment that states the issue and the concrete scenario in which the code misbehaves. Quality over quantity: include every issue you believe is a bug, and nothing you don't.
|
|
197
13
|
|
|
198
|
-
|
|
14
|
+
After the tool call, also restate the findings in your final reply — one line each, `file:line — summary` — so they stay visible in sessions that do not render tool output.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
`xhigh effort →
|
|
1
|
+
`xhigh effort → 10 inline angles → dedup (no verify) → sweep → ≤15 findings`
|
|
2
2
|
|
|
3
3
|
You are reviewing for **recall** at extra-high effort: catch every bug. At
|
|
4
|
-
this level,
|
|
4
|
+
this level, surface a finding even when it may be a false positive. A
|
|
5
5
|
missed bug ships. Err on the side of surfacing.
|
|
6
6
|
|
|
7
7
|
## Phase 0 — Gather the diff
|
|
@@ -10,23 +10,15 @@ Run `git diff @{upstream}...HEAD` (or `git diff main...HEAD` / `git diff HEAD~1`
|
|
|
10
10
|
if there's no upstream) to get the unified diff under review. If there are
|
|
11
11
|
uncommitted changes, or the range diff is empty, also run `git diff HEAD` and
|
|
12
12
|
include the working-tree changes in scope — the review often runs before the
|
|
13
|
-
commit. If a
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## Phase 1 — Find candidates (5 correctness angles + 3 cleanup angles + 1 altitude angle + 1 conventions angle)
|
|
24
|
-
|
|
25
|
-
Run **10 independent finder angles** via the Agent tool. Each surfaces
|
|
26
|
-
candidate findings. Do NOT let one angle's conclusions suppress another's — if
|
|
27
|
-
two angles flag the same line for different reasons, record both. If the Agent
|
|
28
|
-
tool is not available in your current tool set, do not error — perform each
|
|
29
|
-
angle (and each verification) yourself, sequentially, in this context.
|
|
13
|
+
commit. If a PR number, branch name, or file path was passed as an argument,
|
|
14
|
+
review that target instead. Treat this diff as the review scope.
|
|
15
|
+
|
|
16
|
+
## Phase 1 — Find candidates (5 correctness angles + 3 cleanup angles + 1 altitude angle + 1 conventions angle, up to 8 each)
|
|
17
|
+
|
|
18
|
+
Run **10 independent finder angles** in sequence yourself, in THIS context — do NOT spawn subagents for them. Each
|
|
19
|
+
surfaces **up to 8 candidate findings**. Do NOT let one angle's conclusions
|
|
20
|
+
suppress another's — if two angles flag the same line for different reasons,
|
|
21
|
+
record both.
|
|
30
22
|
|
|
31
23
|
### Angle A — line-by-line diff scan
|
|
32
24
|
|
|
@@ -39,10 +31,10 @@ wrong-variable copy-paste, error swallowed in catch, unescaped regex metachars.
|
|
|
39
31
|
|
|
40
32
|
### Angle B — removed-behavior auditor
|
|
41
33
|
|
|
42
|
-
For every line the diff DELETES or
|
|
34
|
+
For every line the diff DELETES or rewrites, name the invariant or behavior it
|
|
43
35
|
enforced, then search the new code for where that invariant is re-established.
|
|
44
36
|
If you can't find it, that's a candidate: a removed guard, a dropped error
|
|
45
|
-
path, a narrowed validation, a deleted test that was covering a case.
|
|
37
|
+
path, a narrowed validation, a deleted test that was covering a live case.
|
|
46
38
|
|
|
47
39
|
### Angle C — cross-file tracer
|
|
48
40
|
|
|
@@ -63,7 +55,7 @@ timezone/DST drift; float equality. Flag any instance the diff introduces.
|
|
|
63
55
|
When the PR adds or modifies a type that wraps another (cache, proxy, decorator,
|
|
64
56
|
adapter): check that every method routes to the wrapped instance and not back
|
|
65
57
|
through a registry/session/global — e.g. a caching provider holding a
|
|
66
|
-
`delegate` field that resolves IDs via `session.get(...)`
|
|
58
|
+
`delegate` field that resolves IDs via `session.get(...)` where it should call
|
|
67
59
|
`delegate.get(...)` will re-enter the cache or recurse. Also check that the
|
|
68
60
|
wrapper forwards all the methods the callers use.
|
|
69
61
|
|
|
@@ -92,10 +84,11 @@ alternative.
|
|
|
92
84
|
|
|
93
85
|
### Altitude
|
|
94
86
|
|
|
95
|
-
Check that each change
|
|
96
|
-
bandaid. Special cases layered on shared
|
|
97
|
-
isn't deep enough — prefer
|
|
98
|
-
special cases
|
|
87
|
+
Check that each change fixes the root cause at the right depth. A fix that
|
|
88
|
+
patches a symptom with a fragile bandaid is a finding. Special cases layered on shared
|
|
89
|
+
infrastructure are a sign the fix isn't deep enough — prefer the simpler, more
|
|
90
|
+
general change to the underlying mechanism over adding special cases, and name
|
|
91
|
+
that change.
|
|
99
92
|
|
|
100
93
|
### Conventions (CLAUDE.md)
|
|
101
94
|
|
|
@@ -113,31 +106,16 @@ report can cite it. If no CLAUDE.md applies, return nothing for this angle.
|
|
|
113
106
|
Cleanup, altitude, and conventions candidates use the same
|
|
114
107
|
`file`/`line`/`summary` shape; in `failure_scenario`, state the concrete
|
|
115
108
|
cost (what is duplicated, wasted, harder to maintain, or which CLAUDE.md rule
|
|
116
|
-
is broken)
|
|
117
|
-
altitude, and conventions findings.
|
|
118
|
-
|
|
119
|
-
## Phase 2 — Verify (1-vote, 3-state)
|
|
109
|
+
is broken) in the place a crash would go. Correctness bugs always outrank cleanup,
|
|
110
|
+
altitude, and conventions findings when the output cap forces a cut.
|
|
120
111
|
|
|
121
|
-
|
|
122
|
-
the most concrete failure scenario. For each remaining candidate, run **one
|
|
123
|
-
verifier** via the Agent tool: give it the diff, the relevant
|
|
124
|
-
file(s), and the candidate, and have it return exactly one of:
|
|
112
|
+
## Phase 2 — Dedup only (no verify)
|
|
125
113
|
|
|
126
|
-
-
|
|
127
|
-
output or crash. Quote the line.
|
|
128
|
-
- **PLAUSIBLE** — mechanism is present in the code, trigger is uncertain (timing, env,
|
|
129
|
-
config). State what would confirm it.
|
|
130
|
-
- **REFUTED** — factually wrong (code doesn't say that) or guarded elsewhere.
|
|
131
|
-
Quote the line that proves it.
|
|
132
|
-
|
|
133
|
-
Keep candidates where the vote is CONFIRMED or PLAUSIBLE.
|
|
134
|
-
|
|
135
|
-
This is recall mode — a single non-REFUTED vote carries the finding. Do NOT
|
|
136
|
-
drop on uncertainty.
|
|
114
|
+
Pool all candidates. Dedup near-duplicates only (same defect, same location, same reason → keep one). Do NOT run verifiers; do NOT re-judge. Sort by severity. Do NOT drop on uncertainty.
|
|
137
115
|
|
|
138
116
|
## Phase 3 — Sweep for gaps
|
|
139
117
|
|
|
140
|
-
|
|
118
|
+
Take one more pass (same context — no subagent) as a fresh reviewer who has the deduplicated list. Re-read
|
|
141
119
|
the diff and enclosing functions looking ONLY for defects not already listed.
|
|
142
120
|
Do not re-derive or re-confirm anything already there — the job is gaps. Focus
|
|
143
121
|
on what the first pass tends to miss: moved/extracted code that dropped a guard
|
|
@@ -145,56 +123,34 @@ or anchor; second-tier footguns (dataclass default evaluated once, `hash()`
|
|
|
145
123
|
non-determinism, lock-scope shrink, predicate methods with side effects);
|
|
146
124
|
setup/teardown asymmetry in tests; config defaults flipped.
|
|
147
125
|
|
|
148
|
-
Surface additional candidates
|
|
149
|
-
If nothing new, return
|
|
126
|
+
Surface **up to 8 additional candidates**, each naming a defect not already on
|
|
127
|
+
the list. If nothing new, return nothing from this phase — do not pad.
|
|
150
128
|
|
|
151
129
|
## Output
|
|
152
130
|
|
|
153
|
-
|
|
154
|
-
findings-report call: the mechanism that renders a review's results as a typed
|
|
155
|
-
list in the host UI, ranked most-severe first. Each entry has `file`, `line`,
|
|
156
|
-
`summary`, `short_summary` — the claim compressed to ≤60 characters, no
|
|
157
|
-
rationale or consequence clause — `failure_scenario`, and `category` — a short
|
|
158
|
-
kebab-case slug for the angle that produced it (`correctness`,
|
|
159
|
-
`simplification`, `efficiency`, `reuse`, `altitude`, `conventions`, or a more
|
|
160
|
-
specific slug like `test-coverage` when one fits better) — plus `verdict` when
|
|
161
|
-
a verify pass produced one. If nothing survives verification, make that call
|
|
162
|
-
with an empty array. Do not also print the findings as text, and do not create
|
|
163
|
-
or publish an artifact of the review — the structured call is the report.
|
|
164
|
-
|
|
165
|
-
## Applying fixes (--fix)
|
|
131
|
+
Target **at least 7 findings**. If fewer findings exist, emit what you have — do not invent to hit the floor.
|
|
166
132
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
133
|
+
Call the ReportFindings tool once to report this review's results
|
|
134
|
+
with `{level, findings}`. `findings` is at most 15 entries ranked
|
|
135
|
+
most-severe first; each entry has `file`, `line`, `summary`,
|
|
136
|
+
`short_summary` — the claim compressed to ≤60 characters, no rationale
|
|
137
|
+
or consequence clause — `failure_scenario`, and `category` — a short kebab-case slug for the angle
|
|
138
|
+
that produced it (`correctness`, `simplification`, `efficiency`,
|
|
139
|
+
`reuse`, `altitude`, `conventions`, or a more specific slug like
|
|
140
|
+
`test-coverage` when one fits better) — plus `verdict` when a verify pass
|
|
141
|
+
produced one. If more than 15 survive, keep the 15 most severe. If
|
|
142
|
+
nothing survives, call it with an empty array. Do not also print
|
|
143
|
+
the findings as text, and do not create or publish an artifact of the review -
|
|
144
|
+
the tool call is the report.
|
|
172
145
|
|
|
173
|
-
When `loop` is also set, skip this section.
|
|
174
146
|
|
|
175
147
|
## If findings are fixed later
|
|
176
148
|
|
|
177
|
-
Whenever
|
|
178
|
-
to fix
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
as text.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
The `loop` arg was passed. Follow `reference\loop.md` (relative to this
|
|
187
|
-
skill's folder) for how to re-run Phases 0–3 and Output repeatedly — including
|
|
188
|
-
its exit condition and re-invocation rules. Schedule no fix pass of your own
|
|
189
|
-
here: when `--fix` is also present, `reference\loop.md`'s gate sequence owns the
|
|
190
|
-
round's fixing and loads `reference\fix.md` for the mechanics. Do not treat a
|
|
191
|
-
single pass through this document as complete while `loop` is active; hand
|
|
192
|
-
control to that document, and do not stop at Output.
|
|
193
|
-
|
|
194
|
-
That hand-off applies when this document is entered directly. When a loop round
|
|
195
|
-
is already running and has handed this document its target, the round owns the
|
|
196
|
-
loop: end at Output with the findings report and return those findings to
|
|
197
|
-
`reference\loop.md`'s gate sequence, rather than handing control to that
|
|
198
|
-
document again from here.
|
|
199
|
-
|
|
200
|
-
When `loop` was not passed, skip this section.
|
|
149
|
+
Whenever reported findings get fixed later in this session - the user asks you
|
|
150
|
+
to fix them, or later work fixes them incidentally - you MUST call ReportFindings again with the same findings, each
|
|
151
|
+
carrying an `outcome`: `fixed`, `no_change_needed` (the finding was wrong or
|
|
152
|
+
already handled), or `skipped` (valid but not applied). Do not repeat the
|
|
153
|
+
findings as text.
|
|
154
|
+
Make that call immediately after the fixes land, before any prose summary; the
|
|
155
|
+
host UI's per-finding status updates only from it, and without it the findings
|
|
156
|
+
stay marked unresolved.
|
|
@@ -22,7 +22,7 @@ import pull_request
|
|
|
22
22
|
REPOSITORY = "jl-cmd/claude-dev-env"
|
|
23
23
|
PR_NUMBER = "2518"
|
|
24
24
|
PR_TITLE = "feat(skills): add guarded pull request publication"
|
|
25
|
-
ACCOUNT_A = "
|
|
25
|
+
ACCOUNT_A = "octocat"
|
|
26
26
|
ACCOUNT_B = "ReviewBot"
|
|
27
27
|
BODY_FILENAME = "pull-request-body.md"
|
|
28
28
|
LINTER_PATH = _SCRIPTS_DIRECTORY.parents[3] / "scripts/durable_post_lint.py"
|
|
@@ -135,7 +135,7 @@ def should_pass_when_clean_bugteam_review_present_on_current_head(
|
|
|
135
135
|
check_convergence, "_gh_api_paginated", _make_stub_gh_paginated(reviews_payload)
|
|
136
136
|
)
|
|
137
137
|
passed, detail = check_convergence._check_bugteam_clean(
|
|
138
|
-
owner="
|
|
138
|
+
owner="octocat", repo="tests", number=42, head_sha=CURRENT_HEAD_SHA
|
|
139
139
|
)
|
|
140
140
|
assert passed is True
|
|
141
141
|
assert "clean bugteam audit" in detail
|
|
@@ -157,7 +157,7 @@ def should_fail_when_dirty_bugteam_review_present_on_current_head(
|
|
|
157
157
|
check_convergence, "_gh_api_paginated", _make_stub_gh_paginated(reviews_payload)
|
|
158
158
|
)
|
|
159
159
|
passed, detail = check_convergence._check_bugteam_clean(
|
|
160
|
-
owner="
|
|
160
|
+
owner="octocat", repo="tests", number=42, head_sha=CURRENT_HEAD_SHA
|
|
161
161
|
)
|
|
162
162
|
assert passed is False
|
|
163
163
|
assert "dirty bugteam audit" in detail
|
|
@@ -185,7 +185,7 @@ def should_fail_when_no_bugteam_review_present_on_current_head(
|
|
|
185
185
|
check_convergence, "_gh_api_paginated", _make_stub_gh_paginated(reviews_payload)
|
|
186
186
|
)
|
|
187
187
|
passed, detail = check_convergence._check_bugteam_clean(
|
|
188
|
-
owner="
|
|
188
|
+
owner="octocat", repo="tests", number=42, head_sha=CURRENT_HEAD_SHA
|
|
189
189
|
)
|
|
190
190
|
assert passed is False
|
|
191
191
|
assert "no bugteam review found" in detail
|
|
@@ -204,7 +204,7 @@ def should_fail_with_shape_detail_when_gh_returns_non_list_payload(
|
|
|
204
204
|
check_convergence, "_gh_api_paginated", stub_gh_api_paginated_returning_object
|
|
205
205
|
)
|
|
206
206
|
passed, detail = check_convergence._check_bugteam_clean(
|
|
207
|
-
owner="
|
|
207
|
+
owner="octocat", repo="tests", number=42, head_sha=CURRENT_HEAD_SHA
|
|
208
208
|
)
|
|
209
209
|
assert passed is False
|
|
210
210
|
assert "unexpected gh api response shape" in detail
|
|
@@ -14,26 +14,26 @@ A Windows `setx` write only updates the persisted user environment; only a proce
|
|
|
14
14
|
|
|
15
15
|
`ADVISOR_EFFORT` selects Codex `model_reasoning_effort` for Astra: `low`, `medium`, `high`, `xhigh`, or `max`. The policy default is `medium`, which sends `model_reasoning_effort="medium"`. Astra Xhigh and Max requests route to Medium. Pass `--effort <level>` on the helper to set effort for that Astra run without changing the environment. An unset value uses the policy default. An unknown value blocks advisor routing.
|
|
16
16
|
|
|
17
|
-
Every fallback reply carries a `fallback_kind` field. `declined` means policy closed the rung (flag off,
|
|
17
|
+
Every fallback reply carries a `fallback_kind` field. `declined` means policy closed the rung (flag off, or the account picker named no Codex account on the `normal` tier). `broken` means the Astra path itself failed (missing executable, spawn error, timeout, malformed reply). A `broken` fallback is a defect to report.
|
|
18
18
|
|
|
19
19
|
## Preflight
|
|
20
20
|
|
|
21
|
-
Flag on:
|
|
21
|
+
Flag on: the helper asks the Codex account picker for an account first.
|
|
22
22
|
|
|
23
23
|
```
|
|
24
|
-
python ~/.claude/
|
|
24
|
+
python ~/.claude/scripts/codex_account_choice.py choose
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
**GOTCHA.
|
|
27
|
+
**GOTCHA. Picker path.** `codex_astra_advisor.resolve_account_picker_path` builds the picker path from the helper's own location: two directories above `_shared/advisor/scripts`, then `scripts/codex_account_choice.py`. Installed, that is `~/.claude/scripts/codex_account_choice.py`. Do not hunt other copies. Repo home: `packages/claude-dev-env/scripts/`. The accounts, their order, and sign-in steps are in [`codex-accounts.md`](../../../docs/codex-accounts.md).
|
|
28
28
|
|
|
29
|
-
The shared entry point is `~/.claude/_shared/advisor/scripts/codex_astra_advisor.py`. It
|
|
29
|
+
The shared entry point is `~/.claude/_shared/advisor/scripts/codex_astra_advisor.py`. It runs the picker and owns Astra bind or resume parsing. Bind with `python ~/.claude/_shared/advisor/scripts/codex_astra_advisor.py --bind --enable-astra --cwd <repo-root>` and pipe the charter on stdin. Resume with `--resume <session_id>` and pipe the delta consult on stdin.
|
|
30
30
|
|
|
31
|
-
The gate passes only when the
|
|
31
|
+
The gate passes only when the picker exits 0 and answers `tier: normal` with a `codex_home` and a finite `percent_left`. The helper then runs Codex with `CODEX_HOME` set to that `codex_home`. A `luna` or `wait` answer fails closed when Fable did not bind.
|
|
32
32
|
|
|
33
33
|
## Branches
|
|
34
34
|
|
|
35
35
|
**Preflight pass.** Bind one Codex CLI session at `gpt-6-astra` with `model_reasoning_effort` set from the policy-selected `ADVISOR_EFFORT` value, `--sandbox read-only`, and JSON output. The helper receives the standing-reviewer charter on stdin and returns only parsed ENDORSE / CORRECTION / PLAN / STOP guidance with a session ID.
|
|
36
36
|
|
|
37
|
-
**Preflight fail.**
|
|
37
|
+
**Preflight fail.** A picker failure, non-zero exit, timeout, malformed answer, or a `luna` or `wait` tier fails closed when Fable did not bind.
|
|
38
38
|
|
|
39
39
|
The helper owns the Astra attempt and returns an explicit fallback result. The consuming advisor path owns the Fable bind. Apply the same gate to every Astra attempt, including resume.
|
|
@@ -5,13 +5,13 @@ Open this when binding or re-binding the advisor from a third-party (non-Claude,
|
|
|
5
5
|
|
|
6
6
|
## GOTCHA: Cursor Astra first shot
|
|
7
7
|
|
|
8
|
-
Cursor is a third-party host. When the walk reaches Astra (`ADVISOR_ASTRA=1` / `--enable-astra` after Fable is out of usage, or the user asks for Astra), bind Astra on the **first** tool call through the headless Codex helper. Do not use the Agent or Task tool, do not spawn Grok as a substitute, and do not search the filesystem for
|
|
8
|
+
Cursor is a third-party host. When the walk reaches Astra (`ADVISOR_ASTRA=1` / `--enable-astra` after Fable is out of usage, or the user asks for Astra), bind Astra on the **first** tool call through the headless Codex helper. Do not use the Agent or Task tool, do not spawn Grok as a substitute, and do not search the filesystem for the Codex account picker.
|
|
9
9
|
|
|
10
10
|
```
|
|
11
11
|
python "$HOME/.claude/_shared/advisor/scripts/codex_astra_advisor.py" --bind --enable-astra --cwd <repo-root>
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Pipe the standing-reviewer charter on stdin. Persist `session_id` from the JSON reply. Later consults: `--resume <session_id>` with the delta on stdin. Capture helper / `codex` stdout as UTF-8 on Windows (`encoding="utf-8"`, `errors="replace"`).
|
|
14
|
+
Pipe the standing-reviewer charter on stdin. Persist `session_id` from the JSON reply. Later consults: `--resume <session_id>` with the delta on stdin. Capture helper / `codex` stdout as UTF-8 on Windows (`encoding="utf-8"`, `errors="replace"`). Picker path and preflight: [`astra-rung.md`](astra-rung.md).
|
|
15
15
|
|
|
16
16
|
When the Astra flag is off, follow the Claude-chain steps below.
|
|
17
17
|
|