@azure-id/orc 1.8.1 → 1.8.2

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 (46) hide show
  1. package/CHANGELOG.md +220 -0
  2. package/README-id.md +90 -71
  3. package/README.md +77 -31
  4. package/bin/cli.js +45460 -44867
  5. package/bin/graph-extract.js +2409 -120
  6. package/bin/graph-gain.js +404 -0
  7. package/bin/graph-map.js +232 -0
  8. package/bin/graph-notes.js +49 -8
  9. package/bin/graph-query.js +1770 -808
  10. package/bin/graph-resolve.js +93 -16
  11. package/bin/graph-shard.js +325 -0
  12. package/bin/graph.js +658 -605
  13. package/bin/verify-contracts.js +140 -0
  14. package/bin/verify-package.js +14 -0
  15. package/bin/webui/api.js +6 -0
  16. package/bin/webui/fixtures/index.js +6 -1
  17. package/bin/webui/fixtures/knowledge.js +41 -1
  18. package/bin/webui/fixtures/stats.js +107 -104
  19. package/bin/webui/i18n/en/knowledge.json +16 -1
  20. package/bin/webui/i18n/id/knowledge.json +16 -1
  21. package/bin/webui/js/panels/knowledge.js +68 -3
  22. package/package.json +1 -1
  23. package/templates/agents/orc-executor-haiku-4-5.md +8 -13
  24. package/templates/agents/orc-executor-opus-4-7-high.md +8 -13
  25. package/templates/agents/orc-executor-opus-4-7-med.md +8 -13
  26. package/templates/agents/orc-executor-opus-4-8-high.md +8 -13
  27. package/templates/agents/orc-executor-opus-5-high.md +8 -13
  28. package/templates/agents/orc-executor-opus-5-low.md +8 -13
  29. package/templates/agents/orc-executor-opus-5-med.md +8 -13
  30. package/templates/agents/orc-executor-sonnet-4-6-high.md +8 -13
  31. package/templates/agents/orc-executor-sonnet-4-6-med.md +8 -13
  32. package/templates/agents/orc-executor-sonnet-5-high.md +8 -13
  33. package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +15 -12
  34. package/templates/hooks/README.md +13 -3
  35. package/templates/hooks/orc-graph-hook.js +148 -13
  36. package/templates/skills/_shared/code-graph.md +148 -20
  37. package/templates/skills/_shared/phases/execution.md +13 -11
  38. package/templates/skills/_shared/phases/planning.md +8 -1
  39. package/templates/skills/_shared/phases/ship.md +5 -1
  40. package/templates/skills/_shared/phases/trace.md +2 -0
  41. package/templates/skills/_shared/phases/wiki-consult.md +1 -1
  42. package/templates/skills/_shared/read-ladder.md +10 -2
  43. package/templates/skills/orc/SKILL.md +1 -1
  44. package/templates/skills/orc-analyze/SKILL.md +13 -13
  45. package/templates/skills/orc-diy/references/flow-schema.md +1 -1
  46. package/templates/skills/orc-wiki/references/staleness.md +1 -1
package/README.md CHANGED
@@ -7,14 +7,14 @@
7
7
  *Intake → analyze → plan → score → parallel subagents → review → verify → ship.*
8
8
 
