A successful AI search is not a complete operating record until the workflow proves its scope, continuation state and terminal condition.
Deck: A successful tool call proves that an AI agent received a response. It does not prove that the response covered the full operating population. Before an agent can conclude that no work order, access exception or customer record exists, the architecture must prove query scope and terminal completion.
An AI agent searches a facility system for open gate work orders. The tool returns 50 records and an HTTP success. None concerns the west gate, so the agent reports that no related work order exists and recommends opening a new one.
There is a 51st record. It sits on the next page.
The model did not hallucinate the first 50 records. The connector did not fail. The system can preserve a clean trace, a valid response and a fluent explanation while reaching the wrong operating conclusion. The failure happened in the space between “the query ran” and “the search was complete.”
That boundary matters in self-storage because negative conclusions often change work. “No open work order” can create a duplicate dispatch. “No active access exception” can send a customer through the wrong support path. “No unresolved inspection” can make equipment appear available. “No matching payment case” can shift a conversation before an authorized employee has reviewed the governing record.
A responsible AI architecture must treat query coverage as a release condition. The agent should not be allowed to convert one successful page into a statement about the entire population.
A tool response is not a search receipt
Tool integrations often expose a compact result to the model: a status, an array of records and perhaps a text summary. Important query mechanics may be hidden in headers, wrapper objects or connector code. The model may never see the page limit, continuation token, total estimate, permission scope or warning that the backend stopped early.
The result can therefore be technically valid and operationally incomplete.
Google's approved API pagination guidance illustrates the problem clearly. A service may return fewer items than the requested page size, including zero, even when the collection has not ended. Under that design, an empty next_page_token is the end-of-collection signal; the number of rows on a page is not.[^1] Google's client-library guidance describes automatic pagination as continuing otherwise identical requests until that token is empty.[^2]
Those documents are API design guidance, not self-storage operating rules. Their useful lesson is narrower: completion must be established using the contract of the specific source. An agent cannot infer completeness from a familiar-looking array.
GitHub's REST documentation provides another implementation example: larger responses are paginated, and navigation links identify additional pages when available.[^3] The mechanism differs from a token-based API. That variation is exactly why the connector—not the language model—must understand and enforce the endpoint's completion contract.
Define the population before asking whether something is absent
“Search for an open gate work order” sounds specific until the system has to execute it. Which facility identifier governs? Which work-order types count as gate work? Does open include assigned, waiting on parts and reopened? Is the search limited to records created this year? Are archived records excluded? Is the operator permitted to see vendor-managed tickets? Does the endpoint search the description, structured asset field or both?
These questions define the population. Pagination only proves that the agent traversed the pages returned by that definition. It cannot repair a wrong filter, incomplete permission scope or bad identifier.
Before the call, create a query contract with:
- the business question and the consequence of a false negative;
- the organization and facility identifiers;
- the source system, endpoint and version;
- the structured filters, sort order and time boundary;
- the authenticated role and visibility scope;
- the expected record states and semantic definitions;
- the page or batch limit;
- the source-specific continuation rule; and
- the conditions that require handback instead of a conclusion.
The model may help translate a manager's question into that contract, but it should not silently choose the operating definition. For consequential searches, approved code or a governed query template should bind the fields.
Preserve four different outcomes
Search workflows become unsafe when they collapse distinct states into found=true or found=false. Preserve at least four outcomes.
Match found means one or more returned records satisfy the defined query and evidence rules. It does not by itself establish what action is authorized.
No match in a complete population means the query contract was valid, every required page or partition was traversed, the terminal condition was observed, permissions were sufficient for the defined purpose, and no qualifying record appeared.
No match in an incomplete population means the records seen so far contain no match, but coverage is not complete. A continuation token, timeout, rate limit, partial-response warning, expired cursor, permission gap or unsearched partition remains.
Search invalid means the contract itself is unreliable: the facility identity is unresolved, the status vocabulary changed, the endpoint does not support the necessary filter, or the requested purpose exceeds permitted access.
Only the second outcome supports a bounded negative conclusion. The other two negative-looking states require a hold, a narrower statement or human handback.
The language should preserve that difference. “No matching record was returned in the first 50 results” is honest evidence. “No record exists” is a population claim and needs stronger proof.
Make pagination deterministic and observable
Do not ask the model to notice whether it should call the tool again. Put traversal in the connector or orchestration layer.
The component should submit the governed filters, capture the response metadata, accumulate record identifiers, follow the exact continuation mechanism and stop only when the endpoint's documented terminal condition is satisfied. It should also apply guardrails: maximum pages, maximum elapsed time, repeated-token detection, duplicate-record detection and rate-limit handling.
Those guardrails create another important distinction. A maximum-page limit is a safety control for the integration; hitting it is not evidence that the collection ended. The outcome becomes incomplete and must say why.
Record enough information to reproduce the search without copying unnecessary customer content into the trace:
- query-contract identifier and version;
- source and endpoint version;
- facility and organization scope;
- normalized filter and sort digest;
- authenticated role or service identity reference;
- request, page and record counts;
- continuation-token presence and a protected token reference or hash;
- terminal-condition code;
- partial-response, timeout and rate-limit flags;
- duplicate and unstable-order observations;
- start, end and source-as-of times; and
- final coverage disposition.
Tokens can carry source state and may be sensitive. Preserve only what the approved diagnostic process needs. A token is also not authorization. Each subsequent request must still pass the source's access controls.
Guard against a collection that moves during the search
Even perfect pagination can traverse a changing population. A new work order may be created while the agent moves from page one to page two. A record can change status and shift position under a modified_at sort. Offset-based pagination can skip or repeat records when earlier rows are inserted or removed.
Where the source supports a stable snapshot, cursor or bounded as_of time, use it. Preserve that identity with the receipt. If it does not, choose an explicit consistency rule appropriate to the consequence. That might mean querying a closed time interval, sorting on a stable key, deduplicating by record identifier, rerunning boundary pages or handing a high-impact negative result to a person.
Do not advertise snapshot consistency when the source does not provide it. A complete walk of an unstable collection is evidence of what the connector observed across that interval, not proof of one frozen database state.
The architecture should also detect a cursor that expires mid-search. Restarting from page one may be appropriate for a low-consequence read, but it creates a new search episode. Keep the failed attempt and its reason instead of stitching two different populations into one apparently clean receipt.
Test negative conclusions, not just successful calls
Integration testing often proves that the connector returns a known record. That is necessary but weak. The dangerous cases are the ones in which a record is absent from the agent's visible page but present elsewhere in the eligible population.
Build tests that place the qualifying record:
- on the first page, a middle page and the last page;
- immediately beyond the default page limit;
- inside each permitted status and time partition;
- behind a role that should and should not see it;
- near an insertion or status change during traversal; and
- after a temporary empty page that still has a continuation token.
Also test malformed, repeated and expired tokens; rate limits after partial progress; endpoints that return a total estimate rather than an exact count; and connectors that truncate the model-facing result even after retrieving every page.
The pass condition is not merely “the record was eventually found.” The system must classify coverage correctly, preserve the query contract, refuse an unsupported negative conclusion, and disclose the limitation to the reviewer.
NIST's Generative AI Profile recommends documenting knowledge limits and upstream dependencies and evaluating data and content flows through a generative-AI system.[^4] The AI Risk Management Framework also calls for documenting data selection, system context, human oversight and third-party components.[^5] Neither source specifies this pagination architecture or certifies a facility workflow. They support the broader discipline: an AI output should be interpreted in light of the actual system and evidence path that produced it.
A fully fictional facility example
Consider Maple Span Storage, a fictional facility. Every company, facility, person, system, identifier, record and outcome in this example is invented.
A fictional support agent asks an AI assistant whether a current gate problem already has an open maintenance record. The governed query contract uses facility MSS-FIC-04, the structured gate asset category, four qualifying work-order states and the approved service identity. The source endpoint returns 25 records per page, newest first.
The first response contains 25 unrelated open records and a continuation token. A naive agent would summarize the page and answer no. The governed connector records coverage=incomplete, follows the token and retrieves page two. Record WO-FIC-1051, created earlier but still waiting on a fictional part, matches the gate asset and qualifying status.
The connector returns a search receipt with two pages, 37 distinct records, the terminal token state and the matching record reference. The model may now summarize the match for human review. It still may not dispatch a vendor, close the record or tell a customer that repair is complete. Search coverage, record meaning, action authority and operating readback remain separate.
In a second test, the continuation request times out. No gate record appears on page one. The outcome is not no_match; it is incomplete_timeout_after_page_1. The assistant says that it could not complete the search and hands the case to the designated role. That response is less polished than a confident answer and more useful than a false absence.
This fictional example demonstrates control logic only. It is not a modSTORAGE or Facily.ai deployment, product capability, incident, customer result or performance claim.
Use the AI Tool-Query Coverage and Negative-Conclusion Test
The companion tool creates one row per search episode and, when needed, linked page rows. It records the business question, false-negative consequence, facility scope, source, filter digest, visibility role, page behavior, traversal totals, terminal evidence, consistency model, interruptions, matching references, coverage disposition, permitted statement, reviewer and release state.
Use four release states:
- Hold: scope, identity, permissions, traversal or consistency evidence is incomplete.
- Limited: the system may state only what appeared in the observed subset.
- Complete: the source-specific terminal condition and query contract support a bounded result.
- Reconciled: any downstream action has its own authorized execution receipt and required operating readback.
The test does not prove that the source data is correct, that a record's text is true, that the user has legal authority, or that a facility condition exists. It proves something narrower and necessary: the system can distinguish a returned page from a completed search.
Absence is an earned conclusion
An AI agent should not receive more confidence than its tool path earned. A 200 response is not a complete population. An empty page is not necessarily the end. A total can be an estimate. A cursor can expire. A role can hide records. A moving collection can skip them. A connector can retrieve every page and still truncate what reaches the model.
Define the population. Bind the filters and identity. Traverse pagination outside the model. Observe the terminal condition. Record interruptions and consistency limits. Test false negatives at every boundary. Then allow only the statement supported by the receipt.
The question is not whether the AI searched. The question is whether the architecture can prove what the search covered before the answer changes facility work.
Sources
[^1]: Google, AIP-158: Pagination, approved API Improvement Proposal, updated July 8, 2025; accessed October 18, 2026.
[^2]: Google, AIP-4233: Automatic pagination, approved client-library guidance; accessed October 18, 2026.
[^3]: GitHub, Using pagination in the REST API, official product documentation; accessed October 18, 2026.
[^4]: National Institute of Standards and Technology, Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile (NIST AI 600-1), July 2024; accessed October 18, 2026.
[^5]: National Institute of Standards and Technology, AI RMF Core, official AIRC presentation of AI RMF 1.0 outcomes; accessed October 18, 2026.
Author
Jared Mastroianni is Chief Operating Officer of modSTORAGE and CEO and Founder of Facily.ai.
Editorial disclosure
AI assistance supported source discovery, drafting, comparison, tool construction and editorial QA. The architecture, fictional example and companion test are editorial proposals, not evidence of a product feature, deployment, customer result, legal requirement, certification or industry standard.
Companion operating tools
These governed companion materials are rendered accessibly because this WordPress instance does not accept the source Markdown and CSV files as media uploads. Blank templates and fictional examples are operating aids, not proof of a real facility event, deployment, customer, result or compliance state.
ai tool query coverage and negative conclusion test
Use this tool before an AI-assisted workflow converts a search result into an operating conclusion. Create one search-episode row in the CSV template and one page row for every response page. Do not place credentials, access codes, payment data or unnecessary customer content in the register.
Required decisions
- Define the population. Record the facility and organization scope, endpoint, semantic status definitions, filters, time boundary, sort and authenticated visibility role.
- Name the false-negative consequence. State what could happen if a qualifying record exists but the search reports none.
- Specify the completion contract. Identify the source's continuation mechanism and exact terminal condition. Row count alone is not a completion rule unless the source contract says it is.
- Traverse outside the model. The connector or orchestration layer, not prose generation, should follow pages and enforce guardrails.
- Classify coverage. Use
match_found,no_match_complete,no_match_incompleteorsearch_invalid. - Limit the statement. If coverage is incomplete, describe only the observed subset and the interruption.
- Keep action authority separate. A complete search does not authorize a work order, customer message, access change, payment action or closure.
Release states
| State | Meaning | Permitted next step |
|---|---|---|
| Hold | Identity, query contract, permissions, traversal, consistency or terminal evidence is incomplete | Correct the contract, restart as a new episode or hand back |
| Limited | A defined subset was observed but the full population was not proven | State only the subset and limitation; no population-wide negative conclusion |
| Complete | The source-specific terminal condition and governed query contract support a bounded result | Present the result for the separately authorized decision |
| Reconciled | A downstream authorized action has its own execution receipt and required source readback | Close the linked action under its governing workflow |
Minimum test cases
- qualifying record on first, middle and final pages;
- qualifying record one position beyond the default limit;
- empty intermediate page with a continuation token;
- timeout, rate limit and expired cursor after partial progress;
- repeated token and duplicate record across pages;
- changed status or insertion during traversal;
- role with insufficient visibility;
- connector retrieves all pages but truncates the model-facing payload; and
- no-match result with a proven terminal condition.
Claim boundary
Passing this test does not prove source accuracy, record truth, legal compliance, facility condition, action authority, execution or operating outcome. It establishes only that the workflow represented query scope and completion honestly for the tested source contract.
ai tool query coverage fictional example
ai tool query coverage fictional example — record 1
- episode id
- QRY-FIC-001
- episode status
- completed
- business question
- Is there an open gate maintenance record?
- false negative consequence
- Duplicate dispatch or conflicting work
- organization ref
- ORG-FIC-MAPLE
- facility ref
- MSS-FIC-04
- source system
- fictional maintenance system
- endpoint or view
- fictional work-order list endpoint
- endpoint version
- v3
- query contract id
- QCON-FIC-GATE-01
- query contract version
- v2
- semantic definition ref
- STATUS-FIC-MAINT-v4
- filter digest
- sha256-fictional-filter-001
- filter summary
- facility=MSS-FIC-04; asset_category=gate; status in assigned|waiting_parts|reopened|open
- sort order
- created_at desc; record_id asc
- time boundary
- all active qualifying records
- authenticated role ref
- fictional approved service role
- visibility scope
- MSS-FIC-04 maintenance records
- page size
- 25
- maximum pages
- 10
- continuation mechanism
- next_page_token
- terminal condition
- empty next_page_token
- consistency model
- source_cursor
- source as of
- 2026-10-18T17:45:00-04:00
- start time
- 2026-10-18T17:45:02-04:00
- end time
- 2026-10-18T17:45:05-04:00
- page count
- 2
- raw record count
- 37
- distinct record count
- 37
- duplicate record count
- 0
- continuation observed
- yes
- terminal observed
- yes
- partial response flag
- no
- timeout flag
- no
- rate limit flag
- no
- repeated token flag
- no
- expired cursor flag
- no
- permission gap flag
- no
- model payload truncated flag
- no
- match count
- 1
- match refs
- WO-FIC-1051
- coverage disposition
- match_found
- coverage reason
- Qualifying fictional gate work order returned on page two
- permitted statement
- A qualifying fictional gate work order was returned for human review
- prohibited statement
- Repair is complete or a vendor is authorized
- reviewer role
- fictional maintenance reviewer
- release state
- complete
- downstream action ref
- execution receipt ref
- operating readback ref
- fictional flag
- yes
- notes
- Fictional teaching record only; no real facility, customer, vendor or product result
ai tool query coverage fictional example — record 2
- episode id
- QRY-FIC-002
- episode status
- interrupted
- business question
- Is there an open gate maintenance record?
- false negative consequence
- False absence could misroute work
- organization ref
- ORG-FIC-MAPLE
- facility ref
- MSS-FIC-04
- source system
- fictional maintenance system
- endpoint or view
- fictional work-order list endpoint
- endpoint version
- v3
- query contract id
- QCON-FIC-GATE-01
- query contract version
- v2
- semantic definition ref
- STATUS-FIC-MAINT-v4
- filter digest
- sha256-fictional-filter-001
- filter summary
- facility=MSS-FIC-04; asset_category=gate; status in assigned|waiting_parts|reopened|open
- sort order
- created_at desc; record_id asc
- time boundary
- all active qualifying records
- authenticated role ref
- fictional approved service role
- visibility scope
- MSS-FIC-04 maintenance records
- page size
- 25
- maximum pages
- 10
- continuation mechanism
- next_page_token
- terminal condition
- empty next_page_token
- consistency model
- source_cursor
- source as of
- 2026-10-18T18:05:00-04:00
- start time
- 2026-10-18T18:05:02-04:00
- end time
- 2026-10-18T18:05:32-04:00
- page count
- 1
- raw record count
- 25
- distinct record count
- 25
- duplicate record count
- 0
- continuation observed
- yes
- terminal observed
- no
- partial response flag
- no
- timeout flag
- yes
- rate limit flag
- no
- repeated token flag
- no
- expired cursor flag
- no
- permission gap flag
- no
- model payload truncated flag
- no
- match count
- 0
- match refs
- coverage disposition
- no_match_incomplete
- coverage reason
- Timeout occurred before the continuation page returned
- permitted statement
- No match appeared in the first 25 observed records; the search did not complete
- prohibited statement
- No open gate work order exists
- reviewer role
- fictional maintenance reviewer
- release state
- hold
- downstream action ref
- execution receipt ref
- operating readback ref
- fictional flag
- yes
- notes
- Fictional teaching record only; timeout is invented and establishes no real reliability result
ai tool query coverage template
ai tool query coverage template
- episode id
- TEMPLATE-000
- episode status
- business question
- false negative consequence
- organization ref
- facility ref
- source system
- endpoint or view
- endpoint version
- query contract id
- query contract version
- semantic definition ref
- filter digest
- filter summary
- sort order
- time boundary
- authenticated role ref
- visibility scope
- page size
- maximum pages
- continuation mechanism
- terminal condition
- consistency model
- source as of
- start time
- end time
- page count
- raw record count
- distinct record count
- duplicate record count
- continuation observed
- terminal observed
- partial response flag
- timeout flag
- rate limit flag
- repeated token flag
- expired cursor flag
- permission gap flag
- model payload truncated flag
- match count
- match refs
- coverage disposition
- coverage reason
- permitted statement
- prohibited statement
- reviewer role
- release state
- downstream action ref
- execution receipt ref
- operating readback ref
- fictional flag
- no
- notes
- Blank template; do not store secrets, access codes, payment data or unnecessary customer content
