fito-tui 0.4.0 → 0.5.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.
Files changed (51) hide show
  1. package/agents/fito-performance-reviewer.md +6 -5
  2. package/extensions/fito-startup.js +27 -3
  3. package/extensions/fito-startup.ts +39 -7
  4. package/package.json +3 -3
  5. package/prompts/fito-auth-refresh.md +1 -1
  6. package/prompts/fito-case-edit.md +2 -2
  7. package/prompts/fito-case-generate.md +1 -1
  8. package/prompts/fito-case-open.md +6 -5
  9. package/prompts/fito-create-or-update-competence.md +2 -2
  10. package/prompts/fito-create-or-update-technology.md +5 -5
  11. package/prompts/fito-delete-competence.md +2 -2
  12. package/prompts/fito-evaluate.md +30 -22
  13. package/prompts/fito-login.md +3 -3
  14. package/prompts/fito-logout.md +1 -1
  15. package/prompts/fito-publish-case.md +3 -3
  16. package/prompts/fito-push-knowledge.md +1 -1
  17. package/prompts/fito-submit.md +55 -36
  18. package/skills/fito-auth/SKILL.md +8 -7
  19. package/skills/fito-auth/browser.js +3 -2
  20. package/skills/fito-auth/browser.ts +3 -2
  21. package/skills/fito-auth/login.js +22 -6
  22. package/skills/fito-auth/login.ts +23 -6
  23. package/skills/fito-case-author/SKILL.md +4 -4
  24. package/skills/fito-case-author/checkout.js +22 -5
  25. package/skills/fito-case-author/checkout.ts +22 -5
  26. package/skills/fito-case-runner/SKILL.md +24 -7
  27. package/skills/fito-case-runner/github.js +20 -2
  28. package/skills/fito-case-runner/github.ts +21 -2
  29. package/skills/fito-case-runner/open.js +3 -3
  30. package/skills/fito-case-runner/open.ts +3 -3
  31. package/skills/fito-case-runner/runner.js +12 -1
  32. package/skills/fito-case-runner/runner.ts +15 -0
  33. package/skills/fito-case-runner/submit.js +1 -1
  34. package/skills/fito-case-runner/submit.ts +1 -1
  35. package/skills/fito-case-runner/temp-file.js +16 -0
  36. package/skills/fito-case-runner/temp-file.ts +17 -0
  37. package/skills/fito-competence-write/SKILL.md +3 -3
  38. package/skills/fito-competence-write/delete.js +1 -1
  39. package/skills/fito-competence-write/delete.ts +1 -1
  40. package/skills/fito-evaluator/SKILL.md +7 -6
  41. package/skills/fito-evaluator/criterion-exec.js +113 -17
  42. package/skills/fito-evaluator/criterion-exec.ts +110 -18
  43. package/skills/fito-evaluator/evaluate-automated.js +7 -3
  44. package/skills/fito-evaluator/evaluate-automated.ts +7 -3
  45. package/skills/fito-knowledge-push/SKILL.md +1 -1
  46. package/skills/fito-knowledge-push/push.js +8 -8
  47. package/skills/fito-knowledge-push/push.ts +8 -8
  48. package/skills/fito-source-ingestion/SKILL.md +4 -4
  49. package/skills/fito-technology-write/SKILL.md +2 -2
  50. package/skills/fito-technology-write/create.js +2 -2
  51. package/skills/fito-technology-write/create.ts +2 -2
@@ -34,9 +34,10 @@ you were given; the output contract differs per job.
34
34
  evidence (exit/stdout/stderr), the **passing condition**, the **on-pass** level
35
35
  label, the **on-fail** route (`ai`/`human`), and any **fallback prompt hint**.
36
36
  - A **Needs human review** list of any `human` criteria.
