0xray 4.0.41 → 4.0.42

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 (115) hide show
  1. package/.grok-plugin/plugin.json +1 -1
  2. package/.opencode/skills/orchestrator/SKILL.md +12 -0
  3. package/.xray/features.json +1 -1
  4. package/.xray/features.schema.json +1 -1
  5. package/AGENTS-consumer.md +2 -0
  6. package/AGENTS.md +2 -0
  7. package/README.md +52 -12
  8. package/SKILLS.md +2 -0
  9. package/dist/AGENTS.md +2 -0
  10. package/dist/CHANGELOG.md +13 -0
  11. package/dist/README.md +52 -12
  12. package/dist/SKILLS.md +2 -0
  13. package/dist/cli/commands/openclaw-install.js +1 -1
  14. package/dist/cli/index.js +12 -0
  15. package/dist/enforcement/index.d.ts +4 -0
  16. package/dist/enforcement/index.js +4 -0
  17. package/dist/enforcement/validators/code-quality-validators.js +6 -4
  18. package/dist/governance/llm-governance-provider.d.ts +7 -1
  19. package/dist/governance/llm-governance-provider.js +72 -14
  20. package/dist/governance/local-confer.d.ts +4 -1
  21. package/dist/governance/local-confer.js +22 -1
  22. package/dist/integrations/grok/grok-cli.js +10 -37
  23. package/dist/integrations/grok/hooks/grok-hook-utils.js +8 -1
  24. package/dist/integrations/hooks/confer-hook-runtime.mjs +23 -1
  25. package/dist/integrations/hooks/goggles-planes.json +4 -1
  26. package/dist/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
  27. package/dist/mcps/architect-tools.server.d.ts +6 -0
  28. package/dist/mcps/architect-tools.server.js +19 -2
  29. package/dist/mcps/config/server-config-registry.js +8 -6
  30. package/dist/mcps/governance.server.d.ts +1 -0
  31. package/dist/mcps/governance.server.js +46 -0
  32. package/dist/mcps/knowledge-skills/code-review.server.js +7 -0
  33. package/dist/mcps/knowledge-skills/security-audit.server.js +5 -3
  34. package/dist/mcps/mcp-client.js +1 -1
  35. package/dist/mcps/orchestrator/handlers/complexity-handler.js +2 -2
  36. package/dist/mcps/researcher.server.js +12 -3
  37. package/dist/nucleus/autonomy-kernel.d.ts +2 -0
  38. package/dist/nucleus/autonomy-kernel.js +17 -13
  39. package/dist/nucleus/confer-host.d.ts +35 -0
  40. package/dist/nucleus/confer-host.js +55 -0
  41. package/dist/nucleus/confer.d.ts +19 -3
  42. package/dist/nucleus/confer.js +111 -55
  43. package/dist/nucleus/lead-dev-plan-persistence.js +4 -2
  44. package/dist/nucleus/suit-temperament.d.ts +1 -1
  45. package/dist/nucleus/suit-temperament.js +2 -2
  46. package/dist/nucleus/synthesis-consult-receipt.d.ts +7 -1
  47. package/dist/nucleus/synthesis-consult-receipt.js +86 -35
  48. package/dist/reporting/framework-reporting-system.js +2 -5
  49. package/dist/reporting/log-parser.d.ts +2 -0
  50. package/dist/reporting/log-parser.js +7 -6
  51. package/dist/skills/orchestrator/SKILL.md +12 -0
  52. package/docs-site/docs/plates/activity-log.md +1 -1
  53. package/docs-site/docs/plates/boot.md +1 -1
  54. package/docs-site/docs/plates/centrifuge.md +1 -1
  55. package/docs-site/docs/plates/cursor-compact.md +1 -1
  56. package/docs-site/docs/plates/glossary.md +1 -1
  57. package/docs-site/docs/plates/goggles.md +1 -1
  58. package/docs-site/docs/plates/governance.md +1 -1
  59. package/docs-site/docs/plates/grok-compact.md +1 -1
  60. package/docs-site/docs/plates/grokbot.md +1 -1
  61. package/docs-site/docs/plates/host-pack.md +1 -1
  62. package/docs-site/docs/plates/house.md +1 -1
  63. package/docs-site/docs/plates/index.md +1 -1
  64. package/docs-site/docs/plates/inference-files.md +1 -1
  65. package/docs-site/docs/plates/kept-line.md +1 -1
  66. package/docs-site/docs/plates/kits.md +1 -1
  67. package/docs-site/docs/plates/lens-gate.md +1 -1
  68. package/docs-site/docs/plates/lens-page.md +1 -1
  69. package/docs-site/docs/plates/live-mesh.md +1 -1
  70. package/docs-site/docs/plates/memory-recall.md +1 -1
  71. package/docs-site/docs/plates/notes-page.md +1 -1
  72. package/docs-site/docs/plates/orchestration.md +1 -1
  73. package/docs-site/docs/plates/package-face.md +1 -1
  74. package/docs-site/docs/plates/payload-heat.md +1 -1
  75. package/docs-site/docs/plates/pickup-stamp.md +1 -1
  76. package/docs-site/docs/plates/pre-tool.md +1 -1
  77. package/docs-site/docs/plates/processor.md +1 -1
  78. package/docs-site/docs/plates/record-map.md +1 -1
  79. package/docs-site/docs/plates/reflection-page.md +1 -1
  80. package/docs-site/docs/plates/reporting.md +1 -1
  81. package/docs-site/docs/plates/review.md +1 -1
  82. package/docs-site/docs/plates/routing.md +1 -1
  83. package/docs-site/docs/plates/session-capture.md +1 -1
  84. package/docs-site/docs/plates/site-manual.md +1 -1
  85. package/docs-site/docs/plates/stamp-plate.md +1 -1
  86. package/docs-site/docs/plates/station-card.md +1 -1
  87. package/docs-site/docs/plates/station-heat.md +1 -1
  88. package/docs-site/docs/plates/suit-organs.md +1 -1
  89. package/docs-site/docs/plates/suit-settings.md +1 -1
  90. package/docs-site/docs/plates/suit-wear.md +1 -1
  91. package/docs-site/docs/plates/suit.md +1 -1
  92. package/docs-site/docs/plates/trail-state.md +1 -1
  93. package/docs-site/docs/plates/work-fresh.md +1 -1
  94. package/docs-site/docs/plates/write-home.md +1 -1
  95. package/llms.txt +2 -0
  96. package/package.json +2 -2
  97. package/scripts/mjs/verify-confer-core.mjs +153 -29
  98. package/scripts/mjs/verify-user-aside-core.mjs +3 -4
  99. package/scripts/node/bridge-mcp-wiring.cjs +236 -5
  100. package/scripts/node/confer-switch.cjs +66 -0
  101. package/scripts/node/install-bridges.cjs +16 -41
  102. package/src/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
  103. package/src/mcps/architect-tools.server.ts +26 -2
  104. package/src/mcps/config/__tests__/server-config-registry.test.ts +15 -6
  105. package/src/mcps/config/server-config-registry.ts +9 -6
  106. package/src/mcps/governance.server.ts +49 -0
  107. package/src/mcps/knowledge-skills/code-review.server.ts +8 -0
  108. package/src/mcps/knowledge-skills/security-audit.server.ts +11 -12
  109. package/src/mcps/mcp-client.ts +1 -1
  110. package/src/mcps/orchestrator/handlers/complexity-handler.ts +2 -1
  111. package/src/mcps/researcher.server.ts +19 -10
  112. package/src/skills/orchestrator/SKILL.md +12 -0
  113. package/vendor/@0xray/repertoire/scripts/run-live-synthesis-checkpoint.mjs +5 -51
  114. package/xray/features.json +1 -1
  115. package/xray/features.schema.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "0xray",
