claude-code-session-manager 0.128.0 → 0.129.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/.claude-plugin/marketplace.json +1 -1
- package/README.md +2 -0
- package/dist/assets/{AgentLibrary-cNQU5YWy.js → AgentLibrary-Cp250YHF.js} +1 -1
- package/dist/assets/{Button-9dIPAOBg.js → Button-DU5UF-6L.js} +1 -1
- package/dist/assets/{DataModel-DrDJ6ysw.js → DataModel-CPf6f17e.js} +1 -1
- package/dist/assets/{History-4rrDdWNP.js → History-B2x-LMlT.js} +1 -1
- package/dist/assets/{Hooks-Bj_jF5Pa.js → Hooks-BWr33C4Q.js} +1 -1
- package/dist/assets/{Library-D-Wsxrh7.js → Library-DBNLTAa8.js} +1 -1
- package/dist/assets/{ListDetail-D7Om0H8j.js → ListDetail-BGBw6egp.js} +1 -1
- package/dist/assets/{McpServers-CbIbSd5o.js → McpServers-DywZ50Ec.js} +1 -1
- package/dist/assets/{Memory-DgQlvQrO.js → Memory-CnalwnFf.js} +1 -1
- package/dist/assets/{Panel-DZHiD8Ar.js → Panel-BzIklgKf.js} +1 -1
- package/dist/assets/{Permissions-CfzduF4B.js → Permissions-mgRifwQc.js} +1 -1
- package/dist/assets/{Plugins-D-AG5nAo.js → Plugins-CV42zfid.js} +2 -2
- package/dist/assets/{ProvenanceBadge-B9JSEjll.js → ProvenanceBadge-DYmX4xgB.js} +1 -1
- package/dist/assets/{SaveBar-mVKig6hL.js → SaveBar-DxrAfnlC.js} +1 -1
- package/dist/assets/{Scheduler-DFTCnh60.js → Scheduler-iyUl1NDl.js} +1 -1
- package/dist/assets/{ScopeSwitcher-s8J-yr7Z.js → ScopeSwitcher-CC8BDPgf.js} +1 -1
- package/dist/assets/{Settings-BTmxRMaP.js → Settings-CWBnQghD.js} +1 -1
- package/dist/assets/{SkillReferenceGraph-C5lKqf5y.js → SkillReferenceGraph-DOhiCxuL.js} +1 -1
- package/dist/assets/{Skills-CxOacq0k.js → Skills-3Er-9YA9.js} +1 -1
- package/dist/assets/{SystemPrompt-BCWg5FAz.js → SystemPrompt-BLxdvZ9K.js} +1 -1
- package/dist/assets/{TagLibrary-BnF0_PkG.js → TagLibrary-BZ6QHYMQ.js} +1 -1
- package/dist/assets/{TiptapBody-C2Iu6rZd.js → TiptapBody-Du6jRBoW.js} +1 -1
- package/dist/assets/{Toggle-C-oD66BG.js → Toggle-Qdi2Z7VD.js} +1 -1
- package/dist/assets/{ViewTabs-Cs4v7vLY.js → ViewTabs-BKfFsziD.js} +1 -1
- package/dist/assets/{historyTotals-CbRSLD8f.js → historyTotals-8ecP_6wF.js} +1 -1
- package/dist/assets/{index-DzY_GXYY.js → index-GI6F_j41.js} +824 -822
- package/dist/assets/{settingsSchema-bSBfHuan.js → settingsSchema-lHTHAabD.js} +1 -1
- package/dist/assets/{skillFrontmatter-BEseWm8r.js → skillFrontmatter-8X1Uc282.js} +1 -1
- package/dist/assets/{useAgentsDirWatch-CdyHxKCI.js → useAgentsDirWatch-CcsoD1bp.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-web/app.js +369 -367
- package/package.json +1 -1
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/skills/develop/SKILL.md +4 -2
- package/scripts/hooks/lib/guard-inline-implementation-policy.cjs +10 -0
- package/src/main/build-info.json +4 -4
- package/src/main/chatRunner.cjs +8 -0
- package/src/main/index.cjs +13 -0
- package/src/main/ipcSchemas.cjs +3 -1
- package/src/main/lib/claude/agentModelResolve.cjs +5 -3
- package/src/main/lib/claude/effectiveModelInfo.cjs +14 -4
- package/src/main/lib/claude/modelCatalog.cjs +28 -1
- package/src/main/lib/epic/developLoopSpawn.cjs +18 -0
- package/src/main/lib/epic/epicMint.cjs +4 -2
- package/src/main/lib/epic/promptSessionsCreateEpic.cjs +4 -3
- package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +21 -21
- package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +24 -0
- package/src/main/lib/prd/prdCreate.cjs +15 -0
- package/src/main/lib/promptSessionSchema.cjs +8 -0
- package/src/preload/api.d.ts +6 -1
- package/src/preload/apiSurface.json +7 -0
- package/src/preload/index.cjs +5 -0
- package/src/seed/agents/architect.md +8 -8
- package/src/main/lib/epic/epicStandingInstructions.cjs +0 -73
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-session-manager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.129.0",
|
|
4
4
|
"description": "Local cockpit for the Claude Code CLI — multi-tab terminal, full config surface, scheduler, voice dictation, and live observability.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main/index.cjs",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "session-manager-dev",
|
|
3
3
|
"description": "The default end-to-end development skillset for the Claude Code Session Manager: decompose work into scheduler PRDs and track them to a validated finish (/develop), publish releases to npm (/builder), and hand a finding to another project on this machine (/send-feedback). Together with the session-manager scheduler these form a develop → queue → validate → release loop.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.4",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Bilko Bibitkov",
|
|
7
7
|
"email": "BilkoBibitkov2000@gmail.com",
|
|
@@ -27,13 +27,15 @@ new work. **report** = your final message to the human.
|
|
|
27
27
|
(`$SM_PROJECT_ROOT`, or the first `git worktree list` path). Why: a worktree copy is
|
|
28
28
|
frozen at branch time and often lacks this Epic.
|
|
29
29
|
3. The `sessions` entry whose `claudeSessionId` matches is this Epic: its `id` is
|
|
30
|
-
`<epic-id>`, its `tag`
|
|
30
|
+
`<epic-id>`, its `tag` and `developLoop` drive rule 2.
|
|
31
31
|
4. No match: stop and say so. Tell the human to open an Epic with the New Epic card and run
|
|
32
32
|
/develop there. Never mint an Epic or write a PRD without one. Why: only a human creates
|
|
33
33
|
an Epic.
|
|
34
34
|
2. **Tag-aware default.** On a `feature`, `bug` or `art` Epic, PRDs are the expected path once scope
|
|
35
35
|
is clear; start unasked. On a `discussion` Epic it stays available, but wait until the
|
|
36
|
-
human settles that code is wanted.
|
|
36
|
+
human settles that code is wanted. An Epic with no tag (No mission) is treated like `discussion`.
|
|
37
|
+
If `developLoop` is `false`, do not author PRDs (the API refuses them): tell the human this
|
|
38
|
+
session was started without the develop loop and a new session with it on is needed to queue work. Stop.
|
|
37
39
|
3. **Never hand-implement in this session**, even when the plan is agreed. Why: this session
|
|
38
40
|
runs an expensive planner model; a cheaper executor runs each PRD as a headless `claude -p`
|
|
39
41
|
job.
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
* `git rev-parse` to resolve the ops root (see `resolveOpsRootCwd` below).
|
|
14
14
|
* Calling it directly from a test still removes the outer CLI-process spawn
|
|
15
15
|
* per case, exercising real filesystem/git behavior instead of mocking it.
|
|
16
|
+
*
|
|
17
|
+
* A developLoop:false Epic was started as a plain session (develop loop off)
|
|
18
|
+
* and may edit inline whatever its tag, like the allowInlineImplementation
|
|
19
|
+
* per-Epic escape hatch.
|
|
16
20
|
*/
|
|
17
21
|
'use strict';
|
|
18
22
|
|
|
@@ -132,6 +136,12 @@ function decide(payload) {
|
|
|
132
136
|
if (!epic) return buildAllow(); // unresolvable session — allow by construction
|
|
133
137
|
|
|
134
138
|
if (epic.allowInlineImplementation) return buildAllow();
|
|
139
|
+
if (epic.developLoop === false) {
|
|
140
|
+
return {
|
|
141
|
+
continue: true,
|
|
142
|
+
reason: 'This Epic was started with the develop loop off (developLoop: false) as a plain session, so inline edits are allowed.',
|
|
143
|
+
};
|
|
144
|
+
}
|
|
135
145
|
if (!DENY_TAGS.has(epic.tag)) return buildAllow();
|
|
136
146
|
|
|
137
147
|
const reason = [
|
package/src/main/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"gitSha": "
|
|
4
|
-
"gitShortSha": "
|
|
2
|
+
"version": "0.129.0",
|
|
3
|
+
"gitSha": "6bb933179c6b91ea91b4ef8bfe113b95fae19466",
|
|
4
|
+
"gitShortSha": "6bb93317",
|
|
5
5
|
"gitBranch": "HEAD",
|
|
6
|
-
"builtAt": "2026-11-
|
|
6
|
+
"builtAt": "2026-11-06T22:56:53.741Z",
|
|
7
7
|
"dirty": false
|
|
8
8
|
}
|
package/src/main/chatRunner.cjs
CHANGED
|
@@ -48,6 +48,7 @@ const sessionSlots = require('./lib/scheduler/sessionSlots.cjs');
|
|
|
48
48
|
const opsErrorLog = require('./lib/telemetry/opsErrorLog.cjs');
|
|
49
49
|
const { killTree, detachedSpawnOpts } = require('./lib/process/killTree.cjs');
|
|
50
50
|
const agentModelResolve = require('./lib/claude/agentModelResolve.cjs');
|
|
51
|
+
const { developLoopOffSettingsArgs } = require('./lib/epic/developLoopSpawn.cjs');
|
|
51
52
|
const { resolveEpicEffort, effortArgs } = require('./lib/claude/agentEffortResolve.cjs');
|
|
52
53
|
const { planEpicSpawn } = require('./lib/epic/epicSpawnPlan.cjs');
|
|
53
54
|
const epicWorktreeMint = require('./lib/epic/epicWorktreeMint.cjs');
|
|
@@ -631,6 +632,12 @@ function executeRun({ tabId, sessionId, prompt, cwd, resume, silent, onSilentRes
|
|
|
631
632
|
// effortArgs() yields NO tokens for inherit/absent/dangling.
|
|
632
633
|
const effortFlags = effortArgs(resolveEpicEffort({ cwd, claudeSessionId: sessionId }).effort);
|
|
633
634
|
|
|
635
|
+
// Develop-loop-off Epics launch with the dev plugin disabled for this session only.
|
|
636
|
+
let loopOffArgs = [];
|
|
637
|
+
try {
|
|
638
|
+
loopOffArgs = developLoopOffSettingsArgs(agentModelResolve.findEpicByClaudeSessionId(cwd, sessionId));
|
|
639
|
+
} catch { /* lookup failure = launch as today */ }
|
|
640
|
+
|
|
634
641
|
// Main is authoritative about --resume vs --session-id AND the spawn cwd, and it decides
|
|
635
642
|
// them TOGETHER (epicSpawnPlan.cjs): a transcript under an encoding the spawn cwd cannot see
|
|
636
643
|
// must never yield a claimed flag. Unreachable / closed Epics are refused before any spawn.
|
|
@@ -665,6 +672,7 @@ function executeRun({ tabId, sessionId, prompt, cwd, resume, silent, onSilentRes
|
|
|
665
672
|
'--model', model,
|
|
666
673
|
...effortFlags,
|
|
667
674
|
'--dangerously-skip-permissions',
|
|
675
|
+
...loopOffArgs,
|
|
668
676
|
'--output-format', 'stream-json',
|
|
669
677
|
'--verbose',
|
|
670
678
|
];
|
package/src/main/index.cjs
CHANGED
|
@@ -1467,6 +1467,19 @@ app.whenReady().then(async () => {
|
|
|
1467
1467
|
{ role: 'selectAll' },
|
|
1468
1468
|
],
|
|
1469
1469
|
},
|
|
1470
|
+
{
|
|
1471
|
+
label: 'Help',
|
|
1472
|
+
submenu: [
|
|
1473
|
+
{
|
|
1474
|
+
label: 'Book a Free Hour with Bilko',
|
|
1475
|
+
click: () => {
|
|
1476
|
+
if (mainWindow && !mainWindow.isDestroyed()) {
|
|
1477
|
+
sendIfAlive(mainWindow, 'app:open-free-hour');
|
|
1478
|
+
}
|
|
1479
|
+
},
|
|
1480
|
+
},
|
|
1481
|
+
],
|
|
1482
|
+
},
|
|
1470
1483
|
];
|
|
1471
1484
|
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
|
|
1472
1485
|
|
package/src/main/ipcSchemas.cjs
CHANGED
|
@@ -226,6 +226,8 @@ const promptSessionsCreateEpic = z.object({
|
|
|
226
226
|
// Per-Epic runtime overrides (New Session card) — absent = use the persona's own value.
|
|
227
227
|
model: z.string().min(1).max(256).optional(),
|
|
228
228
|
effort: z.string().min(1).max(64).optional(),
|
|
229
|
+
// false = develop loop off for this Epic's whole life; absent = on.
|
|
230
|
+
developLoop: z.boolean().optional(),
|
|
229
231
|
source: EpicSourceSchema.optional(),
|
|
230
232
|
// The full first-prompt body + its labeled sections (epicIntake.ts's
|
|
231
233
|
// composeEpicIntake) — both optional, since not every mint caller (e.g. a
|
|
@@ -805,7 +807,7 @@ const agentsGetPersonaBody = z.object({
|
|
|
805
807
|
// ──────────────────────────────────────────── Effective model info (PRD: what-will-this-run-as)
|
|
806
808
|
const agentsResolveModelInfo = z.object({
|
|
807
809
|
cwd: z.string().min(1).max(4096),
|
|
808
|
-
agentType: z.string().min(1).max(200),
|
|
810
|
+
agentType: z.string().min(1).max(200).optional(),
|
|
809
811
|
}).strict();
|
|
810
812
|
|
|
811
813
|
// ──────────────────────────────────────────── Live model/effort catalog (modelCatalog.cjs)
|
|
@@ -33,6 +33,7 @@ const os = require('node:os');
|
|
|
33
33
|
const { splitFrontmatter } = require('../prd/prdFrontmatter.cjs');
|
|
34
34
|
const { readActiveIndex, resolvePersonaPaths } = require('../epic/epicMint.cjs');
|
|
35
35
|
const { resolveMergedPersona, PERSONA_NAME_RE } = require('../persona-macro/personaMerge.cjs');
|
|
36
|
+
const { readSettingsModel } = require('./modelCatalog.cjs');
|
|
36
37
|
const configMgr = require('../../config.cjs');
|
|
37
38
|
const { SHIPPED_PERSONA_SEEDS } = require('../persona-macro/shippedPersonaSeeds.cjs');
|
|
38
39
|
|
|
@@ -170,12 +171,13 @@ function resolveEpicModel({ cwd, claudeSessionId, fallbackModel = FALLBACK_MODEL
|
|
|
170
171
|
const override = epicOverrideValue(epic, 'model');
|
|
171
172
|
if (override && override !== 'inherit') return override;
|
|
172
173
|
const agentType = epic?.agentType || null;
|
|
173
|
-
|
|
174
|
+
const settingsOrFallback = () => readSettingsModel(cwd, deps) || fallbackModel || FALLBACK_MODEL;
|
|
175
|
+
if (!agentType) return settingsOrFallback();
|
|
174
176
|
const model = readOverlayAwarePersonaModel(agentType, { ...deps, cwd });
|
|
175
|
-
if (!model || model === 'inherit') return
|
|
177
|
+
if (!model || model === 'inherit') return settingsOrFallback();
|
|
176
178
|
return model;
|
|
177
179
|
} catch {
|
|
178
|
-
return fallbackModel;
|
|
180
|
+
return fallbackModel || FALLBACK_MODEL;
|
|
179
181
|
}
|
|
180
182
|
}
|
|
181
183
|
|
|
@@ -281,17 +281,24 @@ async function resolveEffectiveModelInfo({ cwd, agentType, deps = {} } = {}) {
|
|
|
281
281
|
personaEffort: null,
|
|
282
282
|
personaEffortSource: null,
|
|
283
283
|
};
|
|
284
|
-
if (!cwd
|
|
284
|
+
if (!cwd) return miss;
|
|
285
285
|
|
|
286
286
|
try {
|
|
287
287
|
const { projectRootOf } = deps.activeSessions || require('../activeSessions.cjs');
|
|
288
288
|
const normalizedCwd = projectRootOf(path.resolve(cwd));
|
|
289
289
|
if (!normalizedCwd) return miss;
|
|
290
290
|
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
let { modelAlias, modelSource, provenance: personaProvenance } = agentType
|
|
292
|
+
? await resolvePersonaModelAlias(normalizedCwd, agentType, deps)
|
|
293
|
+
: { modelAlias: null, modelSource: 'fallback', provenance: {} };
|
|
294
|
+
if (!modelAlias) {
|
|
295
|
+
// No persona model (agentless, inherit or dangling): the launch uses the Claude settings model.
|
|
296
|
+
const settingsModel = (deps.readSettingsModel || require('./modelCatalog.cjs').readSettingsModel)(normalizedCwd, deps);
|
|
297
|
+
if (settingsModel) { modelAlias = settingsModel; modelSource = 'settings'; }
|
|
298
|
+
}
|
|
299
|
+
const { effort: personaEffort, source: personaEffortSource } = !agentType ? { effort: null, source: null } : (deps.agentEffortResolve || require('./agentEffortResolve.cjs'))
|
|
293
300
|
.resolveEpicEffort({ cwd: normalizedCwd, agentType, deps });
|
|
294
|
-
const result = { agentType, modelAlias, modelSource, personaProvenance, resolvedModelId: null, resolvedFrom: null, effortEnvReachable, personaEffort, personaEffortSource };
|
|
301
|
+
const result = { agentType: agentType || null, modelAlias, modelSource, personaProvenance, resolvedModelId: null, resolvedFrom: null, effortEnvReachable, personaEffort, personaEffortSource };
|
|
295
302
|
|
|
296
303
|
if (isConcreteModelId(modelAlias)) {
|
|
297
304
|
// Already a concrete pinned id — echo it back, fabricate no evidence.
|
|
@@ -299,6 +306,9 @@ async function resolveEffectiveModelInfo({ cwd, agentType, deps = {} } = {}) {
|
|
|
299
306
|
return result;
|
|
300
307
|
}
|
|
301
308
|
|
|
309
|
+
// Agentless: no per-agent evidence to look up (it would match every agentless job).
|
|
310
|
+
if (!agentType) return result;
|
|
311
|
+
|
|
302
312
|
// Evidence is never derived via historyAggregator.cjs's resolvePricingKey
|
|
303
313
|
// (which buckets any unknown id to 'sonnet' with estimated:true) —
|
|
304
314
|
// deliberately: that is a pricing heuristic, and borrowing it here would
|
|
@@ -132,6 +132,33 @@ function readAvailableModels(cwd, d, fsImpl) {
|
|
|
132
132
|
return merged ? [...new Set(merged)] : null;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* The `model` key of the user's Claude settings: first non-empty string from
|
|
137
|
+
* <projectRoot>/.claude/settings.local.json, <projectRoot>/.claude/settings.json,
|
|
138
|
+
* then ~/.claude/settings.json (local over project over user). Never throws; null when none.
|
|
139
|
+
*/
|
|
140
|
+
function readSettingsModel(cwd, deps = {}) {
|
|
141
|
+
try {
|
|
142
|
+
const d = deps || {};
|
|
143
|
+
const fsImpl = d.fs || fs;
|
|
144
|
+
const home = d.homeDir ? d.homeDir() : os.homedir();
|
|
145
|
+
const files = [];
|
|
146
|
+
if (cwd) {
|
|
147
|
+
let root;
|
|
148
|
+
try { root = (d.projectRootOf || require('../activeSessions.cjs').projectRootOf)(path.resolve(cwd)); } catch { root = path.resolve(cwd); }
|
|
149
|
+
if (root) files.push(path.join(root, '.claude', 'settings.local.json'), path.join(root, '.claude', 'settings.json'));
|
|
150
|
+
}
|
|
151
|
+
files.push(path.join(home, '.claude', 'settings.json'));
|
|
152
|
+
for (const f of files) {
|
|
153
|
+
try {
|
|
154
|
+
const m = JSON.parse(fsImpl.readFileSync(f, 'utf8')).model;
|
|
155
|
+
if (typeof m === 'string' && m.trim()) return m.trim();
|
|
156
|
+
} catch { /* missing/unreadable scope */ }
|
|
157
|
+
}
|
|
158
|
+
} catch { /* never throws */ }
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
|
|
135
162
|
function readCache(file, fsImpl) {
|
|
136
163
|
try {
|
|
137
164
|
const c = JSON.parse(fsImpl.readFileSync(file, 'utf8'));
|
|
@@ -240,4 +267,4 @@ function resolveModelCatalog({ cwd, force, deps } = {}) {
|
|
|
240
267
|
return inFlight;
|
|
241
268
|
}
|
|
242
269
|
|
|
243
|
-
module.exports = { resolveModelCatalog, CATALOG_FLOOR, parseAliases, parseEffortLevels, scanModelIds };
|
|
270
|
+
module.exports = { resolveModelCatalog, readSettingsModel, CATALOG_FLOOR, parseAliases, parseEffortLevels, scanModelIds };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* developLoopSpawn.cjs — per-session opt-out of the session-manager-dev plugin.
|
|
4
|
+
*
|
|
5
|
+
* Session Manager installs the plugin (/develop, /builder, /send-feedback) at
|
|
6
|
+
* user scope, so every claude session gets it. An Epic whose row has
|
|
7
|
+
* `developLoop === false` wants a "pure claude" session: the launch passes
|
|
8
|
+
* `--settings '{"enabledPlugins":{"<key>":false}}'`, which outranks the user
|
|
9
|
+
* scope for that one session only. Every other Epic / plain tab gets no args.
|
|
10
|
+
*/
|
|
11
|
+
const { ENABLED_KEY } = require('../../seedDevPlugin.cjs');
|
|
12
|
+
|
|
13
|
+
function developLoopOffSettingsArgs(epic) {
|
|
14
|
+
if (epic?.developLoop !== false) return [];
|
|
15
|
+
return ['--settings', JSON.stringify({ enabledPlugins: { [ENABLED_KEY]: false } })];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module.exports = { developLoopOffSettingsArgs };
|
|
@@ -212,7 +212,7 @@ function withPathLock(lockPath, task) {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
/**
|
|
215
|
-
* ensureEpic(cwd, { epicId?, goalText, tag?, status?, openingPrompt?, source?, agentType?, model?, effort?, mintAuthority? }) → Promise<{ epicId, prdDir, created }>
|
|
215
|
+
* ensureEpic(cwd, { epicId?, goalText, tag?, status?, openingPrompt?, source?, agentType?, model?, effort?, developLoop?, mintAuthority? }) → Promise<{ epicId, prdDir, created }>
|
|
216
216
|
*
|
|
217
217
|
* Two behaviors, and only two:
|
|
218
218
|
* - JOIN (the default, for every automated caller): `epicId` names an Epic
|
|
@@ -231,7 +231,7 @@ function withPathLock(lockPath, task) {
|
|
|
231
231
|
* The Epic's id doubles as its directory name under scheduler/epics/, so the
|
|
232
232
|
* PromptSession ↔ on-disk Epic mapping is 1:1 with no lookup table.
|
|
233
233
|
*/
|
|
234
|
-
function ensureEpic(cwd, { goalText, tag, epicId: explicitEpicId, status = 'proposed', openingPrompt = null, sections = null, source = null, agentType = null, model = null, effort = null, mintAuthority = null } = {}, deps = {}) {
|
|
234
|
+
function ensureEpic(cwd, { goalText, tag, epicId: explicitEpicId, status = 'proposed', openingPrompt = null, sections = null, source = null, agentType = null, model = null, effort = null, developLoop = null, mintAuthority = null } = {}, deps = {}) {
|
|
235
235
|
if (!cwd || typeof cwd !== 'string') throw new Error('ensureEpic: cwd is required');
|
|
236
236
|
// A relative cwd (e.g. a caller passing '.') would otherwise get stored
|
|
237
237
|
// verbatim on the minted Epic's `cwd` field — the renderer's EpicsWorkspace
|
|
@@ -344,6 +344,8 @@ function ensureEpic(cwd, { goalText, tag, epicId: explicitEpicId, status = 'prop
|
|
|
344
344
|
// Per-Epic runtime overrides — written only when set, so an Epic minted without one keeps its on-disk shape.
|
|
345
345
|
...(typeof model === 'string' && model ? { model } : {}),
|
|
346
346
|
...(typeof effort === 'string' && effort ? { effort } : {}),
|
|
347
|
+
// Only false is persisted: absent = develop loop on (byte-identical legacy shape).
|
|
348
|
+
...(developLoop === false ? { developLoop: false } : {}),
|
|
347
349
|
};
|
|
348
350
|
|
|
349
351
|
// Validate the constructed record against the canonical PromptSession
|
|
@@ -41,7 +41,7 @@ const { validatePath } = require('../../config.cjs');
|
|
|
41
41
|
* IPC (config:read-json/write-json, lib/epic/activeIndexMerge.cjs's own merge) is
|
|
42
42
|
* already required to pass through.
|
|
43
43
|
*/
|
|
44
|
-
async function createEpicViaIpc(cwd, { goalText, tag, agentType, model, effort, source, openingPrompt, sections } = {}) {
|
|
44
|
+
async function createEpicViaIpc(cwd, { goalText, tag, agentType, model, effort, developLoop, source, openingPrompt, sections } = {}) {
|
|
45
45
|
validatePath(cwd);
|
|
46
46
|
const { epicId } = await ensureEpic(cwd, {
|
|
47
47
|
goalText,
|
|
@@ -49,6 +49,7 @@ async function createEpicViaIpc(cwd, { goalText, tag, agentType, model, effort,
|
|
|
49
49
|
agentType,
|
|
50
50
|
model,
|
|
51
51
|
effort,
|
|
52
|
+
developLoop,
|
|
52
53
|
source,
|
|
53
54
|
openingPrompt,
|
|
54
55
|
sections,
|
|
@@ -64,8 +65,8 @@ function registerPromptSessionsCreateEpicHandlers() {
|
|
|
64
65
|
const { schemas: s, validated: v } = require('../../ipcSchemas.cjs');
|
|
65
66
|
ipcMain.handle(
|
|
66
67
|
'promptSessions:create-epic',
|
|
67
|
-
v(s.promptSessionsCreateEpic, ({ cwd, goalText, tag, agentType, model, effort, source, openingPrompt, sections }) =>
|
|
68
|
-
createEpicViaIpc(cwd, { goalText, tag, agentType, model, effort, source, openingPrompt, sections })),
|
|
68
|
+
v(s.promptSessionsCreateEpic, ({ cwd, goalText, tag, agentType, model, effort, developLoop, source, openingPrompt, sections }) =>
|
|
69
|
+
createEpicViaIpc(cwd, { goalText, tag, agentType, model, effort, developLoop, source, openingPrompt, sections })),
|
|
69
70
|
);
|
|
70
71
|
}
|
|
71
72
|
|
|
@@ -186,23 +186,20 @@ function seriesLine(series) {
|
|
|
186
186
|
* → { goalText, openingPrompt, sections }
|
|
187
187
|
*
|
|
188
188
|
* Pure. Mirrors the renderer's `composeEpicIntake` (lib/epicIntake.ts) —
|
|
189
|
-
* same `EpicIntakeSection` shape
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* deliberately emits only the section kinds whose text it OWNS:
|
|
189
|
+
* same `EpicIntakeSection` shape: kind = AIM slot (actor | input | mission)
|
|
190
|
+
* plus `part`. It cannot import that module (TS, renderer-side), so it emits
|
|
191
|
+
* only the parts whose text it OWNS, in AIM order:
|
|
193
192
|
*
|
|
194
|
-
* actor
|
|
195
|
-
* input
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
* goal — the report itself.
|
|
199
|
-
* reference — attached paths.
|
|
193
|
+
* actor / persona — the persona line, same sentence template
|
|
194
|
+
* input / grounding — "an external report from Project-A", this module's fact
|
|
195
|
+
* input / reference — attached paths (before the report)
|
|
196
|
+
* mission / goal — the report itself
|
|
200
197
|
*
|
|
201
|
-
* There is NO
|
|
202
|
-
*
|
|
203
|
-
* here would be a second, drifting copy of a tag's meaning
|
|
204
|
-
*
|
|
205
|
-
*
|
|
198
|
+
* There is NO job-type part, on purpose. Its text is the tag's
|
|
199
|
+
* `initialPromptTemplate`, which lives in renderer-only agentTagDefs.ts;
|
|
200
|
+
* re-typing it here would be a second, drifting copy of a tag's meaning, and
|
|
201
|
+
* the auto-start path recomposes the full prompt through composeEpicIntake.
|
|
202
|
+
* The Epic still carries its `tag` field.
|
|
206
203
|
*
|
|
207
204
|
* Complexity: O(n) in the number of references.
|
|
208
205
|
*/
|
|
@@ -228,6 +225,7 @@ function composeFeedbackIntake({
|
|
|
228
225
|
if (agentName && agentDescription) {
|
|
229
226
|
sections.push({
|
|
230
227
|
kind: 'actor',
|
|
228
|
+
part: 'persona',
|
|
231
229
|
label: 'Actor',
|
|
232
230
|
text: `You are acting as the "${singleLine(agentName)}" agent: ${singleLine(agentDescription)}`,
|
|
233
231
|
source: agentName,
|
|
@@ -242,7 +240,8 @@ function composeFeedbackIntake({
|
|
|
242
240
|
const askClause = originAsk ? ` It was raised while working on: ${singleLine(originAsk)}.` : '';
|
|
243
241
|
sections.push({
|
|
244
242
|
kind: 'input',
|
|
245
|
-
|
|
243
|
+
part: 'grounding',
|
|
244
|
+
label: 'Grounding',
|
|
246
245
|
text:
|
|
247
246
|
`This session is INBOUND FEEDBACK from another project: ${origin}.${askClause} `
|
|
248
247
|
+ 'Nobody in this project wrote the report below — an agent working in that project did, and it '
|
|
@@ -263,18 +262,19 @@ function composeFeedbackIntake({
|
|
|
263
262
|
blocks.push(`## Details\n${trimmedBody}`);
|
|
264
263
|
const structured = blocks.join('\n\n');
|
|
265
264
|
|
|
266
|
-
const goalBody = trimmedTitle ? `Goal: ${trimmedTitle}\n\n${structured}` : structured;
|
|
267
|
-
sections.push({ kind: 'goal', label: 'Goal', text: goalBody });
|
|
268
|
-
|
|
269
265
|
for (const p of referencePaths) {
|
|
270
|
-
sections.push({ kind: 'reference', label: 'Reference', text: `Reference: ${singleLine(p)}`, source: p });
|
|
266
|
+
sections.push({ kind: 'input', part: 'reference', label: 'Reference', text: `Reference: ${singleLine(p)}`, source: p });
|
|
271
267
|
}
|
|
272
268
|
|
|
269
|
+
const goalBody = trimmedTitle ? `Goal: ${trimmedTitle}\n\n${structured}` : structured;
|
|
270
|
+
sections.push({ kind: 'mission', part: 'goal', label: 'Goal', text: goalBody });
|
|
271
|
+
|
|
272
|
+
// Part names are string literals: keep in step with AimPart in src/renderer/lib/epicIntake.ts.
|
|
273
273
|
// Same join rule as epicIntake.ts's joinSections: '\n\n' everywhere except
|
|
274
274
|
// between two consecutive reference lines, which stay one visual block.
|
|
275
275
|
const openingPrompt = sections.reduce((out, s, i) => {
|
|
276
276
|
if (i === 0) return s.text;
|
|
277
|
-
const sep = s.
|
|
277
|
+
const sep = s.part === 'reference' && sections[i - 1].part === 'reference' ? '\n' : '\n\n';
|
|
278
278
|
return out + sep + s.text;
|
|
279
279
|
}, '');
|
|
280
280
|
|
|
@@ -63,6 +63,30 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
|
|
|
63
63
|
tools: "Read, Grep, Glob, Bash, Edit, Write",
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
|
+
{
|
|
67
|
+
commit: "f91d78eb",
|
|
68
|
+
bodySha256: "f0b9bf01ddb9dc4c52a2c446dd20759070347ccc5b125ddbe812bb82cfec17c6",
|
|
69
|
+
fm: {
|
|
70
|
+
description: "The primary Actor for an Epic's whole interactive conversation — owns overall plan and decomposition, clarifies scope, searches before building, decomposes work into scheduled PRDs via /develop, tracks them to completion, and verifies before calling anything done. Never implements a PRD itself — that's dev-lead's job, one PRD at a time, headless. Task-type framing is the Epic's Mission tag's job, not this persona's.",
|
|
71
|
+
model: "opus",
|
|
72
|
+
effort: "medium",
|
|
73
|
+
tags: "feature, bug, discussion, art",
|
|
74
|
+
title: "Engineering — Architect",
|
|
75
|
+
tools: "Read, Grep, Glob, Bash, Edit, Write",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
commit: "2651bc05",
|
|
80
|
+
bodySha256: "522f0bd3b4119a4fe7a01571907657de2cc2c01129171cf5b60aa16eecaf4375",
|
|
81
|
+
fm: {
|
|
82
|
+
description: "The primary Actor for an Epic's whole interactive conversation — owns overall plan and decomposition, clarifies scope, searches before building, decomposes work into scheduled PRDs via /develop, tracks them to completion, and verifies before calling anything done. Never implements a PRD itself — that's dev-lead's job, one PRD at a time, headless. Task-type framing is the Epic's Mission tag's job, not this persona's.",
|
|
83
|
+
model: "opus",
|
|
84
|
+
effort: "medium",
|
|
85
|
+
tags: "feature, bug, discussion, art",
|
|
86
|
+
title: "Engineering — Architect",
|
|
87
|
+
tools: "Read, Grep, Glob, Bash, Edit, Write",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
66
90
|
],
|
|
67
91
|
"dev-lead": [
|
|
68
92
|
{
|
|
@@ -313,6 +313,21 @@ async function createPrdInner(input, remote, ctl, opts = {}) {
|
|
|
313
313
|
if (fallback) input = { ...input, sourcePromptId: fallback };
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
+
// Develop-loop-off Epics never receive PRDs (so no check-ins, digests or
|
|
317
|
+
// validation sweeps either). Safety refusal — deliberately no bypass.
|
|
318
|
+
if (input.sourcePromptId) {
|
|
319
|
+
const { sessions } = readActiveIndex(cwd);
|
|
320
|
+
const row = Object.prototype.hasOwnProperty.call(sessions, input.sourcePromptId)
|
|
321
|
+
? sessions[input.sourcePromptId] : null;
|
|
322
|
+
if (row && row.developLoop === false) {
|
|
323
|
+
return {
|
|
324
|
+
ok: false, applied: false, status: 409,
|
|
325
|
+
error: `Epic ${input.sourcePromptId} was started with the develop loop off, so it cannot queue PRDs. `
|
|
326
|
+
+ 'Start a new session with the develop loop on to queue this work.',
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
316
331
|
// Wave-disposition decision point (scheduler wave-disposition PRD): only
|
|
317
332
|
// matters for a PRD that would become a ROOT of its own wave — one the
|
|
318
333
|
// caller didn't already give an explicit dependsOn (that already fixes
|
|
@@ -59,6 +59,11 @@ const EpicIntakeSectionSchema = z.object({
|
|
|
59
59
|
label: z.string(),
|
|
60
60
|
text: z.string(),
|
|
61
61
|
source: z.string().optional(),
|
|
62
|
+
// Mirrors AimPart in src/renderer/lib/epicIntake.ts (main cannot import the
|
|
63
|
+
// renderer module). Optional because Epics minted before AIM sections carry
|
|
64
|
+
// none. NEVER narrow the kind enum above — dropInvalidSessions in
|
|
65
|
+
// ipcSchemas.cjs drops a whole stored Epic whose record fails this schema.
|
|
66
|
+
part: z.enum(['persona', 'grounding', 'injection', 'reference', 'job-type', 'goal']).optional(),
|
|
62
67
|
});
|
|
63
68
|
|
|
64
69
|
// Mirrors PromptSession's `worktree` field (src/renderer/state/
|
|
@@ -89,6 +94,9 @@ const PromptSessionSchema = z.object({
|
|
|
89
94
|
// Per-Epic runtime overrides chosen on the New Session card; absent = the persona's own value.
|
|
90
95
|
model: z.string().optional(),
|
|
91
96
|
effort: z.string().optional(),
|
|
97
|
+
// false = started with the develop loop (/develop skill, delegation guard, PRD queueing) switched off;
|
|
98
|
+
// fixed for the life of its session; absent = on; only false is ever written.
|
|
99
|
+
developLoop: z.boolean().optional(),
|
|
92
100
|
// Absent on Epics minted before this field existed — those fall back to
|
|
93
101
|
// rendering the flat `openingPrompt` as a single block (see
|
|
94
102
|
// ChatTranscriptTurn.tsx's EpicIntakeCard).
|
package/src/preload/api.d.ts
CHANGED
|
@@ -1850,6 +1850,7 @@ export interface SessionManagerAPI {
|
|
|
1850
1850
|
installSelfScheduleGuard: (cwd: string) => Promise<InstallGuardResult>;
|
|
1851
1851
|
onNewSession: (handler: () => void) => () => void;
|
|
1852
1852
|
onRebootSession: (handler: () => void) => () => void;
|
|
1853
|
+
onOpenFreeHour: (handler: () => void) => () => void;
|
|
1853
1854
|
archiveProject: (encoded: string) => Promise<{ ok: boolean; error?: string }>;
|
|
1854
1855
|
};
|
|
1855
1856
|
pty: {
|
|
@@ -1921,7 +1922,7 @@ export interface SessionManagerAPI {
|
|
|
1921
1922
|
* with the renderer's `useEffectiveSettings.ts` scope-chain reader for
|
|
1922
1923
|
* the effortLevel/effortSource half — this call only covers the parts
|
|
1923
1924
|
* that need main-process filesystem access. */
|
|
1924
|
-
resolveModelInfo: (payload: { cwd: string; agentType
|
|
1925
|
+
resolveModelInfo: (payload: { cwd: string; agentType?: string }) => Promise<{
|
|
1925
1926
|
agentType: string;
|
|
1926
1927
|
modelAlias: string | null;
|
|
1927
1928
|
modelSource: 'persona' | 'persona-overlay' | 'inherit' | 'fallback';
|
|
@@ -2463,6 +2464,8 @@ export interface PromptSessionsCreateEpicPayload {
|
|
|
2463
2464
|
/** Per-Epic model/effort overrides (New Session card); omitted = the persona's own. */
|
|
2464
2465
|
model?: string;
|
|
2465
2466
|
effort?: string;
|
|
2467
|
+
/** Absent = develop loop on; false = started without it, fixed for the life of the session. */
|
|
2468
|
+
developLoop?: boolean;
|
|
2466
2469
|
source?: {
|
|
2467
2470
|
producer: 'new-epic-ui' | 'scheduler-dispatch';
|
|
2468
2471
|
prdSlug?: string;
|
|
@@ -2480,6 +2483,8 @@ export interface PromptSessionsCreateEpicPayload {
|
|
|
2480
2483
|
label: string;
|
|
2481
2484
|
text: string;
|
|
2482
2485
|
source?: string;
|
|
2486
|
+
/** Which part of its AIM slot this entry is; absent on Epics minted before AIM sections. */
|
|
2487
|
+
part?: 'persona' | 'grounding' | 'injection' | 'reference' | 'job-type' | 'goal';
|
|
2483
2488
|
}>;
|
|
2484
2489
|
}
|
|
2485
2490
|
|
package/src/preload/index.cjs
CHANGED
|
@@ -50,6 +50,11 @@ contextBridge.exposeInMainWorld('api', {
|
|
|
50
50
|
ipcRenderer.on('app:reboot-session', listener);
|
|
51
51
|
return () => ipcRenderer.removeListener('app:reboot-session', listener);
|
|
52
52
|
},
|
|
53
|
+
onOpenFreeHour: (handler) => {
|
|
54
|
+
const listener = () => handler();
|
|
55
|
+
ipcRenderer.on('app:open-free-hour', listener);
|
|
56
|
+
return () => ipcRenderer.removeListener('app:open-free-hour', listener);
|
|
57
|
+
},
|
|
53
58
|
},
|
|
54
59
|
pty: {
|
|
55
60
|
spawn: (payload) => ipcRenderer.invoke('pty:spawn', payload),
|
|
@@ -6,7 +6,7 @@ model: opus
|
|
|
6
6
|
effort: medium
|
|
7
7
|
tags: feature, bug, discussion, art
|
|
8
8
|
title: Engineering — Architect
|
|
9
|
-
seedVersion:
|
|
9
|
+
seedVersion: 5
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
You are the architect. You are the one Actor a human talks to for the whole life of an Epic's
|
|
@@ -36,8 +36,8 @@ parallel process, the same way `/develop` itself references `standards.md` inste
|
|
|
36
36
|
5. **Never treat "the tests pass" as "it's done."** Verify live against the real acceptance
|
|
37
37
|
criteria before reporting anything as complete.
|
|
38
38
|
6. **Stay agnostic about what kind of work this is.** Whether this Epic is a feature build, a bug
|
|
39
|
-
fix, or an open-ended discussion is decided by its Mission tag, which
|
|
40
|
-
|
|
39
|
+
fix, or an open-ended discussion is decided by its Mission tag, which reaches you in the Mission
|
|
40
|
+
part of the opening prompt, after this persona. Don't restate or second-guess that framing here —
|
|
41
41
|
your job is *how* to plan, not *what* the work is.
|
|
42
42
|
|
|
43
43
|
## Relationship to `dev-lead`
|
|
@@ -49,11 +49,11 @@ You and `dev-lead` are deliberately different scopes, not two names for the same
|
|
|
49
49
|
the overall plan — it reads a PRD's Goal/Acceptance Criteria/Implementation notes and executes
|
|
50
50
|
that PRD, nothing more.
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
A PRD's `agentType` frontmatter names its executor. When omitted, the PRD API stamps `dev-lead`.
|
|
53
|
+
Set it only when another persona must run the PRD (`validator` on the validate PRD, the project's
|
|
54
|
+
art persona on art PRDs). The scheduler reads it at dispatch and launches the run as that persona:
|
|
55
|
+
its body appended as the system prompt, plus its model, effort and tools. You can change it before
|
|
56
|
+
the run with `scheduler_update_prd`.
|
|
57
57
|
|
|
58
58
|
## What you don't do
|
|
59
59
|
|