@azure-id/orc 2.1.1 → 2.2.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.
Files changed (145) hide show
  1. package/CHANGELOG.md +320 -0
  2. package/README.md +48 -23
  3. package/bin/build-agents.js +207 -205
  4. package/bin/cli.js +48188 -47417
  5. package/bin/fix.js +21 -18
  6. package/bin/graph-extract.js +314 -6
  7. package/bin/graph-gain.js +83 -2
  8. package/bin/graph-map.js +23 -1
  9. package/bin/graph-notes.js +1 -1
  10. package/bin/graph-query.js +1362 -37
  11. package/bin/graph-resolve.js +1 -1
  12. package/bin/graph-shard.js +29 -6
  13. package/bin/graph-signals.js +5 -3
  14. package/bin/graph.js +7 -3
  15. package/bin/habit.js +1 -1
  16. package/bin/pricing.json +8 -1
  17. package/bin/trace-write.js +40 -11
  18. package/bin/verify-contracts.js +5661 -5552
  19. package/bin/verify-package.js +716 -716
  20. package/bin/webui/api.js +8 -0
  21. package/bin/webui/fixtures/extra.js +2036 -2036
  22. package/bin/webui/fixtures/flow.js +1 -1
  23. package/bin/webui/fixtures/index.js +2 -2
  24. package/bin/webui/fixtures/knowledge.js +8 -1
  25. package/bin/webui/fixtures/pact.js +112 -111
  26. package/bin/webui/fixtures/stats.js +2 -2
  27. package/bin/webui/i18n/en/knowledge.json +2 -0
  28. package/bin/webui/i18n/id/knowledge.json +2 -0
  29. package/bin/webui/js/panels/knowledge.js +17 -0
  30. package/guides/code-graph-benefit.md +116 -0
  31. package/guides/configuration.md +150 -0
  32. package/guides/documents.md +262 -0
  33. package/guides/extra-models.md +448 -0
  34. package/guides/habits-and-gotchas.md +152 -0
  35. package/guides/knowledge-reads.md +190 -0
  36. package/guides/model-selection.md +186 -0
  37. package/guides/rules.md +305 -0
  38. package/guides/status-line.md +344 -0
  39. package/mock-run/orc-cli.md +3 -2
  40. package/mock-run/orc-doc.md +452 -448
  41. package/mock-run/orc.md +157 -157
  42. package/package.json +2 -1
  43. package/templates/agents/MODEL-MAPPING.md +176 -176
  44. package/templates/agents/{orc-executor-haiku-4-5.md → orc-executor-haiku-5-high.md} +21 -8
  45. package/templates/agents/orc-executor-opus-4-7-high.md +17 -5
  46. package/templates/agents/orc-executor-opus-4-7-med.md +17 -5
  47. package/templates/agents/orc-executor-opus-4-8-high.md +17 -5
  48. package/templates/agents/orc-executor-opus-5-high.md +17 -5
  49. package/templates/agents/orc-executor-opus-5-low.md +17 -5
  50. package/templates/agents/orc-executor-opus-5-med.md +17 -5
  51. package/templates/agents/orc-executor-sonnet-4-6-high.md +17 -5
  52. package/templates/agents/orc-executor-sonnet-5-high.md +17 -5
  53. package/templates/agents/orc-executor-sonnet-5-low.md +17 -5
  54. package/templates/agents/orc-executor-sonnet-5-med.md +17 -5
  55. package/templates/agents/{orc-graph-noter-sonnet-4-6-med.md → orc-graph-noter-haiku-5-high.md} +4 -4
  56. package/templates/agents/orc-planner-mini-opus-5-med.md +3 -1
  57. package/templates/agents/orc-planner-mini-sonnet-5-high.md +3 -1
  58. package/templates/agents/orc-planner-opus-5-med.md +3 -1
  59. package/templates/agents/{orc-trace-writer-haiku-4-5.md → orc-trace-writer-haiku-5-high.md} +4 -3
  60. package/templates/commands/orc-doc.md +128 -128
  61. package/templates/commands/orc-export.md +51 -46
  62. package/templates/hooks/README.md +8 -3
  63. package/templates/hooks/orc-effort-guard.js +105 -27
  64. package/templates/hooks/orc-graph-hook.js +252 -4
  65. package/templates/hooks/orc-statusline.js +13 -6
  66. package/templates/hooks/orc-trace.js +1 -1
  67. package/templates/skills/_shared/README.md +2 -2
  68. package/templates/skills/_shared/code-graph.md +185 -251
  69. package/templates/skills/_shared/extra-dispatch.md +1331 -1331
  70. package/templates/skills/_shared/lane-contract.md +7 -3
  71. package/templates/skills/_shared/opus5-only.md +137 -137
  72. package/templates/skills/_shared/phases/execution.md +13 -11
  73. package/templates/skills/_shared/phases/planning.md +27 -9
  74. package/templates/skills/_shared/phases/preflight.md +3 -3
  75. package/templates/skills/_shared/phases/review.md +4 -3
  76. package/templates/skills/_shared/phases/ship.md +7 -10
  77. package/templates/skills/_shared/phases/summary.md +2 -3
  78. package/templates/skills/_shared/phases/trace-verbs.md +21 -16
  79. package/templates/skills/_shared/phases/trace.md +3 -3
  80. package/templates/skills/_shared/phases/wiki-consult.md +2 -2
  81. package/templates/skills/_shared/pr-templates.md +108 -106
  82. package/templates/skills/_shared/read-ladder.md +8 -2
  83. package/templates/skills/_shared/return-validation.md +10 -6
  84. package/templates/skills/_shared/review-slice.md +1 -1
  85. package/templates/skills/_shared/stack-plan.md +135 -135
  86. package/templates/skills/_shared/wait.md +14 -2
  87. package/templates/skills/context-combiner/SKILL.md +2 -2
  88. package/templates/skills/orc/SKILL.md +227 -227
  89. package/templates/skills/orc/config.md +2 -2
  90. package/templates/skills/orc/examples/full-run-mock.md +74 -74
  91. package/templates/skills/orc/schemas/planning-output.md +3 -0
  92. package/templates/skills/orc-aftermath/SKILL.md +15 -15
  93. package/templates/skills/orc-analyze/SKILL.md +2 -2
  94. package/templates/skills/orc-analyze-mini/SKILL.md +2 -2
  95. package/templates/skills/orc-boundary/SKILL.md +15 -15
  96. package/templates/skills/orc-boundary/references/card.md +81 -78
  97. package/templates/skills/orc-boundary/references/gate.md +113 -113
  98. package/templates/skills/orc-brainstorm/SKILL.md +15 -15
  99. package/templates/skills/orc-budget/SKILL.md +15 -15
  100. package/templates/skills/orc-challenge/README.md +1 -1
  101. package/templates/skills/orc-challenge/SKILL.md +16 -16
  102. package/templates/skills/orc-challenge/examples/council-full-roster.md +1 -1
  103. package/templates/skills/orc-claude/SKILL.md +4 -4
  104. package/templates/skills/orc-claude/examples/claude-run-mock.md +1 -1
  105. package/templates/skills/orc-diy/SKILL.md +2 -2
  106. package/templates/skills/orc-diy/references/blocks/wiki.md +26 -26
  107. package/templates/skills/orc-diy/references/flow-schema.md +2 -2
  108. package/templates/skills/orc-doc/README.md +2 -2
  109. package/templates/skills/orc-doc/SKILL.md +501 -490
  110. package/templates/skills/orc-doc/examples/orc-doc-prd-run.md +12 -1
  111. package/templates/skills/orc-doc/references/chunking.md +6 -4
  112. package/templates/skills/orc-doc/references/gates.md +311 -311
  113. package/templates/skills/orc-doc/references/resume-protocol.md +229 -228
  114. package/templates/skills/orc-explain/SKILL.md +88 -88
  115. package/templates/skills/orc-export/SKILL.md +190 -187
  116. package/templates/skills/orc-fast/SKILL.md +213 -210
  117. package/templates/skills/orc-grill/SKILL.md +245 -245
  118. package/templates/skills/orc-handoff/SKILL.md +11 -11
  119. package/templates/skills/orc-learn/SKILL.md +13 -13
  120. package/templates/skills/orc-learn/examples/learn-run-mock.md +2 -2
  121. package/templates/skills/orc-mini/SKILL.md +12 -12
  122. package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -5
  123. package/templates/skills/orc-pact/SKILL.md +15 -15
  124. package/templates/skills/orc-pact/references/gate.md +70 -70
  125. package/templates/skills/orc-pattern/SKILL.md +3 -3
  126. package/templates/skills/orc-poly/SKILL.md +4 -4
  127. package/templates/skills/orc-poly/examples/poly-run-mock.md +51 -51
  128. package/templates/skills/orc-pr-driver/SKILL.md +4 -3
  129. package/templates/skills/orc-pr-driver/references/orc-run-split.md +108 -99
  130. package/templates/skills/orc-pr-setup/SKILL.md +2 -2
  131. package/templates/skills/orc-quick/README.md +535 -536
  132. package/templates/skills/orc-quick/SKILL.md +29 -32
  133. package/templates/skills/orc-quick/references/context-doc.md +145 -145
  134. package/templates/skills/orc-quick/references/dispatch-gate.md +220 -220
  135. package/templates/skills/orc-quick/references/gh-mode.md +2 -1
  136. package/templates/skills/orc-quick/references/look.md +34 -12
  137. package/templates/skills/orc-retro/SKILL.md +2 -2
  138. package/templates/skills/orc-retro/examples/retro-mock.md +2 -2
  139. package/templates/skills/orc-route/SKILL.md +2 -2
  140. package/templates/skills/orc-test/SKILL.md +6 -3
  141. package/templates/skills/orc-verify/SKILL.md +2 -2
  142. package/templates/skills/orc-wait/SKILL.md +10 -2
  143. package/templates/skills/orc-wiki/SKILL.md +4 -4
  144. package/templates/skills/orc-wiki/references/pattern-prewarm.md +19 -19
  145. package/templates/agents/orc-executor-sonnet-4-6-med.md +0 -155
