@azure-id/orc 1.6.0 → 1.7.1

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 (84) hide show
  1. package/CHANGELOG.md +152 -0
  2. package/README-id.md +206 -125
  3. package/README.md +202 -74
  4. package/bin/cli.js +1595 -2
  5. package/bin/mockrun-catalog.js +272 -267
  6. package/bin/verify-contracts.js +4553 -4509
  7. package/bin/verify-package.js +6 -0
  8. package/bin/webui/api.js +26 -0
  9. package/bin/webui/app.html +10 -0
  10. package/bin/webui/css/panels/knowledge.css +30 -0
  11. package/bin/webui/css/panels/rules.css +145 -0
  12. package/bin/webui/fixtures/index.js +27 -0
  13. package/bin/webui/fixtures/rules.js +1002 -0
  14. package/bin/webui/fixtures/wiki-one.js +198 -0
  15. package/bin/webui/i18n/en/knowledge.json +127 -117
  16. package/bin/webui/i18n/en/nav.json +1 -0
  17. package/bin/webui/i18n/en/rules.json +55 -0
  18. package/bin/webui/i18n/id/knowledge.json +127 -117
  19. package/bin/webui/i18n/id/nav.json +1 -0
  20. package/bin/webui/i18n/id/rules.json +55 -0
  21. package/bin/webui/js/01-i18n.js +1 -0
  22. package/bin/webui/js/panels/knowledge.js +117 -1
  23. package/bin/webui/js/panels/rules.js +351 -0
  24. package/mock-run/INDEX.md +107 -106
  25. package/mock-run/orc-rules.md +254 -0
  26. package/package.json +1 -1
  27. package/templates/agents/orc-executor-haiku-4-5.md +9 -1
  28. package/templates/agents/orc-executor-opus-4-7-high.md +9 -1
  29. package/templates/agents/orc-executor-opus-4-7-med.md +9 -1
  30. package/templates/agents/orc-executor-opus-4-8-high.md +9 -1
  31. package/templates/agents/orc-executor-opus-5-high.md +9 -1
  32. package/templates/agents/orc-executor-opus-5-low.md +9 -1
  33. package/templates/agents/orc-executor-opus-5-med.md +9 -1
  34. package/templates/agents/orc-executor-sonnet-4-6-high.md +9 -1
  35. package/templates/agents/orc-executor-sonnet-4-6-med.md +9 -1
  36. package/templates/agents/orc-executor-sonnet-5-high.md +9 -1
  37. package/templates/commands/orc-rules.md +66 -0
  38. package/templates/commands/orc-wiki.md +23 -1
  39. package/templates/skills/_shared/README.md +61 -54
  40. package/templates/skills/_shared/extra-dispatch.md +1 -1
  41. package/templates/skills/_shared/phases/README.md +1 -0
  42. package/templates/skills/_shared/phases/execution.md +3 -1
  43. package/templates/skills/_shared/phases/preflight.md +20 -0
  44. package/templates/skills/_shared/phases/rules.md +159 -0
  45. package/templates/skills/_shared/return-validation.md +28 -0
  46. package/templates/skills/_shared/rules/CREDITS.md +141 -0
  47. package/templates/skills/_shared/rules/INDEX.md +107 -0
  48. package/templates/skills/_shared/rules/code.md +229 -0
  49. package/templates/skills/_shared/rules/delivery.md +114 -0
  50. package/templates/skills/_shared/rules/ui.md +139 -0
  51. package/templates/skills/_shared/rules/writing.md +223 -0
  52. package/templates/skills/context-combiner/SKILL.md +9 -1
  53. package/templates/skills/orc/SKILL.md +8 -1
  54. package/templates/skills/orc/references/preflight-report.md +6 -0
  55. package/templates/skills/orc/subskills/orc-execution/SKILL.md +2 -1
  56. package/templates/skills/orc/subskills/orc-execution/core.md +9 -1
  57. package/templates/skills/orc-aftermath/SKILL.md +7 -0
  58. package/templates/skills/orc-analyze/SKILL.md +7 -0
  59. package/templates/skills/orc-analyze-mini/SKILL.md +9 -1
  60. package/templates/skills/orc-boundary/SKILL.md +7 -0
  61. package/templates/skills/orc-brainstorm/SKILL.md +7 -0
  62. package/templates/skills/orc-budget/SKILL.md +7 -0
  63. package/templates/skills/orc-challenge/SKILL.md +7 -0
  64. package/templates/skills/orc-claude/SKILL.md +7 -0
  65. package/templates/skills/orc-diy/SKILL.md +7 -0
  66. package/templates/skills/orc-explain/SKILL.md +7 -0
  67. package/templates/skills/orc-export/SKILL.md +7 -0
  68. package/templates/skills/orc-fast/SKILL.md +9 -2
  69. package/templates/skills/orc-grill/SKILL.md +7 -0
  70. package/templates/skills/orc-handoff/SKILL.md +9 -1
  71. package/templates/skills/orc-learn/SKILL.md +7 -0
  72. package/templates/skills/orc-mini/SKILL.md +10 -3
  73. package/templates/skills/orc-pact/SKILL.md +7 -0
  74. package/templates/skills/orc-poly/SKILL.md +7 -0
  75. package/templates/skills/orc-pr-driver/SKILL.md +9 -1
  76. package/templates/skills/orc-pr-setup/SKILL.md +9 -1
  77. package/templates/skills/orc-quick/SKILL.md +9 -1
  78. package/templates/skills/orc-retro/SKILL.md +7 -0
  79. package/templates/skills/orc-route/SKILL.md +7 -0
  80. package/templates/skills/orc-test/SKILL.md +7 -0
  81. package/templates/skills/orc-verify/SKILL.md +7 -0
  82. package/templates/skills/orc-wiki/SKILL.md +15 -0
  83. package/templates/skills/orc-wiki/references/partial-refresh.md +68 -0
  84. package/templates/skills/orc-wiki/references/phases/phase-0.md +15 -1
