@pennixrv/trellis 0.7.1-beta.18 → 0.7.1-beta.19

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.
Files changed (31) hide show
  1. package/dist/commands/teamwork/artifact.js +2 -2
  2. package/dist/commands/teamwork/artifact.js.map +1 -1
  3. package/dist/commands/teamwork/batch.d.ts.map +1 -1
  4. package/dist/commands/teamwork/batch.js +4 -1
  5. package/dist/commands/teamwork/batch.js.map +1 -1
  6. package/dist/commands/teamwork/coordination.d.ts +66 -0
  7. package/dist/commands/teamwork/coordination.d.ts.map +1 -1
  8. package/dist/commands/teamwork/coordination.js +82 -6
  9. package/dist/commands/teamwork/coordination.js.map +1 -1
  10. package/dist/commands/teamwork/coordinator.d.ts.map +1 -1
  11. package/dist/commands/teamwork/coordinator.js +2 -1
  12. package/dist/commands/teamwork/coordinator.js.map +1 -1
  13. package/dist/commands/teamwork/guard.d.ts +2 -2
  14. package/dist/commands/teamwork/guard.d.ts.map +1 -1
  15. package/dist/commands/teamwork/guard.js +8 -4
  16. package/dist/commands/teamwork/guard.js.map +1 -1
  17. package/dist/commands/teamwork/index.d.ts.map +1 -1
  18. package/dist/commands/teamwork/index.js +2 -0
  19. package/dist/commands/teamwork/index.js.map +1 -1
  20. package/dist/commands/teamwork/teammate-config.d.ts +4 -1
  21. package/dist/commands/teamwork/teammate-config.d.ts.map +1 -1
  22. package/dist/commands/teamwork/teammate-config.js +48 -16
  23. package/dist/commands/teamwork/teammate-config.js.map +1 -1
  24. package/dist/migrations/manifests/0.7.1-beta.19.json +9 -0
  25. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-teamwork.md +2 -2
  26. package/dist/templates/common/bundled-skills/trellis-teamwork/SKILL.md +1 -1
  27. package/dist/templates/common/bundled-skills/trellis-teamwork/references/coordination-modes.md +16 -5
  28. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-configuration-matrix.md +4 -2
  29. package/dist/templates/trellis/config.yaml +2 -5
  30. package/dist/templates/trellis/teamwork.json +6 -5
  31. package/package.json +2 -2
@@ -2,9 +2,15 @@ import crypto from "node:crypto";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import { DIR_NAMES } from "../../constants/paths.js";
5
+ import { DEFAULT_TEAMWORK_CONFIG, readCoordinationConfig, } from "./coordination.js";
5
6
  const DEFAULT_CONFIG = {
6
- teammate: { maxConcurrency: 1 },
7
- guard: { maxLiveTeammates: 6, nonBatchReserved: 0 },
7
+ teammate: {
8
+ maxConcurrency: DEFAULT_TEAMWORK_CONFIG.modes.general.max_concurrency,
9
+ },
10
+ guard: {
11
+ maxLiveTeammates: DEFAULT_TEAMWORK_CONFIG.resources.max_live_teammates,
12
+ nonBatchReserved: DEFAULT_TEAMWORK_CONFIG.resources.non_batch_reserved,
13
+ },
8
14
  };
9
15
  function integer(value, field, positive = false) {
10
16
  if (value === undefined)
@@ -44,35 +50,61 @@ function yamlInteger(content, section, key) {
44
50
  }
45
51
  return undefined;
46
52
  }
