@azure-id/orc 2.0.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 +401 -0
- package/README-id.md +52 -23
- package/README.md +50 -22
- package/bin/build-agents.js +24 -25
- package/bin/clear-logs.js +620 -0
- package/bin/cli.js +1155 -158
- package/bin/fix.js +459 -0
- package/bin/gotcha.js +288 -8
- package/bin/habit.js +1538 -1453
- package/bin/mockrun-catalog.js +3 -0
- package/bin/onboarding-content.js +2 -1
- package/bin/pricing.json +28 -21
- package/bin/trace-write.js +869 -657
- package/bin/verify-contracts.js +108 -27
- package/bin/verify-package.js +17 -6
- package/bin/webui/api.js +125 -6
- package/bin/webui/css/panels/hookui.css +79 -0
- package/bin/webui/fixtures/behaviour.js +30 -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 +32 -3
- package/bin/webui/fixtures/knowledge.js +2 -2
- 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 +9 -6
- package/bin/webui/fixtures/wait.js +98 -97
- package/bin/webui/i18n/en/behaviour.json +13 -0
- package/bin/webui/i18n/en/hookui.json +290 -194
- package/bin/webui/i18n/en/maintenance.json +71 -52
- package/bin/webui/i18n/en/settings.json +60 -60
- package/bin/webui/i18n/id/behaviour.json +13 -0
- package/bin/webui/i18n/id/hookui.json +290 -194
- package/bin/webui/i18n/id/maintenance.json +71 -52
- package/bin/webui/i18n/id/settings.json +60 -60
- package/bin/webui/js/05-banners.js +181 -172
- package/bin/webui/js/06-edit.js +193 -183
- package/bin/webui/js/panels/behaviour.js +77 -12
- 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 +1 -0
- package/mock-run/extra-slots.md +1 -1
- package/mock-run/habits.md +1 -1
- 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.md +157 -157
- package/package.json +1 -1
- package/templates/agents/MODEL-MAPPING.md +32 -29
- package/templates/agents/orc-analyze-mini-sonnet-5-high.md +2 -2
- package/templates/agents/{orc-claude-writer-opus-5-med.md → orc-claude-writer-opus-5-low.md} +4 -4
- package/templates/agents/orc-executor-haiku-4-5.md +1 -1
- package/templates/agents/orc-executor-opus-5-low.md +1 -1
- package/templates/agents/orc-executor-sonnet-4-6-high.md +1 -1
- package/templates/agents/orc-executor-sonnet-4-6-med.md +1 -1
- package/templates/agents/orc-executor-sonnet-5-high.md +2 -2
- 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-pattern-codifier-sonnet-5-high.md +2 -2
- package/templates/agents/orc-planner-mini-sonnet-5-high.md +2 -2
- package/templates/agents/orc-retro-sonnet-5-high.md +2 -2
- package/templates/agents/{orc-reviewer-opus-5-med.md → orc-reviewer-opus-5-low.md} +4 -4
- package/templates/agents/{orc-wiki-scanner-opus-5-med.md → orc-wiki-scanner-opus-5-low.md} +3 -3
- package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +2 -2
- package/templates/commands/orc-fix.md +18 -0
- package/templates/commands/orc-wiki.md +64 -64
- package/templates/hooks/README.md +75 -7
- package/templates/hooks/orc-session-hook.js +78 -3
- package/templates/hooks/orc-statusline-render.js +317 -23
- package/templates/hooks/orc-statusline.js +162 -49
- package/templates/hooks/orc-subagent-line.js +23 -5
- package/templates/hooks/orc-weather-fetch.js +123 -0
- package/templates/skills/_shared/extra-dispatch.md +5 -5
- package/templates/skills/_shared/gotchas.md +27 -7
- package/templates/skills/_shared/habits.md +2 -2
- package/templates/skills/_shared/opus5-only.md +14 -14
- package/templates/skills/_shared/phases/review.md +2 -2
- package/templates/skills/_shared/phases/trace-verbs.md +17 -3
- package/templates/skills/_shared/phases/trace.md +136 -136
- package/templates/skills/_shared/review-slice.md +28 -1
- package/templates/skills/_shared/wait.md +1 -0
- package/templates/skills/orc/README.md +2 -2
- package/templates/skills/orc/SKILL.md +1 -1
- 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/preflight-report.md +3 -3
- package/templates/skills/orc/references/ultra-mode.md +1 -1
- package/templates/skills/orc/schemas/checkpoint.md +122 -122
- package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +3 -3
- package/templates/skills/orc/subskills/orc-review-verify/core.md +1 -1
- package/templates/skills/orc-analyze/SKILL.md +4 -2
- 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/SKILL.md +5 -5
- package/templates/skills/orc-fast/SKILL.md +8 -6
- package/templates/skills/orc-fix/SKILL.md +110 -0
- package/templates/skills/orc-mini/SKILL.md +4 -4
- package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -2
- package/templates/skills/orc-quick/README.md +1 -1
- package/templates/skills/orc-quick/SKILL.md +2 -2
- package/templates/skills/orc-quick/references/dispatch-gate.md +3 -2
- package/templates/skills/orc-quick/references/gh-mode.md +4 -2
- package/templates/skills/orc-retro/SKILL.md +1 -1
- package/templates/skills/orc-retro/examples/retro-mock.md +16 -16
- 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 +1 -1
- package/templates/skills/orc-wiki/references/phases/phase-2.md +3 -3
- package/templates/skills/orc-wiki/references/phases/phase-3c.md +3 -2
- package/templates/agents/orc-claude-writer-opus-4-8-high.md +0 -48
- package/templates/agents/orc-wiki-scanner-opus-4-8-high.md +0 -74
|
@@ -1,271 +1,276 @@
|
|
|
1
|
-
# Reference — targeted refresh, the scan tier ladder, debt and usage (v0.46.0)
|
|
2
|
-
|
|
3
|
-
Loaded when the user asks for a refresh, or when `/orc-wiki refresh …` is the
|
|
4
|
-
entry. This is the half that makes a 2-line change cost 2 lines.
|
|
5
|
-
|
|
6
|
-
## What already worked, and must not be rebuilt
|
|
7
|
-
|
|
8
|
-
- `orc wiki impact` already classifies every doc `CLEAN | TOUCHED | STRUCTURAL`
|
|
9
|
-
against **its own** `scanned_commit`.
|
|
10
|
-
- Delta refresh has been the default since v0.33.0.
|
|
11
|
-
- `orc wiki sync` is free and CLI-only.
|
|
12
|
-
- `computeWikiFreshness` already makes staleness coverage-relative.
|
|
13
|
-
|
|
14
|
-
Nothing here replaces any of it. `orc wiki plan` sits ON TOP of `impact` and
|
|
15
|
-
answers the question impact does not: **what to do about it, in what order, for
|
|
16
|
-
how much.**
|
|
17
|
-
|
|
18
|
-
## Free repairs ALWAYS come before anything that costs money
|
|
19
|
-
|
|
20
|
-
A hard rule, in this order, every time:
|
|
21
|
-
|
|
22
|
-
| # | Step | Cost | Fixes |
|
|
23
|
-
|---|---|---|---|
|
|
24
|
-
| 1 | `orc wiki sync` | free | UNREGISTERED / drifted registration |
|
|
25
|
-
| 2 | regenerate `wiki/orc-orientation.md` | free | the derived doc every consumer reads first |
|
|
26
|
-
| 3 | crosslink-only backfill | free | tags publishable from already-anchored rows |
|
|
27
|
-
| 4 | targeted refresh | **money** | actual doc rot |
|
|
28
|
-
|
|
29
|
-
**A user must never be able to pay for something a free step would have fixed.**
|
|
30
|
-
`orc wiki plan` prints the available free repairs above the priced table; do the
|
|
31
|
-
same in prose, and never offer step 4 while a step 1–3 is outstanding.
|
|
32
|
-
|
|
33
|
-
## `orc wiki plan` — the ranked, priced work list
|
|
34
|
-
|
|
35
|
-
Free, CLI, no model. Exit 0 nothing to do · 1 work pending, all light · 2 work
|
|
36
|
-
pending, at least one deep · 3 cannot compute.
|
|
37
|
-
|
|
38
|
-
**The ranking rule, and the reasons for it:**
|
|
39
|
-
|
|
40
|
-
1. **`STRUCTURAL` always first.** A doc pointing at a file that no longer exists is
|
|
41
|
-
actively lying, and no cheaper step repairs it — a targeted refresh cannot
|
|
42
|
-
re-anchor blind, which is also why STRUCTURAL always takes the deep tier.
|
|
43
|
-
2. **Then by use × delta**, where `used` is how many of the last 20 runs actually
|
|
44
|
-
put that doc into a slice. Refresh what gets read.
|
|
45
|
-
3. **Zero-use docs sink to the bottom** with a retire hint. `used: ?` (no usage
|
|
46
|
-
data yet) is NOT zero-use and must never be ranked as dead.
|
|
47
|
-
|
|
48
|
-
Render what the CLI returns. **Never compute the order, the tier or the estimate
|
|
49
|
-
in this skill** — one engine, the same rule the wiki tier itself lives under
|
|
50
|
-
(`../../_shared/detecting-artifacts.md`).
|
|
51
|
-
|
|
52
|
-
## Targeted refresh
|
|
53
|
-
|
|
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
|
|
57
|
-
/orc-wiki refresh <doc>
|
|
58
|
-
/orc-wiki refresh --only api/refunds/**
|
|
59
|
-
/orc-wiki refresh --top 2
|
|
60
|
-
/orc-wiki refresh --all-touched (today's delta behaviour)
|
|
61
|
-
```
|
|
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
|
-
|
|
69
|
-
It **skips Phase 0 branch detection and Phase 1 area planning entirely** — the doc
|
|
70
|
-
exists, so its coverage area is already in its own header. That skip is the whole
|
|
71
|
-
saving in wall-clock terms.
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
R0 probe orc wiki plan --json (free)
|
|
75
|
-
R1 confirm the doc, the delta, the TIER, the token + $ estimate. ONE turn.
|
|
76
|
-
R2 scan ONE scan-task, at the tier the ladder resolved
|
|
77
|
-
R3 write doc body + crosslink tags (unchanged — per-scan-task rule)
|
|
78
|
-
R4 register orc wiki sync (free)
|
|
79
|
-
R5 integrity the existing self-check, scoped to the touched doc
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
**No new pause mechanic.** The fixed pause every 5 scan-tasks still holds; a 1–2
|
|
83
|
-
task refresh simply never reaches it.
|
|
84
|
-
|
|
85
|
-
**Crosslink rules are unchanged:** tags publish per scan-task, no refresh path
|
|
86
|
-
bulk-deletes `wiki/crosslink/`, and the dead-tag sweep still runs per point.
|
|
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
|
-
|
|
148
|
-
## The scan tier ladder (`wiki_scan_tier`, default `ladder`)
|
|
149
|
-
|
|
150
|
-
Every scan-task used to dispatch the most expensive scanner in the payload whether
|
|
151
|
-
the delta was 2 lines or 2000. Five rows, in order, first match wins:
|
|
152
|
-
|
|
153
|
-
| Condition | Tier | Agent |
|
|
154
|
-
|---|---|---|
|
|
155
|
-
| first scan of an area (no doc yet) | deep | `orc-wiki-scanner-opus-
|
|
156
|
-
| `STRUCTURAL` | deep | `orc-wiki-scanner-opus-
|
|
157
|
-
| ≥ `wiki_tier_deep_files` covered files touched (default 3) | deep | `orc-wiki-scanner-opus-
|
|
158
|
-
| a new exported symbol in a covered file | deep | `orc-wiki-scanner-opus-
|
|
159
|
-
| otherwise (small delta, no new surface) | **light** | **`orc-wiki-scanner-sonnet-5-high`** |
|
|
160
|
-
|
|
161
|
-
- **`opus5_only` needs no new pair.**
|
|
162
|
-
`orc-wiki-scanner-opus-5-
|
|
163
|
-
that one agent** while the flag is on. `OPUS5_ONLY_ROLES` gains no row and no
|
|
164
|
-
phantom pair — see `../../_shared/opus5-only.md`.
|
|
165
|
-
- **`wiki_scan_tier: always_deep`** restores pre-v0.46.0 behaviour exactly.
|
|
166
|
-
- **NEVER SILENT.** The resolved tier is printed in `orc wiki plan` and in the R1
|
|
167
|
-
confirmation. A cheaper model is a decision the user sees, never a quiet
|
|
168
|
-
substitution.
|
|
169
|
-
- The light scanner escalates rather than under-delivers: a `needs_context` return
|
|
170
|
-
naming a new symbol or a missing anchor is re-run deep. That is cheap; a doc with
|
|
171
|
-
invented anchors is permanent.
|
|
172
|
-
|
|
173
|
-
**Expected saving:** a delta refresh where 3 of 4 docs have a one-or-two-file delta
|
|
174
|
-
goes from 4×deep to 1×deep + 3×light — roughly **40% off**, with the deep scan
|
|
175
|
-
still doing the work that needs it.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
wiki
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
1
|
+
# Reference — targeted refresh, the scan tier ladder, debt and usage (v0.46.0)
|
|
2
|
+
|
|
3
|
+
Loaded when the user asks for a refresh, or when `/orc-wiki refresh …` is the
|
|
4
|
+
entry. This is the half that makes a 2-line change cost 2 lines.
|
|
5
|
+
|
|
6
|
+
## What already worked, and must not be rebuilt
|
|
7
|
+
|
|
8
|
+
- `orc wiki impact` already classifies every doc `CLEAN | TOUCHED | STRUCTURAL`
|
|
9
|
+
against **its own** `scanned_commit`.
|
|
10
|
+
- Delta refresh has been the default since v0.33.0.
|
|
11
|
+
- `orc wiki sync` is free and CLI-only.
|
|
12
|
+
- `computeWikiFreshness` already makes staleness coverage-relative.
|
|
13
|
+
|
|
14
|
+
Nothing here replaces any of it. `orc wiki plan` sits ON TOP of `impact` and
|
|
15
|
+
answers the question impact does not: **what to do about it, in what order, for
|
|
16
|
+
how much.**
|
|
17
|
+
|
|
18
|
+
## Free repairs ALWAYS come before anything that costs money
|
|
19
|
+
|
|
20
|
+
A hard rule, in this order, every time:
|
|
21
|
+
|
|
22
|
+
| # | Step | Cost | Fixes |
|
|
23
|
+
|---|---|---|---|
|
|
24
|
+
| 1 | `orc wiki sync` | free | UNREGISTERED / drifted registration |
|
|
25
|
+
| 2 | regenerate `wiki/orc-orientation.md` | free | the derived doc every consumer reads first |
|
|
26
|
+
| 3 | crosslink-only backfill | free | tags publishable from already-anchored rows |
|
|
27
|
+
| 4 | targeted refresh | **money** | actual doc rot |
|
|
28
|
+
|
|
29
|
+
**A user must never be able to pay for something a free step would have fixed.**
|
|
30
|
+
`orc wiki plan` prints the available free repairs above the priced table; do the
|
|
31
|
+
same in prose, and never offer step 4 while a step 1–3 is outstanding.
|
|
32
|
+
|
|
33
|
+
## `orc wiki plan` — the ranked, priced work list
|
|
34
|
+
|
|
35
|
+
Free, CLI, no model. Exit 0 nothing to do · 1 work pending, all light · 2 work
|
|
36
|
+
pending, at least one deep · 3 cannot compute.
|
|
37
|
+
|
|
38
|
+
**The ranking rule, and the reasons for it:**
|
|
39
|
+
|
|
40
|
+
1. **`STRUCTURAL` always first.** A doc pointing at a file that no longer exists is
|
|
41
|
+
actively lying, and no cheaper step repairs it — a targeted refresh cannot
|
|
42
|
+
re-anchor blind, which is also why STRUCTURAL always takes the deep tier.
|
|
43
|
+
2. **Then by use × delta**, where `used` is how many of the last 20 runs actually
|
|
44
|
+
put that doc into a slice. Refresh what gets read.
|
|
45
|
+
3. **Zero-use docs sink to the bottom** with a retire hint. `used: ?` (no usage
|
|
46
|
+
data yet) is NOT zero-use and must never be ranked as dead.
|
|
47
|
+
|
|
48
|
+
Render what the CLI returns. **Never compute the order, the tier or the estimate
|
|
49
|
+
in this skill** — one engine, the same rule the wiki tier itself lives under
|
|
50
|
+
(`../../_shared/detecting-artifacts.md`).
|
|
51
|
+
|
|
52
|
+
## Targeted refresh
|
|
53
|
+
|
|
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
|
|
57
|
+
/orc-wiki refresh <doc>
|
|
58
|
+
/orc-wiki refresh --only api/refunds/**
|
|
59
|
+
/orc-wiki refresh --top 2
|
|
60
|
+
/orc-wiki refresh --all-touched (today's delta behaviour)
|
|
61
|
+
```
|
|
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
|
+
|
|
69
|
+
It **skips Phase 0 branch detection and Phase 1 area planning entirely** — the doc
|
|
70
|
+
exists, so its coverage area is already in its own header. That skip is the whole
|
|
71
|
+
saving in wall-clock terms.
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
R0 probe orc wiki plan --json (free)
|
|
75
|
+
R1 confirm the doc, the delta, the TIER, the token + $ estimate. ONE turn.
|
|
76
|
+
R2 scan ONE scan-task, at the tier the ladder resolved
|
|
77
|
+
R3 write doc body + crosslink tags (unchanged — per-scan-task rule)
|
|
78
|
+
R4 register orc wiki sync (free)
|
|
79
|
+
R5 integrity the existing self-check, scoped to the touched doc
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**No new pause mechanic.** The fixed pause every 5 scan-tasks still holds; a 1–2
|
|
83
|
+
task refresh simply never reaches it.
|
|
84
|
+
|
|
85
|
+
**Crosslink rules are unchanged:** tags publish per scan-task, no refresh path
|
|
86
|
+
bulk-deletes `wiki/crosslink/`, and the dead-tag sweep still runs per point.
|
|
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
|
+
|
|
148
|
+
## The scan tier ladder (`wiki_scan_tier`, default `ladder`)
|
|
149
|
+
|
|
150
|
+
Every scan-task used to dispatch the most expensive scanner in the payload whether
|
|
151
|
+
the delta was 2 lines or 2000. Five rows, in order, first match wins:
|
|
152
|
+
|
|
153
|
+
| Condition | Tier | Agent |
|
|
154
|
+
|---|---|---|
|
|
155
|
+
| first scan of an area (no doc yet) | deep | `orc-wiki-scanner-opus-5-low` |
|
|
156
|
+
| `STRUCTURAL` | deep | `orc-wiki-scanner-opus-5-low` |
|
|
157
|
+
| ≥ `wiki_tier_deep_files` covered files touched (default 3) | deep | `orc-wiki-scanner-opus-5-low` |
|
|
158
|
+
| a new exported symbol in a covered file | deep | `orc-wiki-scanner-opus-5-low` |
|
|
159
|
+
| otherwise (small delta, no new surface) | **light** | **`orc-wiki-scanner-sonnet-5-high`** |
|
|
160
|
+
|
|
161
|
+
- **`opus5_only` needs no new pair.** The deep tier is already
|
|
162
|
+
`orc-wiki-scanner-opus-5-low`. The flag flips the light tier to that same agent,
|
|
163
|
+
so **both tiers collapse onto that one agent** while the flag is on. `OPUS5_ONLY_ROLES` gains no row and no
|
|
164
|
+
phantom pair — see `../../_shared/opus5-only.md`.
|
|
165
|
+
- **`wiki_scan_tier: always_deep`** restores pre-v0.46.0 behaviour exactly.
|
|
166
|
+
- **NEVER SILENT.** The resolved tier is printed in `orc wiki plan` and in the R1
|
|
167
|
+
confirmation. A cheaper model is a decision the user sees, never a quiet
|
|
168
|
+
substitution.
|
|
169
|
+
- The light scanner escalates rather than under-delivers: a `needs_context` return
|
|
170
|
+
naming a new symbol or a missing anchor is re-run deep. That is cheap; a doc with
|
|
171
|
+
invented anchors is permanent.
|
|
172
|
+
|
|
173
|
+
**Expected saving:** a delta refresh where 3 of 4 docs have a one-or-two-file delta
|
|
174
|
+
goes from 4×deep to 1×deep + 3×light — roughly **40% off**, with the deep scan
|
|
175
|
+
still doing the work that needs it.
|
|
176
|
+
|
|
177
|
+
**Since v2.1.0 the deep tier is Opus 5.5 low** (it was Opus 4.8 high). Opus 5.5 low
|
|
178
|
+
costs $4 / $20 per MTok and Sonnet 5 high costs $2 / $10, but at a higher effort.
|
|
179
|
+
Nobody has measured the tokens of each tier yet, so the ladder stays. To see
|
|
180
|
+
whether light is still cheaper, read the per-agent rows in `/orc-retro`.
|
|
181
|
+
|
|
182
|
+
## Budget cap (`wiki_refresh_budget`, default 0 = no cap)
|
|
183
|
+
|
|
184
|
+
Max scan-tasks per refresh run. A capped refresh is a **planned stop**, not an
|
|
185
|
+
interrupt:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
Refresh · budget reached
|
|
189
|
+
Done : 2 of 4 scan-tasks Left : 2 tasks, est. 73k tokens / $0.14
|
|
190
|
+
orc wiki sync ran. The wiki is REGISTERED and consistent right now.
|
|
191
|
+
The two remaining docs are AGING, not broken.
|
|
192
|
+
Continue any time: /orc-wiki refresh --top 2
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Stopping mid-refresh must leave a VALID wiki. That already holds — sync runs after
|
|
196
|
+
every scan-task and freshness is per-doc. This only makes the stop first-class.
|
|
197
|
+
|
|
198
|
+
**It is a different mechanic from the fixed pause every 5 scan-tasks. Do not merge
|
|
199
|
+
them.** The pause is a checkpoint you continue through; the budget is a ceiling you
|
|
200
|
+
stop at.
|
|
201
|
+
|
|
202
|
+
## `orc wiki debt`
|
|
203
|
+
|
|
204
|
+
One line, for the habit: docs pending, tokens, dollars, oldest debt, tier, and the
|
|
205
|
+
reassurance that matters — *nothing is broken*. Exit 0 no debt · 1 debt exists · 3
|
|
206
|
+
no wiki.
|
|
207
|
+
|
|
208
|
+
Inside `/orc`, one preflight tail **only when debt exists**:
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
wiki : FRESH — 4 docs pending refresh, 335k tok / $0.94
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**This is the real budget win** — not a cheaper full refresh, but a full refresh you
|
|
215
|
+
never need.
|
|
216
|
+
|
|
217
|
+
## `orc wiki usage` and retirement (`wiki_retire_after_runs`, default 0 = never)
|
|
218
|
+
|
|
219
|
+
Since v0.41.0 every dispatch whose slice carried wiki material writes a `wiki:`
|
|
220
|
+
continuation and every return carries `wiki_used`. Two releases of clean
|
|
221
|
+
point-of-use attribution that nothing read back. `orc wiki usage --rebuild` reads
|
|
222
|
+
it into `.claude/orc/wiki-usage.json`.
|
|
223
|
+
|
|
224
|
+
> **Do NOT put usage in `wiki-meta.json`.** That manifest is 100% derived from doc
|
|
225
|
+
> headers and `orc wiki sync` is its only writer — a load-bearing rule. Usage comes
|
|
226
|
+
> from traces, so it gets its own file and its own writer.
|
|
227
|
+
|
|
228
|
+
Three things it unlocks: the ranking above · honest coverage on `orc wiki status`
|
|
229
|
+
(`14 registered · 8 in active use · 2 never used in 20 runs`) · and retirement.
|
|
230
|
+
|
|
231
|
+
When `wiki_retire_after_runs` is non-zero and a doc has been in no slice for that
|
|
232
|
+
many runs, OFFER retirement — never do it silently:
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
2 docs were never put into a slice in 20 runs. They cost money on every full
|
|
236
|
+
refresh — and context tokens whenever they ARE included.
|
|
237
|
+
Retire them? (moves to wiki/retired/, drops from INDEX.md and every plan.
|
|
238
|
+
Reversible. Never a delete.)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Retirement MOVES, never deletes**, and `orc wiki sync` re-derives `INDEX.md`
|
|
242
|
+
afterwards. A retired doc that turns out to matter is one `git mv` away.
|
|
243
|
+
|
|
244
|
+
## The consent prompt gets a real number
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
Before: ⚠ This is an EXPENSIVE, possibly multi-session scan. Continue?
|
|
248
|
+
After: ⚠ Full scan: 14 areas, est. 2.1M tokens / $3.80 → $6.10, 25–40 min,
|
|
249
|
+
2 pause points, ~48% of a 5-hour window on Max 20x.
|
|
250
|
+
A targeted refresh of the 4 stale docs: 335k tokens / $0.94.
|
|
251
|
+
Continue with the full scan?
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
The numbers come from `/orc-budget`'s engine (`orc wiki plan --json` carries them).
|
|
255
|
+
When there is no history yet, print `insufficient history` rather than a guess.
|
|
256
|
+
|
|
257
|
+
## Later, opt-in: surgical section refresh — NOT in this release
|
|
258
|
+
|
|
259
|
+
Noted so it is not re-invented. A doc's sections each anchor to files; in principle
|
|
260
|
+
only the sections whose files changed need regenerating (~20% of the body). It
|
|
261
|
+
waits because it needs the wiki-doc header parser to carry a section→file map — one
|
|
262
|
+
of the GRAMMAR-shaped drift surfaces the contract lint cannot see — and because a
|
|
263
|
+
partial body rewrite can break the integrity self-check's anchoring rule. If it is
|
|
264
|
+
ever built: default off, and the integrity check still runs over the whole doc.
|
|
265
|
+
|
|
266
|
+
## What must NOT change
|
|
267
|
+
|
|
268
|
+
- `orc wiki sync` stays the only writer of `wiki-meta.json` + `INDEX.md`, and stays
|
|
269
|
+
100% derived from doc headers.
|
|
270
|
+
- `meta.scan_commit` stays the OLDEST doc's anchor, and nothing reads it as a tier.
|
|
271
|
+
- Edges come from `wiki_fresh_max` / `wiki_aging_max`. A hardcoded 10/30 is a bug.
|
|
272
|
+
- `computeWikiFreshness` stays the ONE engine. `plan`, `debt` and `usage` all call
|
|
273
|
+
it, and skills never compute a tier.
|
|
274
|
+
- Crosslink publish stays per-scan-task.
|
|
275
|
+
- A STRUCTURAL blind spot still degrades one step and never past AGING.
|
|
276
|
+
- The fixed pause every 5 scan-tasks is not configurable.
|
|
@@ -37,7 +37,7 @@ Then detect state and branch:
|
|
|
37
37
|
boundary guard fired and already names the real fix. Auto-detect OFFERS it in
|
|
38
38
|
one line with a small cost note; never start unasked.
|
|
39
39
|
- **Empty/absent `wiki/` AND no wiki checkpoint** → FRESH. Show the generic
|
|
40
|
-
cost warning ("scans your code with Opus
|
|
40
|
+
cost warning ("scans your code with Opus 5.5 low — expensive, likely
|
|
41
41
|
multi-session, fixed pause every 5 areas; nothing scanned until you
|
|
42
42
|
confirm") and wait for explicit consent. Only THEN Phase 1.
|
|
43
43
|
- **Wiki checkpoint exists (mid-scan)** → RESUME. Re-anchor from
|
|
@@ -11,12 +11,12 @@ Write checkpoint + state-of-play into the run subfolder BEFORE dispatching.
|
|
|
11
11
|
`wiki_tier_deep_files`, default 3 — full ladder in references/partial-refresh.md):
|
|
12
12
|
first scan · STRUCTURAL · wide delta · a new exported symbol → **deep**; otherwise
|
|
13
13
|
**light** (`orc-wiki-scanner-sonnet-5-high`). `always_deep` restores the old
|
|
14
|
-
behaviour, `opus5_only` collapses BOTH tiers onto `orc-wiki-scanner-opus-5-
|
|
14
|
+
behaviour, `opus5_only` collapses BOTH tiers onto `orc-wiki-scanner-opus-5-low`
|
|
15
15
|
(no new pair). **PRINT the resolved tier** — a cheaper model is never a quiet
|
|
16
16
|
substitution. **Extra (`extra_enabled`) reaches the SCANNER ONLY, and it is a POSITION per tier** — `wiki-scanner-deep` / `wiki-scanner-light`, held by `orc extra role` and resolved for the tier JUST PICKED. The resolved tier already prints; PRINT ITS TARGET with it. Load `../extra.md` at the scan phase when the gate is on; `orc wiki sync` never routes foreign (registration is CLI-derived — there is no model in it to replace). A wiki doc is evidence-anchored and cheap to re-scan, which is what makes the scanner the one role here worth handing over; `orc wiki sync` never routes foreign (registration is CLI-derived — there is no model in it to replace). `wiki_refresh_budget` (0 = no cap) caps scan-tasks per run as a
|
|
17
17
|
PLANNED stop, and `wiki_retire_after_runs` (0 = never) offers — never performs —
|
|
18
18
|
retirement of a doc no run has sliced.
|
|
19
|
-
Per scan-task: spawn `orc-wiki-scanner-opus-
|
|
19
|
+
Per scan-task: spawn `orc-wiki-scanner-opus-5-low` BY NAME (`orc-wiki-scanner-sonnet-5-high` at the light tier; under `opus5_only` BOTH tiers use `orc-wiki-scanner-opus-5-low`) with the area's file list + the
|
|
20
20
|
doc-writing contract (schemas/wiki-doc.md — v2: evidence anchors in contract
|
|
21
21
|
sections, `keywords[]` + per-file `covered_files` hashes, AND `crosslink_tags`
|
|
22
22
|
= one tag body per OUTWARD boundary point in the area's files, or `none`+reason)
|
|
@@ -42,6 +42,6 @@ repo believing it was done. At every pause, lead with the coverage line:
|
|
|
42
42
|
> The {N} docs so far are registered and usable now. Reply **continue** to scan
|
|
43
43
|
> the rest.
|
|
44
44
|
At completion, say **✅ Wiki complete — all {M} areas scanned.** The two must be
|
|
45
|
-
impossible to confuse at a glance.
|
|
45
|
+
impossible to confuse at a glance.
|
|
46
46
|
|
|
47
47
|
<!-- /orc:layer -->
|
|
@@ -16,7 +16,7 @@ existing docs' rows, opens only the {N} anchored files, no repo scan, no doc
|
|
|
16
16
|
changes. Proceed?" (Prereq: `wiki/` has docs.)
|
|
17
17
|
|
|
18
18
|
**Steps:** collect boundary points from the docs' `Contracts & shapes` rows
|
|
19
|
-
(read DOCS, not source) → dispatch Opus
|
|
19
|
+
(read DOCS, not source) → dispatch Opus 5.5 low over the anchored files ONLY
|
|
20
20
|
(tag bodies per schemas/crosslink-tag.md; unanchorable row = SKIPPED + reported)
|
|
21
21
|
→ write `wiki/crosslink/<kind>/<slug>.md` → resolve the consume half when
|
|
22
22
|
`.claude/orc-crosslink.config.yaml` exists → `orc wiki sync` → crosslink
|
|
@@ -26,6 +26,7 @@ coverage/`pages` — coverage is a scan question; the boundary is not.
|
|
|
26
26
|
**Zero-tag outcome is always explicit + reasoned, never a bare finish:** rows
|
|
27
27
|
too thin/absent to tag → SAY so + recommend an incremental refresh of just those
|
|
28
28
|
areas (an honest cost, not "never a refresh"); pure consumer (inbound-only, no
|
|
29
|
-
API of its own) → valid no-op but NAME the inbound-only edges (references/crosslink.md).
|
|
29
|
+
API of its own) → valid no-op but NAME the inbound-only edges (references/crosslink.md).
|
|
30
|
+
|
|
30
31
|
|
|
31
32
|
<!-- /orc:layer -->
|