@fro.bot/systematic 2.9.2 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -326,11 +326,52 @@ Configuration is loaded from multiple locations and merged (later sources overri
326
326
  | `bootstrap.enabled` | `boolean` | `true` | Inject the `using-systematic` guide into system prompts |
327
327
  | `bootstrap.file` | `string` | — | Custom bootstrap file path (overrides default) |
328
328
 
329
- Agent overlays support `model`, `variant`, `temperature`, `top_p`, `permission`, `mode`, `color`, `steps`, `hidden`, exact-agent-only `disable`, and managed `skills`. `color` accepts `#RGB`, `#RRGGBB`, or OpenCode named color tokens matching `[a-zA-Z][a-zA-Z0-9-]*`; whitespace/freeform numeric strings are rejected. `skills` uses bundled skill frontmatter names like `ce:review`; it is a shortcut that writes OpenCode `permission.skill` rules, not a native OpenCode agent field. Because `model` controls provider routing/cost/privacy and `permission`/`skills` control tool access, those fields are only accepted from user config or `$OPENCODE_CONFIG_DIR/systematic.json`. Project config may tune non-sensitive presentation and runtime fields such as `variant`, `temperature`, `top_p`, `mode`, `color`, `steps`, `hidden`, or exact-agent `disable`, but it cannot choose model/provider routing or loosen permission/capability policy.
330
-
331
- Systematic separates config-source precedence from overlay precedence. Config files merge in this order: user config, project config, then `$OPENCODE_CONFIG_DIR/systematic.json` if set. Higher-priority `agents.<key>` and `categories.<id>` entries replace lower-priority entries wholesale, while unrelated keys survive. Project overlays are the exception for trust-sensitive fields: same-key project overlays preserve user-level `model`, `permission`, and `skills` fields instead of erasing them. After the effective config is built, exact `agents` overlays beat category overlays, which beat built-in policy defaults, bundled markdown defaults, and OpenCode inherited defaults.
332
-
333
- Bundled agents omit `model` by default so OpenCode model inheritance keeps working. Systematic emits a `model` only when you configure one explicitly in user or custom config; provider-specific zero-config model defaults are intentionally deferred.
329
+ Agent overlays support `model`, `variant`, `temperature`, `top_p`, `permission`, `mode`, `color`, `steps`, `hidden`, exact-agent-only `disable`, and managed `skills`. `color` accepts `#RGB`, `#RRGGBB`, or OpenCode named color tokens matching `[a-zA-Z][a-zA-Z0-9-]*`; whitespace/freeform numeric strings are rejected. `skills` uses bundled skill frontmatter names like `ce:review`; it is a shortcut that writes OpenCode `permission.skill` rules, not a native OpenCode agent field. Because `model` and `variant` control provider routing/cost/privacy and `permission`/`skills` control tool access, those fields are only accepted from user config or `$OPENCODE_CONFIG_DIR/systematic.json`. Project config may tune non-sensitive presentation and runtime fields such as `temperature`, `top_p`, `mode`, `color`, `steps`, `hidden`, or exact-agent `disable`, but it cannot choose model/provider routing, tune `variant`, or loosen permission/capability policy.
330
+
331
+ Systematic separates config-source precedence from overlay precedence. Config files merge in this order: user config, project config, then `$OPENCODE_CONFIG_DIR/systematic.json` if set. Higher-priority `agents.<key>` and `categories.<id>` entries replace lower-priority entries wholesale, while unrelated keys survive. Project overlays are the exception for trust-sensitive fields: same-key project overlays preserve user-level `model`, `variant`, `permission`, and `skills` fields instead of erasing them. After the effective config is built, Systematic applies agent overlay precedence for bundled agents:
332
+
333
+ 1. Exact `agents.<key>` overlay (high-trust `model` wins)
334
+ 2. `categories.<category-id>` overlay (high-trust `model` wins)
335
+ 3. Source category model default (built-in, code-owned)
336
+ 4. Bundled markdown/frontmatter defaults
337
+ 5. OpenCode inherited defaults
338
+
339
+ Source category model defaults are primary model choices only — they are not fallback chains. Systematic does not support `fallback_models`, inherited retry semantics, runtime fallback behavior, or fallback to the parent model when a source model is unavailable. Explicit and source model IDs are structurally validated and may still fail at OpenCode runtime if the provider or model is unavailable.
340
+
341
+ If you want to restore OpenCode parent-model inheritance for a bundled agent or category (opting out of the source default), set `"model": null` in high-trust user or `$OPENCODE_CONFIG_DIR/systematic.json` config. Project config cannot use `model: null` — project config cannot set, erase, or shadow `model` at any value.
342
+
343
+ The source defaults are:
344
+
345
+ | Category | Default `model` | Rationale |
346
+ |----------|-----------------|-----------|
347
+ | `design` | `openai/gpt-5.5` | High-judgment UX/product/design work benefits from a strong general reasoning model. |
348
+ | `docs` | `openai/gpt-5.4-mini` | Documentation and summarization should start cheaper/faster. |
349
+ | `document-review` | `anthropic/claude-opus-4.7` | Requirements and plan critique benefit from strongest nuanced reasoning. |
350
+ | `research` | `openai/gpt-5.5` | Tool-heavy synthesis and source evaluation benefit from a strong general reasoning model. |
351
+ | `review` | `anthropic/claude-opus-4.7` | Code/security/adversarial review benefits from strongest reasoning. |
352
+ | `workflow` | `openai/gpt-5.4-mini` | Orchestration and bounded implementation should default cheaper/faster. |
353
+
354
+ These defaults are owned by Systematic code and emitted for bundled agents in each category when no stronger high-trust exact or category `model` override exists. Uncategorized bundled agents receive no source default and continue inheriting the parent OpenCode model. Native OpenCode agents with the same emitted key are full replacements and receive no Systematic source model default.
355
+
356
+ Bundled agent markdown still intentionally omits `model` — the field belongs in source code defaults, not portable markdown files. Authors must not add `model:` frontmatter to bundled agent files.
357
+
358
+ Systematic emits a source model as the default; you can override it per-agent or per-category in user or `$OPENCODE_CONFIG_DIR/systematic.json` config. Project config cannot set, erase, or shadow `model` policy.
359
+
360
+ > **Migration: Restoring parent-model inheritance.** If you previously relied on bundled agents inheriting the parent OpenCode model (no source defaults), set `"model": null` in your high-trust config to opt out of the source default per agent or per category. For example:
361
+ >
362
+ > ```jsonc
363
+ > // ~/.config/opencode/systematic.json or $OPENCODE_CONFIG_DIR/systematic.json
364
+ > {
365
+ > "categories": {
366
+ > "review": { "model": null } // All review agents inherit parent model
367
+ > },
368
+ > "agents": {
369
+ > "security-sentinel": { "model": null } // Single agent inherits parent model
370
+ > }
371
+ > }
372
+ > ```
373
+ >
374
+ > This only works from high-trust config (user or `$OPENCODE_CONFIG_DIR/systematic.json`). Project `.opencode/systematic.json` cannot set `model: null` or any `model` value.
334
375
 
335
376
  Native OpenCode agents with the same emitted key are full replacements. An exact Systematic overlay for that key conflicts, while category overlays skip native replacements and continue applying to other bundled agents. Use one canonical agent key form across config sources (`security-sentinel` or `review/security-sentinel`) because alias collisions fail duplicate-target validation.
336
377
 
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  findCommandsInDir,
7
7
  findSkillsInDir,
8
8
  getConfigPaths
9
- } from "./index-d5ewqz8w.js";
9
+ } from "./index-mfy9dbdx.js";
10
10
 
