fito-tui 0.2.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 +88 -0
- package/agents/fito-case-source-planner.md +265 -0
- package/agents/fito-performance-reviewer.md +231 -0
- package/agents/fito-practice-concept-content-generator.md +318 -0
- package/agents/fito-practice-concept-identifier.md +482 -0
- package/agents/fito-practice-execution-fact-content-generator.md +299 -0
- package/agents/fito-practice-execution-fact-identifier.md +367 -0
- package/agents/fito-practice-usage-scenario-content-generator.md +331 -0
- package/agents/fito-practice-usage-scenario-identifier.md +397 -0
- package/agents/fito-subagent-selftest.md +27 -0
- package/agents/fito-technology-generator.md +207 -0
- package/agents/fito-tool-concept-content-generator.md +282 -0
- package/agents/fito-tool-concept-identifier.md +384 -0
- package/agents/fito-tool-execution-fact-content-generator.md +382 -0
- package/agents/fito-tool-execution-fact-identifier.md +360 -0
- package/agents/fito-tool-usage-scenario-content-generator.md +381 -0
- package/agents/fito-tool-usage-scenario-identifier.md +432 -0
- package/agents/fito-tutor.md +185 -0
- package/extensions/fito-delegate.js +539 -0
- package/extensions/fito-delegate.ts +691 -0
- package/extensions/fito-fetch-tools.js +380 -0
- package/extensions/fito-fetch-tools.ts +419 -0
- package/extensions/fito-startup.js +166 -0
- package/extensions/fito-startup.ts +188 -0
- package/package.json +56 -0
- package/prompts/fito-auth-refresh.md +15 -0
- package/prompts/fito-case-design.md +506 -0
- package/prompts/fito-case-edit.md +91 -0
- package/prompts/fito-case-generate.md +222 -0
- package/prompts/fito-case-open.md +124 -0
- package/prompts/fito-case-plan-source.md +114 -0
- package/prompts/fito-create-or-update-competence.md +261 -0
- package/prompts/fito-create-or-update-technology.md +199 -0
- package/prompts/fito-delete-competence.md +147 -0
- package/prompts/fito-evaluate.md +148 -0
- package/prompts/fito-fetch-urls-content.md +35 -0
- package/prompts/fito-generate-domain-concepts.md +85 -0
- package/prompts/fito-generate-execution-facts.md +85 -0
- package/prompts/fito-generate-usage-scenarios.md +85 -0
- package/prompts/fito-identify-domain-concepts.md +49 -0
- package/prompts/fito-identify-execution-facts.md +49 -0
- package/prompts/fito-identify-usage-scenarios.md +49 -0
- package/prompts/fito-login.md +21 -0
- package/prompts/fito-logout.md +14 -0
- package/prompts/fito-publish-case.md +266 -0
- package/prompts/fito-push-knowledge.md +84 -0
- package/prompts/fito-submit.md +208 -0
- package/prompts/fito-tutor.md +120 -0
- package/shared/case-briefing/briefing.js +221 -0
- package/shared/case-briefing/briefing.ts +261 -0
- package/shared/case-quiz/scoring.js +16 -0
- package/shared/case-quiz/scoring.ts +61 -0
- package/shared/case-validation/case-loader.js +88 -0
- package/shared/case-validation/case-loader.ts +106 -0
- package/shared/case-validation/case-schema.js +716 -0
- package/shared/case-validation/case-schema.ts +895 -0
- package/shared/competences/competence-list.js +29 -0
- package/shared/competences/competence-list.ts +32 -0
- package/shared/fito-api/README.md +192 -0
- package/shared/fito-api/client.js +731 -0
- package/shared/fito-api/client.ts +1426 -0
- package/shared/fito-session/credentials.js +79 -0
- package/shared/fito-session/credentials.ts +88 -0
- package/shared/fito-session/session.js +16 -0
- package/shared/fito-session/session.ts +35 -0
- package/shared/github-url/parse.js +26 -0
- package/shared/github-url/parse.ts +35 -0
- package/shared/knowledge-components/component-names.js +35 -0
- package/shared/knowledge-components/component-names.ts +39 -0
- package/shared/knowledge-components/knowledge-fetch.js +46 -0
- package/shared/knowledge-components/knowledge-fetch.ts +57 -0
- package/shared/knowledge-components/knowledge-search.js +101 -0
- package/shared/knowledge-components/knowledge-search.ts +144 -0
- package/shared/knowledge-components/push-payload.js +104 -0
- package/shared/knowledge-components/push-payload.ts +129 -0
- package/shared/knowledge-components/reference.js +24 -0
- package/shared/knowledge-components/reference.ts +43 -0
- package/shared/knowledge-components/technology-fetch.js +30 -0
- package/shared/knowledge-components/technology-fetch.ts +38 -0
- package/shared/shell-exec/exec.js +22 -0
- package/shared/shell-exec/exec.ts +46 -0
- package/skills/fito-auth/SKILL.md +68 -0
- package/skills/fito-auth/auth-refresh.js +23 -0
- package/skills/fito-auth/auth-refresh.ts +25 -0
- package/skills/fito-auth/browser.js +35 -0
- package/skills/fito-auth/browser.ts +57 -0
- package/skills/fito-auth/callback-server.js +152 -0
- package/skills/fito-auth/callback-server.ts +189 -0
- package/skills/fito-auth/login.js +37 -0
- package/skills/fito-auth/login.ts +42 -0
- package/skills/fito-auth/logout.js +24 -0
- package/skills/fito-auth/logout.ts +25 -0
- package/skills/fito-case-author/SKILL.md +179 -0
- package/skills/fito-case-author/checkout.js +222 -0
- package/skills/fito-case-author/checkout.ts +281 -0
- package/skills/fito-case-author/github-publish.js +218 -0
- package/skills/fito-case-author/github-publish.ts +251 -0
- package/skills/fito-case-author/publish-payload.js +108 -0
- package/skills/fito-case-author/publish-payload.ts +186 -0
- package/skills/fito-case-author/publish-state.js +72 -0
- package/skills/fito-case-author/publish-state.ts +87 -0
- package/skills/fito-case-author/publish-version.js +364 -0
- package/skills/fito-case-author/publish-version.ts +495 -0
- package/skills/fito-case-author/publish.js +284 -0
- package/skills/fito-case-author/publish.ts +394 -0
- package/skills/fito-case-author/semver.js +55 -0
- package/skills/fito-case-author/semver.ts +63 -0
- package/skills/fito-case-author/status-gate.js +34 -0
- package/skills/fito-case-author/status-gate.ts +54 -0
- package/skills/fito-case-author/validate.js +62 -0
- package/skills/fito-case-author/validate.ts +64 -0
- package/skills/fito-case-runner/SKILL.md +119 -0
- package/skills/fito-case-runner/case-component-names.js +45 -0
- package/skills/fito-case-runner/case-component-names.ts +65 -0
- package/skills/fito-case-runner/case-detail.js +20 -0
- package/skills/fito-case-runner/case-detail.ts +20 -0
- package/skills/fito-case-runner/github.js +234 -0
- package/skills/fito-case-runner/github.ts +287 -0
- package/skills/fito-case-runner/manifest.js +56 -0
- package/skills/fito-case-runner/manifest.ts +73 -0
- package/skills/fito-case-runner/open.js +175 -0
- package/skills/fito-case-runner/open.ts +241 -0
- package/skills/fito-case-runner/report.js +22 -0
- package/skills/fito-case-runner/report.ts +24 -0
- package/skills/fito-case-runner/runner.js +158 -0
- package/skills/fito-case-runner/runner.ts +304 -0
- package/skills/fito-case-runner/score-quiz-mc.js +85 -0
- package/skills/fito-case-runner/score-quiz-mc.ts +99 -0
- package/skills/fito-case-runner/submit-evaluation.js +73 -0
- package/skills/fito-case-runner/submit-evaluation.ts +98 -0
- package/skills/fito-case-runner/submit-quiz-result.js +75 -0
- package/skills/fito-case-runner/submit-quiz-result.ts +100 -0
- package/skills/fito-case-runner/submit.js +85 -0
- package/skills/fito-case-runner/submit.ts +111 -0
- package/skills/fito-case-runner/workdir.js +10 -0
- package/skills/fito-case-runner/workdir.ts +11 -0
- package/skills/fito-competence-write/SKILL.md +155 -0
- package/skills/fito-competence-write/create.js +64 -0
- package/skills/fito-competence-write/create.ts +80 -0
- package/skills/fito-competence-write/delete.js +136 -0
- package/skills/fito-competence-write/delete.ts +166 -0
- package/skills/fito-competence-write/display.js +20 -0
- package/skills/fito-competence-write/display.ts +21 -0
- package/skills/fito-competence-write/payload.js +96 -0
- package/skills/fito-competence-write/payload.ts +115 -0
- package/skills/fito-competence-write/update.js +155 -0
- package/skills/fito-competence-write/update.ts +206 -0
- package/skills/fito-evaluator/SKILL.md +73 -0
- package/skills/fito-evaluator/criterion-exec.js +64 -0
- package/skills/fito-evaluator/criterion-exec.ts +73 -0
- package/skills/fito-evaluator/evaluate-automated.js +57 -0
- package/skills/fito-evaluator/evaluate-automated.ts +84 -0
- package/skills/fito-evaluator/evaluate.js +28 -0
- package/skills/fito-evaluator/evaluate.ts +86 -0
- package/skills/fito-evaluator/report.js +112 -0
- package/skills/fito-evaluator/report.ts +128 -0
- package/skills/fito-evaluator/rubric.js +90 -0
- package/skills/fito-evaluator/rubric.ts +170 -0
- package/skills/fito-knowledge-push/SKILL.md +114 -0
- package/skills/fito-knowledge-push/push.js +282 -0
- package/skills/fito-knowledge-push/push.ts +360 -0
- package/skills/fito-source-ingestion/SKILL.md +77 -0
- package/skills/fito-source-ingestion/authoring-check.js +128 -0
- package/skills/fito-source-ingestion/authoring-check.ts +155 -0
- package/skills/fito-source-ingestion/bundle.js +198 -0
- package/skills/fito-source-ingestion/bundle.ts +246 -0
- package/skills/fito-technology-write/SKILL.md +108 -0
- package/skills/fito-technology-write/create.js +134 -0
- package/skills/fito-technology-write/create.ts +161 -0
- package/skills/fito-technology-write/payload.js +64 -0
- package/skills/fito-technology-write/payload.ts +70 -0
- package/skills/fito-technology-write/update.js +122 -0
- package/skills/fito-technology-write/update.ts +171 -0
- package/skills/fito-url-content-fetcher/SKILL.md +213 -0
- package/templates/concept-practice-content-template.md +281 -0
- package/templates/concept-tool-content-template.md +207 -0
- package/templates/execution-fact-practice-content-template.md +372 -0
- package/templates/execution-fact-tool-content-template.md +307 -0
- package/templates/usage-scenario-content-template.md +248 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Extract usage scenarios from an ingested source (case source tree or fetched docs)"
|
|
3
|
+
argument-hint: '<tool-name> --technology-version <slug> [--source <path>] [--technology <slug>] [--description "<text>"] [--fetch] [--urls <file>] [--docs <path>] [--output <path>]'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Identify Usage Scenarios
|
|
7
|
+
|
|
8
|
+
Extract usage scenarios from an ingested source using the UsageScenario identifier matching the
|
|
9
|
+
subject technology's kind — the IDENTIFY step of the Fito knowledge pipeline for UsageScenario
|
|
10
|
+
components. Step 2 resolves that kind; step 8 names the sibling it selects.
|
|
11
|
+
|
|
12
|
+
The **preferred** ingestion source is the case's own source tree — pass `--source`
|
|
13
|
+
and this prompt runs the `fito-source-ingestion` skill to bundle it. **Fetched
|
|
14
|
+
documentation URLs** (via `/fito-fetch-urls-content`) are the fallback / supplemental
|
|
15
|
+
source. Either way, the identifier reads a directory of files; `--docs` points at one
|
|
16
|
+
that was already ingested.
|
|
17
|
+
|
|
18
|
+
Parse `$ARGUMENTS` to extract:
|
|
19
|
+
|
|
20
|
+
- **tool-name** (required): first positional argument — the name of the software tool, technique, or methodology being analyzed
|
|
21
|
+
- **--source** (optional): path to a local case source tree — the preferred ingestion source, ingested by the `fito-source-ingestion` skill (step 4)
|
|
22
|
+
- **--technology** (optional): the subject's Fito Technology slug (e.g. `spring-boot`), used to resolve the technology's `kind` (step 2) and by the identifier to ground candidates against the backend Knowledge Repository. Defaults to the tool name lowercased with spaces collapsed to dashes
|
|
23
|
+
- **--technology-version** (required): the Fito `TechnologyVersion.slug` the identified components apply to — the technology's major line (e.g. `7`). The identifier grounds every candidate under this version, so a component that lives only for another major line reads as new. This is the declared version that flows downstream to generate and plan-source. A practice carries a single version `1` — Fito's own numbering, not an upstream release line — so a practice run passes `--technology-version 1`; the flag is required for every kind
|
|
24
|
+
- **--description** (optional): a brief description of what the subject does and what domains it operates in. Helps the agent infer relevant domains before reading the source
|
|
25
|
+
- **--fetch** (optional flag): if present, run `/fito-fetch-urls-content` before identifying usage scenarios (the URL-fallback ingestion path)
|
|
26
|
+
- **--urls** (optional): URL list file to pass to `/fito-fetch-urls-content`. Defaults to `urls.txt`. Only relevant when `--fetch` is present
|
|
27
|
+
- **--docs** (optional): path to the directory containing the source to analyze — a `fito-source-ingestion` bundle or fetched markdown documents. Defaults to `./output/1-ingest/extracted_links_content/`
|
|
28
|
+
- **--output** (optional): path to the directory where results will be saved. Defaults to `./output/2-identify/usage_scenarios/`
|
|
29
|
+
|
|
30
|
+
## Steps
|
|
31
|
+
|
|
32
|
+
1. If no tool name is provided, stop and ask the user:
|
|
33
|
+
> "Please provide the tool name. Usage: `/fito-identify-usage-scenarios <tool-name> --technology-version <slug> [--source <path>] [--technology <slug>] [--description \"<text>\"] [--fetch] [--urls <file>] [--docs <path>] [--output <path>]`"
|
|
34
|
+
If `--technology-version` is not provided, stop and ask the user:
|
|
35
|
+
> "Please provide the Fito technology version the identified components apply to with `--technology-version <slug>` (e.g. `7`, or `1` for a practice). Every knowledge component is version-scoped; without a declared major line the identifier cannot decide whether an existing component still applies."
|
|
36
|
+
2. Resolve the subject technology's **kind** — the value that picks which identifier runs. Call the `fito_technology_fetch` tool once with the technology slug (the `--technology` value, or the default derived from the tool name; the read is public — no login) and read its `kind`: `tool` or `practice`. Nothing else picks a variant — the author declares a technology, and the kind follows from it.
|
|
37
|
+
**Only a not-found means the technology is not provisioned** — the fetch reports `No technology found for`. Stop and tell the user:
|
|
38
|
+
> "The Fito vocabulary holds no `<slug>` technology, so there is nothing to ground candidates against. Provision it first with `/fito-create-or-update-technology --technology <slug>@<version>` — a practice is provisioned at version `1` — then re-run `/fito-identify-usage-scenarios`. If the slug is merely misspelled, correct `--technology` instead: provisioning a misspelling admits a second, independent technology alongside the real one."
|
|
39
|
+
|
|
40
|
+
Any other outcome — an unreachable backend, a 5xx, anything that is not a not-found — says nothing about whether the technology exists: report it **verbatim** and stop there, without the refusal above. A backend that is down must never read as a technology nobody provisioned
|
|
41
|
+
3. If none of `--source`, `--docs`, or `--fetch` was given, the current directory contains `.case/manifest.yaml`, and the `fito-source-ingestion` skill is available, run its **authoring-context check** (authoring = the checkout is the case repo itself or a fork of an unregistered repo — not a fork of a case registered in the backend). On an *authoring* verdict, offer to proceed with `--source .`; if the user accepts, treat `--source .` as given for the remaining steps. In every other outcome (skill unavailable, non-authoring verdict, or offer declined), continue without `--source`
|
|
42
|
+
4. If `--source` is provided, run the `fito-source-ingestion` skill on that path and use the bundle directory it produces as the docs directory for the remaining steps, skipping `--fetch` even if present. If the skill is not available, tell the user:
|
|
43
|
+
> "The `fito-source-ingestion` skill is not available yet — falling back to fetched documentation (`--docs` / `--fetch`)."
|
|
44
|
+
5. If `--fetch` is present and no `--source` bundle was produced, run the `/fito-fetch-urls-content` prompt with the `--urls` path (or `urls.txt` if not provided)
|
|
45
|
+
6. Verify the docs directory exists and contains at least one file. If not, stop and tell the user:
|
|
46
|
+
> "No source found at `<docs-path>`. Ingest the case's source tree with `--source <path>` (preferred) or fetch documentation with `/fito-fetch-urls-content`, then re-run."
|
|
47
|
+
7. Create the output directory if it does not exist
|
|
48
|
+
8. Delegate to the identifier the resolved `kind` selects — `fito-tool-usage-scenario-identifier` for a `tool`, `fito-practice-usage-scenario-identifier` for a `practice` — as a **subagent** via the `fito_delegate` tool, handing it: the subject name, the technology slug, the technology version slug (from `--technology-version`), the subject description (if provided), the docs path, and the output path. This delegation blocks — you read the child's summary from the tool result.
|
|
49
|
+
9. Relay the subagent's summary to the user — including how many candidates already exist in the backend Knowledge Repository
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Log in to Fito from the terminal (opens your browser)
|
|
3
|
+
---
|
|
4
|
+
Log the learner in to Fito.
|
|
5
|
+
|
|
6
|
+
Use the `fito-auth` skill (read its `SKILL.md`), then run:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
node <fito-auth skill dir>/login.js
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This starts a local loopback server, opens the system browser to the Fito web
|
|
13
|
+
login page (`/auth/login?return_to=tui&port=<port>`), and waits for the browser
|
|
14
|
+
to hand back the freshly minted token pair, which it writes to
|
|
15
|
+
`~/.fito/credentials` (mode `0600`). The learner can use either email/password or
|
|
16
|
+
"Continue with GitHub" in the browser.
|
|
17
|
+
|
|
18
|
+
Stream the command output so the learner sees the login URL (in case the browser
|
|
19
|
+
does not open automatically). When it prints the success line, confirm they are
|
|
20
|
+
logged in. If it fails or times out, report the error and suggest re-running
|
|
21
|
+
`/fito-login`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Log out of Fito and remove stored credentials
|
|
3
|
+
---
|
|
4
|
+
Log the learner out of Fito.
|
|
5
|
+
|
|
6
|
+
Use the `fito-auth` skill (read its `SKILL.md`), then run:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
node <fito-auth skill dir>/logout.js
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This best-effort revokes the refresh token on the backend and deletes
|
|
13
|
+
`~/.fito/credentials`. It is idempotent — it succeeds even if the learner was not
|
|
14
|
+
logged in. Report the result.
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Publish a Fito case — initial publish or a new version of a published case, routed automatically; push to GitHub and register/publish with the backend
|
|
3
|
+
argument-hint: '[<case-dir>] [--repo <owner>/<name>] [--case-id <uuid>]'
|
|
4
|
+
---
|
|
5
|
+
The author wants to publish a Fito case — either the PUBLISH step of case
|
|
6
|
+
authoring (a finished tree, after `/fito-case-generate` wrote the `.case/`
|
|
7
|
+
contract and the source work guided by `/fito-case-plan-source` — executed
|
|
8
|
+
outside Fito — produced the starter state and the solution branch), or a
|
|
9
|
+
**new version** of an already-published case from an edited authoring
|
|
10
|
+
checkout (`/fito-case-edit`'s output). One flow serves both: the route is
|
|
11
|
+
resolved automatically by registration state. Drive the `fito-case-author`
|
|
12
|
+
skill's publish scripts (read its `SKILL.md`) on this session — a
|
|
13
|
+
knowledgeable peer walking the author through the step that makes the case
|
|
14
|
+
(or its correction) public. Two things hold throughout: **every resolution is
|
|
15
|
+
the author's call** — a repo name, an identity mismatch, a rejected
|
|
16
|
+
reference — you relay and ask, never decide; and **published refs are
|
|
17
|
+
immutable** — the `vX.Y.Z` and `case/solution-vX.Y.Z` refs, once published,
|
|
18
|
+
are never rewritten; an update publishes **new** refs beside them.
|
|
19
|
+
|
|
20
|
+
Parse `$ARGUMENTS`:
|
|
21
|
+
|
|
22
|
+
- **case-dir** (optional): the leading free text — the case working directory.
|
|
23
|
+
Defaults to `.`
|
|
24
|
+
- **--repo <owner>/<name>** (optional, initial route only): the GitHub repo to
|
|
25
|
+
create and push; a bare `<name>` gets its owner from
|
|
26
|
+
`FITO_PUBLISH_GITHUB_OWNER`, else the authenticated `gh` login
|
|
27
|
+
- **--case-id <uuid>** (optional, initial route only): the draft registered by
|
|
28
|
+
an earlier attempt
|
|
29
|
+
|
|
30
|
+
## 1. Resolve the case directory and the route
|
|
31
|
+
|
|
32
|
+
Two prerequisites, both before anything is pushed: a **Fito login**
|
|
33
|
+
(`/fito-login` — registering, publishing, and versioning are
|
|
34
|
+
bearer-authenticated) and an authenticated **`gh`** (`gh auth login` — the
|
|
35
|
+
initial publish creates and pushes the repo under this local account; an
|
|
36
|
+
update's push needs its credentials to hold write access to the case repo).
|
|
37
|
+
|
|
38
|
+
The directory must contain `.case/` — otherwise stop and point the author at
|
|
39
|
+
`/fito-case-generate` (a new case) or `/fito-case-edit <case-id>` (an update
|
|
40
|
+
checkout). Then resolve **which publish this is** — using the `fito-case-author`
|
|
41
|
+
skill (read its `SKILL.md`):
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
node <fito-case-author skill dir>/publish-version.js <case-dir> --probe
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- **`route: initial`** — the directory is not a registered case's checkout:
|
|
48
|
+
follow **The initial publish** below.
|
|
49
|
+
- **`route: update`** — the directory's `origin` is an already-published
|
|
50
|
+
case: relay the probe's `currently published:` line to the author and
|
|
51
|
+
follow **The update publish** below. Never drive the initial path at a
|
|
52
|
+
published case's URL — its script refuses that anyway.
|
|
53
|
+
- **`route: deprecated`** — the case was retired (possibly after this
|
|
54
|
+
checkout was made) and the probe decided the stop: relay its printed
|
|
55
|
+
guidance verbatim and stop — the correction is a **new case** via
|
|
56
|
+
`/fito-case-design`; this one stays deprecated. Don't walk the author
|
|
57
|
+
through version work the script will refuse.
|
|
58
|
+
|
|
59
|
+
On either publish route this flow expects a **finished** tree: the source
|
|
60
|
+
work done, the local `case/solution-vX.Y.Z` branch built, everything
|
|
61
|
+
committed. If `git status` shows uncommitted changes, surface them and
|
|
62
|
+
settle them with the author before going on — both scripts refuse a dirty
|
|
63
|
+
tree, because what is validated must be exactly what is pushed.
|
|
64
|
+
|
|
65
|
+
**Done when** both prerequisites hold, the route is known, and the tree is
|
|
66
|
+
clean — or the route was `deprecated` and you relayed and stopped.
|
|
67
|
+
|
|
68
|
+
# The initial publish (route: initial)
|
|
69
|
+
|
|
70
|
+
## 2. Settle the repo
|
|
71
|
+
|
|
72
|
+
Propose the repo and let the author confirm or correct both halves:
|
|
73
|
+
|
|
74
|
+
- **owner** — `--repo`'s owner, else `FITO_PUBLISH_GITHUB_OWNER`, else the
|
|
75
|
+
`gh` login. An org is fine: a case repo lives wherever its Case Creator
|
|
76
|
+
controls; Fito only records the URL.
|
|
77
|
+
- **name** — `--repo`'s name, else propose a short kebab-case name derived
|
|
78
|
+
from the case title.
|
|
79
|
+
|
|
80
|
+
State it plainly before moving on: the repo will be created **public** (the
|
|
81
|
+
MVP scope), under `https://github.com/<owner>/<name>`, and that URL is what
|
|
82
|
+
learners clone.
|
|
83
|
+
|
|
84
|
+
**Done when** the author confirms `<owner>/<name>`.
|
|
85
|
+
|
|
86
|
+
## 3. Draft the storefront description
|
|
87
|
+
|
|
88
|
+
The backend requires a `descriptionOverview` — the markdown a learner reads
|
|
89
|
+
on the `/cases` listing *before* opening the case. It is a storefront pitch,
|
|
90
|
+
not the in-fiction narrative: what the case is about, what the learner will
|
|
91
|
+
practice (the learning objectives), and how to get started. Draft it from the
|
|
92
|
+
`.case/` content — the situation, `task/objective.md`,
|
|
93
|
+
`learning_objectives.yaml` — and never anything from `.case/solution/`.
|
|
94
|
+
|
|
95
|
+
**The pitch names the topic, never the move.** That last clause does not
|
|
96
|
+
cover it: the repair reaches this page through `learning_objectives.yaml`,
|
|
97
|
+
which this step legitimately draws on. The page is public and read before
|
|
98
|
+
anyone enrols, so test the drafted text — *could a reader who saw only this
|
|
99
|
+
page apply the fix?* If yes, rewrite it. Say what the case is about and what
|
|
100
|
+
the learner will practice; leave the technique to the case. `tutorial` cases
|
|
101
|
+
are the exception: their steps *are* the method, so a tutorial's pitch may
|
|
102
|
+
name it.
|
|
103
|
+
|
|
104
|
+
If `.authoring/description-overview.md` already exists (an earlier attempt or
|
|
105
|
+
revision), offer it back for reuse or revision instead of re-drafting.
|
|
106
|
+
Iterate until the author approves the text, then write it to
|
|
107
|
+
`.authoring/description-overview.md` — committed, it survives a fix-and-retry
|
|
108
|
+
and seeds the later version-update flow.
|
|
109
|
+
|
|
110
|
+
**Done when** the author has approved the text and the file is written.
|
|
111
|
+
|
|
112
|
+
## 4. Set the manifest status and commit
|
|
113
|
+
|
|
114
|
+
Set `status: published` in `.case/manifest.yaml` — the frozen `vX.Y.Z`
|
|
115
|
+
snapshot every learner clones should describe itself truthfully. Commit it
|
|
116
|
+
together with `.authoring/description-overview.md` in one commit. (The script
|
|
117
|
+
re-validates the tree after this edit, so a slip here is caught before
|
|
118
|
+
anything is pushed.)
|
|
119
|
+
|
|
120
|
+
**Done when** the tree is clean again.
|
|
121
|
+
|
|
122
|
+
## 5. Run the publish
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
node <fito-case-author skill dir>/publish.js <case-dir> --repo <owner>/<name> --overview <case-dir>/.authoring/description-overview.md
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Add `--case-id <uuid>` when one is known (passed in, or printed by a previous
|
|
129
|
+
run — the script also remembers it in `~/.fito/publish-state.json` on its
|
|
130
|
+
own). One run validates, pushes `main` + the `vX.Y.Z` branch and tag + the
|
|
131
|
+
solution branch, registers the case, and publishes it. It is safe to re-run
|
|
132
|
+
after a failure: the repo is never duplicated and the registered draft is
|
|
133
|
+
reused.
|
|
134
|
+
|
|
135
|
+
**Done when** the script exits 0 — or its stop is handled in step 6.
|
|
136
|
+
|
|
137
|
+
## 6. Relay outcomes — verbatim
|
|
138
|
+
|
|
139
|
+
- **Success** — relay the backend case id, the `PUBLISHED` status, and the
|
|
140
|
+
web URL where the case is now listed. Then the road ahead:
|
|
141
|
+
`/fito-case-open <case-id>` to run the case exactly as a learner would.
|
|
142
|
+
Leave the author the update rules too: the published refs are now frozen —
|
|
143
|
+
a correction that **changes the knowledge-reference set** is a new case
|
|
144
|
+
(design it with `/fito-case-design` and deprecate this one); a
|
|
145
|
+
**same-reference** perfection update is a versioned publish
|
|
146
|
+
(`/fito-case-edit <case-id>`, edit, then this flow again — it routes to
|
|
147
|
+
the update path).
|
|
148
|
+
- **Identity-mismatch stop** — the local `gh` account is not the Fito-linked
|
|
149
|
+
GitHub identity. Relay the message verbatim and ask; only re-run with
|
|
150
|
+
`--accept-gh-mismatch` after the author explicitly confirms — **the
|
|
151
|
+
confirmation is the author's, never yours**.
|
|
152
|
+
- **Structural errors** — relay them verbatim, grouped by file — never
|
|
153
|
+
paraphrase or collapse them. Fix the named files (or re-enter
|
|
154
|
+
`/fito-case-generate`'s validate loop) and re-run; never regenerate the
|
|
155
|
+
tree over a fixable error.
|
|
156
|
+
- **Backend rejection** (HTTP status + problem detail) — relay it verbatim,
|
|
157
|
+
with the remembered draft id. Route the fix, then re-run this flow (the
|
|
158
|
+
draft id is reused automatically; the GitHub repo is not re-created):
|
|
159
|
+
- an **unresolvable or wrong-type reference** — the component is missing
|
|
160
|
+
from the backend vocabulary (run the knowledge pipeline and
|
|
161
|
+
`/fito-push-knowledge`) or the `.case/` value is wrong
|
|
162
|
+
(`/fito-case-generate`)
|
|
163
|
+
- a **failed reachability ping** — the pushed refs didn't land (network,
|
|
164
|
+
permissions): check the repo on GitHub, then re-run
|
|
165
|
+
|
|
166
|
+
**Done when** the case is published — or the author holds a verbatim error
|
|
167
|
+
and a named next step.
|
|
168
|
+
|
|
169
|
+
# The update publish (route: update)
|
|
170
|
+
|
|
171
|
+
The tree is an authoring checkout from `/fito-case-edit`, edited on `main`.
|
|
172
|
+
Publishing it as a new version keeps the case's identity: the registry
|
|
173
|
+
repoints to the new version, new learners get it, and prior learners keep
|
|
174
|
+
their **pinned versions** untouched — published refs are never rewritten; the
|
|
175
|
+
update cuts new ones beside them.
|
|
176
|
+
|
|
177
|
+
## 7. Check the edit against the update rules
|
|
178
|
+
|
|
179
|
+
Ask what changed (or read the diff) and check it against the update rules
|
|
180
|
+
before any version work:
|
|
181
|
+
|
|
182
|
+
- The **reference set is frozen** across versions: an edit that changes the
|
|
183
|
+
knowledge references (learning objectives, prerequisites, rubric — component or
|
|
184
|
+
Bloom level) cannot be a version. Stop — that correction is a **new
|
|
185
|
+
case**: design it with `/fito-case-design` and deprecate this one. The
|
|
186
|
+
script preflights this and itemizes any drift before pushing, but catching
|
|
187
|
+
it here saves the author the version work.
|
|
188
|
+
- A **same-reference perfection** — starter code, wording, rubric phrasing,
|
|
189
|
+
descriptions, the quiz — is exactly what this path publishes.
|
|
190
|
+
|
|
191
|
+
**Done when** the edit is confirmed same-reference — or the author was
|
|
192
|
+
routed to `/fito-case-design` and you stopped.
|
|
193
|
+
|
|
194
|
+
## 8. Settle the new version
|
|
195
|
+
|
|
196
|
+
Agree the new SemVer with the author: it must be **strictly greater** than
|
|
197
|
+
the currently published version (the probe printed it) — patch for a
|
|
198
|
+
correction, minor for a perfection is a sane default, but the number is the
|
|
199
|
+
author's call. Then the version-bearing fields must all name it, so the
|
|
200
|
+
frozen snapshot describes itself truthfully:
|
|
201
|
+
|
|
202
|
+
- `.case/manifest.yaml` — `version: X.Y.Z` **and**
|
|
203
|
+
`submission.target_branch: vX.Y.Z` (a learner's PR targets the frozen
|
|
204
|
+
version branch)
|
|
205
|
+
- `.case/solution.yaml` — `branch: case/solution-vX.Y.Z` (and any
|
|
206
|
+
`acceptable_solutions` branches)
|
|
207
|
+
|
|
208
|
+
The local exemplar branch `case/solution-vX.Y.Z` must exist with the
|
|
209
|
+
solution for **this** version — rebuilt from the previous version's solution
|
|
210
|
+
branch, re-applied onto the updated `main`. That is source work, done
|
|
211
|
+
outside Fito; the script refuses until the branch exists.
|
|
212
|
+
|
|
213
|
+
**Done when** the version is agreed, every field names it, and the local
|
|
214
|
+
exemplar branch exists.
|
|
215
|
+
|
|
216
|
+
## 9. Draft the change description — and revisit the storefront
|
|
217
|
+
|
|
218
|
+
The backend requires a `change_description` — the correction note served
|
|
219
|
+
with the case and shown on the next `/fito-case-edit`. Draft it with the
|
|
220
|
+
author: what changed and why, a few sentences, plain and specific. Iterate
|
|
221
|
+
until the author approves, then write it to
|
|
222
|
+
`.authoring/change-description.md` (overwriting the previous version's note —
|
|
223
|
+
the full history lives in the backend's version chain).
|
|
224
|
+
|
|
225
|
+
Offer `.authoring/description-overview.md` back too: if the correction
|
|
226
|
+
changes what a learner should read on the storefront, revise it with the
|
|
227
|
+
author; otherwise it is re-sent as is.
|
|
228
|
+
|
|
229
|
+
Commit everything — the version-field bumps, the change description, any
|
|
230
|
+
overview revision — so the tree is clean again.
|
|
231
|
+
|
|
232
|
+
**Done when** both `.authoring/` files hold author-approved text and the
|
|
233
|
+
tree is clean.
|
|
234
|
+
|
|
235
|
+
## 10. Run the version publish and relay — verbatim
|
|
236
|
+
|
|
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
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
One run re-validates the tree, preflights the frozen reference set against
|
|
242
|
+
the backend, pushes `main` + the new `vX.Y.Z` branch and tag + the solution
|
|
243
|
+
branch, and publishes the version. It is safe to re-run after a failure:
|
|
244
|
+
nothing is registered until the final call succeeds, and the local tree is
|
|
245
|
+
never modified.
|
|
246
|
+
|
|
247
|
+
- **Success** — relay the new version (previous → new), the web URL, that
|
|
248
|
+
prior learners keep their pinned versions while
|
|
249
|
+
`/fito-case-open <case-id>` now serves the new one, and that this checkout
|
|
250
|
+
was refreshed: its tags and `origin/…` refs now match GitHub. A `⚠` on that
|
|
251
|
+
last one means the refresh alone failed — the version is published, and the
|
|
252
|
+
author picks the refs up later with `git fetch origin --tags`.
|
|
253
|
+
- **Reference-set preflight stop** — relay the itemized added/removed lines
|
|
254
|
+
verbatim — never paraphrase or collapse them. The route is the author's
|
|
255
|
+
call: revert the reference change (if it was unintended) and re-run, or
|
|
256
|
+
design the successor case with `/fito-case-design` and deprecate this one.
|
|
257
|
+
- **Staleness and version stops** (`target_branch`, the solution branch, a
|
|
258
|
+
version not strictly greater) — relay verbatim; each names the file, the
|
|
259
|
+
stale value, and the expected one. Fix, commit, re-run.
|
|
260
|
+
- **Backend rejection** (HTTP status + problem detail) — relay it verbatim.
|
|
261
|
+
A failed reachability ping means the pushed refs didn't land (network,
|
|
262
|
+
permissions — an update push needs write access to the case repo): check
|
|
263
|
+
the repo on GitHub, then re-run.
|
|
264
|
+
|
|
265
|
+
**Done when** the new version is served — or the author holds a verbatim
|
|
266
|
+
error and a named next step.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Push generated knowledge components to the backend Knowledge Repository, resolving near-duplicates with the author
|
|
3
|
+
argument-hint: "[payload-dir-or-files]"
|
|
4
|
+
---
|
|
5
|
+
The author wants to push generated knowledge-component payloads to the backend Knowledge
|
|
6
|
+
Repository — the PUSH step of the Fito knowledge pipeline, after `/fito-generate-*` produced
|
|
7
|
+
them. Drive the whole flow below with the `fito-knowledge-push` skill (read its `SKILL.md`).
|
|
8
|
+
|
|
9
|
+
## 1. Resolve the payloads
|
|
10
|
+
|
|
11
|
+
Take the payload files from `$ARGUMENTS`: each argument is a payload file or a directory of
|
|
12
|
+
them (collect `*.json` inside, non-recursive). With no arguments, default to the generate
|
|
13
|
+
stage's output — every `*.json` under `./output/3-generate/*/` (the
|
|
14
|
+
`concept_content/`, `execution_fact_content/`, and `usage_scenario_content/` directories).
|
|
15
|
+
|
|
16
|
+
If no payload files are found, stop and tell the author:
|
|
17
|
+
|
|
18
|
+
> "No generated payloads found under `<path>`. Run `/fito-generate-domain-concepts`,
|
|
19
|
+
> `/fito-generate-execution-facts`, or `/fito-generate-usage-scenarios` first, or pass the
|
|
20
|
+
> payload directory: `/fito-push-knowledge <payload-dir-or-files>`"
|
|
21
|
+
|
|
22
|
+
List the resolved files and their count before pushing so the author sees what is about to
|
|
23
|
+
be pushed. Pushing requires a Fito login — if a push fails with the not-logged-in message,
|
|
24
|
+
relay it: run `/fito-login`, then re-run `/fito-push-knowledge`.
|
|
25
|
+
|
|
26
|
+
## 2. Push one payload at a time
|
|
27
|
+
|
|
28
|
+
**Payloads are read-only.** Never edit, overwrite, or regenerate a payload file by any means —
|
|
29
|
+
editor, `python3`, shell redirection — for any reason: not to force a name match, not to fix a
|
|
30
|
+
validation error, not to satisfy a resolution. When a payload looks wrong, surface the problem
|
|
31
|
+
to the author and stop; the fix is the author's call (usually regenerating with the generator
|
|
32
|
+
prompt, then pushing fresh). *(A pipeline run saw a worker patch `metadata.name` on disk to
|
|
33
|
+
force an outcome — this rule exists because that happened.)*
|
|
34
|
+
|
|
35
|
+
For each payload file, in order, run:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
node <fito-knowledge-push skill dir>/push.js <payload-file>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- **Created** (`✓ Created <canonical-reference> …`) — record the canonical reference and move
|
|
42
|
+
to the next file.
|
|
43
|
+
- **Similar components found (advisory probe)** — the script stops **before storing anything**
|
|
44
|
+
and prints each similar existing component with its similarity plus the choices (link /
|
|
45
|
+
supersede / skip / proceed) and their exact re-run commands. **The choice is the author's —
|
|
46
|
+
never yours.** Relay the block and wait for their pick; link and supersede work as on the 409
|
|
47
|
+
below, and **proceed** (`--proceed`) stores an independent component that will coexist with
|
|
48
|
+
the matches — restate that consequence before running it. If a proceed is then rejected with
|
|
49
|
+
the near-duplicate 409, resolve it through the 409 block below.
|
|
50
|
+
- **Near-duplicate 409** — the script stops and prints the duplicate's reference and the four
|
|
51
|
+
choices (link / supersede / skip / override) with their exact re-run commands. **The
|
|
52
|
+
resolution call is the author's — never yours.** Relay the block, then wait for their pick:
|
|
53
|
+
- **link** or **supersede** are the preferred resolutions. For supersede, ask whether to
|
|
54
|
+
label the new version (`--version <label>`, e.g. `2.0.0`) — the backend otherwise defaults
|
|
55
|
+
`1.0.0`, the same label as the predecessor. If the supersede re-run reports the target is
|
|
56
|
+
already superseded, relay the printed chain-head re-run and let the author retarget.
|
|
57
|
+
- **skip** — record the payload as skipped; push nothing for it. When the reported
|
|
58
|
+
duplicate is a component already pushed from this very payload file (an interrupted or
|
|
59
|
+
repeated run — same name, matching content; the earlier `✓ Created` lines name each
|
|
60
|
+
source file), tell the author skip is the expected resolution: it is already in the
|
|
61
|
+
vocabulary.
|
|
62
|
+
- **override** — before running it, restate the consequence: an independent near-duplicate
|
|
63
|
+
component will be stored and **coexist** with the duplicate in the vocabulary. Run it only
|
|
64
|
+
after the author explicitly confirms; the printed command already echoes the exact
|
|
65
|
+
reported reference.
|
|
66
|
+
|
|
67
|
+
Then run the author's exact chosen command and record the outcome.
|
|
68
|
+
- **Any other failure** (malformed payload, unknown technology, unknown technology version,
|
|
69
|
+
field-schema violations) — relay the printed reason, record the payload as failed, and continue
|
|
70
|
+
with the remaining files (payloads are read-only — the rule above). A payload that names no
|
|
71
|
+
technology version, or one the backend does not have, is a generator-side fix: regenerate with
|
|
72
|
+
the right `--technology-version`, never hand-edit the payload's `technology_versions`.
|
|
73
|
+
|
|
74
|
+
**Done when every resolved payload file is accounted for**: created (with its canonical
|
|
75
|
+
reference), skipped, or failed — none silently dropped.
|
|
76
|
+
|
|
77
|
+
## 3. Report
|
|
78
|
+
|
|
79
|
+
Summarize for the author:
|
|
80
|
+
|
|
81
|
+
- every created component's **canonical reference** (plain create, link, supersede, or
|
|
82
|
+
override alike) and the **total created count**;
|
|
83
|
+
- payloads skipped at the author's choice;
|
|
84
|
+
- payloads failed, each with its reason.
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Submit your Fito case solution — push, open the PR, then evaluate and record it
|
|
3
|
+
argument-hint: "<case-id>"
|
|
4
|
+
---
|
|
5
|
+
The learner wants to submit their worked solution for the Fito case `$1`: push
|
|
6
|
+
and open the pull request, then have it evaluated and the results recorded with
|
|
7
|
+
Fito. Drive the steps below in order.
|
|
8
|
+
|
|
9
|
+
If no case id was given, ask the learner for it first — the case's UUID, the same
|
|
10
|
+
id they opened with `/fito-case-open` — and don't run anything until you have it.
|
|
11
|
+
|
|
12
|
+
The submit step pushes whatever is **committed** on the case's working branch, so
|
|
13
|
+
first make sure their work is committed. If there are uncommitted changes in
|
|
14
|
+
`~/.fito/cases/$1/`, tell the learner to commit them on the working branch before
|
|
15
|
+
continuing.
|
|
16
|
+
|
|
17
|
+
## 1. Record the submission (push + open the PR)
|
|
18
|
+
|
|
19
|
+
Use the `fito-case-runner` skill (read its `SKILL.md`), then run:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
node <fito-case-runner skill dir>/submit.js $1
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This pushes the working branch to the learner's fork, opens a pull request against
|
|
26
|
+
the case's submission target branch, and records the submission with Fito. Stream
|
|
27
|
+
the output. It is safe to re-run: it reuses an already-open PR and re-recording the
|
|
28
|
+
same PR is idempotent.
|
|
29
|
+
|
|
30
|
+
**Note the submission id** it prints (`Submission recorded with Fito (id: <uuid>)`) —
|
|
31
|
+
you need it in step 4.
|
|
32
|
+
|
|
33
|
+
- If it reports the PR is open but recording the submission failed, the PR is on
|
|
34
|
+
GitHub but Fito did not record it — have the learner re-run `/fito-submit $1`,
|
|
35
|
+
which reuses the PR and retries the record.
|
|
36
|
+
- If it reports no open case at `~/.fito/cases/$1/`, the case was never opened (or
|
|
37
|
+
the checkout was moved) — point the learner at `/fito-case-open $1` first, and stop.
|
|
38
|
+
- If it reports the push was rejected because the fork's branch **diverged** (it
|
|
39
|
+
carries a previous attempt), do **not** force-push or reconcile the branches
|
|
40
|
+
yourself with raw git commands. Relay its guidance — re-open with
|
|
41
|
+
`/fito-case-open $1` and choose resume or start over — and stop.
|
|
42
|
+
- If `gh` is missing or unauthenticated, relay its message: install `gh` and run
|
|
43
|
+
`gh auth login` with the Fito-linked GitHub account, then retry.
|
|
44
|
+
|
|
45
|
+
**Done when** the PR is open and the submission is recorded (you have its id).
|
|
46
|
+
|
|
47
|
+
## 2. Build the evaluation report
|
|
48
|
+
|
|
49
|
+
Use the `fito-evaluator` skill (read its `SKILL.md`), then run:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
node <fito-evaluator skill dir>/evaluate-automated.js $1
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Stream the output. In `~/.fito/cases/$1/` it runs the automated criteria's commands
|
|
56
|
+
and the hybrid criteria's gate commands, and prints one **evaluation report**: the
|
|
57
|
+
automated evidence, the `ai` criteria + their prompt hints, the `hybrid` gate
|
|
58
|
+
evidence, and any `human` criteria under **Needs human review**.
|
|
59
|
+
|
|
60
|
+
If the report has **no scorable criteria** (nothing automated, ai, or hybrid), there
|
|
61
|
+
is no rubric to score — skip the rubric steps (3–4) and go straight to the quiz
|
|
62
|
+
(step 5). If there is also no `~/.fito/cases/$1/.case/quiz.yaml`, tell the learner
|
|
63
|
+
the submission is recorded but has nothing to score, and stop. (The PR and
|
|
64
|
+
submission from step 1 still stand.)
|
|
65
|
+
|
|
66
|
+
## 3. Score the report
|
|
67
|
+
|
|
68
|
+
Delegate to the `fito-performance-reviewer` **subagent** via the `fito_delegate`
|
|
69
|
+
tool. Hand it **both**:
|
|
70
|
+
|
|
71
|
+
- the **full evaluation report** from step 2, and
|
|
72
|
+
- the **case checkout path** `~/.fito/cases/$1/`, which it needs to score the `ai`
|
|
73
|
+
and `hybrid` criteria from the learner's actual changes.
|
|
74
|
+
|
|
75
|
+
It returns, as a fenced ```json array, one object per criterion —
|
|
76
|
+
`criterionId`, `knowledgeComponent`, `bloomLevel`, `evaluationType`, `score`
|
|
77
|
+
(0–3, or `null` for a `human` criterion needing review), `label`, and
|
|
78
|
+
`justification` — plus a short plain-text summary. Do not score anything yourself.
|
|
79
|
+
|
|
80
|
+
This delegation blocks — you read the child's summary from the tool result.
|
|
81
|
+
|
|
82
|
+
**Done when** the subagent has returned a result for every rubric criterion.
|
|
83
|
+
|
|
84
|
+
## 4. Record the evaluation with Fito
|
|
85
|
+
|
|
86
|
+
Save the subagent's JSON array **exactly as returned** (just the array from the
|
|
87
|
+
fenced ```json block) to a temporary file outside the checkout — e.g. write it to
|
|
88
|
+
`$(mktemp)` and note the path — the submission id from step 1 and that path are the
|
|
89
|
+
two arguments:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
node <fito-case-runner skill dir>/submit-evaluation.js <submission-id> <results-file>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
This POSTs the scores to Fito (`POST /submissions/{id}/results`), which records the
|
|
96
|
+
full result set, updates the learner's proficiency profile, and marks the submission
|
|
97
|
+
evaluated. Stream the output. It is safe to re-run: re-POSTing replaces the
|
|
98
|
+
submission's results, so re-running `/fito-submit $1` re-evaluates and re-records.
|
|
99
|
+
|
|
100
|
+
- If it reports the learner is not logged in, have them run `/fito-login`, then
|
|
101
|
+
re-run `/fito-submit $1`.
|
|
102
|
+
- If it reports a 404 for the submission, the id from step 1 was wrong — re-run from
|
|
103
|
+
step 1 to get the recorded submission id.
|
|
104
|
+
|
|
105
|
+
**Done when** it confirms the evaluation was recorded (status `EVALUATED`).
|
|
106
|
+
|
|
107
|
+
## 5. Administer and record the quiz (if the case has one)
|
|
108
|
+
|
|
109
|
+
If `~/.fito/cases/$1/.case/quiz.yaml` exists, the case has a knowledge-check quiz;
|
|
110
|
+
administer, score, and record it against the submission from step 1. If the file is
|
|
111
|
+
absent, skip this step.
|
|
112
|
+
|
|
113
|
+
1. **Present the quiz, hiding the answer key.** Read `.case/quiz.yaml` and walk the
|
|
114
|
+
learner through each question in order, showing only its `prompt` and (for a
|
|
115
|
+
`multiple_choice` question) its `choices` (id + text). **Never reveal a
|
|
116
|
+
question's `answer` or its `evaluation.prompt_hint`** — those are the answer key,
|
|
117
|
+
for scoring only. Collect the learner's `multiple_choice` answers as a
|
|
118
|
+
`{ "<questionId>": "<choiceId>" }` map, and hold their `short_answer` /
|
|
119
|
+
`code_snippet` answers for the reviewer.
|
|
120
|
+
2. **Score the `multiple_choice` questions in code.** Write the MC answers map to a
|
|
121
|
+
temp file (e.g. `$(mktemp)`), then run:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
node <fito-case-runner skill dir>/score-quiz-mc.js $1 <answers-file>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Capture its JSON array of scored `multiple_choice` questions (`[]` if the quiz
|
|
128
|
+
has none).
|
|
129
|
+
3. **Score the `short_answer` / `code_snippet` questions via the reviewer.** If the
|
|
130
|
+
quiz has any, delegate to the `fito-performance-reviewer` **subagent** via
|
|
131
|
+
the `fito_delegate` tool, handing it the **case checkout path**
|
|
132
|
+
`~/.fito/cases/$1/` (it reads `.case/quiz.yaml` — including the `evaluation`
|
|
133
|
+
block — itself) and the **learner's answers** to those questions, keyed by
|
|
134
|
+
question id. It returns, as a fenced ```json array, one object per question —
|
|
135
|
+
`questionId`, `knowledgeComponents`, `bloomLevel`, `score` (0–3, or `null` for a
|
|
136
|
+
question needing human review), and `justification`. Do not score anything yourself.
|
|
137
|
+
This delegation blocks — you read the child's summary from the tool result.
|
|
138
|
+
4. **Record the quiz result with Fito.** Merge the code-scored (step 2) and
|
|
139
|
+
reviewer-scored (step 3) questions into one JSON array of per-question scores,
|
|
140
|
+
write it to a temp file outside the checkout (e.g. `$(mktemp)`) — the submission id
|
|
141
|
+
from step 1 and that path are the two arguments:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
node <fito-case-runner skill dir>/submit-quiz-result.js <submission-id> <scores-file>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
This POSTs to `POST /submissions/{id}/quiz-result`, which records the scores,
|
|
148
|
+
updates the learner's proficiency profile per knowledge component (max-take,
|
|
149
|
+
never regressing — it coexists with the rubric result), and marks the submission
|
|
150
|
+
evaluated. Stream the output. It is safe to re-run: re-POSTing replaces the
|
|
151
|
+
submission's quiz result, so re-running `/fito-submit $1` re-records it.
|
|
152
|
+
|
|
153
|
+
- If it reports the learner is not logged in, have them run `/fito-login`, then
|
|
154
|
+
re-run `/fito-submit $1`.
|
|
155
|
+
- If it reports a 404 for the submission, the id from step 1 was wrong — re-run
|
|
156
|
+
from step 1 to get the recorded submission id.
|
|
157
|
+
|
|
158
|
+
**Done when** it confirms the quiz result was recorded (or the case has no
|
|
159
|
+
`quiz.yaml`).
|
|
160
|
+
|
|
161
|
+
## 6. Show the learner where they landed
|
|
162
|
+
|
|
163
|
+
First, resolve each scored component's canonical **name**. Collect the distinct
|
|
164
|
+
component ids — the rubric `knowledgeComponent` ids from the subagent's JSON array
|
|
165
|
+
and, if you administered a quiz (step 5), the `knowledgeComponents` of every question
|
|
166
|
+
in the merged quiz array you recorded — then run:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
node <fito-case-runner skill dir>/case-component-names.js $1 <component-id...>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
passing those ids. It prints one `<id>\t<label>` line per id, where `<label>` is
|
|
173
|
+
`name (id)` for a component the case declares as a learning objective or prerequisite, or
|
|
174
|
+
the bare id otherwise (`GET /cases/{id}` is public — no login needed). Build an id→label
|
|
175
|
+
map from its output.
|
|
176
|
+
|
|
177
|
+
If that command fails (for example the backend is unreachable), do **not** block the
|
|
178
|
+
feedback — name resolution is additive, and the evaluation is already recorded. Relay
|
|
179
|
+
the summary with the bare component ids instead, and add a brief note that the
|
|
180
|
+
component names could not be resolved (the backend may be unavailable).
|
|
181
|
+
|
|
182
|
+
Then relay the subagent's **learner-facing summary** — one block per criterion: the
|
|
183
|
+
criterion, its knowledge component **labeled by name** (replace the bare
|
|
184
|
+
`knowledgeComponent` id with its label from the map; fall back to the id if absent),
|
|
185
|
+
its Bloom level, the score (`<n>/3` + label), the **proficiency recorded** for that
|
|
186
|
+
component, the `/knowledge/...` link, and the one-sentence justification. Make each
|
|
187
|
+
link clickable by prefixing it with the web origin — read `$FITO_WEB_ORIGIN`
|
|
188
|
+
(`echo $FITO_WEB_ORIGIN`), falling back to `http://localhost:5173` if it is unset.
|
|
189
|
+
|
|
190
|
+
If you administered a quiz (step 5), also relay one block per quiz question — the
|
|
191
|
+
code-scored `multiple_choice` ones and the reviewer's, as you merged them in step 5:
|
|
192
|
+
the prompt, the result, its knowledge component(s) **labeled by name** (same map,
|
|
193
|
+
falling back to the id) with their Bloom level, the **proficiency recorded**, and the
|
|
194
|
+
justification. Show a `multiple_choice` result as met or not met, never as `<n>/3` —
|
|
195
|
+
it scores 2 when correct and 0 when wrong or blank, so `2/3` would show a right
|
|
196
|
+
answer as a lost point. Show an open-ended question's score as `<n>/3`. The
|
|
197
|
+
proficiency recorded is the question's Bloom level at score 2 or 3, `NOT_ACHIEVED` at
|
|
198
|
+
0 or 1: *"Correct — recorded KNOWLEDGE."*, *"Incorrect — recorded NOT_ACHIEVED."* Do
|
|
199
|
+
**not** reveal the correct answer or the question's prompt hint.
|
|
200
|
+
|
|
201
|
+
Frame the proficiency as **recorded**: this submission's rubric and quiz scores set
|
|
202
|
+
each component's proficiency, but the profile keeps the **highest** across attempts
|
|
203
|
+
(and across the rubric and quiz) — so point the learner at the web `/competencies`
|
|
204
|
+
area for their authoritative current level rather than asserting it here.
|
|
205
|
+
|
|
206
|
+
Call out any criterion or quiz question that came back as **needs human review** (a
|
|
207
|
+
`human` method) so they know that part is still open. Then confirm: the PR is open,
|
|
208
|
+
the submission is recorded, and the rubric and any quiz landed.
|