37
- 2. The **case checkout path** — the local directory (`~/.fito/cases/<case-id>/`)
38
- where the learner is working. You read the learner's work from here to score the
39
- `ai` and `hybrid` criteria. You never write to it.
37
+ 2. The **case checkout path** — the absolute path of the local directory where the
38
+ learner is working. You read the learner's work from here to score the `ai` and
39
+ `hybrid` criteria. You never write to it. Use the path exactly as given, in double
40
+ quotes in every command: it can hold a space or a `\`.
40
41
 
41
42
  If you are given **no checkout path**, score the automated criteria from the report,
42
43
  and say the `ai`/`hybrid` criteria could not be scored because no checkout was
@@ -78,8 +79,8 @@ For `ai` (and failed-`hybrid`) criteria, read only from `<checkout>` to build th
78
79
  picture the case author intended (Case Structure Spec §16 "AI Assessment Context"):
79
80
 
80
81
  - **The learner's changes** — read `submission.target_branch` from
81
- `.case/manifest.yaml`, then `cd <checkout> && git diff <target_branch>`. If that
82
- ref is absent locally, fall back to `cd <checkout> && git diff` and note the diff
82
+ `.case/manifest.yaml`, then `git -C "<checkout>" diff <target_branch>`. If that
83
+ ref is absent locally, fall back to `git -C "<checkout>" diff` and note the diff
83
84
  is against the working tree only.
84
85
  - **Relevant artifacts** — the entries in `.case/artifacts.yaml` whose `role` is
85
86
  `target` or `evidence`; read those files.
@@ -1,5 +1,6 @@
1
1
  import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
+ import { getShellConfig, } from "@earendil-works/pi-coding-agent";
3
4
  import { FitoApiError, createFitoApiClient } from "../shared/fito-api/client.js";
4
5
  import { registerFitoDelegateTool } from "./fito-delegate.js";
5
6
  import { registerFitoCasePartialFetchTool, registerFitoCompetenceListTool, registerFitoKnowledgeFetchTool, registerFitoKnowledgeSearchTool, registerFitoTechnologyFetchTool, } from "./fito-fetch-tools.js";
@@ -20,8 +21,8 @@ import { registerFitoCasePartialFetchTool, registerFitoCompetenceListTool, regis
20
21
  *
21
22
  * What remains here is the `session_start` checks — the guard for the missing
22
23
  * `subagent` tool, the `pi-subagents` version floor, and the backend's refusal of this
23
- * TUI's version (both Task 15d.7b) — and registration of Fito-owned custom tools (`pi.registerTool(...)`)
24
- * for the **main**
24
+ * TUI's version (both Task 15d.7b), and Bash on Windows (Task 17a.3) — and registration
25
+ * of Fito-owned custom tools (`pi.registerTool(...)`) for the **main**
25
26
  * session: `fito_knowledge_fetch` (Task 5.1b), the in-process knowledge-component
26
27
  * read that the `fito-tutor` worker holds while denied bash/filesystem (Success
27
28
  * Criterion #9; ADR-006), `fito_technology_fetch` (Task 9a.6a), the
@@ -67,7 +68,8 @@ import { registerFitoCasePartialFetchTool, registerFitoCompetenceListTool, regis
67
68
  * that id out of prose to resume its thread. `fito_delegate` now runs the tutor's thread and holds
68
69
  * the id itself, so there is no vendor tool result left to annotate and no reader for the line.
69
70
  */
70
- export default function registerFitoStartup(pi) {
71
+ export default function registerFitoStartup(pi, options = {}) {
72
+ const platform = options.platform ?? process.platform;
71
73
  if (process.env.PI_SUBAGENT_CHILD !== "1") {
72
74
  registerFitoKnowledgeFetchTool(pi);
73
75
  registerFitoKnowledgeSearchTool(pi);
@@ -93,6 +95,13 @@ export default function registerFitoStartup(pi) {
93
95
  if (subagent !== undefined && isBelowPiSubagentsFloor(subagent.sourceInfo)) {
94
96
  ctx.ui.notify(`Fito needs pi-subagents ${PI_SUBAGENTS_FLOOR.join(".")} or newer. Run: \`pi update --extensions\``, "error");
95
97
  }
98
+ // Windows has no Bash of its own, and Fito needs one (ADR-021): every script command runs
99
+ // through pi's `bash` tool, and scoring runs each rubric command with `sh`. Without it they
100
+ // fail one by one at the point of use; this says so once.
101
+ if (platform === "win32" && !piFindsBash(pi.getSettings().shellPath)) {
102
+ ctx.ui.notify("Fito needs Bash, which pi did not find. Set `shellPath` in pi's settings.json to a bash.exe, " +
103
+ "or install Git for Windows, which brings Git Bash: https://git-scm.com/download/win", "error");
104
+ }
96
105
  // Not awaited: pi awaits what a handler returns, so the start would wait for the backend.
97
106
  void warnIfTuiTooOld(ctx);
98
107
  });
