# Supervised Capability Curriculum

AgInTiFlow should be trained and verified by supervising real tasks, not by trusting the agent's final summary. Each curriculum run uses a clean project under `~/ProjectsLFS/Aginti-Test/`, runs AgInTiFlow through a persistent tmux session, and verifies artifacts from outside the agent.

Use `scripts/supervision-ledger.js` and
`docs/supervision-campaign-ledger.md` for the machine-readable campaign record.
The Markdown homework ledger remains the compact human handoff; it does not
replace the SQLite evidence record.

## Verification Contract

Every supervised task must end with independent checks:

- Inspect `git status --short`.
- Verify output files exist with `test -s`, `ls -lh`, `file`, or a domain-specific checker.
- Read `~/.agintiflow/sessions/<session-id>/events.jsonl` for actual tool calls when claims matter.
- For screenshots, PDFs, images, APKs, reports, and archives, keep a durable workspace path unless the user explicitly requested only a temporary preview.
- Commit intentional project changes or explicitly report why the worktree is not clean.

## Task Families

| Profile | Example supervised task | Required evidence |
| --- | --- | --- |
| `auto` | Mixed request: inspect a messy folder, infer the purpose, write a report, run checks | Correct profile inference, durable files, useful checks, clean git status |
| `code` | Add a CLI feature with tests | Patch diff, focused test output, git status |
| `large-codebase` | Fix a cross-file bug in a generated multi-package repo | Codebase map, targeted reads, focused then broader checks |
| `qa` | Build or repair a realistic testing project | focused check output, useful regression coverage, clean runnable test suite |
| `database` | Fix a schema/query/migration bug in a local SQLite app | migration/query evidence, no data-loss ambiguity |
| `devops` | Diagnose a broken Docker/service/CI setup without sudo | read-only evidence, idempotent fix, health/log check |
| `security` | Review a small app for auth, path, secret, or shell risks | findings, patch or report, no secret leakage |
| `data` | Clean messy CSV/JSON data and generate a report | raw preserved, cleaned output, validation script |
| `docs` | Write source-backed README/API/tutorial docs | source reads, docs files, verified commands/examples |
| `app` | Build a small usable app from scratch | Real app files, build/preview/install check, durable screenshot or demo |
| `website` | Build a polished landing page or dashboard | Preview works, screenshots/artifacts saved, responsive layout |
| `node` | Build/test a Node or TypeScript package | package manager detected, script/test output |
| `python` | Write a package/script/notebook-style analysis | Python check/test, output artifact if generated |
| `c-cpp` | Build a small CMake/Make project and fix a compiler error | Compiler output, binary/test result |
| `r-stan` | Run a reproducible R/Stan/statistics analysis | Rscript/CmdStan evidence, saved plot/report |
| `android` | Build, install, launch, screenshot an Android app | Gradle build/test, adb install/launch, durable screenshot |
| `ios` | Build/test a SwiftUI or SwiftPM app/library | swift/xcodebuild evidence or signing/Xcode blocker, durable screenshot if simulator exists |
| `java` | Repair a Maven/Gradle Java service or library | wrapper/build files inspected, compile/test output |
| `go` | Fix a Go module with CLI/server tests | gofmt, focused `go test`, binary or smoke output |
| `rust` | Fix a Cargo crate/workspace bug | cargo fmt/check/test evidence |
| `dotnet` | Repair a .NET/C# app or library | dotnet restore/build/test evidence |
| `php` | Fix a Composer/Laravel-style app | php lint/test or framework command output |
| `ruby` | Fix a Ruby/Rails/gem project | bundle/rake/rspec evidence |
| `latex` | Write and compile a paper/report | `.tex` source, PDF, compile log/pass evidence |
| `paper` | Draft a research manuscript with sources and figures | Outline/source notes, manuscript file, figure/PDF when available |
| `research` | Research a current technical topic | Source list, dated notes, clear evidence/inference split |
| `writing` | Write a structured article/script | Durable draft file, outline/revision notes |
| `book` | Plan and draft a chapter | Chapter map, chapter file, continuity notes |
| `novel` | Draft a scene/chapter with character continuity | Story bible or continuity notes, chapter file |
| `design` | Produce an engineering/product design doc | Options/tradeoffs, decision, verification criteria |
| `slides` | Create a pitch deck, lecture deck, or poster | outline, slide source, exported/previewable artifact |
| `education` | Create lesson materials with exercises and answers | learner objective, examples, exercise checks |
| `image` | Generate an image with GRS AI or Venice | Manifest, generated image path, canvas preview |
| `word` | Create/convert/edit a `.docx` style document | Input backup, output file, converter/tool evidence |
| `github` | Commit/push/open PR or fix CI | status/diff first, gh/git output, conflict handling |
| `shell` | Write and run a maintenance script | read-only diagnosis first, script syntax/check output |
| `maintenance` | Diagnose/fix an environment/toolchain/system issue | evidence log, reversible commands, no silent host mutation |
| `aaps` | Work with AAPS project conventions | `.aaps`/project files inspected, assumptions documented |

