@azure-id/orc 1.8.2 → 1.9.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 (65) hide show
  1. package/CHANGELOG.md +299 -0
  2. package/README-id.md +68 -51
  3. package/README.md +60 -45
  4. package/bin/cli.js +301 -39
  5. package/bin/graph-audit.js +235 -0
  6. package/bin/graph-extract.js +308 -3
  7. package/bin/graph-gain.js +23 -3
  8. package/bin/graph-map.js +9 -1
  9. package/bin/graph-query.js +152 -10
  10. package/bin/graph-shard.js +6 -1
  11. package/bin/graph-signals.js +287 -4
  12. package/bin/graph.js +717 -658
  13. package/bin/verify-contracts.js +277 -61
  14. package/bin/verify-package.js +19 -1
  15. package/bin/webui/fixtures/knowledge.js +21 -4
  16. package/bin/webui/i18n/en/knowledge.json +5 -2
  17. package/bin/webui/i18n/id/knowledge.json +5 -2
  18. package/bin/webui/js/panels/knowledge.js +21 -2
  19. package/mock-run/orc-quick.md +141 -113
  20. package/package.json +1 -1
  21. package/templates/agents/MODEL-MAPPING.md +15 -5
  22. package/templates/agents/orc-executor-haiku-4-5.md +19 -1
  23. package/templates/agents/orc-executor-opus-4-7-high.md +19 -1
  24. package/templates/agents/orc-executor-opus-4-7-med.md +19 -1
  25. package/templates/agents/orc-executor-opus-4-8-high.md +19 -1
  26. package/templates/agents/orc-executor-opus-5-high.md +19 -1
  27. package/templates/agents/orc-executor-opus-5-low.md +19 -1
  28. package/templates/agents/orc-executor-opus-5-med.md +19 -1
  29. package/templates/agents/orc-executor-sonnet-4-6-high.md +19 -1
  30. package/templates/agents/orc-executor-sonnet-4-6-med.md +19 -1
  31. package/templates/agents/orc-executor-sonnet-5-high.md +19 -1
  32. package/templates/agents/orc-planner-mini-opus-5-med.md +75 -69
  33. package/templates/agents/orc-planner-mini-sonnet-5-high.md +73 -67
  34. package/templates/agents/orc-recon-opus-5-low.md +109 -0
  35. package/templates/agents/orc-recon-sonnet-4-6-med.md +109 -0
  36. package/templates/commands/orc-mini.md +10 -12
  37. package/templates/commands/orc-quick.md +20 -33
  38. package/templates/hooks/README.md +11 -1
  39. package/templates/hooks/orc-graph-hook.js +53 -7
  40. package/templates/hooks/orc-trace.js +476 -471
  41. package/templates/skills/_shared/code-graph.md +56 -17
  42. package/templates/skills/_shared/phases/execution.md +4 -4
  43. package/templates/skills/_shared/phases/planning.md +3 -3
  44. package/templates/skills/_shared/phases/preflight.md +1 -1
  45. package/templates/skills/_shared/phases/review.md +3 -1
  46. package/templates/skills/_shared/phases/rules.md +172 -159
  47. package/templates/skills/_shared/phases/ship.md +1 -1
  48. package/templates/skills/_shared/phases/trace.md +4 -2
  49. package/templates/skills/_shared/phases/wiki-consult.md +9 -5
  50. package/templates/skills/_shared/read-ladder.md +14 -1
  51. package/templates/skills/_shared/return-validation.md +22 -0
  52. package/templates/skills/context-combiner/SKILL.md +13 -13
  53. package/templates/skills/orc/SKILL.md +1 -1
  54. package/templates/skills/orc/subskills/orc-execution/core.md +171 -159
  55. package/templates/skills/orc-fast/SKILL.md +3 -3
  56. package/templates/skills/orc-mini/SKILL.md +145 -137
  57. package/templates/skills/orc-mini/examples/mini-run-mock.md +64 -50
  58. package/templates/skills/orc-mini/references/complexity.md +119 -0
  59. package/templates/skills/orc-quick/README.md +495 -423
  60. package/templates/skills/orc-quick/SKILL.md +157 -212
  61. package/templates/skills/orc-quick/references/context-doc.md +145 -114
  62. package/templates/skills/orc-quick/references/defect.md +101 -0
  63. package/templates/skills/orc-quick/references/dispatch-gate.md +55 -24
  64. package/templates/skills/orc-quick/references/gh-mode.md +148 -127
  65. package/templates/skills/orc-quick/references/look.md +107 -0
