task(ai, spec) from @bijectionhq/library-models declares one bounded
model call: the catalog entry, instructions, an input type, an output type
and the prompt builder.
bijection/triage.ts
task.submit(ctx, input, { once, then, within })refuses input that does not conform toinput.task.check(result)answersokwith the typed value,InvalidOutputwith the first problem and the raw answer, or the call’s own refusal. The model’s answer is untrusted: nothing is written until you check it.task.resultis the type the continuation declares for itsresult.task.definition.digestcovers the name, revision, model entry, instructions, both types and the bounds. Store it beside a result to know what produced it. Thepromptfunction’s code is not covered: change the revision when it changes.
jsonSchema(type) and problem(type, value) derive a model contract from
a value type and check a value against it, for your own structured
generations.
Screen untrusted content
screen(content, { mode }) runs deterministic rules over text before it
reaches a model: instruction override, role reassignment, system
impersonation, secret exfiltration, tool invocation, markdown exfiltration
and hidden characters. With mode: "block", matched content is withheld
(verdict.finding). screenCheck(verdict) turns a verdict into a
checks record of kind
injection-screen, whose subject is the content’s SHA-256: it carries the
digest and the rules, never the content.