@a-company/paradigm 3.28.0 → 3.43.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-6EM5EHXA.js → accept-orchestration-ZUWQUHSK.js} +6 -6
- package/dist/add-VSPZ6FM4.js +81 -0
- package/dist/{aggregate-M5WMUI6B.js → aggregate-SV3VGEIL.js} +2 -2
- package/dist/assess-UHBDYIK7.js +68 -0
- package/dist/{beacon-XL2ALH5O.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-AK5M6KJB.js → chunk-36TKPM5Z.js} +20 -2
- package/dist/{chunk-W4VFKZVF.js → chunk-7COU5S2Z.js} +3 -3
- package/dist/{chunk-3BAMPB6I.js → chunk-7WEKMZ46.js} +2 -147
- package/dist/{chunk-SCC77UUP.js → chunk-AKIMFN6I.js} +3 -3
- package/dist/{chunk-3DYYXGDC.js → chunk-CDMAMDSG.js} +33 -0
- package/dist/{chunk-7IJ5JVKT.js → chunk-CZEIK3Y2.js} +913 -40
- package/dist/{chunk-MRENOFTR.js → chunk-EDOAWN7J.js} +6 -1
- package/dist/chunk-F3BCHPYT.js +143 -0
- package/dist/chunk-GT5QGC2H.js +253 -0
- package/dist/{chunk-N6RNYCZD.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-KWDTBXP2.js → chunk-LHLIAYQ3.js} +1 -1
- package/dist/{chunk-OXG5GVDJ.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-ZOH24ZPF.js → chunk-QWA26UNO.js} +7 -7
- package/dist/{lore-server-ILPHKWLK.js → chunk-RAB5IKPR.js} +77 -112
- package/dist/{chunk-BKMNLROM.js → chunk-RGFANZ4Q.js} +448 -147
- package/dist/{chunk-R2SGQ22F.js → chunk-YW5OCVKB.js} +448 -2
- package/dist/{chunk-6P4IFIK2.js → chunk-ZGUAAVMA.js} +53 -4
- package/dist/{commands-6ZVTD74M.js → commands-LEPFD7S5.js} +452 -1
- package/dist/config-schema-3YNIFJCJ.js +152 -0
- package/dist/{constellation-NXU6Q2HM.js → constellation-FAGT45TU.js} +2 -2
- package/dist/{context-audit-RI4R2WRH.js → context-audit-557EO6PK.js} +138 -8
- package/dist/{cost-CTGSLSOC.js → cost-UD3WPEKZ.js} +1 -1
- package/dist/{cursorrules-XBWFX66V.js → cursorrules-3TKZ4E4R.js} +2 -2
- package/dist/{delete-YTASL4SM.js → delete-RRK4RL6Y.js} +1 -1
- package/dist/{diff-AH7L4PRQ.js → diff-IP5CIARP.js} +6 -6
- package/dist/{dist-AG5JNIZU-HW2FWNTZ.js → dist-5QE2BB2B-X6DYVSUL.js} +59 -5
- package/dist/{dist-KY5HGDDL.js → dist-OGTSAZ55.js} +58 -4
- package/dist/{dist-IKBGY7FQ.js → dist-RVKYUCRU.js} +3 -1
- package/dist/{dist-7U64HDSC.js → dist-UXWV4OKX.js} +8 -2
- package/dist/{dist-RMAIFRTW.js → dist-Y7I3CFY5.js} +5 -3
- 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-O37HTUKE.js} +2 -2
- package/dist/index.js +207 -89
- package/dist/integrity-MK2OP5TA.js +194 -0
- package/dist/integrity-checker-J7YXRTBT.js +11 -0
- package/dist/{lint-53GPXKKI.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 +2616 -112
- package/dist/migrate-FQVGQNXZ.js +889 -0
- package/dist/{migrate-assessments-FPR6C35Z.js → migrate-assessments-JP6Q5KME.js} +1 -1
- package/dist/{orchestrate-HMSQ2CED.js → orchestrate-A226N6FC.js} +6 -6
- package/dist/platform-server-KK4OCRTV.js +891 -0
- package/dist/{probe-SN4BNXOC.js → probe-7JK7IDNI.js} +5 -5
- 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-YG3KIXAK.js → reindex-NZQRGKPN.js} +3 -2
- package/dist/{remember-IEBQHXHZ.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-DFMXLFWI.js → ripple-RI3LOT6R.js} +2 -2
- package/dist/{sentinel-FUR3QKCJ.js → sentinel-BKYTBT7M.js} +1 -1
- package/dist/sentinel-bridge-IZTXYS5M.js +109 -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-3V2WXLGM.js +33 -0
- package/dist/{server-2VICPDUR.js → server-OFEJ2HJP.js} +25 -2
- package/dist/{server-OWBK2WFS.js → server-RDLQ3DK7.js} +49 -4
- package/dist/{setup-HOI52TN3.js → setup-M2ZKLKNN.js} +4 -4
- package/dist/{shift-DRF5M3G6.js → shift-LNMKFYLR.js} +73 -14
- package/dist/{show-GEVVQWWG.js → show-P7GYO43X.js} +1 -1
- package/dist/show-PKZMYKRN.js +82 -0
- package/dist/{snapshot-XHINQBZS.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-NV7SBV5O.js → summary-5NQNOD3F.js} +2 -2
- package/dist/{sweep-5POCF2E4.js → sweep-EZU3GU6S.js} +1 -1
- package/dist/symphony-ROEKK7VD.js +999 -0
- package/dist/{team-YOGT2Q2X.js → team-HGLJXWQG.js} +7 -7
- package/dist/{timeline-RKXNRMKF.js → timeline-ANC7LVDL.js} +1 -1
- package/dist/{triage-GJ6GK647.js → triage-POXJ2TIX.js} +2 -2
- package/dist/university-content/courses/.purpose +7 -1
- package/dist/university-content/courses/para-101.json +53 -0
- 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 +400 -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/{upgrade-65QOQXRC.js → upgrade-ANX3LVSA.js} +1 -0
- package/dist/validate-GD5XWILV.js +134 -0
- package/dist/{validate-TKKRGJKC.js → validate-ZVPNN4FL.js} +1 -1
- package/dist/{workspace-L27RR5MF.js → workspace-UIUTHZTD.js} +6 -6
- package/package.json +4 -2
- package/platform-ui/dist/assets/GitSection-C-GQWHcu.css +1 -0
- package/platform-ui/dist/assets/GitSection-DvyJBF_-.js +4 -0
- package/platform-ui/dist/assets/GraphSection-BiQrXqfs.js +8 -0
- package/platform-ui/dist/assets/GraphSection-BlgXTl53.css +1 -0
- package/platform-ui/dist/assets/LoreSection-BaH1FaRb.js +1 -0
- package/platform-ui/dist/assets/LoreSection-C3EixkjW.css +1 -0
- package/platform-ui/dist/assets/SentinelSection-BI-aIYKL.css +1 -0
- package/platform-ui/dist/assets/SentinelSection-DemAznjI.js +1 -0
- package/platform-ui/dist/assets/index-CfpZFjea.css +1 -0
- package/platform-ui/dist/assets/index-DDKhCt-w.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-5SXMV4SP.js → chunk-FS3WTUHY.js} +0 -0
|
@@ -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
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
rebuildUniversityIndex,
|
|
4
|
+
saveNote,
|
|
5
|
+
saveQuiz
|
|
6
|
+
} from "./chunk-GT5QGC2H.js";
|
|
7
|
+
import "./chunk-ZXMDA7VB.js";
|
|
8
|
+
|
|
9
|
+
// src/commands/university/add.ts
|
|
10
|
+
import chalk from "chalk";
|
|
11
|
+
import { execSync } from "child_process";
|
|
12
|
+
import * as os from "os";
|
|
13
|
+
function resolveAuthor() {
|
|
14
|
+
try {
|
|
15
|
+
return execSync("git config user.name", { encoding: "utf-8", timeout: 3e3 }).trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").slice(0, 20) || "unknown";
|
|
16
|
+
} catch {
|
|
17
|
+
try {
|
|
18
|
+
return os.userInfo().username;
|
|
19
|
+
} catch {
|
|
20
|
+
return "unknown";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function universityAddCommand(type, options) {
|
|
25
|
+
const rootDir = process.cwd();
|
|
26
|
+
if (!options.title) {
|
|
27
|
+
console.error(chalk.red("\n Error: --title is required\n"));
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
const author = resolveAuthor();
|
|
31
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
32
|
+
const slug = options.title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 40);
|
|
33
|
+
const tags = options.tags ? options.tags.split(",").map((t) => t.trim()) : [];
|
|
34
|
+
const symbols = options.symbols ? options.symbols.split(",").map((s) => s.trim()) : [];
|
|
35
|
+
if (type === "quiz") {
|
|
36
|
+
const id2 = `Q-${slug}`;
|
|
37
|
+
const quiz = {
|
|
38
|
+
id: id2,
|
|
39
|
+
title: options.title,
|
|
40
|
+
description: options.body || "",
|
|
41
|
+
author,
|
|
42
|
+
created: today,
|
|
43
|
+
updated: today,
|
|
44
|
+
tags,
|
|
45
|
+
symbols,
|
|
46
|
+
difficulty: options.difficulty || "beginner",
|
|
47
|
+
passThreshold: 0.7,
|
|
48
|
+
questions: []
|
|
49
|
+
};
|
|
50
|
+
saveQuiz(rootDir, quiz);
|
|
51
|
+
rebuildUniversityIndex(rootDir);
|
|
52
|
+
console.log(chalk.green(`
|
|
53
|
+
Created quiz: ${id2}`));
|
|
54
|
+
console.log(chalk.gray(" Add questions by editing the YAML file\n"));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const prefix = type === "policy" ? "P" : "N";
|
|
58
|
+
const id = `${prefix}-${slug}`;
|
|
59
|
+
const frontmatter = {
|
|
60
|
+
id,
|
|
61
|
+
title: options.title,
|
|
62
|
+
type,
|
|
63
|
+
author,
|
|
64
|
+
created: today,
|
|
65
|
+
updated: today,
|
|
66
|
+
tags,
|
|
67
|
+
symbols,
|
|
68
|
+
difficulty: options.difficulty || "beginner",
|
|
69
|
+
estimatedMinutes: options.minutes ? parseInt(options.minutes, 10) : void 0,
|
|
70
|
+
prerequisites: []
|
|
71
|
+
};
|
|
72
|
+
saveNote(rootDir, frontmatter, options.body || "");
|
|
73
|
+
rebuildUniversityIndex(rootDir);
|
|
74
|
+
console.log(chalk.green(`
|
|
75
|
+
Created ${type}: ${id}`));
|
|
76
|
+
console.log(chalk.gray(` Edit at .paradigm/university/content/${type === "policy" ? "policies" : "notes"}/${id}.md
|
|
77
|
+
`));
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
universityAddCommand
|
|
81
|
+
};
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
buildSymbolIndex,
|
|
6
6
|
getSymbolCounts,
|
|
7
7
|
parsePremiseFile
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-ZGUAAVMA.js";
|
|
9
|
+
import "./chunk-EDOAWN7J.js";
|
|
10
10
|
import "./chunk-IRKUEJVW.js";
|
|
11
11
|
import "./chunk-ZXMDA7VB.js";
|
|
12
12
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
addAssessment,
|
|
4
|
+
loadLoreEntry
|
|
5
|
+
} from "./chunk-QIOCFXDQ.js";
|
|
6
|
+
import "./chunk-ZXMDA7VB.js";
|
|
7
|
+
|
|
8
|
+
// src/commands/lore/assess.ts
|
|
9
|
+
import chalk from "chalk";
|
|
10
|
+
async function loreAssessCommand(id, verdict, options) {
|
|
11
|
+
const rootDir = process.cwd();
|
|
12
|
+
const validVerdicts = ["correct", "partial", "incorrect"];
|
|
13
|
+
if (!validVerdicts.includes(verdict)) {
|
|
14
|
+
console.error(chalk.red(`
|
|
15
|
+
Invalid verdict: "${verdict}". Must be one of: correct, partial, incorrect
|
|
16
|
+
`));
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
const entry = await loadLoreEntry(rootDir, id);
|
|
20
|
+
if (!entry) {
|
|
21
|
+
console.error(chalk.red(`
|
|
22
|
+
Entry not found: ${id}
|
|
23
|
+
`));
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
const success = await addAssessment(rootDir, id, {
|
|
27
|
+
verdict,
|
|
28
|
+
assessed_by: options.assessor || "unknown",
|
|
29
|
+
assessed_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
30
|
+
notes: options.notes
|
|
31
|
+
});
|
|
32
|
+
if (success) {
|
|
33
|
+
const verdictColors = {
|
|
34
|
+
correct: chalk.green,
|
|
35
|
+
partial: chalk.yellow,
|
|
36
|
+
incorrect: chalk.red
|
|
37
|
+
};
|
|
38
|
+
const colorFn = verdictColors[verdict] || chalk.white;
|
|
39
|
+
console.log(chalk.green(`
|
|
40
|
+
Assessment recorded for ${id}`));
|
|
41
|
+
console.log(` Verdict: ${colorFn(verdict)}`);
|
|
42
|
+
if (entry.confidence != null) {
|
|
43
|
+
const impliedScore = verdict === "correct" ? 1 : verdict === "partial" ? 0.5 : 0;
|
|
44
|
+
const delta = impliedScore - entry.confidence;
|
|
45
|
+
const deltaStr = `${delta > 0 ? "+" : ""}${delta.toFixed(2)}`;
|
|
46
|
+
const deltaColor = Math.abs(delta) <= 0.1 ? chalk.green : Math.abs(delta) <= 0.3 ? chalk.yellow : chalk.red;
|
|
47
|
+
console.log(` Confidence: ${entry.confidence.toFixed(2)} | Delta: ${deltaColor(deltaStr)}`);
|
|
48
|
+
if (delta > 0.1) {
|
|
49
|
+
console.log(chalk.gray(" Under-confident (outcome better than predicted)"));
|
|
50
|
+
} else if (delta < -0.1) {
|
|
51
|
+
console.log(chalk.gray(" Over-confident (outcome worse than predicted)"));
|
|
52
|
+
} else {
|
|
53
|
+
console.log(chalk.gray(" Well-calibrated"));
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
console.log(chalk.gray(" No confidence recorded \u2014 delta not computed"));
|
|
57
|
+
}
|
|
58
|
+
console.log();
|
|
59
|
+
} else {
|
|
60
|
+
console.error(chalk.red(`
|
|
61
|
+
Failed to assess entry: ${id}
|
|
62
|
+
`));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
loreAssessCommand
|
|
68
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
loadLoreEntries
|
|
4
|
+
} from "./chunk-QIOCFXDQ.js";
|
|
5
|
+
import "./chunk-ZXMDA7VB.js";
|
|
6
|
+
|
|
7
|
+
// src/commands/lore/calibration.ts
|
|
8
|
+
import chalk from "chalk";
|
|
9
|
+
async function loreCalibrationCommand(options) {
|
|
10
|
+
const rootDir = process.cwd();
|
|
11
|
+
const entries = await loadLoreEntries(rootDir, {
|
|
12
|
+
symbol: options.symbol,
|
|
13
|
+
tag: options.tag,
|
|
14
|
+
author: options.author,
|
|
15
|
+
hasAssessment: true
|
|
16
|
+
});
|
|
17
|
+
if (entries.length === 0) {
|
|
18
|
+
if (options.json) {
|
|
19
|
+
console.log(JSON.stringify({ totalAssessed: 0, message: "No assessed entries found" }, null, 2));
|
|
20
|
+
} else {
|
|
21
|
+
console.log(chalk.gray("\n No assessed lore entries found.\n"));
|
|
22
|
+
console.log(chalk.gray(" Use `paradigm lore assess <id> <correct|partial|incorrect>` to assess entries.\n"));
|
|
23
|
+
}
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const withConfidence = entries.filter((e) => e.confidence != null);
|
|
27
|
+
const totalAssessed = entries.length;
|
|
28
|
+
const totalWithConfidence = withConfidence.length;
|
|
29
|
+
const verdictBreakdown = { correct: 0, partial: 0, incorrect: 0 };
|
|
30
|
+
let totalImpliedScore = 0;
|
|
31
|
+
let totalConfidence = 0;
|
|
32
|
+
let totalAbsDelta = 0;
|
|
33
|
+
for (const e of entries) {
|
|
34
|
+
const v = e.assessment.verdict;
|
|
35
|
+
verdictBreakdown[v]++;
|
|
36
|
+
const implied = v === "correct" ? 1 : v === "partial" ? 0.5 : 0;
|
|
37
|
+
totalImpliedScore += implied;
|
|
38
|
+
if (e.confidence != null) {
|
|
39
|
+
totalConfidence += e.confidence;
|
|
40
|
+
totalAbsDelta += Math.abs(implied - e.confidence);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const accuracyRate = totalImpliedScore / totalAssessed;
|
|
44
|
+
const avgConfidence = totalWithConfidence > 0 ? totalConfidence / totalWithConfidence : null;
|
|
45
|
+
const calibrationScore = totalWithConfidence > 0 ? 1 - totalAbsDelta / totalWithConfidence : null;
|
|
46
|
+
let groups;
|
|
47
|
+
if (options.groupBy && totalAssessed > 0) {
|
|
48
|
+
const groupMap = /* @__PURE__ */ new Map();
|
|
49
|
+
for (const e of entries) {
|
|
50
|
+
let keys = [];
|
|
51
|
+
if (options.groupBy === "symbol") {
|
|
52
|
+
keys = e.symbols_touched || [];
|
|
53
|
+
} else if (options.groupBy === "tag") {
|
|
54
|
+
keys = e.tags || [];
|
|
55
|
+
} else if (options.groupBy === "type") {
|
|
56
|
+
keys = [e.type || "agent-session"];
|
|
57
|
+
}
|
|
58
|
+
for (const key of keys) {
|
|
59
|
+
if (!groupMap.has(key)) groupMap.set(key, []);
|
|
60
|
+
groupMap.get(key).push(e);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
groups = Array.from(groupMap.entries()).map(([key, gEntries]) => {
|
|
64
|
+
const gWithConf = gEntries.filter((e) => e.confidence != null);
|
|
65
|
+
const gBreakdown = { correct: 0, partial: 0, incorrect: 0 };
|
|
66
|
+
let gImplied = 0;
|
|
67
|
+
let gConf = 0;
|
|
68
|
+
let gAbsDelta = 0;
|
|
69
|
+
for (const e of gEntries) {
|
|
70
|
+
const v = e.assessment.verdict;
|
|
71
|
+
gBreakdown[v]++;
|
|
72
|
+
const implied = v === "correct" ? 1 : v === "partial" ? 0.5 : 0;
|
|
73
|
+
gImplied += implied;
|
|
74
|
+
if (e.confidence != null) {
|
|
75
|
+
gConf += e.confidence;
|
|
76
|
+
gAbsDelta += Math.abs(implied - e.confidence);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
key,
|
|
81
|
+
total: gEntries.length,
|
|
82
|
+
accuracyRate: gImplied / gEntries.length,
|
|
83
|
+
avgConfidence: gWithConf.length > 0 ? gConf / gWithConf.length : null,
|
|
84
|
+
calibrationScore: gWithConf.length > 0 ? 1 - gAbsDelta / gWithConf.length : null,
|
|
85
|
+
verdictBreakdown: gBreakdown
|
|
86
|
+
};
|
|
87
|
+
}).sort((a, b) => b.total - a.total);
|
|
88
|
+
}
|
|
89
|
+
if (options.json) {
|
|
90
|
+
console.log(JSON.stringify({
|
|
91
|
+
totalAssessed,
|
|
92
|
+
totalWithConfidence,
|
|
93
|
+
accuracyRate: Math.round(accuracyRate * 1e3) / 1e3,
|
|
94
|
+
avgConfidence: avgConfidence != null ? Math.round(avgConfidence * 1e3) / 1e3 : null,
|
|
95
|
+
calibrationScore: calibrationScore != null ? Math.round(calibrationScore * 1e3) / 1e3 : null,
|
|
96
|
+
verdictBreakdown,
|
|
97
|
+
...groups ? { groups } : {}
|
|
98
|
+
}, null, 2));
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const caveat = totalAssessed < 5 ? chalk.gray(` (Low sample: N=${totalAssessed}. Stats may not be representative.)`) : totalAssessed < 15 ? chalk.gray(` (Moderate sample: N=${totalAssessed}. Trends are directional.)`) : "";
|
|
102
|
+
console.log(chalk.magenta(`
|
|
103
|
+
Calibration Report (${totalAssessed} assessed entries)
|
|
104
|
+
`));
|
|
105
|
+
if (caveat) console.log(caveat + "\n");
|
|
106
|
+
const total = totalAssessed;
|
|
107
|
+
console.log(chalk.white(" Verdicts:"));
|
|
108
|
+
console.log(` ${chalk.green("correct")}: ${verdictBreakdown.correct}/${total} (${(verdictBreakdown.correct / total * 100).toFixed(0)}%)`);
|
|
109
|
+
console.log(` ${chalk.yellow("partial")}: ${verdictBreakdown.partial}/${total} (${(verdictBreakdown.partial / total * 100).toFixed(0)}%)`);
|
|
110
|
+
console.log(` ${chalk.red("incorrect")}: ${verdictBreakdown.incorrect}/${total} (${(verdictBreakdown.incorrect / total * 100).toFixed(0)}%)`);
|
|
111
|
+
console.log();
|
|
112
|
+
console.log(chalk.white(" Scores:"));
|
|
113
|
+
const accColor = accuracyRate >= 0.8 ? chalk.green : accuracyRate >= 0.5 ? chalk.yellow : chalk.red;
|
|
114
|
+
console.log(` Accuracy rate: ${accColor(accuracyRate.toFixed(3))}`);
|
|
115
|
+
if (avgConfidence != null) {
|
|
116
|
+
console.log(` Avg confidence: ${avgConfidence.toFixed(3)}`);
|
|
117
|
+
}
|
|
118
|
+
if (calibrationScore != null) {
|
|
119
|
+
const calColor = calibrationScore >= 0.9 ? chalk.green : calibrationScore >= 0.7 ? chalk.yellow : chalk.red;
|
|
120
|
+
console.log(` Calibration: ${calColor(calibrationScore.toFixed(3))} (1.0 = perfect)`);
|
|
121
|
+
}
|
|
122
|
+
console.log();
|
|
123
|
+
if (groups && groups.length > 0) {
|
|
124
|
+
console.log(chalk.white(` By ${options.groupBy}:`));
|
|
125
|
+
for (const g of groups.slice(0, 15)) {
|
|
126
|
+
const gAccColor = g.accuracyRate >= 0.8 ? chalk.green : g.accuracyRate >= 0.5 ? chalk.yellow : chalk.red;
|
|
127
|
+
const calStr = g.calibrationScore != null ? ` cal:${g.calibrationScore.toFixed(2)}` : "";
|
|
128
|
+
console.log(` ${chalk.cyan(g.key.padEnd(25))} ${gAccColor(`acc:${g.accuracyRate.toFixed(2)}`)}${calStr} (${g.verdictBreakdown.correct}/${g.verdictBreakdown.partial}/${g.verdictBreakdown.incorrect}) N=${g.total}`);
|
|
129
|
+
}
|
|
130
|
+
console.log();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
loreCalibrationCommand
|
|
135
|
+
};
|
|
@@ -423,6 +423,96 @@ async function doctorCommand(options = {}) {
|
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
+
const universityDir = path.join(cwd, ".paradigm", "university");
|
|
427
|
+
if (fs.existsSync(universityDir)) {
|
|
428
|
+
try {
|
|
429
|
+
const contentDir = path.join(universityDir, "content");
|
|
430
|
+
let contentCount = 0;
|
|
431
|
+
let issues = 0;
|
|
432
|
+
if (fs.existsSync(contentDir)) {
|
|
433
|
+
for (const subdir of ["notes", "policies", "quizzes", "paths"]) {
|
|
434
|
+
const sd = path.join(contentDir, subdir);
|
|
435
|
+
if (fs.existsSync(sd)) {
|
|
436
|
+
contentCount += fs.readdirSync(sd).filter((f) => f.endsWith(".md") || f.endsWith(".yaml")).length;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
if (contentCount === 0) {
|
|
441
|
+
results.push({
|
|
442
|
+
name: "University content",
|
|
443
|
+
status: "warn",
|
|
444
|
+
message: "University directory exists but no content found",
|
|
445
|
+
fix: 'Add content: paradigm university add note --title "Getting Started"'
|
|
446
|
+
});
|
|
447
|
+
} else {
|
|
448
|
+
const quizDir = path.join(contentDir, "quizzes");
|
|
449
|
+
if (fs.existsSync(quizDir)) {
|
|
450
|
+
for (const file of fs.readdirSync(quizDir).filter((f) => f.endsWith(".yaml"))) {
|
|
451
|
+
try {
|
|
452
|
+
const { parse } = await import("./dist-PSF5CP4I.js");
|
|
453
|
+
const quiz = parse(fs.readFileSync(path.join(quizDir, file), "utf8"));
|
|
454
|
+
if (quiz?.questions) {
|
|
455
|
+
for (const q of quiz.questions) {
|
|
456
|
+
if (q.choices && q.correct && !(q.correct in q.choices)) {
|
|
457
|
+
issues++;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
} catch {
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
const pathDir = path.join(contentDir, "paths");
|
|
466
|
+
if (fs.existsSync(pathDir)) {
|
|
467
|
+
for (const file of fs.readdirSync(pathDir).filter((f) => f.endsWith(".yaml"))) {
|
|
468
|
+
try {
|
|
469
|
+
const { parse } = await import("./dist-PSF5CP4I.js");
|
|
470
|
+
const lp = parse(fs.readFileSync(path.join(pathDir, file), "utf8"));
|
|
471
|
+
if (lp?.steps) {
|
|
472
|
+
for (const step of lp.steps) {
|
|
473
|
+
if (step.content && !step.content.startsWith("plsat:")) {
|
|
474
|
+
let found = false;
|
|
475
|
+
for (const sd of ["notes", "policies", "quizzes", "paths"]) {
|
|
476
|
+
const sdPath = path.join(contentDir, sd);
|
|
477
|
+
if (fs.existsSync(sdPath)) {
|
|
478
|
+
const files = fs.readdirSync(sdPath);
|
|
479
|
+
if (files.some((f) => f.startsWith(step.content))) {
|
|
480
|
+
found = true;
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
if (!found) issues++;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
} catch {
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
if (issues > 0) {
|
|
494
|
+
results.push({
|
|
495
|
+
name: "University content",
|
|
496
|
+
status: "warn",
|
|
497
|
+
message: `${contentCount} items, ${issues} issue${issues > 1 ? "s" : ""}`,
|
|
498
|
+
fix: "Run: paradigm university validate --deep"
|
|
499
|
+
});
|
|
500
|
+
} else {
|
|
501
|
+
results.push({
|
|
502
|
+
name: "University content",
|
|
503
|
+
status: "ok",
|
|
504
|
+
message: `${contentCount} content item${contentCount > 1 ? "s" : ""}`
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
} catch {
|
|
509
|
+
results.push({
|
|
510
|
+
name: "University content",
|
|
511
|
+
status: "warn",
|
|
512
|
+
message: "Could not read university directory"
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
}
|
|
426
516
|
const hooksJsonPath = path.join(cwd, ".claude", "hooks.json");
|
|
427
517
|
const pluginHooksPath = path.join(cwd, "plugins", "paradigm", "hooks.json");
|
|
428
518
|
if (fs.existsSync(hooksJsonPath)) {
|
|
@@ -543,7 +633,7 @@ async function doctorCommand(options = {}) {
|
|
|
543
633
|
}
|
|
544
634
|
}
|
|
545
635
|
}
|
|
546
|
-
const { runContextAudit } = await import("./context-audit-
|
|
636
|
+
const { runContextAudit } = await import("./context-audit-557EO6PK.js");
|
|
547
637
|
const contextResults = await runContextAudit(cwd, { quiet });
|
|
548
638
|
let contextErrorCount = 0;
|
|
549
639
|
let contextWarnCount = 0;
|
|
@@ -34,6 +34,20 @@ function generateScanIndex(input, options) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
const typeCounts = {};
|
|
38
|
+
for (const comp of Object.values(index.components)) {
|
|
39
|
+
if (comp.componentType) {
|
|
40
|
+
typeCounts[comp.componentType] = (typeCounts[comp.componentType] || 0) + 1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
for (const feat of Object.values(index.features)) {
|
|
44
|
+
if (feat.componentType) {
|
|
45
|
+
typeCounts[feat.componentType] = (typeCounts[feat.componentType] || 0) + 1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (Object.keys(typeCounts).length > 0) {
|
|
49
|
+
index.$meta.componentTypes = typeCounts;
|
|
50
|
+
}
|
|
37
51
|
buildScreenReferences(index);
|
|
38
52
|
return index;
|
|
39
53
|
}
|
|
@@ -89,7 +103,9 @@ function addComponent(symbol, index, options) {
|
|
|
89
103
|
path: symbol.filePath,
|
|
90
104
|
description: symbol.description,
|
|
91
105
|
visualTags,
|
|
92
|
-
related: symbol.references
|
|
106
|
+
related: symbol.references,
|
|
107
|
+
componentType: symbol.componentType,
|
|
108
|
+
parent: symbol.parentSymbol
|
|
93
109
|
};
|
|
94
110
|
index.components[id] = element;
|
|
95
111
|
index.symbolMap[symbol.symbol] = { category: "components", id };
|
|
@@ -105,7 +121,9 @@ function addFeature(symbol, index, options) {
|
|
|
105
121
|
path: symbol.filePath,
|
|
106
122
|
description: symbol.description,
|
|
107
123
|
visualTags,
|
|
108
|
-
related: symbol.references
|
|
124
|
+
related: symbol.references,
|
|
125
|
+
componentType: symbol.componentType,
|
|
126
|
+
parent: symbol.parentSymbol
|
|
109
127
|
};
|
|
110
128
|
index.features[id] = element;
|
|
111
129
|
index.symbolMap[symbol.symbol] = { category: "features", id };
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
generateScanIndex,
|
|
4
4
|
serializeScanIndex
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-36TKPM5Z.js";
|
|
6
6
|
import {
|
|
7
7
|
aggregateFromDirectory
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZGUAAVMA.js";
|
|
9
9
|
import {
|
|
10
10
|
cliBuildGraphState
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QDXI2DHR.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/scan/navigator.ts
|
|
14
14
|
import * as fs from "fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
SentinelStorage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YW5OCVKB.js";
|
|
5
5
|
|
|
6
6
|
// ../sentinel/dist/chunk-VQ3SIN7S.js
|
|
7
7
|
import { v4 as uuidv4 } from "uuid";
|
|
@@ -2578,150 +2578,6 @@ var PatternImporter = class {
|
|
|
2578
2578
|
};
|
|
2579
2579
|
}
|
|
2580
2580
|
};
|
|
2581
|
-
var PARADIGM_SCHEMA = {
|
|
2582
|
-
id: "paradigm-logger",
|
|
2583
|
-
version: "1.0.0",
|
|
2584
|
-
name: "Paradigm Logger",
|
|
2585
|
-
description: "Structured logs from @a-company/paradigm-logger with symbolic context",
|
|
2586
|
-
scope: {
|
|
2587
|
-
field: "correlationId",
|
|
2588
|
-
type: "string",
|
|
2589
|
-
label: "Correlation",
|
|
2590
|
-
ordering: "independent",
|
|
2591
|
-
sessionField: "sessionId"
|
|
2592
|
-
},
|
|
2593
|
-
eventTypes: [
|
|
2594
|
-
{
|
|
2595
|
-
type: "log:debug",
|
|
2596
|
-
category: "logs",
|
|
2597
|
-
label: "Debug Log",
|
|
2598
|
-
severity: "debug",
|
|
2599
|
-
frequency: "high",
|
|
2600
|
-
fields: [
|
|
2601
|
-
{ name: "symbol", type: "string", indexed: true, display: true },
|
|
2602
|
-
{ name: "symbolType", type: "string", indexed: true, display: true },
|
|
2603
|
-
{ name: "message", type: "string", display: true },
|
|
2604
|
-
{ name: "service", type: "string", indexed: true, display: true },
|
|
2605
|
-
{ name: "durationMs", type: "number", display: true }
|
|
2606
|
-
]
|
|
2607
|
-
},
|
|
2608
|
-
{
|
|
2609
|
-
type: "log:info",
|
|
2610
|
-
category: "logs",
|
|
2611
|
-
label: "Info Log",
|
|
2612
|
-
severity: "info",
|
|
2613
|
-
frequency: "high",
|
|
2614
|
-
fields: [
|
|
2615
|
-
{ name: "symbol", type: "string", indexed: true, display: true },
|
|
2616
|
-
{ name: "symbolType", type: "string", indexed: true, display: true },
|
|
2617
|
-
{ name: "message", type: "string", display: true },
|
|
2618
|
-
{ name: "service", type: "string", indexed: true, display: true },
|
|
2619
|
-
{ name: "durationMs", type: "number", display: true }
|
|
2620
|
-
]
|
|
2621
|
-
},
|
|
2622
|
-
{
|
|
2623
|
-
type: "log:warn",
|
|
2624
|
-
category: "logs",
|
|
2625
|
-
label: "Warning Log",
|
|
2626
|
-
severity: "warn",
|
|
2627
|
-
frequency: "medium",
|
|
2628
|
-
fields: [
|
|
2629
|
-
{ name: "symbol", type: "string", indexed: true, display: true },
|
|
2630
|
-
{ name: "symbolType", type: "string", indexed: true, display: true },
|
|
2631
|
-
{ name: "message", type: "string", display: true },
|
|
2632
|
-
{ name: "service", type: "string", indexed: true, display: true }
|
|
2633
|
-
]
|
|
2634
|
-
},
|
|
2635
|
-
{
|
|
2636
|
-
type: "log:error",
|
|
2637
|
-
category: "logs",
|
|
2638
|
-
label: "Error Log",
|
|
2639
|
-
severity: "error",
|
|
2640
|
-
frequency: "low",
|
|
2641
|
-
fields: [
|
|
2642
|
-
{ name: "symbol", type: "string", indexed: true, display: true },
|
|
2643
|
-
{ name: "symbolType", type: "string", indexed: true, display: true },
|
|
2644
|
-
{ name: "message", type: "string", display: true },
|
|
2645
|
-
{ name: "service", type: "string", indexed: true, display: true }
|
|
2646
|
-
]
|
|
2647
|
-
},
|
|
2648
|
-
{
|
|
2649
|
-
type: "metric:counter",
|
|
2650
|
-
category: "metrics",
|
|
2651
|
-
label: "Counter Metric",
|
|
2652
|
-
severity: "info",
|
|
2653
|
-
frequency: "high",
|
|
2654
|
-
fields: [
|
|
2655
|
-
{ name: "name", type: "string", indexed: true, display: true },
|
|
2656
|
-
{ name: "value", type: "number", display: true },
|
|
2657
|
-
{ name: "tags", type: "object" }
|
|
2658
|
-
]
|
|
2659
|
-
},
|
|
2660
|
-
{
|
|
2661
|
-
type: "metric:gauge",
|
|
2662
|
-
category: "metrics",
|
|
2663
|
-
label: "Gauge Metric",
|
|
2664
|
-
severity: "info",
|
|
2665
|
-
frequency: "medium",
|
|
2666
|
-
fields: [
|
|
2667
|
-
{ name: "name", type: "string", indexed: true, display: true },
|
|
2668
|
-
{ name: "value", type: "number", display: true },
|
|
2669
|
-
{ name: "tags", type: "object" }
|
|
2670
|
-
]
|
|
2671
|
-
},
|
|
2672
|
-
{
|
|
2673
|
-
type: "metric:histogram",
|
|
2674
|
-
category: "metrics",
|
|
2675
|
-
label: "Histogram Metric",
|
|
2676
|
-
severity: "info",
|
|
2677
|
-
frequency: "medium",
|
|
2678
|
-
fields: [
|
|
2679
|
-
{ name: "name", type: "string", indexed: true, display: true },
|
|
2680
|
-
{ name: "value", type: "number", display: true },
|
|
2681
|
-
{ name: "tags", type: "object" }
|
|
2682
|
-
]
|
|
2683
|
-
},
|
|
2684
|
-
{
|
|
2685
|
-
type: "trace:span",
|
|
2686
|
-
category: "traces",
|
|
2687
|
-
label: "Trace Span",
|
|
2688
|
-
severity: "info",
|
|
2689
|
-
frequency: "medium",
|
|
2690
|
-
fields: [
|
|
2691
|
-
{ name: "traceId", type: "string", indexed: true, display: true },
|
|
2692
|
-
{ name: "spanId", type: "string", indexed: true },
|
|
2693
|
-
{ name: "operation", type: "string", display: true },
|
|
2694
|
-
{ name: "durationMs", type: "number", display: true },
|
|
2695
|
-
{ name: "status", type: "string", display: true }
|
|
2696
|
-
]
|
|
2697
|
-
},
|
|
2698
|
-
{
|
|
2699
|
-
type: "incident:recorded",
|
|
2700
|
-
category: "incidents",
|
|
2701
|
-
label: "Incident Recorded",
|
|
2702
|
-
severity: "error",
|
|
2703
|
-
frequency: "low",
|
|
2704
|
-
fields: [
|
|
2705
|
-
{ name: "incidentId", type: "string", indexed: true, display: true },
|
|
2706
|
-
{ name: "errorMessage", type: "string", display: true },
|
|
2707
|
-
{ name: "symbols", type: "object" },
|
|
2708
|
-
{ name: "environment", type: "string", display: true }
|
|
2709
|
-
]
|
|
2710
|
-
}
|
|
2711
|
-
],
|
|
2712
|
-
visualization: {
|
|
2713
|
-
defaultView: "table",
|
|
2714
|
-
categoryColors: {
|
|
2715
|
-
logs: "#3b82f6",
|
|
2716
|
-
metrics: "#22c55e",
|
|
2717
|
-
traces: "#a855f7",
|
|
2718
|
-
incidents: "#ef4444"
|
|
2719
|
-
},
|
|
2720
|
-
summaryFields: ["symbol", "message", "service"],
|
|
2721
|
-
defaultExcluded: ["log:debug"]
|
|
2722
|
-
},
|
|
2723
|
-
tags: ["builtin", "paradigm"]
|
|
2724
|
-
};
|
|
2725
2581
|
|
|
2726
2582
|
export {
|
|
2727
2583
|
SentinelClient,
|
|
@@ -2742,6 +2598,5 @@ export {
|
|
|
2742
2598
|
StatsCalculator,
|
|
2743
2599
|
ContextEnricher,
|
|
2744
2600
|
PatternSuggester,
|
|
2745
|
-
PatternImporter
|
|
2746
|
-
PARADIGM_SCHEMA
|
|
2601
|
+
PatternImporter
|
|
2747
2602
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
indexCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7COU5S2Z.js";
|
|
5
5
|
import {
|
|
6
6
|
getDefaultPremiseContent
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZGUAAVMA.js";
|
|
8
8
|
import {
|
|
9
9
|
getDefaultPurposeContent
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EDOAWN7J.js";
|
|
11
11
|
import {
|
|
12
12
|
STACK_PRESETS,
|
|
13
13
|
detectDiscipline,
|