@@ -130,6 +139,21 @@ function isBelowPiSubagentsFloor(sourceInfo) {
130
139
  const differing = installed.findIndex((number, index) => number !== PI_SUBAGENTS_FLOOR[index]);
131
140
  return differing !== -1 && installed[differing] < PI_SUBAGENTS_FLOOR[differing];
132
141
  }
142
+ /**
143
+ * Whether pi's own Bash lookup — the one its `bash` tool runs — finds a Bash: the user's `shellPath`
144
+ * when it is set, otherwise Git Bash under `Program Files`, then a `bash.exe` on `PATH`. pi exports
145
+ * it for extensions. pi expands `~` and `/c/…` in `shellPath` before its own lookup, and this check
146
+ * does not, so a `shellPath` written that way reads here as missing.
147
+ */
148
+ function piFindsBash(shellPath) {
149
+ try {
150
+ getShellConfig(shellPath);
151
+ return true;
152
+ }
153
+ catch {
154
+ return false;
155
+ }
156
+ }
133
157
  /** The problem `type` of the backend's refusal of a TUI older than its minimum (Task 15d.7a). */
134
158
  const TUI_TOO_OLD = "/problems/tui-too-old";
135
159
  /** How long the start check waits for the backend before it gives up and shows nothing. */
@@ -1,10 +1,11 @@
1
1
  import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
3
 
