@a-company/paradigm 3.46.0 → 5.4.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.
Files changed (169) hide show
  1. package/dist/{accept-orchestration-ZUWQUHSK.js → accept-orchestration-GX2YRWM4.js} +5 -5
  2. package/dist/{add-VSPZ6FM4.js → add-FZRKEGH4.js} +1 -1
  3. package/dist/agent-WERIO2XV.js +523 -0
  4. package/dist/agent-loader-SJPJJS33.js +36 -0
  5. package/dist/{agents-suggest-65SER5IS.js → agents-suggest-DNSYJ6IA.js} +1 -1
  6. package/dist/{aggregate-SV3VGEIL.js → aggregate-H57K7PNV.js} +1 -1
  7. package/dist/{assess-UHBDYIK7.js → assess-4WVXZLZQ.js} +2 -2
  8. package/dist/{auto-24ICVUH4.js → auto-QFS5NHQU.js} +1 -1
  9. package/dist/{beacon-3SJV4DAP.js → beacon-KXZXYQHX.js} +1 -1
  10. package/dist/{calibration-WWHK73WU.js → calibration-V46G7JTY.js} +2 -2
  11. package/dist/{check-OLI6AUS6.js → check-OWAIWV23.js} +1 -1
  12. package/dist/{chunk-RP6TZYGE.js → chunk-2IO7JAG2.js} +1 -1
  13. package/dist/chunk-2T6BTYBN.js +712 -0
  14. package/dist/{chunk-CDMAMDSG.js → chunk-5VKJBNJL.js} +13 -5
  15. package/dist/{chunk-KB4XJWE3.js → chunk-6N3JTACN.js} +98 -437
  16. package/dist/{chunk-ZMQA6SCO.js → chunk-7HRBT23N.js} +631 -231
  17. package/dist/chunk-7N7GSU6K.js +34 -0
  18. package/dist/chunk-A2L4TSLZ.js +526 -0
  19. package/dist/{chunk-P7XSBJE3.js → chunk-ABVQGRF7.js} +1 -1
  20. package/dist/{chunk-HIKKOCXY.js → chunk-EI32ZBE6.js} +1 -1
  21. package/dist/{chunk-QIOCFXDQ.js → chunk-EKGMAM62.js} +1 -1
  22. package/dist/chunk-EZ3GOCYC.js +132 -0
  23. package/dist/{chunk-DS5QY37M.js → chunk-GTR2TBIJ.js} +247 -15
  24. package/dist/chunk-ICSLIPUS.js +1128 -0
  25. package/dist/{chunk-QDXI2DHR.js → chunk-J2JEQRT3.js} +1 -1
  26. package/dist/{chunk-AKIMFN6I.js → chunk-JASGXLK3.js} +2 -2
  27. package/dist/{chunk-J4E6K5MG.js → chunk-LSRABQIY.js} +25 -1
  28. package/dist/chunk-MCMOGQMU.js +145 -0
  29. package/dist/{chunk-ZXMDA7VB.js → chunk-PDX44BCA.js} +1 -6
  30. package/dist/{chunk-2SKXFXIT.js → chunk-S3ORKP3V.js} +10 -15
  31. package/dist/chunk-TAIJOFOE.js +124 -0
  32. package/dist/{chunk-FS3WTUHY.js → chunk-TXESEO7Y.js} +6 -6
  33. package/dist/{chunk-7COU5S2Z.js → chunk-VL67H5IC.js} +1 -1
  34. package/dist/{chunk-QWA26UNO.js → chunk-WQITYKHM.js} +7 -7
  35. package/dist/{chunk-MW5DMGBB.js → chunk-YMDLDELF.js} +114 -55
  36. package/dist/{claude-63ISJAZK.js → claude-FRRWJSTJ.js} +1 -1
  37. package/dist/{claude-cli-ABML5RHX.js → claude-cli-XJLK2X4L.js} +1 -1
  38. package/dist/{claude-code-JRLMRPTO.js → claude-code-HTBA4XRB.js} +1 -1
  39. package/dist/{claude-code-teams-CAJBEFIZ.js → claude-code-teams-T4SP24MD.js} +1 -1
  40. package/dist/{conductor-HLWYWUVH.js → conductor-PGPDVIVE.js} +1 -1
  41. package/dist/{config-schema-3YNIFJCJ.js → config-schema-EA4XALGG.js} +4 -2
  42. package/dist/{constellation-FAGT45TU.js → constellation-A26CCGQS.js} +1 -1
  43. package/dist/{context-audit-557EO6PK.js → context-audit-RLO3ETRP.js} +8 -5
  44. package/dist/{cost-XEBADYFT.js → cost-BGM32XJU.js} +1 -1
  45. package/dist/{cost-UD3WPEKZ.js → cost-VI46A4XL.js} +1 -1
  46. package/dist/{cursor-cli-QUOOF2N4.js → cursor-cli-JVEZGHWQ.js} +1 -1
  47. package/dist/{cursorrules-3TKZ4E4R.js → cursorrules-HLIKJJZT.js} +1 -1
  48. package/dist/decision-loader-WWCLIQPJ.js +20 -0
  49. package/dist/{delete-RRK4RL6Y.js → delete-KBRPQLPC.js} +2 -2
  50. package/dist/{diff-IP5CIARP.js → diff-RQLLNAFI.js} +5 -5
  51. package/dist/{discipline-5F5OVTXB.js → discipline-FA4OZXIS.js} +1 -1
  52. package/dist/{dist-UXWV4OKX.js → dist-34NA5RS5.js} +1 -1
  53. package/dist/{dist-5QE2BB2B-X6DYVSUL.js → dist-5QE2BB2B-5S3T6Y3T.js} +1 -1
  54. package/dist/{dist-CM3MVWWW.js → dist-77JDTVAY.js} +1 -0
  55. package/dist/{dist-POMVY6WP.js → dist-QK4SQAK7.js} +1 -1
  56. package/dist/{dist-3RVKEJRT.js → dist-TA6LSC2Q.js} +1 -1
  57. package/dist/docs-J2BTKRVU.js +155 -0
  58. package/dist/docs-PBZB7LYP.js +89 -0
  59. package/dist/{doctor-GKZJU7QG.js → doctor-ULBOHEIC.js} +3 -3
  60. package/dist/{drift-YGT4LJ7Q.js → drift-R5NRKFHI.js} +1 -1
  61. package/dist/{echo-A6HD5UP7.js → echo-O2LY7CC2.js} +1 -1
  62. package/dist/{edit-4CLNN5JG.js → edit-R2HNLMOG.js} +2 -2
  63. package/dist/event-25OJKDCE.js +31 -0
  64. package/dist/{export-T7CMMJIB.js → export-IWVL7XLF.js} +1 -1
  65. package/dist/{flow-UFMPVOEM.js → flow-CRRVV3O3.js} +2 -2
  66. package/dist/{global-HHUJSBG5.js → global-3NG5JXUB.js} +1 -1
  67. package/dist/graduate-USAWGBJM.js +160 -0
  68. package/dist/{graph-YYUXI3F7.js → graph-VHUMAAS6.js} +2 -2
  69. package/dist/{graph-server-ZPXRSGCW.js → graph-server-YL22VBBN.js} +1 -1
  70. package/dist/{habits-RG5SVKXP.js → habits-OL5NGPXO.js} +3 -3
  71. package/dist/{history-CETCSUCP.js → history-WOWC573W.js} +1 -1
  72. package/dist/{hooks-TCUHQMPF.js → hooks-HFWSCGPV.js} +2 -2
  73. package/dist/index.js +302 -188
  74. package/dist/{integrity-MK2OP5TA.js → integrity-IHO4FZTS.js} +1 -1
  75. package/dist/{integrity-checker-J7YXRTBT.js → integrity-checker-PSKJA5SB.js} +1 -0
  76. package/dist/journal-loader-5EYSBFFY.js +18 -0
  77. package/dist/{lint-HYWGS3JJ.js → lint-K6CJGGPH.js} +1 -1
  78. package/dist/{list-IUCYPGMK.js → list-4YK7QKFF.js} +1 -1
  79. package/dist/{list-BTLFHSRC.js → list-ENR7Q4CR.js} +2 -2
  80. package/dist/{lore-loader-VTEEZDX3.js → lore-loader-7NO6N6FT.js} +4 -1
  81. package/dist/{lore-server-NOOAHKJX.js → lore-server-UNJY5KC3.js} +1 -1
  82. package/dist/{manual-AFJ2J2V3.js → manual-G6FISID5.js} +1 -1
  83. package/dist/mcp.js +3917 -356
  84. package/dist/{migrate-FQVGQNXZ.js → migrate-LS45DNEV.js} +2 -2
  85. package/dist/{migrate-assessments-JP6Q5KME.js → migrate-assessments-RGH4O6IX.js} +2 -2
  86. package/dist/nomination-engine-HDWMN4IO.js +42 -0
  87. package/dist/notebook-YWIYGEHV.js +155 -0
  88. package/dist/{orchestrate-A226N6FC.js → orchestrate-XZA33TJC.js} +5 -5
  89. package/dist/{peers-RFQCWVLV.js → peers-DEOUIZM6.js} +1 -1
  90. package/dist/persona-UHAHIVST.js +390 -0
  91. package/dist/{pipeline-3G2FRAKM.js → pipeline-L4HCSBGN.js} +1 -1
  92. package/dist/{platform-server-H7Y6Q7O4.js → platform-server-2D6S6YTK.js} +412 -18
  93. package/dist/{plugin-update-checker-HMRPGY5Z.js → plugin-update-checker-ELOEEQYS.js} +1 -0
  94. package/dist/{portal-check-FF5EKZE5.js → portal-check-NPYGII2D.js} +2 -2
  95. package/dist/{portal-compliance-VU4NIFEN.js → portal-compliance-J7DGAPFX.js} +2 -2
  96. package/dist/{probe-7JK7IDNI.js → probe-MHL5HQZ2.js} +3 -3
  97. package/dist/{promote-XO63XMAN.js → promote-F6ZYZZAL.js} +2 -2
  98. package/dist/{providers-YNFSL6HK.js → providers-GK7PB2OL.js} +2 -2
  99. package/dist/{quiz-I75NU2QQ.js → quiz-M66SC7F7.js} +1 -1
  100. package/dist/{record-46CLR4OG.js → record-RA4WR2BO.js} +2 -2
  101. package/dist/{reindex-WIJMCJ4A.js → reindex-65H4WULU.js} +3 -2
  102. package/dist/{remember-4EUZKIIB.js → remember-HBWJ655S.js} +1 -1
  103. package/dist/{retag-KC4JVRLE.js → retag-3OLCVDEQ.js} +2 -2
  104. package/dist/{review-Q7M4CRB5.js → review-27ATYTD2.js} +2 -2
  105. package/dist/review-57QMURZV.js +334 -0
  106. package/dist/{ripple-RI3LOT6R.js → ripple-JPBXP5I3.js} +1 -1
  107. package/dist/{sentinel-UOIGJWHH.js → sentinel-4XIG4STA.js} +2 -2
  108. package/dist/{sentinel-bridge-APDXYAZS.js → sentinel-bridge-MDUXTQRL.js} +2 -2
  109. package/dist/{serve-KKEHE44G.js → serve-EFVRS4GA.js} +2 -2
  110. package/dist/{serve-22A4XOIG.js → serve-INL7SNBK.js} +2 -2
  111. package/dist/{serve-2YJ6D2Y6.js → serve-KBSE36PL.js} +4 -4
  112. package/dist/{server-JV6UFGWZ.js → server-54SKYFFY.js} +2 -2
  113. package/dist/{server-RDLQ3DK7.js → server-XUOIO7E6.js} +1 -1
  114. package/dist/{setup-YNZJQLW7.js → setup-EDS27WUR.js} +1 -1
  115. package/dist/{setup-M2ZKLKNN.js → setup-KO5AFC4K.js} +2 -2
  116. package/dist/{shift-LNMKFYLR.js → shift-VFG23DLA.js} +16 -16
  117. package/dist/{show-P7GYO43X.js → show-5PV5KFJE.js} +2 -2
  118. package/dist/{show-PKZMYKRN.js → show-NQKYX6WQ.js} +1 -1
  119. package/dist/{snapshot-Y3COXK4T.js → snapshot-BK4RBPCG.js} +1 -1
  120. package/dist/{spawn-SSXZX45U.js → spawn-AW6GDECS.js} +3 -3
  121. package/dist/{status-KLHALGW4.js → status-WGIAQODY.js} +1 -1
  122. package/dist/{summary-5NQNOD3F.js → summary-NIRABMF5.js} +2 -2
  123. package/dist/{sweep-EZU3GU6S.js → sweep-QMHNSIY5.js} +2 -2
  124. package/dist/{switch-WYUMVNA5.js → switch-6EJPZDIA.js} +1 -1
  125. package/dist/{symphony-6K3HD7AW.js → symphony-4OCY36AI.js} +5 -5
  126. package/dist/{symphony-YCHBYN3E.js → symphony-B75X2MME.js} +2 -2
  127. package/dist/{symphony-peers-HSY3RI3S.js → symphony-peers-2ZQYLRNI.js} +1 -1
  128. package/dist/{symphony-peers-APOGJPF4.js → symphony-peers-OL7F6M5S.js} +1 -0
  129. package/dist/{symphony-relay-GTAJRCVF.js → symphony-relay-UJYUXN65.js} +28 -1
  130. package/dist/{sync-ZM4Q3R4U.js → sync-VEHUH4OA.js} +3 -3
  131. package/dist/{sync-llms-JIPP3XX4.js → sync-llms-YHCFIE6X.js} +2 -2
  132. package/dist/{task-loader-7M2FCBX6.js → task-loader-LDYWQSLM.js} +1 -0
  133. package/dist/{team-HGLJXWQG.js → team-7HG7XK5C.js} +6 -6
  134. package/dist/{test-WTR5Q33E.js → test-566CP5KC.js} +1 -1
  135. package/dist/{thread-3WM7KKID.js → thread-N754I4D5.js} +1 -1
  136. package/dist/{timeline-ANC7LVDL.js → timeline-M3CICQFE.js} +2 -2
  137. package/dist/{triage-IZ4MDYNB.js → triage-HHYGT3HY.js} +1 -1
  138. package/dist/{tutorial-GC6QL4US.js → tutorial-KD22SUNO.js} +1 -1
  139. package/dist/university-content/courses/.purpose +66 -0
  140. package/dist/university-content/courses/para-401.json +146 -0
  141. package/dist/university-content/courses/para-501.json +67 -0
  142. package/dist/university-content/courses/para-601.json +690 -0
  143. package/dist/university-content/plsat/.purpose +6 -0
  144. package/dist/university-content/plsat/v2.0.json +2 -2
  145. package/dist/university-content/plsat/v3.0.json +563 -3
  146. package/dist/university-content/reference.json +91 -0
  147. package/dist/university-ui/assets/{index-tfi5xN4Q.js → index-C6bH_6xu.js} +2 -2
  148. package/dist/university-ui/assets/{index-tfi5xN4Q.js.map → index-C6bH_6xu.js.map} +1 -1
  149. package/dist/university-ui/index.html +1 -1
  150. package/dist/{upgrade-ANX3LVSA.js → upgrade-H5PF32BW.js} +2 -2
  151. package/dist/{validate-GD5XWILV.js → validate-CNKEKO6A.js} +1 -1
  152. package/dist/{validate-ITC5D6QG.js → validate-MB5ULIHS.js} +1 -1
  153. package/dist/{validate-ZVPNN4FL.js → validate-QH3LADM6.js} +1 -1
  154. package/dist/{watch-X64UK7K4.js → watch-2TKP5PVL.js} +3 -3
  155. package/dist/{watch-ERBEJUJW.js → watch-ZF4ML6CD.js} +2 -2
  156. package/dist/{wisdom-L2WC7J62.js → wisdom-AATMGNFA.js} +1 -1
  157. package/dist/work-log-loader-5L45XNYZ.js +14 -0
  158. package/dist/{workspace-UIUTHZTD.js → workspace-6E6OSRNU.js} +4 -4
  159. package/package.json +1 -1
  160. package/platform-ui/dist/assets/DocsSection-ByAgPzWV.js +1 -0
  161. package/platform-ui/dist/assets/DocsSection-CjdO6R-u.css +1 -0
  162. package/platform-ui/dist/assets/{GitSection-BD3Ze06e.js → GitSection-BLovj9yT.js} +1 -1
  163. package/platform-ui/dist/assets/{GraphSection-SglITfSs.js → GraphSection-C5PCPUFl.js} +1 -1
  164. package/platform-ui/dist/assets/{LoreSection-bR5Km4Fd.js → LoreSection-BftejTla.js} +1 -1
  165. package/platform-ui/dist/assets/{SentinelSection-QSpAZArG.js → SentinelSection-CnYcasN7.js} +1 -1
  166. package/platform-ui/dist/assets/{SymphonySection-CobYJgvg.js → SymphonySection-BpmqCHeK.js} +1 -1
  167. package/platform-ui/dist/assets/{index-DbxeSMkV.js → index-G9JnWEs_.js} +10 -10
  168. package/platform-ui/dist/index.html +1 -1
  169. package/dist/dist-PSF5CP4I.js +0 -7294
