@really-knows-ai/foundry 3.8.3 → 3.8.4
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.
|
@@ -133,6 +133,7 @@ function artefactTypeArgs(s) { return {
|
|
|
133
133
|
name: s.string().describe('Human-readable display name (accepted at boundary, not persisted — id becomes frontmatter.name)'),
|
|
134
134
|
filePatterns: s.array(s.string()).describe('Glob patterns defining forge write scope (written to frontmatter.file-patterns)'),
|
|
135
135
|
description: s.string().describe('Prose description placed under ## Definition'),
|
|
136
|
+
example: s.string().optional().describe('Example artefact structure (markdown with code blocks). Written to example.md alongside definition.md. Guides forge agents on the expected output format.'),
|
|
136
137
|
appraisers: s.object({
|
|
137
138
|
count: s.number().optional().describe('Number of appraisers per cycle'),
|
|
138
139
|
allowed: s.array(s.string()).optional().describe('Restrict to specific appraiser IDs'),
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.8.4] - 2026-05-27
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `foundry_config_create_artefact_type` now accepts an optional `example` arg. When provided, it writes `foundry/artefacts/<id>/example.md` alongside `definition.md`. The example file is a structure document — markdown with code blocks showing the expected output format, plus documentation for the forge agent.
|
|
8
|
+
|
|
9
|
+
- The `add-artefact-type` skill now prompts users to provide an example artefact during the Understand phase, includes it in the Plan, and passes it to the create tool in Build.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Human-appraise stage tokens no longer carry a subagent model scope. Previously, `sort.js` resolved a model for human-appraise routes (falling through to `defaultModel`), which got embedded in the token. `foundry_stage_begin` then rejected the token because the main Foundry agent is not the scoped subagent, causing the human-appraise stage to fail to start and user feedback to be lost. Human-appraise always runs inline by the Foundry agent.
|
|
14
|
+
|
|
3
15
|
## [3.8.3] - 2026-05-27
|
|
4
16
|
|
|
5
17
|
### Changed
|
|
@@ -50,7 +50,30 @@ const _create = makeCreator({
|
|
|
50
50
|
validator: validate,
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Assemble the markdown body for example.md from structured arguments.
|
|
55
|
+
*
|
|
56
|
+
* The example file is a structure document: markdown with code blocks showing
|
|
57
|
+
* the expected output format, plus documentation for the forge agent.
|
|
58
|
+
*
|
|
59
|
+
* @param {string} exampleContent - Raw markdown for example.md
|
|
60
|
+
* @returns {string} Trimmed content with trailing newline.
|
|
61
|
+
*/
|
|
62
|
+
export function assembleExampleMarkdown(exampleContent) {
|
|
63
|
+
return `${exampleContent.trim()}\n`;
|
|
64
|
+
}
|
|
65
|
+
|
|
53
66
|
export async function create(args) {
|
|
54
67
|
const body = assembleArtefactTypeMarkdown(args);
|
|
68
|
+
|
|
69
|
+
if (args.example) {
|
|
70
|
+
const exampleDir = join('foundry', 'artefacts', args.id);
|
|
71
|
+
await args.io.mkdirp(exampleDir);
|
|
72
|
+
await args.io.writeFile(
|
|
73
|
+
join(exampleDir, 'example.md'),
|
|
74
|
+
assembleExampleMarkdown(args.example),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
55
78
|
return _create({ ...args, name: args.id, body });
|
|
56
79
|
}
|
package/dist/scripts/sort.js
CHANGED
|
@@ -166,6 +166,7 @@ function resolveModelId(routeBase, models, defaultModel) {
|
|
|
166
166
|
|
|
167
167
|
function pickModelId(route, frontmatter, defaultModel) {
|
|
168
168
|
const routeBase = baseStage(route);
|
|
169
|
+
if (routeBase === 'human-appraise') return null;
|
|
169
170
|
const resolved = frontmatter.models ? resolveModelId(routeBase, frontmatter.models, defaultModel) : null;
|
|
170
171
|
return resolved || defaultModel || defaultForStage(routeBase);
|
|
171
172
|
}
|
|
@@ -38,7 +38,7 @@ Do not tell the user to call branch tools directly.
|
|
|
38
38
|
|
|
39
39
|
When invoked with pre-filled fields matching the `foundry_config_create_artefact_type` tool args, skip questions for provided fields. Missing fields trigger clarifying questions.
|
|
40
40
|
|
|
41
|
-
Context fields: `{id, name, filePatterns, description, appraisers?}`
|
|
41
|
+
Context fields: `{id, name, filePatterns, description, example?, appraisers?}`
|
|
42
42
|
|
|
43
43
|
When invoked with a context:
|
|
44
44
|
- If all required fields are present, skip the Understand phase and proceed to Plan → Confirm → Build.
|
|
@@ -48,6 +48,12 @@ When invoked with a context:
|
|
|
48
48
|
|
|
49
49
|
Ask for each field one question at a time. Prefer multiple choice for `filePatterns`, deriving options from the artefact type name and common conventions (e.g. `haikus/*.md`, `haiku.md`, `output/haiku/*.md`). Ask about `appraisers` (optional) — either provide an existing appraiser ID or skip.
|
|
50
50
|
|
|
51
|
+
After the core fields, ask about the example:
|
|
52
|
+
|
|
53
|
+
> Would you like to provide an example artefact? An example shows forge agents the expected output structure — markdown with code blocks, plus any conventions, constraints, or required sections. Give a short example file that demonstrates what a valid output looks like.
|
|
54
|
+
|
|
55
|
+
If the user provides an example, capture it verbatim. If the artefact type has no structured output (e.g. free-form prose with no required format), the user may skip this step.
|
|
56
|
+
|
|
51
57
|
**Naming conflict check**: Read all existing artefact type definitions in `foundry/artefacts/*/definition.md`. Exact id match means a hard conflict — choose a different id. A semantically similar name or description triggers a warning:
|
|
52
58
|
|
|
53
59
|
> An artefact type `<existing-id>` already exists that seems similar:
|
|
@@ -74,6 +80,7 @@ Present the definition to the user with these structured fields:
|
|
|
74
80
|
- `name` (string) — human-readable label.
|
|
75
81
|
- `filePatterns` (string[]) — glob patterns for files this type produces.
|
|
76
82
|
- `description` (string) — prose description of what this artefact type is.
|
|
83
|
+
- `example` (string, optional) — example artefact to guide forge agents on the expected output structure.
|
|
77
84
|
- `appraisers` ({ count?: number, allowed?: string[] }, optional) — appraiser configuration.
|
|
78
85
|
|
|
79
86
|
Ask: does this capture the artefact type correctly? Iterate until the user is satisfied.
|
|
@@ -86,7 +93,7 @@ Ask: "Proceed with this plan?" — wait for user answer before building. If the
|
|
|
86
93
|
|
|
87
94
|
1. **Validate**: Call `foundry_config_validate_artefact_type({ 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.
|
|
88
95
|
|
|
89
|
-
2. **Create**: Call `foundry_config_create_artefact_type({ id: "<id>", name: "<name>", filePatterns: ["<pattern>"], description: "<description>" })`. The tool re-validates the body (TOCTOU), writes `foundry/artefacts/<id>/definition.md
|
|
96
|
+
2. **Create**: Call `foundry_config_create_artefact_type({ id: "<id>", name: "<name>", filePatterns: ["<pattern>"], description: "<description>", example: "<example>" })`. Include `example` only when the user provided one. The tool re-validates the body (TOCTOU), writes `foundry/artefacts/<id>/definition.md` (and `example.md` if provided), and produces one git commit on the current `config/*` branch. Show the user the resulting commit hash.
|
|
90
97
|
|
|
91
98
|
If the tool returns `{ ok: false, errors }` because the target file already exists, read the existing file, incorporate the user's requested changes into the current body, propose the merged result for review, then write and commit the updated file.
|
|
92
99
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@really-knows-ai/foundry",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.4",
|
|
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",
|