47
- export function resolveTeammateRuntimeConfig(cwd = process.cwd(), env = process.env) {
53
+ export function resolveTeammateRuntimeConfig(cwd = process.cwd(), env = process.env, mode) {
48
54
  const configPath = path.join(cwd, DIR_NAMES.WORKFLOW, "config.yaml");
49
55
  let content = "";
50
56
  try {
51
57
  content = fs.readFileSync(configPath, "utf8");
52
58
  }
53
- catch {
54
- // Built-in defaults are intentionally conservative.
59
+ catch (error) {
60
+ if (error.code !== "ENOENT")
61
+ throw error;
55
62
  }
63
+ const resolved = readCoordinationConfig(cwd);
64
+ const selected = mode ?? resolved.config.default_mode;
65
+ const legacyConcurrency = yamlInteger(content, "teammate", "max_concurrency");
66
+ const legacyLive = yamlInteger(content, "teammate_guard", "max_live_teammates");
67
+ const legacyReserved = yamlInteger(content, "teammate_guard", "non_batch_reserved");
68
+ const diagnostics = [];
69
+ if (legacyConcurrency !== undefined ||
70
+ legacyLive !== undefined ||
71
+ legacyReserved !== undefined)
72
+ diagnostics.push(resolved.legacy
73
+ ? "Legacy YAML capacity is active; migrate to .trellis/teamwork.json schema 2."
74
+ : "Legacy YAML capacity keys are ignored by teamwork.json schema 2; remove them with trellis update.");
75
+ if (resolved.legacy && resolved.source !== "built-in")
76
+ diagnostics.push("Legacy teamwork.json schema 1; update to schema 2 for mode-specific capacity.");
77
+ for (const key of [
78
+ "TRELLIS_TEAMWORK_TEAMMATE_MAX_CONCURRENCY",
79
+ "TRELLIS_TEAMWORK_MAX_LIVE_TEAMMATES",
80
+ "TRELLIS_TEAMWORK_TEAMMATE_RESERVED",
81
+ ])
82
+ if (env[key])
83
+ diagnostics.push(`${key} explicitly overrides the project capacity policy.`);
56
84
  const maxConcurrency = integer(env.TRELLIS_TEAMWORK_TEAMMATE_MAX_CONCURRENCY
57
85
  ? Number(env.TRELLIS_TEAMWORK_TEAMMATE_MAX_CONCURRENCY)
58
- : yamlInteger(content, "teammate", "max_concurrency"), "teamwork.teammate.max_concurrency", true) ?? DEFAULT_CONFIG.teammate.maxConcurrency;
86
+ : resolved.legacy && legacyConcurrency !== undefined
87
+ ? legacyConcurrency
88
+ : resolved.config.modes[selected].max_concurrency, "teamwork.teammate.max_concurrency", true) ?? DEFAULT_CONFIG.teammate.maxConcurrency;
59
89
  const maxLiveTeammates = integer(env.TRELLIS_TEAMWORK_MAX_LIVE_TEAMMATES
60
90
  ? Number(env.TRELLIS_TEAMWORK_MAX_LIVE_TEAMMATES)
61
- : yamlInteger(content, "teammate_guard", "max_live_teammates"), "teamwork.teammate_guard.max_live_teammates", true) ?? DEFAULT_CONFIG.guard.maxLiveTeammates;
91
+ : resolved.legacy && legacyLive !== undefined
92
+ ? legacyLive
93
+ : resolved.config.resources.max_live_teammates, "teamwork.teammate_guard.max_live_teammates", true) ?? DEFAULT_CONFIG.guard.maxLiveTeammates;
62
94
  const nonBatchReserved = integer(env.TRELLIS_TEAMWORK_TEAMMATE_RESERVED
63
95
  ? Number(env.TRELLIS_TEAMWORK_TEAMMATE_RESERVED)
64
- : yamlInteger(content, "teammate_guard", "non_batch_reserved"), "teamwork.teammate_guard.non_batch_reserved") ?? DEFAULT_CONFIG.guard.nonBatchReserved;
96
+ : resolved.legacy && legacyReserved !== undefined
97
+ ? legacyReserved
98
+ : resolved.config.resources.non_batch_reserved, "teamwork.teammate_guard.non_batch_reserved") ?? DEFAULT_CONFIG.guard.nonBatchReserved;
65
99
  return {
66
100
  teammate: { maxConcurrency },
67
101
  guard: { maxLiveTeammates, nonBatchReserved },
68
- ...(content
69
- ? {
70
- sourceDigest: crypto
71
- .createHash("sha256")
72
- .update(content)
73
- .digest("hex"),
74
- }
75
- : {}),
102
+ source: resolved.source,
103
+ diagnostics,
104
+ sourceDigest: crypto
105
+ .createHash("sha256")
106
+ .update(content + resolved.configDigest)
107
+ .digest("hex"),
76
108
  };
77
109
  }
