@pennixrv/trellis 0.6.27 → 0.6.29
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/commands/channel/agent-loader.d.ts +3 -1
- package/dist/commands/channel/agent-loader.d.ts.map +1 -1
- package/dist/commands/channel/agent-loader.js +32 -1
- package/dist/commands/channel/agent-loader.js.map +1 -1
- package/dist/commands/channel/guard.d.ts +21 -2
- package/dist/commands/channel/guard.d.ts.map +1 -1
- package/dist/commands/channel/guard.js +105 -4
- package/dist/commands/channel/guard.js.map +1 -1
- package/dist/commands/channel/index.d.ts.map +1 -1
- package/dist/commands/channel/index.js +22 -5
- package/dist/commands/channel/index.js.map +1 -1
- package/dist/commands/channel/run.d.ts.map +1 -1
- package/dist/commands/channel/run.js +15 -9
- package/dist/commands/channel/run.js.map +1 -1
- package/dist/commands/channel/spawn.d.ts +4 -0
- package/dist/commands/channel/spawn.d.ts.map +1 -1
- package/dist/commands/channel/spawn.js +59 -7
- package/dist/commands/channel/spawn.js.map +1 -1
- package/dist/commands/channel/workers.d.ts +8 -0
- package/dist/commands/channel/workers.d.ts.map +1 -0
- package/dist/commands/channel/workers.js +30 -0
- package/dist/commands/channel/workers.js.map +1 -0
- package/dist/migrations/manifests/0.6.27.json +9 -0
- package/dist/migrations/manifests/0.6.28.json +9 -0
- package/dist/migrations/manifests/0.6.29.json +9 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +23 -4
- package/dist/templates/common/bundled-skills/trellis-channel/references/subnode-work.md +37 -8
- package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +25 -6
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +2 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +2 -1
- package/dist/templates/trellis/agents/subnode.env +4 -0
- package/dist/templates/trellis/agents/subnode.md +5 -0
- package/dist/templates/trellis/config.yaml +9 -1
- package/dist/templates/trellis/index.d.ts +5 -3
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +7 -3
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/common/ownership_record.py +414 -0
- package/dist/templates/trellis/scripts/subnode_artifact.py +100 -1
- package/dist/templates/trellis/scripts/task.py +114 -1
- package/package.json +2 -2
|
@@ -14,13 +14,25 @@ import fs from "node:fs";
|
|
|
14
14
|
import { createChannel } from "./create.js";
|
|
15
15
|
import { channelRm } from "./rm.js";
|
|
16
16
|
import { channelSend } from "./send.js";
|
|
17
|
-
import { channelSpawn } from "./spawn.js";
|
|
17
|
+
import { applySubnodeSupervisorDefaults, channelSpawn } from "./spawn.js";
|
|
18
18
|
import { channelDir, eventsPath } from "./store/paths.js";
|
|
19
19
|
import { readLastSeq } from "./store/events.js";
|
|
20
20
|
import { watchEvents } from "./store/watch.js";
|
|
21
21
|
export async function channelRun(opts) {
|
|
22
22
|
const name = opts.name ?? `run-${crypto.randomBytes(4).toString("hex")}`;
|
|
23
|
-
|
|
23
|
+
// Keep the ordinary one-shot default at five minutes while letting an
|
|
24
|
+
// explicitly selected subnode role use its project dispatch default.
|
|
25
|
+
const spawnOptions = applySubnodeSupervisorDefaults({
|
|
26
|
+
agent: opts.agent,
|
|
27
|
+
provider: opts.provider,
|
|
28
|
+
as: opts.as,
|
|
29
|
+
cwd: opts.cwd,
|
|
30
|
+
model: opts.model,
|
|
31
|
+
...(opts.timeoutMs !== undefined ? { timeoutMs: opts.timeoutMs } : {}),
|
|
32
|
+
files: opts.files,
|
|
33
|
+
jsonls: opts.jsonls,
|
|
34
|
+
});
|
|
35
|
+
const timeoutMs = spawnOptions.timeoutMs ?? 5 * 60 * 1000;
|
|
24
36
|
await createChannel(name, {
|
|
25
37
|
by: "main",
|
|
26
38
|
cwd: opts.cwd,
|
|
@@ -34,14 +46,8 @@ export async function channelRun(opts) {
|
|
|
34
46
|
let succeeded = false;
|
|
35
47
|
try {
|
|
36
48
|
const spawned = await channelSpawn(name, {
|
|
37
|
-
|
|
38
|
-
provider: opts.provider,
|
|
39
|
-
as: opts.as,
|
|
40
|
-
cwd: opts.cwd,
|
|
41
|
-
model: opts.model,
|
|
49
|
+
...spawnOptions,
|
|
42
50
|
timeoutMs,
|
|
43
|
-
files: opts.files,
|
|
44
|
-
jsonls: opts.jsonls,
|
|
45
51
|
});
|
|
46
52
|
workerName = spawned.worker;
|
|
47
53
|
await channelSend(name, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/channel/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AAGzB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/channel/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AAGzB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,8BAA8B,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAqB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAmB/C,MAAM,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C;YACP,SAAS;QACX,CAAC;IACH,CAAC;IACD,MAAM,SAAS,GAAG,MAAM;SACrB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC;SAC1D,GAAG,EAAE,CAAC;IACT,IAAI,CAAC,SAAS;QAAE,OAAO;IACvB,MAAM,IAAI,GAAI,SAA+B,CAAC,IAAI,IAAI,EAAE,CAAC;IACzD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -35,6 +35,10 @@ export interface SpawnOptions {
|
|
|
35
35
|
*/
|
|
36
36
|
maxLiveWorkers?: number;
|
|
37
37
|
}
|
|
38
|
+
/** Parse a role-owned KEY=VALUE file without shell expansion or interpolation. */
|
|
39
|
+
export declare function parseAgentEnvFile(filePath: string): Record<string, string>;
|
|
40
|
+
/** Apply supervisor role defaults without consuming guard env precedence. */
|
|
41
|
+
export declare function applySubnodeSupervisorDefaults(opts: SpawnOptions, cwd?: string): SpawnOptions;
|
|
38
42
|
export declare function channelSpawn(channelName: string, opts: SpawnOptions): Promise<{
|
|
39
43
|
pid: number;
|
|
40
44
|
log: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/commands/channel/spawn.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources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,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAkFvD"}
|
|
@@ -5,11 +5,45 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
import { loadAgent } from "./agent-loader.js";
|
|
6
6
|
import { assembleContext } from "./context-loader.js";
|
|
7
7
|
import { resolveTrustedRoots } from "./context-trust.js";
|
|
8
|
-
import { enforceSpawnBudget, formatBudgetOverflowError, resolveWorkerGuardConfig, } from "./guard.js";
|
|
8
|
+
import { enforceSpawnBudget, formatBudgetOverflowError, loadSubnodeDispatchConfig, resolveWorkerGuardConfig, } from "./guard.js";
|
|
9
9
|
import { withLock } from "./store/lock.js";
|
|
10
10
|
import { channelDir, projectDir, resolveExistingChannelRef, workerFile, workerLockPath, } from "./store/paths.js";
|
|
11
11
|
import { parseChannelScope } from "./store/schema.js";
|
|
12
12
|
import { writeSupervisorConfig } from "./supervisor.js";
|
|
13
|
+
/** Parse a role-owned KEY=VALUE file without shell expansion or interpolation. */
|
|
14
|
+
export function parseAgentEnvFile(filePath) {
|
|
15
|
+
const env = {};
|
|
16
|
+
const lines = fs.readFileSync(filePath, "utf-8").split(/\r?\n/);
|
|
17
|
+
for (const [index, rawLine] of lines.entries()) {
|
|
18
|
+
const line = rawLine.trim();
|
|
19
|
+
if (!line || line.startsWith("#"))
|
|
20
|
+
continue;
|
|
21
|
+
const separator = line.indexOf("=");
|
|
22
|
+
const name = separator < 0 ? "" : line.slice(0, separator).trim();
|
|
23
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
|
|
24
|
+
throw new Error(`Invalid environment entry in ${filePath}:${index + 1}; expected KEY=VALUE`);
|
|
25
|
+
}
|
|
26
|
+
const value = line.slice(separator + 1).trim();
|
|
27
|
+
if (value.includes("\0")) {
|
|
28
|
+
throw new Error(`Environment value for '${name}' contains a NUL byte`);
|
|
29
|
+
}
|
|
30
|
+
env[name] = value;
|
|
31
|
+
}
|
|
32
|
+
return env;
|
|
33
|
+
}
|
|
34
|
+
/** Apply supervisor role defaults without consuming guard env precedence. */
|
|
35
|
+
export function applySubnodeSupervisorDefaults(opts, cwd = process.cwd()) {
|
|
36
|
+
if (opts.agent !== "subnode")
|
|
37
|
+
return opts;
|
|
38
|
+
const config = loadSubnodeDispatchConfig(cwd);
|
|
39
|
+
return {
|
|
40
|
+
...opts,
|
|
41
|
+
...(opts.timeoutMs === undefined ? { timeoutMs: config.timeoutMs } : {}),
|
|
42
|
+
...(opts.warnBeforeMs === undefined
|
|
43
|
+
? { warnBeforeMs: config.warnBeforeMs }
|
|
44
|
+
: {}),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
13
47
|
function resolveSpawn(channelName, opts) {
|
|
14
48
|
const cwd = opts.cwd ?? process.cwd();
|
|
15
49
|
const trustedRoots = resolveTrustedRoots(cwd);
|
|
@@ -17,12 +51,14 @@ function resolveSpawn(channelName, opts) {
|
|
|
17
51
|
let provider = opts.provider;
|
|
18
52
|
let model = opts.model;
|
|
19
53
|
let as = opts.as;
|
|
54
|
+
let env;
|
|
20
55
|
if (opts.agent) {
|
|
21
56
|
const agent = loadAgent(opts.agent, cwd, trustedRoots);
|
|
22
57
|
agentBody = agent.systemPrompt || undefined;
|
|
23
58
|
provider = provider ?? agent.provider;
|
|
24
59
|
model = model ?? agent.model;
|
|
25
60
|
as = as ?? agent.name;
|
|
61
|
+
env = agent.envFile ? parseAgentEnvFile(agent.envFile) : undefined;
|
|
26
62
|
}
|
|
27
63
|
if (!provider) {
|
|
28
64
|
throw new Error("Missing --provider (and the agent definition has no `provider:` frontmatter)");
|
|
@@ -37,6 +73,7 @@ function resolveSpawn(channelName, opts) {
|
|
|
37
73
|
as,
|
|
38
74
|
systemPrompt,
|
|
39
75
|
model,
|
|
76
|
+
...(env ? { env } : {}),
|
|
40
77
|
contextFiles: context.paths,
|
|
41
78
|
contextManifests: context.manifests,
|
|
42
79
|
};
|
|
@@ -85,17 +122,31 @@ export async function channelSpawn(channelName, opts) {
|
|
|
85
122
|
if (!fs.existsSync(channelDir(channelName, ref.project))) {
|
|
86
123
|
throw new Error(`Channel '${channelName}' not found at ${channelDir(channelName, ref.project)}`);
|
|
87
124
|
}
|
|
88
|
-
const
|
|
125
|
+
const subnodeConfig = opts.agent === "subnode"
|
|
126
|
+
? loadSubnodeDispatchConfig(process.cwd())
|
|
127
|
+
: undefined;
|
|
128
|
+
const effectiveOpts = applySubnodeSupervisorDefaults(opts);
|
|
129
|
+
const resolved = resolveSpawn(channelName, effectiveOpts);
|
|
89
130
|
// OOM guard: enforce live-worker budget for this project/scope before
|
|
90
131
|
// forking a supervisor. Expired idle workers are cleaned first; if the
|
|
91
132
|
// budget is still exhausted we reject rather than guess which non-
|
|
92
133
|
// expired worker to kill.
|
|
93
134
|
const guardPolicy = resolveWorkerGuardConfig({
|
|
94
|
-
...(
|
|
95
|
-
? { flagIdleTimeoutMs:
|
|
135
|
+
...(effectiveOpts.idleTimeoutMs !== undefined
|
|
136
|
+
? { flagIdleTimeoutMs: effectiveOpts.idleTimeoutMs }
|
|
96
137
|
: {}),
|
|
97
|
-
...(
|
|
98
|
-
? { flagMaxLiveWorkers:
|
|
138
|
+
...(effectiveOpts.maxLiveWorkers !== undefined
|
|
139
|
+
? { flagMaxLiveWorkers: effectiveOpts.maxLiveWorkers }
|
|
140
|
+
: {}),
|
|
141
|
+
...(subnodeConfig
|
|
142
|
+
? {
|
|
143
|
+
roleDefaults: {
|
|
144
|
+
...(subnodeConfig.idleTimeoutMs !== undefined
|
|
145
|
+
? { idleTimeoutMs: subnodeConfig.idleTimeoutMs }
|
|
146
|
+
: {}),
|
|
147
|
+
maxLiveWorkers: subnodeConfig.maxLiveWorkers,
|
|
148
|
+
},
|
|
149
|
+
}
|
|
99
150
|
: {}),
|
|
100
151
|
});
|
|
101
152
|
// Serialize the budget check across the whole project bucket. A per-worker
|
|
@@ -122,7 +173,7 @@ export async function channelSpawn(channelName, opts) {
|
|
|
122
173
|
// with us. The lock is released as soon as we've handed off to a detached
|
|
123
174
|
// supervisor (pid file in place).
|
|
124
175
|
return withLock(workerLockPath(channelName, resolved.as, ref.project), async () => {
|
|
125
|
-
return spawnLocked(channelName, resolved,
|
|
176
|
+
return spawnLocked(channelName, resolved, effectiveOpts, ref.project, guardPolicy.idleTimeoutMs);
|
|
126
177
|
});
|
|
127
178
|
});
|
|
128
179
|
}
|
|
@@ -152,6 +203,7 @@ async function spawnLocked(channelName, resolved, opts, project, idleTimeoutMs)
|
|
|
152
203
|
idleTimeoutMs,
|
|
153
204
|
spawnedBy,
|
|
154
205
|
...(opts.inboxPolicy ? { inboxPolicy: opts.inboxPolicy } : {}),
|
|
206
|
+
...(resolved.env ? { env: resolved.env } : {}),
|
|
155
207
|
...(opts.agent ? { agent: opts.agent } : {}),
|
|
156
208
|
...(resolved.contextFiles.length > 0
|
|
157
209
|
? { contextFiles: resolved.contextFiles }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../../src/commands/channel/spawn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,UAAU,EACV,UAAU,EACV,yBAA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AC;AAChD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface WorkersOptions {
|
|
2
|
+
scope?: string;
|
|
3
|
+
includeTerminal?: boolean;
|
|
4
|
+
json?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/** Show the core's durable worker projection; never infer state from PIDs. */
|
|
7
|
+
export declare function channelWorkers(channelName: string, opts?: WorkersOptions): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=workers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workers.d.ts","sourceRoot":"","sources":["../../../src/commands/channel/workers.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,8EAA8E;AAC9E,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,IAAI,CAAC,CAgBf"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { listWorkers, parseChannelScope, } from "@pennixrv/trellis-core/channel";
|
|
2
|
+
/** Show the core's durable worker projection; never infer state from PIDs. */
|
|
3
|
+
export async function channelWorkers(channelName, opts = {}) {
|
|
4
|
+
const workers = await listWorkers({
|
|
5
|
+
channel: channelName,
|
|
6
|
+
scope: parseChannelScope(opts.scope),
|
|
7
|
+
includeTerminal: opts.includeTerminal,
|
|
8
|
+
});
|
|
9
|
+
if (opts.json) {
|
|
10
|
+
console.log(JSON.stringify(workers, null, 2));
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (workers.length === 0) {
|
|
14
|
+
console.log("No workers found.");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
console.log("WORKER\tLIFECYCLE\tACTIVITY\tPENDING\tLAST_SEQ");
|
|
18
|
+
for (const worker of workers)
|
|
19
|
+
printWorker(worker);
|
|
20
|
+
}
|
|
21
|
+
function printWorker(worker) {
|
|
22
|
+
console.log([
|
|
23
|
+
worker.workerId,
|
|
24
|
+
worker.lifecycle,
|
|
25
|
+
worker.activity,
|
|
26
|
+
worker.pendingMessageCount,
|
|
27
|
+
worker.lastSeq,
|
|
28
|
+
].join("\t"));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=workers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workers.js","sourceRoot":"","sources":["../../../src/commands/channel/workers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,GAElB,MAAM,gCAAgC,CAAC;AAQxC,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,WAAmB,EACnB,OAAuB,EAAE;IAEzB,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC;QAChC,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC;QACpC,eAAe,EAAE,IAAI,CAAC,eAAe;KACtC,CAAC,CAAC;IACH,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9C,OAAO;IACT,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACjC,OAAO;IACT,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAC9D,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,WAAW,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,WAAW,CAAC,MAAmB;IACtC,OAAO,CAAC,GAAG,CACT;QACE,MAAM,CAAC,QAAQ;QACf,MAAM,CAAC,SAAS;QAChB,MAAM,CAAC,QAAQ;QACf,MAAM,CAAC,mBAAmB;QAC1B,MAAM,CAAC,OAAO;KACf,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.6.27",
|
|
3
|
+
"description": "Hardens the task-bound continuation record for safe cross-session handoff state.",
|
|
4
|
+
"breaking": false,
|
|
5
|
+
"recommendMigrate": false,
|
|
6
|
+
"changelog": "**Fixes:**\n- Rechecks task identity while a continuation record operation acquires its lock.\n- Keeps continuation writes bound to the direct current Trellis session.\n\n**Internal:**\n- Keeps continuation runtime state outside version-controlled project files.",
|
|
7
|
+
"migrations": [],
|
|
8
|
+
"notes": "No project migration is required. Existing projects can run the normal `trellis update` flow."
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.6.28",
|
|
3
|
+
"description": "Publishes the ownership-safe task handoff transfer runtime.",
|
|
4
|
+
"breaking": false,
|
|
5
|
+
"recommendMigrate": false,
|
|
6
|
+
"changelog": "**Enhancements:**\n- Publishes ownership-safe task handoff transfer state and its bundled project helpers.\n\n**Internal:**\n- No project-file migration is required for this release.",
|
|
7
|
+
"migrations": [],
|
|
8
|
+
"notes": "No project migration is required. Existing projects can run the normal `trellis update` flow. This manifest restores the published 0.6.28 release entry so updates do not skip a version in the manifest chain."
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.6.29",
|
|
3
|
+
"description": "Makes bounded subnode dispatch defaults configurable and records durable coordinator review state.",
|
|
4
|
+
"breaking": false,
|
|
5
|
+
"recommendMigrate": false,
|
|
6
|
+
"changelog": "**Enhancements:**\n- Adds a durable `trellis channel workers` projection for coordinator recovery and terminal-state inspection.\n- Adds role-specific `channel.subnode` defaults for the live-worker budget, idle cleanup, supervisor timeout, and timeout warning. The generated live-worker default is 8; ordinary workers retain 6.\n- Adds create-once coordinator dispositions for validated subnode reports.\n\n**Fixes:**\n- Applies the subnode role timeout and warning defaults consistently to `channel run --agent subnode`.",
|
|
7
|
+
"migrations": [],
|
|
8
|
+
"notes": "No project migration is required. Existing projects without channel.subnode use the compatible code defaults; add the optional section from a newly initialized project when per-project subnode tuning is needed."
|
|
9
|
+
}
|
package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md
CHANGED
|
@@ -161,6 +161,20 @@ Behavior:
|
|
|
161
161
|
- **Timeout exits 124** and prints `timeout: still waiting on ...` to stderr
|
|
162
162
|
when `--all` was in play.
|
|
163
163
|
|
|
164
|
+
### `workers <name>`
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
trellis channel workers <name>
|
|
168
|
+
[--scope project|global]
|
|
169
|
+
[--include-terminal]
|
|
170
|
+
[--json]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Reads the durable worker projection from Trellis core. Without
|
|
174
|
+
`--include-terminal`, only non-terminal workers are shown. `--json` is the
|
|
175
|
+
machine-readable form for coordinator recovery and disposition checks. This
|
|
176
|
+
command does not inspect PID sidecars and does not poll.
|
|
177
|
+
|
|
164
178
|
---
|
|
165
179
|
|
|
166
180
|
## tag-vs-kind — how event shape is actually controlled
|
|
@@ -242,7 +256,7 @@ trellis channel spawn <name>
|
|
|
242
256
|
[--resume <id>] # session/thread id resume
|
|
243
257
|
[--timeout <Ns|Nm|Nh>] # auto-kill after duration
|
|
244
258
|
[--warn-before <Ns|Nm|Nh>] # supervisor_warning lead time
|
|
245
|
-
# default 5m
|
|
259
|
+
# default 5m; subnode role reads config
|
|
246
260
|
[--file <path>] ... # glob, repeatable; inject content
|
|
247
261
|
[--jsonl <path>] ... # Trellis manifest, repeatable
|
|
248
262
|
[--by <agent>] # spawn-event author
|
|
@@ -250,9 +264,9 @@ trellis channel spawn <name>
|
|
|
250
264
|
[--inbox-policy explicitOnly|broadcastAndExplicit]
|
|
251
265
|
# default explicitOnly
|
|
252
266
|
[--idle-timeout <Ns|Nm|Nh>] # OOM-guard idle TTL
|
|
253
|
-
# default 5m
|
|
267
|
+
# default 5m; subnode role reads config
|
|
254
268
|
[--max-live-workers <n>] # spawn-time live-worker budget
|
|
255
|
-
# default 6
|
|
269
|
+
# default 6; subnode role reads config
|
|
256
270
|
```
|
|
257
271
|
|
|
258
272
|
Behavior:
|
|
@@ -267,6 +281,11 @@ Behavior:
|
|
|
267
281
|
(`TRELLIS_CHANNEL_WORKER_IDLE_TIMEOUT`,
|
|
268
282
|
`TRELLIS_CHANNEL_MAX_LIVE_WORKERS`) →
|
|
269
283
|
`.trellis/config.yaml#channel.worker_guard` → built-in defaults.
|
|
284
|
+
- `--agent subnode` additionally reads `.trellis/config.yaml#channel.subnode`:
|
|
285
|
+
its `idle_timeout` / `max_live_workers` sit below explicit flags and the
|
|
286
|
+
guard environment variables but above `worker_guard`; its `timeout` /
|
|
287
|
+
`warn_before` supply the role's supervisor defaults. Generated projects set
|
|
288
|
+
`max_live_workers: 8` without changing ordinary workers' default of `6`.
|
|
270
289
|
|
|
271
290
|
### `run [name]`
|
|
272
291
|
|
|
@@ -280,7 +299,7 @@ trellis channel run [name?]
|
|
|
280
299
|
[--file <path>] ... # repeatable, glob
|
|
281
300
|
[--jsonl <path>] ... # repeatable
|
|
282
301
|
[--message <text> | --message-file <path> | --stdin]
|
|
283
|
-
[--timeout <Ns|Nm|Nh>] # default 5m
|
|
302
|
+
[--timeout <Ns|Nm|Nh>] # default 5m; subnode role reads config
|
|
284
303
|
```
|
|
285
304
|
|
|
286
305
|
Behavior:
|
|
@@ -41,6 +41,7 @@ $TASK/subnodes/$WORK_ID/$SUBNODE_ID/
|
|
|
41
41
|
brief.json # coordinator-owned and immutable after dispatch
|
|
42
42
|
worklog.md # subnode appends material progress and corrections
|
|
43
43
|
report.json # subnode-owned final pending-review result
|
|
44
|
+
disposition.json # coordinator-owned, create-once result decision
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
Do not use a terminal Channel message as the report transport. The short final
|
|
@@ -88,16 +89,23 @@ events committed after that barrier:
|
|
|
88
89
|
trellis channel create subnode-example --by main --cwd "$PWD"
|
|
89
90
|
BARRIER="$(trellis channel barrier subnode-example)"
|
|
90
91
|
trellis channel spawn subnode-example --agent subnode --provider codex \
|
|
91
|
-
--as "$SUBNODE_ID" --cwd "$PWD"
|
|
92
|
+
--as "$SUBNODE_ID" --cwd "$PWD"
|
|
92
93
|
|
|
93
94
|
printf '%s\n' "Read $TASK/subnodes/$WORK_ID/$SUBNODE_ID/brief.json and perform only that bounded work." \
|
|
94
95
|
| trellis channel send subnode-example --as main --to "$SUBNODE_ID" \
|
|
95
96
|
--stdin --delivery-mode requireRunningWorker
|
|
96
97
|
|
|
97
98
|
trellis channel wait subnode-example --as main --from "$SUBNODE_ID" \
|
|
98
|
-
--kind done,error --after-seq "$BARRIER" --timeout 30m
|
|
99
|
+
--kind done,error,killed --after-seq "$BARRIER" --timeout 30m
|
|
99
100
|
```
|
|
100
101
|
|
|
102
|
+
`channel.subnode` in `.trellis/config.yaml` supplies the role defaults for
|
|
103
|
+
`max_live_workers` (generated default `8`), `idle_timeout`, `timeout`, and
|
|
104
|
+
`warn_before`. Change that section before a dispatch group when its resource
|
|
105
|
+
or lifetime needs differ; pass the corresponding `spawn` flag only for a
|
|
106
|
+
one-off override. The generic `channel.worker_guard` remains the fallback for
|
|
107
|
+
ordinary workers and for a subnode key omitted from the project config.
|
|
108
|
+
|
|
101
109
|
Where the host exposes a live wait continuation, capture the same barrier,
|
|
102
110
|
establish one event waiter before triggering the worker, and continue that same
|
|
103
111
|
waiter until terminal state. Until it resolves, times out, or errors, the next
|
|
@@ -111,18 +119,38 @@ not as a high-frequency supervision loop.
|
|
|
111
119
|
|
|
112
120
|
After a terminal message, independently validate and then record a task-level
|
|
113
121
|
disposition. `complete` means only that the subnode claims it completed its
|
|
114
|
-
assigned work; it is not acceptance.
|
|
122
|
+
assigned work; it is not acceptance. Confirm the terminal state from the
|
|
123
|
+
durable worker projection; a report without a terminal worker is still
|
|
124
|
+
pending, and a terminal worker without a valid report is recovery.
|
|
115
125
|
|
|
116
126
|
```bash
|
|
117
127
|
REPORT="$TASK/subnodes/$WORK_ID/$SUBNODE_ID/report.json"
|
|
118
128
|
python3 .trellis/scripts/subnode_artifact.py validate --report "$REPORT"
|
|
129
|
+
trellis channel workers subnode-example --include-terminal --json
|
|
119
130
|
```
|
|
120
131
|
|
|
121
132
|
The coordinator must re-check enough source evidence and protected-target state
|
|
122
|
-
to decide `accepted`, `rejected`, or `deferred
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
133
|
+
to decide `accepted`, `rejected`, or `deferred`. Record the terminal lifecycle
|
|
134
|
+
and sequence returned by `channel workers`, then let the helper create the
|
|
135
|
+
disposition exactly once:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
python3 .trellis/scripts/subnode_artifact.py disposition \
|
|
139
|
+
--report "$REPORT" \
|
|
140
|
+
--outcome accepted \
|
|
141
|
+
--terminal-lifecycle done \
|
|
142
|
+
--terminal-seq 17 \
|
|
143
|
+
--terminal-at 2026-09-14T03:00:00Z \
|
|
144
|
+
--check report_validation \
|
|
145
|
+
--check source_recheck \
|
|
146
|
+
--check protected_target_check \
|
|
147
|
+
--reason "Evidence and protected targets were independently rechecked."
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`disposition.json` is coordinator-owned and cannot be replaced. The helper
|
|
151
|
+
does not inspect the Channel store or make the acceptance judgment; the
|
|
152
|
+
terminal values must come from the worker projection and the reason records
|
|
153
|
+
the coordinator's decision.
|
|
126
154
|
|
|
127
155
|
Use the separate coordinator work-record helper only for a durable cross-task
|
|
128
156
|
observation, decision, open question, or blocker. It does not substitute for a
|
|
@@ -159,4 +187,5 @@ record why it is retrying and check the new report independently; neither the
|
|
|
159
187
|
helper nor Channel decides when to retry.
|
|
160
188
|
|
|
161
189
|
No scheduler, high-frequency polling loop, automatic retry, worktree, global
|
|
162
|
-
ledger, or provider-specific transport is introduced by this workflow.
|
|
190
|
+
ledger, or provider-specific transport is introduced by this workflow. A
|
|
191
|
+
manual retry always uses a new subnode id and worker handle.
|
|
@@ -39,16 +39,27 @@ Key `spawn` flags:
|
|
|
39
39
|
- `--idle-timeout <duration>` — OOM guard idle TTL (default `5m`; `0` disables).
|
|
40
40
|
- `--max-live-workers <n>` — spawn-time live-worker budget (default `6`; `0` disables).
|
|
41
41
|
|
|
42
|
+
An agent card may declare `env_file: <file>`; the channel runtime loads that
|
|
43
|
+
relative sibling file automatically for the provider child. Use this for
|
|
44
|
+
stable role settings so every spawn of that role gets the same environment.
|
|
45
|
+
The file contains plain `KEY=VALUE` lines only; it is not shell code and does
|
|
46
|
+
not perform expansion or interpolation. Do not put credentials in a bundled
|
|
47
|
+
role file. The bundled `subnode` role uses this mechanism to disable
|
|
48
|
+
OpenViking's automatic recall, capture, and fixed background injection in the
|
|
49
|
+
evidence worker process.
|
|
50
|
+
|
|
42
51
|
The success event `spawned` records `pid`, `provider`, `agent`, the injected
|
|
43
52
|
`files`, and the resolved `manifests` so later spectators can audit context.
|
|
44
53
|
|
|
45
54
|
## Agent Cards
|
|
46
55
|
|
|
47
56
|
`--agent <name>` resolves to `.trellis/agents/<name>.md`. The card name must
|
|
48
|
-
match `[A-Za-z0-9._-]+`. The default Trellis install ships
|
|
57
|
+
match `[A-Za-z0-9._-]+`. The default Trellis install ships three cards:
|
|
49
58
|
|
|
50
59
|
- `.trellis/agents/check.md` — code-quality reviewer.
|
|
51
60
|
- `.trellis/agents/implement.md` — coding worker for implementation runs.
|
|
61
|
+
- `.trellis/agents/subnode.md` — bounded independent-evidence worker; its
|
|
62
|
+
`subnode.env` sibling is loaded automatically.
|
|
52
63
|
|
|
53
64
|
```yaml
|
|
54
65
|
---
|
|
@@ -205,17 +216,25 @@ Precedence (highest first):
|
|
|
205
216
|
1. CLI flags: `--idle-timeout`, `--max-live-workers` on `spawn`.
|
|
206
217
|
2. Environment variables: `TRELLIS_CHANNEL_WORKER_IDLE_TIMEOUT`,
|
|
207
218
|
`TRELLIS_CHANNEL_MAX_LIVE_WORKERS`.
|
|
208
|
-
3. `.trellis/config.yaml
|
|
209
|
-
4.
|
|
219
|
+
3. For `--agent subnode`, `channel.subnode` in `.trellis/config.yaml`.
|
|
220
|
+
4. `.trellis/config.yaml` under `channel.worker_guard`.
|
|
221
|
+
5. Built-in defaults (`5m`, `6`) for ordinary workers.
|
|
210
222
|
|
|
211
223
|
Cleanup notices are written to stderr at spawn time so operators can see which
|
|
212
224
|
idle workers were swept and why a new spawn was rejected. The guard does not
|
|
213
225
|
touch ephemeral / `channel run` workers any differently — they are subject to
|
|
214
226
|
the same idle TTL and budget.
|
|
215
227
|
|
|
216
|
-
To audit
|
|
217
|
-
|
|
218
|
-
`~/.trellis/channels/<bucket>/<channel
|
|
228
|
+
To audit durable state, use `trellis channel workers <name> --include-terminal
|
|
229
|
+
--json`. This is the canonical worker projection. Inspect per-channel `pid` /
|
|
230
|
+
`worker-pid` sidecar files under `~/.trellis/channels/<bucket>/<channel>/` only
|
|
231
|
+
when diagnosing host-local process liveness; they are not lifecycle truth.
|
|
232
|
+
|
|
233
|
+
For bounded evidence workers, `channel.subnode` is a separate role-default
|
|
234
|
+
section. It configures `idle_timeout`, `max_live_workers` (generated default
|
|
235
|
+
`8`), `timeout`, and `warn_before` only for `spawn --agent subnode`. Explicit
|
|
236
|
+
spawn flags remain one-dispatch overrides; ordinary workers retain the generic
|
|
237
|
+
`worker_guard` defaults.
|
|
219
238
|
|
|
220
239
|
## Worker Inbox APIs
|
|
221
240
|
|
|
@@ -45,7 +45,7 @@ Do not assume the user has the Trellis source repository. Do not default to modi
|
|
|
45
45
|
|
|
46
46
|
- `references/platform-files/overview.md`: How shared `.trellis/` files relate to platform directories and the four platform integration modes (hook-driven, agent prelude, main-session workflow, channel runtime).
|
|
47
47
|
- `references/platform-files/platform-map.md`: Platform directories and paths for skills, agents, hooks, and extensions across all supported platforms including Reasonix and Pi's native `trellis_subagent` extension.
|
|
48
|
-
- `references/platform-files/hooks-and-settings.md`: How settings/config files, hooks, plugins, and extensions connect to Trellis; covers `channel.worker_guard
|
|
48
|
+
- `references/platform-files/hooks-and-settings.md`: How settings/config files, hooks, plugins, and extensions connect to Trellis; covers `channel.worker_guard.*`, `channel.subnode.*`, and `codex.dispatch_mode`.
|
|
49
49
|
- `references/platform-files/agents.md`: Per-platform `trellis-research` / `trellis-implement` / `trellis-check` sub-agent files plus bundled `.trellis/agents/{check,implement}.md` for the channel runtime.
|
|
50
50
|
- `references/platform-files/skills-and-commands.md`: Differences between skills, commands, prompts, and workflows, plus how to change them.
|
|
51
51
|
|
|
@@ -64,7 +64,7 @@ Do not assume the user has the Trellis source repository. Do not default to modi
|
|
|
64
64
|
## Current Rules
|
|
65
65
|
|
|
66
66
|
- `.trellis/workflow.md` is the local workflow source of truth; its initial content was selected from a workflow template (built-in `native`, `tdd`, `channel-driven-subagent-dispatch`, or a marketplace template) at `trellis init` time and can be re-selected via `trellis workflow --template <id>`. Missing `.trellis/agents/<name>.md` files referenced by the active template trigger a non-blocking stderr warning pointing at `trellis update`.
|
|
67
|
-
- `.trellis/config.yaml` is the project-level Trellis configuration entry point. It hosts task lifecycle hooks (`hooks.after_create` / `after_start` / `after_finish` / `after_archive`), journal shape (`session_commit_message` / `max_journal_lines` / `session_auto_commit`), channel worker guard (`channel.worker_guard.idle_timeout` / `max_live_workers`), Codex dispatch mode (`codex.dispatch_mode: inline | sub-agent`), and the spec registry block (`registry.spec.source` + `registry.spec.template`).
|
|
67
|
+
- `.trellis/config.yaml` is the project-level Trellis configuration entry point. It hosts task lifecycle hooks (`hooks.after_create` / `after_start` / `after_finish` / `after_archive`), journal shape (`session_commit_message` / `max_journal_lines` / `session_auto_commit`), generic channel worker guard (`channel.worker_guard.idle_timeout` / `max_live_workers`), bounded subnode defaults (`channel.subnode.max_live_workers` / `idle_timeout` / `timeout` / `warn_before`), Codex dispatch mode (`codex.dispatch_mode: inline | sub-agent`), and the spec registry block (`registry.spec.source` + `registry.spec.template`).
|
|
68
68
|
- `.trellis/spec/` stores the user's project-specific coding conventions and design constraints. When `registry.spec` is set, files are refreshed by `trellis update`; local edits surface as "modified by user" conflicts in `.trellis/.template-hashes.json`.
|
|
69
69
|
- `.trellis/tasks/` stores task PRDs, design notes, implement plans, research files, and JSONL context. Tasks form parent/child trees: `task.py create --parent <slug>`, `task.py add-subtask <parent> <child>`, `task.py remove-subtask <parent> <child>`, and `task.py list-context <task>`. `task.py create` rejects a slug already present in `.trellis/tasks/archive/**`.
|
|
70
70
|
- `.trellis/workspace/` stores **deliberately written** developer journals. Raw cross-session dialogue is **not** stored here — it lives on disk under `~/.claude/projects/`, `~/.codex/sessions/`, and `~/.pi/agent/sessions/` and is recovered via `trellis mem search|extract|context`. The bundled `trellis-session-insight` skill teaches when to reach for `mem`.
|
|
@@ -49,12 +49,13 @@ Prefer cheaper primitives when:
|
|
|
49
49
|
| Change default channel worker idle timeout | `channel.worker_guard.idle_timeout` in `.trellis/config.yaml`. Accepts `5m`, `30s`, etc. Set `0` to disable idle cleanup. |
|
|
50
50
|
| Change live worker budget | `channel.worker_guard.max_live_workers` in `.trellis/config.yaml`. Set `0` to disable the spawn-time budget check. |
|
|
51
51
|
| Override worker guard per spawn | Pass `--idle-timeout` / `--max-live-workers` on `trellis channel spawn`, or set `TRELLIS_CHANNEL_WORKER_IDLE_TIMEOUT` / `TRELLIS_CHANNEL_MAX_LIVE_WORKERS` in the environment. |
|
|
52
|
+
| Tune bounded subnode dispatch defaults | Set `channel.subnode.max_live_workers`, `idle_timeout`, `timeout`, or `warn_before`. Generated defaults are `8`, `5m`, `30m`, and `5m`; explicit spawn flags and existing guard environment overrides still win. |
|
|
52
53
|
| Change what the default Check or Implement worker does | Edit `.trellis/agents/check.md` or `.trellis/agents/implement.md`. These are platform-agnostic role cards; the channel runtime injects them when `--agent check|implement` is passed. |
|
|
53
54
|
| Add a new role card | Drop `<name>.md` into `.trellis/agents/`. `trellis channel spawn --agent <name>` will pick it up. |
|
|
54
55
|
| Relocate channel storage (CI sandbox, ephemeral runs) | Set `TRELLIS_CHANNEL_ROOT=/path/to/dir`. Channel events move with it; existing channels stay at the old root. |
|
|
55
56
|
| Switch storage scope | Pass `--scope project` (default) or `--scope global` on every channel subcommand. The bucket directory changes; nothing else does. |
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
Worker guard precedence is: CLI flag > environment variable > `channel.subnode` for `--agent subnode` > `channel.worker_guard` > built-in default. Ordinary worker defaults remain `idle_timeout: 5m` and `max_live_workers: 6`.
|
|
58
59
|
|
|
59
60
|
## Relationship To Other Local Layers
|
|
60
61
|
|
|
@@ -5,6 +5,7 @@ description: |
|
|
|
5
5
|
never changes protected target files, and leaves acceptance to the coordinator.
|
|
6
6
|
provider: codex
|
|
7
7
|
labels: [trellis, subnode]
|
|
8
|
+
env_file: subnode.env
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
# Subnode (channel runtime)
|
|
@@ -54,6 +55,10 @@ sandbox claim.
|
|
|
54
55
|
6. Send one short terminal Channel message with the status and report path.
|
|
55
56
|
Do not place the report JSON in Channel text.
|
|
56
57
|
|
|
58
|
+
The terminal message ends the worker runtime; it does not accept the report.
|
|
59
|
+
The coordinator later checks the durable worker terminal projection and records
|
|
60
|
+
the disposition. A report without a terminal worker remains pending.
|
|
61
|
+
|
|
57
62
|
## Report Boundary
|
|
58
63
|
|
|
59
64
|
The coordinator independently runs the artifact validator and then records the
|