11
11
  // src/cli.ts
12
12
  import fs from "fs";
@@ -856,7 +856,12 @@ var DEFAULT_CONFIG = {
856
856
  agents: {},
857
857
  categories: {}
858
858
  };
859
- var SECURITY_OVERLAY_FIELDS = new Set(["model", "permission", "skills"]);
859
+ var SECURITY_OVERLAY_FIELDS = new Set([
860
+ "model",
861
+ "variant",
862
+ "permission",
863
+ "skills"
864
+ ]);
860
865
  function isErrorWithCode(error) {
861
866
  return error instanceof Error && "code" in error;
862
867
  }
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  loadConfig,
13
13
  loadConfigWithSources,
14
14
  parseFrontmatter
15
- } from "./index-d5ewqz8w.js";
15
+ } from "./index-mfy9dbdx.js";
16
16
 
17
17
  // src/index.ts
18
18
  import fs4 from "fs";
@@ -79,6 +79,14 @@ ${toolMapping}
79
79
  // src/lib/agent-overlays.ts
80
80
  import fs2 from "fs";
81
81
  import path2 from "path";
82
+ var SOURCE_CATEGORY_MODEL_DEFAULTS = {
83
+ design: "openai/gpt-5.5",
84
+ docs: "openai/gpt-5.4-mini",
85
+ "document-review": "anthropic/claude-opus-4.7",
86
+ research: "openai/gpt-5.5",
87
+ review: "anthropic/claude-opus-4.7",
88
+ workflow: "openai/gpt-5.4-mini"
89
+ };
82
90
  var ALLOWED_OVERLAY_FIELDS = new Set([
83
91
  "model",
84
92
  "variant",
@@ -158,6 +166,23 @@ function inferBuiltInTemperature(name, description) {
158
166
  }
159
167
  return 0.3;
160
168
  }
169
+ function getSourceCategoryModel(category) {
170
+ if (!category)
171
+ return;
172
+ return SOURCE_CATEGORY_MODEL_DEFAULTS[category];
173
+ }
174
+ function assertSourceCategoryModelCoverage(categories) {
175
+ validateSourceCategoryModelDefaults();
176
+ const missingCategories = categories.filter((category) => !Object.hasOwn(SOURCE_CATEGORY_MODEL_DEFAULTS, category));
177
+ if (missingCategories.length > 0) {
178
+ throw new Error(`Source category model defaults missing intentional coverage for: ${missingCategories.join(", ")}`);
179
+ }
180
+ }
181
+ function validateSourceCategoryModelDefaults(defaults = SOURCE_CATEGORY_MODEL_DEFAULTS) {
182
+ for (const [category, model] of Object.entries(defaults)) {
183
+ validateModel("source category model defaults", `source category model defaults.${category}`, model);
184
+ }
185
+ }
161
186
  function validateExactAgentOverlays(inventory, overlays, nativeAgents, enabledSkills) {
162
187
  const result = [];
163
188
  const seenTargets = new Map;
@@ -227,6 +252,8 @@ function hasPermissionSkill(permission) {
227
252
  function validateOverlayFieldValue(sourcePath, keyPath, field, value, enabledSkills) {
228
253
  switch (field) {
229
254
  case "model":
255
+ if (value === null)
256
+ return;
230
257
  validateModel(sourcePath, keyPath, value);
231
258
  return;
232
259
  case "variant":
@@ -571,6 +598,12 @@ function applyAgentOverlays(config, agentInfo, overlays) {
571
598
  addPermissionRules(permissionRules, config.permission);
572
599
  }
573
600
  result.temperature = inferBuiltInTemperature(agentInfo.name, result.description);
601
+ if (agentInfo.category) {
602
+ const sourceModel = getSourceCategoryModel(agentInfo.category);
603
+ if (sourceModel) {
604
+ result.model = sourceModel;
605
+ }
606
+ }
574
607
  if (categoryOverlay) {
575
608
  applyOverlayObject(result, categoryOverlay.value, permissionRules);
576
609
  }
@@ -603,7 +636,11 @@ var OVERLAY_ASSIGN_FIELDS = [
603
636
  function applyOverlayObject(target, overlay, permissionRules) {
604
637
  for (const field of OVERLAY_ASSIGN_FIELDS) {
605
638
  if (Object.hasOwn(overlay, field)) {
606
- target[field] = overlay[field];
639
+ if (field === "model" && overlay[field] === null) {
640
+ delete target[field];
641
+ } else {
642
+ target[field] = overlay[field];
643
+ }
607
644
  }
608
645
  }
609
646
  if (isRecord(overlay.permission)) {
@@ -699,6 +736,7 @@ function createConfigHandler(deps) {
699
736
  const bundledSkills = collectSkillsAsCommands(bundledSkillsDir, systematicConfig.disabled_skills);
700
737
  const enabledSkillNames = collectEnabledSkillNames(bundledSkillsDir, systematicConfig.disabled_skills);
701
738
  const inventory = buildBundledAgentInventory(bundledAgentsDir, systematicConfig.disabled_agents);
739
+ assertSourceCategoryModelCoverage(inventory.categories);
702
740
  const validatedOverlays = validateAgentOverlays({
703
741
  inventory,
704
742
  overlays,
@@ -42,3 +42,6 @@ export declare function buildBundledAgentInventory(agentsDir: string, disabledAg
42
42
  export declare function validateAgentOverlays({ inventory, overlays, nativeAgents, enabledSkills, }: ValidateAgentOverlaysOptions): ValidatedAgentOverlays;
43
43
  export declare function resolveAgentOverlaySet(overlays: ValidatedAgentOverlays): ResolvedAgentOverlaySet;
44
44
  export declare function inferBuiltInTemperature(name: string, description?: string): number;
45
+ export declare function getSourceCategoryModel(category: string | undefined): string | undefined;
46
+ export declare function assertSourceCategoryModelCoverage(categories: string[]): void;
47
+ export declare function validateSourceCategoryModelDefaults(defaults?: Record<string, unknown>): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fro.bot/systematic",
3
- "version": "2.9.2",
3
+ "version": "2.10.0",
4
4
  "description": "Structured engineering workflows for OpenCode",
5
5
  "type": "module",
6
6
  "homepage": "https://fro.bot/systematic",
@@ -339,7 +339,7 @@ async function detectLanguagesAndFrameworks() {
339
339
  if (allDeps[dep]) {
340
340
  // Check exclusion rules before adding
341
341
  const exclusions = NODE_FRAMEWORK_EXCLUSIONS[fw]
342
- if (exclusions && exclusions.some((ex) => allDeps[ex])) continue
342
+ if (exclusions?.some((ex) => allDeps[ex])) continue
343
343
 
344
344
  const ver = allDeps[dep].replace(/[\^~>=<]/g, '').split(' ')[0]
345
345
  frameworks.push(ver ? `${fw} ${ver}` : fw)
@@ -821,7 +821,7 @@ async function findTestInfra() {
821
821
  'src/__tests__',
822
822
  ]
823
823
  for (const dir of testDirs) {
824
- if (await exists(join(root, dir))) dirs.push(dir + '/')
824
+ if (await exists(join(root, dir))) dirs.push(`${dir}/`)
825
825
  }
826
826
 
827
827
  // Test config files
@@ -1042,13 +1042,13 @@ async function main() {
1042
1042
  infrastructure,
1043
1043
  }
1044
1044
 
1045
- process.stdout.write(JSON.stringify(inventory) + '\n')
1045
+ process.stdout.write(`${JSON.stringify(inventory)}\n`)
1046
1046
  }
1047
1047
 
1048
1048
  main().catch((err) => {
1049
1049
  // Always exit 0 with valid JSON, even on error
1050
1050
  process.stdout.write(
1051
- JSON.stringify({
1051
+ `${JSON.stringify({
1052
1052
  error: err.message,
1053
1053
  name: basename(root),
1054
1054
  languages: [],
@@ -1062,6 +1062,6 @@ main().catch((err) => {
1062
1062
  docs: [],
1063
1063
  testInfra: { dirs: [], config: [] },
1064
1064
  infrastructure: { envFiles: [], configFiles: [], services: [] },
1065
- }) + '\n',
1065
+ })}\n`,
1066
1066
  )
1067
1067
  })
@@ -86,7 +86,7 @@ description: ...
86
86
  ---
87
87
  ```
88
88
 
89
- Per [OpenCode's agent docs](https://opencode.ai/docs/agents/), subagents with no `model` inherit the model of the primary agent that invoked them — which is the desired portable behavior. Do **not** declare `model: inherit`: that literal value is undocumented and produces `ProviderModelNotFoundError` on OpenCode older than ~v1.13.x (pre [sst/opencode#17888](https://github.com/sst/opencode/pull/17888)). Hardcoded provider model IDs (`anthropic/...`, `openai/...`, etc.) are also banned because they break users on other providers.
89
+ Per [OpenCode's agent docs](https://opencode.ai/docs/agents/), subagents with no `model` inherit the model of the primary agent that invoked them — which is the desired portable behavior. Do **not** declare `model: inherit`: that literal value is undocumented and produces `ProviderModelNotFoundError` on OpenCode older than ~v1.13.x (pre [sst/opencode#17888](https://github.com/sst/opencode/pull/17888)). Hardcoded provider model IDs (`anthropic/...`, `openai/...`, etc.) are also banned from **bundled agent markdown/frontmatter** because they break users on other providers. Source-owned category model defaults in TypeScript code are a separate mechanism — they are audited, centrally maintained, and do not violate this markdown rule.
90
90
 
91
91
  For agent or API attribution, `ai:systematic` is the machine ID used by Systematic-owned operations, such as Proof's `by` field and `X-Agent-Id` header. It is not a skill cross-reference convention.
92
92
 
@@ -120,7 +120,9 @@ Per [OpenCode's agent docs](https://opencode.ai/docs/agents/): **"If you don't s
120
120
 
121
121
  Do **not** declare `model: inherit`. That literal value is undocumented and was treated as a real provider/model string by `Provider.parseModel()` until [sst/opencode#17888](https://github.com/sst/opencode/pull/17888) landed in mid-March 2026 — producing `ProviderModelNotFoundError` on every subagent invocation for anyone on an older OpenCode. Omitting the field works on every OpenCode version and is what the docs canonically describe.
122
122
 
123
- Hardcoded provider IDs (`anthropic/claude-...`, `openai/gpt-...`, etc.) are also banned because they make an agent unusable for users on other providers. If a future agent truly depends on a specific provider, document the constraint in the plan and get explicit review before adding the hardcoded model.
123
+ Hardcoded provider IDs (`anthropic/claude-...`, `openai/gpt-...`, etc.) are also banned from **bundled agent markdown/frontmatter** because they make an agent unusable for users on other providers. This ban does not apply to source-owned category model defaults in TypeScript code, which are centrally maintained, structurally validated, and emitted at the built-in/default layer during config handling. If a future agent truly depends on a specific provider in its markdown, document the constraint in the plan and get explicit review before adding the hardcoded model.
124
+
125
+ Systematic provides source-owned category model defaults in TypeScript code for all six bundled agent categories (`design`, `docs`, `document-review`, `research`, `review`, `workflow`). These code-level defaults are emitted during config handling and do not change the markdown contract: bundled agent files must still omit `model` frontmatter. The content-integrity gate continues to enforce the markdown-level ban independently of what source code defaults provide.
124
126
 
125
127
  ### Machine ID
126
128