9
9
  ![npm](https://img.shields.io/npm/v/%40azure-id%2Forc?style=for-the-badge&color=cb3837&logo=npm)
10
- ![Version](https://img.shields.io/badge/version-1.8.1-blue.svg?style=for-the-badge)
10
+ ![Version](https://img.shields.io/badge/version-1.8.2-blue.svg?style=for-the-badge)
11
11
  ![License](https://img.shields.io/badge/license-MIT-green.svg?style=for-the-badge)
12
12
  ![Node](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg?style=for-the-badge)
13
13
  ![Claude Code](https://img.shields.io/badge/Claude_Code-Skills-purple.svg?style=for-the-badge)
14
14
  ![Dependencies](https://img.shields.io/badge/dependencies-zero-lightgrey.svg?style=for-the-badge)
15
15
  ![GitHub stars](https://img.shields.io/github/stars/azure-id/orc?style=for-the-badge&color=yellow)
16
16
 
17
- **Latest: v1.8.1** · updated 2026-09-16 · [full changelog](CHANGELOG.md)
17
+ **Latest: v1.8.2** · updated 2026-09-21 · [full changelog](CHANGELOG.md)
18
18
 
19
19
  **On npm: [`@azure-id/orc`](https://www.npmjs.com/package/@azure-id/orc)** — `npm i -g @azure-id/orc`
20
20
 
@@ -388,28 +388,45 @@ A local map of how your code is connected. It is **off by default**.
388
388
  ```bash
389
389
  orc config set code_graph on # code lanes build and use the map (free)
390
390
  orc config set code_graph_notes wave # optional: one-sentence notes (costs tokens)
391
+ orc graph map # the repository ranked, before you know a file name
391
392
  orc graph ctx OrderService.create # a card: callers, calls, SQL/HTTP/env effects
393
+ orc graph ctx "GET /orders/:id" # a route is a symbol too
392
394
  orc graph changes # what THIS diff touched, and how risky
393
395
  orc graph cochange src/orders.js # what usually changes with this file
394
396
  orc graph coverage src/orders.js # how much of it the parser really saw
397
+ orc graph gain # what the map put in, and an estimate of what it kept out
395
398
  ```
396
399
 
397
400
  - **Structure is free.** The CLI parses the code. No model, no dependency.
398
401
  Functions, methods, classes and route handlers (`GET /orders/:id`); a
399
402
  middleware passed by name is a `used by` link.
403
+ - **Languages:** JavaScript, TypeScript, Python, Go, Java, C#, PHP, Ruby, Rust,
404
+ Kotlin, C / C++, and the `<script>` block of a Vue or Svelte component. Where
405
+ your project already has the tool, ORC borrows it and the parse is exact —
406
+ Python's `ast`, your own `node_modules/typescript`, the `go` on PATH. ORC
407
+ itself still has zero dependencies. `ORC_GRAPH_NO_BORROW=1` turns that off.
408
+ - **A URL is an edge.** A test that calls `request(app).get("/orders/search")`
409
+ is a caller of that route, and the card says so. So is an instance alias
410
+ (`const svc = new OrderService(); svc.run()`), an inherited method
411
+ (`this.ok()` → `Base.ok`) and a name re-exported through a barrel file.
400
412
  - **Updates are small.** Git already hashes every file. Only the files whose hash
401
413
  changed are parsed again — a teammate's change heals at the next preflight.
402
- - **Every link says how sure it is:** `LOCAL`, `IMPORT`, `UNIQUE`, `AMBIGUOUS`
403
- (every candidate listed) or `UNRESOLVED`. The graph never guesses.
414
+ - **Every link says how sure it is:** `LOCAL`, `IMPORT`, `UNIQUE`, `ROUTE`,
415
+ `AMBIGUOUS` (every candidate listed) or `UNRESOLVED`. The graph never guesses.
404
416
  - **A card has a token budget.** It never goes over it, and it says what it hid.
405
- `--format tree` names each column once instead of on every row, and falls back
406
- to the normal shape when a card is too small to pay for the header.
417
+ `--source [N]` adds the target's own lines to the same call. `--for-slice`
418
+ prints only the OUTSIDE view of a file an agent is about to read in full.
419
+ `--format tree` names each column once instead of on every row.
420
+ - **`orc graph map` answers "which files matter here"** before you know a file
421
+ name, inside a budget. `--focus` re-ranks the whole repository around the files
422
+ or names your request already mentioned. **Rank is a hint about where to look
423
+ first**, never proof that a file matters to a change.
407
424
  - **It shows where code is. It does not replace reading it.** Agents still read
408
425
  the line range before they act. A card header says `coverage partial 327-466`
409
426
  when the parser could not finish a file — **no recorded gap is not proof of
410
- completeness**. A card also lists only the callers that NAME the symbol: one
411
- that reaches it through an HTTP route or a string dispatch is not a link, so
412
- **a card's silence is not proof of absence**.
427
+ completeness**. A card lists the callers that NAME the symbol or reach it by a
428
+ URL; one that reaches it through a job runner or a string dispatch is not a
429
+ link, so **a card's silence is not proof of absence**.
413
430
  - **Every answer carries a `generation`** — a number that goes up each time the
414
431
  map changes. A card quoted back later can be placed in time.
415
432
  - **It keeps itself current in three ways, and only one of them needs a lane to
@@ -418,8 +435,9 @@ orc graph coverage src/orders.js # how much of it the parser really saw
418
435
  — `/orc`, `/orc-ultra`, `/orc-diy`, `/orc-mini`, `/orc-fast`, `/orc-quick` —
419
436
  still builds it at preflight and updates it after each change. Other lanes
420
437
  never call it. **Nothing runs on a timer and nothing runs in the background.**
421
- - **The hook also hands a worker the anchors it would otherwise search for**, and
422
- everything it hands over is labelled repository data, never an instruction.
438
+ - **The hook also hands a worker the anchors it would otherwise search for** —
439
+ for a Grep, a Glob and a shell search (`grep`, `rg`, `git grep`, `findstr`) —
440
+ and everything it hands over is labelled repository data, never an instruction.
423
441
  Switch it off with `orc config set code_graph_hooks off`; the map still works.
424
442
 
425
443
  The contract: `templates/skills/_shared/code-graph.md`. The hook:
@@ -432,6 +450,10 @@ The contract: `templates/skills/_shared/code-graph.md`. The hook:
432
450
  > a session**. Turn the map on because you want the cards: what calls what, what
433
451
  > a change would touch, where the parser could not finish. Not for a number.
434
452
  > The working is in `eval/graph-replay.js`, and it spends no tokens to re-run.
453
+ > `orc graph gain` reports the same honesty per run: what the map PUT IN is
454
+ > recorded, what it kept out is an **estimate** printed as a range, and a
455
+ > measured figure appears only when your own project has three runs with the map
456
+ > on and three with it off.
435
457
 
436
458
  ## `orc ui` — the control panel
437
459
 
@@ -613,7 +635,8 @@ templates/
613
635
  └── agents/ 48 model-pinned subagents + MODEL-MAPPING.md
614
636
  bin/cli.js installer, config editor, flow composer, run-state reader, and
615
637
  the deterministic half of every lane. Every read speaks --json
616
- bin/graph*.js the code graph: store, extraction, resolution + its cache, signals, notes
638
+ bin/graph*.js the code graph: store, extraction, resolution + its cache and
639
+ shards, signals, notes, the ranked map, the gain meter
617
640
  bin/webui/ `orc ui` — the local control panel: css/ + js/ + i18n/<lang>/ +
618
641
  fixtures/, one file per layer and per panel. Zero deps, no build step
619
642
  bin/mockrun-catalog.js the mocked-run catalogue (derived from the files on disk)
@@ -683,28 +706,51 @@ a current audit: [EVAL-REPORT.md](EVAL-REPORT.md).
683
706
  **Full history: [CHANGELOG.md](CHANGELOG.md)** — or `orc changelog`, which prints
684
707
  only what is newer than the version you have.
685
708
 
686
- ### v1.8.1 - the guard that only failed on Windows _(2026-09-16)_
687
-
688
- `npm publish` could not run on Windows. The `prepack` guard reported nine
689
- drifted executor agents, and `git status` reported no change at all.
690
-
691
- **The cause was a line ending, not content.** `.gitattributes` says
692
- `* text=auto`, so git stores the generated executor agents with LF and checks
693
- them out native — a Windows clone holds CRLF. The generator read the template
694
- as it is on disk, but injected the `effort:` frontmatter line with a hardcoded
695
- LF. `bin/build-agents.js` now takes its line ending from the template, and
696
- `--check` compares LF-normalized text, so the guard gives the same result in
697
- either worktree. A test in `test/payload.test.js` holds the rule.
698
-
699
- One test carried the same fault. `npm test` also runs on `prepack`, and the
700
- statusline graph-component test sliced a hook's source to the next `\n}\n` — a
701
- needle a CRLF checkout never contains. It now normalizes the source first.
702
-
703
- No shipped payload changed. The generated agent files are byte-identical.
709
+ ### v1.8.2 — the map that finds what a grep cannot _(2026-09-21)_
710
+
711
+ v1.8.0 shipped the code graph with a known hole: a card listed every caller that
712
+ NAMES a symbol, so a test reaching a route by its URL was not a caller and the
713
+ card was silent about it. **A URL is now an edge** — and so is an instance alias
714
+ (`const svc = new OrderService(); svc.run()`), an inherited method and a name
715
+ re-exported through a barrel. A bare call no longer resolves to the only method
716
+ in the repository with that name; that guess was an invented edge and it is gone.
717
+ On django, confident edges went 65,379 → 72,955 and `UNIQUE` guesses 23,866 →
718
+ 6,442.
719
+
720
+ **Five more languages** — Ruby, Rust, Kotlin, C / C++ and the `<script>` block of
721
+ a Vue or Svelte component. **Borrowed parsers** where your project already has
722
+ the tool: your own `node_modules/typescript` and the `go` on PATH join Python's
723
+ `ast`. ORC still has zero dependencies.
724
+
725
+ **Fewer round trips.** `ctx --source [N]` adds the target's lines to the card.
726
+ `ctx --for-slice` prints only the outside view of a file an agent is about to
727
+ read in full, 30–51% smaller than the card it replaces. `update --notes-pending`
728
+ answers both in one call. The hook now answers a shell search too, and
729
+ `code_graph_hooks on,read` names a wide file's six most reached symbols so the
730
+ next read can ask for a range.
731
+
732
+ **`orc graph map`** ranks the repository before you know a file name, inside a
733
+ budget, with `--focus`. Rank is a hint about where to look first, never proof.
734
+ **A one-symbol card is about twice as fast** — the resolution cache is sharded,
735
+ so django goes 881 → 480 ms, and the shards answer exactly what the full index
736
+ answers or they decline (577 cards compared, 0 different).
737
+
738
+ **`orc graph gain`** reports what the map put in — recorded — and an estimate,
739
+ always a range, of what it kept out. It never prints one number and never claims
740
+ a saving it cannot show.
741
+
742
+ **`code_graph_ignore`** is a new key: extra globs the graph never indexes.
743
+
744
+ Two gates in this release were missed and the CHANGELOG says so with the
745
+ numbers: the borrowed parsers ship on the maintainer's call although the
746
+ confident-rate gate measured +1.0 / −0.3 / −0.3, and `orc graph map` is wired to
747
+ planning only because the replay measured 0.39 answerable planning calls per run
748
+ against a gate of three.
704
749
 
705
750
  <details>
706
- <summary><strong>Earlier releases</strong> — 117 of them, titles only. Full text in <a href="CHANGELOG.md">CHANGELOG.md</a>.</summary>
751
+ <summary><strong>Earlier releases</strong> — 118 of them, titles only. Full text in <a href="CHANGELOG.md">CHANGELOG.md</a>.</summary>
707
752
 
753
+ - **v1.8.1** — the guard that only failed on Windows · _2026-09-16_
708
754
  - **v1.8.0** — the code graph: a map of the code that stays fresh · _2026-09-16_
709
755
  - **v1.7.1** — the rules card now reaches the agent · _2026-09-14_
710
756
  - **v1.7.0** — the rules that keep the slop out · _2026-09-13_