@@ -4,7 +4,7 @@
4
4
  import * as fs from "fs";
5
5
  import * as path from "path";
6
6
  import * as yaml from "js-yaml";
7
- import { execSync } from "child_process";
7
+ import { execFileSync } from "child_process";
8
8
  var SKIP_DIRECTORIES = [
9
9
  "node_modules",
10
10
  ".git",
@@ -13,7 +13,9 @@ var SKIP_DIRECTORIES = [
13
13
  "coverage",
14
14
  ".paradigm",
15
15
  "vendor",
16
- "__pycache__"
16
+ "__pycache__",
17
+ ".next",
18
+ "target"
17
19
  ];
18
20
  function loadPortalConfig(rootDir) {
19
21
  const portalPath = path.join(rootDir, "portal.yaml");
@@ -46,32 +48,62 @@ function extractDeclaredGates(config) {
46
48
  }
47
49
  return Array.from(gates);
48
50
  }
51
+ function extractRouteAttachedGates(config) {
52
+ const gates = /* @__PURE__ */ new Set();
53
+ if (config.routes) {
54
+ for (const routeConfig of Object.values(config.routes)) {
55
+ const gateList = Array.isArray(routeConfig) ? routeConfig : routeConfig.gates || [];
56
+ for (const gate of gateList) {
57
+ const gateName = gate.startsWith("^") ? gate.slice(1) : gate;
58
+ gates.add(gateName);
59
+ }
60
+ }
61
+ }
62
+ return gates;
63
+ }
64
+ function runGrep(rootDir, pattern) {
65
+ const options = {
66
+ encoding: "utf-8",
67
+ maxBuffer: 10 * 1024 * 1024,
68
+ stdio: ["ignore", "pipe", "pipe"]
69
+ };
70
+ try {
71
+ const globArgs = SKIP_DIRECTORIES.flatMap((d) => ["--glob", `!${d}/**`]);
72
+ const rgArgs = ["-n", "--no-ignore-vcs", ...globArgs, "--engine", "auto", pattern, rootDir];
73
+ return execFileSync("rg", rgArgs, options);
74
+ } catch {
75
+ }
76
+ const skipDirArgs = SKIP_DIRECTORIES.map((d) => `--exclude-dir=${d}`);
77
+ const grepArgs = ["-rn", ...skipDirArgs, "-E", pattern, "--", rootDir];
78
+ try {
79
+ return execFileSync("grep", grepArgs, options);
80
+ } catch (err) {
81
+ const code = err?.code;
82
+ if (code === 1 || err?.status === 1) {
83
+ return "";
84
+ }
85
+ return "";
86
+ }
87
+ }
49
88
  function findGateReferences(rootDir) {
50
89
  const references = [];
51
- const skipDirsArg = SKIP_DIRECTORIES.map((d) => `--exclude-dir=${d}`).join(" ");
52
- try {
53
- const symbolPattern = "\\^[a-zA-Z][a-zA-Z0-9_-]+";
54
- const symbolResult = execSync(
55
- `grep -rn ${skipDirsArg} -E "${symbolPattern}" "${rootDir}" 2>/dev/null || true`,
56
- { encoding: "utf-8", maxBuffer: 10 * 1024 * 1024 }
57
- );
58
- for (const line of symbolResult.split("\n").filter(Boolean)) {
59
- const match = line.match(/^(.+?):(\d+):(.*)$/);
60
- if (match) {
61
- const [, file, lineNum, context] = match;
62
- const gateMatch = context.match(/\^([a-zA-Z][a-zA-Z0-9_-]+)/);
63
- if (gateMatch) {
64
- references.push({
65
- gate: gateMatch[1],
66
- file: path.relative(rootDir, file),
67
- line: parseInt(lineNum, 10),
68
- context: context.trim().slice(0, 100),
69
- matchType: "symbol"
70
- });
71
- }
90
+ const symbolPattern = "\\^[a-zA-Z][a-zA-Z0-9_-]+";
91
+ const symbolResult = runGrep(rootDir, symbolPattern);
92
+ for (const line of symbolResult.split("\n").filter(Boolean)) {
93
+ const match = line.match(/^(.+?):(\d+):(.*)$/);
94
+ if (match) {
95
+ const [, file, lineNum, context] = match;
96
+ const gateMatch = context.match(/\^([a-zA-Z][a-zA-Z0-9_-]+)/);
97
+ if (gateMatch) {
98
+ references.push({
99
+ gate: gateMatch[1],
100
+ file: path.relative(rootDir, file),
101
+ line: parseInt(lineNum, 10),
102
+ context: context.trim().slice(0, 100),
103
+ matchType: "symbol"
104
+ });
72
105
  }
73
106
  }
74
- } catch {
75
107
  }
76
108
  const functionPatterns = [
77
109
  { pattern: `checkGate\\s*\\(['"]([^'"]+)['"]`, type: "function" },
@@ -80,29 +112,23 @@ function findGateReferences(rootDir) {
80
112
  { pattern: `@Gate\\s*\\(['"]?([^'"\\)]+)['"]?\\)`, type: "function" }
81
113
  ];
82
114
  for (const { pattern, type } of functionPatterns) {
83
- try {
84
- const result = execSync(
85
- `grep -rn ${skipDirsArg} -E "${pattern}" "${rootDir}" 2>/dev/null || true`,
86
- { encoding: "utf-8", maxBuffer: 10 * 1024 * 1024 }
87
- );
88
- for (const line of result.split("\n").filter(Boolean)) {
89
- const match = line.match(/^(.+?):(\d+):(.*)$/);
90
- if (match) {
91
- const [, file, lineNum, context] = match;
92
- const gateMatch = context.match(new RegExp(pattern));
93
- if (gateMatch && gateMatch[1]) {
94
- const gateName = gateMatch[1].startsWith("^") ? gateMatch[1].slice(1) : gateMatch[1];
95
- references.push({
96
- gate: gateName,
97
- file: path.relative(rootDir, file),
98
- line: parseInt(lineNum, 10),
99
- context: context.trim().slice(0, 100),
100
- matchType: type
101
- });
102
- }
115
+ const result = runGrep(rootDir, pattern);
116
+ for (const line of result.split("\n").filter(Boolean)) {
117
+ const match = line.match(/^(.+?):(\d+):(.*)$/);
118
+ if (match) {
119
+ const [, file, lineNum, context] = match;
120
+ const gateMatch = context.match(new RegExp(pattern));
121
+ if (gateMatch && gateMatch[1]) {
122
+ const gateName = gateMatch[1].startsWith("^") ? gateMatch[1].slice(1) : gateMatch[1];
123
+ references.push({
124
+ gate: gateName,
125
+ file: path.relative(rootDir, file),
126
+ line: parseInt(lineNum, 10),
127
+ context: context.trim().slice(0, 100),
128
+ matchType: type
129
+ });
103
130
  }
104
131
  }
105
- } catch {
106
132
  }
107
133
  }
108
134
  return references;
@@ -119,6 +145,8 @@ async function checkPortalCompliance(rootDir) {
119
145
  return {
120
146
  status: "compliant",
121
147
  declaredButUnused: [],
148
+ routeAttachedUnused: [],
149
+ orphanUnused: [],
122
150
  usedButUndeclared: [],
123
151
  properlyDeclared: [],
124
152
  suggestions: ["No portal.yaml found, and no gate references detected in code."],
@@ -128,6 +156,8 @@ async function checkPortalCompliance(rootDir) {
128
156
  return {
129
157
  status: "violations",
130
158
  declaredButUnused: [],
159
+ routeAttachedUnused: [],
160
+ orphanUnused: [],
131
161
  usedButUndeclared: usedGates2,
132
162
  properlyDeclared: [],
133
163
  suggestions: [
@@ -141,18 +171,28 @@ async function checkPortalCompliance(rootDir) {
141
171
  };
142
172
  }
143
173
  const declaredGates = extractDeclaredGates(config);
174
+ const routeAttachedGates = extractRouteAttachedGates(config);
144
175
  const references = findGateReferences(rootDir);
145
176
  const usedGates = extractUniqueGates(references);
146
177
  const declaredSet = new Set(declaredGates);
147
178
  const usedSet = new Set(usedGates);
148
179
  const declaredButUnused = declaredGates.filter((g) => !usedSet.has(g));
180
+ const routeAttachedUnused = declaredButUnused.filter((g) => routeAttachedGates.has(g));
181
+ const orphanUnused = declaredButUnused.filter((g) => !routeAttachedGates.has(g));
149
182
  const usedButUndeclared = usedGates.filter((g) => !declaredSet.has(g));
150
183
  const properlyDeclared = declaredGates.filter((g) => usedSet.has(g));
151
184
  const suggestions = [];
152
- if (declaredButUnused.length > 0) {
153
- suggestions.push("Gates declared but never referenced:");
154
- for (const gate of declaredButUnused) {
155
- suggestions.push(` - ^${gate} (consider removing from portal.yaml or implementing)`);
185
+ if (routeAttachedUnused.length > 0) {
186
+ suggestions.push("Gates documented on routes but no checkGate/requireGate in code:");
187
+ for (const gate of routeAttachedUnused) {
188
+ suggestions.push(` - ^${gate} (documented on routes; if enforced by middleware, this may be intentional)`);
189
+ }
190
+ suggestions.push("");
191
+ }
192
+ if (orphanUnused.length > 0) {
193
+ suggestions.push("Orphan gates (declared but never on a route or in code):");
194
+ for (const gate of orphanUnused) {
195
+ suggestions.push(` - ^${gate} (add to a route or remove from portal.yaml)`);
156
196
  }
157
197
  suggestions.push("");
158
198
  }
@@ -172,6 +212,8 @@ async function checkPortalCompliance(rootDir) {
172
212
  return {
173
213
  status,
174
214
  declaredButUnused,
215
+ routeAttachedUnused,
216
+ orphanUnused,
175
217
  usedButUndeclared,
176
218
  properlyDeclared,
177
219
  suggestions,
@@ -184,8 +226,11 @@ function formatComplianceReport(report) {
184
226
  lines.push(`Portal Compliance: ${statusIcon} ${report.status.toUpperCase()}`);
185
227
  lines.push("");
186
228
  lines.push(`Properly Declared: ${report.properlyDeclared.length}`);
187
- if (report.declaredButUnused.length > 0) {
188
- lines.push(`Declared but Unused: ${report.declaredButUnused.length}`);
229
+ if (report.routeAttachedUnused.length > 0) {
230
+ lines.push(`Route-Attached, No Code: ${report.routeAttachedUnused.length}`);
231
+ }
232
+ if (report.orphanUnused.length > 0) {
233
+ lines.push(`Orphan Gates: ${report.orphanUnused.length}`);
189
234
  }
190
235
  if (report.usedButUndeclared.length > 0) {
191
236
  lines.push(`Used but Undeclared: ${report.usedButUndeclared.length}`);
@@ -198,9 +243,16 @@ function formatComplianceReport(report) {
198
243
  }
199
244
  lines.push("");
200
245
  }
201
- if (report.declaredButUnused.length > 0) {
202
- lines.push("Unused Gates (declared but never referenced):");
203
- for (const gate of report.declaredButUnused) {
246
+ if (report.routeAttachedUnused.length > 0) {
247
+ lines.push("Route-Attached (no checkGate/requireGate in code):");
248
+ for (const gate of report.routeAttachedUnused) {
249
+ lines.push(` \u26A0 ^${gate}`);
250
+ }
251
+ lines.push("");
252
+ }
253
+ if (report.orphanUnused.length > 0) {
254
+ lines.push("Orphan Gates (declared but never on route or in code):");
255
+ for (const gate of report.orphanUnused) {
204
256
  lines.push(` \u26A0 ^${gate}`);
205
257
  }
206
258
  lines.push("");
@@ -234,9 +286,16 @@ function getComplianceSummary(report) {
234
286
  };
235
287
  }
236
288
  if (report.status === "warnings") {
289
+ const parts = [];
290
+ if (report.routeAttachedUnused.length > 0) {
291
+ parts.push(`${report.routeAttachedUnused.length} route-attached`);
292
+ }
293
+ if (report.orphanUnused.length > 0) {
294
+ parts.push(`${report.orphanUnused.length} orphan`);
295
+ }
237
296
  return {
238
297
  status: "warn",
239
- message: `${report.declaredButUnused.length} unused gates`
298
+ message: parts.length > 0 ? parts.join(", ") + " gate(s)" : `${report.declaredButUnused.length} unused gates`
240
299
  };
241
300
  }
242
301
  return {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MODEL_PRICING
4
4
  } from "./chunk-5JGJACDU.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/core/providers/claude.ts
8
8
  var MODEL_IDS = {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MODEL_PRICING
4
4
  } from "./chunk-5JGJACDU.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/core/providers/claude-cli.ts
8
8
  import * as fs from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MODEL_PRICING
4
4
  } from "./chunk-5JGJACDU.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/core/providers/claude-code.ts
8
8
  import * as fs from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MODEL_PRICING
4
4
  } from "./chunk-5JGJACDU.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/core/providers/claude-code-teams.ts
8
8
  import * as fs from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  log
4
4
  } from "./chunk-4NCFWYGG.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/commands/conductor.ts
8
8
  import { execSync, spawn } from "child_process";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-ZXMDA7VB.js";
2
+ import "./chunk-PDX44BCA.js";
3
3
 
4
4
  // src/core/config-schema.ts
5
5
  import { z } from "zod";
@@ -106,7 +106,9 @@ var KNOWN_TOP_LEVEL_KEYS = /* @__PURE__ */ new Set([
106
106
  "context",
107
107
  "probe",
108
108
  "states",
109
- "custom-symbols"
109
+ "custom-symbols",
110
+ "docs",
111
+ "features"
110
112
  ]);
111
113
  function validateConfig(content) {
112
114
  const warnings = [];
@@ -11,7 +11,7 @@ import "./chunk-IRKUEJVW.js";
11
11
  import {
12
12
  log
13
13
  } from "./chunk-4NCFWYGG.js";
14
- import "./chunk-ZXMDA7VB.js";
14
+ import "./chunk-PDX44BCA.js";
15
15
 
16
16
  // src/commands/constellation.ts
17
17
  import * as fs from "fs";
@@ -2,11 +2,12 @@
2
2
  import {
3
3
  log
4
4
  } from "./chunk-4NCFWYGG.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/commands/doctor/context-audit.ts
8
8
  import * as fs from "fs";
9
9
  import * as path from "path";
10
+ import * as yaml from "js-yaml";
10
11
  var INSTRUCTION_FILES = ["CLAUDE.md", ".cursorrules", "AGENTS.md"];
11
12
  function loadInstructionFiles(rootDir) {
12
13
  const results = [];
@@ -94,6 +95,9 @@ async function checkStaleReferences(rootDir) {
94
95
  if (cleaned.startsWith("node_modules/")) continue;
95
96
  if (checked.has(cleaned)) continue;
96
97
  checked.add(cleaned);
98
+ const hasExt = /\.(ts|js|py|rs|go|yaml|yml|json|md|toml)(?:\/|$)/.test(cleaned);
99
+ const hasPathPrefix = /^(\.|src\/|packages\/|lib\/|app\/|docs\/)/.test(cleaned);
100
+ if (!hasExt && !hasPathPrefix) continue;
97
101
  const fullPath = path.join(rootDir, cleaned);
98
102
  if (!fs.existsSync(fullPath)) {
99
103
  stale.push(`${file.name}: ${cleaned}`);
@@ -406,8 +410,7 @@ async function checkStalePortal(rootDir) {
406
410
  }
407
411
  let portal;
408
412
  try {
409
- const { parse } = await import("./dist-PSF5CP4I.js");
410
- portal = parse(fs.readFileSync(portalPath, "utf8"));
413
+ portal = yaml.load(fs.readFileSync(portalPath, "utf8"));
411
414
  } catch {
412
415
  results.push({
413
416
  check: "stale-portal",
@@ -486,7 +489,7 @@ var VAGUE_PATTERNS = [
486
489
  { pattern: /\btry to\b/i, label: "try to" },
487
490
  { pattern: /\bmaybe\b/i, label: "maybe" },
488
491
  { pattern: /\bif possible\b/i, label: "if possible" },
489
- { pattern: /\bconsider\b/i, label: "consider" },
492
+ { pattern: /\bconsider\b(?!-handoff)/i, label: "consider" },
490
493
  { pattern: /\bmight want to\b/i, label: "might want to" },
491
494
  { pattern: /\byou could\b/i, label: "you could" },
492
495
  { pattern: /\boptionally\b/i, label: "optionally" }
@@ -547,7 +550,7 @@ async function checkConfigSchema(rootDir) {
547
550
  }
548
551
  try {
549
552
  const content = fs.readFileSync(configPath, "utf8");
550
- const { validateConfig } = await import("./config-schema-3YNIFJCJ.js");
553
+ const { validateConfig } = await import("./config-schema-EA4XALGG.js");
551
554
  const validation = validateConfig(content);
552
555
  const details = [];
553
556
  for (const err of validation.errors) {
@@ -6,7 +6,7 @@ import {
6
6
  formatCost,
7
7
  formatTokens
8
8
  } from "./chunk-5JGJACDU.js";
9
- import "./chunk-ZXMDA7VB.js";
9
+ import "./chunk-PDX44BCA.js";
10
10
 
11
11
  // src/commands/team/cost.ts
12
12
  import * as path from "path";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  findGateFiles
7
7
  } from "./chunk-IRKUEJVW.js";
8
- import "./chunk-ZXMDA7VB.js";
8
+ import "./chunk-PDX44BCA.js";
9
9
 
10
10
  // src/commands/cost.ts
11
11
  import * as fs from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MODEL_PRICING
4
4
  } from "./chunk-5JGJACDU.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/core/providers/cursor-cli.ts
8
8
  import * as fs from "fs";
@@ -11,7 +11,7 @@ import {
11
11
  parseParadigmConfig,
12
12
  serializeParadigmConfig
13
13
  } from "./chunk-YO6DVTL7.js";
14
- import "./chunk-ZXMDA7VB.js";
14
+ import "./chunk-PDX44BCA.js";
15
15
 
16
16
  // src/commands/cursorrules.ts
17
17
  import * as fs from "fs";
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ findDecisionsForSymbol,
4
+ getDecisionSummary,
5
+ loadDecision,
6
+ loadDecisions,
7
+ recordDecision,
8
+ supersedeDecision,
9
+ updateDecision
10
+ } from "./chunk-EZ3GOCYC.js";
11
+ import "./chunk-7N7GSU6K.js";
12
+ export {
13
+ findDecisionsForSymbol,
14
+ getDecisionSummary,
15
+ loadDecision,
16
+ loadDecisions,
17
+ recordDecision,
18
+ supersedeDecision,
19
+ updateDecision
20
+ };
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  deleteLoreEntry,
4
4
  loadLoreEntry
5
- } from "./chunk-QIOCFXDQ.js";
6
- import "./chunk-ZXMDA7VB.js";
5
+ } from "./chunk-EKGMAM62.js";
6
+ import "./chunk-PDX44BCA.js";
7
7
 
8
8
  // src/commands/lore/delete.ts
9
9
  import chalk from "chalk";
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  BackgroundOrchestrator
4
- } from "./chunk-QWA26UNO.js";
5
- import "./chunk-J4E6K5MG.js";
4
+ } from "./chunk-WQITYKHM.js";
5
+ import "./chunk-LSRABQIY.js";
6
6
  import "./chunk-PBHIFAL4.js";
7
- import "./chunk-FS3WTUHY.js";
7
+ import "./chunk-TXESEO7Y.js";
8
8
  import "./chunk-6QC3YGB6.js";
9
9
  import "./chunk-PMXRGPRQ.js";
10
- import "./chunk-MW5DMGBB.js";
11
10
  import "./chunk-5JGJACDU.js";
12
11
  import "./chunk-ZGUAAVMA.js";
13
12
  import "./chunk-EDOAWN7J.js";
14
13
  import "./chunk-IRKUEJVW.js";
15
- import "./chunk-ZXMDA7VB.js";
14
+ import "./chunk-YMDLDELF.js";
15
+ import "./chunk-PDX44BCA.js";
16
16
 
17
17
  // src/commands/team/diff.ts
18
18
  import * as fs from "fs";
@@ -10,7 +10,7 @@ import {
10
10
  getStackConfig,
11
11
  listStackPresets
12
12
  } from "./chunk-UPLDI7CN.js";
13
- import "./chunk-ZXMDA7VB.js";
13
+ import "./chunk-PDX44BCA.js";
14
14
  export {
15
15
  DISCIPLINE_MAPPINGS,
16
16
  GENERIC_SYMBOL_MAPPING,
@@ -36,7 +36,7 @@ import {
36
36
  } from "./chunk-ZGUAAVMA.js";
37
37
  import "./chunk-EDOAWN7J.js";
38
38
  import "./chunk-IRKUEJVW.js";
39
- import "./chunk-ZXMDA7VB.js";
39
+ import "./chunk-PDX44BCA.js";
40
40
  export {
41
41
  PREFIX_TO_TYPE,
42
42
  SYMBOL_PREFIXES,
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-ZXMDA7VB.js";
2
+ import "./chunk-PDX44BCA.js";
3
3
 
4
4
  // ../sentinel/dist/dist-5QE2BB2B.js
5
5
  import * as fs4 from "fs";
@@ -29,6 +29,7 @@ import {
29
29
  loadUniversalPatterns,
30
30
  writeConfig
31
31
  } from "./chunk-ZDHLG5VP.js";
32
+ import "./chunk-7N7GSU6K.js";
32
33
  export {
33
34
  ContextEnricher,
34
35
  DEFAULT_AUTH_CONFIG,
@@ -31,7 +31,7 @@ import {
31
31
  loadServerConfig,
32
32
  writeConfig
33
33
  } from "./chunk-FKJUBQU3.js";
34
- import "./chunk-ZXMDA7VB.js";
34
+ import "./chunk-PDX44BCA.js";
35
35
  export {
36
36
  ContextEnricher,
37
37
  DEFAULT_AUTH_CONFIG,
@@ -8,7 +8,7 @@ import {
8
8
  serializeGateConfig,
9
9
  validateGateConfig
10
10
  } from "./chunk-IRKUEJVW.js";
11
- import "./chunk-ZXMDA7VB.js";
11
+ import "./chunk-PDX44BCA.js";
12
12
  export {
13
13
  findGateFiles,
14
14
  formatValidationResult,