3
- "version": "4.0.41",
3
+ "version": "4.0.42",
4
4
  "description": "0xRay suit for Grok, Hermes, OpenClaw, OpenCode: mill+inspect, Codex, 7 MCP servers. Costume 45/42 is opt-in foundry, not the default wear.",
5
5
  "author": {
6
6
  "name": "0xRay AI",
@@ -72,6 +72,18 @@ The hold lasts for the work that named the plane. A sentence that does not say l
72
72
 
73
73
  Config: `features.json` → `multi_agent_orchestration.lead_dev_mode`
74
74
 
75
+ ## Confer
76
+
77
+ The TUI that is wearing the suit already spawned the MCP servers. Confer uses those servers. It does not start a private server and it does not run `hermes -z`.
78
+
79
+ When `.xray/state/confer-ask-s.1.json`, `confer-ask-s.2.json`, and `confer-ask-s.3.json` are on disk:
80
+
81
+ 1. Call the server and tool named in each ask. Researcher and code-review return evidence. Architect returns the assessment with `Verdict: UNREVIEWED`.
82
+ 2. Write one verdict line from this TUI's model: `Verdict: PASS`, `Verdict: CONDITIONAL`, or `Verdict: FAIL`, plus top risks and a hardening note.
83
+ 3. Call `record_confer_receipt` on `xray-governance` with `todoId`, `subagent`, `sessionId`, and that text.
84
+
85
+ Only `Verdict: PASS` completes the todo. FAIL, CONDITIONAL, and UNREVIEWED stay open. A session id that does not match the plan does not complete the todo. Grok, OpenCode, Hermes, and OpenClaw use these same three steps. Hermes is a voter only when Hermes is the TUI, and then only as that TUI's own model.
86
+
75
87
  ## Lead cadence (syncopation)
76
88
 
77
89
  The seven rules are the engine. The cadence is the time signature. Disk SSOT: `grok-bot/OP-PROC.md` (team specifics live in `house/`).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "./features.schema.json",
3
- "version": "4.0.41",
3
+ "version": "4.0.42",
4
4
  "description": "0xRay Framework - Unified Feature Configuration",
5
5
  "suit_temperament": {
6
6
  "profile": "auto",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "confer_on_synthesis": {
47
47
  "type": "boolean",
48
- "description": "Auto-run 3-agent confer quorum at synthesis checkpoint (default true)"
48
+ "description": "Opt in to the 3-agent confer quorum. A missing key stays off."
49
49
  },
50
50
  "confer": {
51
51
  "type": "object",
@@ -6,6 +6,8 @@ Quick reference for the 0xRay AI orchestration framework worn on **{{CONSUMER_NA
6
6
 
7
7
  **4.0** — a suit that survives the context window
8
8
 
9
+ Confer votes. Burst runs the swarm.
10
+
9
11
  Same **three-subsystem OS** as v2 (Inference · External Governance · Autonomous Engine). Constitution always on. Temperament scales ceremony. Four chat bridges plus Cursor project hooks. **Repertoire is preferred** — vendored 0.2.9 ships **on**. Dest is named laws, not keywords. Station is the compact ticket, not a substitute. Explicit opt-out only: `"enabled": false, "provider": "repertoire"`. Trim fat, do not gut the design.
10
12
 
11
13
  **Governance always on** (Codex PreToolUse, no new surface, no `eval`). **Engine ceremony** (analyze-complexity before spawn, confer) is **guided** by default so free-model OpenCode/Hermes stay in check. Frontier hosts (Grok 4.6 class) with `suit_temperament.profile: auto` **warn** on spawn-without-plan instead of deny — the engine is still there. Existing `.xray/features.json` without `suit_temperament` stays **guided**. Docs: v3 from v2 · Suit temperament.
package/AGENTS.md CHANGED
@@ -4,6 +4,8 @@ Quick reference for the xray AI orchestration framework (**4.0**).
4
4
 
5
5
  **4.0** — a suit that survives the context window.
6
6
 
7
+ Confer votes. Burst runs the swarm.
8
+
7
9
  **Exo, not catalog.** Three-subsystem OS (Inference · External Governance · Autonomous Engine) · constitution always on · temperament by host · 4 floors · **Repertoire preferred** (vendored 0.2.9, dest = laws).
8
10
 
9
11
  **Temperament:** ceremony (analyze-complexity before spawn, confer) is **guided** by default so free-model OpenCode/Hermes stay in check. Frontier hosts (Grok 4.6 class) with `suit_temperament.profile: auto` **warn** on spawn-without-plan; Codex 11/29/69 still **deny**. Missing `suit_temperament` stays guided. See `docs-site/docs/architecture/v3-from-v2.md`.
package/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  **4.0** — a suit that survives the context window
4
4
 
5
- ![0xRay v4 exo — CONSTITUTION ON](docs-site/static/img/exo-skeleton-v4.jpg)
5
+ ![0xRay 4.0.42 — Confer votes. Burst runs the swarm.](docs-site/static/img/exo-skeleton-v4.jpg)
6
+
7
+ Confer votes. Burst runs the swarm.
6
8
 
7
9
  Not a catalog of agents. The product is the **skeleton you wear**.
8
10
 
@@ -18,20 +20,22 @@ Not a catalog of agents. The product is the **skeleton you wear**.
18
20
 
19
21
  ```bash
20
22
  npm install 0xray
23
+ npx 0xray wear
21
24
  ```
22
25
 
23
- Consumer `npm install 0xray` auto-wires four chat bridges, Cursor project hooks, and seven MCP servers. **Repertoire is preferred** — vendored **0.2.9** ships on: factory + stack laws, in-process routing, extra host MCP `repertoire`. Not an eighth `xray-*` server. Dest is a judgment index. Explicit opt-out only: `"enabled": false, "provider": "repertoire"`. Do not pin 0.1.8.
26
+ `npm install 0xray` links vendored `@0xray/repertoire` and prints `npx 0xray wear`. It does not write `.mcp.json` or the chat bridges. Wear writes the consumer suit: managed `AGENTS.md`, `.xray` config, seven MCP servers, and the OpenCode, Grok, Hermes, and OpenClaw bridges (`install-bridges.cjs`). Inside a git checkout, wear also fastens Cursor project hooks. **Repertoire is preferred** — vendored **0.2.9** ships on: factory + stack laws, in-process routing, extra host MCP `repertoire`. Not an eighth `xray-*` server. Dest is a judgment index. Explicit opt-out only: `"enabled": false, "provider": "repertoire"`. Do not pin 0.1.8.
24
27
 
25
28
  ## Quick Start
26
29
 
27
30
  ```bash
28
- npm install 0xray # postinstall: mill+inspect plant + 4 bridges + 7 MCPs + AGENTS.md + .mcp.json
29
- npx 0xray status # verify install
30
- npx 0xray setup # optional: symlinks, hook extras
31
+ npm install 0xray
32
+ npx 0xray wear
33
+ npx 0xray status
34
+ npx 0xray setup --git-hooks # optional: git hooks only
31
35
  npx @0xray/foundry inspect --skip-live # mill receipt (chat is not a receipt)
32
36
  ```
33
37
 
34
- Manual per-platform install (idempotent, same result as postinstall):
38
+ Manual per-platform install (idempotent, same bridges wear writes):
35
39
 
36
40
  ```bash
37
41
  npx 0xray opencode install
@@ -51,12 +55,48 @@ Docs: [guides/autonomy-command](docs-site/docs/guides/autonomy-command.md) · Sk
51
55
 
52
56
  | Version | Highlights |
53
57
  |---------|------------|
54
- | **Unreleased** | Fasten is **foundry-plant/0**: builtin plant is mill+inspect only. `foundry.json` `"plant": "@0xray/blip"` (aliases `"plant": "blip"` / `"plant": "sound"`) fastens whatever that mill declares (looker / vibe / mixer live in the mill). Nested mill `@0xray/foundry@0.1.12`. CLI shims `foundry blip\|sound` remain (0.1.11+). Shop plant first-class (`shop-extract`, `shop-witness`, `shop-pin` + `foundry.json` `shopPlant`). |
58
+ | **4.0.42** | Confer votes. Burst runs the swarm. |
59
+ | **4.0.41** | Wake cascade stays on the station module. A fresh wear fastens mill and inspect. Goggles records the worn package path. The live page plays the mesh in the browser. |
60
+ | **4.0.40** | Live mesh runs the full loop: feed watch, render, direction, deploy, health, and the ledger both ways. |
61
+ | **4.0.39** | The seven stack laws stay worn. Repertoire in the suit is 0.2.9. |
62
+ | **4.0.38** | Codex term 70 requires the current source and the worn npm package. Dynamo's recommendation is honored. |
63
+ | **4.0.37** | A naked checkout wakes with repertoire on. |
64
+ | **4.0.36** | Goggles holds the stop through search, read, and a dist wipe. |
65
+ | **4.0.35** | Wear rewrites a checkout `dist/cli` launch to `node_modules/0xray`. |
66
+ | **4.0.34** | The lens stays on the worn build when the source is not packed. |
67
+ | **4.0.33** | Version bump. |
68
+ | **4.0.32** | `0xray look` opens one plane. Digest and triage return the card. Calling and confer stay off. |
69
+ | **4.0.31** | Goggles looks at one pipeline. Kind 0 stays quiet when the worn list matches the map. Calling and confer stay off. |
55
70
  | **4.0.30** | Fixes 4.0.29: `npx 0xray wear` and `setup` work outside a git checkout again. They write the 4.0.28 project setup, skip only Cursor hooks, and print one warning. Inside a git checkout they restore the 4.0.28 project setup, and `wear` adds Cursor hooks plus the unwear snapshot. Companion `@0xray/grok-bot` 0.1.8. Released 2026-09-28. |
56
71
  | **4.0.29** | `npm install` only creates the relative `node_modules/@0xray/repertoire` link to the vendored repertoire and prints `npx 0xray wear`. Run `npx 0xray wear` after install. Wear writes only the consumer project's `.cursor/hooks.json` (installed dist hooks, beside user entries); `npx 0xray unwear` restores the snapshot. Companion `@0xray/grok-bot` 0.1.8. Released 2026-09-28. |
57
72
  | **4.0.28** | MCP servers start through `scripts/node/mcp-launch.cjs` and only see PATH, HOME, XRAY_ROOT, plus names on their keep list. Tokens such as NPM_TOKEN are not inherited. User env values stay out of argv. Postinstall keeps user edits to AGENTS.md, .mcp.json, and opencode.json. `house init` does not copy EXAMPLE.md; doctor FAILs while `house/EXAMPLE.md` exists. Inspect adds a machinePlugin check. The Cursor hook defaults XRAY_ROOT to the suit. Companion `@0xray/grok-bot` 0.1.7. Released 2026-09-27. |
58
73
  | **4.0.27** | Host compact proof needs a generation id and a numeric usage percent, and the same preCompact receipt is mirrored to nested consumer wear roots. Memory scoring: [docs/memory-scoring.md](docs/memory-scoring.md) (orchestrator links it). Companion `@0xray/grok-bot` 0.1.6: general page vs `house/` overlay, `templates/house/`, `grok-bot house init`, doctor `GROK_BOT_HOUSE` or walk-up. Released 2026-09-26. |
74
+ | **4.0.26** | A lesson is stored when the task matches no signal. A Cursor compact cut is proved with a session log and a per-session receipt. |
75
+ | **4.0.25** | Plate schematics ship in the package. A worn suit resolves them from `dist/integrations/hooks/plates.cjs`. |
76
+ | **4.0.24** | Compaction and a host change are the same cut. The station card is the handoff. Repertoire in that suit is 0.2.8. |
77
+ | **4.0.23** | The Dynamo client starts when external governance is required. Proposals score locally when that governance is off. |
78
+ | **4.0.22** | The stamper strips present-tense patch pins from shipped prose. The cursor gate follows the suit mill. |
79
+ | **4.0.21** | Dest is named laws, not hangar slugs. Cleanup heat grows the project copy when Repertoire is on. |
80
+ | **4.0.20** | Heat grows the project copy. Session boot rewrites when HEAD moves. |
81
+ | **4.0.19** | Vendored Repertoire 0.2.5. Wear replaces older leftovers. |
82
+ | **4.0.18** | Wake heat joins bookmark, index, and mind. |
83
+ | **4.0.17** | Cursor heat writes session files when HEAD moves. |
84
+ | **4.0.16** | `npx 0xray validate` is a wear check. |
85
+ | **4.0.15** | Fasten is **foundry-plant/0**: builtin plant is mill+inspect only. `foundry.json` `"plant": "@0xray/blip"` (aliases `"plant": "blip"` / `"plant": "sound"`) fastens whatever that mill declares (looker / vibe / mixer live in the mill). Nested mill `@0xray/foundry@0.1.12`. CLI shims `foundry blip\|sound` remain (0.1.11+). Shop plant first-class (`shop-extract`, `shop-witness`, `shop-pin` + `foundry.json` `shopPlant`). |
86
+ | **4.0.14** | Factory-blip beds stamp the hook cell and keep six tellable bodies. |
87
+ | **4.0.13** | Station PreCompact merge keeps custom STATION.md keys. |
88
+ | **4.0.12** | Project-scoped Grok plugin dest so multi-seat wear does not clobber the machine plugin. |
89
+ | **4.0.11** | The npm pack includes `.grok-plugin/` so the Grok marketplace manifest ships. |
90
+ | **4.0.10** | Version bump. |
59
91
  | **4.0.9** | Mill target: postinstall does not mill npm global prefix or `_npx` as a consumer. Isolated HOME skips machine `~/.grok`. |
92
+ | **4.0.8** | Confer abstains locally instead of rubber-stamping a proposal. |
93
+ | **4.0.7** | Nested mill 0.1.9. Inventory writes `dna`. The mill does not mint on chain. |
94
+ | **4.0.6** | Nested mill 0.1.8. Isolated HOME skips machine Hermes and OpenClaw. |
95
+ | **4.0.5** | Inspect is a mill command. A costume dump fails mint. Mill plant stays mill + inspect. |
96
+ | **4.0.4** | Mill fastens an inspect suit. Costume is opt-in with `foundry.json` `"costume": true`. |
97
+ | **4.0.3** | Their plant is the suit. The mill plant is the factory discipline on the hanger. |
98
+ | **4.0.2** | The nested mill ships in the 0xray tarball. `@0xray/foundry` stays the standalone mill CLI. |
99
+ | **4.0.1** | CLI `--version` no longer dumps a Commander stack. The release gate smokes the organ and does not run another publish from a lifecycle script. |
60
100
  | **4.0.0** | Exo + temperament. Constitution always on; ceremony by host. Repertoire organ on (vendored 0.2). Station card survives compact/host-swap. **On npm.** [vision](docs-site/docs/architecture/v4-vision.md) · [now](docs-site/docs/architecture/v4-now.md) |
61
101
  | **3.4.1** | Unified `install-bridges.cjs` on postinstall — OpenCode, Grok, Hermes, OpenClaw in one pass. All 7 MCPs servers via `npx -y 0xray mcp <cmd>` (no `dist/` paths). Canonical `release.mjs` pipeline. |
62
102
  | **3.3.1** | Orchestrator confidence gate wired into execution planning. |
@@ -102,9 +142,9 @@ Docs: [guides/autonomy-command](docs-site/docs/guides/autonomy-command.md) · Sk
102
142
  - **External Governance** — Dynamo Solar SSOT; CodexPolicyService; weighted PHI/TAU deliberation.
103
143
  - **Autonomous Engine** — thinDispatch 7-flow routing; orchestrator confidence gate (v3.3.1).
104
144
 
105
- ## Consumer Install (postinstall)
145
+ ## Consumer Install (wear)
106
146
 
107
- On `npm install 0xray` in a consumer project, postinstall automatically:
147
+ `npm install 0xray` links the vendored repertoire and prints `npx 0xray wear`. Wear then:
108
148
 
109
149
  1. Copies **`AGENTS-consumer.md` → `AGENTS.md`**. Does **not** write consumer-root **`SKILLS.md`**.
110
150
  2. Fastens **mill plant** (`mill` + `inspect`). Fasten is **foundry-plant/0**: builtin plant is mill+inspect only. `foundry.json` `"plant": "@0xray/blip"` (aliases `"plant": "blip"` / `"plant": "sound"`) fastens whatever that mill package declares — organs (looker, vibe, mixer) live in the mill, not an xray catalog. Nested mill `@0xray/foundry@0.1.12`. CLI shims `foundry blip|sound` still exist on foundry 0.1.11+; fasten is the new cut. Not a 45-skill / 42-agent costume dump. `foundry.json` `"costume": true` is the opt-in dump.
@@ -113,7 +153,7 @@ On `npm install 0xray` in a consumer project, postinstall automatically:
113
153
  5. Writes project **`.mcp.json`** with 7 MCPs servers (`npx -y 0xray mcp …`)
114
154
  6. Installs **4 chat bridges**: OpenCode, Grok, Hermes, OpenClaw, plus **Cursor** `.cursor/hooks.json` (PPE + wiring; mill plant, not costume)
115
155
  7. Factory shop plant (`shop-extract`, `shop-witness`, `shop-pin` from groover-hangar) may coexist when worn. Extra shops: `foundry.json` `shopPlant`. Not costume.
116
- 8. Installs git pre-commit hook (non-blocking if not a git repo)
156
+ 8. Inside a git checkout, fastens Cursor `.cursor/hooks.json` and the hook scripts, and keeps an unwear snapshot. Outside a git checkout, skips those hooks and prints one warning. `npx 0xray setup --git-hooks` is what installs git hooks.
117
157
 
118
158
  See [llms.txt](llms.txt) for the agent map. Catalog of 45 skills lives in [SKILLS.md](SKILLS.md) — that is the exo catalog, not default consumer wear.
119
159
 
@@ -186,13 +226,13 @@ Docs: [memory routing](docs-site/docs/guides/memory-routing.md) · [Repertoire](
186
226
 
187
227
  ## Integrations
188
228
 
189
- | Platform | Install | Postinstall behavior |
229
+ | Platform | Install | What that command writes |
190
230
  |----------|---------|----------------------|
191
231
  | **OpenCode** | `npx 0xray opencode install` | Merges `opencode.json`, copies agent YML surfaces |
192
232
  | **Grok CLI / Build** | `npx 0xray grok install` | Project `.grok/plugins/0xray` (shared HOME does not clobber machine plugin), 7 MCPs servers |
193
233
  | **Hermes Agent** | `npx 0xray hermes install` | `~/.hermes/plugins/xray-hermes`, consumer root marker |
194
234
  | **OpenClaw** | `npx 0xray openclaw install` | `.xray/config/openclaw.json`, skill sync |
195
- | **Cursor** | postinstall (`installCursorBridge`) | Fastens `.cursor/hooks.json` + relative `.cursor/hooks/*.sh`. Rewrites leftover env-assignment one-liners. Not a fifth chat TUI. |
235
+ | **Cursor** | `npx 0xray wear` inside a git checkout | Fastens `.cursor/hooks.json` + relative `.cursor/hooks/*.sh`. Rewrites leftover env-assignment one-liners. Not a fifth chat TUI. |
196
236
 
197
237
  ## Governance & Codex
198
238
 
package/SKILLS.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  **4.0** — a suit that survives the context window
4
4
 
5
+ Confer votes. Burst runs the swarm.
6
+
5
7
  **45 skills** in this exo catalog. Default consumer plant is **`mill` + `inspect`**, not this dump. `npm install 0xray` does **not** sync 45 skills unless `foundry.json` `"costume": true`. Factory shop plant (`shop-extract`, `shop-witness`, `shop-pin`) coexists with mill plant when a hangar wears those shops. Extra shops: `foundry.json` `shopPlant`. Fasten is **foundry-plant/0**: builtin plant is mill+inspect only. `foundry.json` `"plant": "@0xray/blip"` (aliases `"plant": "blip"` / `"plant": "sound"`) fastens whatever that mill package declares — organs (looker, vibe, mixer) live in the mill, not this catalog. Nested mill `@0xray/foundry@0.1.12`. CLI shims `foundry blip|sound` still exist on foundry 0.1.11+. Agent map: [llms.txt](llms.txt).
6
8
 
7
9
  xray ships 45 knowledge skills (`src/skills/<name>/SKILL.md`) as the **costume / self-plant catalog**. Lead-dev operating model lives in **`orchestrator`** skill + `multi_agent_orchestration.lead_dev_mode` in features.json. **Repertoire is preferred** for long-term judgment (vendored 0.2.9, dest = named laws). Station is the compact ticket, not a skill and not a keyword store. Skills load on demand via the **xray-skills** MCP server (`npx -y 0xray mcp skills`) or when you plant them. This file is the exo catalog — mill does **not** write it to the consumer root.
package/dist/AGENTS.md CHANGED
@@ -4,6 +4,8 @@ Quick reference for the xray AI orchestration framework (**4.0**).
4
4
 
5
5
  **4.0** — a suit that survives the context window.
6
6
 
7
+ Confer votes. Burst runs the swarm.
8
+
7
9
  **Exo, not catalog.** Three-subsystem OS (Inference · External Governance · Autonomous Engine) · constitution always on · temperament by host · 4 floors · **Repertoire preferred** (vendored 0.2.9, dest = laws).
8
10
 
9
11
  **Temperament:** ceremony (analyze-complexity before spawn, confer) is **guided** by default so free-model OpenCode/Hermes stay in check. Frontier hosts (Grok 4.6 class) with `suit_temperament.profile: auto` **warn** on spawn-without-plan; Codex 11/29/69 still **deny**. Missing `suit_temperament` stays guided. See `docs-site/docs/architecture/v3-from-v2.md`.
package/dist/CHANGELOG.md CHANGED
@@ -42,6 +42,19 @@ The format is based on [Conventional Commits](https://www.conventionalcommits.or
42
42
  - Archive root `integrations/` costume SKILL dump → `docs/archive/integrations-costume/`. Live wear is `src/integrations`.
43
43
  - Archive root `commands/` stale copy → `docs/archive/commands-copy/`. Live wear is `src/opencode/commands`.
44
44
 
45
+ ## [4.0.42] - 2026-10-09
46
+
47
+ ### 🔄 Changes
48
+
49
+ Confer votes. Burst runs the swarm.
50
+
51
+ - Confer asks the MCP servers the wearing chat already spawned. Only a real PASS completes the consult. A PASS that belongs to another session is asked again.
52
+ - Wear pins Grok at the installed CLI. Hermes codex-check catches a console call. OpenClaw stays on the installed plugin. Cursor hooks stay on a git checkout.
53
+ - Burst runs the swarm live. The board keeps an honest LIVE pill and one seat state. The box posts one delta while `push.sh` holds the lock, retries once on 409, and keeps the ingest secret in the header.
54
+ - A SENT prompt holds that seat working for 10 minutes. A posted seat must match the installation token. Legacy prompt lines are read, and the prompts file defaults to `fleet/prompts.jsonl`.
55
+
56
+ ---
57
+
45
58
  ## [4.0.41] - 2026-10-07
46
59
 
47
60
  ### 🔄 Changes
package/dist/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  **4.0** — a suit that survives the context window
4
4
 
5
- ![0xRay v4 exo — CONSTITUTION ON](docs-site/static/img/exo-skeleton-v4.jpg)
5
+ ![0xRay 4.0.42 — Confer votes. Burst runs the swarm.](docs-site/static/img/exo-skeleton-v4.jpg)
6
+
7
+ Confer votes. Burst runs the swarm.
6
8
 
7
9
  Not a catalog of agents. The product is the **skeleton you wear**.
8
10
 
@@ -18,20 +20,22 @@ Not a catalog of agents. The product is the **skeleton you wear**.
18
20
 
19
21
  ```bash
20
22
  npm install 0xray
23
+ npx 0xray wear
21
24
  ```
22
25
 
23
- Consumer `npm install 0xray` auto-wires four chat bridges, Cursor project hooks, and seven MCP servers. **Repertoire is preferred** — vendored **0.2.9** ships on: factory + stack laws, in-process routing, extra host MCP `repertoire`. Not an eighth `xray-*` server. Dest is a judgment index. Explicit opt-out only: `"enabled": false, "provider": "repertoire"`. Do not pin 0.1.8.
26
+ `npm install 0xray` links vendored `@0xray/repertoire` and prints `npx 0xray wear`. It does not write `.mcp.json` or the chat bridges. Wear writes the consumer suit: managed `AGENTS.md`, `.xray` config, seven MCP servers, and the OpenCode, Grok, Hermes, and OpenClaw bridges (`install-bridges.cjs`). Inside a git checkout, wear also fastens Cursor project hooks. **Repertoire is preferred** — vendored **0.2.9** ships on: factory + stack laws, in-process routing, extra host MCP `repertoire`. Not an eighth `xray-*` server. Dest is a judgment index. Explicit opt-out only: `"enabled": false, "provider": "repertoire"`. Do not pin 0.1.8.
24
27
 
25
28
  ## Quick Start
26
29
 
27
30
  ```bash
28
- npm install 0xray # postinstall: mill+inspect plant + 4 bridges + 7 MCPs + AGENTS.md + .mcp.json
29
- npx 0xray status # verify install
30
- npx 0xray setup # optional: symlinks, hook extras
31
+ npm install 0xray
32
+ npx 0xray wear
33
+ npx 0xray status
34
+ npx 0xray setup --git-hooks # optional: git hooks only
31
35
  npx @0xray/foundry inspect --skip-live # mill receipt (chat is not a receipt)
32
36
  ```
33
37
 
34
- Manual per-platform install (idempotent, same result as postinstall):
38
+ Manual per-platform install (idempotent, same bridges wear writes):
35
39
 
36
40
  ```bash
37
41
  npx 0xray opencode install
@@ -51,12 +55,48 @@ Docs: [guides/autonomy-command](docs-site/docs/guides/autonomy-command.md) · Sk
51
55
 
52
56
  | Version | Highlights |
53
57
  |---------|------------|
54
- | **Unreleased** | Fasten is **foundry-plant/0**: builtin plant is mill+inspect only. `foundry.json` `"plant": "@0xray/blip"` (aliases `"plant": "blip"` / `"plant": "sound"`) fastens whatever that mill declares (looker / vibe / mixer live in the mill). Nested mill `@0xray/foundry@0.1.12`. CLI shims `foundry blip\|sound` remain (0.1.11+). Shop plant first-class (`shop-extract`, `shop-witness`, `shop-pin` + `foundry.json` `shopPlant`). |
58
+ | **4.0.42** | Confer votes. Burst runs the swarm. |
59
+ | **4.0.41** | Wake cascade stays on the station module. A fresh wear fastens mill and inspect. Goggles records the worn package path. The live page plays the mesh in the browser. |
60
+ | **4.0.40** | Live mesh runs the full loop: feed watch, render, direction, deploy, health, and the ledger both ways. |
61
+ | **4.0.39** | The seven stack laws stay worn. Repertoire in the suit is 0.2.9. |
62
+ | **4.0.38** | Codex term 70 requires the current source and the worn npm package. Dynamo's recommendation is honored. |
63
+ | **4.0.37** | A naked checkout wakes with repertoire on. |
64
+ | **4.0.36** | Goggles holds the stop through search, read, and a dist wipe. |
65
+ | **4.0.35** | Wear rewrites a checkout `dist/cli` launch to `node_modules/0xray`. |
66
+ | **4.0.34** | The lens stays on the worn build when the source is not packed. |
67
+ | **4.0.33** | Version bump. |
68
+ | **4.0.32** | `0xray look` opens one plane. Digest and triage return the card. Calling and confer stay off. |
69
+ | **4.0.31** | Goggles looks at one pipeline. Kind 0 stays quiet when the worn list matches the map. Calling and confer stay off. |
55
70
  | **4.0.30** | Fixes 4.0.29: `npx 0xray wear` and `setup` work outside a git checkout again. They write the 4.0.28 project setup, skip only Cursor hooks, and print one warning. Inside a git checkout they restore the 4.0.28 project setup, and `wear` adds Cursor hooks plus the unwear snapshot. Companion `@0xray/grok-bot` 0.1.8. Released 2026-09-28. |
56
71
  | **4.0.29** | `npm install` only creates the relative `node_modules/@0xray/repertoire` link to the vendored repertoire and prints `npx 0xray wear`. Run `npx 0xray wear` after install. Wear writes only the consumer project's `.cursor/hooks.json` (installed dist hooks, beside user entries); `npx 0xray unwear` restores the snapshot. Companion `@0xray/grok-bot` 0.1.8. Released 2026-09-28. |
57
72
  | **4.0.28** | MCP servers start through `scripts/node/mcp-launch.cjs` and only see PATH, HOME, XRAY_ROOT, plus names on their keep list. Tokens such as NPM_TOKEN are not inherited. User env values stay out of argv. Postinstall keeps user edits to AGENTS.md, .mcp.json, and opencode.json. `house init` does not copy EXAMPLE.md; doctor FAILs while `house/EXAMPLE.md` exists. Inspect adds a machinePlugin check. The Cursor hook defaults XRAY_ROOT to the suit. Companion `@0xray/grok-bot` 0.1.7. Released 2026-09-27. |
58
73
  | **4.0.27** | Host compact proof needs a generation id and a numeric usage percent, and the same preCompact receipt is mirrored to nested consumer wear roots. Memory scoring: [docs/memory-scoring.md](docs/memory-scoring.md) (orchestrator links it). Companion `@0xray/grok-bot` 0.1.6: general page vs `house/` overlay, `templates/house/`, `grok-bot house init`, doctor `GROK_BOT_HOUSE` or walk-up. Released 2026-09-26. |
74
+ | **4.0.26** | A lesson is stored when the task matches no signal. A Cursor compact cut is proved with a session log and a per-session receipt. |
75
+ | **4.0.25** | Plate schematics ship in the package. A worn suit resolves them from `dist/integrations/hooks/plates.cjs`. |
76
+ | **4.0.24** | Compaction and a host change are the same cut. The station card is the handoff. Repertoire in that suit is 0.2.8. |
77
+ | **4.0.23** | The Dynamo client starts when external governance is required. Proposals score locally when that governance is off. |
78
+ | **4.0.22** | The stamper strips present-tense patch pins from shipped prose. The cursor gate follows the suit mill. |
79
+ | **4.0.21** | Dest is named laws, not hangar slugs. Cleanup heat grows the project copy when Repertoire is on. |
80
+ | **4.0.20** | Heat grows the project copy. Session boot rewrites when HEAD moves. |
81
+ | **4.0.19** | Vendored Repertoire 0.2.5. Wear replaces older leftovers. |
82
+ | **4.0.18** | Wake heat joins bookmark, index, and mind. |
83
+ | **4.0.17** | Cursor heat writes session files when HEAD moves. |
84
+ | **4.0.16** | `npx 0xray validate` is a wear check. |
85
+ | **4.0.15** | Fasten is **foundry-plant/0**: builtin plant is mill+inspect only. `foundry.json` `"plant": "@0xray/blip"` (aliases `"plant": "blip"` / `"plant": "sound"`) fastens whatever that mill declares (looker / vibe / mixer live in the mill). Nested mill `@0xray/foundry@0.1.12`. CLI shims `foundry blip\|sound` remain (0.1.11+). Shop plant first-class (`shop-extract`, `shop-witness`, `shop-pin` + `foundry.json` `shopPlant`). |
86
+ | **4.0.14** | Factory-blip beds stamp the hook cell and keep six tellable bodies. |
87
+ | **4.0.13** | Station PreCompact merge keeps custom STATION.md keys. |
88
+ | **4.0.12** | Project-scoped Grok plugin dest so multi-seat wear does not clobber the machine plugin. |
89
+ | **4.0.11** | The npm pack includes `.grok-plugin/` so the Grok marketplace manifest ships. |
90
+ | **4.0.10** | Version bump. |
59
91
  | **4.0.9** | Mill target: postinstall does not mill npm global prefix or `_npx` as a consumer. Isolated HOME skips machine `~/.grok`. |
92
+ | **4.0.8** | Confer abstains locally instead of rubber-stamping a proposal. |
93
+ | **4.0.7** | Nested mill 0.1.9. Inventory writes `dna`. The mill does not mint on chain. |
94
+ | **4.0.6** | Nested mill 0.1.8. Isolated HOME skips machine Hermes and OpenClaw. |
95
+ | **4.0.5** | Inspect is a mill command. A costume dump fails mint. Mill plant stays mill + inspect. |
96
+ | **4.0.4** | Mill fastens an inspect suit. Costume is opt-in with `foundry.json` `"costume": true`. |
97
+ | **4.0.3** | Their plant is the suit. The mill plant is the factory discipline on the hanger. |
98
+ | **4.0.2** | The nested mill ships in the 0xray tarball. `@0xray/foundry` stays the standalone mill CLI. |
99
+ | **4.0.1** | CLI `--version` no longer dumps a Commander stack. The release gate smokes the organ and does not run another publish from a lifecycle script. |
60
100
  | **4.0.0** | Exo + temperament. Constitution always on; ceremony by host. Repertoire organ on (vendored 0.2). Station card survives compact/host-swap. **On npm.** [vision](docs-site/docs/architecture/v4-vision.md) · [now](docs-site/docs/architecture/v4-now.md) |
61
101
  | **3.4.1** | Unified `install-bridges.cjs` on postinstall — OpenCode, Grok, Hermes, OpenClaw in one pass. All 7 MCPs servers via `npx -y 0xray mcp <cmd>` (no `dist/` paths). Canonical `release.mjs` pipeline. |
62
102
  | **3.3.1** | Orchestrator confidence gate wired into execution planning. |
@@ -102,9 +142,9 @@ Docs: [guides/autonomy-command](docs-site/docs/guides/autonomy-command.md) · Sk
102
142
  - **External Governance** — Dynamo Solar SSOT; CodexPolicyService; weighted PHI/TAU deliberation.
103
143
  - **Autonomous Engine** — thinDispatch 7-flow routing; orchestrator confidence gate (v3.3.1).
104
144
 
105
- ## Consumer Install (postinstall)
145
+ ## Consumer Install (wear)
106
146
 
107
- On `npm install 0xray` in a consumer project, postinstall automatically:
147
+ `npm install 0xray` links the vendored repertoire and prints `npx 0xray wear`. Wear then:
108
148
 
109
149
  1. Copies **`AGENTS-consumer.md` → `AGENTS.md`**. Does **not** write consumer-root **`SKILLS.md`**.
110
150
  2. Fastens **mill plant** (`mill` + `inspect`). Fasten is **foundry-plant/0**: builtin plant is mill+inspect only. `foundry.json` `"plant": "@0xray/blip"` (aliases `"plant": "blip"` / `"plant": "sound"`) fastens whatever that mill package declares — organs (looker, vibe, mixer) live in the mill, not an xray catalog. Nested mill `@0xray/foundry@0.1.12`. CLI shims `foundry blip|sound` still exist on foundry 0.1.11+; fasten is the new cut. Not a 45-skill / 42-agent costume dump. `foundry.json` `"costume": true` is the opt-in dump.
@@ -113,7 +153,7 @@ On `npm install 0xray` in a consumer project, postinstall automatically:
113
153
  5. Writes project **`.mcp.json`** with 7 MCPs servers (`npx -y 0xray mcp …`)
114
154
  6. Installs **4 chat bridges**: OpenCode, Grok, Hermes, OpenClaw, plus **Cursor** `.cursor/hooks.json` (PPE + wiring; mill plant, not costume)
115
155
  7. Factory shop plant (`shop-extract`, `shop-witness`, `shop-pin` from groover-hangar) may coexist when worn. Extra shops: `foundry.json` `shopPlant`. Not costume.
116
- 8. Installs git pre-commit hook (non-blocking if not a git repo)
156
+ 8. Inside a git checkout, fastens Cursor `.cursor/hooks.json` and the hook scripts, and keeps an unwear snapshot. Outside a git checkout, skips those hooks and prints one warning. `npx 0xray setup --git-hooks` is what installs git hooks.
117
157
 
118
158
  See [llms.txt](llms.txt) for the agent map. Catalog of 45 skills lives in [SKILLS.md](SKILLS.md) — that is the exo catalog, not default consumer wear.
119
159
 
@@ -186,13 +226,13 @@ Docs: [memory routing](docs-site/docs/guides/memory-routing.md) · [Repertoire](
186
226
 
187
227
  ## Integrations
188
228
 
189
- | Platform | Install | Postinstall behavior |
229
+ | Platform | Install | What that command writes |
190
230
  |----------|---------|----------------------|
191
231
  | **OpenCode** | `npx 0xray opencode install` | Merges `opencode.json`, copies agent YML surfaces |
192
232
  | **Grok CLI / Build** | `npx 0xray grok install` | Project `.grok/plugins/0xray` (shared HOME does not clobber machine plugin), 7 MCPs servers |
193
233
  | **Hermes Agent** | `npx 0xray hermes install` | `~/.hermes/plugins/xray-hermes`, consumer root marker |
194
234
  | **OpenClaw** | `npx 0xray openclaw install` | `.xray/config/openclaw.json`, skill sync |
195
- | **Cursor** | postinstall (`installCursorBridge`) | Fastens `.cursor/hooks.json` + relative `.cursor/hooks/*.sh`. Rewrites leftover env-assignment one-liners. Not a fifth chat TUI. |
235
+ | **Cursor** | `npx 0xray wear` inside a git checkout | Fastens `.cursor/hooks.json` + relative `.cursor/hooks/*.sh`. Rewrites leftover env-assignment one-liners. Not a fifth chat TUI. |
196
236
 
197
237
  ## Governance & Codex
198
238
 
package/dist/SKILLS.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  **4.0** — a suit that survives the context window
4
4
 
5
+ Confer votes. Burst runs the swarm.
6
+
5
7
  **45 skills** in this exo catalog. Default consumer plant is **`mill` + `inspect`**, not this dump. `npm install 0xray` does **not** sync 45 skills unless `foundry.json` `"costume": true`. Factory shop plant (`shop-extract`, `shop-witness`, `shop-pin`) coexists with mill plant when a hangar wears those shops. Extra shops: `foundry.json` `shopPlant`. Fasten is **foundry-plant/0**: builtin plant is mill+inspect only. `foundry.json` `"plant": "@0xray/blip"` (aliases `"plant": "blip"` / `"plant": "sound"`) fastens whatever that mill package declares — organs (looker, vibe, mixer) live in the mill, not this catalog. Nested mill `@0xray/foundry@0.1.12`. CLI shims `foundry blip|sound` still exist on foundry 0.1.11+. Agent map: [llms.txt](llms.txt).
6
8
 
7
9
  xray ships 45 knowledge skills (`src/skills/<name>/SKILL.md`) as the **costume / self-plant catalog**. Lead-dev operating model lives in **`orchestrator`** skill + `multi_agent_orchestration.lead_dev_mode` in features.json. **Repertoire is preferred** for long-term judgment (vendored 0.2.9, dest = named laws). Station is the compact ticket, not a skill and not a keyword store. Skills load on demand via the **xray-skills** MCP server (`npx -y 0xray mcp skills`) or when you plant them. This file is the exo catalog — mill does **not** write it to the consumer root.
@@ -69,7 +69,7 @@ async function installForOpenClaw(options = {}) {
69
69
  /* session-boot is best-effort */
70
70
  }
71
71
  const packageRoot = path.resolve(__dirname, '..', '..', '..');
72
- const hookInstalled = isolated ? null : wiring.installOpenClawHostWear(packageRoot);
72
+ const hookInstalled = isolated ? null : wiring.installOpenClawHostWear(packageRoot, targetDir);
73
73
  const cliBackend = isolated ? false : wiring.maybeWriteOpenClawCliBackend();
74
74
  frameworkLogger.log('openclaw-integration', 'cli-backend', 'info', { written: cliBackend });
75
75
  if (hookInstalled) {
package/dist/cli/index.js CHANGED
@@ -116,6 +116,18 @@ program
116
116
  .action((args) => {
117
117
  runGoggles(args);
118
118
  });
119
+ program
120
+ .command("confer")
121
+ .argument("<state>", "on or off")
122
+ .description("Turn confer on or off in .xray/features.json. A missing key stays off until this runs.")
123
+ .action((state) => {
124
+ try {
125
+ runNodeScript("confer-switch.cjs", [state]);
126
+ }
127
+ catch {
128
+ process.exit(1);
129
+ }
130
+ });
119
131
  program
120
132
  .command("wear")
121
133
  .description("Wear the 0xray suit in this git checkout")
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Enforcement entry. The Hermes bridge loads ValidatorRegistry from this file.
3
+ */
4
+ export { ValidatorRegistry, globalValidatorRegistry, } from "./validators/index.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Enforcement entry. The Hermes bridge loads ValidatorRegistry from this file.
3
+ */
4
+ export { ValidatorRegistry, globalValidatorRegistry, } from "./validators/index.js";
@@ -322,13 +322,15 @@ export class ConsoleLogUsageValidator extends BaseValidator {
322
322
  severity = "error";
323
323
  async validate(context) {
324
324
  const { newCode } = context;
325
- // Skip validation if no code to check
326
325
  if (!newCode) {
327
326
  return this.createSuccessResult("No code to validate for console.log usage");
328
327
  }
329
- // Check for console.log usage
330
- if (newCode.includes("await frameworkLogger.log('rule-enforcer', '-return-passed-false-message-console-log-', 'info', { message: ")) {
331
- return this.createFailureResult("await frameworkLogger.log('rule-enforcer', '-', 'info', { message: } }); detected - use frameworkLogger for production logs or remove for debugging");
328
+ const codeWithoutComments = newCode
329
+ .replace(/\/\/.*$/gm, "")
330
+ .replace(/\/\*[\s\S]*?\*\//g, "");
331
+ const consoleCall = /console\.(?:log|debug|info|warn|error|trace)\s*\(/;
332
+ if (consoleCall.test(codeWithoutComments)) {
333
+ return this.createFailureResult("console method detected — use frameworkLogger", ["Use frameworkLogger instead of console methods"]);
332
334
  }
333
335
  return this.createSuccessResult("Console log usage follows proper guidelines");
334
336
  }
@@ -1,4 +1,9 @@
1
- export type GovernanceRole = "code-review" | "security-audit" | "researcher";
1
+ export type GovernanceRole = "code-review" | "security-audit" | "researcher" | "architect";
2
+ export type GovernanceMiss = "not-configured" | "error" | "timeout" | "empty" | "unparseable";
3
+ export interface GovernanceAttempt {
4
+ vote: GovernanceVote | null;
5
+ miss: GovernanceMiss | null;
6
+ }
2
7
  export interface GovernanceVote {
3
8
  decision: "approve" | "reject" | "abstain";
4
9
  confidence: number;
@@ -7,6 +12,7 @@ export interface GovernanceVote {
7
12
  export declare function resolveHermesBin(): string;
8
13
  export declare function isGovernanceLlmConfigured(): boolean;
9
14
  export declare function hermesCliAvailable(): boolean;
15
+ export declare function attemptLLMGovernance(role: GovernanceRole, proposalTitle: string, proposalDescription: string, evidence: string[], proposalType: string): Promise<GovernanceAttempt>;
10
16
  export declare function tryLLMGovernance(role: GovernanceRole, proposalTitle: string, proposalDescription: string, evidence: string[], proposalType: string): Promise<GovernanceVote | null>;
11
17
  export declare function checkHermesOAuthStatus(): {
12
18
  configured: boolean;
@@ -41,6 +41,19 @@ Respond with a structured vote in exactly this format:
41
41
  DECISION: approve|reject|abstain
42
42
  CONFIDENCE: <0.0-1.0>
43
43
  REASONING: <2-4 sentence analysis of the proposal's broader project impact>`,
44
+ architect: `You are a senior architect on a governance committee for a software project. Analyze the following proposal and architecture assessment.
45
+
46
+ Consider:
47
+ - Does the change fit the existing architecture?
48
+ - Does it raise coupling, complexity, or scaling risk?
49
+ - Should the work stop until a structural problem is fixed?
50
+
51
+ Respond with a structured vote in exactly this format:
52
+ DECISION: approve|reject|abstain
53
+ CONFIDENCE: <0.0-1.0>
54
+ REASONING: <2-4 sentence analysis>
55
+
56
+ reject means the architecture should not proceed.`,
44
57
  };
45
58
  function resolveHermesProvider() {
46
59
  return process.env.HERMES_PROVIDER?.trim() || DEFAULT_HERMES_PROVIDER;
@@ -151,18 +164,43 @@ function runHermesGovernanceInference(prompt, config) {
151
164
  maxBuffer: 10 * 1024 * 1024,
152
165
  }).trim();
153
166
  }
167
+ function sanitizeVoteReasoning(reasoning) {
168
+ return reasoning
169
+ .split("\n")
170
+ .map((line) => /^\s*(?:[-*•]\s*)?(?:Verdict:|DECISION:)/i.test(line) ? `> ${line.trim()}` : line)
171
+ .join("\n")
172
+ .trim();
173
+ }
154
174
  function parseVote(text) {
155
- const decisionMatch = text.match(/DECISION:\s*(approve|reject|abstain)/i);
156
- const confidenceMatch = text.match(/CONFIDENCE:\s*([0-9.]+)/i);
157
- const reasoningMatch = text.match(/REASONING:\s*(.+)/is);
158
- if (!decisionMatch || !decisionMatch[1])
175
+ // First exact token before REASONING. The prompt menu and anything the model
176
+ // writes inside the reasoning body are not a second vote.
177
+ const lines = text.split("\n");
178
+ const reasoningIdx = lines.findIndex((line) => /^REASONING:/i.test(line.trim()));
179
+ const headerLines = reasoningIdx < 0 ? lines : lines.slice(0, reasoningIdx);
180
+ let decisionWord;
181
+ for (const line of headerLines) {
182
+ const match = line.trim().match(/^DECISION:\s*(approve|reject|abstain)\s*$/i);
183
+ if (match?.[1]) {
184
+ decisionWord = match[1];
185
+ break;
186
+ }
187
+ }
188
+ if (!decisionWord)
159
189
  return null;
190
+ const header = headerLines.join("\n");
191
+ const confidenceMatch = header.match(/CONFIDENCE:\s*([0-9.]+)/i);
160
192
  const rawConfidence = confidenceMatch?.[1];
161
193
  const confidence = rawConfidence ? parseFloat(rawConfidence) : 0.5;
194
+ const reasoningBody = reasoningIdx < 0
195
+ ? ""
196
+ : lines
197
+ .slice(reasoningIdx)
198
+ .join("\n")
199
+ .replace(/^REASONING:\s*/i, "");
162
200
  return {
163
- decision: decisionMatch[1].toLowerCase(),
164
- confidence: isNaN(confidence) ? 0.5 : Math.min(1, Math.max(0, confidence)),
165
- reasoning: reasoningMatch?.[1]?.trim() || "No reasoning provided",
201
+ decision: decisionWord.toLowerCase(),
202
+ confidence: Number.isNaN(confidence) ? 0.5 : Math.min(1, Math.max(0, confidence)),
203
+ reasoning: sanitizeVoteReasoning(reasoningBody) || "No reasoning provided",
166
204
  };
167
205
  }
168
206
  async function callDirectLlm(role, config, proposalTitle, proposalDescription, evidence, proposalType) {
@@ -209,11 +247,28 @@ Please provide your structured vote.`;
209
247
  const message = choices?.[0]?.message;
210
248
  return message?.content ?? null;
211
249
  }
212
- export async function tryLLMGovernance(role, proposalTitle, proposalDescription, evidence, proposalType) {
250
+ function missFromThrown(error) {
251
+ const message = error instanceof Error ? error.message : String(error);
252
+ const code = typeof error === "object" && error !== null && "code" in error
253
+ ? String(error.code ?? "")
254
+ : "";
255
+ const killed = typeof error === "object" &&
256
+ error !== null &&
257
+ "killed" in error &&
258
+ error.killed === true;
259
+ if (code === "ETIMEDOUT" || killed || /ETIMEDOUT|timed out/i.test(message)) {
260
+ return "timeout";
261
+ }
262
+ if (/invalid_grant|not configured|unauthorized|no credentials|authentication/i.test(message)) {
263
+ return "not-configured";
264
+ }
265
+ return "error";
266
+ }
267
+ export async function attemptLLMGovernance(role, proposalTitle, proposalDescription, evidence, proposalType) {
213
268
  const config = getConfig();
214
269
  if (!config) {
215
270
  process.stderr.write(`[llm] no config for role=${role}\n`);
216
- return null;
271
+ return { vote: null, miss: "not-configured" };
217
272
  }
218
273
  if (config.mode === "hermes") {
219
274
  process.stderr.write(`[llm] using hermes -z provider=${config.provider} model=${config.model}\n`);
@@ -230,12 +285,12 @@ export async function tryLLMGovernance(role, proposalTitle, proposalDescription,
230
285
  const content = config.mode === "hermes"
231
286
  ? runHermesGovernanceInference(buildGovernancePrompt(role, proposalTitle, proposalDescription, evidence, proposalType), config)
232
287
  : await callDirectLlm(role, config, proposalTitle, proposalDescription, evidence, proposalType);
233
- if (!content) {
288
+ if (!content?.trim()) {
234
289
  frameworkLogger.log("llm-governance", "parse", "warning", {
235
290
  issue: "missing content in response",
236
291
  role,
237
292
  });
238
- return null;
293
+ return { vote: null, miss: "empty" };
239
294
  }
240
295
  const vote = parseVote(content);
241
296
  if (!vote) {
@@ -244,23 +299,26 @@ export async function tryLLMGovernance(role, proposalTitle, proposalDescription,
244
299
  snippet: content.slice(0, 200),
245
300
  role,
246
301
  });
247
- return null;
302
+ return { vote: null, miss: "unparseable" };
248
303
  }
249
304
  frameworkLogger.log("llm-governance", "vote", "success", {
250
305
  role,
251
306
  decision: vote.decision,
252
307
  confidence: vote.confidence,
253
308
  });
254
- return vote;
309
+ return { vote, miss: null };
255
310
  }
256
311
  catch (error) {
257
312
  frameworkLogger.log("llm-governance", "error", "error", {
258
313
  error: String(error),
259
314
  role,
260
315
  });
261
- return null;
316
+ return { vote: null, miss: missFromThrown(error) };
262
317
  }
263
318
  }
319
+ export async function tryLLMGovernance(role, proposalTitle, proposalDescription, evidence, proposalType) {
320
+ return (await attemptLLMGovernance(role, proposalTitle, proposalDescription, evidence, proposalType)).vote;
321
+ }
264
322
  export function checkHermesOAuthStatus() {
265
323
  const direct = getDirectLlmConfig();
266
324
  if (direct) {