fito-tui 0.5.0 → 0.6.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/agents/fito-case-source-planner.md +42 -13
- package/agents/fito-performance-reviewer.md +15 -5
- package/agents/fito-tutor.md +2 -1
- package/extensions/fito-fetch-tools.js +63 -7
- package/extensions/fito-fetch-tools.ts +70 -7
- package/extensions/fito-startup.js +5 -2
- package/extensions/fito-startup.ts +5 -1
- package/package.json +1 -1
- package/prompts/fito-case-design.md +71 -16
- package/prompts/fito-case-generate.md +29 -10
- package/prompts/fito-case-open.md +17 -10
- package/prompts/fito-case-plan-source.md +13 -6
- package/prompts/fito-generate-domain-concepts.md +1 -1
- package/prompts/fito-generate-execution-facts.md +1 -1
- package/prompts/fito-generate-usage-scenarios.md +1 -1
- package/shared/case-briefing/briefing.js +1 -0
- package/shared/case-briefing/briefing.ts +1 -0
- package/skills/fito-case-author/SKILL.md +8 -6
- package/skills/fito-case-author/github-publish.js +29 -2
- package/skills/fito-case-author/github-publish.ts +30 -2
- package/skills/fito-case-author/publish.js +36 -3
- package/skills/fito-case-author/publish.ts +46 -2
- package/skills/fito-url-content-fetcher/SKILL.md +53 -16
|
@@ -37,10 +37,13 @@ Your caller hands you:
|
|
|
37
37
|
technologies paired with the major line each is scoped to. You pass the
|
|
38
38
|
matching version when you fetch a component (section 2), so every read
|
|
39
39
|
resolves the case's declared major line.
|
|
40
|
-
4. **The toolchain** — the
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
4. **The toolchain** — the tools and their major lines the case project is
|
|
41
|
+
built against (e.g. JDK 21, Gradle 9, Kotlin 2, Javalin 7), each entry
|
|
42
|
+
naming who provides it: `learner` (the learner installs it, and its line is
|
|
43
|
+
a minimum — that line or newer) or `project` (the build fetches it itself,
|
|
44
|
+
through a wrapper or a lockfile). It grounds a greenfield scaffold and the
|
|
45
|
+
build's version rules (section 4), and you cross-check it against the
|
|
46
|
+
declared technologies' version prose (section 2).
|
|
44
47
|
5. On a revision run, **the author's feedback** on the previous documents.
|
|
45
48
|
|
|
46
49
|
## 1. Read the case contract
|
|
@@ -73,7 +76,8 @@ From `<case-dir>/.case/`, collect what binds the source:
|
|
|
73
76
|
|
|
74
77
|
On **reuse**, also skim the project itself — **structure, not a deep read**:
|
|
75
78
|
layout, build/manifest files, test layout — enough to name real files in the
|
|
76
|
-
plan
|
|
79
|
+
plan, to confirm the gate commands are the ones the build files declare, and
|
|
80
|
+
to see how the build names each `learner` tool's version.
|
|
77
81
|
Read adaptively — never pull a whole large file into your context; the head
|
|
78
82
|
of a build file or a grep for a gate command is enough.
|
|
79
83
|
|
|
@@ -182,8 +186,9 @@ exactly two files.
|
|
|
182
186
|
### `.authoring/source-spec.md` — what the source must be
|
|
183
187
|
|
|
184
188
|
- **Project** — what the case project is and does, its stack and layout
|
|
185
|
-
(reuse: as skimmed; greenfield: what to build),
|
|
186
|
-
|
|
189
|
+
(reuse: as skimmed; greenfield: what to build), each `learner` tool as the
|
|
190
|
+
minimum line the build accepts, and how it matches the situation fiction
|
|
191
|
+
(names, framing, the story the tree must tell).
|
|
187
192
|
- **Starter state** (the branch carrying `.case/`) — the inline contract:
|
|
188
193
|
every failing test by name with how it must fail, every known error
|
|
189
194
|
verbatim, the build status, and what must *not* be present (the solution,
|
|
@@ -209,7 +214,7 @@ the starter checks fail on the starter branch exactly as `known_state.yaml`
|
|
|
209
214
|
states.
|
|
210
215
|
|
|
211
216
|
On **greenfield**, the scaffold steps must produce a **complete, buildable**
|
|
212
|
-
project from the declared toolchain —
|
|
217
|
+
project from the declared toolchain — four load-bearing requirements, each a
|
|
213
218
|
precondition for the plan to execute and every gate command to actually run:
|
|
214
219
|
|
|
215
220
|
- **Complete build config** — the build files wire the test runner (e.g.
|
|
@@ -220,10 +225,30 @@ precondition for the plan to execute and every gate command to actually run:
|
|
|
220
225
|
- **No patch pins** — every dependency version is a major line the toolchain
|
|
221
226
|
declared; the step resolves an actual release satisfying that major at build
|
|
222
227
|
time and pins no fabricated patch version.
|
|
228
|
+
- **Learner tools at their line or newer** — the build accepts each `learner`
|
|
229
|
+
entry at its declared line or any newer install, with that line as a floor
|
|
230
|
+
and no ceiling: a JVM build that targets Java 21 on whatever JDK 21 or newer
|
|
231
|
+
it finds, rather than demanding JDK 21 itself; a Node project whose
|
|
232
|
+
`engines` field reads `>=24`, rather than `24.x`. The step's check: the
|
|
233
|
+
gates pass on the minimum line, and the build file sets that line as a floor
|
|
234
|
+
with no upper limit; when the creator has a newer line installed, the gates
|
|
235
|
+
pass on it too.
|
|
223
236
|
- **A `.gitignore` covering build outputs** — a clean-tree guard so the starter
|
|
224
237
|
branch starts from a known state and every gate runs against the source, not
|
|
225
238
|
build artifacts.
|
|
226
239
|
|
|
240
|
+
On **reuse**, a build that refuses a newer line of a `learner` tool — an exact
|
|
241
|
+
version, such as a JVM build fixed at one JDK, or an upper limit, such as an
|
|
242
|
+
`engines` range that stops below the next Node line — gets a plan step of its
|
|
243
|
+
own that makes the build accept that line or newer, verified by the check
|
|
244
|
+
the greenfield bullet above names. The project's other pins stay as they are:
|
|
245
|
+
the build fetches those tools itself.
|
|
246
|
+
|
|
247
|
+
A `learner` tool the build cannot accept at its line or newer is a **gap**:
|
|
248
|
+
flag it in your digest rather than claiming the line or newer. The project's
|
|
249
|
+
own tools can set that ceiling — a build tool runs only on the runtime lines
|
|
250
|
+
it knows, up to its newest one.
|
|
251
|
+
|
|
227
252
|
Trace the starter contract entry by entry, never implicitly: every
|
|
228
253
|
`failing_tests` entry, every known error, and every deliverable has a named,
|
|
229
254
|
file-level counterpart in the plan — which file, what change or content makes
|
|
@@ -237,16 +262,20 @@ attestation, then `/fito-publish-case`.
|
|
|
237
262
|
|
|
238
263
|
**Done when** both files exist, the spec carries both terminal states with
|
|
239
264
|
every gate and every starter item inline, every plan step has a
|
|
240
|
-
verification,
|
|
241
|
-
as a gap
|
|
265
|
+
verification, every starter entry and deliverable is traced — or flagged
|
|
266
|
+
as a gap — and the build accepts every `learner` tool at its line or newer
|
|
267
|
+
(through the scaffold on greenfield, through a plan step on reuse wherever the
|
|
268
|
+
build refuses a newer line), or the tool is flagged as a gap.
|
|
242
269
|
|
|
243
270
|
## 5. Report back
|
|
244
271
|
|
|
245
272
|
Return a digest for your caller to relay — not a file dump: the scenario, the
|
|
246
273
|
two file paths, each terminal state in one line, the plan-step count, the
|
|
247
|
-
gates covered,
|
|
248
|
-
|
|
249
|
-
|
|
274
|
+
gates covered, each `learner` tool with its minimum line, any plan step that
|
|
275
|
+
lifts a limit on one, any `learner` tool flagged as a gap, any contract
|
|
276
|
+
conflict you surfaced (see Boundaries), and a **toolchain cross-check** section
|
|
277
|
+
listing every declared technology whose version description contradicted the
|
|
278
|
+
toolchain (empty when none did).
|
|
250
279
|
|
|
251
280
|
## Boundaries
|
|
252
281
|
|
|
@@ -36,8 +36,9 @@ you were given; the output contract differs per job.
|
|
|
36
36
|
- A **Needs human review** list of any `human` criteria.
|
|
37
37
|
2. The **case checkout path** — the absolute path of the local directory where the
|
|
38
38
|
learner is working. You read the learner's work from here to score the `ai` and
|
|
39
|
-
|
|
40
|
-
quotes in every command: it can hold a
|
|
39
|
+
failed-`hybrid` criteria — never an `automated` one. You never write to it. Use
|
|
40
|
+
the path exactly as given, in double quotes in every command: it can hold a
|
|
41
|
+
space or a `\`.
|
|
41
42
|
|
|
42
43
|
If you are given **no checkout path**, score the automated criteria from the report,
|
|
43
44
|
and say the `ai`/`hybrid` criteria could not be scored because no checkout was
|
|
@@ -48,13 +49,22 @@ Score **every** criterion the report lists, in report order, by its type.
|
|
|
48
49
|
|
|
49
50
|
## `automated` — score from the captured evidence
|
|
50
51
|
|
|
52
|
+
Score an `automated` criterion from the captured exit code and output alone: the
|
|
53
|
+
command is its whole evidence, so the checkout stays unread for it — even when a
|
|
54
|
+
rung seems to ask for more.
|
|
55
|
+
|
|
51
56
|
1. Read the captured stdout/stderr and exit code as the ground truth of what the
|
|
52
57
|
learner's work produced. A non-zero exit, an empty result where output was
|
|
53
58
|
required, or a "command not found" is itself evidence — usually `not_achieved`.
|
|
54
|
-
2. Judge that evidence against the **passing condition**, then
|
|
55
|
-
**level** (0–3)
|
|
59
|
+
2. Judge that evidence against the **passing condition**, then award the highest
|
|
60
|
+
**level** (0–3) the output proves. A rung that needs evidence this output does
|
|
61
|
+
not show is not awarded: a passing run proves its passing condition, not which
|
|
62
|
+
test covers a behavior or which call the code makes — unless the output prints
|
|
63
|
+
it.
|
|
56
64
|
3. Justify in one sentence citing the specific evidence (a line of stdout, the exit
|
|
57
|
-
code) — not a restatement of the level.
|
|
65
|
+
code) — not a restatement of the level. When a higher rung went unawarded
|
|
66
|
+
because the output cannot show it, the sentence also names what the output
|
|
67
|
+
could not show.
|
|
58
68
|
|
|
59
69
|
## `ai` — judge the learner's work against the prompt hint
|
|
60
70
|
|
package/agents/fito-tutor.md
CHANGED
|
@@ -43,7 +43,8 @@ from so you can cite it:
|
|
|
43
43
|
- `situation` — the scenario documents, in reading order.
|
|
44
44
|
- `task` — the objective, the constraints, any steps, the deliverables.
|
|
45
45
|
- `artifacts` — the annotated map of the files the case works on.
|
|
46
|
-
- `starter_state` — the baseline the learner started from
|
|
46
|
+
- `starter_state` — the baseline the learner started from, and the tools they
|
|
47
|
+
install to build it.
|
|
47
48
|
- `knowledge_refs` — the components the case teaches and the ones it assumes.
|
|
48
49
|
|
|
49
50
|
Fetch the keys the question actually turns on, not all six: what is being asked
|
|
@@ -4,12 +4,14 @@ import { listCompetences } from "../shared/competences/competence-list.js";
|
|
|
4
4
|
import { COMPONENT_TYPES } from "../shared/fito-api/client.js";
|
|
5
5
|
import { fetchKnowledgeComponent } from "../shared/knowledge-components/knowledge-fetch.js";
|
|
6
6
|
import { searchKnowledgeComponents } from "../shared/knowledge-components/knowledge-search.js";
|
|
7
|
+
import { resolveRegisteredTemplate } from "../shared/knowledge-components/push-payload.js";
|
|
7
8
|
import { fetchTechnology } from "../shared/knowledge-components/technology-fetch.js";
|
|
8
9
|
/**
|
|
9
|
-
* Side-effect-free registrar for the
|
|
10
|
+
* Side-effect-free registrar for the six Fito read-only fetch tools
|
|
10
11
|
* (`fito_knowledge_fetch`, `fito_knowledge_search`, `fito_technology_fetch`,
|
|
11
|
-
* `fito_competence_list`, `fito_case_partial_fetch`). The first
|
|
12
|
-
* the
|
|
12
|
+
* `fito_competence_list`, `fito_template_fetch`, `fito_case_partial_fetch`). The first five read the
|
|
13
|
+
* backend over HTTP; the sixth reads the learner's own `.case/` checkout through the
|
|
14
|
+
* `shared/case-briefing/` allow-list. None of them
|
|
13
15
|
* spawns a process or opens a caller-named path, which is what lets a persona denied `bash`,
|
|
14
16
|
* `read`, `edit` and `write` hold them (Success Criterion #9).
|
|
15
17
|
*
|
|
@@ -37,6 +39,8 @@ export const TECHNOLOGY_FETCH_TOOL = "fito_technology_fetch";
|
|
|
37
39
|
export const KNOWLEDGE_SEARCH_TOOL = "fito_knowledge_search";
|
|
38
40
|
/** Name of the in-process competence-listing custom tool (Task 15b.6). */
|
|
39
41
|
export const COMPETENCE_LIST_TOOL = "fito_competence_list";
|
|
42
|
+
/** Name of the in-process registered-template read (Task 17.22). */
|
|
43
|
+
export const TEMPLATE_FETCH_TOOL = "fito_template_fetch";
|
|
40
44
|
/** Name of the in-process case-briefing custom tool (Task 11.2). */
|
|
41
45
|
export const CASE_PARTIAL_FETCH_TOOL = "fito_case_partial_fetch";
|
|
42
46
|
/**
|
|
@@ -296,6 +300,57 @@ export function registerFitoCompetenceListTool(pi) {
|
|
|
296
300
|
});
|
|
297
301
|
});
|
|
298
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* Register the `fito_template_fetch` tool: given a component type and a technology slug, return
|
|
305
|
+
* the registered template — the field-schema a component's `content` must conform to — that the
|
|
306
|
+
* technology's `kind` selects (Task 17.22). The three `/fito-generate-*` prompts read it before they
|
|
307
|
+
* delegate. Without it they named no means, and each model found its own: the package's own
|
|
308
|
+
* `fito-api` code imported with `node -e`, which failed once on Windows, `curl`, or the authoring
|
|
309
|
+
* guide's field list alone (Task 17b.2's run, F1).
|
|
310
|
+
*
|
|
311
|
+
* **The tool takes the technology, not a kind**, so it resolves through `resolveRegisteredTemplate`,
|
|
312
|
+
* the same function `push.js` runs: the template the generator writes against is the one the push
|
|
313
|
+
* stores the component under, and no caller can ask for another variant.
|
|
314
|
+
*
|
|
315
|
+
* Transport + resolution stay in `shared/` (pi-free); this `execute()` is a thin adapter over two
|
|
316
|
+
* in-process public HTTP reads, and failures throw so pi marks the result `isError`.
|
|
317
|
+
*/
|
|
318
|
+
export function registerFitoTemplateFetchTool(pi) {
|
|
319
|
+
registerToolTolerant(() => {
|
|
320
|
+
pi.registerTool({
|
|
321
|
+
name: TEMPLATE_FETCH_TOOL,
|
|
322
|
+
label: "Fetch Fito template",
|
|
323
|
+
description: "Fetch the registered template a Fito knowledge component must conform to — its " +
|
|
324
|
+
"field-schema: each field's key, label, type and requirement. Pass the component type " +
|
|
325
|
+
"and the technology's slug (e.g. `javalin`): the technology's kind selects the variant " +
|
|
326
|
+
"(an exact `tool` or `practice` template, otherwise the shared `any` one), newest version " +
|
|
327
|
+
"first, which is the template `/fito-push-knowledge` stores the component under. Use it " +
|
|
328
|
+
"before generating a component's content. The backend is the source of truth, so fetch " +
|
|
329
|
+
"rather than recall. The read is public (no login). Returns the template as JSON; an " +
|
|
330
|
+
"unknown technology is an error.",
|
|
331
|
+
promptSnippet: "Fetch the registered field-schema a knowledge component type must conform to, for one technology",
|
|
332
|
+
promptGuidelines: [
|
|
333
|
+
`Use ${TEMPLATE_FETCH_TOOL} to read a component type's registered field-schema before generating its content, instead of reading the Fito package's code or calling the backend from the shell.`,
|
|
334
|
+
],
|
|
335
|
+
parameters: Type.Object({
|
|
336
|
+
// A literal union rather than a free string, as on `fito_knowledge_search`.
|
|
337
|
+
type: Type.Union(COMPONENT_TYPES.map((componentType) => Type.Literal(componentType)), { description: "The component type — `concept`, `execution-fact`, or `usage-scenario`." }),
|
|
338
|
+
technology: Type.String({
|
|
339
|
+
description: "The technology's slug (e.g. `javalin`, `specification-by-example`) — the middle " +
|
|
340
|
+
"segment of a knowledge-component id `<type>:<tech-slug>.<component-slug>`. Its kind " +
|
|
341
|
+
"selects the template variant.",
|
|
342
|
+
}),
|
|
343
|
+
}),
|
|
344
|
+
async execute(_toolCallId, params) {
|
|
345
|
+
const template = await resolveRegisteredTemplate(params.type, params.technology);
|
|
346
|
+
return {
|
|
347
|
+
content: [{ type: "text", text: JSON.stringify(template, null, 2) }],
|
|
348
|
+
details: { template },
|
|
349
|
+
};
|
|
350
|
+
},
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
}
|
|
299
354
|
/**
|
|
300
355
|
* Register the `fito_case_partial_fetch` tool: given a case id and one of an enumerated set of
|
|
301
356
|
* document **keys**, return that part of the learner's local `.case/` checkout. It is the read the
|
|
@@ -350,9 +405,9 @@ export function registerFitoCasePartialFetchTool(pi) {
|
|
|
350
405
|
"`manifest` is the case's title, type, version, tags and estimated duration; " +
|
|
351
406
|
"`situation` the scenario documents in reading order; `task` the objective, " +
|
|
352
407
|
"constraints, steps and deliverables; `artifacts` the annotated map of the files " +
|
|
353
|
-
"the case works on; `starter_state` the baseline the learner starts from
|
|
354
|
-
"`knowledge_refs` the knowledge components the case
|
|
355
|
-
"those with `fito_knowledge_fetch`).",
|
|
408
|
+
"the case works on; `starter_state` the baseline the learner starts from and the tools " +
|
|
409
|
+
"they install to build it; `knowledge_refs` the knowledge components the case " +
|
|
410
|
+
"teaches and assumes (fetch those with `fito_knowledge_fetch`).",
|
|
356
411
|
}),
|
|
357
412
|
}),
|
|
358
413
|
async execute(_toolCallId, params) {
|
|
@@ -366,7 +421,7 @@ export function registerFitoCasePartialFetchTool(pi) {
|
|
|
366
421
|
});
|
|
367
422
|
}
|
|
368
423
|
/**
|
|
369
|
-
* Register all
|
|
424
|
+
* Register all six Fito fetch tools. This is the module's `default` export so it can be
|
|
370
425
|
* named as a persona's `subagentOnlyExtensions` entry — `pi-subagents` loads the file
|
|
371
426
|
* as a `--extension` in the child, and the registered tool names then survive the
|
|
372
427
|
* child's strict `--tools` allowlist (Task 9a.10; pi-subagents README §subagentOnlyExtensions).
|
|
@@ -376,5 +431,6 @@ export default function registerFitoFetchTools(pi) {
|
|
|
376
431
|
registerFitoKnowledgeSearchTool(pi);
|
|
377
432
|
registerFitoTechnologyFetchTool(pi);
|
|
378
433
|
registerFitoCompetenceListTool(pi);
|
|
434
|
+
registerFitoTemplateFetchTool(pi);
|
|
379
435
|
registerFitoCasePartialFetchTool(pi);
|
|
380
436
|
}
|
|
@@ -6,13 +6,15 @@ import { listCompetences } from "../shared/competences/competence-list.ts";
|
|
|
6
6
|
import { COMPONENT_TYPES } from "../shared/fito-api/client.ts";
|
|
7
7
|
import { fetchKnowledgeComponent } from "../shared/knowledge-components/knowledge-fetch.ts";
|
|
8
8
|
import { searchKnowledgeComponents } from "../shared/knowledge-components/knowledge-search.ts";
|
|
9
|
+
import { resolveRegisteredTemplate } from "../shared/knowledge-components/push-payload.ts";
|
|
9
10
|
import { fetchTechnology } from "../shared/knowledge-components/technology-fetch.ts";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
|
-
* Side-effect-free registrar for the
|
|
13
|
+
* Side-effect-free registrar for the six Fito read-only fetch tools
|
|
13
14
|
* (`fito_knowledge_fetch`, `fito_knowledge_search`, `fito_technology_fetch`,
|
|
14
|
-
* `fito_competence_list`, `fito_case_partial_fetch`). The first
|
|
15
|
-
* the
|
|
15
|
+
* `fito_competence_list`, `fito_template_fetch`, `fito_case_partial_fetch`). The first five read the
|
|
16
|
+
* backend over HTTP; the sixth reads the learner's own `.case/` checkout through the
|
|
17
|
+
* `shared/case-briefing/` allow-list. None of them
|
|
16
18
|
* spawns a process or opens a caller-named path, which is what lets a persona denied `bash`,
|
|
17
19
|
* `read`, `edit` and `write` hold them (Success Criterion #9).
|
|
18
20
|
*
|
|
@@ -45,6 +47,9 @@ export const KNOWLEDGE_SEARCH_TOOL = "fito_knowledge_search";
|
|
|
45
47
|
/** Name of the in-process competence-listing custom tool (Task 15b.6). */
|
|
46
48
|
export const COMPETENCE_LIST_TOOL = "fito_competence_list";
|
|
47
49
|
|
|
50
|
+
/** Name of the in-process registered-template read (Task 17.22). */
|
|
51
|
+
export const TEMPLATE_FETCH_TOOL = "fito_template_fetch";
|
|
52
|
+
|
|
48
53
|
/** Name of the in-process case-briefing custom tool (Task 11.2). */
|
|
49
54
|
export const CASE_PARTIAL_FETCH_TOOL = "fito_case_partial_fetch";
|
|
50
55
|
|
|
@@ -331,6 +336,63 @@ export function registerFitoCompetenceListTool(pi: ExtensionAPI): void {
|
|
|
331
336
|
});
|
|
332
337
|
}
|
|
333
338
|
|
|
339
|
+
/**
|
|
340
|
+
* Register the `fito_template_fetch` tool: given a component type and a technology slug, return
|
|
341
|
+
* the registered template — the field-schema a component's `content` must conform to — that the
|
|
342
|
+
* technology's `kind` selects (Task 17.22). The three `/fito-generate-*` prompts read it before they
|
|
343
|
+
* delegate. Without it they named no means, and each model found its own: the package's own
|
|
344
|
+
* `fito-api` code imported with `node -e`, which failed once on Windows, `curl`, or the authoring
|
|
345
|
+
* guide's field list alone (Task 17b.2's run, F1).
|
|
346
|
+
*
|
|
347
|
+
* **The tool takes the technology, not a kind**, so it resolves through `resolveRegisteredTemplate`,
|
|
348
|
+
* the same function `push.js` runs: the template the generator writes against is the one the push
|
|
349
|
+
* stores the component under, and no caller can ask for another variant.
|
|
350
|
+
*
|
|
351
|
+
* Transport + resolution stay in `shared/` (pi-free); this `execute()` is a thin adapter over two
|
|
352
|
+
* in-process public HTTP reads, and failures throw so pi marks the result `isError`.
|
|
353
|
+
*/
|
|
354
|
+
export function registerFitoTemplateFetchTool(pi: ExtensionAPI): void {
|
|
355
|
+
registerToolTolerant(() => {
|
|
356
|
+
pi.registerTool({
|
|
357
|
+
name: TEMPLATE_FETCH_TOOL,
|
|
358
|
+
label: "Fetch Fito template",
|
|
359
|
+
description:
|
|
360
|
+
"Fetch the registered template a Fito knowledge component must conform to — its " +
|
|
361
|
+
"field-schema: each field's key, label, type and requirement. Pass the component type " +
|
|
362
|
+
"and the technology's slug (e.g. `javalin`): the technology's kind selects the variant " +
|
|
363
|
+
"(an exact `tool` or `practice` template, otherwise the shared `any` one), newest version " +
|
|
364
|
+
"first, which is the template `/fito-push-knowledge` stores the component under. Use it " +
|
|
365
|
+
"before generating a component's content. The backend is the source of truth, so fetch " +
|
|
366
|
+
"rather than recall. The read is public (no login). Returns the template as JSON; an " +
|
|
367
|
+
"unknown technology is an error.",
|
|
368
|
+
promptSnippet: "Fetch the registered field-schema a knowledge component type must conform to, for one technology",
|
|
369
|
+
promptGuidelines: [
|
|
370
|
+
`Use ${TEMPLATE_FETCH_TOOL} to read a component type's registered field-schema before generating its content, instead of reading the Fito package's code or calling the backend from the shell.`,
|
|
371
|
+
],
|
|
372
|
+
parameters: Type.Object({
|
|
373
|
+
// A literal union rather than a free string, as on `fito_knowledge_search`.
|
|
374
|
+
type: Type.Union(
|
|
375
|
+
COMPONENT_TYPES.map((componentType) => Type.Literal(componentType)),
|
|
376
|
+
{ description: "The component type — `concept`, `execution-fact`, or `usage-scenario`." },
|
|
377
|
+
),
|
|
378
|
+
technology: Type.String({
|
|
379
|
+
description:
|
|
380
|
+
"The technology's slug (e.g. `javalin`, `specification-by-example`) — the middle " +
|
|
381
|
+
"segment of a knowledge-component id `<type>:<tech-slug>.<component-slug>`. Its kind " +
|
|
382
|
+
"selects the template variant.",
|
|
383
|
+
}),
|
|
384
|
+
}),
|
|
385
|
+
async execute(_toolCallId, params) {
|
|
386
|
+
const template = await resolveRegisteredTemplate(params.type, params.technology);
|
|
387
|
+
return {
|
|
388
|
+
content: [{ type: "text", text: JSON.stringify(template, null, 2) }],
|
|
389
|
+
details: { template },
|
|
390
|
+
};
|
|
391
|
+
},
|
|
392
|
+
});
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
|
|
334
396
|
/**
|
|
335
397
|
* Register the `fito_case_partial_fetch` tool: given a case id and one of an enumerated set of
|
|
336
398
|
* document **keys**, return that part of the learner's local `.case/` checkout. It is the read the
|
|
@@ -388,9 +450,9 @@ export function registerFitoCasePartialFetchTool(pi: ExtensionAPI): void {
|
|
|
388
450
|
"`manifest` is the case's title, type, version, tags and estimated duration; " +
|
|
389
451
|
"`situation` the scenario documents in reading order; `task` the objective, " +
|
|
390
452
|
"constraints, steps and deliverables; `artifacts` the annotated map of the files " +
|
|
391
|
-
"the case works on; `starter_state` the baseline the learner starts from
|
|
392
|
-
"`knowledge_refs` the knowledge components the case
|
|
393
|
-
"those with `fito_knowledge_fetch`).",
|
|
453
|
+
"the case works on; `starter_state` the baseline the learner starts from and the tools " +
|
|
454
|
+
"they install to build it; `knowledge_refs` the knowledge components the case " +
|
|
455
|
+
"teaches and assumes (fetch those with `fito_knowledge_fetch`).",
|
|
394
456
|
}),
|
|
395
457
|
}),
|
|
396
458
|
async execute(_toolCallId, params) {
|
|
@@ -405,7 +467,7 @@ export function registerFitoCasePartialFetchTool(pi: ExtensionAPI): void {
|
|
|
405
467
|
}
|
|
406
468
|
|
|
407
469
|
/**
|
|
408
|
-
* Register all
|
|
470
|
+
* Register all six Fito fetch tools. This is the module's `default` export so it can be
|
|
409
471
|
* named as a persona's `subagentOnlyExtensions` entry — `pi-subagents` loads the file
|
|
410
472
|
* as a `--extension` in the child, and the registered tool names then survive the
|
|
411
473
|
* child's strict `--tools` allowlist (Task 9a.10; pi-subagents README §subagentOnlyExtensions).
|
|
@@ -415,5 +477,6 @@ export default function registerFitoFetchTools(pi: ExtensionAPI): void {
|
|
|
415
477
|
registerFitoKnowledgeSearchTool(pi);
|
|
416
478
|
registerFitoTechnologyFetchTool(pi);
|
|
417
479
|
registerFitoCompetenceListTool(pi);
|
|
480
|
+
registerFitoTemplateFetchTool(pi);
|
|
418
481
|
registerFitoCasePartialFetchTool(pi);
|
|
419
482
|
}
|
|
@@ -3,7 +3,7 @@ import * as path from "node:path";
|
|
|
3
3
|
import { getShellConfig, } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
import { FitoApiError, createFitoApiClient } from "../shared/fito-api/client.js";
|
|
5
5
|
import { registerFitoDelegateTool } from "./fito-delegate.js";
|
|
6
|
-
import { registerFitoCasePartialFetchTool, registerFitoCompetenceListTool, registerFitoKnowledgeFetchTool, registerFitoKnowledgeSearchTool, registerFitoTechnologyFetchTool, } from "./fito-fetch-tools.js";
|
|
6
|
+
import { registerFitoCasePartialFetchTool, registerFitoCompetenceListTool, registerFitoKnowledgeFetchTool, registerFitoKnowledgeSearchTool, registerFitoTechnologyFetchTool, registerFitoTemplateFetchTool, } from "./fito-fetch-tools.js";
|
|
7
7
|
/**
|
|
8
8
|
* Fito startup extension.
|
|
9
9
|
*
|
|
@@ -32,7 +32,9 @@ import { registerFitoCasePartialFetchTool, registerFitoCompetenceListTool, regis
|
|
|
32
32
|
* a flow that runs **here**, in the main session, which is why the tool has to be
|
|
33
33
|
* registered at this call site and not only in the child registrar —
|
|
34
34
|
* `fito_competence_list` (Task 15b.6), a technology's competences, registered here for the
|
|
35
|
-
* same reason: the competence-authoring flow that reads it runs in the main session —
|
|
35
|
+
* same reason: the competence-authoring flow that reads it runs in the main session —
|
|
36
|
+
* `fito_template_fetch` (Task 17.22), the registered template the `/fito-generate-*` prompts read
|
|
37
|
+
* in the main session before they delegate — and
|
|
36
38
|
* `fito_case_partial_fetch` (Task 11.2), the allow-listed read of a locally opened
|
|
37
39
|
* case that the `fito-tutor` worker holds in place of filesystem access. The registrars
|
|
38
40
|
* live in `./fito-fetch-tools.ts` so the
|
|
@@ -75,6 +77,7 @@ export default function registerFitoStartup(pi, options = {}) {
|
|
|
75
77
|
registerFitoKnowledgeSearchTool(pi);
|
|
76
78
|
registerFitoTechnologyFetchTool(pi);
|
|
77
79
|
registerFitoCompetenceListTool(pi);
|
|
80
|
+
registerFitoTemplateFetchTool(pi);
|
|
78
81
|
registerFitoCasePartialFetchTool(pi);
|
|
79
82
|
registerFitoDelegateTool(pi);
|
|
80
83
|
}
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
registerFitoKnowledgeFetchTool,
|
|
17
17
|
registerFitoKnowledgeSearchTool,
|
|
18
18
|
registerFitoTechnologyFetchTool,
|
|
19
|
+
registerFitoTemplateFetchTool,
|
|
19
20
|
} from "./fito-fetch-tools.ts";
|
|
20
21
|
|
|
21
22
|
/**
|
|
@@ -46,7 +47,9 @@ import {
|
|
|
46
47
|
* a flow that runs **here**, in the main session, which is why the tool has to be
|
|
47
48
|
* registered at this call site and not only in the child registrar —
|
|
48
49
|
* `fito_competence_list` (Task 15b.6), a technology's competences, registered here for the
|
|
49
|
-
* same reason: the competence-authoring flow that reads it runs in the main session —
|
|
50
|
+
* same reason: the competence-authoring flow that reads it runs in the main session —
|
|
51
|
+
* `fito_template_fetch` (Task 17.22), the registered template the `/fito-generate-*` prompts read
|
|
52
|
+
* in the main session before they delegate — and
|
|
50
53
|
* `fito_case_partial_fetch` (Task 11.2), the allow-listed read of a locally opened
|
|
51
54
|
* case that the `fito-tutor` worker holds in place of filesystem access. The registrars
|
|
52
55
|
* live in `./fito-fetch-tools.ts` so the
|
|
@@ -93,6 +96,7 @@ export default function registerFitoStartup(
|
|
|
93
96
|
registerFitoKnowledgeSearchTool(pi);
|
|
94
97
|
registerFitoTechnologyFetchTool(pi);
|
|
95
98
|
registerFitoCompetenceListTool(pi);
|
|
99
|
+
registerFitoTemplateFetchTool(pi);
|
|
96
100
|
registerFitoCasePartialFetchTool(pi);
|
|
97
101
|
registerFitoDelegateTool(pi);
|
|
98
102
|
}
|
package/package.json
CHANGED
|
@@ -123,15 +123,30 @@ place a defect can be introduced with a test that will catch it; an
|
|
|
123
123
|
`implementation` case needs a coherent gap to fill. Say which area of the
|
|
124
124
|
project the case would live in.
|
|
125
125
|
|
|
126
|
-
Also settle the **toolchain** — the
|
|
127
|
-
project is built against (e.g. Gradle 9, Kotlin 2, Javalin 7). On
|
|
128
|
-
read it from the build/manifest files the step-2 skim covered and
|
|
129
|
-
with the author; on **greenfield**, ask the author for their intended
|
|
130
|
-
tooling. Record **major lines only** — never a patch pin (`9`, not
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
126
|
+
Also settle the **toolchain** — the tools and their major lines the case
|
|
127
|
+
project is built against (e.g. JDK 21, Gradle 9, Kotlin 2, Javalin 7). On
|
|
128
|
+
**reuse**, read it from the build/manifest files the step-2 skim covered and
|
|
129
|
+
confirm it with the author; on **greenfield**, ask the author for their intended
|
|
130
|
+
build tooling. Record **major lines only** — never a patch pin (`9`, not
|
|
131
|
+
`9.5.1`). The toolchain (what the source builds against) is a separate axis
|
|
132
|
+
from the `--technology` versions (what the case teaches): they overlap but are
|
|
133
|
+
not the same declaration.
|
|
134
|
+
|
|
135
|
+
Each entry also says **who provides** the tool, in `provided_by`:
|
|
136
|
+
|
|
137
|
+
- `learner` — the learner installs it before the first build, so its version is
|
|
138
|
+
a **minimum**: that line or newer. The build accepts any newer install, and
|
|
139
|
+
the learner reads the entry in the case's setup instructions.
|
|
140
|
+
- `project` — the build fetches it itself, through a wrapper or a lockfile, so
|
|
141
|
+
the learner never installs it, and the build can pin an actual release of
|
|
142
|
+
the declared line.
|
|
143
|
+
|
|
144
|
+
A JVM project: the learner installs the JDK, and the Gradle wrapper fetches
|
|
145
|
+
Gradle, the Kotlin plugin and the libraries. A Node project: the learner
|
|
146
|
+
installs Node.js, and npm fetches the packages its lockfile pins. When no entry
|
|
147
|
+
is `learner`, add a line to **Open questions** — a case project usually runs on
|
|
148
|
+
a runtime or a compiler the learner installs, so ask the author to confirm that
|
|
149
|
+
this one needs none — and present the proposal as usual.
|
|
135
150
|
|
|
136
151
|
Once the toolchain is settled, **cross-check it against what the vocabulary
|
|
137
152
|
knows**. For each declared `--technology <slug>@<version>`, read the declared
|
|
@@ -146,9 +161,10 @@ exist; this cross-check is about their **prose**, so it is **best-effort** and
|
|
|
146
161
|
`description` yields nothing to check, and the cross-check **never blocks** the
|
|
147
162
|
flow — it informs the author, nothing more.
|
|
148
163
|
|
|
149
|
-
**Done when** scope, type, duration estimate, and toolchain
|
|
150
|
-
consistent with what the source (if any)
|
|
151
|
-
technology's version prose has been
|
|
164
|
+
**Done when** scope, type, duration estimate, and toolchain — each entry naming
|
|
165
|
+
who provides it — are stated and consistent with what the source (if any)
|
|
166
|
+
actually contains, and each declared technology's version prose has been
|
|
167
|
+
cross-checked against the toolchain.
|
|
152
168
|
|
|
153
169
|
## 4. Ground the required components
|
|
154
170
|
|
|
@@ -262,13 +278,19 @@ tags: [<lowercase tags>]
|
|
|
262
278
|
technologies: # one {slug, version} pair per declared technology (from --technology <slug>@<version>)
|
|
263
279
|
- slug: javalin
|
|
264
280
|
version: "7"
|
|
265
|
-
toolchain: #
|
|
281
|
+
toolchain: # tools + their major lines the source builds against — major lines only, no patch pins
|
|
282
|
+
- tool: jdk
|
|
283
|
+
version: "21"
|
|
284
|
+
provided_by: learner # the learner installs it: the version is a minimum — that line or newer
|
|
266
285
|
- tool: gradle
|
|
267
286
|
version: "9"
|
|
287
|
+
provided_by: project # the build fetches it itself (a wrapper, a lockfile)
|
|
268
288
|
- tool: kotlin
|
|
269
289
|
version: "2"
|
|
290
|
+
provided_by: project
|
|
270
291
|
- tool: javalin
|
|
271
292
|
version: "7"
|
|
293
|
+
provided_by: project
|
|
272
294
|
```
|
|
273
295
|
|
|
274
296
|
## Learning objectives
|
|
@@ -356,15 +378,18 @@ Rules the proposal must satisfy:
|
|
|
356
378
|
levels (scores 0–3).
|
|
357
379
|
- `automated` evaluation commands are commands the project actually runs (the
|
|
358
380
|
step-2 gate commands) — never guessed.
|
|
359
|
-
- The `toolchain` block names the
|
|
360
|
-
|
|
361
|
-
|
|
381
|
+
- The `toolchain` block names the tools and their **major lines only** (`9`,
|
|
382
|
+
not `9.5.1`), and every entry names who provides it: a `learner` entry's
|
|
383
|
+
version is a minimum — that line or newer — and a `project` entry is one the
|
|
384
|
+
build fetches itself.
|
|
362
385
|
- Every quiz question references at least one live component.
|
|
363
386
|
- Every rubric criterion and every quiz question is checked against the **Learning
|
|
364
387
|
objectives** block — the comparison below says what to do with a miss.
|
|
365
388
|
- Every rubric criterion's rungs are written at its declared `bloom_level` and
|
|
366
389
|
checked against it — the two sections on rungs below say how, and what to do
|
|
367
390
|
with a miss.
|
|
391
|
+
- Every rung of every `automated` criterion is one its command's exit code and
|
|
392
|
+
output can decide — the comparison below says what to do with a miss.
|
|
368
393
|
- Every `description` names the **topic**, never the **move** — the rule below.
|
|
369
394
|
|
|
370
395
|
## Every criterion and question names a learning objective
|
|
@@ -467,6 +492,36 @@ anything. Its entry in **Open questions**:
|
|
|
467
492
|
- `root-cause-diagnosis` declares `APPLICATION`, but `achieved` and `exemplary` ask the
|
|
468
493
|
learner to explain the fault: they assess `COMPREHENSION`.
|
|
469
494
|
|
|
495
|
+
## Every `automated` rung is decided by its command's output
|
|
496
|
+
|
|
497
|
+
An `automated` criterion is scored from its command's exit code and output alone: the
|
|
498
|
+
reviewer never reads the learner's code for one, and awards the highest rung the output
|
|
499
|
+
proves. So a rung the output cannot show is a rung no learner can earn — and at `achieved`,
|
|
500
|
+
correct work goes unawarded.
|
|
501
|
+
|
|
502
|
+
**Run this comparison before you present the proposal.** It covers every rung of every
|
|
503
|
+
`automated` criterion:
|
|
504
|
+
|
|
505
|
+
1. For each rung, ask: can the command's exit code and output decide this rung?
|
|
506
|
+
2. Every rung that cannot goes in **Open questions**: name the criterion, the rung, and what
|
|
507
|
+
the output cannot show, with the two repairs — rewrite the rung as an outcome the command
|
|
508
|
+
shows, or move that judgement to an `ai` criterion.
|
|
509
|
+
|
|
510
|
+
**Report every miss and present the proposal.** Keep the rung as drafted: either repair
|
|
511
|
+
changes what the case assesses, so it is the author's call.
|
|
512
|
+
|
|
513
|
+
An output shows an exit code and what the command prints — which tests failed, a linter's
|
|
514
|
+
findings. A passing run proves its passing condition, and nothing the command does not print:
|
|
515
|
+
a named call in the code, a change kept local, which test covers a behavior, an explanation
|
|
516
|
+
the learner wrote. Judge each command by what it prints: a runner that lists every test by
|
|
517
|
+
name does show which tests ran. A shape this catches, from a real rubric: `health-route` runs
|
|
518
|
+
`./gradlew test`, and its `exemplary` rung reads *"a focused passing test covers its behavior
|
|
519
|
+
and the existing users-route tests still pass"*. Its entry in **Open questions**:
|
|
520
|
+
|
|
521
|
+
- `health-route`, `exemplary`: when every test passes, `./gradlew test` prints no test names,
|
|
522
|
+
so its output cannot show that a focused test covers the route. Rewrite the rung as an
|
|
523
|
+
outcome the command shows, or move that judgement to an `ai` criterion.
|
|
524
|
+
|
|
470
525
|
## Descriptions name the topic, never the move
|
|
471
526
|
|
|
472
527
|
Every description written here travels: `/fito-case-generate` copies the
|