Parametric learning in your code harness.
machine docs commands.md

machine commands #

/good [note] #

Save the latest user turn as a good trace: user, assistant prose, tool calls, and tool results.

/good
/good --as "Go to Settings → Security → Reset password."

Default destination: the project's traces.jsonl in the Machine store. Run /machine data to see the path. Observed Pi reasoning is never saved. When a correction is pending, /good injects the approved reasoning as a structured {type:"thinking", thinking:"..."} part on the first assistant target, then runs a save-time hygiene gate. /good does not prove model/renderer compatibility; that is enforced at /train validate and /train sft for the selected --model.

The JSONL row contains:

  • messages — Tinker chat JSONL, including OpenAI-style tool_calls[].function and optional structured thinking parts
  • kind: "trace"
  • tag: "good", source, entryIds
  • correctionId when linking a pending correction

Plain legacy good traces without thinking remain valid.

/correction [note] #

Same shape as /good, same file, tag: "bad" so /train skips it. The note is a diagnosis, not a teacher instruction. Machine asks the remembered work model (or the current non-Tinker model) for one bounded interpretation of the diagnosis and rejected turn, receiving proposed trainable reasoning plus behavior, applicability, and verifier fields. That call uses modelRegistry.complete only — no tools, no session switch — and caps output near 280 tokens. /correction may therefore incur one teacher request. If no teacher is available or the response is invalid, a deterministic fallback is used instead. --reasoning "..." overrides the proposed trainable reasoning. Bare --reasoning (no value) is rejected. --behavior is not supported.

If a proposal refers to your correction or an earlier answer, Machine asks the teacher to rewrite it once (a second bounded request, max 200 tokens) rather than discarding it. The rewrite must preserve task facts while removing the feedback attribution. A failed rewrite retains the proposal for review and requires an edit before retrying, so task facts remain visible. The ledger records the outcome. Reasoning supplied with --reasoning is never rewritten. Every path still refuses a pasted teacher wrapper.

The TUI shows the reasoning proposal so you can accept, edit, or decline before retrying. It then offers to retry the original prompt with the teacher (remembered /machine work model) in a new session, not a fork. The missed answer is gone; approved reasoning becomes a hidden teacher wrapper and never enters student-facing messages. --retry forces that; --stay only saves; --decline keeps the rejected trace without accepting the proposal. Headless --stay uses the deterministic fallback and makes no interpretation call; headless --retry uses the teacher when configured.

Pending correction state survives the new session and /reload. The next /good injects approved reasoning, runs hygiene, and links to that correction.

The /good gate is deterministic and offline: it makes no model call. It blocks hidden-wrapper wording and diagnosis wording attributed to feedback or an earlier attempt. It permits standalone task facts from a diagnosis and ordinary reasoning about retries, prompts, or instructions. The rewrite pass during /correction handles phrasing that needs a model. The removed --scope and --retain flags are rejected. /bad is an alias.

/corrections [id] #

List recent correction ledger rows, or show one id in detail. Rows show correction/contribution evidence for this project. They do not claim an active reusable contributor across traces in this slice. The ledger lives in the project Machine store (corrections.jsonl) and keeps diagnosis, proposed and approved reasoning, edits, source/target provenance, state, and timestamps.

/tagged #

List recent rows from the project's traces.jsonl pool.

/machine auto #

Save the span Pi is about to compact as an unlabeled full trajectory.

/machine auto          # toggle
/machine auto on
/machine auto off
/machine auto status

Off by default. /machine auto on persists the setting for the current project. Two automatic writes go to the same traces.jsonl pool:

  • Compaction: session_before_compact writes the span before firstKeptEntryId with kind: "auto-compact".
  • Headless exit: when pi -p or --mode json finishes a real prompt (session_shutdown reason quit), the last user turn is written with kind: "auto-headless". Slash-command-only runs (/train, /good, …) are skipped.

Observed reasoning is omitted. /machine auto off disables both.

Automatic rows use tag: "observed" in the same pool. Completion and compaction are evidence that work happened, not judgments that the behavior was good. /train trains only tag: "good" rows.

/machine data #

Show the current project's Machine store, automatic-capture setting, pool path, and tag counts.

Machine stores data outside the working tree by default:

  • All platforms: ~/.machine/<project>-<hash>