@@ -202,7 +202,8 @@ Rules:
202
202
 
203
203
  Put in the slice: the change sketch, the Q2 answers, 2–3 acceptance bullets,
204
204
  the wiki **paths**, the cached pattern (whole text), the `house_rules` card
205
- (`../_shared/phases/house-rules.md`, whole text), PR comments with their
205
+ (`../_shared/phases/house-rules.md`, whole text), the `rules_card` under it
206
+ (`orc rules slice --lane orc-quick --json` → `text`, whole text), PR comments with their
206
207
  `file:line`, and a short-return rule (fields only, no long prose).
207
208
 
208
209
  For an **ad-hoc** dispatch, also tell the agent to report its own
@@ -328,6 +329,13 @@ orc-quick has no config key of its own and ignores every dispatch-forcing key
328
329
  which is why five of them come back INERT with a reason. Say that at the gate;
329
330
  see "Nothing can override this lane" above.
330
331
 
332
+ ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
333
+
334
+ `orc rules slice --lane orc-quick --json` is the ONLY assembler; never build
335
+ the card here. It rides under the house rules and above the task —
336
+ **house rules > your project's rules > ORC's own packs** — and its `line` prints
337
+ VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
338
+ never a silent choice) and `rules_overridden[]`.
331
339
  ## Calls
332
340
 
333
341
  **ONE catalogue, and it is not you:** `orc lane calls orc-quick --json` names every
@@ -243,6 +243,13 @@ a failure**. A call the answer does not name is a call this lane does not make.
243
243
  Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
244
244
  command you are about to run, out loud, before running it.
245
245
 