78
110
  export function effectiveTeammateCapacity(input) {
@@ -1 +1 @@
1
- {"version":3,"file":"teammate-config.js","sourceRoot":"","sources":["../../../src/commands/teamwork/teammate-config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAiBrD,MAAM,cAAc,GAA0B;IAC5C,QAAQ,EAAE,EAAE,cAAc,EAAE,CAAC,EAAE;IAC/B,KAAK,EAAE,EAAE,gBAAgB,EAAE,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE;CACpD,CAAC;AAEF,SAAS,OAAO,CACd,KAAyB,EACzB,KAAa,EACb,QAAQ,GAAG,KAAK;IAEhB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,G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AI,KAAK,CACb,sEAAsE,CACvE,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CACvB,SAAS,EACT,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EACpC,cAAc,EACd,KAAK,CAAC,eAAe,CACtB,CAAC;IACF,IAAI,QAAQ,IAAI,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,CAAC,SAAS,GAAG,QAAQ,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CACb,+BAA+B,KAAK,CAAC,SAAS,2BAA2B,QAAQ,EAAE,CACpF,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.7.1-beta.19",
3
+ "description": "Centralize Teamwork capacity policy and enable multi-advisor consultations",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "Mode capacity defaults 8/3/3, member defaults 1/3/3, shared budget 8; schema-2 policy with diagnosed legacy/environment compatibility; advisor supports 1–3 assignments.",
7
+ "migrations": [],
8
+ "notes": "Run trellis update for generated schema-2 policy and Skills. Review customized schema-1 policy before migrating; historical plans remain unchanged."
9
+ }
@@ -27,12 +27,12 @@ The storage root defaults to `~/.trellis/teamwork`; `TRELLIS_TEAMWORK_ROOT` over
27
27
 
28
28
  ## Configuration
29
29
 
30
- The project configuration supports `teamwork.teammate.max_concurrency` and `teamwork.teammate_guard.idle_timeout`, `max_live_teammates`, and `non_batch_reserved`. Defaults and CLI overrides are defined by the current Trellis CLI; read `packages/cli/src/commands/teamwork/teammate-config.ts` before changing them.
30
+ The schema-2 `.trellis/teamwork.json` owns mode member defaults, mode concurrency limits, and the shared live-process budget and reservation. Defaults are members 1/3/3, concurrency 8/3/3, live budget 8, and reservation 0. YAML retains `teamwork.teammate_guard.idle_timeout`; legacy YAML capacity applies only before schema-2 migration and is otherwise ignored with diagnostics. Runtime `maxConcurrency` is a resolved value, not an independent configuration. Read `coordination.ts` and `teammate-config.ts` before changing this policy.
31
31
 
32
32
  `teamwork config` resolves project defaults. `teamwork plan` freezes profile,
33
33
  configuration, instructions and evidence into schema-2 plan/brief artifacts;
34
34
  `teamwork batch --task` connects the foreground coordinator to Codex app-server,
35
- Claude CLI, Copilot ACP or DSH ACP. Claims are schema 2, reports schema 1.
35
+ Claude CLI, Copilot ACP or DSH ACP. Claims and content reports are schema 2.
36
36
  An unresolved batch keeps a durable project capacity reservation, including
37
37
  after coordinator exit. The guard and session cleanup preserve that evidence.
38
38
  Role read-only and history-use requirements are behavioral contracts; runtime
@@ -39,7 +39,7 @@ trellis teamwork context list <session> --scope global --thread <thread>
39
39
  | User intent | Read |
40
40
  |---|---|
41
41
  | `general`: bounded research, review, or verification assignments | `references/teamwork-plan-construction.md`, then `references/coordination-modes.md` |
42
- | Advisor: one bounded consultation | `references/coordination-modes.md`, then `references/teamwork-plan-construction.md` |
42
+ | Advisor: one to three bounded consultations | `references/coordination-modes.md`, then `references/teamwork-plan-construction.md` |
43
43
  | `committee`: parallel assessment by two or three distinct lenses | `references/coordination-modes.md`, then `references/teamwork-plan-construction.md` |
44
44
  | Profile, model, provider, reasoning effort, or role-card configuration | `references/teammate-configuration-matrix.md` |
45
45
  | “和 codex/claude 讨论一下”, “brainstorm with another agent” | `references/teamwork-plan-construction.md`, then `references/coordination-modes.md` |
@@ -8,12 +8,23 @@ envelope. Mode selection does not waive result validation or main-agent
8
8
  semantic review. It also does not transfer FIFO or process control to a model.
9
9
 
10
10
  Project defaults live in `.trellis/teamwork.json`: general defaults to one
11
- member, advisor to one, and committee to three. Read them with
11
+ member, advisor to three, and committee to three. Schema 2 also owns the mode
12
+ concurrency limits (general 8, advisor 3, committee 3) and the shared live-process
13
+ budget (8, with 0 reserved for non-batch work). Read them with
12
14
  `trellis teamwork config --mode <mode>`. The coordinator uses `defaultMembers`
13
15
  when composing assignments; it must write each member explicitly. The runtime
14
16
  does not invent assignments or silently duplicate one to reach the default.
15
- Changing defaults affects only newly constructed plans. Advisor must have one
16
- member, committee two or three, and general one or more within capacity.
17
+ Changing defaults affects only newly constructed plans. Advisor must have one to
18
+ three members, committee two or three, and general one or more within capacity.
19
+
20
+ Member count guides plan composition; concurrency limits simultaneous work.
21
+ Effective capacity is bounded by the selected mode, requested capacity, shared
22
+ live budget after reservations, and verified host capability. Existing live
23
+ workers and batch reservations share admission control. Environment overrides
24
+ are explicit and reported in `capacityPolicy.diagnostics`. Legacy schema 1 and
25
+ YAML capacity remain readable for compatibility. Schema 2 ignores legacy YAML
26
+ capacity keys with a diagnostic, so a stale YAML limit of 1 cannot silently
27
+ override the new policy. YAML retains idle-cleanup settings.
17
28
 
18
29
  ## `general`
19
30
 
@@ -24,8 +35,8 @@ each assignment independently.
24
35
 
25
36
  ## `advisor`
26
37
 
27
- Use advisor coordination for one bounded consultation. The plan contains
28
- exactly one assignment and its result is advice for the current coordinator.
38
+ Use advisor coordination for one to three bounded consultations. Each advisor
39
+ returns independent advice for the current coordinator; the default is three.
29
40
  The result still carries a source digest and acceptance evidence and does not
30
41
  change the task or phase by itself.
31
42
 
@@ -7,8 +7,10 @@
7
7
  | `.trellis/agents/teammate-profiles.json`,schema 2 | `default_profile`;每个 profile 的 `role`、`default_configuration` 和 2–3 套命名 `configurations` |
8
8
  | `.trellis/agents/teammate.md` | 通用角色、只读职责和结果合同 |
9
9
  | `.trellis/agents/profiles/<profile>.md` | 精确专业角色卡;普通 Markdown,通过 Trellis 注入,不注册宿主原生角色 |
10
- | `.trellis/teamwork.json`,schema 1 | `default_mode` 及三种模式的 `default_members` |
11
- | `.trellis/config.yaml` 的 `teamwork.*` | 并发和进程容量限制 |
10
+ | `.trellis/teamwork.json`,schema 2 | `default_mode`;各模式的 `default_members`、`max_concurrency`;`resources` 中的共享进程预算与非 batch 预留 |
11
+ | `.trellis/config.yaml` 的 `teamwork.teammate_guard.idle_timeout` | 空闲清理;旧容量键仅在未迁移到 schema 2 时兼容读取 |
12
+
13
+ 默认成员数为 general 1、advisor 3、committee 3;默认并发上限分别为 8、3、3,共享存活进程预算为 8,非 batch 预留为 0。成员数用于构造计划,不要求同时运行;有效并发还受显式请求、共享预算和宿主能力约束。schema 2 不再叠加旧 YAML 容量上限,兼容读取和环境覆盖均在 `capacityPolicy.diagnostics` 中说明。`capacityPolicy` 是解析结果,不是另一套配置。
12
14
 
13
15
  每套执行配置包含 `provider`、`model`,可选 `reasoning_effort` 和适配器支持的 `options`。上下文长度沿用 provider 默认,不配置 token 或预算机制。`teammate` 是内部执行者类型,公开计划不填写 `role_id`;`lens` 只表示成员的“本次关注点”。
14
16
 
@@ -102,7 +102,7 @@ max_journal_lines: 2000
102
102
  #
103
103
  # `idle_timeout: 0` disables idle cleanup (teammates can sit idle forever
104
104
  # unless explicitly killed or given `--timeout`).
105
- # `max_live_teammates: 0` disables the spawn-time budget check.
105
+ # Capacity policy lives in .trellis/teamwork.json (schema 2).
106
106
  #
107
107
  # `trusted_context_dirs` extends the `--file`/`--jsonl`/`--agent` containment
108
108
  # check beyond the teammate cwd — useful when `.trellis/tasks` or
@@ -115,13 +115,10 @@ max_journal_lines: 2000
115
115
  teamwork:
116
116
  teammate_guard:
117
117
  idle_timeout: 5m
118
- max_live_teammates: 6
119
- non_batch_reserved: 0
118
+ # Capacity and shared live budget live in .trellis/teamwork.json.
120
119
  # trusted_context_dirs:
121
120
  # - /work/user/trellis_workspace
122
121
  # auto_trust_trellis_symlinks: false
123
- teammate:
124
- max_concurrency: 1
125
122
 
126
123
  #-------------------------------------------------------------------------------
127
124
  # Codex (dispatch behavior)
@@ -1,9 +1,10 @@
1
1
  {
2
- "schema_version": 1,
2
+ "schema_version": 2,
3
3
  "default_mode": "general",
4
4
  "modes": {
5
- "general": { "default_members": 1 },
6
- "advisor": { "default_members": 1 },
7
- "committee": { "default_members": 3 }
8
- }
5
+ "general": { "default_members": 1, "max_concurrency": 8 },
6
+ "advisor": { "default_members": 3, "max_concurrency": 3 },
7
+ "committee": { "default_members": 3, "max_concurrency": 3 }
8
+ },
9
+ "resources": { "max_live_teammates": 8, "non_batch_reserved": 0 }
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pennixrv/trellis",
3
- "version": "0.7.1-beta.18",
3
+ "version": "0.7.1-beta.19",
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.18"
38
+ "@pennixrv/trellis-core": "0.7.1-beta.19"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@eslint/js": "^9.18.0",