@a-company/paradigm 5.4.0 → 5.5.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/{agent-loader-SJPJJS33.js → agent-loader-DBF4OARL.js} +1 -1
- package/dist/{chunk-ICSLIPUS.js → chunk-B2RC3HEB.js} +17 -9
- package/dist/{chunk-A2L4TSLZ.js → chunk-ITPJJIHG.js} +6 -3
- package/dist/chunk-SDDCVUCV.js +106 -0
- package/dist/{chunk-7HRBT23N.js → chunk-SU3WDCRR.js} +10 -1
- package/dist/mcp.js +192 -42
- package/dist/{nomination-engine-HDWMN4IO.js → nomination-engine-LPLCCDW2.js} +2 -2
- package/dist/{reindex-65H4WULU.js → reindex-J5SEDVTT.js} +2 -1
- package/dist/session-work-log-KDOH4GER.js +20 -0
- package/dist/university-content/courses/para-601.json +170 -141
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
loadAgentProfile,
|
|
5
5
|
loadAllAgentProfiles,
|
|
6
6
|
saveAgentProfile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ITPJJIHG.js";
|
|
8
8
|
import {
|
|
9
9
|
init_journal_loader,
|
|
10
10
|
journal_loader_exports
|
|
@@ -686,7 +686,7 @@ function loadDebates(rootDir) {
|
|
|
686
686
|
return [];
|
|
687
687
|
}
|
|
688
688
|
}
|
|
689
|
-
function engageNomination(rootDir, nominationId, response) {
|
|
689
|
+
function engageNomination(rootDir, nominationId, response, reason) {
|
|
690
690
|
const filePath = getNominationsPath(rootDir);
|
|
691
691
|
if (!fs4.existsSync(filePath)) return false;
|
|
692
692
|
try {
|
|
@@ -699,6 +699,7 @@ function engageNomination(rootDir, nominationId, response) {
|
|
|
699
699
|
if (nom.id === nominationId) {
|
|
700
700
|
nom.engaged = true;
|
|
701
701
|
nom.response = response;
|
|
702
|
+
if (reason) nom.reason = reason;
|
|
702
703
|
found = true;
|
|
703
704
|
return JSON.stringify(nom);
|
|
704
705
|
}
|
|
@@ -847,8 +848,12 @@ function adjustAttentionFromFeedback(rootDir, agentId) {
|
|
|
847
848
|
return { adjusted: false, oldThreshold: 0.6, newThreshold: 0.6, reason: "No attention config" };
|
|
848
849
|
}
|
|
849
850
|
const oldThreshold = profile.attention.threshold ?? 0.6;
|
|
850
|
-
const
|
|
851
|
-
const
|
|
851
|
+
const STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
852
|
+
const allNominations = loadNominations(rootDir, { agent: agentId });
|
|
853
|
+
const active = allNominations.filter(
|
|
854
|
+
(n) => n.engaged || Date.now() - new Date(n.timestamp).getTime() < STALE_THRESHOLD_MS
|
|
855
|
+
);
|
|
856
|
+
const engaged = active.filter((n) => n.engaged);
|
|
852
857
|
if (engaged.length < 5) {
|
|
853
858
|
return { adjusted: false, oldThreshold, newThreshold: oldThreshold, reason: `Insufficient data (${engaged.length}/5 engaged nominations)` };
|
|
854
859
|
}
|
|
@@ -882,7 +887,11 @@ function adjustAttentionFromFeedback(rootDir, agentId) {
|
|
|
882
887
|
return { adjusted: true, oldThreshold, newThreshold, reason };
|
|
883
888
|
}
|
|
884
889
|
function getNominationStats(rootDir, agentId) {
|
|
885
|
-
const
|
|
890
|
+
const STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
891
|
+
const allNominations = loadNominations(rootDir, { agent: agentId });
|
|
892
|
+
const nominations = allNominations.filter(
|
|
893
|
+
(n) => n.engaged || Date.now() - new Date(n.timestamp).getTime() < STALE_THRESHOLD_MS
|
|
894
|
+
);
|
|
886
895
|
const accepted = nominations.filter((n) => n.response === "accepted").length;
|
|
887
896
|
const dismissed = nominations.filter((n) => n.response === "dismissed").length;
|
|
888
897
|
const deferred = nominations.filter((n) => n.response === "deferred").length;
|
|
@@ -987,10 +996,9 @@ function autoPromoteJournalEntries(rootDir, agentId) {
|
|
|
987
996
|
} catch {
|
|
988
997
|
return { promoted: 0, entries: [] };
|
|
989
998
|
}
|
|
990
|
-
const
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
});
|
|
999
|
+
const patternEntries = loadJournalEntries(agentId, { trigger: "pattern_discovered", limit: 100 });
|
|
1000
|
+
const feedbackEntries = loadJournalEntries(agentId, { trigger: "human_feedback", limit: 100 });
|
|
1001
|
+
const journal = [...patternEntries, ...feedbackEntries];
|
|
994
1002
|
const promoted = [];
|
|
995
1003
|
for (const entry of journal) {
|
|
996
1004
|
if (entry.promoted_to_notebook) continue;
|
|
@@ -13,21 +13,24 @@ var init_agents = __esm({
|
|
|
13
13
|
builder: { style: "rapid", risk: "balanced", verbosity: "concise" },
|
|
14
14
|
tester: { style: "methodical", risk: "conservative", verbosity: "concise" },
|
|
15
15
|
reviewer: { style: "deliberate", risk: "conservative", verbosity: "detailed" },
|
|
16
|
-
security: { style: "methodical", risk: "conservative", verbosity: "detailed" }
|
|
16
|
+
security: { style: "methodical", risk: "conservative", verbosity: "detailed" },
|
|
17
|
+
documentor: { style: "methodical", risk: "conservative", verbosity: "concise" }
|
|
17
18
|
};
|
|
18
19
|
DEFAULT_ATTENTION = {
|
|
19
20
|
architect: { symbols: ["$*", "#*"], concepts: ["architecture", "design", "pattern", "refactor"], signals: [{ type: "flow-modified" }, { type: "compliance-violation" }], threshold: 0.5 },
|
|
20
21
|
builder: { paths: ["src/**", "lib/**", "packages/**"], signals: [{ type: "file-modified" }, { type: "error-encountered" }], threshold: 0.7 },
|
|
21
22
|
reviewer: { concepts: ["code quality", "bug", "smell", "convention"], signals: [{ type: "compliance-violation" }], threshold: 0.6 },
|
|
22
23
|
tester: { paths: ["**/*.test.*", "**/*.spec.*"], concepts: ["test", "coverage", "assertion"], signals: [{ type: "error-encountered" }, { type: "test-result" }], threshold: 0.5 },
|
|
23
|
-
security: { symbols: ["^*", "#*-auth", "#*-middleware"], paths: ["auth/**", "middleware/**", "guards/**"], concepts: ["permission", "JWT", "session", "RBAC", "XSS", "injection"], signals: [{ type: "gate-added" }, { type: "route-created" }, { type: "gate-checked" }, { type: "compliance-violation" }], threshold: 0.4 }
|
|
24
|
+
security: { symbols: ["^*", "#*-auth", "#*-middleware"], paths: ["auth/**", "middleware/**", "guards/**"], concepts: ["permission", "JWT", "session", "RBAC", "XSS", "injection"], signals: [{ type: "gate-added" }, { type: "route-created" }, { type: "gate-checked" }, { type: "compliance-violation" }], threshold: 0.4 },
|
|
25
|
+
documentor: { paths: ["**/.purpose", "**/portal.yaml", ".paradigm/**"], concepts: ["purpose", "portal", "symbol", "documentation", "component", "gate", "flow"], signals: [{ type: "file-modified" }, { type: "compliance-violation" }, { type: "work-completed" }], threshold: 0.3 }
|
|
24
26
|
};
|
|
25
27
|
DEFAULT_COLLABORATION = {
|
|
26
28
|
architect: { stance: "lead", debate: { will_challenge: true, evidence_required: true, escalate_to_human: true } },
|
|
27
29
|
builder: { stance: "supportive", with: { architect: { stance: "supportive", can_contradict: false } } },
|
|
28
30
|
reviewer: { stance: "advisory", debate: { will_challenge: true, evidence_required: true, escalate_to_human: true } },
|
|
29
31
|
tester: { stance: "supportive", debate: { will_challenge: false, evidence_required: true, escalate_to_human: false } },
|
|
30
|
-
security: { stance: "advisory", with: { architect: { stance: "peer", can_contradict: true }, builder: { stance: "advisory", review_output: true } }, debate: { will_challenge: true, evidence_required: true, escalate_to_human: true } }
|
|
32
|
+
security: { stance: "advisory", with: { architect: { stance: "peer", can_contradict: true }, builder: { stance: "advisory", review_output: true } }, debate: { will_challenge: true, evidence_required: true, escalate_to_human: true } },
|
|
33
|
+
documentor: { stance: "supportive", with: { architect: { stance: "supportive" }, builder: { stance: "supportive" }, reviewer: { stance: "supportive" }, security: { stance: "supportive" } }, debate: { will_challenge: false, evidence_required: false, escalate_to_human: false } }
|
|
31
34
|
};
|
|
32
35
|
}
|
|
33
36
|
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
__esm,
|
|
4
|
+
__export
|
|
5
|
+
} from "./chunk-7N7GSU6K.js";
|
|
6
|
+
|
|
7
|
+
// ../paradigm-mcp/src/utils/session-work-log.ts
|
|
8
|
+
var session_work_log_exports = {};
|
|
9
|
+
__export(session_work_log_exports, {
|
|
10
|
+
appendSessionWorkEntry: () => appendSessionWorkEntry,
|
|
11
|
+
clearSessionWorkLog: () => clearSessionWorkLog,
|
|
12
|
+
getAgentEntries: () => getAgentEntries,
|
|
13
|
+
getAgentVerdicts: () => getAgentVerdicts,
|
|
14
|
+
getContributingAgents: () => getContributingAgents,
|
|
15
|
+
readSessionWorkLog: () => readSessionWorkLog
|
|
16
|
+
});
|
|
17
|
+
import * as fs from "fs";
|
|
18
|
+
import * as path from "path";
|
|
19
|
+
function appendSessionWorkEntry(rootDir, entry) {
|
|
20
|
+
try {
|
|
21
|
+
const filePath = path.join(rootDir, SESSION_LOG_FILE);
|
|
22
|
+
const dir = path.dirname(filePath);
|
|
23
|
+
if (!fs.existsSync(dir)) {
|
|
24
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
25
|
+
}
|
|
26
|
+
if (fs.existsSync(filePath)) {
|
|
27
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
28
|
+
const lineCount = content.trim().split("\n").filter((l) => l.trim()).length;
|
|
29
|
+
if (lineCount >= MAX_ENTRIES) return;
|
|
30
|
+
}
|
|
31
|
+
const line = JSON.stringify(entry) + "\n";
|
|
32
|
+
fs.appendFileSync(filePath, line, "utf8");
|
|
33
|
+
} catch {
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function readSessionWorkLog(rootDir) {
|
|
37
|
+
try {
|
|
38
|
+
const filePath = path.join(rootDir, SESSION_LOG_FILE);
|
|
39
|
+
if (!fs.existsSync(filePath)) return [];
|
|
40
|
+
return fs.readFileSync(filePath, "utf8").trim().split("\n").filter((line) => line.trim()).map((line) => {
|
|
41
|
+
try {
|
|
42
|
+
return JSON.parse(line);
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}).filter((e) => e !== null);
|
|
47
|
+
} catch {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function clearSessionWorkLog(rootDir) {
|
|
52
|
+
try {
|
|
53
|
+
const filePath = path.join(rootDir, SESSION_LOG_FILE);
|
|
54
|
+
if (fs.existsSync(filePath)) {
|
|
55
|
+
fs.writeFileSync(filePath, "", "utf8");
|
|
56
|
+
}
|
|
57
|
+
} catch {
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function getContributingAgents(rootDir) {
|
|
61
|
+
const entries = readSessionWorkLog(rootDir);
|
|
62
|
+
const agents = /* @__PURE__ */ new Set();
|
|
63
|
+
for (const entry of entries) {
|
|
64
|
+
if (entry.agent) agents.add(entry.agent);
|
|
65
|
+
}
|
|
66
|
+
return Array.from(agents);
|
|
67
|
+
}
|
|
68
|
+
function getAgentEntries(rootDir, agentId) {
|
|
69
|
+
return readSessionWorkLog(rootDir).filter((e) => e.agent === agentId);
|
|
70
|
+
}
|
|
71
|
+
function getAgentVerdicts(rootDir, agentId) {
|
|
72
|
+
const entries = getAgentEntries(rootDir, agentId);
|
|
73
|
+
const contributions = entries.filter((e) => e.type === "agent-contribution");
|
|
74
|
+
const verdicts = entries.filter((e) => e.type === "user-verdict");
|
|
75
|
+
const pairs = [];
|
|
76
|
+
for (const contrib of contributions) {
|
|
77
|
+
pairs.push({ contribution: contrib });
|
|
78
|
+
}
|
|
79
|
+
for (const verdict of verdicts) {
|
|
80
|
+
const unpaired = pairs.find((p) => !p.verdict && p.contribution);
|
|
81
|
+
if (unpaired) {
|
|
82
|
+
unpaired.verdict = verdict;
|
|
83
|
+
} else {
|
|
84
|
+
pairs.push({ verdict });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return pairs;
|
|
88
|
+
}
|
|
89
|
+
var SESSION_LOG_FILE, MAX_ENTRIES;
|
|
90
|
+
var init_session_work_log = __esm({
|
|
91
|
+
"../paradigm-mcp/src/utils/session-work-log.ts"() {
|
|
92
|
+
SESSION_LOG_FILE = ".paradigm/events/session-log.jsonl";
|
|
93
|
+
MAX_ENTRIES = 200;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
appendSessionWorkEntry,
|
|
99
|
+
readSessionWorkLog,
|
|
100
|
+
clearSessionWorkLog,
|
|
101
|
+
getContributingAgents,
|
|
102
|
+
getAgentEntries,
|
|
103
|
+
getAgentVerdicts,
|
|
104
|
+
session_work_log_exports,
|
|
105
|
+
init_session_work_log
|
|
106
|
+
};
|
|
@@ -4,6 +4,10 @@ import {
|
|
|
4
4
|
checkIntegrity,
|
|
5
5
|
checkPurposeHealth
|
|
6
6
|
} from "./chunk-L27I3CPZ.js";
|
|
7
|
+
import {
|
|
8
|
+
init_session_work_log,
|
|
9
|
+
session_work_log_exports
|
|
10
|
+
} from "./chunk-SDDCVUCV.js";
|
|
7
11
|
import {
|
|
8
12
|
init_lore_loader,
|
|
9
13
|
loadLoreEntries,
|
|
@@ -2113,6 +2117,11 @@ var SessionTracker = class {
|
|
|
2113
2117
|
*/
|
|
2114
2118
|
setRootDir(rootDir) {
|
|
2115
2119
|
this.rootDir = rootDir;
|
|
2120
|
+
try {
|
|
2121
|
+
const { clearSessionWorkLog } = (init_session_work_log(), __toCommonJS(session_work_log_exports));
|
|
2122
|
+
clearSessionWorkLog(rootDir);
|
|
2123
|
+
} catch {
|
|
2124
|
+
}
|
|
2116
2125
|
}
|
|
2117
2126
|
createNewSession() {
|
|
2118
2127
|
return {
|
|
@@ -3223,7 +3232,7 @@ async function buildRecoveryPreamble(rootDir) {
|
|
|
3223
3232
|
} catch {
|
|
3224
3233
|
}
|
|
3225
3234
|
try {
|
|
3226
|
-
const { loadNominations } = await import("./nomination-engine-
|
|
3235
|
+
const { loadNominations } = await import("./nomination-engine-LPLCCDW2.js");
|
|
3227
3236
|
const urgent = loadNominations(rootDir, { pending_only: true }).filter((n) => n.urgency === "critical" || n.urgency === "high");
|
|
3228
3237
|
if (urgent.length > 0) {
|
|
3229
3238
|
lines.push("");
|
package/dist/mcp.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
getDecisionSummary,
|
|
4
|
+
loadDecisions,
|
|
5
|
+
recordDecision
|
|
6
|
+
} from "./chunk-EZ3GOCYC.js";
|
|
2
7
|
import {
|
|
3
8
|
addStep,
|
|
4
9
|
addToolBreadcrumb,
|
|
@@ -74,7 +79,7 @@ import {
|
|
|
74
79
|
validateProtocol,
|
|
75
80
|
validatePurposeFile,
|
|
76
81
|
validateUniversityContent
|
|
77
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-SU3WDCRR.js";
|
|
78
83
|
import "./chunk-L27I3CPZ.js";
|
|
79
84
|
import {
|
|
80
85
|
getWorkLogSummary,
|
|
@@ -85,6 +90,7 @@ import {
|
|
|
85
90
|
getPluginUpdateNotice,
|
|
86
91
|
schedulePluginUpdateCheck
|
|
87
92
|
} from "./chunk-MP73YDXF.js";
|
|
93
|
+
import "./chunk-SDDCVUCV.js";
|
|
88
94
|
import {
|
|
89
95
|
completeTask,
|
|
90
96
|
createTask,
|
|
@@ -127,7 +133,7 @@ import {
|
|
|
127
133
|
queryEvents,
|
|
128
134
|
resolveDebate,
|
|
129
135
|
searchNotebooks
|
|
130
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-B2RC3HEB.js";
|
|
131
137
|
import {
|
|
132
138
|
buildProfileEnrichment,
|
|
133
139
|
init_agent_loader,
|
|
@@ -136,7 +142,7 @@ import {
|
|
|
136
142
|
queryExpertise,
|
|
137
143
|
saveAgentProfile,
|
|
138
144
|
verifyIntegrity
|
|
139
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-ITPJJIHG.js";
|
|
140
146
|
import {
|
|
141
147
|
getJournalStats,
|
|
142
148
|
init_journal_loader,
|
|
@@ -152,11 +158,6 @@ import {
|
|
|
152
158
|
TimelineBuilder,
|
|
153
159
|
loadAllSeedPatterns
|
|
154
160
|
} from "./chunk-ZDHLG5VP.js";
|
|
155
|
-
import {
|
|
156
|
-
getDecisionSummary,
|
|
157
|
-
loadDecisions,
|
|
158
|
-
recordDecision
|
|
159
|
-
} from "./chunk-EZ3GOCYC.js";
|
|
160
161
|
import {
|
|
161
162
|
__esm,
|
|
162
163
|
__export,
|
|
@@ -2249,35 +2250,108 @@ paradigm_flows_affected({ symbol: "#tasks" })
|
|
|
2249
2250
|
\`\`\``
|
|
2250
2251
|
},
|
|
2251
2252
|
"orchestration": {
|
|
2252
|
-
description: "
|
|
2253
|
-
generate: () => `#
|
|
2253
|
+
description: "Maestro team orchestration \u2014 attributed responses, ambient context, learning loop, bench/activate, documentor agent",
|
|
2254
|
+
generate: () => `# Maestro Team Orchestration
|
|
2254
2255
|
|
|
2255
|
-
|
|
2256
|
+
The Maestro model: the active Claude Code session orchestrates domain-specific subagents, makes their contributions visible as distinct attributed messages, and learns from feedback to improve agent performance over time.
|
|
2256
2257
|
|
|
2257
|
-
##
|
|
2258
|
+
## How Maestro Works
|
|
2258
2259
|
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
| \`paradigm team agents suggest "task"\` | Suggest agents based on task triggers |
|
|
2266
|
-
| \`paradigm team providers\` | Show available providers |
|
|
2267
|
-
| \`paradigm team models\` | View/configure agent model assignments |
|
|
2260
|
+
1. **Evaluate expertise** \u2014 Which agents have the highest confidence scores on relevant symbols?
|
|
2261
|
+
2. **Load ambient context** \u2014 Recent team decisions, journal insights, and pending nominations are injected into each agent's prompt via \`buildProfileEnrichment()\`.
|
|
2262
|
+
3. **Spawn subagents** \u2014 Each agent receives its full profile: personality, expertise history, transferable patterns, notebook entries, and ambient context.
|
|
2263
|
+
4. **Present attributed responses** \u2014 Each agent's response appears with a \`[role]\` or \`[nickname (role)]\` prefix. Do NOT synthesize \u2014 show distinct contributions.
|
|
2264
|
+
5. **Record to Symphony** \u2014 Each contribution is written as a Symphony message to \`thr-orch-*\` thread for Conductor/Platform visibility.
|
|
2265
|
+
6. **Learn from feedback** \u2014 At session end, Maestro reads the session work log and writes targeted journal entries per agent.
|
|
2268
2266
|
|
|
2269
|
-
##
|
|
2267
|
+
## Attributed Responses
|
|
2270
2268
|
|
|
2271
|
-
|
|
2269
|
+
When presenting agent responses, use the \`attribution\` field from orchestration output:
|
|
2270
|
+
- \`[architect]\` \u2014 default format
|
|
2271
|
+
- \`[George (architect)]\` \u2014 if agent has a \`nickname\` in its profile
|
|
2272
2272
|
|
|
2273
|
-
|
|
2274
|
-
paradigm team agents suggest "Add user authentication with JWT"
|
|
2275
|
-
\`\`\`
|
|
2273
|
+
Do NOT combine or summarize multiple agents into one response. Each agent speaks for itself.
|
|
2276
2274
|
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2275
|
+
## Agent Roster
|
|
2276
|
+
|
|
2277
|
+
| Agent | Model | Role |
|
|
2278
|
+
|-------|-------|------|
|
|
2279
|
+
| architect | opus | Design, specifications, file plans |
|
|
2280
|
+
| builder | haiku | Implementation from specs |
|
|
2281
|
+
| security | opus | Auth, permissions, vulnerability review |
|
|
2282
|
+
| reviewer | sonnet | Code quality, patterns, conventions |
|
|
2283
|
+
| tester | haiku | Test coverage, assertions |
|
|
2284
|
+
| documentor | haiku | .purpose, portal.yaml, symbol updates (always final stage) |
|
|
2285
|
+
|
|
2286
|
+
### Bench / Activate
|
|
2287
|
+
|
|
2288
|
+
Silence a noisy agent without deleting its profile:
|
|
2289
|
+
- \`paradigm agent bench security\` \u2014 Maestro and nomination engine skip this agent
|
|
2290
|
+
- \`paradigm agent activate security\` \u2014 restore to active orchestration
|
|
2291
|
+
- \`paradigm agent roster\` \u2014 see active vs benched with stats
|
|
2292
|
+
|
|
2293
|
+
### Documentor Agent
|
|
2294
|
+
|
|
2295
|
+
The documentor always runs as the **final orchestration stage**. It:
|
|
2296
|
+
- Reviews what other agents changed
|
|
2297
|
+
- Updates .purpose files, portal.yaml, and symbol registrations
|
|
2298
|
+
- Uses only \`paradigm_purpose_*\` and \`paradigm_portal_*\` MCP tools
|
|
2299
|
+
- Runs \`paradigm_reindex\` when done
|
|
2300
|
+
- Never modifies source code
|
|
2301
|
+
|
|
2302
|
+
This relieves all other agents of Paradigm file maintenance.
|
|
2303
|
+
|
|
2304
|
+
## Session Work Log
|
|
2305
|
+
|
|
2306
|
+
During a session, a running log captures:
|
|
2307
|
+
- **Agent contributions** \u2014 what each agent was asked to do (from orchestration)
|
|
2308
|
+
- **User verdicts** \u2014 accepted / dismissed / revised, with reason (from ambient engage)
|
|
2309
|
+
|
|
2310
|
+
Stored at \`.paradigm/events/session-log.jsonl\`. Read by Maestro at postflight.
|
|
2311
|
+
|
|
2312
|
+
## Learning Loop
|
|
2313
|
+
|
|
2314
|
+
At session end (via postflight skill Step 8b):
|
|
2315
|
+
|
|
2316
|
+
1. **Read session work log** \u2014 cross-reference contributions with verdicts
|
|
2317
|
+
2. **Write journal entries** \u2014 targeted feedback per agent:
|
|
2318
|
+
- Accepted \u2192 \`human_feedback\` trigger, high confidence, extractable pattern
|
|
2319
|
+
- Dismissed \u2192 \`correction_received\` trigger, low confidence, explains what was wrong
|
|
2320
|
+
- Revised \u2192 \`correction_received\` trigger, medium confidence, includes delta
|
|
2321
|
+
3. **Adjust thresholds** \u2014 \`paradigm_ambient_learn\` per agent
|
|
2322
|
+
4. **Promote to notebooks** \u2014 \`paradigm_ambient_promote\` auto-promotes high-confidence journal entries
|
|
2323
|
+
|
|
2324
|
+
Journal entries with patterns flow through to notebooks, which appear in future \`buildProfileEnrichment()\` calls. This is how agents accumulate domain knowledge.
|
|
2325
|
+
|
|
2326
|
+
## Training New Behaviors
|
|
2327
|
+
|
|
2328
|
+
To teach an agent a new skill (e.g., "documentor should also draft CHANGELOG entries"):
|
|
2329
|
+
1. Tell the agent during the session \u2014 Maestro records the instruction
|
|
2330
|
+
2. The postflight pass writes a \`human_feedback\` journal entry with the new behavior
|
|
2331
|
+
3. On promotion, it becomes a notebook entry
|
|
2332
|
+
4. Next session, \`buildProfileEnrichment()\` injects that knowledge into the agent's context
|
|
2333
|
+
|
|
2334
|
+
No configuration needed \u2014 the learning pipeline IS the training mechanism.
|
|
2335
|
+
|
|
2336
|
+
## Neverland Validation
|
|
2337
|
+
|
|
2338
|
+
Track learning progress with \`paradigm_ambient_neverland\`:
|
|
2339
|
+
- Per-agent: acceptance rate, threshold, expertise count, notebook count
|
|
2340
|
+
- Aggregate: average accept rate, total expertise, total notebooks
|
|
2341
|
+
- Health status: cold-start \u2192 accumulating \u2192 calibrating \u2192 mature
|
|
2342
|
+
- Target: >80% routing accuracy by session 10, >70% acceptance rate
|
|
2343
|
+
|
|
2344
|
+
## MCP Tools
|
|
2345
|
+
|
|
2346
|
+
| Tool | Purpose |
|
|
2347
|
+
|------|---------|
|
|
2348
|
+
| \`paradigm_orchestrate_inline\` | Plan (mode=plan) or execute (mode=execute) multi-agent orchestration |
|
|
2349
|
+
| \`paradigm_agent_prompt\` | Get enriched prompt for a single agent |
|
|
2350
|
+
| \`paradigm_agent_list\` | List all agents with expertise + bench status |
|
|
2351
|
+
| \`paradigm_agent_bench\` | Bench an agent |
|
|
2352
|
+
| \`paradigm_agent_activate\` | Activate a benched agent |
|
|
2353
|
+
| \`paradigm_ambient_neverland\` | Neverland validation metrics |
|
|
2354
|
+
| \`paradigm_context_compose\` | Compose full ambient context for an agent |`
|
|
2281
2355
|
},
|
|
2282
2356
|
"workspaces": {
|
|
2283
2357
|
description: "Multi-project workspaces \u2014 setup, cross-project tools, reindexing",
|
|
@@ -5618,7 +5692,8 @@ var DEFAULT_MODELS = {
|
|
|
5618
5692
|
security: "opus",
|
|
5619
5693
|
reviewer: "sonnet",
|
|
5620
5694
|
builder: "haiku",
|
|
5621
|
-
tester: "haiku"
|
|
5695
|
+
tester: "haiku",
|
|
5696
|
+
documentor: "haiku"
|
|
5622
5697
|
};
|
|
5623
5698
|
var AGENT_TOKEN_ESTIMATES = {
|
|
5624
5699
|
architect: { min: 5e3, max: 2e4 },
|
|
@@ -5782,7 +5857,35 @@ You flag issues but do NOT implement fixes - hand to Builder for that.
|
|
|
5782
5857
|
## What You DON'T Do
|
|
5783
5858
|
- Implement security fixes yourself
|
|
5784
5859
|
- Skip checking ^gate routes
|
|
5785
|
-
- Approve code with known vulnerabilities
|
|
5860
|
+
- Approve code with known vulnerabilities`,
|
|
5861
|
+
documentor: `You are the DOCUMENTOR agent.
|
|
5862
|
+
|
|
5863
|
+
## Your Role
|
|
5864
|
+
You maintain Paradigm metadata files after other agents complete their work.
|
|
5865
|
+
You are the ONLY agent responsible for .purpose files, portal.yaml, and symbol registrations.
|
|
5866
|
+
Other agents focus on their domain \u2014 you handle all Paradigm compliance.
|
|
5867
|
+
|
|
5868
|
+
## Key Responsibilities
|
|
5869
|
+
1. Review what other agents changed (read git diff, session work log)
|
|
5870
|
+
2. Update .purpose files for modified directories (paradigm_purpose_init, paradigm_purpose_add_component)
|
|
5871
|
+
3. Update portal.yaml with new routes and gates (paradigm_portal_add_route, paradigm_portal_add_gate)
|
|
5872
|
+
4. Register new signals, flows, and states (paradigm_purpose_add_signal, paradigm_purpose_add_flow)
|
|
5873
|
+
5. Run paradigm_reindex when done to rebuild the symbol index
|
|
5874
|
+
6. Ask peers via Symphony what symbols they touched if unclear
|
|
5875
|
+
|
|
5876
|
+
## What You ONLY Use
|
|
5877
|
+
- paradigm_purpose_init / paradigm_purpose_add_component / paradigm_purpose_add_flow
|
|
5878
|
+
- paradigm_purpose_add_gate / paradigm_purpose_add_signal / paradigm_purpose_add_state
|
|
5879
|
+
- paradigm_portal_add_route / paradigm_portal_add_gate
|
|
5880
|
+
- paradigm_reindex
|
|
5881
|
+
- paradigm_search (to find existing symbols)
|
|
5882
|
+
- paradigm_ripple (to check impact)
|
|
5883
|
+
|
|
5884
|
+
## What You NEVER Do
|
|
5885
|
+
- Modify source code (.ts, .js, .py, .rs files)
|
|
5886
|
+
- Write implementation code
|
|
5887
|
+
- Change application logic
|
|
5888
|
+
- Skip .purpose coverage for new code directories`
|
|
5786
5889
|
};
|
|
5787
5890
|
function getOrchestrationToolsList() {
|
|
5788
5891
|
return [
|
|
@@ -5918,10 +6021,10 @@ async function handleOrchestrateInline(args, ctx) {
|
|
|
5918
6021
|
}
|
|
5919
6022
|
let agentProfiles = /* @__PURE__ */ new Map();
|
|
5920
6023
|
try {
|
|
5921
|
-
const { loadAgentProfile: loadAgentProfile2, buildProfileEnrichment: buildProfileEnrichment2 } = await import("./agent-loader-
|
|
6024
|
+
const { loadAgentProfile: loadAgentProfile2, buildProfileEnrichment: buildProfileEnrichment2 } = await import("./agent-loader-DBF4OARL.js");
|
|
5922
6025
|
const { loadDecisions: loadDecisions3 } = await import("./decision-loader-WWCLIQPJ.js");
|
|
5923
6026
|
const { loadJournalEntries: loadJournalEntries2 } = await import("./journal-loader-5EYSBFFY.js");
|
|
5924
|
-
const { loadNominations: loadNominations2 } = await import("./nomination-engine-
|
|
6027
|
+
const { loadNominations: loadNominations2 } = await import("./nomination-engine-LPLCCDW2.js");
|
|
5925
6028
|
const recentDecisions = loadDecisions3(ctx.rootDir, { status: "active", limit: 5 }).map((d) => ({ title: d.title, decision: d.decision.slice(0, 150) }));
|
|
5926
6029
|
const pendingNominations = loadNominations2(ctx.rootDir, { pending_only: true, limit: 10 }).map((n) => ({ urgency: n.urgency, brief: n.brief }));
|
|
5927
6030
|
for (const stage of plan.stages) {
|
|
@@ -5992,6 +6095,22 @@ async function handleOrchestrateInline(args, ctx) {
|
|
|
5992
6095
|
}
|
|
5993
6096
|
const orchestrationId = `orch-${Date.now().toString(36)}-${Math.random().toString(36).substring(2, 6)}`;
|
|
5994
6097
|
logOrchestration(ctx.rootDir, orchestrationId, task, plan);
|
|
6098
|
+
try {
|
|
6099
|
+
const { appendSessionWorkEntry } = await import("./session-work-log-KDOH4GER.js");
|
|
6100
|
+
for (const stage of stagePrompts) {
|
|
6101
|
+
for (const agent of stage.agents) {
|
|
6102
|
+
appendSessionWorkEntry(ctx.rootDir, {
|
|
6103
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6104
|
+
type: "agent-contribution",
|
|
6105
|
+
agent: agent.agent,
|
|
6106
|
+
contribution: agent.taskDescription?.slice(0, 200) || task.slice(0, 200),
|
|
6107
|
+
attribution: agent.attribution,
|
|
6108
|
+
symbols
|
|
6109
|
+
});
|
|
6110
|
+
}
|
|
6111
|
+
}
|
|
6112
|
+
} catch {
|
|
6113
|
+
}
|
|
5995
6114
|
const result = {
|
|
5996
6115
|
orchestrationId,
|
|
5997
6116
|
task,
|
|
@@ -6075,10 +6194,10 @@ async function handleAgentPrompt(args, ctx) {
|
|
|
6075
6194
|
let profileEnrichment;
|
|
6076
6195
|
let nickname;
|
|
6077
6196
|
try {
|
|
6078
|
-
const { loadAgentProfile: loadAgentProfile2, buildProfileEnrichment: buildProfileEnrichment2 } = await import("./agent-loader-
|
|
6197
|
+
const { loadAgentProfile: loadAgentProfile2, buildProfileEnrichment: buildProfileEnrichment2 } = await import("./agent-loader-DBF4OARL.js");
|
|
6079
6198
|
const { loadDecisions: loadDecisions3 } = await import("./decision-loader-WWCLIQPJ.js");
|
|
6080
6199
|
const { loadJournalEntries: loadJournalEntries2 } = await import("./journal-loader-5EYSBFFY.js");
|
|
6081
|
-
const { loadNominations: loadNominations2 } = await import("./nomination-engine-
|
|
6200
|
+
const { loadNominations: loadNominations2 } = await import("./nomination-engine-LPLCCDW2.js");
|
|
6082
6201
|
const profile = loadAgentProfile2(ctx.rootDir, agentName);
|
|
6083
6202
|
if (profile) {
|
|
6084
6203
|
nickname = profile.nickname;
|
|
@@ -6257,6 +6376,17 @@ function planAgentSequence(task, agents, agentOverride, classification) {
|
|
|
6257
6376
|
canRunParallel: stageAgents.length > 1
|
|
6258
6377
|
});
|
|
6259
6378
|
}
|
|
6379
|
+
const lastStageNum = sortedStages.length > 0 ? sortedStages[sortedStages.length - 1] + 1 : 0;
|
|
6380
|
+
stages.push({
|
|
6381
|
+
stage: lastStageNum,
|
|
6382
|
+
agents: [{
|
|
6383
|
+
name: "documentor",
|
|
6384
|
+
task: "Review all changes made by previous agents. Update .purpose files, portal.yaml, and symbol registrations using only paradigm_purpose_* and paradigm_portal_* MCP tools. Run paradigm_reindex when done. Do NOT modify source code.",
|
|
6385
|
+
dependsOn: plannedAgents.map((a) => a.name),
|
|
6386
|
+
required: true
|
|
6387
|
+
}],
|
|
6388
|
+
canRunParallel: false
|
|
6389
|
+
});
|
|
6260
6390
|
let minTokens = 0;
|
|
6261
6391
|
let maxTokens = 0;
|
|
6262
6392
|
for (const agent of plannedAgents) {
|
|
@@ -6264,12 +6394,15 @@ function planAgentSequence(task, agents, agentOverride, classification) {
|
|
|
6264
6394
|
minTokens += estimate.min;
|
|
6265
6395
|
maxTokens += estimate.max;
|
|
6266
6396
|
}
|
|
6397
|
+
minTokens += 2e3;
|
|
6398
|
+
maxTokens += 8e3;
|
|
6267
6399
|
return {
|
|
6268
6400
|
task,
|
|
6269
6401
|
mode: "faceted",
|
|
6270
6402
|
stages,
|
|
6271
6403
|
symbols,
|
|
6272
|
-
estimatedAgents: plannedAgents.length,
|
|
6404
|
+
estimatedAgents: plannedAgents.length + 1,
|
|
6405
|
+
// +1 for documentor
|
|
6273
6406
|
estimatedTokens: { min: minTokens, max: maxTokens }
|
|
6274
6407
|
};
|
|
6275
6408
|
}
|
|
@@ -9969,7 +10102,7 @@ async function handleLoreTool(name, args, ctx) {
|
|
|
9969
10102
|
try {
|
|
9970
10103
|
const agentId = process.env.PARADIGM_AGENT_ID;
|
|
9971
10104
|
if (agentId && symbols_touched && symbols_touched.length > 0) {
|
|
9972
|
-
const { updateExpertiseFromLore } = await import("./agent-loader-
|
|
10105
|
+
const { updateExpertiseFromLore } = await import("./agent-loader-DBF4OARL.js");
|
|
9973
10106
|
updateExpertiseFromLore(ctx.rootDir, agentId, {
|
|
9974
10107
|
symbols_touched,
|
|
9975
10108
|
confidence: confidence != null && confidence >= 0 && confidence <= 1 ? confidence : void 0
|
|
@@ -10140,7 +10273,7 @@ async function handleLoreTool(name, args, ctx) {
|
|
|
10140
10273
|
try {
|
|
10141
10274
|
const agentId = process.env.PARADIGM_AGENT_ID;
|
|
10142
10275
|
if (agentId && success && entryToAssess.symbols_touched?.length) {
|
|
10143
|
-
const { updateExpertiseFromAssessment } = await import("./agent-loader-
|
|
10276
|
+
const { updateExpertiseFromAssessment } = await import("./agent-loader-DBF4OARL.js");
|
|
10144
10277
|
updateExpertiseFromAssessment(ctx.rootDir, agentId, {
|
|
10145
10278
|
symbols_touched: entryToAssess.symbols_touched,
|
|
10146
10279
|
verdict
|
|
@@ -19567,7 +19700,7 @@ function getAmbientToolsList() {
|
|
|
19567
19700
|
nomination_id: { type: "string", description: "Nomination ID to engage with" },
|
|
19568
19701
|
response: { type: "string", enum: ["accepted", "dismissed", "deferred"], description: "How to respond" },
|
|
19569
19702
|
resolve_debate: { type: "string", description: "Optional debate ID to resolve by choosing this nomination" },
|
|
19570
|
-
reason: { type: "string", description: "
|
|
19703
|
+
reason: { type: "string", description: "Reason for response \u2014 stored on nomination for learning feedback. Especially valuable for dismissals." }
|
|
19571
19704
|
},
|
|
19572
19705
|
required: ["nomination_id", "response"]
|
|
19573
19706
|
},
|
|
@@ -19750,7 +19883,24 @@ async function handleAmbientTool(name, args, ctx) {
|
|
|
19750
19883
|
case "paradigm_ambient_engage": {
|
|
19751
19884
|
const nominationId = args.nomination_id;
|
|
19752
19885
|
const response = args.response;
|
|
19753
|
-
const
|
|
19886
|
+
const reason = args.reason;
|
|
19887
|
+
const engaged = engageNomination(ctx.rootDir, nominationId, response, reason);
|
|
19888
|
+
if (engaged) {
|
|
19889
|
+
try {
|
|
19890
|
+
const { appendSessionWorkEntry } = await import("./session-work-log-KDOH4GER.js");
|
|
19891
|
+
const noms = loadNominations(ctx.rootDir, { limit: 500 });
|
|
19892
|
+
const nom = noms.find((n) => n.id === nominationId);
|
|
19893
|
+
appendSessionWorkEntry(ctx.rootDir, {
|
|
19894
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
19895
|
+
type: "user-verdict",
|
|
19896
|
+
agent: nom?.agent,
|
|
19897
|
+
nominationId,
|
|
19898
|
+
verdict: response,
|
|
19899
|
+
reason
|
|
19900
|
+
});
|
|
19901
|
+
} catch {
|
|
19902
|
+
}
|
|
19903
|
+
}
|
|
19754
19904
|
let debateResolved = false;
|
|
19755
19905
|
if (args.resolve_debate && engaged) {
|
|
19756
19906
|
debateResolved = resolveDebate(
|
|
@@ -20961,7 +21111,7 @@ Update command:
|
|
|
20961
21111
|
trackToolCall(noWsText.length, name);
|
|
20962
21112
|
return { content: [{ type: "text", text: noWsText }] };
|
|
20963
21113
|
}
|
|
20964
|
-
const { rebuildStaticFiles: rebuildStaticFiles2 } = await import("./reindex-
|
|
21114
|
+
const { rebuildStaticFiles: rebuildStaticFiles2 } = await import("./reindex-J5SEDVTT.js");
|
|
20965
21115
|
const memberResults = [];
|
|
20966
21116
|
for (const member of ctx.workspace.config.members) {
|
|
20967
21117
|
const memberAbsPath = path34.resolve(path34.dirname(ctx.workspace.workspacePath), member.path);
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
processEvent,
|
|
18
18
|
processPendingEvents,
|
|
19
19
|
resolveDebate
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-B2RC3HEB.js";
|
|
21
|
+
import "./chunk-ITPJJIHG.js";
|
|
22
22
|
import "./chunk-MCMOGQMU.js";
|
|
23
23
|
import "./chunk-7N7GSU6K.js";
|
|
24
24
|
init_nomination_engine();
|
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
getReindexToolsList,
|
|
4
4
|
handleReindexTool,
|
|
5
5
|
rebuildStaticFiles
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SU3WDCRR.js";
|
|
7
7
|
import "./chunk-L27I3CPZ.js";
|
|
8
|
+
import "./chunk-SDDCVUCV.js";
|
|
8
9
|
import "./chunk-5VKJBNJL.js";
|
|
9
10
|
import "./chunk-7N7GSU6K.js";
|
|
10
11
|
export {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
appendSessionWorkEntry,
|
|
4
|
+
clearSessionWorkLog,
|
|
5
|
+
getAgentEntries,
|
|
6
|
+
getAgentVerdicts,
|
|
7
|
+
getContributingAgents,
|
|
8
|
+
init_session_work_log,
|
|
9
|
+
readSessionWorkLog
|
|
10
|
+
} from "./chunk-SDDCVUCV.js";
|
|
11
|
+
import "./chunk-7N7GSU6K.js";
|
|
12
|
+
init_session_work_log();
|
|
13
|
+
export {
|
|
14
|
+
appendSessionWorkEntry,
|
|
15
|
+
clearSessionWorkLog,
|
|
16
|
+
getAgentEntries,
|
|
17
|
+
getAgentVerdicts,
|
|
18
|
+
getContributingAgents,
|
|
19
|
+
readSessionWorkLog
|
|
20
|
+
};
|