@really-knows-ai/foundry 3.5.1 → 3.5.2

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.
@@ -160,7 +160,7 @@ function cycleArgs(s) { return {
160
160
  inputs: s.object({
161
161
  type: s.enum(['any-of', 'all-of']).describe('Contract type: any-of (at least one) or all-of (all must exist)'),
162
162
  artefacts: s.array(s.string()).describe('Artefact type IDs this cycle reads'),
163
- }).optional().describe('Input contract for this cycle'),
163
+ }).optional().describe('Input contract for this cycle. Omit for source cycles that start from the user goal; empty artefacts arrays are invalid.'),
164
164
  targets: s.array(s.string()).optional().describe('Downstream cycle IDs this cycle can route to'),
165
165
  humanAppraise: s.boolean().optional().describe('Include human-appraise in every iteration'),
166
166
  deadlockAppraise: s.boolean().optional().describe('Route to human-appraise on LLM appraiser deadlock'),
@@ -173,7 +173,7 @@ function cycleArgs(s) { return {
173
173
  read: s.array(s.string()).describe('Memory store keys this cycle can read'),
174
174
  write: s.array(s.string()).describe('Memory store keys this cycle can write'),
175
175
  }).optional().describe('Flow memory permissions'),
176
- models: s.object({}).optional().describe('Per-stage model overrides (e.g. { forge: "openai/gpt-4o" })'),
176
+ models: s.object({}).optional().describe('Per-stage model overrides (e.g. { forge: "opencode-go/deepseek-v4-flash", appraise: "opencode-go/qwen3.6-plus" }). Preserve user-selected stage models.'),
177
177
  description: s.string().optional().describe('Prose description placed after frontmatter'),
178
178
  }; }
179
179
 
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.5.2] - 2026-05-23
4
+
5
+ ### Fixed
6
+
7
+ - Guide agents to omit empty `inputs` for source cycles and preserve stage-specific model overrides when creating cycles.
8
+
3
9
  ## [3.5.1] - 2026-05-22
4
10
 
5
11
  ### Fixed
@@ -40,6 +40,10 @@ When invoked with pre-filled fields matching the `foundry_config_create_cycle` t
40
40
 
41
41
  Context fields: `{id, name, outputType, description, inputs?, targets?, humanAppraise?, deadlockAppraise?, deadlockIterations?, maxIterations?, assay?, memory?, models?}`
42
42
 
43
+ `inputs` is optional. A source cycle that starts from the user's run goal and has no upstream artefact dependency omits `inputs` entirely. Empty input contracts are invalid: do not pass `inputs: {type: "any-of", artefacts: []}`.
44
+
45
+ `models` is a map of stage names to model IDs. Preserve user-selected model overrides exactly, for example `{forge: "opencode-go/deepseek-v4-flash", appraise: "opencode-go/qwen3.6-plus"}`.
46
+
43
47
  When invoked with a context:
44
48
  - If all required fields are present, skip the Understand phase and proceed to Plan → Confirm → Build.
45
49
  - If only some fields are present, ask only for the missing ones.
@@ -80,7 +84,7 @@ If the parent flow or required artefact type is missing and the user's goal clea
80
84
 
81
85
  **Optional clusters** — After each cluster, ask whether the user wants to configure it; if not, skip:
82
86
 
83
- - **Routing**: `inputs` (input contract: `{type: "any-of"|"all-of", artefacts: string[]}`), `targets` (cycle IDs to route to after completion), `maxIterations` (maximum iterations before forced progression)
87
+ - **Routing**: `inputs` (input contract: `{type: "any-of"|"all-of", artefacts: string[]}`; omit for source cycles with no upstream artefact dependency), `targets` (cycle IDs to route to after completion), `maxIterations` (maximum iterations before forced progression)
84
88
  - **Human-appraise**: `humanAppraise` (boolean, default false) — human reviews every iteration; `deadlockAppraise` (boolean, default true) — human is pulled in when LLM appraisers deadlock; `deadlockIterations` (number, default 5) — deadlock threshold. Only applies when either appraise is enabled.
85
89
  - **Memory and models**: `assay` (assay configuration), `memory` (memory configuration), `models` (stage-specific model overrides, e.g. `{forge: "openai/gpt-4o", appraise: "openai/gpt-4o"}`). For models, offer each stage (forge, quench, appraise) individually. If the user has no preference, omit the `models` map and use the session defaults.
86
90
 
@@ -98,7 +102,7 @@ Ask: "Proceed with this plan?" — wait for user answer before building. If the
98
102
 
99
103
  1. **Validate**: Call `foundry_config_validate_cycle({ name: "<id>", body: "<assembled markdown>" })`. Assemble the body from the fields using the frontmatter format the tool produces internally. If the result is `{ ok: false, errors: [...] }`, address each error and re-run until `{ ok: true }`. Common issues: missing required frontmatter keys, references to artefact types or flows that do not exist yet.