246
+ ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
247
+
248
+ `orc rules slice --lane orc-retro --json` is the ONLY assembler; never build
249
+ the card here. It rides under the house rules and above the task —
250
+ **house rules > your project's rules > ORC's own packs** — and its `line` prints
251
+ VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
252
+ never a silent choice) and `rules_overridden[]`.
246
253
  ## Waiting mid-run (`/orc-wait`)
247
254
 
248
255
  Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
@@ -182,6 +182,13 @@ a failure**. A call the answer does not name is a call this lane does not make.
182
182
  Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
183
183
  command you are about to run, out loud, before running it.
184
184
 
185
+ ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
186
+
187
+ `orc rules slice --lane orc-route --json` is the ONLY assembler; never build
188
+ the card here. It rides under the house rules and above the task —
189
+ **house rules > your project's rules > ORC's own packs** — and its `line` prints
190
+ VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
191
+ never a silent choice) and `rules_overridden[]`.
185
192
  ## Waiting mid-run (`/orc-wait`)
186
193
 
187
194
  Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
@@ -227,6 +227,13 @@ Tier **Iterative** — one packet per completed cycle. Narration is DISPATCHED,
227
227
  never remembered: build the PHASE PACKET and dispatch
228
228
  `orc-trace-writer-haiku-4-5`. Canonical: `../_shared/phases/trace.md`.
229
229
 
230
+ ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
231
+
232
+ `orc rules slice --lane orc-test --json` is the ONLY assembler; never build
233
+ the card here. It rides under the house rules and above the task —
234
+ **house rules > your project's rules > ORC's own packs** — and its `line` prints
235
+ VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
236
+ never a silent choice) and `rules_overridden[]`.
230
237
  ## Waiting mid-run (`/orc-wait`)
231
238
 
232
239
  Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
@@ -99,6 +99,13 @@ a failure**. A call the answer does not name is a call this lane does not make.
99
99
  Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
100
100
  command you are about to run, out loud, before running it.
101
101
 
102
+ ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
103
+
104
+ `orc rules slice --lane orc-verify --json` is the ONLY assembler; never build
105
+ the card here. It rides under the house rules and above the task —
106
+ **house rules > your project's rules > ORC's own packs** — and its `line` prints
107
+ VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
108
+ never a silent choice) and `rules_overridden[]`.
102
109
  ## Waiting mid-run (`/orc-wait`)
103
110
 
104
111
  Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
@@ -143,6 +143,14 @@ v0.41.0 has been recording and never reading. **Usage lives in its own file
143
143
  100% doc-header-derived and `orc wiki sync` is its only writer. Render what the
144
144
  CLI returns; never compute an order, a tier or an estimate here.
145
145
 
146
+ **One doc at a time (v1.7.0).** `/orc-wiki update <doc-or-topic>` is the targeted
147
+ refresh under the name people type; `/orc-wiki add "<topic>"` adds ONE new doc to
148
+ a wiki that already exists, without re-planning any other area. A topic is
149
+ resolved with `orc wiki resolve` (free) before anything is scanned — AMBIGUOUS is
150
+ a question, never a guess — a new row is RESERVED with `orc wiki add`, and the
151
+ run ends with `orc wiki refs`, the derived-reference sweep. Flow: A0–A7 in
152
+ references/partial-refresh.md.
153
+
146
154
  ## Refresh & staleness (references/staleness.md — THE canonical freshness reference)
147
155
 
148
156
  Freshness is computed on read, never stored: measure `scan_commit` (from
@@ -163,6 +171,13 @@ the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
163
171
  documented defaults, out loud. Priorities and families:
164
172
  `../_shared/config-precedence.md`.
165
173
 
174
+ ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
175
+
176
+ `orc rules slice --lane orc-wiki --json` is the ONLY assembler; never build
177
+ the card here. It rides under the house rules and above the task —
178
+ **house rules > your project's rules > ORC's own packs** — and its `line` prints
179
+ VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
180
+ never a silent choice) and `rules_overridden[]`.
166
181
  ## Calls
167
182
 
