@azure-id/orc 0.56.0 → 1.0.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 +228 -0
- package/README-id.md +143 -53
- package/README.md +124 -103
- package/bin/build-agents.js +18 -11
- package/bin/cli.js +4139 -315
- package/bin/onboarding-content.js +0 -3
- package/bin/test-run.js +491 -0
- package/bin/verify-contracts.js +4256 -3277
- package/bin/verify-package.js +563 -498
- package/bin/webui/api.js +1186 -1163
- package/bin/webui/app.html +9 -0
- package/bin/webui/css/06-responsive.css +120 -108
- package/bin/webui/css/panels/extra.css +29 -0
- package/bin/webui/css/panels/lanes.css +134 -0
- package/bin/webui/css/panels/settings.css +79 -3
- package/bin/webui/fixtures/extra.js +2036 -1934
- package/bin/webui/fixtures/flow.js +2 -2
- package/bin/webui/fixtures/index.js +503 -486
- package/bin/webui/fixtures/lanes.js +218 -0
- package/bin/webui/fixtures/settings.js +261 -34
- package/bin/webui/fixtures/stats.js +3 -3
- package/bin/webui/i18n/TERMS.md +135 -134
- package/bin/webui/i18n/en/extra.json +345 -313
- package/bin/webui/i18n/en/lanes.json +29 -0
- package/bin/webui/i18n/en/nav.json +1 -0
- package/bin/webui/i18n/en/overview.json +2 -0
- package/bin/webui/i18n/en/settings.json +16 -5
- package/bin/webui/i18n/id/extra.json +345 -313
- package/bin/webui/i18n/id/lanes.json +29 -0
- package/bin/webui/i18n/id/nav.json +1 -0
- package/bin/webui/i18n/id/overview.json +2 -0
- package/bin/webui/i18n/id/settings.json +15 -4
- package/bin/webui/js/01-i18n.js +1 -0
- package/bin/webui/js/panels/extra.js +3199 -3011
- package/bin/webui/js/panels/lanes.js +259 -0
- package/bin/webui/js/panels/overview.js +10 -0
- package/bin/webui/js/panels/settings.js +149 -3
- package/package.json +3 -3
- package/templates/agents/MODEL-MAPPING.md +23 -35
- package/templates/agents/orc-executor-opus-4-7-high.md +1 -1
- package/templates/agents/orc-executor-opus-4-7-med.md +1 -1
- package/templates/agents/orc-executor-opus-4-8-high.md +1 -1
- package/templates/agents/orc-executor-opus-5-high.md +1 -1
- package/templates/agents/orc-executor-opus-5-low.md +1 -1
- package/templates/agents/orc-executor-opus-5-med.md +1 -1
- package/templates/agents/orc-retro-opus-5-med.md +73 -73
- package/templates/agents/orc-retro-sonnet-5-high.md +72 -72
- package/templates/agents/orc-trace-writer-haiku-4-5.md +107 -107
- package/templates/commands/orc-route.md +1 -1
- package/templates/commands/orc.md +1 -1
- package/templates/skills/_shared/README.md +7 -3
- package/templates/skills/_shared/config-precedence.md +198 -0
- package/templates/skills/_shared/drift-recovery.md +1 -1
- package/templates/skills/_shared/extra-dispatch.md +292 -6
- package/templates/skills/_shared/interview.md +1 -1
- package/templates/skills/_shared/opus5-only.md +9 -7
- package/templates/skills/_shared/phases/README.md +82 -0
- package/templates/skills/{orc/references → _shared/phases}/analyst-gates.md +15 -3
- package/templates/skills/_shared/phases/execution.md +143 -0
- package/templates/skills/{orc/references → _shared/phases}/house-rules.md +13 -1
- package/templates/skills/{orc/references → _shared/phases}/intake.md +15 -2
- package/templates/skills/_shared/phases/mock-example.md +56 -0
- package/templates/skills/{orc/references → _shared/phases}/plan-handoff.md +16 -3
- package/templates/skills/_shared/phases/planning.md +135 -0
- package/templates/skills/_shared/phases/preflight.md +76 -0
- package/templates/skills/_shared/phases/review.md +53 -0
- package/templates/skills/_shared/phases/scoring.md +65 -0
- package/templates/skills/{orc/references → _shared/phases}/security-checklist.md +12 -1
- package/templates/skills/_shared/phases/security.md +55 -0
- package/templates/skills/_shared/phases/ship.md +88 -0
- package/templates/skills/{orc/references/stop-and-resume.md → _shared/phases/stop-resume.md} +169 -160
- package/templates/skills/_shared/phases/summary.md +48 -0
- package/templates/skills/_shared/phases/testgen.md +51 -0
- package/templates/skills/{orc/references/trace-protocol.md → _shared/phases/trace.md} +49 -6
- package/templates/skills/_shared/phases/verify.md +70 -0
- package/templates/skills/{orc/references → _shared/phases}/wave-grouping.md +14 -2
- package/templates/skills/{orc/references → _shared/phases}/wiki-consult.md +13 -1
- package/templates/skills/_shared/read-ladder.md +48 -0
- package/templates/skills/context-combiner/SKILL.md +214 -187
- package/templates/skills/orc/README.md +148 -150
- package/templates/skills/orc/SKILL.md +70 -358
- package/templates/skills/orc/config.md +137 -389
- package/templates/skills/orc/examples/full-run-mock.md +1 -1
- package/templates/skills/orc/references/effort-and-mode.md +16 -18
- package/templates/skills/orc/references/phases/intake.md +47 -0
- package/templates/skills/orc/references/phases/integration.md +19 -0
- package/templates/skills/orc/references/preflight-report.md +4 -4
- package/templates/skills/orc/references/ultra-mode.md +117 -123
- package/templates/skills/orc/schemas/planning-output.md +279 -279
- package/templates/skills/orc/subskills/orc-planner/SKILL.md +260 -264
- package/templates/skills/orc/subskills/orc-pr/stack-gate.md +4 -1
- package/templates/skills/orc-aftermath/SKILL.md +153 -136
- package/templates/skills/orc-analyze/SKILL.md +247 -220
- package/templates/skills/orc-analyze/references/branching.md +51 -51
- package/templates/skills/orc-analyze/references/thin-input.md +1 -1
- package/templates/skills/orc-analyze-mini/SKILL.md +128 -112
- package/templates/skills/orc-boundary/SKILL.md +244 -208
- package/templates/skills/orc-brainstorm/SKILL.md +372 -339
- package/templates/skills/orc-budget/SKILL.md +243 -225
- package/templates/skills/orc-challenge/README.md +1 -1
- package/templates/skills/orc-challenge/SKILL.md +293 -255
- package/templates/skills/orc-challenge/examples/council-full-roster.md +1 -1
- package/templates/skills/orc-claude/SKILL.md +216 -199
- package/templates/skills/orc-diy/README.md +2 -1
- package/templates/skills/orc-diy/SKILL.md +129 -70
- package/templates/skills/orc-diy/references/blocks/analyze.md +1 -1
- package/templates/skills/orc-diy/references/compile.md +21 -7
- package/templates/skills/orc-diy/references/flow-schema.md +2 -2
- package/templates/skills/orc-doc/SKILL.md +44 -7
- package/templates/skills/orc-explain/SKILL.md +19 -0
- package/templates/skills/orc-export/SKILL.md +26 -5
- package/templates/skills/orc-fast/SKILL.md +215 -187
- package/templates/skills/orc-grill/SKILL.md +233 -207
- package/templates/skills/orc-handoff/SKILL.md +223 -204
- package/templates/skills/orc-learn/SKILL.md +176 -156
- package/templates/skills/orc-mini/SKILL.md +41 -23
- package/templates/skills/orc-pact/SKILL.md +250 -218
- package/templates/skills/orc-pattern/SKILL.md +149 -124
- package/templates/skills/orc-poly/SKILL.md +237 -216
- package/templates/skills/orc-poly/references/gather.md +1 -1
- package/templates/skills/orc-pr-driver/SKILL.md +196 -167
- package/templates/skills/orc-pr-driver/references/orc-run-split.md +1 -1
- package/templates/skills/orc-pr-setup/SKILL.md +212 -184
- package/templates/skills/orc-quick/README.md +2 -2
- package/templates/skills/orc-quick/SKILL.md +346 -313
- package/templates/skills/orc-quick/references/dispatch-gate.md +12 -4
- package/templates/skills/orc-retro/SKILL.md +244 -222
- package/templates/skills/orc-retro/examples/retro-mock.md +171 -171
- package/templates/skills/orc-route/SKILL.md +183 -165
- package/templates/skills/orc-verify/SKILL.md +100 -86
- package/templates/skills/orc-wiki/SKILL.md +55 -206
- package/templates/skills/orc-wiki/references/phases/phase-0.md +71 -0
- package/templates/skills/orc-wiki/references/phases/phase-1.md +35 -0
- package/templates/skills/orc-wiki/references/phases/phase-2.md +52 -0
- package/templates/skills/orc-wiki/references/phases/phase-3.md +57 -0
- package/templates/skills/orc-wiki/references/phases/phase-3c.md +36 -0
- package/templates/agents/orc-advisor-fable-5.md +0 -50
- package/templates/agents/orc-analyst-fable-5.md +0 -115
- package/templates/agents/orc-judge-fable-5.md +0 -79
- package/templates/agents/orc-planner-fable-5.md +0 -152
- package/templates/agents/orc-reviewer-fable-5.md +0 -57
- package/templates/skills/_shared/fable5-override.md +0 -56
- package/templates/skills/orc-diy/references/blocks/execution.md +0 -42
- package/templates/skills/orc-diy/references/blocks/mock-example.md +0 -22
- package/templates/skills/orc-diy/references/blocks/planning.md +0 -34
- package/templates/skills/orc-diy/references/blocks/review.md +0 -18
- package/templates/skills/orc-diy/references/blocks/scoring.md +0 -16
- package/templates/skills/orc-diy/references/blocks/security.md +0 -25
- package/templates/skills/orc-diy/references/blocks/ship.md +0 -25
- package/templates/skills/orc-diy/references/blocks/summary.md +0 -18
- package/templates/skills/orc-diy/references/blocks/testgen.md +0 -17
- package/templates/skills/orc-diy/references/blocks/trace.md +0 -28
- package/templates/skills/orc-diy/references/blocks/verify.md +0 -25
|
@@ -1,167 +1,196 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: orc-pr-driver
|
|
3
|
-
description: >
|
|
4
|
-
Stacked-PR DRIVER. Use for "/orc-pr-driver", "build the stacked PRs", "submit
|
|
5
|
-
the stack", "restack / sync / merge my stack". Takes an approved
|
|
6
|
-
stacked-pr/<slug>/stack-plan.md — written by /orc-pr-setup, generated by
|
|
7
|
-
`orc pr stack template` and filled in by hand, or handed over by ORC's ship
|
|
8
|
-
phase — and executes it: one branch per layer, only that layer's files, a
|
|
9
|
-
MANDATORY per-layer green gate (build + tests + lint scoped to the layer's own
|
|
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.
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
# ORC-PR-DRIVER (stacked-PR driver)
|
|
17
|
-
|
|
18
|
-
The half that touches git. `orc-pr-setup` decides WHERE the cut lines go; this
|
|
19
|
-
lane makes the layers real and keeps the stack healthy until every layer is
|
|
20
|
-
merged.
|
|
21
|
-
|
|
22
|
-
Its whole discipline is one sentence: **no layer is submitted, pushed or merged
|
|
23
|
-
until its own gate is green at its own base.** A layer that only builds when the
|
|
24
|
-
whole stack is applied is not a reviewable layer, and merging the layer below it
|
|
25
|
-
breaks the trunk.
|
|
26
|
-
|
|
27
|
-
**Tier.** Not effort-gated (the guard matches the exact skill name `orc`), so it
|
|
28
|
-
runs at whatever tier the chat is on.
|
|
29
|
-
|
|
30
|
-
**Human guide:** this skill's own `README.md` (step-by-step walkthrough, the green
|
|
31
|
-
gate per language, merge order, troubleshooting table) — point the USER there when
|
|
32
|
-
they ask how any of this works; never load it to drive the run.
|
|
33
|
-
|
|
34
|
-
**Load at their phase, never preloaded:**
|
|
35
|
-
`../_shared/stack-plan.md` (plan schema, probe, budgets, `STACK-FROM`, entry
|
|
36
|
-
modes) · `../_shared/gh-stack-commands.md` (preflight + command surface) ·
|
|
37
|
-
`../_shared/pr-templates.md` (per-layer body rules) ·
|
|
38
|
-
`references/green-gate.md` (the mandatory ladder) ·
|
|
39
|
-
`references/orc-run-split.md` (splitting an already-built worktree, file-granular) ·
|
|
40
|
-
`references/conflict-playbook.md` (sync, rebase, modify, merge).
|
|
41
|
-
|
|
42
|
-
## Hard rules
|
|
43
|
-
|
|
44
|
-
1. **Never `git commit --no-verify`.** The repo's hooks ARE the gate; bypassing
|
|
45
|
-
them means the PR cannot land anyway.
|
|
46
|
-
2. **Never `gh stack submit` over a red layer**, and never push one.
|
|
47
|
-
3. **Green means green at the layer's OWN base** — not "green once the whole
|
|
48
|
-
stack is applied".
|
|
49
|
-
4. **After ANY lower-layer change, re-run the full ladder at every tip above it**,
|
|
50
|
-
bottom-up. "It was green when I cut it" is not evidence — a rebase rewrites
|
|
51
|
-
every upper branch.
|
|
52
|
-
5. **Merge bottom-up only.** Never merge a middle layer while an unmerged layer
|
|
53
|
-
sits below it.
|
|
54
|
-
6. **Hunk surgery is forbidden.** Splits are file-granular; a file that seems to
|
|
55
|
-
belong in two layers is a question, not a manual diff edit.
|
|
56
|
-
7. **Never fabricate a green.** No `//nolint`, no fake caller, no deleted
|
|
57
|
-
identifier to silence a linter (`references/green-gate.md` — that is a P0
|
|
58
|
-
question about the seam).
|
|
59
|
-
8. **The plan is the contract.** Re-cutting a seam mid-run means updating the
|
|
60
|
-
plan file (and its `## Decisions`) in the same step.
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
##
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
`
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
1
|
+
---
|
|
2
|
+
name: orc-pr-driver
|
|
3
|
+
description: >
|
|
4
|
+
Stacked-PR DRIVER. Use for "/orc-pr-driver", "build the stacked PRs", "submit
|
|
5
|
+
the stack", "restack / sync / merge my stack". Takes an approved
|
|
6
|
+
stacked-pr/<slug>/stack-plan.md — written by /orc-pr-setup, generated by
|
|
7
|
+
`orc pr stack template` and filled in by hand, or handed over by ORC's ship
|
|
8
|
+
phase — and executes it: one branch per layer, only that layer's files, a
|
|
9
|
+
MANDATORY per-layer green gate (build + tests + lint scoped to the layer's own
|
|
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.
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# ORC-PR-DRIVER (stacked-PR driver)
|
|
17
|
+
|
|
18
|
+
The half that touches git. `orc-pr-setup` decides WHERE the cut lines go; this
|
|
19
|
+
lane makes the layers real and keeps the stack healthy until every layer is
|
|
20
|
+
merged.
|
|
21
|
+
|
|
22
|
+
Its whole discipline is one sentence: **no layer is submitted, pushed or merged
|
|
23
|
+
until its own gate is green at its own base.** A layer that only builds when the
|
|
24
|
+
whole stack is applied is not a reviewable layer, and merging the layer below it
|
|
25
|
+
breaks the trunk.
|
|
26
|
+
|
|
27
|
+
**Tier.** Not effort-gated (the guard matches the exact skill name `orc`), so it
|
|
28
|
+
runs at whatever tier the chat is on.
|
|
29
|
+
|
|
30
|
+
**Human guide:** this skill's own `README.md` (step-by-step walkthrough, the green
|
|
31
|
+
gate per language, merge order, troubleshooting table) — point the USER there when
|
|
32
|
+
they ask how any of this works; never load it to drive the run.
|
|
33
|
+
|
|
34
|
+
**Load at their phase, never preloaded:**
|
|
35
|
+
`../_shared/stack-plan.md` (plan schema, probe, budgets, `STACK-FROM`, entry
|
|
36
|
+
modes) · `../_shared/gh-stack-commands.md` (preflight + command surface) ·
|
|
37
|
+
`../_shared/pr-templates.md` (per-layer body rules) ·
|
|
38
|
+
`references/green-gate.md` (the mandatory ladder) ·
|
|
39
|
+
`references/orc-run-split.md` (splitting an already-built worktree, file-granular) ·
|
|
40
|
+
`references/conflict-playbook.md` (sync, rebase, modify, merge).
|
|
41
|
+
|
|
42
|
+
## Hard rules
|
|
43
|
+
|
|
44
|
+
1. **Never `git commit --no-verify`.** The repo's hooks ARE the gate; bypassing
|
|
45
|
+
them means the PR cannot land anyway.
|
|
46
|
+
2. **Never `gh stack submit` over a red layer**, and never push one.
|
|
47
|
+
3. **Green means green at the layer's OWN base** — not "green once the whole
|
|
48
|
+
stack is applied".
|
|
49
|
+
4. **After ANY lower-layer change, re-run the full ladder at every tip above it**,
|
|
50
|
+
bottom-up. "It was green when I cut it" is not evidence — a rebase rewrites
|
|
51
|
+
every upper branch.
|
|
52
|
+
5. **Merge bottom-up only.** Never merge a middle layer while an unmerged layer
|
|
53
|
+
sits below it.
|
|
54
|
+
6. **Hunk surgery is forbidden.** Splits are file-granular; a file that seems to
|
|
55
|
+
belong in two layers is a question, not a manual diff edit.
|
|
56
|
+
7. **Never fabricate a green.** No `//nolint`, no fake caller, no deleted
|
|
57
|
+
identifier to silence a linter (`references/green-gate.md` — that is a P0
|
|
58
|
+
question about the seam).
|
|
59
|
+
8. **The plan is the contract.** Re-cutting a seam mid-run means updating the
|
|
60
|
+
plan file (and its `## Decisions`) in the same step.
|
|
61
|
+
|
|
62
|
+
## Phases
|
|
63
|
+
|
|
64
|
+
`orc lane phases orc-pr-driver --json` is this lane's pipeline: the ordered list, where
|
|
65
|
+
each phase lives, and how much of it to read. **The CLI owns the order** — never
|
|
66
|
+
derive it from the headings below, and never renumber or rename one without the
|
|
67
|
+
manifest, because a `read: section` pointer names a HEADING and a renamed heading
|
|
68
|
+
is a pointer into nothing.
|
|
69
|
+
|
|
70
|
+
## Phase D0 — Read the plan + hard gate
|
|
71
|
+
|
|
72
|
+
1. **Probe, do not search:** `orc pr stack status [<slug>]` — exit 0 = READY,
|
|
73
|
+
exit 1 = absent or unfilled (`../_shared/stack-plan.md`). Exit 1 → say which
|
|
74
|
+
it is and offer `/orc-pr-setup` (plan it) or `orc pr stack template` (skeleton
|
|
75
|
+
to fill in by hand).
|
|
76
|
+
2. Read `stacked-pr/<slug>/stack-plan.md`, plus
|
|
77
|
+
`stacked-pr/<slug>/STACK-FROM.md` when present (source, ticket, entry mode,
|
|
78
|
+
template, run dir, `BUILD-GREEN`).
|
|
79
|
+
3. **REFUSE to run** — name the exact missing field, then stop — on: an
|
|
80
|
+
unanswered UNCERTAIN in `## Decisions`, a missing ticket, a layer with no
|
|
81
|
+
purpose or no value class, a FOUNDATION layer naming no consumer,
|
|
82
|
+
fewer than 2 layers, or `BUILD-GREEN: false`. Never fill a field in for the user.
|
|
83
|
+
4. Re-validate the budgets against the real numbers (`git diff --numstat`,
|
|
84
|
+
exclusions applied). A layer that grew past a ceiling since planning → surface
|
|
85
|
+
it and ask: split it here, or log an accepted exception.
|
|
86
|
+
5. Preflight per `../_shared/gh-stack-commands.md` (gh · auth · extension ·
|
|
87
|
+
**not a fork** · trunk · protections · merge queue). A hard fail → one
|
|
88
|
+
regular PR, and say so plainly.
|
|
89
|
+
|
|
90
|
+
## Phase D1 — Snapshot (entry mode `orc-run` only)
|
|
91
|
+
|
|
92
|
+
The change already exists in the worktree, so **preserve it before touching
|
|
93
|
+
branches** — `references/orc-run-split.md` is the exact procedure: commit the
|
|
94
|
+
whole change to a scratch snapshot branch, verify the snapshot contains every
|
|
95
|
+
changed path from `git status --short`, and only then move to the trunk. Every
|
|
96
|
+
layer is later materialized with `git checkout <snapshot> -- <that layer's
|
|
97
|
+
files>`; deletions are applied as `git rm`. The snapshot branch stays until the
|
|
98
|
+
last layer merges — it is the undo button.
|
|
99
|
+
|
|
100
|
+
`greenfield` skips this phase: each layer's code is written in its own layer.
|
|
101
|
+
|
|
102
|
+
## Phase D2 — Build the stack, layer by layer
|
|
103
|
+
|
|
104
|
+
`gh stack init -b <trunk>` → then, per layer, bottom-up:
|
|
105
|
+
|
|
106
|
+
1. `gh stack add -m "<ticket> <layer title>"` (branch name from the plan).
|
|
107
|
+
2. Materialize **only that layer's files** — `git checkout <snapshot> -- <files>`
|
|
108
|
+
(orc-run) or write them (greenfield). Nothing from another layer, ever.
|
|
109
|
+
3. **Run the FULL green-gate ladder** (`references/green-gate.md`): build →
|
|
110
|
+
tests (the layer's scope) → lint attributed to **this layer's base** → the
|
|
111
|
+
repo's own pre-commit hooks, unbypassed. Any step red → stop, fix, re-run the
|
|
112
|
+
ladder from step 1 for that layer. Do not proceed, do not push.
|
|
113
|
+
4. Commit through the hooks. Record the layer's gate status (`GREEN`) back into
|
|
114
|
+
the plan file.
|
|
115
|
+
5. Report one line per layer to the user: `L<n> <branch> — <files> files, <LoC>
|
|
116
|
+
LoC — GATE GREEN`.
|
|
117
|
+
|
|
118
|
+
A layer that cannot go green alone is a **seam defect, not a lint problem**: stop
|
|
119
|
+
and ask (merge it into its consumer · land the first caller here · accept with an
|
|
120
|
+
explicit, reason-carrying suppression — user's call only), then record the answer
|
|
121
|
+
in the plan's `## Decisions`.
|
|
122
|
+
|
|
123
|
+
## Phase D3 — Submit
|
|
124
|
+
|
|
125
|
+
1. `gh stack submit` → then **verify with `gh stack view --json`**: the bases
|
|
126
|
+
chain correctly (bottom → trunk, each upper → the branch below) and each PR's
|
|
127
|
+
diff really is only its own layer.
|
|
128
|
+
2. Fill each PR body from the resolved template per `../_shared/pr-templates.md`,
|
|
129
|
+
including the four per-layer facts: layer `n` of `N` + ticket · purpose +
|
|
130
|
+
value class · **deliberately NOT here** → which layer has it ·
|
|
131
|
+
excluded-from-budget files, listed.
|
|
132
|
+
3. Show the user the stack map, each PR's URL, and the review order hint.
|
|
133
|
+
|
|
134
|
+
## Phase D4 — Maintain
|
|
135
|
+
|
|
136
|
+
`references/conflict-playbook.md`. In short: `gh stack sync` after the trunk
|
|
137
|
+
moves · `gh stack rebase --upstack` after amending a lower layer, then **re-run
|
|
138
|
+
the ladder at every tip above, bottom-up** (hard rule 4) · `gh stack modify` to
|
|
139
|
+
insert / reorder / drop / combine when review demands it (prefer it, and
|
|
140
|
+
fixup-on-top, over history rewrites mid-review — a force-push destroys a
|
|
141
|
+
reviewer's in-progress context).
|
|
142
|
+
|
|
143
|
+
## Phase D5 — Merge (bottom-up, gated)
|
|
144
|
+
|
|
145
|
+
Before each `gh stack merge`: confirm via `gh stack view --json` +
|
|
146
|
+
`gh pr view <n> --json statusCheckRollup` that **that layer's own CI is green**.
|
|
147
|
+
After each merge: confirm the upper layers auto-retargeted and their CI re-ran.
|
|
148
|
+
Never merge a middle layer with unmerged layers below it. When the last layer
|
|
149
|
+
lands, delete the snapshot branch (ask first) and report the final state.
|
|
150
|
+
|
|
151
|
+
## Behavior trace (always on)
|
|
152
|
+
|
|
153
|
+
`../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
|
|
154
|
+
the file and the layers). Lane token `prdriver`, tier **Multi-dispatch** —
|
|
155
|
+
one packet per LAYER boundary (each layer's green gate closes) + the
|
|
156
|
+
end-of-run packet.
|
|
157
|
+
At run start write `log_dir/.current` = `run-prdriver-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
|
|
158
|
+
`touch the trace file` of that name in the SAME step.
|
|
159
|
+
Nothing else about the protocol is restated here; a phase that ends with
|
|
160
|
+
`zero new trace lines is a protocol violation`.
|
|
161
|
+
|
|
162
|
+
Events: `PHASE D0..D5`, `GATE layer-green pass|bounce :: L<n> <step>`,
|
|
163
|
+
`QUESTION count=<n>`, `GATE stack-certainty` on a mid-run re-cut, `FINISH`;
|
|
164
|
+
`decisions` carries the WHY (seam calls, accepted exceptions, the user's
|
|
165
|
+
answers verbatim).
|
|
166
|
+
|
|
167
|
+
## Boundaries
|
|
168
|
+
|
|
169
|
+
- **Never plans the layering.** No plan → `/orc-pr-setup` or
|
|
170
|
+
`orc pr stack template`. It executes a plan; it does not invent one.
|
|
171
|
+
- **Never bypasses a gate** — no `--no-verify`, no red submit, no red merge.
|
|
172
|
+
- **Never rewrites the user's work silently:** the snapshot branch exists before
|
|
173
|
+
any branch switch, and it survives until the stack is merged.
|
|
174
|
+
- Out of scope: cross-repo stacks (unsupported by GitHub) and retrofitting an
|
|
175
|
+
already-open PR into a stack.
|
|
176
|
+
- Reminder: to see usage limits, tell the user to run `/usage` (never invoke it
|
|
177
|
+
programmatically).
|
|
178
|
+
|
|
179
|
+
## Config
|
|
180
|
+
|
|
181
|
+
Resolve with `orc lane config orc-pr-driver --json` and obey `effective`. Never merge
|
|
182
|
+
`.claude/orc.config.yaml` yourself, and never re-derive a precedence. Exit ≠ 0 →
|
|
183
|
+
say so and use `../_shared/config-precedence.md`'s documented defaults, out
|
|
184
|
+
loud. Nothing this lane reads is contested, gated or a stop, so it owes no
|
|
185
|
+
preflight line and has no gate to honour.
|
|
186
|
+
|
|
187
|
+
## Calls
|
|
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.
|
|
@@ -35,7 +35,7 @@ Any path in `git status --short` that is missing from that diff → **STOP**. Do
|
|
|
35
35
|
proceed with a partial snapshot.
|
|
36
36
|
|
|
37
37
|
Note the excluded-but-listed paths (generated code, lockfiles, vendored trees —
|
|
38
|
-
|
|
38
|
+
`../../_shared/stack-plan.md`): they are still real files that must land in some
|
|
39
39
|
layer, they just do not count toward a budget.
|
|
40
40
|
|
|
41
41
|
## Step 2 — start the stack from the trunk
|