@a-company/paradigm 3.34.0 → 3.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{accept-orchestration-XXANWJVZ.js → accept-orchestration-ZUWQUHSK.js} +6 -6
- package/dist/add-VSPZ6FM4.js +81 -0
- package/dist/{aggregate-XHQ6GI3Z.js → aggregate-SV3VGEIL.js} +2 -2
- package/dist/assess-UHBDYIK7.js +68 -0
- package/dist/{beacon-BTLQMYQL.js → beacon-3SJV4DAP.js} +2 -2
- package/dist/calibration-WWHK73WU.js +135 -0
- package/dist/{chunk-C5ZE6WEX.js → chunk-2SKXFXIT.js} +91 -1
- package/dist/{chunk-S5TDFT5Q.js → chunk-7COU5S2Z.js} +2 -2
- package/dist/{chunk-H4TVBJD4.js → chunk-AKIMFN6I.js} +3 -3
- package/dist/{chunk-3DYYXGDC.js → chunk-CDMAMDSG.js} +33 -0
- package/dist/chunk-F3BCHPYT.js +143 -0
- package/dist/{chunk-R2SGQ22F.js → chunk-FKJUBQU3.js} +461 -2
- package/dist/chunk-GT5QGC2H.js +253 -0
- package/dist/{chunk-UQNTJ5VB.js → chunk-HIKKOCXY.js} +1 -1
- package/dist/{chunk-J26YQVAK.js → chunk-J4E6K5MG.js} +1 -1
- package/dist/chunk-L27I3CPZ.js +357 -0
- package/dist/{chunk-WOONGZ3C.js → chunk-P7XSBJE3.js} +1 -1
- package/dist/{chunk-Z7W7HNRG.js → chunk-QDXI2DHR.js} +1 -1
- package/dist/{chunk-BRILIG7Z.js → chunk-QIOCFXDQ.js} +42 -0
- package/dist/{chunk-3BGSDKWD.js → chunk-QWA26UNO.js} +7 -7
- package/dist/{lore-server-ILPHKWLK.js → chunk-RAB5IKPR.js} +77 -112
- package/dist/chunk-SOBTKFSP.js +616 -0
- package/dist/{chunk-BKMNLROM.js → chunk-ZDHLG5VP.js} +461 -147
- package/dist/{chunk-CTF6RHKG.js → chunk-ZGUAAVMA.js} +17 -2
- package/dist/{chunk-PFLWLC6J.js → chunk-ZMQA6SCO.js} +855 -34
- package/dist/{chunk-3BAMPB6I.js → chunk-ZSYVKSY6.js} +2 -147
- package/dist/{commands-KPT2T2OZ.js → commands-5N4ILTPH.js} +465 -1
- package/dist/config-schema-3YNIFJCJ.js +152 -0
- package/dist/{constellation-LZ6XIKDT.js → constellation-FAGT45TU.js} +2 -2
- package/dist/{context-audit-RI4R2WRH.js → context-audit-557EO6PK.js} +138 -8
- package/dist/{cost-4SZM7OUS.js → cost-UD3WPEKZ.js} +1 -1
- package/dist/{delete-YTASL4SM.js → delete-RRK4RL6Y.js} +1 -1
- package/dist/{diff-T6YJSAAC.js → diff-IP5CIARP.js} +6 -6
- package/dist/{dist-AG5JNIZU-HW2FWNTZ.js → dist-5QE2BB2B-X6DYVSUL.js} +59 -5
- package/dist/{dist-IKBGY7FQ.js → dist-CM3MVWWW.js} +3 -1
- package/dist/{dist-OH4DBV2O.js → dist-OGTSAZ55.js} +16 -1
- package/dist/{dist-RMAIFRTW.js → dist-POMVY6WP.js} +5 -3
- package/dist/{dist-QSBAGCZT.js → dist-UXWV4OKX.js} +2 -2
- package/dist/{doctor-INBOLZC7.js → doctor-GKZJU7QG.js} +1 -1
- package/dist/{edit-S7NZD7H7.js → edit-4CLNN5JG.js} +1 -1
- package/dist/{graph-ERNQQQ7C.js → graph-YYUXI3F7.js} +1 -1
- package/dist/graph-server-ZPXRSGCW.js +116 -0
- package/dist/{habits-7BORPC2F.js → habits-RG5SVKXP.js} +2 -2
- package/dist/index.js +200 -86
- package/dist/integrity-MK2OP5TA.js +194 -0
- package/dist/integrity-checker-J7YXRTBT.js +11 -0
- package/dist/{lint-MTRZB5EC.js → lint-HYWGS3JJ.js} +1 -1
- package/dist/{list-QTFWN35D.js → list-BTLFHSRC.js} +1 -1
- package/dist/list-IUCYPGMK.js +57 -0
- package/dist/{lore-loader-S5BXMH27.js → lore-loader-VTEEZDX3.js} +3 -1
- package/dist/lore-server-NOOAHKJX.js +118 -0
- package/dist/mcp.js +2591 -112
- package/dist/{migrate-HRN5TUBQ.js → migrate-FQVGQNXZ.js} +21 -3
- package/dist/{migrate-assessments-FPR6C35Z.js → migrate-assessments-JP6Q5KME.js} +1 -1
- package/dist/{orchestrate-3SI6ON33.js → orchestrate-A226N6FC.js} +6 -6
- package/dist/platform-server-KHL6ZPPN.js +900 -0
- package/dist/{probe-ABMGCXQG.js → probe-7JK7IDNI.js} +4 -4
- package/dist/{providers-YW3FG6DA.js → providers-YNFSL6HK.js} +1 -1
- package/dist/quiz-I75NU2QQ.js +99 -0
- package/dist/{record-UGN75GTB.js → record-46CLR4OG.js} +11 -2
- package/dist/{reindex-YC7LD4MN.js → reindex-WIJMCJ4A.js} +3 -2
- package/dist/{remember-WR6ZVXLT.js → remember-4EUZKIIB.js} +1 -1
- package/dist/{retag-URLJLMSK.js → retag-KC4JVRLE.js} +1 -1
- package/dist/{review-725ZKA7U.js → review-Q7M4CRB5.js} +1 -1
- package/dist/{ripple-QTXKJCEI.js → ripple-RI3LOT6R.js} +2 -2
- package/dist/{sentinel-FUR3QKCJ.js → sentinel-UOIGJWHH.js} +1 -1
- package/dist/sentinel-bridge-APDXYAZS.js +109 -0
- package/dist/sentinel-mcp.js +13 -0
- package/dist/sentinel-ui/assets/{index-Zh1YM0C9.css → index-CJ1Wx083.css} +1 -1
- package/dist/sentinel-ui/assets/index-S1VJ67dT.js +62 -0
- package/dist/sentinel-ui/assets/index-S1VJ67dT.js.map +1 -0
- package/dist/sentinel-ui/index.html +2 -2
- package/dist/sentinel.js +6 -6
- package/dist/{serve-DIALBCTU.js → serve-22A4XOIG.js} +1 -1
- package/dist/{university-A66BMZ4Z.js → serve-2YJ6D2Y6.js} +9 -8
- package/dist/serve-JVXSRSUB.js +33 -0
- package/dist/{server-2VICPDUR.js → server-JV6UFGWZ.js} +25 -2
- package/dist/{server-OWBK2WFS.js → server-RDLQ3DK7.js} +49 -4
- package/dist/{setup-ASR6OMKV.js → setup-M2ZKLKNN.js} +2 -2
- package/dist/{shift-7XLSBLDW.js → shift-LNMKFYLR.js} +63 -14
- package/dist/{show-GEVVQWWG.js → show-P7GYO43X.js} +1 -1
- package/dist/show-PKZMYKRN.js +82 -0
- package/dist/{snapshot-QZFD7YBI.js → snapshot-Y3COXK4T.js} +2 -2
- package/dist/{spawn-DIY7T4QW.js → spawn-SSXZX45U.js} +2 -2
- package/dist/status-KLHALGW4.js +71 -0
- package/dist/{summary-R4CSYNNP.js → summary-5NQNOD3F.js} +2 -2
- package/dist/{sweep-5POCF2E4.js → sweep-EZU3GU6S.js} +1 -1
- package/dist/symphony-EYRGGVNE.js +470 -0
- package/dist/symphony-QWOEKZMC.js +308 -0
- package/dist/{team-VH3HYABB.js → team-HGLJXWQG.js} +7 -7
- package/dist/{timeline-RKXNRMKF.js → timeline-ANC7LVDL.js} +1 -1
- package/dist/{triage-GJ6GK647.js → triage-IZ4MDYNB.js} +2 -2
- package/dist/university-content/courses/.purpose +7 -1
- package/dist/university-content/courses/para-501.json +166 -0
- package/dist/university-content/plsat/.purpose +6 -0
- package/dist/university-content/plsat/v3.0.json +323 -1
- package/dist/university-content/reference.json +48 -0
- package/dist/university-ui/assets/{index-TcsCEBMo.js → index-tfi5xN4Q.js} +2 -2
- package/dist/university-ui/assets/{index-TcsCEBMo.js.map → index-tfi5xN4Q.js.map} +1 -1
- package/dist/university-ui/index.html +1 -1
- package/dist/validate-GD5XWILV.js +134 -0
- package/dist/{validate-OUHUBZPO.js → validate-ZVPNN4FL.js} +1 -1
- package/dist/{workspace-5RBSALXC.js → workspace-UIUTHZTD.js} +5 -5
- package/package.json +4 -2
- package/platform-ui/dist/assets/GitSection-BD3Ze06e.js +4 -0
- package/platform-ui/dist/assets/GitSection-C-GQWHcu.css +1 -0
- package/platform-ui/dist/assets/GraphSection-BlgXTl53.css +1 -0
- package/platform-ui/dist/assets/GraphSection-SglITfSs.js +8 -0
- package/platform-ui/dist/assets/LoreSection-C3EixkjW.css +1 -0
- package/platform-ui/dist/assets/LoreSection-bR5Km4Fd.js +1 -0
- package/platform-ui/dist/assets/SentinelSection-BI-aIYKL.css +1 -0
- package/platform-ui/dist/assets/SentinelSection-QSpAZArG.js +1 -0
- package/platform-ui/dist/assets/SymphonySection-CobYJgvg.js +1 -0
- package/platform-ui/dist/assets/SymphonySection-zY0C5tFl.css +1 -0
- package/platform-ui/dist/assets/index-CfpZFjea.css +1 -0
- package/platform-ui/dist/assets/index-DbxeSMkV.js +57 -0
- package/platform-ui/dist/index.html +14 -0
- package/dist/graph-server-BZ73HTAT.js +0 -251
- package/dist/sentinel-ui/assets/index-C_Wstm64.js +0 -62
- package/dist/sentinel-ui/assets/index-C_Wstm64.js.map +0 -1
- /package/dist/{chunk-VUSCJJ4A.js → chunk-EDOAWN7J.js} +0 -0
- /package/dist/{chunk-5SXMV4SP.js → chunk-FS3WTUHY.js} +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "./chunk-ZXMDA7VB.js";
|
|
3
|
+
|
|
4
|
+
// src/core/config-schema.ts
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import * as yaml from "js-yaml";
|
|
7
|
+
var disciplineEnum = z.enum([
|
|
8
|
+
"web",
|
|
9
|
+
"backend",
|
|
10
|
+
"fullstack",
|
|
11
|
+
"api",
|
|
12
|
+
"cli",
|
|
13
|
+
"ml",
|
|
14
|
+
"mobile",
|
|
15
|
+
"game",
|
|
16
|
+
"embedded",
|
|
17
|
+
"devops",
|
|
18
|
+
"data",
|
|
19
|
+
"library",
|
|
20
|
+
"monorepo",
|
|
21
|
+
"custom"
|
|
22
|
+
]);
|
|
23
|
+
var agentProviderEnum = z.enum([
|
|
24
|
+
"auto",
|
|
25
|
+
"claude",
|
|
26
|
+
"claude-code",
|
|
27
|
+
"cursor-cli",
|
|
28
|
+
"claude-cli",
|
|
29
|
+
"manual"
|
|
30
|
+
]);
|
|
31
|
+
var symbolDefinitionSchema = z.object({
|
|
32
|
+
name: z.string(),
|
|
33
|
+
description: z.string(),
|
|
34
|
+
examples: z.array(z.string()).optional()
|
|
35
|
+
}).passthrough();
|
|
36
|
+
var tagBankSchema = z.object({
|
|
37
|
+
file: z.string().optional(),
|
|
38
|
+
"core-tags": z.array(z.string()).optional(),
|
|
39
|
+
"allow-suggestions": z.boolean().optional()
|
|
40
|
+
}).passthrough();
|
|
41
|
+
var agentGuidelinesSchema = z.object({
|
|
42
|
+
overview: z.string().optional(),
|
|
43
|
+
"how-to-use": z.array(z.string()).optional(),
|
|
44
|
+
"update-rules": z.array(z.string()).optional()
|
|
45
|
+
}).passthrough();
|
|
46
|
+
var loggingSchema = z.object({
|
|
47
|
+
enforce: z.boolean().optional(),
|
|
48
|
+
"default-level": z.enum(["debug", "info", "warn", "error"]).optional(),
|
|
49
|
+
"symbol-mapping": z.record(z.string(), z.string()).optional()
|
|
50
|
+
}).passthrough();
|
|
51
|
+
var purposeRequiredEntry = z.object({
|
|
52
|
+
pattern: z.string(),
|
|
53
|
+
depth: z.number().optional()
|
|
54
|
+
});
|
|
55
|
+
var limitsSchema = z.object({
|
|
56
|
+
toolCacheTtlMs: z.number().optional()
|
|
57
|
+
}).passthrough();
|
|
58
|
+
var aiAgentSchema = z.object({
|
|
59
|
+
model: z.string().optional(),
|
|
60
|
+
"context-window": z.number().optional()
|
|
61
|
+
}).passthrough();
|
|
62
|
+
var contextSchema = z.object({
|
|
63
|
+
enabled: z.boolean().optional(),
|
|
64
|
+
"index-file": z.string().optional(),
|
|
65
|
+
"docs-path": z.string().optional()
|
|
66
|
+
}).passthrough();
|
|
67
|
+
var probeSchema = z.object({
|
|
68
|
+
enabled: z.boolean().optional(),
|
|
69
|
+
"auto-include": z.boolean().optional()
|
|
70
|
+
}).passthrough();
|
|
71
|
+
var paradigmConfigSchema = z.object({
|
|
72
|
+
version: z.string(),
|
|
73
|
+
project: z.string(),
|
|
74
|
+
discipline: disciplineEnum.optional(),
|
|
75
|
+
"agent-provider": agentProviderEnum.optional(),
|
|
76
|
+
"agent-guidelines": agentGuidelinesSchema.optional(),
|
|
77
|
+
"symbol-system": z.record(z.string(), symbolDefinitionSchema).optional(),
|
|
78
|
+
"tag-bank": tagBankSchema.optional(),
|
|
79
|
+
component_types: z.record(z.string(), z.string()).optional(),
|
|
80
|
+
logging: loggingSchema.optional(),
|
|
81
|
+
"purpose-required": z.array(purposeRequiredEntry).optional(),
|
|
82
|
+
conventions: z.array(z.string()).optional(),
|
|
83
|
+
workspace: z.string().optional(),
|
|
84
|
+
limits: limitsSchema.optional(),
|
|
85
|
+
"ai-agent": aiAgentSchema.optional(),
|
|
86
|
+
context: contextSchema.optional(),
|
|
87
|
+
probe: probeSchema.optional(),
|
|
88
|
+
states: z.record(z.string(), z.unknown()).optional(),
|
|
89
|
+
"custom-symbols": z.record(z.string(), symbolDefinitionSchema).optional()
|
|
90
|
+
}).passthrough();
|
|
91
|
+
var KNOWN_TOP_LEVEL_KEYS = /* @__PURE__ */ new Set([
|
|
92
|
+
"version",
|
|
93
|
+
"project",
|
|
94
|
+
"discipline",
|
|
95
|
+
"agent-provider",
|
|
96
|
+
"agent-guidelines",
|
|
97
|
+
"symbol-system",
|
|
98
|
+
"tag-bank",
|
|
99
|
+
"component_types",
|
|
100
|
+
"logging",
|
|
101
|
+
"purpose-required",
|
|
102
|
+
"conventions",
|
|
103
|
+
"workspace",
|
|
104
|
+
"limits",
|
|
105
|
+
"ai-agent",
|
|
106
|
+
"context",
|
|
107
|
+
"probe",
|
|
108
|
+
"states",
|
|
109
|
+
"custom-symbols"
|
|
110
|
+
]);
|
|
111
|
+
function validateConfig(content) {
|
|
112
|
+
const warnings = [];
|
|
113
|
+
const errors = [];
|
|
114
|
+
let parsed;
|
|
115
|
+
try {
|
|
116
|
+
parsed = yaml.load(content);
|
|
117
|
+
} catch (e) {
|
|
118
|
+
return {
|
|
119
|
+
valid: false,
|
|
120
|
+
warnings: [],
|
|
121
|
+
errors: [`YAML parse error: ${e.message}`]
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
if (!parsed || typeof parsed !== "object") {
|
|
125
|
+
return {
|
|
126
|
+
valid: false,
|
|
127
|
+
warnings: [],
|
|
128
|
+
errors: ["Config must be a YAML object"]
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
for (const key of Object.keys(parsed)) {
|
|
132
|
+
if (!KNOWN_TOP_LEVEL_KEYS.has(key)) {
|
|
133
|
+
warnings.push(`Unrecognized config key: "${key}"`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const result = paradigmConfigSchema.safeParse(parsed);
|
|
137
|
+
if (!result.success) {
|
|
138
|
+
for (const issue of result.error.issues) {
|
|
139
|
+
const path = issue.path.join(".");
|
|
140
|
+
errors.push(`${path}: ${issue.message}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
valid: errors.length === 0,
|
|
145
|
+
warnings,
|
|
146
|
+
errors
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export {
|
|
150
|
+
paradigmConfigSchema,
|
|
151
|
+
validateConfig
|
|
152
|
+
};
|
|
@@ -360,25 +360,35 @@ async function checkOrphanedSymbols(rootDir) {
|
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
const
|
|
363
|
+
const hasOutgoingRefs = /* @__PURE__ */ new Set();
|
|
364
|
+
for (const cat of categories) {
|
|
365
|
+
const entries = index[cat];
|
|
366
|
+
if (!entries || typeof entries !== "object") continue;
|
|
367
|
+
for (const [, entry] of Object.entries(entries)) {
|
|
368
|
+
if (entry.symbol && entry.related && Array.isArray(entry.related) && entry.related.length > 0) {
|
|
369
|
+
hasOutgoingRefs.add(entry.symbol);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
const isolated = [];
|
|
364
374
|
for (const [symbol] of allSymbols) {
|
|
365
|
-
if (!referencedSymbols.has(symbol)) {
|
|
366
|
-
|
|
375
|
+
if (!referencedSymbols.has(symbol) && !hasOutgoingRefs.has(symbol)) {
|
|
376
|
+
isolated.push(symbol);
|
|
367
377
|
}
|
|
368
378
|
}
|
|
369
|
-
if (
|
|
379
|
+
if (isolated.length > 0) {
|
|
370
380
|
results.push({
|
|
371
381
|
check: "orphaned-symbols",
|
|
372
382
|
status: "advisory",
|
|
373
|
-
message: `${
|
|
374
|
-
details:
|
|
375
|
-
fix: "
|
|
383
|
+
message: `${isolated.length} isolated symbol${isolated.length > 1 ? "s" : ""} (no connections to other symbols)`,
|
|
384
|
+
details: isolated.slice(0, 20),
|
|
385
|
+
fix: "Wire isolated symbols into features or remove them from .purpose files"
|
|
376
386
|
});
|
|
377
387
|
} else {
|
|
378
388
|
results.push({
|
|
379
389
|
check: "orphaned-symbols",
|
|
380
390
|
status: "ok",
|
|
381
|
-
message: "All symbols
|
|
391
|
+
message: "All symbols are connected"
|
|
382
392
|
});
|
|
383
393
|
}
|
|
384
394
|
return results;
|
|
@@ -524,6 +534,124 @@ async function checkInstructionVagueness(rootDir) {
|
|
|
524
534
|
}
|
|
525
535
|
return results;
|
|
526
536
|
}
|
|
537
|
+
async function checkConfigSchema(rootDir) {
|
|
538
|
+
const results = [];
|
|
539
|
+
const configPath = path.join(rootDir, ".paradigm", "config.yaml");
|
|
540
|
+
if (!fs.existsSync(configPath)) {
|
|
541
|
+
results.push({
|
|
542
|
+
check: "config-schema-validation",
|
|
543
|
+
status: "advisory",
|
|
544
|
+
message: "No .paradigm/config.yaml found"
|
|
545
|
+
});
|
|
546
|
+
return results;
|
|
547
|
+
}
|
|
548
|
+
try {
|
|
549
|
+
const content = fs.readFileSync(configPath, "utf8");
|
|
550
|
+
const { validateConfig } = await import("./config-schema-3YNIFJCJ.js");
|
|
551
|
+
const validation = validateConfig(content);
|
|
552
|
+
const details = [];
|
|
553
|
+
for (const err of validation.errors) {
|
|
554
|
+
details.push(`Error: ${err}`);
|
|
555
|
+
}
|
|
556
|
+
for (const warn of validation.warnings) {
|
|
557
|
+
details.push(`Warning: ${warn}`);
|
|
558
|
+
}
|
|
559
|
+
if (validation.errors.length > 0) {
|
|
560
|
+
results.push({
|
|
561
|
+
check: "config-schema-validation",
|
|
562
|
+
status: "error",
|
|
563
|
+
message: `${validation.errors.length} schema error${validation.errors.length > 1 ? "s" : ""} in config.yaml`,
|
|
564
|
+
details,
|
|
565
|
+
fix: "Fix invalid fields in .paradigm/config.yaml"
|
|
566
|
+
});
|
|
567
|
+
} else if (validation.warnings.length > 0) {
|
|
568
|
+
results.push({
|
|
569
|
+
check: "config-schema-validation",
|
|
570
|
+
status: "warn",
|
|
571
|
+
message: `${validation.warnings.length} unrecognized key${validation.warnings.length > 1 ? "s" : ""} in config.yaml`,
|
|
572
|
+
details,
|
|
573
|
+
fix: "Check for typos in .paradigm/config.yaml field names"
|
|
574
|
+
});
|
|
575
|
+
} else {
|
|
576
|
+
results.push({
|
|
577
|
+
check: "config-schema-validation",
|
|
578
|
+
status: "ok",
|
|
579
|
+
message: "config.yaml schema is valid"
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
} catch (e) {
|
|
583
|
+
results.push({
|
|
584
|
+
check: "config-schema-validation",
|
|
585
|
+
status: "error",
|
|
586
|
+
message: `Could not validate config.yaml: ${e.message}`
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
return results;
|
|
590
|
+
}
|
|
591
|
+
async function checkPurposeFileHealth(rootDir) {
|
|
592
|
+
const results = [];
|
|
593
|
+
const purposeFiles = [];
|
|
594
|
+
function findPurpose(dir) {
|
|
595
|
+
const skipDirs = /* @__PURE__ */ new Set(["node_modules", "dist", ".git", ".paradigm", "coverage", "build"]);
|
|
596
|
+
try {
|
|
597
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
598
|
+
for (const entry of entries) {
|
|
599
|
+
if (skipDirs.has(entry.name)) continue;
|
|
600
|
+
const full = path.join(dir, entry.name);
|
|
601
|
+
if (entry.isDirectory()) {
|
|
602
|
+
findPurpose(full);
|
|
603
|
+
} else if (entry.name === ".purpose") {
|
|
604
|
+
purposeFiles.push(full);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
} catch {
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
findPurpose(rootDir);
|
|
611
|
+
if (purposeFiles.length === 0) {
|
|
612
|
+
results.push({
|
|
613
|
+
check: "purpose-file-health",
|
|
614
|
+
status: "ok",
|
|
615
|
+
message: "No .purpose files to check"
|
|
616
|
+
});
|
|
617
|
+
return results;
|
|
618
|
+
}
|
|
619
|
+
const oversized = [];
|
|
620
|
+
let maxLines = 0;
|
|
621
|
+
let maxFile = "";
|
|
622
|
+
for (const pf of purposeFiles) {
|
|
623
|
+
try {
|
|
624
|
+
const content = fs.readFileSync(pf, "utf8");
|
|
625
|
+
const lines = content.split("\n").length;
|
|
626
|
+
if (lines > maxLines) {
|
|
627
|
+
maxLines = lines;
|
|
628
|
+
maxFile = path.relative(rootDir, pf);
|
|
629
|
+
}
|
|
630
|
+
if (lines > 500) {
|
|
631
|
+
const severity = lines > 1e3 ? "!!" : "!";
|
|
632
|
+
oversized.push(`${severity} ${path.relative(rootDir, pf)} (${lines} lines)`);
|
|
633
|
+
}
|
|
634
|
+
} catch {
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
if (oversized.length > 0) {
|
|
639
|
+
results.push({
|
|
640
|
+
check: "purpose-file-health",
|
|
641
|
+
status: "warn",
|
|
642
|
+
message: `${oversized.length} oversized .purpose file${oversized.length > 1 ? "s" : ""} (largest: ${maxFile} at ${maxLines} lines)`,
|
|
643
|
+
details: oversized,
|
|
644
|
+
fix: "Split large .purpose files by component type or subdirectory"
|
|
645
|
+
});
|
|
646
|
+
} else {
|
|
647
|
+
results.push({
|
|
648
|
+
check: "purpose-file-health",
|
|
649
|
+
status: "ok",
|
|
650
|
+
message: `${purposeFiles.length} .purpose files, all under 500 lines`
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
return results;
|
|
654
|
+
}
|
|
527
655
|
async function runContextAudit(rootDir, _options) {
|
|
528
656
|
const tracker = log.command("doctor:context-audit").start("Running context audit checks");
|
|
529
657
|
const results = [];
|
|
@@ -534,6 +662,8 @@ async function runContextAudit(rootDir, _options) {
|
|
|
534
662
|
results.push(...await checkOrphanedSymbols(rootDir));
|
|
535
663
|
results.push(...await checkStalePortal(rootDir));
|
|
536
664
|
results.push(...await checkInstructionVagueness(rootDir));
|
|
665
|
+
results.push(...await checkConfigSchema(rootDir));
|
|
666
|
+
results.push(...await checkPurposeFileHealth(rootDir));
|
|
537
667
|
const errorCount = results.filter((r) => r.status === "error").length;
|
|
538
668
|
const warnCount = results.filter((r) => r.status === "warn").length;
|
|
539
669
|
const advisoryCount = results.filter((r) => r.status === "advisory").length;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
BackgroundOrchestrator
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-J26YQVAK.js";
|
|
4
|
+
} from "./chunk-QWA26UNO.js";
|
|
5
|
+
import "./chunk-J4E6K5MG.js";
|
|
7
6
|
import "./chunk-PBHIFAL4.js";
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-FS3WTUHY.js";
|
|
8
|
+
import "./chunk-6QC3YGB6.js";
|
|
9
9
|
import "./chunk-PMXRGPRQ.js";
|
|
10
10
|
import "./chunk-MW5DMGBB.js";
|
|
11
11
|
import "./chunk-5JGJACDU.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-ZGUAAVMA.js";
|
|
13
|
+
import "./chunk-EDOAWN7J.js";
|
|
14
14
|
import "./chunk-IRKUEJVW.js";
|
|
15
15
|
import "./chunk-ZXMDA7VB.js";
|
|
16
16
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "./chunk-ZXMDA7VB.js";
|
|
3
3
|
|
|
4
|
-
// ../sentinel/dist/dist-
|
|
4
|
+
// ../sentinel/dist/dist-5QE2BB2B.js
|
|
5
5
|
import * as fs4 from "fs";
|
|
6
6
|
import { z as z2 } from "zod";
|
|
7
7
|
import * as path3 from "path";
|
|
@@ -5578,6 +5578,12 @@ var Ze = Object.assign(Je, { glob: Je, globSync: ts, sync: Ui, globStream: Qe, s
|
|
|
5578
5578
|
Ze.glob = Ze;
|
|
5579
5579
|
var PurposeItemSchema = z.object({
|
|
5580
5580
|
description: z.string(),
|
|
5581
|
+
// Component type and hierarchy (v4)
|
|
5582
|
+
type: z.string().optional(),
|
|
5583
|
+
parent: z.string().optional(),
|
|
5584
|
+
anchors: z.array(z.string()).optional(),
|
|
5585
|
+
tags: z.array(z.string()).optional(),
|
|
5586
|
+
// Standard fields
|
|
5581
5587
|
endpoints: z.array(z.string()).optional(),
|
|
5582
5588
|
tests: z.array(z.string()).optional(),
|
|
5583
5589
|
rules: z.record(z.unknown()).optional(),
|
|
@@ -5589,7 +5595,6 @@ var PurposeItemSchema = z.object({
|
|
|
5589
5595
|
states: z.array(z.string()).optional(),
|
|
5590
5596
|
components: z.array(z.string()).optional(),
|
|
5591
5597
|
// Extra fields preserved
|
|
5592
|
-
tags: z.array(z.string()).optional(),
|
|
5593
5598
|
location: z.string().optional(),
|
|
5594
5599
|
locations: z.array(z.string()).optional(),
|
|
5595
5600
|
uses: z.array(z.string()).optional(),
|
|
@@ -6401,6 +6406,7 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
6401
6406
|
purposeFiles.push(...parsed.map((p) => p.filePath));
|
|
6402
6407
|
const features = extractFeatures(parsed);
|
|
6403
6408
|
for (const [id, { item, filePath }] of features) {
|
|
6409
|
+
const featureTags = ["feature", ...item.tags || []];
|
|
6404
6410
|
symbols.push(createSymbolEntry({
|
|
6405
6411
|
id: `purpose-feature-${id}`,
|
|
6406
6412
|
symbol: `#${id}`,
|
|
@@ -6409,7 +6415,10 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
6409
6415
|
filePath,
|
|
6410
6416
|
data: item,
|
|
6411
6417
|
description: item.description,
|
|
6412
|
-
tags:
|
|
6418
|
+
tags: featureTags,
|
|
6419
|
+
componentType: item.type,
|
|
6420
|
+
parentSymbol: item.parent,
|
|
6421
|
+
anchors: item.anchors?.map((a) => parseAnchorString(a))
|
|
6413
6422
|
}));
|
|
6414
6423
|
}
|
|
6415
6424
|
const components = extractComponents(parsed);
|
|
@@ -6421,7 +6430,11 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
6421
6430
|
source: "purpose",
|
|
6422
6431
|
filePath,
|
|
6423
6432
|
data: item,
|
|
6424
|
-
description: item.description
|
|
6433
|
+
description: item.description,
|
|
6434
|
+
tags: item.tags,
|
|
6435
|
+
componentType: item.type,
|
|
6436
|
+
parentSymbol: item.parent,
|
|
6437
|
+
anchors: item.anchors?.map((a) => parseAnchorString(a))
|
|
6425
6438
|
}));
|
|
6426
6439
|
}
|
|
6427
6440
|
const gates = extractGates(parsed);
|
|
@@ -6587,12 +6600,27 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
6587
6600
|
}));
|
|
6588
6601
|
}
|
|
6589
6602
|
resolveReferences(symbols);
|
|
6603
|
+
const symbolFileMap = /* @__PURE__ */ new Map();
|
|
6604
|
+
for (const sym of symbols) {
|
|
6605
|
+
const files = symbolFileMap.get(sym.symbol) || [];
|
|
6606
|
+
if (!files.includes(sym.filePath)) {
|
|
6607
|
+
files.push(sym.filePath);
|
|
6608
|
+
}
|
|
6609
|
+
symbolFileMap.set(sym.symbol, files);
|
|
6610
|
+
}
|
|
6611
|
+
const duplicateSymbols = [];
|
|
6612
|
+
for (const [symbol, files] of symbolFileMap) {
|
|
6613
|
+
if (files.length > 1) {
|
|
6614
|
+
duplicateSymbols.push({ symbol, files });
|
|
6615
|
+
}
|
|
6616
|
+
}
|
|
6590
6617
|
return {
|
|
6591
6618
|
symbols,
|
|
6592
6619
|
purposeFiles,
|
|
6593
6620
|
portalFiles,
|
|
6594
6621
|
errors,
|
|
6595
|
-
timestamp: Date.now()
|
|
6622
|
+
timestamp: Date.now(),
|
|
6623
|
+
...duplicateSymbols.length > 0 ? { duplicateSymbols } : {}
|
|
6596
6624
|
};
|
|
6597
6625
|
}
|
|
6598
6626
|
function createSymbolEntry(partial) {
|
|
@@ -6751,10 +6779,33 @@ function searchSymbols(index, query) {
|
|
|
6751
6779
|
}
|
|
6752
6780
|
if (entry.tags?.some((tag) => tag.toLowerCase().includes(lowerQuery))) {
|
|
6753
6781
|
results.push(entry);
|
|
6782
|
+
continue;
|
|
6783
|
+
}
|
|
6784
|
+
if (entry.componentType?.toLowerCase().includes(lowerQuery)) {
|
|
6785
|
+
results.push(entry);
|
|
6786
|
+
continue;
|
|
6754
6787
|
}
|
|
6755
6788
|
}
|
|
6756
6789
|
return results;
|
|
6757
6790
|
}
|
|
6791
|
+
function getComponentsByType(index, componentType) {
|
|
6792
|
+
const components = getSymbolsByType(index, "component");
|
|
6793
|
+
return components.filter((c) => c.componentType === componentType);
|
|
6794
|
+
}
|
|
6795
|
+
function getAllComponentTypes(index) {
|
|
6796
|
+
const types = /* @__PURE__ */ new Set();
|
|
6797
|
+
const components = getSymbolsByType(index, "component");
|
|
6798
|
+
for (const comp of components) {
|
|
6799
|
+
if (comp.componentType) {
|
|
6800
|
+
types.add(comp.componentType);
|
|
6801
|
+
}
|
|
6802
|
+
}
|
|
6803
|
+
return Array.from(types).sort();
|
|
6804
|
+
}
|
|
6805
|
+
function getChildComponents(index, parentSymbol) {
|
|
6806
|
+
const components = getSymbolsByType(index, "component");
|
|
6807
|
+
return components.filter((c) => c.parentSymbol === parentSymbol);
|
|
6808
|
+
}
|
|
6758
6809
|
function getReferencesTo(index, symbol) {
|
|
6759
6810
|
const entry = getSymbol(index, symbol);
|
|
6760
6811
|
if (!entry) return [];
|
|
@@ -6838,9 +6889,12 @@ export {
|
|
|
6838
6889
|
createSnapshot,
|
|
6839
6890
|
createSymbolIndex,
|
|
6840
6891
|
createSymbolString,
|
|
6892
|
+
getAllComponentTypes,
|
|
6841
6893
|
getAllSymbols,
|
|
6842
6894
|
getAllTags,
|
|
6843
6895
|
getAutocompleteSuggestions,
|
|
6896
|
+
getChildComponents,
|
|
6897
|
+
getComponentsByType,
|
|
6844
6898
|
getDefaultPremiseContent,
|
|
6845
6899
|
getReferencesFrom,
|
|
6846
6900
|
getReferencesTo,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
PatternImporter,
|
|
11
11
|
PatternMatcher,
|
|
12
12
|
PatternSuggester,
|
|
13
|
+
SYMPHONY_SCHEMA,
|
|
13
14
|
Sentinel,
|
|
14
15
|
SentinelClient,
|
|
15
16
|
SentinelStorage,
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
loadServerConfig,
|
|
28
29
|
loadUniversalPatterns,
|
|
29
30
|
writeConfig
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ZDHLG5VP.js";
|
|
31
32
|
export {
|
|
32
33
|
ContextEnricher,
|
|
33
34
|
DEFAULT_AUTH_CONFIG,
|
|
@@ -39,6 +40,7 @@ export {
|
|
|
39
40
|
PatternImporter,
|
|
40
41
|
PatternMatcher,
|
|
41
42
|
PatternSuggester,
|
|
43
|
+
SYMPHONY_SCHEMA,
|
|
42
44
|
Sentinel,
|
|
43
45
|
SentinelClient,
|
|
44
46
|
SentinelStorage,
|
|
@@ -1044,12 +1044,27 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
1044
1044
|
}));
|
|
1045
1045
|
}
|
|
1046
1046
|
resolveReferences(symbols);
|
|
1047
|
+
const symbolFileMap = /* @__PURE__ */ new Map();
|
|
1048
|
+
for (const sym of symbols) {
|
|
1049
|
+
const files = symbolFileMap.get(sym.symbol) || [];
|
|
1050
|
+
if (!files.includes(sym.filePath)) {
|
|
1051
|
+
files.push(sym.filePath);
|
|
1052
|
+
}
|
|
1053
|
+
symbolFileMap.set(sym.symbol, files);
|
|
1054
|
+
}
|
|
1055
|
+
const duplicateSymbols = [];
|
|
1056
|
+
for (const [symbol, files] of symbolFileMap) {
|
|
1057
|
+
if (files.length > 1) {
|
|
1058
|
+
duplicateSymbols.push({ symbol, files });
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1047
1061
|
return {
|
|
1048
1062
|
symbols,
|
|
1049
1063
|
purposeFiles,
|
|
1050
1064
|
portalFiles,
|
|
1051
1065
|
errors,
|
|
1052
|
-
timestamp: Date.now()
|
|
1066
|
+
timestamp: Date.now(),
|
|
1067
|
+
...duplicateSymbols.length > 0 ? { duplicateSymbols } : {}
|
|
1053
1068
|
};
|
|
1054
1069
|
}
|
|
1055
1070
|
function createSymbolEntry(partial) {
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
ContextEnricher,
|
|
4
4
|
FlowTracker,
|
|
5
5
|
IncidentGrouper,
|
|
6
|
-
PARADIGM_SCHEMA,
|
|
7
6
|
PatternImporter,
|
|
8
7
|
PatternMatcher,
|
|
9
8
|
PatternSuggester,
|
|
@@ -20,16 +19,18 @@ import {
|
|
|
20
19
|
loadAllSeedPatterns,
|
|
21
20
|
loadParadigmPatterns,
|
|
22
21
|
loadUniversalPatterns
|
|
23
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZSYVKSY6.js";
|
|
24
23
|
import {
|
|
25
24
|
DEFAULT_AUTH_CONFIG,
|
|
26
25
|
DEFAULT_RATE_LIMIT_CONFIG,
|
|
27
26
|
DEFAULT_SERVER_CONFIG,
|
|
27
|
+
PARADIGM_SCHEMA,
|
|
28
|
+
SYMPHONY_SCHEMA,
|
|
28
29
|
SentinelStorage,
|
|
29
30
|
loadConfig,
|
|
30
31
|
loadServerConfig,
|
|
31
32
|
writeConfig
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-FKJUBQU3.js";
|
|
33
34
|
import "./chunk-ZXMDA7VB.js";
|
|
34
35
|
export {
|
|
35
36
|
ContextEnricher,
|
|
@@ -42,6 +43,7 @@ export {
|
|
|
42
43
|
PatternImporter,
|
|
43
44
|
PatternMatcher,
|
|
44
45
|
PatternSuggester,
|
|
46
|
+
SYMPHONY_SCHEMA,
|
|
45
47
|
Sentinel,
|
|
46
48
|
SentinelClient,
|
|
47
49
|
SentinelStorage,
|
|
@@ -33,8 +33,8 @@ import {
|
|
|
33
33
|
searchSymbols,
|
|
34
34
|
serializePremiseFile,
|
|
35
35
|
updateNodePosition
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-ZGUAAVMA.js";
|
|
37
|
+
import "./chunk-EDOAWN7J.js";
|
|
38
38
|
import "./chunk-IRKUEJVW.js";
|
|
39
39
|
import "./chunk-ZXMDA7VB.js";
|
|
40
40
|
export {
|