@@ -1,99 +1,108 @@
1
- # Reference — splitting an already-built worktree (entry mode `orc-run`)
2
-
3
- Loaded at Phase D1/D2 when the change ALREADY exists — the normal case when
4
- ORC's ship phase hands the stack over. The code is written; the job is to
5
- distribute it across layer branches **without losing a byte and without hunk
6
- surgery**.
7
-
8
- ## Invariants
9
-
10
- - **File-granular only.** Every changed path belongs to exactly ONE layer. A file
11
- whose content seems to belong in two layers is an UNCERTAIN → ask; the default
12
- option offered is "the whole file lands in the LOWEST layer that needs it".
13
- - **The snapshot exists before any branch switch.** The user's work is never held
14
- only by the worktree once branch surgery starts.
15
- - **Nothing is lost:** after the last layer, the union of the layers' files must
16
- equal the snapshot's changed-file set, exactly. That equality is a GATE.
17
-
18
- ## Step 1 — snapshot the change
19
-
20
- ```bash
21
- git status --short > /tmp/orc-stack-surface.txt # the authoritative surface list
22
- git checkout -b orc-stack-snapshot/<slug> # keeps the worktree as-is
23
- git add -A # tracked + untracked
24
- git commit -m "<TICKET> snapshot: pre-stack state (temporary, not for review)"
25
- SNAPSHOT=$(git rev-parse HEAD)
26
- ```
27
-
28
- Then **verify the snapshot is complete** before going further:
29
-
30
- ```bash
31
- git diff --name-status <trunk>..$SNAPSHOT # must cover every path in the surface list
32
- ```
33
-
34
- Any path in `git status --short` that is missing from that diff → **STOP**. Do not
35
- proceed with a partial snapshot.
36
-
37
- Note the excluded-but-listed paths (generated code, lockfiles, vendored trees —
38
- `../../_shared/stack-plan.md`): they are still real files that must land in some
39
- layer, they just do not count toward a budget.
40
-
41
- ## Step 2 — start the stack from the trunk
42
-
43
- ```bash
44
- git checkout <trunk> && git pull --ff-only
45
- gh stack init -b <trunk>
46
- ```
47
-
48
- The worktree now shows trunk state. The change is safe in `$SNAPSHOT`.
49
-
50
- ## Step 3 — materialize each layer, bottom-up
51
-
52
- Per layer, from the plan's explicit file list:
53
-
54
- ```bash
55
- gh stack add -m "<TICKET> <layer title>" <layer-branch>
56
-
57
- # additions + modifications for THIS layer only
58
- git checkout $SNAPSHOT -- <file> <file> ...
59
-
60
- # deletions this layer owns (checkout cannot delete)
61
- git rm <deleted-file> ...
62
-
63
- git status --short # sanity: nothing from another layer
64
- ```
65
-
66
- Then run the full green-gate ladder (`green-gate.md`) and commit through the
67
- repo's hooks. Never `--no-verify`.
68
-
69
- **A moved/renamed file** is one unit: its delete and its add land in the SAME
70
- layer, always.
71
-
72
- ## Step 4 — completeness gate (before `gh stack submit`)
73
-
74
- ```bash
75
- git diff --name-only <trunk>..<top layer branch> | sort > /tmp/stacked.txt
76
- git diff --name-only <trunk>..$SNAPSHOT | sort > /tmp/snapshot.txt
77
- diff /tmp/stacked.txt /tmp/snapshot.txt # MUST be empty
78
- ```
79
-
80
- Non-empty → a file was dropped or duplicated. Fix it before submitting: an
81
- unreviewed missing file is exactly the failure stacking is supposed to prevent.
82
-
83
- ## Step 5 — the snapshot branch stays
84
-
85
- Keep `orc-stack-snapshot/<slug>` until the last layer merges — it is the undo
86
- button, and it is also how you re-cut a seam without re-deriving the change. It
87
- is **never pushed** and never becomes a PR. Delete it (after asking) when the
88
- stack is fully merged.
89
-
90
- ## When the change is already committed on a feature branch
91
-
92
- Same procedure with `$SNAPSHOT` = that branch's tip; skip the `add`/`commit`.
93
- Leave the original branch untouched — it is the snapshot.
94
-
95
- ## What this reference does NOT do
96
-
97
- - No hunk splitting, no interactive `git add -p`, no manual patch editing.
98
- - No retrofitting an already-open PR into a stack (`gh stack link`) — out of
99
- scope; ship it as one regular PR instead.
1
+ # Reference — splitting an already-built worktree (entry mode `orc-run`)
2
+
3
+ Loaded at Phase D1/D2 when the change ALREADY exists — the normal case when
4
+ ORC's ship phase hands the stack over. The code is written; the job is to
5
+ distribute it across layer branches **without losing a byte and without hunk
6
+ surgery**.
7
+
8
+ ## Invariants
9
+
10
+ - **File-granular only.** Every changed path belongs to exactly ONE layer. A file
11
+ whose content seems to belong in two layers is an UNCERTAIN → ask; the default
12
+ option offered is "the whole file lands in the LOWEST layer that needs it".
13
+ - **The snapshot exists before any branch switch.** The user's work is never held
14
+ only by the worktree once branch surgery starts.
15
+ - **Nothing is lost:** after the last layer, the union of the layers' files must
16
+ equal the snapshot's changed-file set, exactly. That equality is a GATE.
17
+
18
+ ## Step 1 — snapshot the change
19
+
20
+ ```bash
21
+ git status --short > /tmp/orc-stack-surface.txt # the authoritative surface list
22
+ git checkout -b orc-stack-snapshot/<slug> # keeps the worktree as-is
23
+ git add -A # tracked + untracked
24
+ git commit -m "<TICKET> snapshot: pre-stack state (temporary, not for review)"
25
+ SNAPSHOT=$(git rev-parse HEAD)
26
+ ```
27
+
28
+ Then **verify the snapshot is complete** before going further:
29
+
30
+ ```bash
31
+ git diff --name-status <trunk>..$SNAPSHOT # must cover every path in the surface list
32
+ ```
33
+
34
+ Any path in `git status --short` that is missing from that diff → **STOP**. Do not
35
+ proceed with a partial snapshot.
36
+
37
+ Note the excluded-but-listed paths (generated code, lockfiles, vendored trees —
38
+ `../../_shared/stack-plan.md`): they are still real files that must land in some
39
+ layer, they just do not count toward a budget.
40
+
41
+ ## Step 2 — start the stack from the trunk
42
+
43
+ ```bash
44
+ git checkout <trunk>
45
+ git merge-base --is-ancestor <trunk> $SNAPSHOT # exit 1 → STOP (below)
46
+ gh stack init -b <trunk>
47
+ ```
48
+
49
+ The worktree now shows trunk state. The change is safe in `$SNAPSHOT`.
50
+
51
+ **Do not pull here.** The stack starts from the trunk commit the change was cut
52
+ from, so `git checkout $SNAPSHOT -- <file>` reproduces exactly the change and
53
+ Step 4 compares like with like. The trunk is not an ancestor of `$SNAPSHOT`
54
+ (it moved after the change was cut) → **STOP** and ask: rebase the snapshot
55
+ first (`git rebase <trunk> orc-stack-snapshot/<slug>`), or stop. A remote trunk
56
+ that moved ahead is `gh stack sync` after submit (`conflict-playbook.md`, "the
57
+ trunk moved") — never a pull in the middle of a split.
58
+
59
+ ## Step 3 — materialize each layer, bottom-up
60
+
61
+ Per layer, from the plan's explicit file list:
62
+
63
+ ```bash
64
+ gh stack add -m "<TICKET> <layer title>" <layer-branch>
65
+
66
+ # additions + modifications for THIS layer only
67
+ git checkout $SNAPSHOT -- <file> <file> ...
68
+
69
+ # deletions this layer owns (checkout cannot delete)
70
+ git rm <deleted-file> ...
71
+
72
+ git status --short # sanity: nothing from another layer
73
+ ```
74
+
75
+ Then run the full green-gate ladder (`green-gate.md`) and commit through the
76
+ repo's hooks. Never `--no-verify`.
77
+
78
+ **A moved/renamed file** is one unit: its delete and its add land in the SAME
79
+ layer, always.
80
+
81
+ ## Step 4 — completeness gate (before `gh stack submit`)
82
+
83
+ ```bash
84
+ git diff --name-only <trunk>..<top layer branch> | sort > /tmp/stacked.txt
85
+ git diff --name-only <trunk>..$SNAPSHOT | sort > /tmp/snapshot.txt
86
+ diff /tmp/stacked.txt /tmp/snapshot.txt # MUST be empty
87
+ ```
88
+
89
+ Non-empty → a file was dropped or duplicated. Fix it before submitting: an
90
+ unreviewed missing file is exactly the failure stacking is supposed to prevent.
91
+
92
+ ## Step 5 — the snapshot branch stays
93
+
94
+ Keep `orc-stack-snapshot/<slug>` until the last layer merges — it is the undo
95
+ button, and it is also how you re-cut a seam without re-deriving the change. It
96
+ is **never pushed** and never becomes a PR. Delete it (after asking) when the
97
+ stack is fully merged.
98
+
99
+ ## When the change is already committed on a feature branch
100
+
101
+ Same procedure with `$SNAPSHOT` = that branch's tip; skip the `add`/`commit`.
102
+ Leave the original branch untouched — it is the snapshot.
103
+
104
+ ## What this reference does NOT do
105
+
106
+ - No hunk splitting, no interactive `git add -p`, no manual patch editing.
107
+ - No retrofitting an already-open PR into a stack (`gh stack link`) — out of
108
+ scope; ship it as one regular PR instead.
@@ -186,8 +186,8 @@ in the SAME step. A phase that ends with `zero new trace lines is a protocol vio
186
186
 
187
187
  ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
188
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.
189
+ - **Calls:** `orc lane calls orc-pr-setup --json` names shared calls and exit codes.
190
+ **An exit code is an ANSWER where it says so, not a failure.** Own calls are here; make no other.
191
191
  - **Config:** `orc lane config orc-pr-setup --json`. Obey `effective`. Never merge
192
192
  `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`). Nothing
193
193
  here is contested, gated or a stop: no preflight line, no gate to honour.