100
104
 
101
- 2. **Create**: Call `foundry_config_create_cycle({ id: "<id>", name: "<name>", outputType: "<type>", description: "<description>", inputs: ..., targets: ..., humanAppraise: ..., deadlockAppraise: ..., deadlockIterations: ..., maxIterations: ..., assay: ..., memory: ..., models: ... })`. The tool:
105
+ 2. **Create**: Call `foundry_config_create_cycle({ id: "<id>", name: "<name>", outputType: "<type>", description: "<description>", targets: ..., humanAppraise: ..., deadlockAppraise: ..., deadlockIterations: ..., maxIterations: ..., assay: ..., memory: ..., models: ... })`. Include `inputs` only when the cycle reads upstream artefacts, and include `models` whenever the user selected stage-specific model overrides. The tool:
102
106
  - re-validates the body (TOCTOU);
103
107
  - writes `foundry/cycles/<id>.md`;
104
108
  - produces one git commit on the current `config/*` branch.
@@ -69,7 +69,7 @@ Create missing dependencies in validation order:
69
69
 
70
70
  3. **Appraisers** (may reference models): For each new appraiser, gather `id`, `name`, `description`, and optional `model` preference. Context object: `{id, name, description, model?}`.
71
71
 
72
- 4. **Cycles** (reference artefact types, laws, appraisers): For each new cycle, gather `id`, `name`, `outputType`, `description`, and any optional settings (inputs, targets, appraise, assay, memory, models). Context object: `{id, name, outputType, description, inputs?, targets?, humanAppraise?, deadlockAppraise?, deadlockIterations?, maxIterations?, assay?, memory?, models?}`.
72
+ 4. **Cycles** (reference artefact types, laws, appraisers): For each new cycle, gather `id`, `name`, `outputType`, `description`, and any optional settings (inputs, targets, appraise, assay, memory, models). Context object: `{id, name, outputType, description, inputs?, targets?, humanAppraise?, deadlockAppraise?, deadlockIterations?, maxIterations?, assay?, memory?, models?}`. For a source cycle that starts from the user's run goal and has no upstream artefact dependency, omit `inputs` entirely; never pass `inputs` with an empty `artefacts` array.
73
73
 
74
74
  For the haiku example, default to a `haiku` artefact type, `haikus/*.md` file pattern, laws for form, imagery, and mood, a deterministic syllable validator where project dependencies allow it, two or three distinct appraisers, one cycle, and one flow.
75
75
 
@@ -92,6 +92,7 @@ Flow: <id> — <name>
92
92
  · <id> — <description>
93
93
  Cycles:
94
94
  · <id> → <outputType> — <description>
95
+ inputs/models: <omitted or explicit settings>
95
96
  ```
96
97
 
97
98
  Ask "Proceed with this plan?" — do not build anything until the user confirms.
@@ -121,9 +122,11 @@ Build order (dependency order):
121
122
 
122
123
  4. **Cycles**: For each new cycle, invoke the `add-cycle` protocol with the captured context.
123
124
 
124
- > Invoke the add-cycle protocol with context: `{id: "haiku-cycle", name: "Haiku Cycle", outputType: "haiku", description: "Generates haiku poems"}`.
125
+ > Invoke the add-cycle protocol with context: `{id: "haiku-cycle", name: "Haiku Cycle", outputType: "haiku", description: "Generates haiku poems", models: {forge: "opencode-go/deepseek-v4-flash", appraise: "opencode-go/qwen3.6-plus"}}`.
125
126
  > If all required fields are present, proceed directly to Build. Otherwise ask for missing required fields only.
126
127
 
128
+ Preserve every user-selected stage model in the cycle context. If the cycle has no upstream artefact input, leave `inputs` absent from the context.
129
+
127
130
  **Build-only mode**: When all required fields for a sub-skill are present in the context, the sub-skill skips Understand, Plan, and Confirm — proceeding directly to validate → create → commit. When only some required fields are present, the sub-skill enters its Understand phase to ask only for those missing required fields, then proceeds to Build (still skipping Plan and Confirm since the parent's combined plan already handled confirmation). Optional fields that are missing are silently skipped.
128
131
 
129
132
  **Error handling during build**: If a sub-skill's Build phase fails (validation error or tool error), surface the error to the user:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@really-knows-ai/foundry",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "description": "A skill-driven framework for governed artefact generation with AI coding tools. Define your own artefact types, laws, and flows — Foundry handles the forge → quench → appraise pipeline with deterministic routing, quality gates, and iterative refinement.",
5
5
  "type": "module",
6
6
  "main": "dist/.opencode/plugins/foundry.js",