168
183
  **ONE catalogue, and it is not you:** `orc lane calls orc-wiki --json` names every
@@ -52,12 +52,20 @@ in this skill** — one engine, the same rule the wiki tier itself lives under
52
52
  ## Targeted refresh
53
53
 
54
54
  ```
55
+ /orc-wiki update <doc> the same thing, under the name people type
56
+ /orc-wiki update "<topic>" resolved to a doc first — see below
55
57
  /orc-wiki refresh <doc>
56
58
  /orc-wiki refresh --only api/refunds/**
57
59
  /orc-wiki refresh --top 2
58
60
  /orc-wiki refresh --all-touched (today's delta behaviour)
59
61
  ```
60
62
 
63
+ `update` is an ENTRY, not a second mechanism. A filename goes straight into
64
+ R0–R5 below. A topic goes through `orc wiki resolve "<topic>" --json` first
65
+ (free, no scan): **exit 0** names the doc · **exit 2** is AMBIGUOUS, so ask which
66
+ one rather than scanning a guess · **exit 1** means nothing covers it, and the
67
+ request is really an ADD.
68
+
61
69
  It **skips Phase 0 branch detection and Phase 1 area planning entirely** — the doc
62
70
  exists, so its coverage area is already in its own header. That skip is the whole
63
71
  saving in wall-clock terms.
@@ -77,6 +85,66 @@ task refresh simply never reaches it.
77
85
  **Crosslink rules are unchanged:** tags publish per scan-task, no refresh path
78
86
  bulk-deletes `wiki/crosslink/`, and the dead-tag sweep still runs per point.
79
87
 
88
+ ## Add ONE topic — `/orc-wiki add "<topic>"` (v1.7.0)
89
+
90
+ The other half of "one doc at a time". Targeted refresh answers *this doc has
91
+ moved*; this answers *this topic is not in the wiki at all* — and until v1.7.0 a
92
+ new coverage area only appeared as a by-product of the coverage-gap sweep during
93
+ a delta refresh, so "add the remittance feature" had no path that did not
94
+ re-plan every area in the repo.
95
+
96
+ Like a targeted refresh it **skips Phase 0 branch detection and Phase 1 area
97
+ planning**. Unlike one, it ends with the **reference sweep**: adding a doc moves
98
+ more derived surfaces than changing one does.
99
+
100
+ ```
101
+ A0 resolve orc wiki resolve "<topic>" --json free
102
+ exit 0 MATCH → this is really an UPDATE. Say so, route there.
103
+ exit 2 AMBIGUOUS → ask which doc. NEVER scan a guess.
104
+ exit 1 NEW → continue.
105
+ exit 3 → no wiki, or unregistered. Fix that first.
106
+ A1 scope the resolver returns `suggested_covers` from PATH NAMES ONLY.
107
+ Show them as a proposal and let the user correct them. ONE turn.
108
+ A wrong glob is a doc that documents the wrong area forever.
109
+ A2 confirm slug · title · covers · the resolved TIER · the token + $ estimate.
110
+ ONE turn. NOTHING spawns before the user says yes.
111
+ A3 reserve orc wiki add <slug> --title "<t>" --covers "<glob>" free
112
+ Writes a STUB with `status: reserved` — a target for the scan,
113
+ not a document. It is reported as outstanding until a scan
114
+ replaces the body, so a half-finished add can never look done.
115
+ A4 scan ONE scan-task, at the tier the ladder resolved
116
+ A5 write doc body + crosslink tags (the per-scan-task rule, unchanged).
117
+ Replace `status: reserved` with a real `scanned_at`,
118
+ `scanned_commit` and `covered_files` set.
119
+ A6 references orc wiki refs free
120
+ A7 integrity the existing self-check, scoped to the new doc
121
+ ```
122
+
123
+ ### A6 — the reference sweep, and why it is its own step
124
+
125
+ After ONE doc is written, these surfaces are derived from the doc SET and are
126
+ now behind it. Before v1.7.0 they were repaired from memory, one at a time, and
127
+ the ones nobody remembered stayed wrong — which is likeliest on a SMALL run,
128
+ because the run feels too small to need a sweep.
129
+
130
+ | Surface | What goes wrong | Repaired by |
131
+ |---|---|---|
132
+ | `wiki-meta.json` + `wiki/INDEX.md` | the new doc is not registered | `orc wiki refs` does it (free) |
133
+ | a reserved row | the reservation never got its scan | reported, with the update command |
134
+ | `wiki/orc-orientation.md` | its reading order predates the new doc | reported — free to regenerate |
135
+ | `wiki/orc-architecture-overview.md` | it names neither the file nor the area | reported — free, and OPTIONAL |
136
+ | the `CLAUDE.md` pointer block | its doc COUNT is now measurably wrong | reported |
137
+ | `wiki/crosslink/**` | a tag anchored to a file that is gone | reported, offered per tag, never bulk-deleted |
138
+
139
+ `orc wiki refs` **repairs only the registration**, because `orc wiki sync` is
140
+ free and already the single writer of those two files. Everything else is
141
+ REPORTED with its command. A sweep that silently regenerated prose would be
142
+ spending money nobody asked it to spend, which is the same rule the free-repair
143
+ ladder above is built on.
144
+
145
+ `orc wiki refs --check` reports and repairs nothing. Exit **0** clean · **1**
146
+ work pending or registration repaired · **2** cannot compute.
147
+
80
148
  ## The scan tier ladder (`wiki_scan_tier`, default `ladder`)
