@azure-id/orc 1.9.2 → 2.1.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/CHANGELOG.md +722 -0
- package/README-id.md +56 -42
- package/README.md +58 -41
- package/bin/build-agents.js +125 -29
- package/bin/clear-logs.js +620 -0
- package/bin/cli.js +1873 -180
- package/bin/fix.js +459 -0
- package/bin/gotcha-import.js +1081 -0
- package/bin/gotcha.js +1566 -0
- package/bin/graph-query.js +1 -1
- package/bin/graph.js +717 -717
- package/bin/habit.js +1538 -0
- package/bin/mockrun-catalog.js +284 -276
- package/bin/onboarding-content.js +2 -1
- package/bin/pricing.json +28 -21
- package/bin/run-undo.js +398 -0
- package/bin/trace-write.js +869 -0
- package/bin/verify-contracts.js +627 -100
- package/bin/verify-package.js +68 -10
- package/bin/webui/api.js +151 -6
- package/bin/webui/app.html +239 -232
- package/bin/webui/css/00-tokens.css +110 -92
- package/bin/webui/css/04-motion.css +87 -0
- package/bin/webui/css/06-responsive.css +203 -178
- package/bin/webui/css/panels/behaviour.css +205 -0
- package/bin/webui/css/panels/hookui.css +79 -0
- package/bin/webui/fixtures/behaviour.js +562 -0
- package/bin/webui/fixtures/extra.js +9 -9
- package/bin/webui/fixtures/flow.js +81 -81
- package/bin/webui/fixtures/hookui.js +506 -431
- package/bin/webui/fixtures/index.js +66 -3
- package/bin/webui/fixtures/knowledge.js +9 -3
- package/bin/webui/fixtures/maintenance.js +123 -42
- package/bin/webui/fixtures/rules.js +1007 -1002
- package/bin/webui/fixtures/settings.js +6 -7
- package/bin/webui/fixtures/stats.js +25 -6
- package/bin/webui/fixtures/wait.js +98 -97
- package/bin/webui/i18n/en/behaviour.json +156 -0
- package/bin/webui/i18n/en/hookui.json +290 -194
- package/bin/webui/i18n/en/maintenance.json +71 -52
- package/bin/webui/i18n/en/nav.json +25 -24
- package/bin/webui/i18n/en/settings.json +60 -60
- package/bin/webui/i18n/en/tour.json +37 -35
- package/bin/webui/i18n/id/behaviour.json +156 -0
- package/bin/webui/i18n/id/hookui.json +290 -194
- package/bin/webui/i18n/id/maintenance.json +71 -52
- package/bin/webui/i18n/id/nav.json +25 -24
- package/bin/webui/i18n/id/settings.json +60 -60
- package/bin/webui/i18n/id/tour.json +37 -35
- package/bin/webui/js/01-i18n.js +155 -154
- package/bin/webui/js/05-banners.js +181 -172
- package/bin/webui/js/06-edit.js +193 -183
- package/bin/webui/js/90-tour.js +498 -494
- package/bin/webui/js/91-shortcuts.js +126 -126
- package/bin/webui/js/99-boot.js +121 -118
- package/bin/webui/js/panels/behaviour.js +1087 -0
- package/bin/webui/js/panels/hookui.js +2196 -1691
- package/bin/webui/js/panels/maintenance.js +336 -235
- package/bin/webui/js/panels/settings.js +726 -719
- package/mock-run/INDEX.md +110 -107
- package/mock-run/extra-slots.md +1 -1
- package/mock-run/gotcha-import.md +118 -0
- package/mock-run/habits.md +129 -0
- package/mock-run/orc-aftermath.md +392 -392
- package/mock-run/orc-budget.md +29 -33
- package/mock-run/orc-cli.md +200 -200
- package/mock-run/orc-explain.md +86 -86
- package/mock-run/orc-extra.md +389 -392
- package/mock-run/orc-fix.md +87 -0
- package/mock-run/orc-pattern.md +112 -112
- package/mock-run/orc-quick.md +6 -1
- package/mock-run/orc.md +157 -157
- package/package.json +1 -1
- package/templates/agents/MODEL-MAPPING.md +37 -34
- package/templates/agents/orc-advisor-opus-5-xhigh.md +1 -7
- package/templates/agents/orc-analyze-mini-opus-5-med.md +1 -6
- package/templates/agents/orc-analyze-mini-sonnet-5-high.md +2 -5
- package/templates/agents/{orc-claude-writer-opus-4-8-high.md → orc-claude-writer-opus-5-low.md} +48 -53
- package/templates/agents/orc-context-combiner-opus-5-high.md +1 -11
- package/templates/agents/orc-executor-haiku-4-5.md +14 -6
- package/templates/agents/orc-executor-opus-4-7-high.md +14 -6
- package/templates/agents/orc-executor-opus-4-7-med.md +14 -6
- package/templates/agents/orc-executor-opus-4-8-high.md +14 -6
- package/templates/agents/orc-executor-opus-5-high.md +14 -6
- package/templates/agents/orc-executor-opus-5-low.md +14 -6
- package/templates/agents/orc-executor-opus-5-med.md +14 -6
- package/templates/agents/orc-executor-sonnet-4-6-high.md +14 -6
- package/templates/agents/orc-executor-sonnet-4-6-med.md +14 -6
- package/templates/agents/orc-executor-sonnet-5-high.md +15 -7
- package/templates/agents/orc-executor-sonnet-5-low.md +155 -0
- package/templates/agents/orc-executor-sonnet-5-med.md +155 -0
- package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +1 -10
- package/templates/agents/orc-judge-opus-5-xhigh.md +5 -9
- package/templates/agents/orc-learn-writer-opus-5-low.md +1 -7
- package/templates/agents/orc-pattern-codifier-opus-5-med.md +1 -8
- package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +58 -63
- package/templates/agents/orc-planner-mini-opus-5-med.md +1 -4
- package/templates/agents/orc-planner-mini-sonnet-5-high.md +2 -3
- package/templates/agents/orc-planner-opus-5-med.md +1 -4
- package/templates/agents/orc-recon-opus-5-low.md +1 -8
- package/templates/agents/orc-recon-sonnet-4-6-med.md +1 -8
- package/templates/agents/orc-retro-opus-5-med.md +6 -8
- package/templates/agents/orc-retro-sonnet-5-high.md +7 -8
- package/templates/agents/orc-reviewer-opus-5-low.md +96 -0
- package/templates/agents/orc-scout-opus-5-low.md +1 -6
- package/templates/agents/orc-scout-sonnet-4-6-high.md +35 -39
- package/templates/agents/orc-system-analyst-opus-5-high.md +1 -6
- package/templates/agents/orc-test-author-opus-5-med.md +4 -5
- package/templates/agents/orc-trace-writer-haiku-4-5.md +3 -7
- package/templates/agents/orc-verifier-opus-5-med.md +16 -8
- package/templates/agents/{orc-wiki-scanner-opus-4-8-high.md → orc-wiki-scanner-opus-5-low.md} +74 -79
- package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +97 -106
- package/templates/commands/orc-analyze.md +13 -21
- package/templates/commands/orc-fast.md +10 -15
- package/templates/commands/orc-fix.md +18 -0
- package/templates/commands/orc-poly.md +12 -21
- package/templates/commands/orc-pr-driver.md +11 -30
- package/templates/commands/orc-pr-setup.md +10 -31
- package/templates/commands/orc-route.md +11 -41
- package/templates/commands/orc-test.md +5 -60
- package/templates/commands/orc-wiki.md +64 -64
- package/templates/hooks/README.md +109 -7
- package/templates/hooks/orc-session-hook.js +339 -0
- package/templates/hooks/orc-statusline-render.js +317 -23
- package/templates/hooks/orc-statusline.js +165 -50
- package/templates/hooks/orc-subagent-line.js +23 -5
- package/templates/hooks/orc-weather-fetch.js +123 -0
- package/templates/skills/_shared/README.md +9 -0
- package/templates/skills/_shared/code-graph.md +47 -55
- package/templates/skills/_shared/config-precedence.md +3 -1
- package/templates/skills/_shared/extra-dispatch.md +78 -93
- package/templates/skills/_shared/gotchas.md +248 -177
- package/templates/skills/_shared/habits.md +101 -0
- package/templates/skills/_shared/lane-contract.md +84 -0
- package/templates/skills/_shared/opus5-only.md +14 -14
- package/templates/skills/_shared/phases/README.md +142 -83
- package/templates/skills/_shared/phases/analyst-gates.md +10 -21
- package/templates/skills/_shared/phases/execution.md +8 -14
- package/templates/skills/_shared/phases/house-rules.md +27 -32
- package/templates/skills/_shared/phases/intake.md +127 -133
- package/templates/skills/_shared/phases/mock-example.md +46 -56
- package/templates/skills/_shared/phases/plan-handoff.md +91 -97
- package/templates/skills/_shared/phases/planning.md +7 -17
- package/templates/skills/_shared/phases/preflight.md +19 -42
- package/templates/skills/_shared/phases/review.md +24 -28
- package/templates/skills/_shared/phases/rules.md +18 -42
- package/templates/skills/_shared/phases/scoring.md +55 -65
- package/templates/skills/_shared/phases/security-checklist.md +46 -50
- package/templates/skills/_shared/phases/security.md +45 -55
- package/templates/skills/_shared/phases/ship.md +6 -15
- package/templates/skills/_shared/phases/stop-resume.md +2 -5
- package/templates/skills/_shared/phases/summary.md +73 -48
- package/templates/skills/_shared/phases/testgen.md +41 -51
- package/templates/skills/_shared/phases/trace-verbs.md +447 -0
- package/templates/skills/_shared/phases/trace.md +66 -297
- package/templates/skills/_shared/phases/verify.md +62 -70
- package/templates/skills/_shared/phases/wave-grouping.md +128 -133
- package/templates/skills/_shared/phases/wiki-consult.md +10 -6
- package/templates/skills/_shared/read-ladder.md +2 -55
- package/templates/skills/_shared/return-validation.md +17 -70
- package/templates/skills/_shared/review-slice.md +106 -0
- package/templates/skills/_shared/smoke-gate.md +46 -28
- package/templates/skills/_shared/wait.md +1 -0
- package/templates/skills/context-combiner/SKILL.md +15 -44
- package/templates/skills/orc/README.md +2 -2
- package/templates/skills/orc/SKILL.md +35 -63
- package/templates/skills/orc/config.md +25 -27
- package/templates/skills/orc/examples/full-run-mock.md +2 -1
- package/templates/skills/orc/references/effort-and-mode.md +17 -17
- package/templates/skills/orc/references/pattern-gate.md +89 -89
- package/templates/skills/orc/references/phases/intake.md +41 -47
- package/templates/skills/orc/references/phases/integration.md +13 -19
- package/templates/skills/orc/references/preflight-report.md +11 -12
- package/templates/skills/orc/references/ultra-mode.md +9 -7
- package/templates/skills/orc/schemas/checkpoint.md +122 -122
- package/templates/skills/orc/subskills/orc-execution/SKILL.md +27 -73
- package/templates/skills/orc/subskills/orc-execution/core.md +12 -99
- package/templates/skills/orc/subskills/orc-execution/subagent.md +14 -13
- package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +12 -53
- package/templates/skills/orc/subskills/orc-review-verify/core.md +52 -135
- package/templates/skills/orc/subskills/orc-review-verify/subagent.md +7 -7
- package/templates/skills/orc/subskills/orc-testgen/SKILL.md +11 -22
- package/templates/skills/orc/subskills/orc-testgen/core.md +20 -59
- package/templates/skills/orc/subskills/orc-testgen/subagent.md +7 -7
- package/templates/skills/orc-advisor/SKILL.md +56 -60
- package/templates/skills/orc-analyze/SKILL.md +33 -67
- package/templates/skills/orc-analyze/schemas/report-audit.md +2 -1
- package/templates/skills/orc-analyze/schemas/report-prose.md +2 -1
- package/templates/skills/orc-analyze-mini/SKILL.md +35 -70
- package/templates/skills/orc-claude/SKILL.md +14 -14
- package/templates/skills/orc-claude/examples/claude-run-mock.md +65 -65
- package/templates/skills/orc-diy/README.md +31 -0
- package/templates/skills/orc-diy/SKILL.md +27 -78
- package/templates/skills/orc-diy/references/blocks/pattern.md +18 -18
- package/templates/skills/orc-fast/SKILL.md +49 -75
- package/templates/skills/orc-fix/SKILL.md +110 -0
- package/templates/skills/orc-judge/SKILL.md +77 -82
- package/templates/skills/orc-mini/SKILL.md +64 -112
- package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -2
- package/templates/skills/orc-pattern/SKILL.md +27 -48
- package/templates/skills/orc-poly/SKILL.md +32 -61
- package/templates/skills/orc-pr-driver/SKILL.md +25 -51
- package/templates/skills/orc-pr-driver/references/green-gate.md +113 -105
- package/templates/skills/orc-pr-setup/SKILL.md +20 -45
- package/templates/skills/orc-quick/README.md +44 -3
- package/templates/skills/orc-quick/SKILL.md +77 -108
- package/templates/skills/orc-quick/references/dispatch-gate.md +18 -6
- package/templates/skills/orc-quick/references/gh-mode.md +50 -1
- package/templates/skills/orc-quick/references/look.md +3 -1
- package/templates/skills/orc-retro/SKILL.md +20 -19
- package/templates/skills/orc-retro/examples/retro-mock.md +17 -17
- package/templates/skills/orc-route/SKILL.md +25 -45
- package/templates/skills/orc-test/SKILL.md +16 -37
- package/templates/skills/orc-verify/SKILL.md +14 -32
- package/templates/skills/orc-wait/SKILL.md +156 -163
- package/templates/skills/orc-wiki/README.md +325 -325
- package/templates/skills/orc-wiki/SKILL.md +195 -195
- package/templates/skills/orc-wiki/examples/wiki-run-mock.md +37 -37
- package/templates/skills/orc-wiki/references/extra.md +2 -2
- package/templates/skills/orc-wiki/references/partial-refresh.md +276 -271
- package/templates/skills/orc-wiki/references/phases/phase-0.md +2 -7
- package/templates/skills/orc-wiki/references/phases/phase-1.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-2.md +4 -9
- package/templates/skills/orc-wiki/references/phases/phase-3.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-3c.md +4 -8
- package/templates/agents/orc-claude-writer-opus-5-med.md +0 -55
- package/templates/agents/orc-reviewer-opus-5-med.md +0 -60
- package/templates/agents/orc-wiki-scanner-opus-5-med.md +0 -81
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
name: orc-pr-driver
|
|
3
3
|
description: >
|
|
4
4
|
Stacked-PR DRIVER. Use for "/orc-pr-driver", "build the stacked PRs", "submit
|
|
5
|
-
the stack", "restack / sync / merge my stack".
|
|
6
|
-
stacked-pr/<slug>/stack-plan.md
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
base + the repo's own hooks, never --no-verify), then `gh stack submit`, PR
|
|
11
|
-
bodies from the resolved template, and the ongoing sync / rebase / conflict /
|
|
12
|
-
bottom-up merge care. Refuses to run on a plan with unanswered uncertainties,
|
|
13
|
-
a missing ticket or a red build.
|
|
5
|
+
the stack", "restack / sync / merge my stack". Executes an approved
|
|
6
|
+
stacked-pr/<slug>/stack-plan.md: one branch per layer, a MANDATORY per-layer
|
|
7
|
+
green gate (build + tests + lint + the repo's own hooks, never --no-verify),
|
|
8
|
+
then `gh stack submit` and the sync / rebase / bottom-up merge care. Refuses a
|
|
9
|
+
plan with open uncertainties or a red build.
|
|
14
10
|
---
|
|
15
11
|
|
|
16
12
|
# ORC-PR-DRIVER (stacked-PR driver)
|
|
@@ -61,17 +57,14 @@ modes) · `../_shared/gh-stack-commands.md` (preflight + command surface) ·
|
|
|
61
57
|
|
|
62
58
|
## Phases
|
|
63
59
|
|
|
64
|
-
`orc lane phases orc-pr-driver --json` is this lane's pipeline
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
manifest, because a `read: section` pointer names a HEADING and a renamed heading
|
|
68
|
-
is a pointer into nothing.
|
|
60
|
+
`orc lane phases orc-pr-driver --json` is this lane's pipeline. **The CLI owns the order**:
|
|
61
|
+
never derive it from the headings below, and never rename or renumber one
|
|
62
|
+
without the manifest (`../_shared/lane-contract.md` §Phases).
|
|
69
63
|
|
|
70
64
|
## Phase D0 — Read the plan + hard gate
|
|
71
65
|
|
|
72
|
-
1. **Probe, do not search:** `orc pr stack status [<slug>]` — exit
|
|
73
|
-
|
|
74
|
-
it is and offer `/orc-pr-setup` (plan it) or `orc pr stack template` (skeleton
|
|
66
|
+
1. **Probe, do not search:** `orc pr stack status [<slug>]` — exit 1 =
|
|
67
|
+
absent or unfilled (`../_shared/stack-plan.md`) → say which it is and offer `/orc-pr-setup` (plan it) or `orc pr stack template` (skeleton
|
|
75
68
|
to fill in by hand).
|
|
76
69
|
2. Read `stacked-pr/<slug>/stack-plan.md`, plus
|
|
77
70
|
`stacked-pr/<slug>/STACK-FROM.md` when present (source, ticket, entry mode,
|
|
@@ -150,14 +143,12 @@ lands, delete the snapshot branch (ask first) and report the final state.
|
|
|
150
143
|
|
|
151
144
|
## Behavior trace (always on)
|
|
152
145
|
|
|
153
|
-
`../_shared/phases/trace.md` (`core`, at run start; `orc lane phases`
|
|
154
|
-
|
|
155
|
-
one packet per LAYER
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
Nothing else about the protocol is restated here; a phase that ends with
|
|
160
|
-
`zero new trace lines is a protocol violation`.
|
|
146
|
+
`../_shared/phases/trace.md` (`core`, at run start; `orc lane phases orc-pr-driver --json` →
|
|
147
|
+
`trace_grammar` gives the verbs). Lane token `prdriver`, tier
|
|
148
|
+
**Multi-dispatch** — one packet per LAYER (each layer's green
|
|
149
|
+
gate closes). At run start write `log_dir/.current` =
|
|
150
|
+
`run-prdriver-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
|
|
151
|
+
in the SAME step. A phase that ends with `zero new trace lines is a protocol violation`.
|
|
161
152
|
|
|
162
153
|
Events: `PHASE D0..D5`, `GATE layer-green pass|bounce :: L<n> <step>`,
|
|
163
154
|
`QUESTION count=<n>`, `GATE stack-certainty` on a mid-run re-cut, `FINISH`;
|
|
@@ -176,29 +167,12 @@ answers verbatim).
|
|
|
176
167
|
- Reminder: to see usage limits, tell the user to run `/usage` (never invoke it
|
|
177
168
|
programmatically).
|
|
178
169
|
|
|
179
|
-
##
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
**ONE catalogue, and it is not you:** `orc lane calls orc-pr-driver --json` names every
|
|
190
|
-
CLI call this lane makes, each with its exit-code contract, its cost, when to run
|
|
191
|
-
it, and what an EMPTY answer means. Never invent a spelling, never re-word an
|
|
192
|
-
exit code, and never re-derive a state word — the CLI's state words are the only
|
|
193
|
-
state words, and **an exit code is an ANSWER wherever that contract says so, not
|
|
194
|
-
a failure**. A call the answer does not name is a call this lane does not make.
|
|
195
|
-
Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
|
|
196
|
-
command you are about to run, out loud, before running it.
|
|
197
|
-
|
|
198
|
-
## Rules — the anti-slop card (`../_shared/phases/rules.md`)
|
|
199
|
-
|
|
200
|
-
`orc rules slice --lane orc-pr-driver --json` is the ONLY assembler; never build
|
|
201
|
-
the card here. It rides under the house rules and above the task —
|
|
202
|
-
**house rules > your project's rules > ORC's own packs** — and its `line` prints
|
|
203
|
-
VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
|
|
204
|
-
never a silent choice) and `rules_overridden[]`.
|
|
170
|
+
## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
|
|
171
|
+
|
|
172
|
+
- **Calls:** `orc lane calls orc-pr-driver --json` names every call and its exit codes.
|
|
173
|
+
**An exit code is an ANSWER where it says so, not a failure.** Make no other call.
|
|
174
|
+
- **Config:** `orc lane config orc-pr-driver --json`. Obey `effective`. Never merge
|
|
175
|
+
`.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`). Nothing
|
|
176
|
+
here is contested, gated or a stop: no preflight line, no gate to honour.
|
|
177
|
+
- **Rules:** `orc rules slice --lane orc-pr-driver --json` is the ONLY assembler
|
|
178
|
+
(`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
|
|
@@ -1,105 +1,113 @@
|
|
|
1
|
-
# Reference — the per-layer GREEN GATE (mandatory)
|
|
2
|
-
|
|
3
|
-
Loaded at Phase D2, run once per layer and again after every rebase above a
|
|
4
|
-
changed layer.
|
|
5
|
-
|
|
6
|
-
**Rule: no layer is submitted, pushed or merged until its own gate is green at
|
|
7
|
-
its OWN base.** Never `git commit --no-verify`. Never `gh stack submit` over a red
|
|
8
|
-
layer. "Green when the whole stack is applied" is not green.
|
|
9
|
-
|
|
10
|
-
## The ladder — all four steps, in order, per layer
|
|
11
|
-
|
|
12
|
-
Detect the stack from the repo (never ask what the repo can tell you) and run the
|
|
13
|
-
four rungs. The commands below are the common shapes; the repo's own scripts win.
|
|
14
|
-
|
|
15
|
-
| # | Rung | Go | Node/TS | Java/Kotlin | Python | Rust |
|
|
16
|
-
|---|------|----|---------|-------------|--------|------|
|
|
17
|
-
| 1 | **build** at this layer's base | `go build ./...` | `npm run build` | `./gradlew compileJava` / `mvn -q compile` | `python -m compileall` / type-check | `cargo build` |
|
|
18
|
-
| 2 | **tests** for the layer's scope | `go test ./<pkgs>/...` | `npm test -- <paths>` | `./gradlew test --tests …` | `pytest <paths>` | `cargo test <filter>` |
|
|
19
|
-
| 3 | **lint scoped to THIS layer's base** | `golangci-lint run --new-from-rev <base> ./<pkgs>/...` | `eslint <changed files>` | `./gradlew checkstyleMain` / detekt | `ruff check <paths>` | `cargo clippy -- -D warnings` |
|
|
20
|
-
| 4 | **the repo's own pre-commit hooks, unbypassed** | `git commit` (hooks run) | same | same | same | same |
|
|
21
|
-
|
|
22
|
-
Mocks/codegen first when the project needs them (`mockery`, `go generate`,
|
|
23
|
-
`protoc`, `npm run codegen`) — a missing generated file reads as a compile error
|
|
24
|
-
and sends you hunting the wrong thing. Platform quirks belong here too: e.g. on
|
|
25
|
-
macOS, Go tests that monkey-patch need `GOARCH=amd64 … -gcflags=all=-l`.
|
|
26
|
-
|
|
27
|
-
Any rung red → **stop, fix, re-run the whole ladder from rung 1** for that layer.
|
|
28
|
-
Do not proceed to the next layer. Do not push.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
##
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
|
1
|
+
# Reference — the per-layer GREEN GATE (mandatory)
|
|
2
|
+
|
|
3
|
+
Loaded at Phase D2, run once per layer and again after every rebase above a
|
|
4
|
+
changed layer.
|
|
5
|
+
|
|
6
|
+
**Rule: no layer is submitted, pushed or merged until its own gate is green at
|
|
7
|
+
its OWN base.** Never `git commit --no-verify`. Never `gh stack submit` over a red
|
|
8
|
+
layer. "Green when the whole stack is applied" is not green.
|
|
9
|
+
|
|
10
|
+
## The ladder — all four steps, in order, per layer
|
|
11
|
+
|
|
12
|
+
Detect the stack from the repo (never ask what the repo can tell you) and run the
|
|
13
|
+
four rungs. The commands below are the common shapes; the repo's own scripts win.
|
|
14
|
+
|
|
15
|
+
| # | Rung | Go | Node/TS | Java/Kotlin | Python | Rust |
|
|
16
|
+
|---|------|----|---------|-------------|--------|------|
|
|
17
|
+
| 1 | **build** at this layer's base | `go build ./...` | `npm run build` | `./gradlew compileJava` / `mvn -q compile` | `python -m compileall` / type-check | `cargo build` |
|
|
18
|
+
| 2 | **tests** for the layer's scope | `go test ./<pkgs>/...` | `npm test -- <paths>` | `./gradlew test --tests …` | `pytest <paths>` | `cargo test <filter>` |
|
|
19
|
+
| 3 | **lint scoped to THIS layer's base** | `golangci-lint run --new-from-rev <base> ./<pkgs>/...` | `eslint <changed files>` | `./gradlew checkstyleMain` / detekt | `ruff check <paths>` | `cargo clippy -- -D warnings` |
|
|
20
|
+
| 4 | **the repo's own pre-commit hooks, unbypassed** | `git commit` (hooks run) | same | same | same | same |
|
|
21
|
+
|
|
22
|
+
Mocks/codegen first when the project needs them (`mockery`, `go generate`,
|
|
23
|
+
`protoc`, `npm run codegen`) — a missing generated file reads as a compile error
|
|
24
|
+
and sends you hunting the wrong thing. Platform quirks belong here too: e.g. on
|
|
25
|
+
macOS, Go tests that monkey-patch need `GOARCH=amd64 … -gcflags=all=-l`.
|
|
26
|
+
|
|
27
|
+
Any rung red → **stop, fix, re-run the whole ladder from rung 1** for that layer.
|
|
28
|
+
Do not proceed to the next layer. Do not push.
|
|
29
|
+
|
|
30
|
+
**Gotcha card (advice only).** Before rung 1, run `orc gotcha sync --json`
|
|
31
|
+
(due at most once per `gotcha_sync_hours`; any failure → go on), then
|
|
32
|
+
`orc gotcha card --files <this layer's files> --lane orc-pr-driver --json`
|
|
33
|
+
(the `gotcha_card` field of `../../_shared/review-slice.md` §2) and print its
|
|
34
|
+
`text`. It names failures this project already paid for in these files. It
|
|
35
|
+
never turns a rung red: the gate stays build · tests · lint · hooks. A rung that
|
|
36
|
+
went red → green after a lint/seam fix is recorded (`../../_shared/gotchas.md` §10).
|
|
37
|
+
|
|
38
|
+
## Attribution — the stacked-specific trap
|
|
39
|
+
|
|
40
|
+
Many repos pin their linter's "new code" baseline to the trunk (e.g.
|
|
41
|
+
`issues.new-from-rev: origin/main` in `.golangci.yml`). On layer 4 that flags
|
|
42
|
+
layers 1–3's diff too: noisy and **misattributed**. Override per layer with
|
|
43
|
+
`--new-from-rev <that layer's base>` (or the equivalent) so each layer is judged
|
|
44
|
+
on **its own** diff.
|
|
45
|
+
|
|
46
|
+
## Code-quality scans (SonarQube and friends) are a STACK-LEVEL gate
|
|
47
|
+
|
|
48
|
+
A scan that analyzes the project key directly, with no PR decoration, measures
|
|
49
|
+
the **cumulative** L1..LN diff against the trunk — not layer N's diff. So:
|
|
50
|
+
|
|
51
|
+
- per-layer new-code coverage from such a scan is **not a trustworthy per-layer
|
|
52
|
+
signal** — verify coverage locally, per layer;
|
|
53
|
+
- treat the scan as a **stack-level** gate;
|
|
54
|
+
- a scan reported as `SKIPPED` on a layer usually means that layer's test job
|
|
55
|
+
failed first — the gate never ran. Read it as red, not as flaky.
|
|
56
|
+
|
|
57
|
+
Keep each layer's tests **with its code** for exactly this reason: a FOUNDATION
|
|
58
|
+
layer with no tests can red-gate on its own coverage rule.
|
|
59
|
+
|
|
60
|
+
## Dead-code / `unused` on a FOUNDATION layer — a P0 QUESTION, never auto-fixed
|
|
61
|
+
|
|
62
|
+
Linters flag declared-but-unreferenced identifiers (Go's `unused`, TS
|
|
63
|
+
`noUnusedLocals`, Rust `dead_code`) even when the compiler is happy. A FOUNDATION
|
|
64
|
+
layer that declares something only a LATER layer calls will go RED. **That is a
|
|
65
|
+
real signal about the seam**, so stop and ask:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
L2 declares repo.FindByRef()
|
|
69
|
+
L4 (handler) is its only caller
|
|
70
|
+
lint --new-from-rev <L2 base>: unused → RED
|
|
71
|
+
|
|
72
|
+
ASK: [a] merge L2 into L4 (one layer, no dead code) ← recommended
|
|
73
|
+
[b] keep the split, land the first caller in L2
|
|
74
|
+
[c] accept it: one suppression, with a reason naming the consumer layer
|
|
75
|
+
(user override only)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Never silently add a suppression, never invent a fake caller, never delete the
|
|
79
|
+
identifier to go green. Record the answer under the plan's `## Decisions`.
|
|
80
|
+
|
|
81
|
+
## Re-verification after ANY lower-layer change (the rule people get wrong)
|
|
82
|
+
|
|
83
|
+
Amending layer N rewrites every branch above it, so previously-green upper layers
|
|
84
|
+
can go red:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
amend L2 → gh stack rebase --upstack
|
|
88
|
+
for layer in L2..Ltop, bottom-up:
|
|
89
|
+
run the FULL ladder (codegen + build + tests + lint + hooks)
|
|
90
|
+
RED → stop, fix, restart from that layer
|
|
91
|
+
all green → gh stack push / gh stack submit
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The same applies after `gh stack sync` when the trunk moves, and after
|
|
95
|
+
`gh stack modify` (insert / reorder / drop / combine).
|
|
96
|
+
|
|
97
|
+
## Merge-time gate
|
|
98
|
+
|
|
99
|
+
Bottom-up only. Before `gh stack merge`, confirm the layer's own CI is green
|
|
100
|
+
(`gh stack view --json` + `gh pr view <n> --json statusCheckRollup`); after each
|
|
101
|
+
merge, confirm the upper layers auto-retargeted and their CI re-ran.
|
|
102
|
+
|
|
103
|
+
## Gate red flags
|
|
104
|
+
|
|
105
|
+
| Excuse | Reality |
|
|
106
|
+
|---|---|
|
|
107
|
+
| "Tests pass on the top layer, the stack is fine" | The gate is per-layer at its own base. Merging L1 alone must not break the trunk. |
|
|
108
|
+
| "The build is clean, lint is cosmetic" | Lint blocks the repo's pre-commit hook. Clean build ≠ committable. |
|
|
109
|
+
| "I'll `--no-verify` and fix lint in a follow-up" | Forbidden. The hooks are the gate; bypassing means the PR cannot land. |
|
|
110
|
+
| "It was green before the rebase" | A rebase rewrites every upper branch. Re-run the ladder at every tip above the change. |
|
|
111
|
+
| "`unused` is a false positive — the caller is in layer 4" | It is a TRUE positive about layer 2 *as a standalone PR*. That is the P0 question, not a suppression. |
|
|
112
|
+
| "The scan says new coverage is fine on layer 3" | Layer 3's scan measures L1..L3 cumulatively. Verify per-layer coverage locally. |
|
|
113
|
+
| "The scan was SKIPPED — it's flaky" | The layer's test job failed first; the gate never ran. Red. |
|
|
@@ -4,13 +4,9 @@ description: >
|
|
|
4
4
|
Stacked-PR PLANNER. Use for "/orc-pr-setup", "plan the stacked PRs", "split
|
|
5
5
|
this change into stacked pull requests", "where do the PR cut lines go".
|
|
6
6
|
Decides the LAYERING of a big change — ordered layers, each with a purpose, a
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
hands off to when a change is too big for one PR. It NEVER touches git
|
|
11
|
-
history: no branches, no commits, no pushes — that is orc-pr-driver's job.
|
|
12
|
-
P0 HARD GATE: when a boundary is uncertain it STOPS and asks, one decision at
|
|
13
|
-
a time, and records the answer.
|
|
7
|
+
file list, a size budget and a dependency reason — and writes
|
|
8
|
+
stacked-pr/<slug>/stack-plan.md. It never touches git history. When a boundary
|
|
9
|
+
is uncertain it STOPS and asks.
|
|
14
10
|
---
|
|
15
11
|
|
|
16
12
|
# ORC-PR-SETUP (stacked-PR planner)
|
|
@@ -62,11 +58,9 @@ how any of this works; never load it to drive the run.
|
|
|
62
58
|
|
|
63
59
|
## Phases
|
|
64
60
|
|
|
65
|
-
`orc lane phases orc-pr-setup --json` is this lane's pipeline
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
manifest, because a `read: section` pointer names a HEADING and a renamed heading
|
|
69
|
-
is a pointer into nothing.
|
|
61
|
+
`orc lane phases orc-pr-setup --json` is this lane's pipeline. **The CLI owns the order**:
|
|
62
|
+
never derive it from the headings below, and never rename or renumber one
|
|
63
|
+
without the manifest (`../_shared/lane-contract.md` §Phases).
|
|
70
64
|
|
|
71
65
|
## Phase S0 — Preflight (probe, never assume)
|
|
72
66
|
|
|
@@ -173,13 +167,11 @@ exceptions`. Then:
|
|
|
173
167
|
|
|
174
168
|
## Behavior trace (always on)
|
|
175
169
|
|
|
176
|
-
`../_shared/phases/trace.md` (`core`, at run start; `orc lane phases`
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
Nothing else about the protocol is restated here; a phase that ends with
|
|
182
|
-
`zero new trace lines is a protocol violation`.
|
|
170
|
+
`../_shared/phases/trace.md` (`core`, at run start; `orc lane phases orc-pr-setup --json` →
|
|
171
|
+
`trace_grammar` gives the verbs). Lane token `prsetup`, tier
|
|
172
|
+
**Single-dispatch**. At run start write `log_dir/.current` =
|
|
173
|
+
`run-prsetup-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
|
|
174
|
+
in the SAME step. A phase that ends with `zero new trace lines is a protocol violation`.
|
|
183
175
|
|
|
184
176
|
## Boundaries
|
|
185
177
|
|
|
@@ -192,29 +184,12 @@ Nothing else about the protocol is restated here; a phase that ends with
|
|
|
192
184
|
- Reminder: to see usage limits, tell the user to run `/usage` (never invoke it
|
|
193
185
|
programmatically).
|
|
194
186
|
|
|
195
|
-
##
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
**ONE catalogue, and it is not you:** `orc lane calls orc-pr-setup --json` names every
|
|
206
|
-
CLI call this lane makes, each with its exit-code contract, its cost, when to run
|
|
207
|
-
it, and what an EMPTY answer means. Never invent a spelling, never re-word an
|
|
208
|
-
exit code, and never re-derive a state word — the CLI's state words are the only
|
|
209
|
-
state words, and **an exit code is an ANSWER wherever that contract says so, not
|
|
210
|
-
a failure**. A call the answer does not name is a call this lane does not make.
|
|
211
|
-
Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
|
|
212
|
-
command you are about to run, out loud, before running it.
|
|
213
|
-
|
|
214
|
-
## Rules — the anti-slop card (`../_shared/phases/rules.md`)
|
|
215
|
-
|
|
216
|
-
`orc rules slice --lane orc-pr-setup --json` is the ONLY assembler; never build
|
|
217
|
-
the card here. It rides under the house rules and above the task —
|
|
218
|
-
**house rules > your project's rules > ORC's own packs** — and its `line` prints
|
|
219
|
-
VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
|
|
220
|
-
never a silent choice) and `rules_overridden[]`.
|
|
187
|
+
## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
|
|
188
|
+
|
|
189
|
+
- **Calls:** `orc lane calls orc-pr-setup --json` names every call and its exit codes.
|
|
190
|
+
**An exit code is an ANSWER where it says so, not a failure.** Make no other call.
|
|
191
|
+
- **Config:** `orc lane config orc-pr-setup --json`. Obey `effective`. Never merge
|
|
192
|
+
`.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`). Nothing
|
|
193
|
+
here is contested, gated or a stop: no preflight line, no gate to honour.
|
|
194
|
+
- **Rules:** `orc rules slice --lane orc-pr-setup --json` is the ONLY assembler
|
|
195
|
+
(`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
|
|
@@ -139,7 +139,7 @@ Code review this change?
|
|
|
139
139
|
|
|
140
140
|
```
|
|
141
141
|
Which reviewer?
|
|
142
|
-
1. orc-reviewer-opus-5-
|
|
142
|
+
1. orc-reviewer-opus-5-low knows your express@v3 pattern
|
|
143
143
|
2. other — name model + effort
|
|
144
144
|
```
|
|
145
145
|
|
|
@@ -165,6 +165,27 @@ entry 1 recorded. anything else?
|
|
|
165
165
|
|
|
166
166
|
Notice: **the reviewer was also a gate.** Every dispatch is asked.
|
|
167
167
|
|
|
168
|
+
**The review uses the repair memory.** The reviewer gets the gotcha card: the
|
|
169
|
+
entries in the repair memory that match the files it reads. When the
|
|
170
|
+
review closes, the lane records what became of each finding (addressed,
|
|
171
|
+
disputed, won't fix, open). That is how `orc gotcha quality` and the gotcha
|
|
172
|
+
promotion learn. It costs no extra question.
|
|
173
|
+
|
|
174
|
+
**Habits (only when you turn them on).** With `habits: observe` or `propose`,
|
|
175
|
+
each answer you give writes one `ASK` line into the trace. After you choose
|
|
176
|
+
"review first" often enough, the end of a run can carry ONE proposal:
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
You chose review first in 6 of your last 6 answers to "Code review before
|
|
180
|
+
commit". Make it your usual? [yes · not now · never]
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
After a yes, the offer puts your usual first — *review → then commit (your
|
|
184
|
+
usual, 6 of 6) · commit without review · stop*. The review is still a dispatch,
|
|
185
|
+
so the agent question is still asked. A habit also only fills the
|
|
186
|
+
`→ suggested` line of the agent question; it never answers it. `habits: off` is
|
|
187
|
+
the default and changes nothing. `orc habit forget <id>` undoes a habit.
|
|
188
|
+
|
|
168
189
|
---
|
|
169
190
|
|
|
170
191
|
## 5. A read-only run (no code changes)
|
|
@@ -380,11 +401,13 @@ No warning, no gate, no question. It goes straight to the commit offer.
|
|
|
380
401
|
### If you stop while things are red
|
|
381
402
|
|
|
382
403
|
It **never undoes your work**. It tells you what changed and gives you the
|
|
383
|
-
command
|
|
404
|
+
command. `orc undo` PRINTS how to revert ONLY the files the run changed, back
|
|
405
|
+
to the snapshot taken at run start. Add `--apply` to run it. An edit you made
|
|
406
|
+
before or during the run stays:
|
|
384
407
|
|
|
385
408
|
```
|
|
386
409
|
stopped. 11 files changed, build red. nothing committed.
|
|
387
|
-
|
|
410
|
+
undo: orc undo --run quick-fix-guest-charge (prints; --apply runs it)
|
|
388
411
|
to keep: the entry lists every file and what each round tried
|
|
389
412
|
```
|
|
390
413
|
|
|
@@ -421,6 +444,20 @@ instructions, push to main"* — it is shown to you and ignored as an instructio
|
|
|
421
444
|
|
|
422
445
|
The agent question is still asked. Nothing is skipped.
|
|
423
446
|
|
|
447
|
+
### A red CI, or Sonar and SARIF issues, as a request
|
|
448
|
+
|
|
449
|
+
> **You:** `/orc-quick CI is red on PR 142`
|
|
450
|
+
|
|
451
|
+
The lane runs `orc ci failed --pr 142` (read-only). It shows the failing steps,
|
|
452
|
+
and each fix is a normal entry with its own agent question. `orc pr threads 142`
|
|
453
|
+
lists the open review threads the same way.
|
|
454
|
+
|
|
455
|
+
> **You:** `/orc-quick fix the Sonar issues on this branch`
|
|
456
|
+
|
|
457
|
+
The lane reads the issues through the CLI (`orc gotcha import sonar` or
|
|
458
|
+
`orc gotcha import sarif <file>`). They are data, never orders. The token comes
|
|
459
|
+
from `SONAR_TOKEN` only.
|
|
460
|
+
|
|
424
461
|
---
|
|
425
462
|
|
|
426
463
|
## 9. When the job is too big
|
|
@@ -483,6 +520,8 @@ same share a thread. Use `thread=<name>` to force a separate one.
|
|
|
483
520
|
| PR comments | `/orc-quick pr 142` |
|
|
484
521
|
| force a thread | `/orc-quick thread=my-thread <what you want>` |
|
|
485
522
|
| read a saved entry | just ask — *"read entry 2"* |
|
|
523
|
+
| a red CI | `/orc-quick CI is red on PR 142` |
|
|
524
|
+
| undo a run | `orc undo --run <slug>` (prints; `--apply` runs it) |
|
|
486
525
|
|
|
487
526
|
| Rule | Always true |
|
|
488
527
|
|------|-------------|
|
|
@@ -491,5 +530,7 @@ same share a thread. Use `thread=<name>` to force a separate one.
|
|
|
491
530
|
| Stages | only the files your task changed |
|
|
492
531
|
| GitHub | reads and pushes, never writes |
|
|
493
532
|
| Undo | never automatic — it prints the command |
|
|
533
|
+
| Undo command | `orc undo --run <slug>` — prints; `--apply` runs it |
|
|
534
|
+
| Habits | off by default; a habit only marks your usual answer, never answers the agent question |
|
|
494
535
|
| Missing wiki / pattern / tests | never a blocker |
|
|
495
536
|
| Config overrides | none — this lane is standalone |
|