AI Assistance
Some queries are answered through a model that picks tools to gather facts and compose the answer. This page states the closed tool set, the structure-only scenarios, the pinned stub, and the provenance those queries carry. A project selects it for each query a model mediates.
On this page
Activation#
Activation scope: local.
Applicable specification kinds: use-case.
A project selects ai for a query when a model mediates the answer by calling tools. A query answered by fixed code does not select it, even when a model wrote that code.
Baseline Relationship#
This extension replaces no baseline provision. It switches on no record type: it adds model mediation detail to query records.
A model-mediated query names its closed tools set, proves itself with structure-only scenarios, pins a deterministic stub in Proof, and returns provenance with its output.
Standards#
Name the Closed Tool Set#
rulerequiredguidancelitespec/ext/ai#name-the-closed-tool-setA model-mediated query MUST name the closed set of tools the model calls.
Applies toartifact: record:use-case
Why
A model with an open tool set invents tools, reaches past its grant, and surprises every review. A closed set names exactly what the model touches, so the grant, the tests, and the audit all read the same list.
Example
The support answer query names orders.lookup and docs.search as its only tools.
Checka reviewer answers
Reviewed forWhich mediated queries call a tool outside their closed tool set? Look at each query's tool set beside the tool calls its tests record.
Marked guidance: a reviewer answers this question.
Refuse Unknown Tools#
rulerequiredguidancelitespec/ext/ai#refuse-unknown-toolsA model-mediated query MUST refuse a run that calls a tool outside its closed set.
Applies toartifact: record:use-case
Why
Models drift: a prompt tweak or a version change can add a call nobody declared. Refusing the run at the first unknown tool keeps the closed set closed in production, not just on paper.
Example
A run that calls billing.refund outside its set is refused before the call leaves the product.
Checka reviewer answers
Reviewed forWhich mediated query tests allow a run to call a tool outside the closed set? Look at the refused-run tests.
Marked guidance: a reviewer answers this question.
Assert Structure and Never Wording#
rulerequiredguidancelitespec/ext/ai#assert-structure-and-never-wordingA scenario for a model-mediated query MUST assert the output structure and never its wording.
Applies toartifact: record:use-case
Why
Model wording shifts between runs: the same facts arrive in different sentences. A scenario asserting exact words fails on a paraphrase, while a scenario asserting structure, fields, codes, and cited sources passes on every true answer.
Example
The scenario asserts the answer carries orderId and one cited source, not the sentence around them.
Checka reviewer answers
Reviewed forWhich mediated query scenarios assert exact words instead of fields, codes, and cited sources? Look at the scenario assertions.
Marked guidance: a reviewer answers this question.
Pin a Deterministic Stub in Proof#
rulerequiredguidancelitespec/ext/ai#pin-a-deterministic-stub-in-proofProof for a model-mediated query MUST run against a deterministic stub pinned by version.
Applies toartifact: test
Why
A live model answers differently each run, so a test against it proves nothing twice. A deterministic stub pinned by version answers the same way every run, so Proof checks the product's handling instead of the model's mood.
Example
The support answer tests run against stub-answers v4, which returns one fixed tool trace per prompt.
Checka reviewer answers
Reviewed forWhich mediated query tests call a live model instead of the pinned stub version? Look at the test configuration beside the stub version.
Marked guidance: a reviewer answers this question.
Record Provenance in the Output#
rulerequiredguidancelitespec/ext/ai#record-provenance-in-the-outputA model-mediated query MUST return provenance naming the model, the tools called, and the sources read.
Applies toartifact: record:use-case
Why
An answer without provenance cannot be checked: nobody knows which model wrote it, which tools fed it, or which sources back it. Provenance names the three, so every answer carries its own audit trail.
Example
The answer returns model: support-7, tools: [orders.lookup], sources: [order-8841].
Checka reviewer answers
Reviewed forWhich mediated query answers lack the model, the tools called, or the sources read? Look at the provenance on each answer.
Marked guidance: a reviewer answers this question.
Bound Tool Calls per Query#
rulerequiredguidancelitespec/ext/ai#bound-tool-calls-per-queryA model-mediated query MUST bound how many tool calls one run makes.
Applies toartifact: record:use-case
Why
A model in a loop calls tools until the budget or the patience runs out. A bound on calls per run caps the cost and the latency up front, so one curious run cannot spend the month's budget.
Example
The support answer query allows eight tool calls per run and refuses the ninth.
Checka reviewer answers
Reviewed forWhich mediated queries state no per-run tool-call bound, or exceed it in the run tests? Look at the query definitions beside the run tests.
Marked guidance: a reviewer answers this question.
Conventions#
Record Every Model Run#
conventiondefaultguidancelitespec/ext/ai#record-every-model-runEach model run writes its prompt hash, the tools called, and the outcome to the run log.
ReplacementA project names its model-run evidence in its AI documentation.
Applies toartifact: query-handler
Why
Production answers need after-the-fact review: what was asked, what the model touched, and what came back. The run log holds the three without storing full prompts.
Checka reviewer answers
Reviewed forWhich run log entries lack a prompt hash, the tools called, or an outcome, with no other evidence named in the AI documentation? Look at the run log.
Marked guidance: a reviewer answers this question.
Dependencies#
Packages: None.
Related extensions: mcp for the server shape when the product also serves tools to outside models.
Guides: None.