4
- import type {
5
- ExtensionAPI,
6
- ExtensionContext,
7
- SourceInfo,
4
+ import {
5
+ type ExtensionAPI,
6
+ type ExtensionContext,
7
+ type SourceInfo,
8
+ getShellConfig,
8
9
  } from "@earendil-works/pi-coding-agent";
9
10
 
10
11
  import { FitoApiError, createFitoApiClient } from "../shared/fito-api/client.ts";
@@ -34,8 +35,8 @@ import {
34
35
  *
35
36
  * What remains here is the `session_start` checks — the guard for the missing
36
37
  * `subagent` tool, the `pi-subagents` version floor, and the backend's refusal of this
37
- * TUI's version (both Task 15d.7b) — and registration of Fito-owned custom tools (`pi.registerTool(...)`)
38
- * for the **main**
38
+ * TUI's version (both Task 15d.7b), and Bash on Windows (Task 17a.3) — and registration
39
+ * of Fito-owned custom tools (`pi.registerTool(...)`) for the **main**
39
40
  * session: `fito_knowledge_fetch` (Task 5.1b), the in-process knowledge-component
40
41
  * read that the `fito-tutor` worker holds while denied bash/filesystem (Success
41
42
  * Criterion #9; ADR-006), `fito_technology_fetch` (Task 9a.6a), the
@@ -81,7 +82,12 @@ import {
81
82
  * that id out of prose to resume its thread. `fito_delegate` now runs the tutor's thread and holds
82
83
  * the id itself, so there is no vendor tool result left to annotate and no reader for the line.
83
84
  */
84
- export default function registerFitoStartup(pi: ExtensionAPI): void {
85
+ export default function registerFitoStartup(
86
+ pi: ExtensionAPI,
87
+ options: { platform?: NodeJS.Platform } = {},
88
+ ): void {
89
+ const platform = options.platform ?? process.platform;
90
+
85
91
  if (process.env.PI_SUBAGENT_CHILD !== "1") {
86
92
  registerFitoKnowledgeFetchTool(pi);
87
93
  registerFitoKnowledgeSearchTool(pi);
@@ -116,6 +122,17 @@ export default function registerFitoStartup(pi: ExtensionAPI): void {
116
122
  );
117
123
  }
118
124
 
125
+ // Windows has no Bash of its own, and Fito needs one (ADR-021): every script command runs
126
+ // through pi's `bash` tool, and scoring runs each rubric command with `sh`. Without it they
127
+ // fail one by one at the point of use; this says so once.
128
+ if (platform === "win32" && !piFindsBash(pi.getSettings().shellPath)) {
129
+ ctx.ui.notify(
130
+ "Fito needs Bash, which pi did not find. Set `shellPath` in pi's settings.json to a bash.exe, " +
131
+ "or install Git for Windows, which brings Git Bash: https://git-scm.com/download/win",
132
+ "error",
133
+ );
134
+ }
135
+
119
136
  // Not awaited: pi awaits what a handler returns, so the start would wait for the backend.
120
137
  void warnIfTuiTooOld(ctx);
121
138
  });
@@ -153,6 +170,21 @@ function isBelowPiSubagentsFloor(sourceInfo: SourceInfo): boolean {
153
170
  return differing !== -1 && installed[differing] < PI_SUBAGENTS_FLOOR[differing];
154
171
  }
155
172
 
173
+ /**
174
+ * Whether pi's own Bash lookup — the one its `bash` tool runs — finds a Bash: the user's `shellPath`
175
+ * when it is set, otherwise Git Bash under `Program Files`, then a `bash.exe` on `PATH`. pi exports
176
+ * it for extensions. pi expands `~` and `/c/…` in `shellPath` before its own lookup, and this check
177
+ * does not, so a `shellPath` written that way reads here as missing.
178
+ */
179
+ function piFindsBash(shellPath: string | undefined): boolean {
180
+ try {
181
+ getShellConfig(shellPath);
182
+ return true;
183
+ } catch {
184
+ return false;
185
+ }
186
+ }
187
+
156
188
  /** The problem `type` of the backend's refusal of a TUI older than its minimum (Task 15d.7a). */
157
189
  const TUI_TOO_OLD = "/problems/tui-too-old";
158
190
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fito-tui",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Fito for pi: case-based practice for software engineers, in your terminal.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -26,8 +26,8 @@
26
26
  "build": "tsc -p tsconfig.build.json",
27
27
  "lint": "tsc --noEmit && npm run build",
28
28
  "prepare": "npm run build",
29
- "test": "FITO_URL=http://127.0.0.1:9 node --test agents/*.test.ts extensions/*.test.ts prompts/*.test.ts skills/*/*.test.ts shared/*/*.test.ts",
30
- "test:coverage": "FITO_URL=http://127.0.0.1:9 node --test --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=tap --test-reporter-destination=tui-tap.txt --test-reporter=lcov --test-reporter-destination=lcov.info agents/*.test.ts extensions/*.test.ts prompts/*.test.ts skills/*/*.test.ts shared/*/*.test.ts"
29
+ "test": "node --import ./test-env.ts --test \"agents/*.test.ts\" \"extensions/*.test.ts\" \"prompts/*.test.ts\" \"skills/*/*.test.ts\" \"shared/*/*.test.ts\"",
30
+ "test:coverage": "node --import ./test-env.ts --test --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=tap --test-reporter-destination=tui-tap.txt --test-reporter=lcov --test-reporter-destination=lcov.info \"agents/*.test.ts\" \"extensions/*.test.ts\" \"prompts/*.test.ts\" \"skills/*/*.test.ts\" \"shared/*/*.test.ts\""
31
31
  },
32
32
  "dependencies": {
33
33
  "yaml": "2.9.0",
@@ -6,7 +6,7 @@ Refresh the learner's Fito access token.
6
6
  Use the `fito-auth` skill (read its `SKILL.md`), then run:
7
7
 
8
8
  ```bash
9
- node <fito-auth skill dir>/auth-refresh.js
9
+ node "<fito-auth skill dir>/auth-refresh.js"
10
10
  ```
11
11
 
12
12
  This exchanges the stored refresh token for a fresh token pair via the backend
@@ -25,7 +25,7 @@ Parse `$ARGUMENTS`:
25
25
  Run:
26
26
 
27
27
  ```bash
28
- node <fito-case-author skill dir>/checkout.js <case-id>
28
+ node "<fito-case-author skill dir>/checkout.js" <case-id>
29
29
  ```
30
30
 
31
31
  (append `--dir <target>` only when the author chose a location). This
@@ -50,7 +50,7 @@ unpublished draft.
50
50
  call, never yours.
51
51
  - **`⚠` structural warning** — the cloned `.case/` tree doesn't read
52
52
  cleanly. Relay it and route the fix through the validator
53
- (`node validate.js <dir>`) before any editing.
53
+ (`node "validate.js" "<dir>"`) before any editing.
54
54
 
55
55
  **Done when** it prints `Authoring checkout at:` with the path and
56
56
  branch 'main' — or a refusal was relayed verbatim and you stopped.
@@ -182,7 +182,7 @@ commit — note it and continue).
182
182
  Use the `fito-case-author` skill (read its `SKILL.md`), then run:
183
183
 
184
184
  ```bash
185
- node <fito-case-author skill dir>/validate.js <working-dir>
185
+ node "<fito-case-author skill dir>/validate.js" "<working-dir>"
186
186
  ```
187
187
 
188
188
  - **Failure (exit 1)** — relay the errors **verbatim**, grouped by file —
@@ -13,7 +13,7 @@ the `<id>` from its `/cases/<id>` URL — and don't run anything until you have
13
13
  Use the `fito-case-runner` skill (read its `SKILL.md`), then run:
14
14
 
15
15
  ```bash
16
- node <fito-case-runner skill dir>/open.js $1
16
+ node "<fito-case-runner skill dir>/open.js" $1
17
17
  ```
18
18
 
19
19
  This forks the case repo to the learner's GitHub account, clones it into
@@ -27,7 +27,7 @@ re-validates** the `.case/` checkout, and creates the working branch.
27
27
  affordance; suggest re-running `/fito-case-open $1` later or reporting the case.
28
28
  - It refuses to overwrite a non-empty existing checkout. If the learner has
29
29
  already opened this case, that is fine — point them at the existing
30
- `~/.fito/cases/$1/` and `/fito-submit $1`, and skip to step 2.
30
+ checkout, whose path the refusal prints, and `/fito-submit $1`, and skip to step 2.
31
31
  - If it refuses because the case is **deprecated**, relay its message verbatim
32
32
  and stop — do not orient, and never work around the refusal with raw git
33
33
  commands.
@@ -46,11 +46,12 @@ re-validates** the `.case/` checkout, and creates the working branch.
46
46
 
47
47
  **Done when** it prints `Case opened at:` with the checkout path and `on branch
48
48
  '<name>'` (or you confirmed an already-open checkout). On any non-zero exit, stop
49
- here — do not orient.
49
+ here — do not orient. Below, `<checkout>` is that path — the one after `Case opened
50
+ at:`, or the one the already-open refusal names — used exactly as printed.
50
51
 
51
52
  ## 2. Brief the learner on the case
52
53
 
53
- Read the case from `~/.fito/cases/$1/.case/` and orient the learner. **Never read
54
+ Read the case from `<checkout>/.case/` and orient the learner. **Never read
54
55
  or reveal anything under `.case/solution/`** — those are evaluator-only rationale
55
56
  notes; surfacing them would defeat the case. Read only the files named below.
56
57
 
@@ -96,7 +97,7 @@ two-group summary is presented.
96
97
 
97
98
  ## 4. Hand off
98
99
 
99
- Tell the learner where their working tree is (`~/.fito/cases/$1/`) and which
100
+ Tell the learner where their working tree is (`<checkout>`) and which
100
101
  branch they are on, that they make and commit their changes there, and that when
101
102
  they are ready they submit with:
102
103
 
@@ -187,7 +187,7 @@ Drive the `fito-competence-write` skill (read its `SKILL.md`).
187
187
  **On a create run:**
188
188
 
189
189
  ```bash
190
- node <fito-competence-write skill dir>/create.js <payload-file>
190
+ node "<fito-competence-write skill dir>/create.js" "<payload-file>"
191
191
  ```
192
192
 
193
193
  It prints the competence's name and its **id**. Show the author that id — an edit or a delete
@@ -202,7 +202,7 @@ one is absent.
202
202
  **On an edit run**, take only the axes the author confirmed changing:
203
203
 
204
204
  ```bash
205
- node <fito-competence-write skill dir>/update.js <competence-id> <payload-file> [--name] [--description]
205
+ node "<fito-competence-write skill dir>/update.js" <competence-id> "<payload-file>" [--name] [--description]
206
206
  ```
207
207
 
208
208
  `--name` writes the name, `--description` the description. Pass both when both changed; both go
@@ -131,7 +131,7 @@ the axes the author confirmed changing — an axis they left alone is another au
131
131
  **On an update run** (step 3 found both), write straight to the update path:
132
132
 
133
133
  ```bash
134
- node <fito-technology-write skill dir>/update.js <payload-file> [--overview] [--version-prose]
134
+ node "<fito-technology-write skill dir>/update.js" "<payload-file>" [--overview] [--version-prose]
135
135
  ```
136
136
 
137
137
  `--overview` writes the version-agnostic overview, `--version-prose` the declared major line's. Pass
@@ -141,17 +141,17 @@ vocabulary already carries what they confirmed and write nothing.
141
141
  **On a create run**, create first:
142
142
 
143
143
  ```bash
144
- node <fito-technology-write skill dir>/create.js <payload-file>
144
+ node "<fito-technology-write skill dir>/create.js" "<payload-file>"
145
145
  ```
146
146
 
147
147
  Read the outcome it reports, because it decides whether a description still needs writing:
148
148
 
149
149
  - **`created`** — the technology was new; both descriptions are stored. Done.
150
150
  - **`version-added`** — the major line was added with its prose, but the technology already existed,
151
- so the submitted overview was **not** stored. Run the `node update.js … --overview` the success
151
+ so the submitted overview was **not** stored. Run the `node "update.js" … --overview` the success
152
152
  line names, when the author confirmed an overview that improves on the one step 3 read back.
153
153
  - **`reused`** — the technology and the major line both already existed, so the create was a
154
- **no-op** and neither description was stored. Run the `node update.js …` the success line names,
154
+ **no-op** and neither description was stored. Run the `node "update.js" …` the success line names,
155
155
  for the axes the author confirmed.
156
156
 
157
157
  If the outcome **contradicts** what step 3 found — a `reused` after a 404, or a `version-added`
@@ -175,7 +175,7 @@ auto-resolved** on the author's behalf, and **the choice is the author's — nev
175
175
  - **reuse** — the match *is* this technology: re-run this command declaring the matched slug, which
176
176
  makes the run an update of that technology's descriptions. Preferred.
177
177
  - **re-declare** — the match only resembles it: re-run with a distinct `--technology` slug.
178
- - **override** — `node create.js <payload-file> --override`. Before running it, restate the
178
+ - **override** — `node "create.js" "<payload-file>" --override`. Before running it, restate the
179
179
  consequence: an independent technology is created and will **coexist** with every match in the
180
180
  vocabulary, and every component pushed against either slug lands on a different row. Run it only
181
181
  after the author explicitly accepts that.
@@ -61,7 +61,7 @@ when it arrives, then re-run this command.
61
61
  Run the script with **no flag**. This run is the read:
62
62
 
63
63
  ```bash
64
- node <fito-competence-write skill dir>/delete.js <competence-id>
64
+ node "<fito-competence-write skill dir>/delete.js" <competence-id>
65
65
  ```
66
66
 
67
67
  It prints one block: the competence by name and id, **every sub-competence** beneath it by name and
@@ -111,7 +111,7 @@ Drive the `fito-competence-write` skill (read its `SKILL.md`). Run this **only a
111
111
  yes** in step 3:
112
112
 
113
113
  ```bash
114
- node <fito-competence-write skill dir>/delete.js <competence-id> --confirm
114
+ node "<fito-competence-write skill dir>/delete.js" <competence-id> --confirm
115
115
  ```
116
116
 
117
117
  It prints the same block once more, then deletes the subtree and prints its success line — both on
@@ -18,20 +18,22 @@ Submitting for real (which also records the evaluation) is `/fito-submit`.
18
18
  Use the `fito-evaluator` skill (read its `SKILL.md`), then run:
19
19
 
20
20
  ```bash
21
- node <fito-evaluator skill dir>/evaluate-automated.js $1
21
+ node "<fito-evaluator skill dir>/evaluate-automated.js" $1
22
22
  ```
23
23
 
24
- Stream the output. In `~/.fito/cases/$1/` it runs the automated criteria's commands
25
- and the hybrid criteria's gate commands, and prints one **evaluation report**: the
26
- automated evidence, the `ai` criteria + their prompt hints, the `hybrid` gate
27
- evidence, and any `human` criteria under **Needs human review**.
24
+ Stream the output. In the case's checkout it runs the automated criteria's commands
25
+ and the hybrid criteria's gate commands, and prints one **evaluation report**. Its
26
+ first line, `Case checkout: <path>`, is the checkout's absolute path: every later
27
+ step uses that path, exactly as printed. Then come the automated evidence, the `ai`
28
+ criteria + their prompt hints, the `hybrid` gate evidence, and any `human` criteria
29
+ under **Needs human review**.
28
30
 
29
31
  - If it reports **no open case** at `~/.fito/cases/$1/`, the case was never opened
30
32
  (or the checkout was moved) — point the learner at `/fito-case-open $1` and stop.
31
33
  - If the report has **no scorable criteria** (nothing automated, ai, or hybrid),
32
34
  there is no rubric to preview — skip the rubric steps (2–3) and go straight to
33
- the quiz (step 4). If there is also no `~/.fito/cases/$1/.case/quiz.yaml`, tell
34
- the learner there is nothing to preview and stop.
35
+ the quiz (step 4). If the checkout also has no `.case/quiz.yaml`, tell the
36
+ learner there is nothing to preview and stop.
35
37
 
36
38
  **Done when** you have the printed evaluation report (or you stopped for one of the
37
39
  cases above).
@@ -43,8 +45,8 @@ tool. Hand it **both**:
43
45
 
44
46
  - the **full evaluation report** from step 1 (automated evidence, the `ai` criteria
45
47
  + prompt hints, and the `hybrid` gate evidence), and
46
- - the **case checkout path** `~/.fito/cases/$1/`, which it needs to score the `ai`
47
- and `hybrid` criteria from the learner's actual changes.
48
+ - the **case checkout path** from the report's first line, which it needs to score
49
+ the `ai` and `hybrid` criteria from the learner's actual changes.
48
50
 
49
51
  It returns a 0–3 score (or a needs-human-review marker for `human` criteria), the
50
52
  matching level, and a justification per criterion. Do not score anything yourself —
@@ -61,7 +63,7 @@ First, resolve each scored component's canonical **name**. Collect the distinct
61
63
  `fito-case-runner` skill (read its `SKILL.md`) — run:
62
64
 
63
65
  ```bash
64
- node <fito-case-runner skill dir>/case-component-names.js $1 <component-id...>
66
+ node "<fito-case-runner skill dir>/case-component-names.js" $1 <component-id...>
65
67
  ```
66
68
 
67
69
  passing those ids. It prints one `<id>\t<label>` line per id, where `<label>` is
@@ -77,7 +79,7 @@ backend may be unavailable).
77
79
  Get Fito's address, for the links in the summary:
78
80
 
79
81
  ```bash
80
- node <fito-case-runner skill dir>/fito-url.js
82
+ node "<fito-case-runner skill dir>/fito-url.js"
81
83
  ```
82
84
 
83
85
  Then relay the subagent's **learner-facing summary** — one block per criterion: the
@@ -99,7 +101,7 @@ the quiz, in step 4).
99
101
 
100
102
  ## 4. Practice the quiz (if the case has one)
101
103
 
102
- If `~/.fito/cases/$1/.case/quiz.yaml` exists, the case has a knowledge-check quiz.
104
+ If the checkout has a `.case/quiz.yaml`, the case has a knowledge-check quiz.
103
105
  Administer it as a **practice run** — nothing here is recorded. If the file is
104
106
  absent, skip this step.
105
107
 
@@ -110,22 +112,27 @@ absent, skip this step.
110
112
  for scoring only. Collect the learner's `multiple_choice` answers as a
111
113
  `{ "<questionId>": "<choiceId>" }` map, and hold their `short_answer` /
112
114
  `code_snippet` answers for the reviewer.
113
- 2. **Score the `multiple_choice` questions in code.** Write the MC answers map to a
114
- temp file (e.g. `$(mktemp)`) and, using the `fito-case-runner` skill (read its
115
- `SKILL.md`), run:
115
+ 2. **Score the `multiple_choice` questions in code.** Using the `fito-case-runner`
116
+ skill (read its `SKILL.md`), get a new temp file's path with:
116
117
 
117
118
  ```bash
118
- node <fito-case-runner skill dir>/score-quiz-mc.js $1 <answers-file>
119
+ node "<fito-case-runner skill dir>/temp-file.js"
120
+ ```
121
+
122
+ Write the MC answers map to the path it prints, exactly as printed, then run:
123
+
124
+ ```bash
125
+ node "<fito-case-runner skill dir>/score-quiz-mc.js" $1 "<answers-file>"
119
126
  ```
120
127
 
121
128
  Capture its JSON array of scored `multiple_choice` questions. (If the quiz has no
122
129
  `multiple_choice` questions it prints `[]`.)
123
130
  3. **Score the `short_answer` / `code_snippet` questions via the reviewer.** If the
124
131
  quiz has any, delegate to the `fito-performance-reviewer` **subagent** via
125
- the `fito_delegate` tool, handing it the **case checkout path**
126
- `~/.fito/cases/$1/` (it reads `.case/quiz.yaml` — including the `evaluation`
127
- block — itself) and the **learner's answers** to those questions, keyed by
128
- question id. It returns a 0–3 score (or a needs-human-review marker) and a
132
+ the `fito_delegate` tool, handing it the **case checkout path** from the report's
133
+ first line (it reads `.case/quiz.yaml` — including the `evaluation` block —
134
+ itself) and the **learner's answers** to those questions, keyed by question
135
+ id. It returns a 0–3 score (or a needs-human-review marker) and a
129
136
  justification per question. Do not score anything yourself. This delegation
130
137
  blocks — you read the child's summary from the tool result.
131
138
  4. **Show the combined result.** Merge the code-scored (step 2) and reviewer-scored
@@ -144,8 +151,9 @@ absent, skip this step.
144
151
  a submission would record COMPREHENSION."*
145
152
 
146
153
  Then remind them: this was a **local preview — nothing was submitted**. They can
147
- keep improving their work in `~/.fito/cases/$1/`, re-run `/fito-evaluate $1` to
148
- re-check, and submit for real with `/fito-submit $1` when satisfied.
154
+ keep improving their work in their checkout (name its path, as the report's first
155
+ line prints it), re-run `/fito-evaluate $1` to re-check, and submit for real with
156
+ `/fito-submit $1` when satisfied.
149
157
 
150
158
  **Done when** every quiz question shows its result **and the proficiency a
151
159
  submission would record for it** (or the case has no `quiz.yaml`), and the
@@ -6,14 +6,14 @@ Log the learner in to Fito.
6
6
  Use the `fito-auth` skill (read its `SKILL.md`), then run:
7
7
 
8
8
  ```bash
9
- node <fito-auth skill dir>/login.js
9
+ node "<fito-auth skill dir>/login.js"
10
10
  ```
11
11
 
12
12
  This starts a local loopback server, opens the system browser to the Fito web
13
13
  login page (`/auth/login?return_to=tui&port=<port>`), and waits for the browser
14
14
  to hand back the freshly minted token pair, which it writes to this Fito's own
15
- file, `~/.fito/credentials-<host>` (mode `0600`). The learner can use either
16
- email/password or "Continue with GitHub" in the browser.
15
+ file, `~/.fito/credentials-<host>`. The learner can use either email/password or
16
+ "Continue with GitHub" in the browser.
17
17
 
18
18
  Stream the command output so the learner sees the login URL (in case the browser
19
19
  does not open automatically). When it prints the success line, confirm they are
@@ -6,7 +6,7 @@ Log the learner out of Fito.
6
6
  Use the `fito-auth` skill (read its `SKILL.md`), then run:
7
7
 
8
8
  ```bash
9
- node <fito-auth skill dir>/logout.js
9
+ node "<fito-auth skill dir>/logout.js"
10
10
  ```
11
11
 
12
12
  This best-effort revokes the refresh token on the backend and deletes this
@@ -41,7 +41,7 @@ checkout). Then resolve **which publish this is** — using the `fito-case-autho
41
41
  skill (read its `SKILL.md`):
42
42
 
43
43
  ```bash