@@ -0,0 +1,119 @@
1
+ # The complexity read — one line, with the numbers behind it
2
+
3
+ This replaces the full lane's scoring table. It asks one question: **is this
4
+ still a mini-sized change?** It answers with counts, not with a feeling, and
5
+ the answer is an OFFER — the user always chooses.
6
+
7
+ It runs after the planner returns and passes the exit gate, before dispatch.
8
+
9
+ ## 1. The one call
10
+
11
+ | Call | What you take from it | Exit codes |
12
+ |---|---|---|
13
+ | `orc graph impact <declared_files> --complexity [--risk=<class>[@<file:line>],…] --if-enabled --json --brief` | `complexity.line` (print it verbatim), `complexity.numbers`, `complexity.why[]`, and `facts{}` for the planner slice | 0 found · 1 no graph · 3 off · 4 not found |
14
+ | the planner's own `facets.risk[]` | the cited risk classes — pass them in `--risk=`, so the ONE line is complete | — |
15
+
16
+ ONE call for ALL the declared files, and it answers what `impact` plus one
17
+ `cochange` per file used to answer. The co-change half runs inside the same
18
+ process, against the same per-HEAD cache.
19
+
20
+ **Exit 3 means the graph is off.** Print the `graph off` form of the line (§3)
21
+ and decide from `facets.risk[]` alone. Never invent a number.
22
+
23
+ **An older CLI** answers without `complexity` and without `facts`. Then count as
24
+ §2 says, from `impact` and one `cochange` per file, and print the line yourself.
25
+
26
+ ## 1b. `graph_facts` — the same numbers, in the planner slice
27
+
28
+ The CLI returns them in `facts{}`, in exactly this shape. `map` comes back
29
+ `null`: the lane already holds the `map --focus` card from Phase 0 and fills it
30
+ in, so the same card is never computed twice. The planner is dispatched BEFORE
31
+ the complexity read and gets the same facts, so it can ground its own plan on
32
+ them instead of guessing:
33
+
34
+ ```yaml
35
+ graph_facts:
36
+ map: <the `map --focus` text, 800 tokens at most, or null>
37
+ impact: [{file, confident_callers, caller_files, tests_reaching}]
38
+ cochange: [{file, partners: [{path, count}]}]
39
+ generation: <n>
40
+ ```
41
+
42
+ The graph off, or every call exit 3 → `graph_facts: null`, and the planner plans
43
+ as it did before. A `cochange` partner that is not in the plan becomes an
44
+ `open_questions[]` entry — never a file the planner adds in silence.
45
+
46
+ ## 2. How the CLI counts
47
+
48
+ **Confident callers** are the edges the graph is sure about: `LOCAL`, `IMPORT`,
49
+ `UNIQUE` and `ROUTE`. A `ROUTE` edge is a test or a client that reaches the code
50
+ through a URL — it counts, because it breaks like any other caller.
51
+
52
+ **`AMBIGUOUS` callers are counted separately** and printed as `maybe <n>`. They
53
+ never trip a threshold on their own. The catalogue says why: an `AMBIGUOUS`
54
+ caller is counted, never followed.
55
+
56
+ **Outside, not inside.** A caller that lives in a file the plan already declares
57
+ is not blast radius — it is part of the change. Only callers outside
58
+ `declared_files` count.
59
+
60
+ The four numbers live in `bin/graph-signals.js` as `COMPLEXITY_CALLER_FILES`,
61
+ `COMPLEXITY_CALLERS` and `COMPLEXITY_COCHANGE_MIN` (the fourth is "any risk
62
+ class"). **Change them there and here in the same commit.** The answer carries
63
+ them in `complexity.thresholds`, so a reader can always check the verdict
64
+ against the numbers that produced it.
65
+
66
+ ## 3. The line
67
+
68
+ Print exactly one line — the CLI's `complexity.line`, verbatim. The lane prints
69
+ the third shape itself, because the CLI never answered. Three shapes:
70
+
71
+ ```
72
+ complexity: mini-ok — 3 files · confident callers 4 in 2 files · tests reach 2 · risk none · cochange none
73
+ complexity: recommend /orc — 6 files · callers 27 in 9 files · risk auth (src/routes/orders.js:12) · cochange src/auth.js x5 not in plan
74
+ complexity: mini-ok (graph off) — 3 files · risk none
75
+ ```
76
+
77
+ Trace it: `GATE complexity :: <the line>`.
78
+
79
+ ## 4. The four thresholds, and why each number
80
+
81
+ **Recommend the full lane when ANY of these holds.** One is enough; they do not
82
+ add up.
83
+
84
+ | Threshold | Why this number |
85
+ |---|---|
86
+ | confident callers in **4 or more files** outside `declared_files` | mini's whole premise is ONE coherent area. Four outside files is a change that is felt across areas, and areas are what a planner and a reviewer exist for. |
87
+ | **8 or more confident callers** outside `declared_files` | one executor and one smoke gate verify a small blast radius well. Eight callers is the point where a reviewer starts to earn its cost. |
88
+ | **any `facets.risk[]` entry** | the six classes — auth, money, migration, security, concurrency, data-integrity — are exactly what the full lane's review and verify phases exist for. The planner already floors them to 70. |
89
+ | a **`cochange` partner with 3 or more co-commits** not in `declared_files` | the repository's own history says people always touch that file too. A plan without it is probably missing a file, and mini has no second pass to notice. |
90
+
91
+ ## 5. The offer
92
+
93
+ The recommendation never switches the lane by itself:
94
+
95
+ ```
96
+ complexity: recommend /orc — 6 files · callers 27 in 9 files · risk auth (src/routes/orders.js:12)
97
+
98
+ 1. switch to /orc (recommended — a cited auth risk, and 27 callers in 9 files)
99
+ 2. continue in mini
100
+
101
+ Your choice.
102
+ ```
103
+
104
+ **If the user continues in mini, write the NUMBERS into the decision log**, not
105
+ just the choice:
106
+
107
+ ```
108
+ complexity: recommended /orc (callers 27 in 9 files · risk auth) — user continued in mini
109
+ ```
110
+
111
+ Months later that line answers "did anyone know this was big?" without anyone
112
+ having to guess.
113
+
114
+ ## 6. Why the thresholds are printed, not hidden
115
+
116
+ The numbers sit in the `GATE complexity` trace line on purpose. `/orc-retro`
117
+ reads the traces, so a threshold that is wrong for a project can be MEASURED and
118
+ moved, instead of argued about. A verdict with no numbers behind it cannot be
119
+ calibrated by anyone.