81
149
 
82
150
  Every scan-task used to dispatch the most expensive scanner in the payload whether
@@ -48,6 +48,20 @@ Then detect state and branch:
48
48
  - **Wiki checkpoint exists (mid-scan)** → RESUME. Re-anchor from
49
49
  state-of-play + checkpoint; show "X of Y areas done, ~Z remaining"; light
50
50
  cost note; continue where it stopped.
51
+ - **`/orc-wiki update <doc-or-topic>` (explicit)** → **TARGETED REFRESH**, the
52
+ same branch as `refresh <doc>` below and the same flow. It exists because
53
+ `update some-doc.md` is what a user actually types. A FILENAME routes straight
54
+ to the refresh; a TOPIC ("the remittance feature") goes through
55
+ `orc wiki resolve "<topic>" --json` first (free): exit 0 names the doc and you
56
+ refresh it, exit 2 is AMBIGUOUS and you ask which one, exit 1 means nothing
57
+ covers it and this is really an ADD.
58
+ - **`/orc-wiki add "<topic>"` (explicit)** → **ADD ONE TOPIC**
59
+ (references/partial-refresh.md, the A0–A7 flow). One new doc in a wiki that
60
+ already exists, without re-planning a single other area. It skips branch
61
+ detection and area planning like a targeted refresh does, and it ends with the
62
+ **reference sweep** (`orc wiki refs`) rather than a bare `orc wiki sync` —
63
+ adding a doc moves more derived surfaces than changing one does. Never start
64
+ it without the ONE confirmation turn at A2.
51
65
  - **`/orc-wiki refresh <doc> | --only <glob> | --top N | --all-touched`
52
66
  (explicit)** → **TARGETED REFRESH** (references/partial-refresh.md). Skips
53
67
  branch detection AND area planning — the doc exists, so its coverage area is
@@ -66,6 +80,6 @@ Then detect state and branch:
66
80
  re-publishes crosslink tags in the same pass (hard rule 11), preserves the
67
81
  folder (rule 12), and ends by regenerating the orientation doc + atlas
68
82
  (derived, cheap). A LEGACY wiki with unpublished tags is a backfill, not a
69
- refresh — route to CROSSLINK-ONLY.
83
+ refresh — route to CROSSLINK-ONLY.
70
84
 
71
85
  <!-- /orc:layer -->