@pennixrv/trellis 0.7.1-beta.17 → 0.7.1-beta.18
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/teamwork/adapters/acp.d.ts +5 -0
- package/dist/commands/teamwork/adapters/acp.d.ts.map +1 -1
- package/dist/commands/teamwork/adapters/acp.js +19 -12
- package/dist/commands/teamwork/adapters/acp.js.map +1 -1
- package/dist/commands/teamwork/adapters/codex.d.ts +1 -1
- package/dist/commands/teamwork/adapters/codex.d.ts.map +1 -1
- package/dist/commands/teamwork/adapters/codex.js +4 -13
- package/dist/commands/teamwork/adapters/codex.js.map +1 -1
- package/dist/commands/teamwork/artifact.d.ts +4 -1
- package/dist/commands/teamwork/artifact.d.ts.map +1 -1
- package/dist/commands/teamwork/artifact.js +35 -4
- package/dist/commands/teamwork/artifact.js.map +1 -1
- package/dist/commands/teamwork/batch.d.ts +6 -0
- package/dist/commands/teamwork/batch.d.ts.map +1 -1
- package/dist/commands/teamwork/batch.js +114 -2
- package/dist/commands/teamwork/batch.js.map +1 -1
- package/dist/commands/teamwork/context-loader.d.ts.map +1 -1
- package/dist/commands/teamwork/context-loader.js +15 -3
- package/dist/commands/teamwork/context-loader.js.map +1 -1
- package/dist/commands/teamwork/coordinator.d.ts.map +1 -1
- package/dist/commands/teamwork/coordinator.js +4 -0
- package/dist/commands/teamwork/coordinator.js.map +1 -1
- package/dist/commands/teamwork/create.d.ts +1 -0
- package/dist/commands/teamwork/create.d.ts.map +1 -1
- package/dist/commands/teamwork/create.js +2 -1
- package/dist/commands/teamwork/create.js.map +1 -1
- package/dist/commands/teamwork/index.d.ts.map +1 -1
- package/dist/commands/teamwork/index.js +25 -4
- package/dist/commands/teamwork/index.js.map +1 -1
- package/dist/commands/teamwork/prompt.d.ts +4 -0
- package/dist/commands/teamwork/prompt.d.ts.map +1 -0
- package/dist/commands/teamwork/prompt.js +33 -0
- package/dist/commands/teamwork/prompt.js.map +1 -0
- package/dist/commands/teamwork/result.d.ts +52 -0
- package/dist/commands/teamwork/result.d.ts.map +1 -0
- package/dist/commands/teamwork/result.js +94 -0
- package/dist/commands/teamwork/result.js.map +1 -0
- package/dist/commands/teamwork/run.d.ts +1 -0
- package/dist/commands/teamwork/run.d.ts.map +1 -1
- package/dist/commands/teamwork/run.js +111 -21
- package/dist/commands/teamwork/run.js.map +1 -1
- package/dist/commands/teamwork/runtime.d.ts.map +1 -1
- package/dist/commands/teamwork/runtime.js +49 -2
- package/dist/commands/teamwork/runtime.js.map +1 -1
- package/dist/commands/teamwork/send.d.ts +1 -0
- package/dist/commands/teamwork/send.d.ts.map +1 -1
- package/dist/commands/teamwork/send.js +2 -1
- package/dist/commands/teamwork/send.js.map +1 -1
- package/dist/commands/teamwork/spawn.d.ts +6 -3
- package/dist/commands/teamwork/spawn.d.ts.map +1 -1
- package/dist/commands/teamwork/spawn.js +12 -28
- package/dist/commands/teamwork/spawn.js.map +1 -1
- package/dist/commands/teamwork/supervisor/inbox.d.ts +1 -0
- package/dist/commands/teamwork/supervisor/inbox.d.ts.map +1 -1
- package/dist/commands/teamwork/supervisor/inbox.js +25 -9
- package/dist/commands/teamwork/supervisor/inbox.js.map +1 -1
- package/dist/commands/teamwork/supervisor.d.ts +2 -0
- package/dist/commands/teamwork/supervisor.d.ts.map +1 -1
- package/dist/commands/teamwork/supervisor.js +1 -0
- package/dist/commands/teamwork/supervisor.js.map +1 -1
- package/dist/commands/teamwork/teammate-launch.d.ts +6 -0
- package/dist/commands/teamwork/teammate-launch.d.ts.map +1 -1
- package/dist/commands/teamwork/teammate-launch.js +24 -3
- package/dist/commands/teamwork/teammate-launch.js.map +1 -1
- package/dist/commands/teamwork/wait.d.ts +2 -0
- package/dist/commands/teamwork/wait.d.ts.map +1 -1
- package/dist/commands/teamwork/wait.js +44 -3
- package/dist/commands/teamwork/wait.js.map +1 -1
- package/dist/migrations/manifests/0.7.1-beta.18.json +9 -0
- package/dist/templates/common/bundled-skills/trellis-teamwork/SKILL.md +5 -2
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/coordination-modes.md +4 -0
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-configuration-matrix.md +4 -2
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-processes.md +31 -6
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/teamwork-plan-construction.md +28 -3
- package/dist/templates/trellis/agents/profiles/research.md +4 -4
- package/dist/templates/trellis/agents/teammate.md +4 -75
- package/package.json +2 -2
|
@@ -9,6 +9,8 @@ export interface TeammateWritePolicy {
|
|
|
9
9
|
recursiveDelegation: "disabled";
|
|
10
10
|
}
|
|
11
11
|
export interface TeammateCapabilitySnapshot {
|
|
12
|
+
/** Static adapter contract, not a successful probe of the installed backend. */
|
|
13
|
+
evidence?: "adapter-contract";
|
|
12
14
|
transport: TeammateAdapterContract["transport"];
|
|
13
15
|
supportsContinuation: true;
|
|
14
16
|
supportsInterrupt: true;
|
|
@@ -28,6 +30,8 @@ export interface TeammateCapabilitySnapshot {
|
|
|
28
30
|
digest: string;
|
|
29
31
|
}
|
|
30
32
|
export interface TeammateLaunchSpec {
|
|
33
|
+
/** Absent on historical frozen plans. */
|
|
34
|
+
reportVersion?: 2;
|
|
31
35
|
roleId: "teammate";
|
|
32
36
|
provider: ResolvedTeammateProfile["provider"];
|
|
33
37
|
profile?: string;
|
|
@@ -58,4 +62,6 @@ export declare function buildTeammateLaunchSpec(input: {
|
|
|
58
62
|
contextManifests?: string[];
|
|
59
63
|
protectedTargets?: readonly string[];
|
|
60
64
|
}): TeammateLaunchSpec;
|
|
65
|
+
/** Frozen references must still name the same bytes when read by a worker. */
|
|
66
|
+
export declare function assertTeammateContextCurrent(launch: TeammateLaunchSpec, cwd: string): void;
|
|
61
67
|
//# sourceMappingURL=teammate-launch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teammate-launch.d.ts","sourceRoot":"","sources":["../../../src/commands/teamwork/teammate-launch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"teammate-launch.d.ts","sourceRoot":"","sources":["../../../src/commands/teamwork/teammate-launch.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,eAAe,CAAC;AAEvB,gFAAgF;AAChF,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,WAAW,CAAC;IAC9B,QAAQ,EAAE,WAAW,CAAC;IACtB,gBAAgB,EAAE,YAAY,CAAC;IAC/B,gBAAgB,EAAE,UAAU,CAAC;IAC7B,mBAAmB,EAAE,UAAU,CAAC;CACjC;AAED,MAAM,WAAW,0BAA0B;IACzC,gFAAgF;IAChF,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,SAAS,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAChD,oBAAoB,EAAE,IAAI,CAAC;IAC3B,iBAAiB,EAAE,IAAI,CAAC;IACxB,cAAc,EAAE,IAAI,CAAC;IACrB,gBAAgB,EAAE,IAAI,CAAC;IACvB,eAAe,EAAE,IAAI,CAAC;IACtB,WAAW,EAAE,mBAAmB,CAAC;IACjC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,SAAS,EAAE;QACT,cAAc,EAAE,IAAI,CAAC;QACrB,uBAAuB,EAAE,IAAI,CAAC;QAC9B,qBAAqB,EAAE,IAAI,CAAC;QAC5B,kBAAkB,EAAE,wBAAwB,CAAC,oBAAoB,CAAC,CAAC;QACnE,eAAe,EAAE,OAAO,CAAC,wBAAwB,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACtE,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,aAAa,CAAC,EAAE,CAAC,CAAC;IAClB,MA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|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { assembleContext } from "./context-loader.js";
|
|
6
|
+
import { buildTeamworkInstructions } from "./prompt.js";
|
|
6
7
|
import { assertTeammateHostCapability, getTeammateAdapter, } from "./teammate-adapters.js";
|
|
7
8
|
import { frozenProfileSchema, } from "./profiles.js";
|
|
8
9
|
const sha256 = z.string().regex(/^[a-f0-9]{64}$/);
|
|
9
10
|
const frozenLaunchSchema = z
|
|
10
11
|
.object({
|
|
12
|
+
reportVersion: z.literal(2).optional(),
|
|
11
13
|
roleId: z.literal("teammate"),
|
|
12
14
|
provider: frozenProfileSchema.shape.provider,
|
|
13
15
|
profile: z.string().optional(),
|
|
@@ -29,6 +31,7 @@ const frozenLaunchSchema = z
|
|
|
29
31
|
contextDigest: sha256,
|
|
30
32
|
capability: z
|
|
31
33
|
.object({
|
|
34
|
+
evidence: z.literal("adapter-contract").optional(),
|
|
32
35
|
transport: z.enum(["claude-cli", "codex-app-server", "acp"]),
|
|
33
36
|
supportsContinuation: z.literal(true),
|
|
34
37
|
supportsInterrupt: z.literal(true),
|
|
@@ -78,7 +81,9 @@ export function parseFrozenTeammate(input) {
|
|
|
78
81
|
if (profile[field] !== launch[field])
|
|
79
82
|
throw new Error(`frozen execution ${field} does not match profile`);
|
|
80
83
|
if (canonical(profile.options) !== canonical(launch.options) ||
|
|
81
|
-
|
|
84
|
+
(launch.reportVersion === 2
|
|
85
|
+
? buildTeamworkInstructions(profile.rolePrompt, "batch")
|
|
86
|
+
: profile.rolePrompt) !== launch.instructions)
|
|
82
87
|
throw new Error("frozen execution instructions or options do not match profile");
|
|
83
88
|
const { digest: expected, ...capability } = launch.capability;
|
|
84
89
|
if (hash(canonical(capability)) !== expected)
|
|
@@ -153,6 +158,7 @@ export function buildTeammateLaunchSpec(input) {
|
|
|
153
158
|
recursiveDelegation: "disabled",
|
|
154
159
|
};
|
|
155
160
|
const capability = {
|
|
161
|
+
evidence: "adapter-contract",
|
|
156
162
|
transport: adapter.transport,
|
|
157
163
|
supportsContinuation: true,
|
|
158
164
|
supportsInterrupt: true,
|
|
@@ -176,6 +182,7 @@ export function buildTeammateLaunchSpec(input) {
|
|
|
176
182
|
};
|
|
177
183
|
return {
|
|
178
184
|
roleId: "teammate",
|
|
185
|
+
reportVersion: 2,
|
|
179
186
|
configuration: input.profile.configuration,
|
|
180
187
|
provider: input.profile.provider,
|
|
181
188
|
...(input.profile.profile ? { profile: input.profile.profile } : {}),
|
|
@@ -187,10 +194,13 @@ export function buildTeammateLaunchSpec(input) {
|
|
|
187
194
|
...(input.profile.profileDigest
|
|
188
195
|
? { profileDigest: input.profile.profileDigest }
|
|
189
196
|
: {}),
|
|
190
|
-
prompt: [
|
|
197
|
+
prompt: [
|
|
198
|
+
buildTeamworkInstructions(input.profile.rolePrompt, "batch"),
|
|
199
|
+
assembled.prompt,
|
|
200
|
+
]
|
|
191
201
|
.filter(Boolean)
|
|
192
202
|
.join("\n\n---\n\n"),
|
|
193
|
-
instructions: input.profile.rolePrompt,
|
|
203
|
+
instructions: buildTeamworkInstructions(input.profile.rolePrompt, "batch"),
|
|
194
204
|
context: assembled.prompt,
|
|
195
205
|
rolePath: input.profile.rolePath,
|
|
196
206
|
contextPaths: assembled.paths,
|
|
@@ -200,4 +210,15 @@ export function buildTeammateLaunchSpec(input) {
|
|
|
200
210
|
capability: capabilitySnapshot,
|
|
201
211
|
};
|
|
202
212
|
}
|
|
213
|
+
/** Frozen references must still name the same bytes when read by a worker. */
|
|
214
|
+
export function assertTeammateContextCurrent(launch, cwd) {
|
|
215
|
+
if (launch.reportVersion !== 2)
|
|
216
|
+
return;
|
|
217
|
+
const actual = hash(launch.contextPaths
|
|
218
|
+
.map((file) => `${file}\0${fs.readFileSync(requireRegularFile(cwd, file, "teammate context file"), "utf8")}`)
|
|
219
|
+
.concat(launch.contextManifests.map((manifest) => `manifest\0${manifest}\0${fs.readFileSync(requireRegularFile(cwd, manifest, "teammate context manifest"), "utf8")}`))
|
|
220
|
+
.join("\0"));
|
|
221
|
+
if (actual !== launch.contextDigest)
|
|
222
|
+
throw new Error("Frozen teammate context changed; construct a new plan before dispatch");
|
|
223
|
+
}
|
|
203
224
|
//# sourceMappingURL=teammate-launch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teammate-launch.js","sourceRoot":"","sources":["../../../src/commands/teamwork/teammate-launch.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,GAGnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mBAAmB,GAEpB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"teammate-launch.js","sourceRoot":"","sources":["../../../src/commands/teamwork/teammate-launch.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,GAGnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mBAAmB,GAEpB,MAAM,eAAe,CAAC;AAuDvB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAClD,MAAM,kBAAkB,GAAG,CAAC;KACzB,MAAM,CAAC;IACN,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CA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a,CAAC;QACtB,YAAY,EAAE,yBAAyB,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC;QAC1E,OAAO,EAAE,SAAS,CAAC,MAAM;QACzB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ;QAChC,YAAY,EAAE,SAAS,CAAC,KAAK;QAC7B,gBAAgB,EAAE,SAAS,CAAC,SAAS;QACrC,UAAU;QACV,aAAa;QACb,UAAU,EAAE,kBAAkB;KAC/B,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,4BAA4B,CAC1C,MAA0B,EAC1B,GAAW;IAEX,IAAI,MAAM,CAAC,aAAa,KAAK,CAAC;QAAE,OAAO;IACvC,MAAM,MAAM,GAAG,IAAI,CACjB,MAAM,CAAC,YAAY;SAChB,GAAG,CACF,CAAC,IAAI,EAAE,EAAE,CACP,GAAG,IAAI,KAAK,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,EAAE,IAAI,EAAE,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,CAChG;SACA,MAAM,CACL,MAAM,CAAC,gBAAgB,CAAC,GAAG,CACzB,CAAC,QAAQ,EAAE,EAAE,CACX,aAAa,QAAQ,KAAK,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,2BAA2B,CAAC,EAAE,MAAM,CAAC,EAAE,CACtH,CACF;SACA,IAAI,CAAC,IAAI,CAAC,CACd,CAAC;IACF,IAAI,MAAM,KAAK,MAAM,CAAC,aAAa;QACjC,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;AACN,CAAC"}
|
|
@@ -10,6 +10,8 @@ export interface WaitOptions {
|
|
|
10
10
|
includeProgress?: boolean;
|
|
11
11
|
/** Wait until every agent in --from has produced a matching event. */
|
|
12
12
|
all?: boolean;
|
|
13
|
+
/** One normalized final result, including content validation and input identity. */
|
|
14
|
+
json?: boolean;
|
|
13
15
|
}
|
|
14
16
|
export declare function teamworkSessionWait(sessionId: string, opts: WaitOptions): Promise<void>;
|
|
15
17
|
/** Parse a duration like "30s", "2m", "1h" into milliseconds. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../../src/commands/teamwork/wait.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../../src/commands/teamwork/wait.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,sEAAsE;IACtE,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,oFAAoF;IACpF,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAID,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,IAAI,CAAC,CAwGf;AAED,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAmBvE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { parseTeamworkEventKinds } from "./store/events.js";
|
|
1
|
+
import { parseTeamworkEventKinds, readTeamworkEvents } from "./store/events.js";
|
|
2
|
+
import { buildInteractiveResult } from "./result.js";
|
|
2
3
|
import { resolveExistingTeamworkSession } from "./store/paths.js";
|
|
3
4
|
import { normalizeThreadKey, parseCsv, parseTeamworkSessionScope, parseThreadAction, } from "./store/schema.js";
|
|
4
5
|
import { watchEvents } from "./store/watch.js";
|
|
@@ -8,13 +9,24 @@ export async function teamworkSessionWait(sessionId, opts) {
|
|
|
8
9
|
scope: parseTeamworkSessionScope(opts.scope),
|
|
9
10
|
});
|
|
10
11
|
const fromList = parseCsv(opts.from);
|
|
12
|
+
const resultWorker = fromList?.[0];
|
|
13
|
+
if (opts.json &&
|
|
14
|
+
(fromList?.length !== 1 ||
|
|
15
|
+
opts.all ||
|
|
16
|
+
opts.kind ||
|
|
17
|
+
opts.thread ||
|
|
18
|
+
opts.action ||
|
|
19
|
+
opts.includeProgress))
|
|
20
|
+
throw new Error("--json requires exactly one --from worker and no event-kind, thread, action, progress or --all filter");
|
|
11
21
|
if (opts.all && (!fromList || fromList.length === 0)) {
|
|
12
22
|
throw new Error("--all requires --from <a,b,...>");
|
|
13
23
|
}
|
|
14
24
|
const filter = {
|
|
15
25
|
self: opts.as,
|
|
16
|
-
from: fromList,
|
|
17
|
-
kind:
|
|
26
|
+
from: opts.json ? undefined : fromList,
|
|
27
|
+
kind: opts.json
|
|
28
|
+
? ["turn_finished", "error", "killed"]
|
|
29
|
+
: parseTeamworkEventKinds(opts.kind),
|
|
18
30
|
to: opts.to ?? opts.as, // default: broadcasts to me + explicit-to-me
|
|
19
31
|
thread: opts.thread ? normalizeThreadKey(opts.thread) : undefined,
|
|
20
32
|
action: opts.action ? parseThreadAction(opts.action) : undefined,
|
|
@@ -32,6 +44,20 @@ export async function teamworkSessionWait(sessionId, opts) {
|
|
|
32
44
|
signal: abort.signal,
|
|
33
45
|
project: ref.project,
|
|
34
46
|
})) {
|
|
47
|
+
if (opts.json) {
|
|
48
|
+
if (!resultWorker)
|
|
49
|
+
throw new Error("Missing result worker");
|
|
50
|
+
const worker = resultWorker;
|
|
51
|
+
if (ev.by !== worker && ev.by !== `supervisor:${worker}`)
|
|
52
|
+
continue;
|
|
53
|
+
const result = buildInteractiveResult(sessionId, worker, ev, await readTeamworkEvents(sessionId, ref.project));
|
|
54
|
+
console.log(JSON.stringify(result));
|
|
55
|
+
if (result.execution.status !== "completed" ||
|
|
56
|
+
result.reports.some((item) => item.validation !== "passed" ||
|
|
57
|
+
item.report?.status !== "complete"))
|
|
58
|
+
process.exitCode = 1;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
35
61
|
console.log(JSON.stringify(ev));
|
|
36
62
|
if (!pending)
|
|
37
63
|
return;
|
|
@@ -44,6 +70,21 @@ export async function teamworkSessionWait(sessionId, opts) {
|
|
|
44
70
|
process.stderr.write(`timeout: still waiting on ${[...pending].join(",")}\n`);
|
|
45
71
|
}
|
|
46
72
|
process.exitCode = TIMEOUT_EXIT_CODE;
|
|
73
|
+
if (opts.json)
|
|
74
|
+
console.log(JSON.stringify({
|
|
75
|
+
schemaVersion: 1,
|
|
76
|
+
kind: "trellis_result",
|
|
77
|
+
mode: "interactive",
|
|
78
|
+
association: { sessionId, worker: resultWorker },
|
|
79
|
+
execution: {
|
|
80
|
+
status: "timeout",
|
|
81
|
+
stopped: false,
|
|
82
|
+
reason: "Wait deadline elapsed; the persistent worker remains owned by the session",
|
|
83
|
+
},
|
|
84
|
+
reports: [],
|
|
85
|
+
semanticValidation: "not_run",
|
|
86
|
+
disposition: "not_applicable",
|
|
87
|
+
}));
|
|
47
88
|
}
|
|
48
89
|
finally {
|
|
49
90
|
if (timer)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait.js","sourceRoot":"","sources":["../../../src/commands/teamwork/wait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"wait.js","sourceRoot":"","sources":["../../../src/commands/teamwork/wait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,8BAA8B,EAAE,MAAM,k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OAAO,EAAE,KAAK;oBACd,MAAM,EACJ,2EAA2E;iBAC9E;gBACD,OAAO,EAAE,EAAE;gBACX,kBAAkB,EAAE,SAAS;gBAC7B,WAAW,EAAE,gBAAgB;aAC9B,CAAC,CACH,CAAC;IACN,CAAC;YAAS,CAAC;QACT,IAAI,KAAK;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,aAAa,CAAC,CAAqB;IACjD,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACzB,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,2BAA2B,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;QACpB,KAAK,IAAI;YACP,OAAO,CAAC,CAAC;QACX,KAAK,GAAG;YACN,OAAO,CAAC,GAAG,IAAI,CAAC;QAClB,KAAK,GAAG;YACN,OAAO,CAAC,GAAG,MAAM,CAAC;QACpB,KAAK,GAAG;YACN,OAAO,CAAC,GAAG,SAAS,CAAC;QACvB;YACE,OAAO,CAAC,GAAG,IAAI,CAAC;IACpB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.7.1-beta.18",
|
|
3
|
+
"description": "统一 Teamwork 输入分层与结构化结果,修复单次调用终态与诊断",
|
|
4
|
+
"breaking": false,
|
|
5
|
+
"recommendMigrate": false,
|
|
6
|
+
"changelog": "Role initialization and mode-specific result contracts are separated from task/reference data. New content reports use schema 2; run, batch and wait provide a normalized machine result. Historical frozen reports remain readable. Tool permissions automatically allow; Codex defaults to no sandbox. Input preflight, supervisor failures, failed-attempt identity, report artifacts and diagnostics are verified.",
|
|
7
|
+
"migrations": [],
|
|
8
|
+
"notes": "Run trellis update to refresh Teamwork role cards and Skill references. Agents must request --json; default human/event views remain available. Content shape validation does not perform main-agent semantic acceptance. Existing frozen launches retain their report contract."
|
|
9
|
+
}
|
|
@@ -53,7 +53,10 @@ trellis teamwork context list <session> --scope global --thread <thread>
|
|
|
53
53
|
|
|
54
54
|
- Teammates provide research, review, verification, evidence, and advice under a role contract; they do not implement product code. Coding tools or provider permission modes do not grant that role authority. Return results in the assigned format and let the coordinator review them.
|
|
55
55
|
- `general`, `advisor`, and `committee` are coordination modes, independent from profiles, providers, `run`, batch execution, and forum sessions. Read project defaults with `teamwork config`; construct a frozen plan with `teamwork plan` and execute it with `teamwork batch --task <task-dir>`.
|
|
56
|
-
- For a managed batch, invoke one foreground `teamwork batch` command and wait for its receipt. The CLI owns FIFO admission, capacity, provider waits, retries, cancellation, report
|
|
56
|
+
- For a managed batch, invoke one foreground `teamwork batch --json` command and wait for its receipt. The CLI owns FIFO admission, capacity, provider waits, retries, cancellation, report validation, and settlement; the main agent must not schedule per-assignment waits or retries.
|
|
57
|
+
- Agent/program callers must use `run --json`, `batch --json`, or `wait --json --from <worker>` for final results. Default run text and default wait events are compatibility/operator views. Read `execution`, every `reports[].validation` and content status, then perform semantic review; `done`, exit zero, `complete`, and `ALL_ACCEPTED` alone do not accept a task result. `semanticValidation: not_run` explicitly leaves that decision to the main agent.
|
|
58
|
+
- Tool permissions are automatically allowed; the default Codex launch has no sandbox. Source/Git, memory, and delegation boundaries are prompt obligations. Do not add tool/path permission gates or describe the role as technical isolation.
|
|
59
|
+
- Initialization carries common/professional rules and the mode-specific result contract. Task messages carry task data, acceptance and exact identity/path references. Context manifests may choose inline, required full reading, or on-demand references; reference text never becomes system instructions. ACP has user content only and cannot claim system priority.
|
|
57
60
|
- A batch runtime continuation waits on the same provider process under the same frozen deadline. It does not send another provider prompt or consume a full-attempt retry. A live `teamwork wait` host-tool continuation is a separate interactive-session workflow.
|
|
58
61
|
- Select one of the six professional profiles and one of its named configurations. For multiple teammates, consider the second and third candidates and record the selection reason; using the same configuration is allowed. See the configuration matrix reference before constructing a new plan.
|
|
59
62
|
- Teamwork does not create or operate Paseo workspaces, Git worktrees, or source-writing implementation agents. Those mechanisms remain independent.
|
|
@@ -64,7 +67,7 @@ trellis teamwork context list <session> --scope global --thread <thread>
|
|
|
64
67
|
- `--as` is the speaker or worker handle, depending on the command. Use explicit, stable names when multiple agents or sessions are involved.
|
|
65
68
|
- `--scope project` (default) operates on the current cwd's project bucket; `--scope global` operates on the shared `__global__` bucket. Pick scope deliberately — a global board is invisible from project listings unless `--scope global` is passed.
|
|
66
69
|
- For exploratory discussion, choose distinct questions and pressure-test unresolved assumptions. Continue only while another exchange can change the decision or its evidence; do not require a fixed number of rounds or relabel a confirmation as new evidence.
|
|
67
|
-
- **Dispatcher wait pattern**: use `--kind done` / `--kind turn_finished
|
|
70
|
+
- **Dispatcher wait pattern**: use `wait --json --from <worker>` for a final content report. Operator event waits may use `--kind done` / `--kind turn_finished`; tags are labels, not runtime completion events. Resume an outstanding host continuation before any other host action.
|
|
68
71
|
- Teamwork Sessions are event-sourced. Do not parse `events.jsonl` first; use `forum`, `thread`, `messages --thread`, and `context list`.
|
|
69
72
|
- `@pennixrv/trellis-core` owns reusable Teamwork Session/thread state, event append, sequence allocation, context/title projection, reducers, and task helpers. The CLI owns flags, terminal rendering, prompts, teammate lifecycle, and process exits.
|
|
70
73
|
- Teamwork plan construction belongs to the current phase coordinator. Teamwork validates and executes a frozen plan; it does not select the task phase, change task status, or create a second task state machine.
|
package/dist/templates/common/bundled-skills/trellis-teamwork/references/coordination-modes.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
The plan's `coordination_mode` selects the call shape. It is independent from
|
|
4
4
|
the teammate role, execution profile, and Teamwork Session type.
|
|
5
5
|
|
|
6
|
+
All modes use the same schema-2 content report and common `--json` result
|
|
7
|
+
envelope. Mode selection does not waive result validation or main-agent
|
|
8
|
+
semantic review. It also does not transfer FIFO or process control to a model.
|
|
9
|
+
|
|
6
10
|
Project defaults live in `.trellis/teamwork.json`: general defaults to one
|
|
7
11
|
member, advisor to one, and committee to three. Read them with
|
|
8
12
|
`trellis teamwork config --mode <mode>`. The coordinator uses `defaultMembers`
|
|
@@ -29,10 +29,12 @@ trellis teamwork config --profile architecture --configuration copilot-opus --mo
|
|
|
29
29
|
|
|
30
30
|
成员显式覆盖执行值只作用于该成员,不改项目默认。多成员应考虑同 provider 不同模型、跨 provider 同模型或不同专业的收益,填写 `selection_reason`;不强制异构、不自动轮换、不静默 fallback。`architecture + committee` 可以让 2–3 位架构成员分别使用不同配置。
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
构造器冻结有效执行值、通用加专业角色指令、模式结果合同、上下文、模式配置摘要和能力摘要。能力的 `evidence: adapter-contract` 说明它来自静态适配器合同,不是已安装后端的成功探测。后续改配置只影响新计划,已有计划执行时不重新解析角色文件;新计划的参考文件在派发前后核对冻结摘要。模型不可用、推理强度未被后端声明或选项不支持时明确失败,并保留实际配置协商阶段及后端声明信息。
|
|
33
33
|
|
|
34
34
|
四种 transport 为 Codex app-server、Claude Code stream-json、Copilot ACP 和 DSH ACP。Copilot 原生 CLI 支持非交互调用;这里选择 ACP 是为了统一会话、配置与取消回执。DSH 使用 `dsh --profile acp`,恢复使用其声明的 `session/resume`;Copilot 使用 `session/load`。安装、账号和真实调用结果须单独核验,fixture 通过不证明某个后端已可用。
|
|
35
35
|
|
|
36
|
-
Codex 使用 `developerInstructions`,Claude 使用独立的 append-system-prompt;ACP v1 只有用户内容块,Trellis
|
|
36
|
+
Codex 使用 `developerInstructions`,Claude 使用独立的 append-system-prompt;ACP v1 只有用户内容块,Trellis 将角色与任务放在两个明确区分的纯文本块,但不宣称具有独立 system 优先级。完整角色在同一会话成功完成一轮后不重复发送,恢复或首次失败后重新建立。参考资料通过任务数据通道发送。不会动态改写 `AGENTS.md` 或注册 provider 原生 persona。
|
|
37
37
|
|
|
38
38
|
源码、Git、递归委派和隐式历史使用限制是角色义务。宿主能力检查只声明实际运行能力:前台等待、受控产物、transport 和容量;不声称完成文件系统只读或记忆隔离。可用工具与宽权限模式不授予 teammate 编写产品代码的职责。
|
|
39
|
+
|
|
40
|
+
工具权限自动允许,不设置默认沙箱或工具/路径准入限制。Codex 默认 `danger-full-access`、`approvalPolicy: never`;ACP 自动选择后端提供的允许选项。宿主仍可能附加 AGENTS、Skills 和环境记忆,角色摘要不代表整个有效上下文摘要。
|
package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-processes.md
CHANGED
|
@@ -32,12 +32,12 @@ Use the ordinary Teamwork Session commands for a deliberate one-shot or
|
|
|
32
32
|
interactive discussion:
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
trellis teamwork run [name] --profile exploration --configuration codex-sol
|
|
35
|
+
trellis teamwork run [name] --profile exploration --configuration codex-sol --stdin --json
|
|
36
36
|
trellis teamwork spawn <name> --profile review --configuration copilot-opus \
|
|
37
37
|
--as reviewer --file .trellis/tasks/in_progress/<task-dir>/prd.md \
|
|
38
38
|
--jsonl .trellis/tasks/in_progress/<task-dir>/research.jsonl
|
|
39
39
|
trellis teamwork send <name> --as <agent> --stdin
|
|
40
|
-
trellis teamwork wait <name> --as <agent> --
|
|
40
|
+
trellis teamwork wait <name> --as <agent> --from reviewer --json
|
|
41
41
|
trellis teamwork interrupt <name> --as <agent> --to <teammate> --stdin
|
|
42
42
|
trellis teamwork kill <name> --as <teammate>
|
|
43
43
|
```
|
|
@@ -52,15 +52,35 @@ execution defaults. `--profile` and `--configuration` select them;
|
|
|
52
52
|
`--reasoning-effort`, `--provider`, `--model`,
|
|
53
53
|
`--cwd`, `--resume`, `--sandbox`, `--timeout`, and `--warn-before` refine one
|
|
54
54
|
launch. `--file` accepts repeatable paths or globs. `--jsonl` accepts a
|
|
55
|
-
repeatable Trellis JSONL manifest whose entries have `{ "file", "reason" }`.
|
|
55
|
+
repeatable Trellis JSONL manifest whose entries have `{ "file", "reason", "delivery" }`.
|
|
56
56
|
Both forms are resolved relative to the spawn cwd, reject paths outside the
|
|
57
57
|
cwd or configured trusted roots, skip missing entries with a warning, and
|
|
58
|
-
enforce per-file and total-context limits before building
|
|
58
|
+
enforce per-file and total-context limits before building reference data.
|
|
59
|
+
`delivery` defaults to `inline`; `required` supplies a path, digest and an
|
|
60
|
+
instruction to read the complete file before work; `on-demand` supplies a
|
|
61
|
+
path, digest and retrieval condition. Required/on-demand missing files fail
|
|
62
|
+
explicitly. New frozen batches recheck reference bytes before dispatch and
|
|
63
|
+
after completion; changed references require a new plan. This check binds
|
|
64
|
+
source versions, but does not prove the model actually read every byte.
|
|
59
65
|
Legacy generic `--agent <card>` remains available for deliberately custom
|
|
60
66
|
agent cards, but it cannot be combined with professional profile selection.
|
|
61
|
-
Interactive roles return
|
|
67
|
+
Interactive roles return a schema-2 JSON content report; they do not invent batch
|
|
62
68
|
claims, report paths or attempt identities.
|
|
63
69
|
|
|
70
|
+
Common/professional role rules and the mode-specific result contract are
|
|
71
|
+
initialization instructions. Codex uses `developerInstructions`; Claude uses
|
|
72
|
+
append-system-prompt. Reference material travels with the first task as data.
|
|
73
|
+
ACP has user blocks only: the role is sent once after a confirmed turn, retained
|
|
74
|
+
for follow-ups, and injected again after recovery or an unsuccessful first
|
|
75
|
+
turn. No JSON transport envelope is serialized into the role/task prose.
|
|
76
|
+
The host may add AGENTS, Skills and memory; `TRELLIS_HOOKS=0` disables Trellis
|
|
77
|
+
hooks, not all host context. No environment or memory isolation is claimed.
|
|
78
|
+
|
|
79
|
+
All providers automatically allow tool permissions. Codex defaults to
|
|
80
|
+
`danger-full-access` with `approvalPolicy: never`; an explicit user sandbox
|
|
81
|
+
override is still supported. ACP selects the offered allow option and reports
|
|
82
|
+
an error if none exists. Role boundaries remain prompt obligations.
|
|
83
|
+
|
|
64
84
|
Use `--inbox-policy explicitOnly|broadcastAndExplicit` to control which
|
|
65
85
|
messages are delivered to a teammate. `send --to` selects recipients and
|
|
66
86
|
`--delivery-mode appendOnly|requireKnownWorker|requireRunningWorker` controls
|
|
@@ -85,7 +105,12 @@ removal and prune preserve sessions with unresolved batch reservations.
|
|
|
85
105
|
|
|
86
106
|
For short independent work, `teamwork run` creates an ephemeral session,
|
|
87
107
|
injects the selected context, sends one prompt, waits for `done`, prints the
|
|
88
|
-
answer, and removes the session
|
|
108
|
+
answer, and removes the session only after a valid complete content report.
|
|
109
|
+
`run --json` returns the common machine envelope and keeps failure diagnostics;
|
|
110
|
+
early supervisor errors/kills terminate the wait without hiding the cause.
|
|
111
|
+
`wait --json --from <one-worker>` binds the final report to `inputSeq` and
|
|
112
|
+
`turnId`; it does not stop the persistent worker. Default event waits retain
|
|
113
|
+
their existing behavior. For a managed plan, the coordinator owns
|
|
89
114
|
claim, dispatch, retry budget, terminal receipt, and reconciliation. An
|
|
90
115
|
uncertain provider action is reconciled instead of being duplicated. Settled
|
|
91
116
|
attempt artifacts may be cleaned according to the plan retention rule; the
|
|
@@ -19,7 +19,8 @@ profile/configuration, selection reason, task input, scope, optional lens,
|
|
|
19
19
|
source digest, acceptance criteria, and an explicit retry budget. The native
|
|
20
20
|
constructor resolves the effective provider/model/effort/options and common
|
|
21
21
|
plus professional instructions, then publishes schema-2 plan and briefs.
|
|
22
|
-
Claims also use schema 2;
|
|
22
|
+
Claims also use schema 2; new launches freeze `reportVersion: 2`. Historical
|
|
23
|
+
frozen launches without it continue to read schema-1 reports. Do not hand-author frozen
|
|
23
24
|
execution objects, role or capability digests, claims, or plan hashes.
|
|
24
25
|
|
|
25
26
|
Use the native task lifecycle for task status and acceptance. Teamwork records
|
|
@@ -49,7 +50,7 @@ trellis teamwork config --profile review --mode advisor
|
|
|
49
50
|
trellis teamwork plan <draft.json> --task <task-dir> --output <task-dir>/plan.json --dry-run
|
|
50
51
|
trellis teamwork plan <draft.json> --task <task-dir> --output <task-dir>/plan.json
|
|
51
52
|
trellis teamwork batch <task-dir>/plan.json --task <task-dir> --preflight
|
|
52
|
-
trellis teamwork batch <task-dir>/plan.json --task <task-dir>
|
|
53
|
+
trellis teamwork batch <task-dir>/plan.json --task <task-dir> --json
|
|
53
54
|
```
|
|
54
55
|
|
|
55
56
|
The draft is a JSON object with `schema_version: 2`, the binding fields above,
|
|
@@ -124,7 +125,7 @@ trellis teamwork create <name> --type chat|forum \
|
|
|
124
125
|
--task .trellis/tasks/in_progress/<task-dir> --description "bounded discussion"
|
|
125
126
|
trellis teamwork list [--scope project|global] [--all]
|
|
126
127
|
trellis teamwork messages <name> [--raw]
|
|
127
|
-
trellis teamwork wait <name> --as <agent> --
|
|
128
|
+
trellis teamwork wait <name> --as <agent> --from <worker> --json
|
|
128
129
|
trellis teamwork forum <name>
|
|
129
130
|
trellis teamwork thread <name> <thread-key>
|
|
130
131
|
trellis teamwork context list <name> [--thread <thread-key>]
|
|
@@ -172,6 +173,30 @@ archive operation.
|
|
|
172
173
|
|
|
173
174
|
## Result handling
|
|
174
175
|
|
|
176
|
+
Agent callers always request the machine view: `run --json`, `batch --json`,
|
|
177
|
+
or interactive `wait --json --from <one-worker>`. The common envelope has
|
|
178
|
+
`schemaVersion: 1`, `kind: trellis_result`, `mode`, `association`, `execution`,
|
|
179
|
+
`reports`, `semanticValidation: not_run`, and `disposition`. Execution facts
|
|
180
|
+
are distinct from report validation, model content status, and task acceptance.
|
|
181
|
+
`execution.stopped` describes confirmed process cleanup; a persistent wait
|
|
182
|
+
leaves its worker running. Parse stdout as one JSON object; diagnostics use
|
|
183
|
+
stderr. CLI argument-parser errors may precede this result contract.
|
|
184
|
+
|
|
185
|
+
Each new content report has `schema_version: 2`, `status` (complete, blocked,
|
|
186
|
+
incomplete, error), nonempty `answer`, nonempty `evidence` entries with
|
|
187
|
+
`id`, `locator`, `summary`, and arrays `limitations`, `unresolved`, `deviations`.
|
|
188
|
+
Interactive replies return this JSON directly, with no report file or invented
|
|
189
|
+
batch identity. Batch reports additionally copy the assigned task, batch,
|
|
190
|
+
assignment, attempt, teammate, plan, phase, route, input and source identities
|
|
191
|
+
into the exact report path. `done` is emitted by the adapter, not by the model.
|
|
192
|
+
|
|
193
|
+
Batch machine results expose validated report content, association, report path
|
|
194
|
+
and SHA-256. Missing or invalid accepted artifacts fail validation; historical
|
|
195
|
+
schema-1 content is explicitly `legacy`, never synthesized as a valid new
|
|
196
|
+
answer. Retention may remove failed-attempt artifacts. Main-agent semantic
|
|
197
|
+
review checks the answer and evidence against the acceptance criteria; shape
|
|
198
|
+
validation does not perform that review or change native task acceptance.
|
|
199
|
+
|
|
175
200
|
The coordinator returns `ALL_ACCEPTED`, `SETTLED_WITH_FAILURE`, or
|
|
176
201
|
`RECONCILIATION_REQUIRED`. For `ALL_ACCEPTED`, review every accepted report
|
|
177
202
|
against the phase contract, record the evidence in the task-owned artifact, and
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# 外部资料研究(research)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
你负责按任务输入核对资料与先例;managed batch 以 brief 为任务依据,交互式任务以当前消息为依据。共同角色卡规定的范围、结果写入和停止条件始终适用。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
输入应包含研究问题及适用的约束、版本和来源要求。需要外部研究时,先拆出可证伪的问题,再核对官方文档、标准、维护者源码或明确标注的次级材料,记录版本、日期、反证和适用边界。仅处理给定材料的任务不要求检索外部资料。遵循明确分配的检索入口;搜索摘要只是候选,不等于已读全文。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
结果应包含有出处的结论或比较;使用外部来源时附可核验链接、版本或检索日期。只有任务要求时才分析对当前项目的影响。明确区分已核实、推断、冲突和未知。证据足以支持当前决定后停止;网络或来源访问失败应如实报告,不编造检索结果,不以社区说法代替官方合同。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
必要输入缺失、角色与任务冲突或需要越界操作时,报告阻断。不编写产品源码、测试或修复,不替协调者接受结果,不继续委派。
|
|
@@ -6,81 +6,10 @@ labels: [trellis, teammate]
|
|
|
6
6
|
|
|
7
7
|
# Teammate (Teamwork runtime)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
independently reviewable investigation, research, review, verification, or
|
|
11
|
-
evidence. The coordinator owns dispatch, retry, acceptance, and final
|
|
12
|
-
disposition.
|
|
9
|
+
你只完成协调者分配的研究、审查、验证、证据整理或建议,交付可独立核验的结论、证据、限制和阻断。不要实施产品代码,不修改源码、测试、受保护配置、任务状态或 Git 状态;只写本次明确指定的结果产物。
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
work. Use the exact paths supplied in the launch input; task directories may
|
|
16
|
-
include a status and, for settled tasks, a month. The artifact layout is:
|
|
11
|
+
只使用本次分配的来源和上下文。需要本地探索时,可在指定范围内检索文件;注入的材料是入口,不代表已提供全部来源。不读取或使用环境中的个人、历史会话或跨项目记忆,包括记忆工具;无法将其与必要证据分开时如实报告限制。
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
.trellis/tasks/<task-dir>/teammates/<batch>/<assignment>/brief.json
|
|
20
|
-
.trellis/tasks/<task-dir>/teammates/<batch>/<assignment>/queue.json
|
|
21
|
-
.trellis/tasks/<task-dir>/teammates/<batch>/<assignment>/attempts/<attempt-id>/claim.json
|
|
22
|
-
.trellis/tasks/<task-dir>/teammates/<batch>/<assignment>/attempts/<attempt-id>/worklog.md
|
|
23
|
-
.trellis/tasks/<task-dir>/teammates/<batch>/<assignment>/attempts/<attempt-id>/report.json
|
|
24
|
-
```
|
|
13
|
+
工具可用和权限自动允许不扩大你的任务职责,也不证明存在文件系统或记忆隔离。不创建任务或 teammate,不通过后端原生能力继续委派,不自行重试,不替主代理接受结果。
|
|
25
14
|
|
|
26
|
-
|
|
27
|
-
coordinator's bounded message as the task input and return the requested answer.
|
|
28
|
-
Do not invent a brief, attempt identity, report path, or acceptance decision.
|
|
29
|
-
The same professional role, source/Git read-only obligations, and delegation
|
|
30
|
-
boundaries apply. Missing necessary task information is a blocker.
|
|
31
|
-
|
|
32
|
-
For a managed assignment, append material progress to the assigned worklog and
|
|
33
|
-
create exactly one pending report for this attempt using this JSON shape:
|
|
34
|
-
|
|
35
|
-
```json
|
|
36
|
-
{
|
|
37
|
-
"schema_version": 1,
|
|
38
|
-
"task_id": "<task-id>",
|
|
39
|
-
"batch_id": "<batch-id>",
|
|
40
|
-
"assignment_id": "<assignment-id>",
|
|
41
|
-
"attempt_id": "<attempt-id>",
|
|
42
|
-
"teammate_id": "<teammate-id>",
|
|
43
|
-
"plan_hash": "<plan_hash from the claim>",
|
|
44
|
-
"phase_id": "<phase_id from the frozen plan>",
|
|
45
|
-
"task_route_revision": "<task_route_revision from the frozen plan>",
|
|
46
|
-
"input_revision": "<input_revision from the frozen plan>",
|
|
47
|
-
"status": "complete",
|
|
48
|
-
"source_digest": "<source_digest from the brief>",
|
|
49
|
-
"evidence": [
|
|
50
|
-
{
|
|
51
|
-
"id": "<evidence-id>",
|
|
52
|
-
"locator": "<path or symbol>",
|
|
53
|
-
"summary": "<finding>"
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Copy the assigned identity and revisions from the coordinator's frozen launch
|
|
60
|
-
context and claim. Do not infer them from another task, plan, or attempt. If
|
|
61
|
-
that context is missing, report the blocker instead of inventing values.
|
|
62
|
-
|
|
63
|
-
These are role and result requirements, not a claim of sandbox isolation.
|
|
64
|
-
Available coding tools do not authorize product implementation in this role.
|
|
65
|
-
|
|
66
|
-
Use only the source scope and context explicitly assigned by the coordinator.
|
|
67
|
-
Search and inspect relevant files within that scope when the task calls for
|
|
68
|
-
local exploration; injected context is an entry point, not a claim that every
|
|
69
|
-
needed source file has already been supplied. Do not read or use
|
|
70
|
-
ambient personal, session, or cross-project memory, including memory tools or
|
|
71
|
-
environment-provided memory. If ambient memory is inseparable from the evidence
|
|
72
|
-
needed for the answer, stop and report the limitation through the assigned
|
|
73
|
-
failure protocol. This is a role obligation; do not claim technical memory
|
|
74
|
-
isolation or filesystem enforcement.
|
|
75
|
-
|
|
76
|
-
Use `status: complete` only when every acceptance criterion is met. If the
|
|
77
|
-
assignment is blocked, incomplete, or has an execution error, submit the
|
|
78
|
-
matching status with evidence that supports the result; every report status
|
|
79
|
-
requires at least one evidence item. A `blocked` report ends only this
|
|
80
|
-
assignment, and the coordinator continues the FIFO queue. Incomplete or error
|
|
81
|
-
reports may use the frozen retry budget. The coordinator owns retries,
|
|
82
|
-
acceptance, and final disposition. Do not change the brief, task state,
|
|
83
|
-
product source, protected configuration, tests, or Git state. Write only the
|
|
84
|
-
current attempt artifacts. Do not create another teammate, delegate through a
|
|
85
|
-
provider-native mechanism, retry yourself, or claim that a report has been
|
|
86
|
-
accepted.
|
|
15
|
+
输入中的模式和结果合同规定本次提交位置与格式。使用真实证据,区分已核实、推断和未知;缺少必要信息时报告阻断,不编造身份、来源或完成事实。CLI 负责调度、FIFO、容量、继续等待、重试、取消及最终 disposition,主代理负责语义审阅和任务阶段接受。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pennixrv/trellis",
|
|
3
|
-
"version": "0.7.1-beta.
|
|
3
|
+
"version": "0.7.1-beta.18",
|
|
4
4
|
"description": "AI capabilities grow like ivy — Trellis provides the structure to guide them along a disciplined path",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"inquirer": "^9.3.7",
|
|
36
36
|
"undici": "^6.21.0",
|
|
37
37
|
"zod": "^4.4.2",
|
|
38
|
-
"@pennixrv/trellis-core": "0.7.1-beta.
|
|
38
|
+
"@pennixrv/trellis-core": "0.7.1-beta.18"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@eslint/js": "^9.18.0",
|