claude-code-session-manager 0.134.0 → 0.135.1
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/dist/assets/{AgentLibrary-C9KFGJQq.js → AgentLibrary-BBY7E1ag.js} +1 -1
- package/dist/assets/{AppSettings-CvVQ6ot5.js → AppSettings-vMiIi0xn.js} +1 -1
- package/dist/assets/{Button-BHvploNk.js → Button-C0Z090Ui.js} +1 -1
- package/dist/assets/{DocumentEditorPane-DaX4xag_.js → DocumentEditorPane-Ds10W8SZ.js} +1 -1
- package/dist/assets/{Extensions-DbRY-KEz.js → Extensions-CjPiz2I5.js} +2 -2
- package/dist/assets/{History-BE_mjM24.js → History-Bm3KXXs1.js} +1 -1
- package/dist/assets/{Library-I37dQ6pB.js → Library-D-khizDg.js} +1 -1
- package/dist/assets/{ListDetail-DJYMWYQd.js → ListDetail-CJYpp8fW.js} +1 -1
- package/dist/assets/{Panel-DP8eSKSs.js → Panel-BHFGylfy.js} +1 -1
- package/dist/assets/{ProjectClaudeConfig-Cw8lc3Qi.js → ProjectClaudeConfig-DIzNAala.js} +1 -1
- package/dist/assets/{ProvenanceBadge-DUwhsmdA.js → ProvenanceBadge-CYryeTYF.js} +1 -1
- package/dist/assets/{Scheduler-B9D2gZqs.js → Scheduler-BS82wfRP.js} +1 -1
- package/dist/assets/{Settings-DSk7bn-1.js → Settings-DWPHJ94d.js} +1 -1
- package/dist/assets/{SkillReferenceGraph-DtJcJJHR.js → SkillReferenceGraph-Cf2M7YNq.js} +1 -1
- package/dist/assets/{Skills-BPZnSjsB.js → Skills-DLq55Odf.js} +1 -1
- package/dist/assets/{SourceChip-DUxulNOp.js → SourceChip-CHxAzRlD.js} +1 -1
- package/dist/assets/{SystemPrompt-BXAugVle.js → SystemPrompt-BYtKMAr3.js} +1 -1
- package/dist/assets/{TiptapBody-CDC1vrOo.js → TiptapBody-O_Gfq0Ha.js} +1 -1
- package/dist/assets/{Toggle-CrgM7OTR.js → Toggle-BJOUI5NY.js} +1 -1
- package/dist/assets/{ViewTabs-DLwaU9RB.js → ViewTabs-kkvNGu-S.js} +1 -1
- package/dist/assets/{VoiceButton-C4hIBxIP.js → VoiceButton-3i-6ju2L.js} +1 -1
- package/dist/assets/{historyTotals-itA00dXm.js → historyTotals-CHrIptK1.js} +1 -1
- package/dist/assets/{index-Cjt8B7H9.css → index-CjQ_p5y7.css} +1 -1
- package/dist/assets/{index-Cznhnxhq.js → index-D9qgN9_V.js} +362 -362
- package/dist/index.html +2 -2
- package/dist-web/app.css +1 -1
- package/dist-web/app.js +392 -392
- package/package.json +1 -1
- package/plugins/CLAUDE.md +7 -8
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/skills/builder/SKILL.md +113 -91
- package/plugins/session-manager-dev/skills/builder/manual.md +80 -0
- package/plugins/session-manager-dev/skills/develop/SKILL.md +29 -56
- package/plugins/session-manager-dev/skills/develop/standards.md +12 -20
- package/plugins/session-manager-dev/skills/send-feedback/SKILL.md +13 -18
- package/src/main/build-info.json +4 -4
- package/src/main/lib/CLAUDE.md +2 -0
- package/src/main/lib/epic/epicTranscriptPath.cjs +5 -4
- package/src/main/lib/epic/restorableSessions.cjs +16 -8
- package/src/main/lib/persona-macro/macroJobDispatch.cjs +3 -2
- package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +34 -0
- package/src/main/lib/prd/prdFrontmatter.cjs +25 -1
- package/src/main/lib/scheduler/scheduleJobSchema.cjs +3 -0
- package/src/main/promptSessionEvents.cjs +7 -1
- package/src/main/runVerify.cjs +2 -2
- package/src/main/scheduler/prdParser.cjs +17 -1
- package/src/main/scheduler.cjs +137 -15
- package/src/main/templates/PRD_AUTHORING.md +2 -2
- package/src/preload/api.d.ts +8 -2
- package/src/seed/agents/demo-video-builder.md +25 -32
- package/src/seed/agents/dev-lead.md +3 -3
- package/src/seed/agents/project-home-builder.md +4 -2
- package/plugins/session-manager-dev/skills/builder/0-diff/SKILL.md +0 -44
- package/plugins/session-manager-dev/skills/builder/1-classify-and-bump/SKILL.md +0 -37
- package/plugins/session-manager-dev/skills/builder/2-gate/SKILL.md +0 -37
- package/plugins/session-manager-dev/skills/builder/3-publish/SKILL.md +0 -137
- package/plugins/session-manager-dev/skills/builder/4-manual/SKILL.md +0 -124
- package/plugins/session-manager-dev/skills/builder/5-report/SKILL.md +0 -35
|
@@ -6,12 +6,9 @@ description: >-
|
|
|
6
6
|
Session Manager's cross-project conduit (the feedback_open_session MCP tool).
|
|
7
7
|
Use whenever work in one repo surfaces something that is genuinely another
|
|
8
8
|
repo's to fix — a bug in a sibling service, a broken contract between two
|
|
9
|
-
projects, a doc that lies about another project's behavior
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
here". NOT for work in the project you are already in — that is /develop.
|
|
13
|
-
Keywords: feedback, proposal, plan, cross-project, project to project, another repo, sibling
|
|
14
|
-
project, hand off, file against, route finding, x-folder.
|
|
9
|
+
projects, a doc that lies about another project's behavior — or when the user
|
|
10
|
+
asks to send, file or hand a finding to another project ("/send-feedback").
|
|
11
|
+
NOT for work in the project you are already in — that is /develop.
|
|
15
12
|
---
|
|
16
13
|
|
|
17
14
|
# send-feedback
|
|
@@ -23,12 +20,10 @@ and never wait for a reply.
|
|
|
23
20
|
|
|
24
21
|
## Why this exists
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
— narrowed to exactly one shape: **a proposal deposited in another project's
|
|
31
|
-
queue, which a human there must approve before anything runs.**
|
|
23
|
+
A PRD can only join an Epic a human already approved, so nothing in one project
|
|
24
|
+
can start work in another. This skill is the one way across that boundary:
|
|
25
|
+
**a proposal deposited in another project's queue, which a human there must
|
|
26
|
+
approve before anything runs.**
|
|
32
27
|
|
|
33
28
|
## The one hard rule
|
|
34
29
|
|
|
@@ -43,9 +38,8 @@ round-trip, not a wrong write.
|
|
|
43
38
|
| Another project on this machine | this skill |
|
|
44
39
|
| Nothing actionable | say so explicitly |
|
|
45
40
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
you delivered.
|
|
41
|
+
Routing a finding is the **default action, not a question**: a proposal starts
|
|
42
|
+
nothing until a human there approves it. Send it, then report what you delivered.
|
|
49
43
|
|
|
50
44
|
## Steps
|
|
51
45
|
|
|
@@ -198,6 +192,7 @@ Two distinct failure modes — don't conflate them:
|
|
|
198
192
|
them in the meantime so it isn't lost.
|
|
199
193
|
- **`feedback_open_session` is absent from your tool list entirely** — the
|
|
200
194
|
`session-manager-scheduler` MCP server isn't registered for this project.
|
|
201
|
-
That's a misconfiguration, not an offline app.
|
|
202
|
-
|
|
203
|
-
|
|
195
|
+
That's a misconfiguration, not an offline app. Tell the human: the app
|
|
196
|
+
registers the server at user scope the first time it starts; if it is still
|
|
197
|
+
missing, delete `~/.claude/session-manager/.scheduler-mcp-seeded`, restart the
|
|
198
|
+
app, and open a new session. Never add an MCP entry yourself.
|
package/src/main/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"gitSha": "
|
|
4
|
-
"gitShortSha": "
|
|
2
|
+
"version": "0.135.1",
|
|
3
|
+
"gitSha": "00ccf511470488cd658d6eaa51a4a8f27128146b",
|
|
4
|
+
"gitShortSha": "00ccf511",
|
|
5
5
|
"gitBranch": "HEAD",
|
|
6
|
-
"builtAt": "2026-11-
|
|
6
|
+
"builtAt": "2026-11-15T16:36:13.769Z",
|
|
7
7
|
"dirty": false
|
|
8
8
|
}
|
package/src/main/lib/CLAUDE.md
CHANGED
|
@@ -7,12 +7,14 @@ Shared main-process helpers (CommonJS `.cjs`). Layout source of truth: `scripts/
|
|
|
7
7
|
- `agent-cli/` — other agent CLIs: registry, adapters, session store, turn planner, IPC.
|
|
8
8
|
- `app-preview/` — Epic dev-server preview processes (spawn, URL detect, stop, orphan sweep).
|
|
9
9
|
- `claude/` — claude CLI binary, caps, model/effort resolution.
|
|
10
|
+
- `demo-video-kit/` — demo-video build tools (capture, sound, frames, checks), seeded to `~/.claude/session-manager/demo-video-kit/`.
|
|
10
11
|
- `epic/` — Epic mint, worktrees, active index, spawn plan/cwd, transcripts.
|
|
11
12
|
- `feedback-remote/` — cross-project and customer feedback conduits.
|
|
12
13
|
- `git/` — git exec, worktrees, branch sweeps, job worktrees.
|
|
13
14
|
- `persona-macro/` — agent persona schema/merge, macro library, builtin macros.
|
|
14
15
|
- `prd/` — PRD parsing helpers, admin routes, dep-slug resolution, plan validation.
|
|
15
16
|
- `process/` — child processes, kill tree, env cleaning, pid liveness, instance lock.
|
|
17
|
+
- `project-pages/` — Project Home pages library, competitor matrix store/HTML, player bridge.
|
|
16
18
|
- `scheduler/` — dispatch loop, session slots, gates, supervisors, queue helpers.
|
|
17
19
|
- `telemetry/` — audit/ops error logs, crash and OTLP telemetry.
|
|
18
20
|
- `util/` — generic pure helpers (atomic fs, kebab, home/cwd encoding, JSON extract, tail).
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Bounded: never enumerates ~/.claude/projects, only stats its candidate list.
|
|
17
17
|
* The active-index.json read and the archive scan are memoised per cwd on
|
|
18
|
-
*
|
|
18
|
+
* restorableSessions.cjs's keyOf (dev:ino:ctimeMs:mtimeMs:size; mtimeMs:size
|
|
19
|
+
* alone misses a same-size, same-mtime rewrite — see keyOf) because
|
|
19
20
|
* usageFor() can call this for up to 500 ids in one IPC.
|
|
20
21
|
*
|
|
21
22
|
* Ops-root hazard (see epicSpawnCwd.cjs): `cwd` here is the PROJECT cwd used
|
|
@@ -29,7 +30,7 @@ const { encodeCwd } = require('../util/encodeCwd.cjs');
|
|
|
29
30
|
const { readActiveIndex } = require('./epicMint.cjs');
|
|
30
31
|
const { resolveEpicSpawnCwd } = require('./epicSpawnCwd.cjs');
|
|
31
32
|
|
|
32
|
-
/** Map<cwd, { key, sessions }> — active-index.json parse, keyed on
|
|
33
|
+
/** Map<cwd, { key, sessions }> — active-index.json parse, keyed on keyOf(stat). */
|
|
33
34
|
const indexCache = new Map();
|
|
34
35
|
/** Map<cwd, { dirKey, files: Map<name,{key,sid,dir}>, byId: Map<sid,string[]> }> */
|
|
35
36
|
const archiveCache = new Map();
|
|
@@ -45,8 +46,8 @@ function emptyResult() {
|
|
|
45
46
|
|
|
46
47
|
function statKey(statSync, p) {
|
|
47
48
|
try {
|
|
48
|
-
|
|
49
|
-
return
|
|
49
|
+
// Lazy: restorableSessions.cjs is heavier than this module needs at load.
|
|
50
|
+
return require('./restorableSessions.cjs').keyOf(statSync(p));
|
|
50
51
|
} catch {
|
|
51
52
|
return 'missing';
|
|
52
53
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* row never takes an interactive row's place. Per-kind budgets exist because
|
|
30
30
|
* a project with claude -p automation has ~98% headless transcripts: one
|
|
31
31
|
* shared budget listed 48 headless + 2 interactive rows on this repo;
|
|
32
|
-
* - memoises the claimed-id scan per cwd on each ops file's
|
|
32
|
+
* - memoises the claimed-id scan per cwd on each ops file's stat key (keyOf), so
|
|
33
33
|
* an unchanged Epic file is never re-read (epicTranscriptPath.cjs's shape).
|
|
34
34
|
* The list path scans through fs.promises (claimedClaudeSessionIdsAsync): a
|
|
35
35
|
* cold scan reads every archived Epic file, which blocked 191 ms when sync.
|
|
@@ -131,16 +131,23 @@ function __resetCacheForTests() {
|
|
|
131
131
|
/**
|
|
132
132
|
* The memo key. One formatter for both stat paths, so each reader can reuse
|
|
133
133
|
* the records the other wrote.
|
|
134
|
+
*
|
|
135
|
+
* mtimeMs:size alone served stale ids: a rewrite that swaps one claudeSessionId
|
|
136
|
+
* for another is always the same size (UUIDs are fixed-length), and it keeps
|
|
137
|
+
* its mtime when it lands within one timestamp tick (coarse-mtime filesystems)
|
|
138
|
+
* or has its mtime restored. dev:ino changes on every tmp+rename write (how
|
|
139
|
+
* atomicFs writes Epic files), and ctime moves on every write and can't be
|
|
140
|
+
* set back from user space.
|
|
134
141
|
* @param {import('node:fs').Stats} s
|
|
135
|
-
* @returns {string} `mtimeMs:size`
|
|
142
|
+
* @returns {string} `dev:ino:ctimeMs:mtimeMs:size`
|
|
136
143
|
*/
|
|
137
144
|
function keyOf(s) {
|
|
138
|
-
return `${s.mtimeMs}:${s.size}`;
|
|
145
|
+
return `${s.dev}:${s.ino}:${s.ctimeMs}:${s.mtimeMs}:${s.size}`;
|
|
139
146
|
}
|
|
140
147
|
|
|
141
148
|
/**
|
|
142
149
|
* @param {string} file
|
|
143
|
-
* @returns {string}
|
|
150
|
+
* @returns {string} keyOf(stat), or 'missing'
|
|
144
151
|
*/
|
|
145
152
|
function statKey(file) {
|
|
146
153
|
try {
|
|
@@ -153,7 +160,7 @@ function statKey(file) {
|
|
|
153
160
|
/**
|
|
154
161
|
* statKey through fs.promises.
|
|
155
162
|
* @param {string} file
|
|
156
|
-
* @returns {Promise<string>}
|
|
163
|
+
* @returns {Promise<string>} keyOf(stat), or 'missing'
|
|
157
164
|
*/
|
|
158
165
|
async function statKeyAsync(file) {
|
|
159
166
|
try {
|
|
@@ -257,7 +264,7 @@ function isArchiveName(name) {
|
|
|
257
264
|
|
|
258
265
|
/**
|
|
259
266
|
* First half of the per-file archive-record update both readers share: the
|
|
260
|
-
* memo's record while the file's
|
|
267
|
+
* memo's record while the file's stat key is unchanged, else null.
|
|
261
268
|
* @param {Map<string, ArchiveRec>} prevFiles
|
|
262
269
|
* @param {string} name
|
|
263
270
|
* @param {string} key
|
|
@@ -296,7 +303,7 @@ function commitClaimed(cwd, entry) {
|
|
|
296
303
|
/**
|
|
297
304
|
* Every claudeSessionId an Epic of this project owns: active-index.json plus
|
|
298
305
|
* each archived prompt-sessions/<id>.json. Memoised per cwd on each file's
|
|
299
|
-
*
|
|
306
|
+
* stat key (keyOf), so an unchanged file is never re-read (one statSync per file per
|
|
300
307
|
* call); the memo is shared with claimedClaudeSessionIdsAsync. A cwd with no ops
|
|
301
308
|
* root (relative, tmpdir or linked worktree) cannot hold Epics, so it owns
|
|
302
309
|
* nothing. Sync, for the mint gate (checkRestorableSessionSync).
|
|
@@ -333,7 +340,7 @@ function claimedClaudeSessionIds(cwd, deps) {
|
|
|
333
340
|
* claimedClaudeSessionIds through fs.promises (readdir, stat and readFile, at
|
|
334
341
|
* most 16 files in flight), for the list path. A cold scan reads every archived
|
|
335
342
|
* Epic file; done sync it blocked the main loop for 191 ms. Same memo as the
|
|
336
|
-
* sync reader, so either one re-reads only the files whose
|
|
343
|
+
* sync reader, so either one re-reads only the files whose stat key changed
|
|
337
344
|
* since the last scan by either. active-index.json stays a readActiveIndex read,
|
|
338
345
|
* memoised on its own key as in the sync reader.
|
|
339
346
|
* @param {string} cwd Project cwd (mapped to its ops root by opsPath).
|
|
@@ -828,6 +835,7 @@ function checkRestorableSessionSync(cwd, sessionId, deps) {
|
|
|
828
835
|
|
|
829
836
|
module.exports = {
|
|
830
837
|
SESSION_ID_RE,
|
|
838
|
+
keyOf,
|
|
831
839
|
claimedClaudeSessionIds,
|
|
832
840
|
claimedClaudeSessionIdsAsync,
|
|
833
841
|
listRestorableSessions,
|
|
@@ -112,11 +112,12 @@ async function dispatchMacroJob(
|
|
|
112
112
|
goal,
|
|
113
113
|
acceptanceCriteria: [
|
|
114
114
|
`${artifactPaths[0]} is written during this run by the save tool your persona names, never by hand.`,
|
|
115
|
-
'Nothing in the repository is committed.',
|
|
115
|
+
'Nothing in the repository is committed. No commit is the expected result: once the gate is green, end with SCHEDULER_VERDICT: PASS, never FAIL for the missing commit.',
|
|
116
116
|
],
|
|
117
117
|
implementationNotes:
|
|
118
118
|
`Work as the ${macro.agentName} persona (your system prompt) end to end. This build was started from Project Home and no one is watching: never stop to ask. `
|
|
119
|
-
+ 'Build outside the repository (mktemp -d under ~/.cache). SM_PROJECT_ROOT is the project main checkout; the save tool writes there, so omit its cwd.'
|
|
119
|
+
+ 'Build outside the repository (mktemp -d under ~/.cache). SM_PROJECT_ROOT is the project main checkout; the save tool writes there, so omit its cwd. '
|
|
120
|
+
+ 'This build is artifact-only (deliverable: artifact) and lands no commit by design: a green gate with no commit means SCHEDULER_VERDICT: PASS.',
|
|
120
121
|
gate: absPaths.map((p) => buildGate(p, t)),
|
|
121
122
|
};
|
|
122
123
|
if (typeof effort === 'string' && PRD_EFFORT_LEVELS.includes(effort)) input.effort = effort;
|
|
@@ -183,6 +183,18 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
|
|
|
183
183
|
tools: "Read, Grep, Glob, Bash, Edit, Write",
|
|
184
184
|
},
|
|
185
185
|
},
|
|
186
|
+
{
|
|
187
|
+
commit: "seed-v6",
|
|
188
|
+
bodySha256: "2f774cedfc73f0593e64fca70110c40b46c0cc0614a1dc9e4a22e847e23c2400",
|
|
189
|
+
fm: {
|
|
190
|
+
description: "Executes exactly one already-scoped PRD at a time, headless, start to finish — reads the PRD's Goal/Acceptance Criteria/Implementation notes and standards.md, implements it, verifies against its own AC, and reports. Has no visibility into the overall plan — that's architect's job. This is the default persona a scheduled PRD runs as: the scheduler resolves a PRD's `agentType` frontmatter field (default `dev-lead`) to this file and launches the headless executor AS this persona via `--append-system-prompt`.",
|
|
191
|
+
effort: "medium",
|
|
192
|
+
executorOnly: "true",
|
|
193
|
+
model: "sonnet",
|
|
194
|
+
title: "Engineering — Software Engineer",
|
|
195
|
+
tools: "Read, Grep, Glob, Bash, Edit, Write",
|
|
196
|
+
},
|
|
197
|
+
},
|
|
186
198
|
],
|
|
187
199
|
"project-home-builder": [
|
|
188
200
|
// Not from src/seed git history: this body was written to ~/.claude/agents by this repo's own
|
|
@@ -259,6 +271,17 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
|
|
|
259
271
|
effort: "medium",
|
|
260
272
|
},
|
|
261
273
|
},
|
|
274
|
+
{
|
|
275
|
+
commit: "seed-v6-no-commit-pass",
|
|
276
|
+
bodySha256: "69890c9b83fb8f2f3a10ab2e0b6a932c3f86be9d7c1d40276113d08fc4d5ba28",
|
|
277
|
+
fm: {
|
|
278
|
+
description: "Reads a project and writes ONE Knowledge Page (Overview by default, or How it works, FAQ, or a custom topic) for its Project Home tab, then saves it with a single project_page_write call.",
|
|
279
|
+
tools: "Read, Grep, Glob, Bash, Write, Edit, mcp__session-manager-scheduler__project_home_write, mcp__session-manager-scheduler__project_page_write",
|
|
280
|
+
title: "Project Home — Builder",
|
|
281
|
+
model: "sonnet",
|
|
282
|
+
effort: "medium",
|
|
283
|
+
},
|
|
284
|
+
},
|
|
262
285
|
],
|
|
263
286
|
"validator": [
|
|
264
287
|
{
|
|
@@ -510,6 +533,17 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
|
|
|
510
533
|
effort: "max",
|
|
511
534
|
},
|
|
512
535
|
},
|
|
536
|
+
{
|
|
537
|
+
commit: "seed-v12",
|
|
538
|
+
bodySha256: "d1d613bde0b771872ecbd2e353e8f872fcca2949b51ba595a88c810f4a03bd66",
|
|
539
|
+
fm: {
|
|
540
|
+
description: "30-second or 1-minute self-contained HTML/JS demo video for Project Home, saved via project_video_write.",
|
|
541
|
+
effort: "max",
|
|
542
|
+
model: "opus",
|
|
543
|
+
title: "Project Home — Demo Video",
|
|
544
|
+
tools: "Read, Grep, Glob, Bash, Write, Edit, mcp__session-manager-scheduler__project_demo_video_write, mcp__session-manager-scheduler__project_video_write, mcp__session-manager-scheduler__project_character_write",
|
|
545
|
+
},
|
|
546
|
+
},
|
|
513
547
|
],
|
|
514
548
|
"blender-artist": [
|
|
515
549
|
{
|
|
@@ -125,6 +125,22 @@ function parseInlineList(raw) {
|
|
|
125
125
|
.filter((s) => s.length > 0);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
/**
|
|
129
|
+
* The one definition of an artifact-only PRD: `deliverable: artifact` plus a
|
|
130
|
+
* non-empty `artifactPaths` list. Used by runVerify's artifact exemption,
|
|
131
|
+
* executeJob's finish-protocol variant and the scheduler's queue-row checks —
|
|
132
|
+
* keep every caller on this predicate so the copies cannot drift apart.
|
|
133
|
+
*
|
|
134
|
+
* @param {{ deliverable?: unknown, artifactPaths?: unknown } | null | undefined} decl
|
|
135
|
+
* @returns {boolean}
|
|
136
|
+
*/
|
|
137
|
+
function isArtifactOnlyDeclaration(decl) {
|
|
138
|
+
if (decl == null || typeof decl !== 'object') return false;
|
|
139
|
+
return decl.deliverable === 'artifact'
|
|
140
|
+
&& Array.isArray(decl.artifactPaths)
|
|
141
|
+
&& decl.artifactPaths.length > 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
128
144
|
function arraysEqual(a, b) {
|
|
129
145
|
if (!Array.isArray(a) || !Array.isArray(b)) return false;
|
|
130
146
|
return a.length === b.length && a.every((v, i) => v === b[i]);
|
|
@@ -322,4 +338,12 @@ function serializePrdFile(fm, body) {
|
|
|
322
338
|
return `---\n${fmText}\n---\n${body}`;
|
|
323
339
|
}
|
|
324
340
|
|
|
325
|
-
module.exports = {
|
|
341
|
+
module.exports = {
|
|
342
|
+
splitFrontmatter,
|
|
343
|
+
parsePrdFile,
|
|
344
|
+
serializePrdFile,
|
|
345
|
+
parseInlineList,
|
|
346
|
+
isArtifactOnlyDeclaration,
|
|
347
|
+
RECOGNIZED_KEYS,
|
|
348
|
+
PRD_EFFORT_LEVELS,
|
|
349
|
+
};
|
|
@@ -95,6 +95,9 @@ const ScheduleJobSchema = z
|
|
|
95
95
|
epicId: z.string().nullable().optional(),
|
|
96
96
|
// Macro press this job's PRD came from (PRD frontmatter `macroId`).
|
|
97
97
|
macroId: z.string().nullable().optional(),
|
|
98
|
+
// PRD frontmatter artifact-only declaration (`deliverable: artifact` + `artifactPaths`).
|
|
99
|
+
deliverable: z.literal('artifact').nullable().optional(),
|
|
100
|
+
artifactPaths: z.array(z.string()).nullable().optional(),
|
|
98
101
|
// PRD frontmatter `effort` — a per-run level from a macro press (outranks the persona's).
|
|
99
102
|
effort: z.string().nullable().optional(),
|
|
100
103
|
statusHistory: z.array(ScheduleJobStatusHistoryEntrySchema).optional(),
|
|
@@ -71,7 +71,9 @@ function mintEventId() {
|
|
|
71
71
|
* validation pass is what may later move it to 'verified'/'refuted'. `agentType`
|
|
72
72
|
* (the job's agent) and `digestKey` (the settle digest's stable key) ride the
|
|
73
73
|
* same meta arg and are copied the same way, as is `notice` (PRD 2950 — a
|
|
74
|
-
* marker like 'job-not-queued'
|
|
74
|
+
* marker like 'job-not-queued', or PRD 3116's 'build-done'/'build-failed', the
|
|
75
|
+
* renderer turns into a distinct notice) and `buildOutput` (PRD 3116 — `{ kind,
|
|
76
|
+
* id, title }` of a macro build's saved entry). All
|
|
75
77
|
* keys are added to the event object only when present in `meta`, never as
|
|
76
78
|
* `undefined`-valued keys, so events appended without them serialize
|
|
77
79
|
* identically to before.
|
|
@@ -104,6 +106,10 @@ async function appendResponseEventWithReason(cwd, sourcePromptId, text, meta = {
|
|
|
104
106
|
if (meta && meta.agentType) event.agentType = meta.agentType;
|
|
105
107
|
if (meta && meta.digestKey) event.digestKey = meta.digestKey;
|
|
106
108
|
if (meta && meta.notice) event.notice = meta.notice;
|
|
109
|
+
if (meta && meta.buildOutput && typeof meta.buildOutput === 'object') {
|
|
110
|
+
const { kind, id, title } = meta.buildOutput;
|
|
111
|
+
event.buildOutput = { kind, id, title };
|
|
112
|
+
}
|
|
107
113
|
data.events[sourcePromptId] = [...events, event];
|
|
108
114
|
await config.writeJson(path, data, { writer: 'scheduler' });
|
|
109
115
|
broadcast(EVENT_APPENDED_CHANNEL, { cwd, promptSessionId: sourcePromptId, event });
|
package/src/main/runVerify.cjs
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
const fs = require('node:fs');
|
|
45
45
|
const path = require('node:path');
|
|
46
46
|
const { execFileSync } = require('node:child_process');
|
|
47
|
-
const { parsePrdFile } = require('./lib/prd/prdFrontmatter.cjs');
|
|
47
|
+
const { parsePrdFile, isArtifactOnlyDeclaration } = require('./lib/prd/prdFrontmatter.cjs');
|
|
48
48
|
const { isSatisfiedDepRow } = require('./lib/prd/depSlugResolve.cjs');
|
|
49
49
|
|
|
50
50
|
const VERDICTS_SCHEMA_VERSION = 1;
|
|
@@ -907,7 +907,7 @@ async function verifyRun({
|
|
|
907
907
|
if (!mergeMainVerified && !priorRunVerified) {
|
|
908
908
|
let fm = null;
|
|
909
909
|
try { fm = parsePrdFile(prdFullText).frontmatter; } catch { fm = null; }
|
|
910
|
-
if (
|
|
910
|
+
if (isArtifactOnlyDeclaration(fm)) {
|
|
911
911
|
const check = artifactsCheck({
|
|
912
912
|
cwd: [queueEntry?.cwd, worktreeDir],
|
|
913
913
|
paths: fm.artifactPaths,
|
|
@@ -17,7 +17,7 @@ const fs = require('node:fs');
|
|
|
17
17
|
const fsp = require('node:fs/promises');
|
|
18
18
|
const os = require('node:os');
|
|
19
19
|
const path = require('node:path');
|
|
20
|
-
const { splitFrontmatter, PRD_EFFORT_LEVELS } = require('../lib/prd/prdFrontmatter.cjs');
|
|
20
|
+
const { splitFrontmatter, parseInlineList, PRD_EFFORT_LEVELS } = require('../lib/prd/prdFrontmatter.cjs');
|
|
21
21
|
const { deriveEpicIdFromPrdPath } = require('../lib/prd/prdLocations.cjs');
|
|
22
22
|
const { parseFilesSection } = require('../lib/prd/prdGateFiles.cjs');
|
|
23
23
|
const { reportDanglingAgentTypeOnce } = require('../lib/prd/prdAgentType.cjs');
|
|
@@ -45,6 +45,17 @@ let prdDirMtime = -1;
|
|
|
45
45
|
let prdDirFiles = null; // sorted absolute paths
|
|
46
46
|
const prdFileCache = new Map(); // path -> { mtimeMs, ino, parsed }
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* `artifactPaths: [a, b]` → ['a', 'b'] — the inline-list form only, same
|
|
50
|
+
* shape prdFrontmatter.cjs's parsePrdFile (runVerify's artifact exemption,
|
|
51
|
+
* executeJob's finish variant) recognizes. Empty / absent / malformed → null.
|
|
52
|
+
*/
|
|
53
|
+
function parseArtifactPaths(raw) {
|
|
54
|
+
if (typeof raw !== 'string') return null;
|
|
55
|
+
const list = parseInlineList(raw);
|
|
56
|
+
return list && list.length > 0 ? list : null;
|
|
57
|
+
}
|
|
58
|
+
|
|
48
59
|
/**
|
|
49
60
|
* Parse a PRD file from disk without any caching. Reads bytes once, decodes
|
|
50
61
|
* frontmatter, and folds in the parallel-group number from the filename when
|
|
@@ -133,6 +144,11 @@ async function parsePrdRaw(filePath) {
|
|
|
133
144
|
planId: (typeof fm.planId === 'string' && /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/.test(fm.planId)) ? fm.planId : null,
|
|
134
145
|
// Macro press that minted this PRD (prdFrontmatter.cjs MACRO_ID_RE); malformed reads as absent.
|
|
135
146
|
macroId: (typeof fm.macroId === 'string' && /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(fm.macroId.trim())) ? fm.macroId.trim() : null,
|
|
147
|
+
// Artifact-only declaration (PRD 3114): copied onto queue rows so the
|
|
148
|
+
// row-based artifact-only checks in scheduler.cjs see it. Exactly
|
|
149
|
+
// 'artifact' else null; artifactPaths = non-empty strings, else null.
|
|
150
|
+
deliverable: (typeof fm.deliverable === 'string' && fm.deliverable.trim() === 'artifact') ? 'artifact' : null,
|
|
151
|
+
artifactPaths: parseArtifactPaths(fm.artifactPaths),
|
|
136
152
|
effort: (typeof fm.effort === 'string' && PRD_EFFORT_LEVELS.includes(fm.effort.trim())) ? fm.effort.trim() : null,
|
|
137
153
|
// Opt-in exclusive-lease flag (PRD 1107, quietMachineLease.cjs +
|
|
138
154
|
// schedulerBatch.cjs's pickNextBatch). Only a literal `true` opts in —
|