Set MACHINE_DATA_DIR to override the base directory. Full trajectories can contain tool output and private source material; inspect them before training or copying them.

Versions before 0.2.0 used a project-local data/ directory. Machine leaves existing files in place; pass one explicitly to /train or move reviewed rows yourself.

/machine work and /machine student #

Flip between the daily driver and the student (Tinker) lane.

/machine student                    # Inkling-Small, or latest /tinker use checkpoint
/machine student Qwen/Qwen3.8-27B:peft:262144
/machine student thinkingmachines/Inkling-Small:peft:262144
/machine work                       # back to Grok / last non-Tinker model

/machine student remembers the current non-Tinker model in this project's settings. /machine work switches back to it. Checkpoints registered with /tinker use are preferred over thinkingmachines/Inkling-Small when no id is passed. HuggingFace-style Tinker ids (Qwen/…, thinkingmachines/…, tinker://…) do not need a tinker/ prefix.

Machine registers the Tinker chat catalog itself (Inkling, Qwen3.8-27B 64K/256K, and /tinker use checkpoints). pi-tinker is no longer required.

Train on Qwen 3.8-27B with /train sft --model Qwen/Qwen3.8-27B. Chat the 256K peft id after /reload. Cookbook main maps that id to the qwen3_8_* renderer family (qwen3_8_xhigh_reasoning by default). PyPI tinker-cookbook 0.5.4 does not know the model yet, so /train validate will KeyError until the venv is upgraded past that release.

/machine student Qwen/Qwen3.8-27B:peft:262144

See tinker/commands.md for /tinker.

/train validate [jsonl] #

Lightweight JSONL checks, plus Python renderer/token-mask validation when tinker-cookbook is installed.

/train validate
/train validate /path/to/reviewed-traces.jsonl --model thinkingmachines/Inkling-Small --quick

The default file is the project's traces.jsonl pool. /train uses good rows and skips bad / observed.

/train prefers .venv/bin/python in the current project, then the machine package venv, then python3.

Thinking traces must use a renderer that preserves structured thinking without flattening ThinkingParts. /train validate and /train sft run an actual renderer execution check against the selected --model via model_info.get_recommended_renderer_name(model). Observed support in this slice includes Inkling tml_v0 (<|content_thinking|>) and Qwen native <think>...</think> channels; every model is still checked by execution. Missing optional renderer dependencies are a block for thinking datasets, not a skipped pass. Plain legacy good traces without thinking remain compatible with non-thinking renderers. The thinking gate inspects every thinking row; ordinary token-stat sampling may still cap non-thinking rows. Training expands each conversation into one full-prefix LAST_ASSISTANT_MESSAGE target per assistant turn so tool-call traces stay safe on renderers without sequence extension.

/train sft [jsonl] #

Write train_sft.py and tinker.yaml into the project Machine store for Tinker Cookbook SFT. Thinking datasets are blocked unless the selected --model passes the structured-thinking renderer check. The generated train_sft.py repeats that check before any training client is initialized. Each conversation expands into one LAST_ASSISTANT_MESSAGE target per assistant turn. When a test split is configured, --test-size counts source conversations (not expanded target rows); all targets from one source stay on the same side of the split.

/train sft
/train sft /path/to/reviewed-traces.jsonl --model thinkingmachines/Inkling-Small --force
/train sft --epochs 10 --steps 60

Training runs at most one epoch by default; small datasets often need --epochs N for the format to stick before --steps can take effect.

/train run [--yes] #

Run the store's train_sft.py. This creates a real Tinker training client.

/train run --yes
/train run --steps 2 --yes

Without --steps, the scaffolded max_steps is used. --steps 2 is a short run to prove the loop. After a run, Machine keeps the new sampler and one rollback sampler, and deletes training-state weights unless --keep.

/train eval #

/train eval init --force
/train eval baseline --yes
/train eval checkpoint tinker://.../sampler_weights/... --yes
/train eval compare eval-baseline.json eval-checkpoint.json

Status line (Pi) #

Pi paints a compact Machine footer next to other extension statuses:

  • last turn untagged after a reply that has not been /good or /correction
  • last: good or last: correction just after a judgment
  • student when the Tinker lane is active
  • auto when automatic observation is on
  • quiet N good count from this project's pool

The line hides when there is nothing to report.