44
- node <fito-case-author skill dir>/publish-version.js <case-dir> --probe
44
+ node "<fito-case-author skill dir>/publish-version.js" "<case-dir>" --probe
45
45
  ```
46
46
 
47
47
  - **`route: initial`** — the directory is not a registered case's checkout:
@@ -122,7 +122,7 @@ anything is pushed.)
122
122
  ## 5. Run the publish
123
123
 
124
124
  ```bash
125
- node <fito-case-author skill dir>/publish.js <case-dir> --repo <owner>/<name> --overview <case-dir>/.authoring/description-overview.md
125
+ node "<fito-case-author skill dir>/publish.js" "<case-dir>" --repo <owner>/<name> --overview "<case-dir>/.authoring/description-overview.md"
126
126
  ```
127
127
 
128
128
  Add `--case-id <uuid>` when one is known (passed in, or printed by a previous
@@ -235,7 +235,7 @@ tree is clean.
235
235
  ## 10. Run the version publish and relay — verbatim
236
236
 
237
237
  ```bash
238
- node <fito-case-author skill dir>/publish-version.js <case-dir> --change-description <case-dir>/.authoring/change-description.md --overview <case-dir>/.authoring/description-overview.md
238
+ node "<fito-case-author skill dir>/publish-version.js" "<case-dir>" --change-description "<case-dir>/.authoring/change-description.md" --overview "<case-dir>/.authoring/description-overview.md"
239
239
  ```
240
240
 
241
241
  One run re-validates the tree, preflights the frozen reference set against
@@ -46,7 +46,7 @@ force an outcome — this rule exists because that happened.)*
46
46
  For each component file, in order, run:
47
47
 
48
48
  ```bash
49
- node <fito-knowledge-push skill dir>/push.js <component-file>
49
+ node "<fito-knowledge-push skill dir>/push.js" "<component-file>"
50
50
  ```
51
51
 
52
52
  - **Stored** (`✓ Stored …`) — record the reference id and move to the next file.