## Supervision Loop

1. Start or reuse a named tmux session in the supervised project.
2. Give AgInTiFlow a normal user-level task, not a full implementation recipe.
3. Poll the pane and session events until it finishes, blocks, or loops.
4. If a reusable capability is missing, patch AgInTiFlow itself: profile, skill, tool, policy, prompt, UI, docs, or tests.
5. Publish/install the updated AgInTiFlow build when possible, resume the same session, and ask it to continue.
6. Record the result, missing capability, fix, and verification evidence.

## Workspace Layout

Future supervised homework should live under `~/ProjectsLFS/Aginti-Test/`:

```text
~/ProjectsLFS/Aginti-Test/
  HOMEWORK.md
  TASK-Profile-Auto/
  TASK-Profile-Code/
  TASK-Profile-Large-Codebase/
  TASK-Profile-App/
  TASK-Profile-Website/
  TASK-Profile-Paper/
  TASK-Profile-Research/
  TASK-Profile-Supervision/
```

Durable example records should be copied into the AgInTiFlow repo under `aginti-work-examples/`.

## Recursive Supervision

The `supervision` profile and `supervision-student` skill are for training AgInTiFlow to be a better supervisor, not only a better worker. In recursive supervision:

1. A student AgInTiFlow session performs a real task.
2. A supervisor AgInTiFlow session monitors the student, verifies artifacts, and records flaws.
3. Codex supervises the supervisor, checking whether it used evidence rather than belief.
4. Repeated misses become AgInTiFlow upgrades.

Use this only with explicit workspace boundaries and clear permission mode. The supervisor may request code/tool/profile improvements, but should not silently mutate unrelated projects.

## Current Lesson From Android Supervision

Canvas preview alone is not proof that an artifact was saved. AgInTiFlow now persists canvas file paths into session artifacts and its Android workflow asks for durable screenshot paths. Supervisors must still verify the workspace file or session artifact exists before reporting success.

## Current Lesson From Auto Supervision

For vague daily tasks, `auto` must borrow specialized habits without being told. The Pocket Greenhouse homework exposed two quality gates: generated output must be inspected and polished, not merely described, and final hygiene claims must use stack-specific recursive checks. AgInTiFlow now explicitly asks the model to fix obvious duplicates/noisy rows/stale summaries and to check Python transient files recursively before claiming none exist.

## Current Lesson From Code Supervision

The Pocket Ledger homework exposed that an explicit `code` profile should not be treated as a cheap short-turn route when the prompt asks to repair a repo and leave it clean. AgInTiFlow now routes `code` work to the complex model by default, gives it a larger cleanup budget, and tells it to prioritize functional checks when optional lint expands scope. The run also exposed that one-shot CLI defaults were overriding `SANDBOX_MODE=host`; env sandbox defaults are now covered by smoke tests.

## Current Lesson From Large-Codebase Supervision

The Checkout Workspace homework proved the large-codebase profile can repair cross-package failures from a vague prompt, but the first tmux run exposed launch fragility: an old tmux environment selected an inaccessible OpenAI model even though the intended route was DeepSeek. AgInTiFlow now has explicit language/platform profiles and a supervised homework seeder, and CLI defaults respect profile/model-role environment variables more consistently. Supervisors should still verify provider/model at launch before sending the project prompt.
