FROM THE DESK OFMERT’S MIND
FIELD NOTE / 004TYPESAFE / JEV
INTAKE, NOT A WRITER

Typed context routing for AI-assisted development with TypeSafe Jev

I built a typed request classifier for a game-asset workflow so the development agent can select relevant context before loading files. Jev reports intent and context bundles; it does not authorize changes.

By TYPESAFE SDK / CHOICE / NOUL6 MIN READ

Project at a glance

Purpose
Select relevant context for an AI-assisted game-asset workflow.
My contribution
Python wrapper, typed intent and bundles, fallbacks, and authorization boundaries.
Status and checks
Development workflow tooling. Thresholds and token savings remain unevaluated; fallback behaviour is documented.
Evidence
Classifier code and an advisory JSON response below.

Toybox builds low-poly parts for Unity: a locked palette, triangle bands, a normalizer, a locomotive, a horse. A request can be any of those, or a question about the workflow. If the agent reads the whole tree before it knows which, most of that reading is waste.

Jev is the intake I put in front of that. TypeSafe asks the questions. A small Python wrapper maps the answers. The agent still writes the code. A label does not authorize the work.

01Classify, then open.

On a new request, or a real change of scope, the agent writes the user text to a temp file and runs the classifier. Chatter does not get a call. The repo, the blends, and the API key stay out of the payload. State is the request, plus an active-task summary if they said “do that.”

INTAKEONE CALL
python tools/classify_request.py --input /tmp/jev-request.json

Stdout is one JSON object. The agent reports a line: source, status, intent, which bundles matched, and whether it will open those paths. It does not paste the body back into the chat.

02The questions are the product.

TypeSafe is doing judgment, not generation. Intent and scope are a Choice over a fixed set of labels. Each context bundle is its own Noul, so several can match. Evidence is a need flag. Jev has not watched the video. It is saying a video would be needed.

FAN-OUTBUILT FROM THE CATALOGUE
intent = Choice(
    instructions="What is the main intent of the user request in state?",
    criteria={
        "explore": "Opinion or discussion. Not implementation.",
        "investigate": "Cause or diagnosis of existing behavior.",
        "implement": "Code or asset changes should be made.",
        "mixed": "More than one intent; keep all of them.",
        "unclear": "Cannot interpret the request.",
    },
)
for bundle in catalogue["bundles"]:
    questions[f"bundle:{bundle['id']}"] = Noul(
        instructions=f"Does this request need the {bundle['id']} bundle?",
        criteria={"true": "Needed.", "false": "Not needed."},
    )

The catalogue is four bundles: locomotive, organic assets, normalize and export, workflow. A piston question should open the loco notes. A mane question should open the horse notes. “Improve the mane and fix the exporter” should open both. Mixed is a legal answer. The classifier is not allowed to drop half of the request.

03Uncertain means keep going, and say so.

Choice confidence under 0.45, an unclear intent, or an ambiguous scope becomes uncertain. Missing key, timeout, or a bad body exits 3 and the agent continues without inventing a class. Both thresholds are labeled unmeasured. I did not pretend a number I had not evaluated was a release bar.

RESPONSEADVISORY
{
  "status": "classified",
  "source": "live",
  "intent": "implement",
  "matched_bundles": ["normalize_export"],
  "evidence": {"needs_visual": false, "needs_code": true, "media_inspected": false},
  "mandatory": ["AGENTS.md"],
  "authorizes_work": false
}

authorizes_work is always false. Hostile text in the request does not become a command. An unknown bundle id is a diagnostic, not a path. A catalogue path that tries to escape the repo is rejected. The SDK logger is pinned above DEBUG and filtered so a request body does not land in a log.

04Select relevant files before loading context.

The live call is an 8 second timeout and one retry, inside a 12 second budget. That is the cost. The return is a short list of paths instead of the agent reading every design note, every contract, and the horse brief to answer a question about a wheel.

I am not going to quote a token saving. The live evaluation is a separate run, and the setup says not to claim one that was not measured. What I can say is the shape: one typed fan-out, a fallback that does not block the task, and a hard line between “this looks like the exporter” and “go change the exporter.”

END OF NOTE / 004RETURN TO THE INDEX ↑