A retrieval script becomes usable by another application when it has a clear request and response boundary. HTTP carries that exchange; FastAPI provides the local endpoint and request validation. The service must distinguish an invalid request from a valid retrieval run that reaches its limits.
Input validation checks whether the caller’s question, version and allowances are supported. Action admission checks whether each later tool call fits those allowances. These happen at different stages, so a valid HTTP request can still produce a limited retrieval result.
When you need this. Use a service boundary when another application needs to call the retrieval core through HTTP and must distinguish invalid input, exhausted allowances and failed tools.
Follow one example. A client sends a question and requested version to POST /retrieve. The service validates the JSON, creates request-local tools and runs the existing scripted policy. Its response includes the action trace, source paragraphs and terminal status. In a limited run, HTTP still succeeds because the service handled the request; the body records that retrieval stopped at an allowance.
You will wrap the existing retrieval core rather than introduce a new agent. The corpus, lexical tools, policy and admission runner stay unchanged. This endpoint returns retrieved sources; it does not generate an answer.
Put a validated HTTP boundary around retrieval
- Submit the HTTP request.
- Invoke retrieval only after validation.
- Retain trace and source relationships.
- Serialize the request-bound reply.
- Reject invalid input before core invocation.
Validate the HTTP request before invoking retrieval
The caller sends a JSON body to POST /retrieve. HTTP provides the request/response boundary: the response has a status code and body. GET /health reports readiness and the pinned corpus identity.
The request contains a question, an exact documentation version and optional step, search, read and source-byte allowances. Omitted allowances receive declared defaults. The strict request model rejects unknown fields, booleans used as counts, invalid versions and blank questions.
Middleware is a layer that runs before the endpoint. Here it counts the received body bytes before JSON parsing and checks for a supported media type. It also rejects duplicate object keys, nonfinite constants and invalid UTF-8. The byte cap limits the request bytes the service accepts. It is not a total process-memory limit: a received chunk already occupies memory when the check runs.
Invalid request. Shape or value errors return a structured refusal and skip tool creation. Oversized body. A chunked request without a content-length header is still checked against the byte cap. Unsupported media. A non-JSON media type is refused before the core runs.
Put these checks in front of tool creation. A refused request then spends no search or read.
Keep HTTP validation separate from action admission
A valid request can still exhaust its action allowance. The core uses the unchanged admission runner to reserve each search or read before invoking it. The result keeps the denied action and any validated source data already read.
The response body carries a terminal status such as completed, incomplete or limited. These statuses arrive in successful HTTP responses because the service handled a valid request. completed means the scripted controller found its literal context marker; it does not grade an answer. A client must read the body status, not only the HTTP code, to tell a completed run from a limited one.
Each request gets its own tool instance, which owns the issued search records and lexical index. A finally block closes it after normal, limited and tool-failure paths. At startup, the application lifespan loads the pinned snapshot before the service reports ready; on shutdown, it clears that state. No request reuses another request’s mutable search table.
Bind the reply to the request and exact bytes
request_id is computed from the normalized request, including defaults, and the corpus identity. The result includes the actual trace, sources and a canonical Python result digest. The saved-response checker compares the exact normalized request representation, so a changed numeric representation cannot silently inherit an earlier hash.
After serialization, the custom X-Retrieval-Body-SHA256 header records the SHA-256 of the actual JSON response bytes. A client can check those bytes without reserializing floating-point scores in another language. The header and the result digest are consistency checks. Neither one authenticates the server or stops an attacker who can replace both the body and the hash.
Changed response. A changed saved payload or request is rejected by the supplied checker. Tool failure. The controlled failure returns a service-error status with an explicit failed result and no private exception detail. The admitted attempt still counts against the allowance, and the request-local tools still close.
| Executed scenario | HTTP status | Result or error |
|---|---|---|
| completed | 200 | completed |
| incomplete | 200 | incomplete |
| empty_eligible | 200 | incomplete |
| limited | 200 | limited |
| invalid_boolean_limit | 422 | invalid_request |
| extra_field | 422 | invalid_request |
| invalid_json | 422 | invalid_json |
| body_too_large_chunked | 413 | body_too_large |
| unsupported_media | 415 | unsupported_media_type |
| trusted_controlled_tool_failure | 503 | failed |
Start and exercise the local service
Download the complete HTTP lab. Its pinned requirements list the FastAPI, Pydantic, Uvicorn and HTTPX runtime. The driver starts a real Uvicorn subprocess and sends HTTP requests over loopback, so the recorded cases are not only in-process test-client calls.
For a fresh environment, install the pinned service dependencies. The recorded run used the already prepared installation.
python -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.lock"""A local HTTP boundary for bounded scripted documentation retrieval."""
from contextlib import asynccontextmanager
import json
import hashlib
from fastapi import FastAPI,Request
from fastapi.exceptions import RequestValidationError
from fastapi.responses import JSONResponse
from tools import DocumentationTools,load_snapshot
from service import RetrieveRequest,retrieve
MAX_BODY_BYTES=4096
def error_body(code,issues=None):
body={'error':{'code':code},'admission':{'accepted':False}}
if issues is not None:body['error']['issues']=issues
return body
def strict_json(raw):
def pairs(items):
result={}
for key,value in items:
if key in result:raise ValueError('duplicate_key')
result[key]=value
return result
def invalid(value):raise ValueError('invalid_constant')
return json.loads(raw.decode('utf-8'),object_pairs_hook=pairs,parse_constant=invalid)
class BoundedJSONBody:
def __init__(self,app):self.app=app
async def __call__(self,scope,receive,send):
if scope['type']!='http' or scope['method']!='POST' or scope['path']!='/retrieve':
return await self.app(scope,receive,send)
headers=dict(scope['headers']);media=headers.get(b'content-type',b'').split(b';',1)[0].strip().lower()
if media!=b'application/json':return await JSONResponse(error_body('unsupported_media_type'),415)(scope,receive,send)
raw=bytearray()
while True:
message=await receive()
if message['type']=='http.disconnect':return
piece=message.get('body',b'')
if len(raw)+len(piece)>MAX_BODY_BYTES:return await JSONResponse(error_body('body_too_large'),413)(scope,receive,send)
raw.extend(piece)
if not message.get('more_body',False):break
try:strict_json(bytes(raw))
except (ValueError,UnicodeError,RecursionError):return await JSONResponse(error_body('invalid_json'),422)(scope,receive,send)
delivered=False
async def replay():
nonlocal delivered
if delivered:return await receive()
delivered=True;return {'type':'http.request','body':bytes(raw),'more_body':False}
return await self.app(scope,replay,send)
def create_app(tool_factory=DocumentationTools):
@asynccontextmanager
async def lifespan(app):
app.state.snapshot=load_snapshot();app.state.ready=True
try:yield
finally:app.state.ready=False;app.state.snapshot=None
app=FastAPI(title='Local documentation retrieval',lifespan=lifespan,docs_url=None,redoc_url=None)
app.state.ready=False;app.state.snapshot=None
app.add_middleware(BoundedJSONBody)
@app.exception_handler(RequestValidationError)
async def validation_error(request,error):
issues=[{'path':[str(part)[:64] for part in issue['loc'][:6]],'type':issue['type']} for issue in error.errors()[:12]]
return JSONResponse(error_body('invalid_request',issues),422)
@app.exception_handler(Exception)
async def unexpected_error(request,error):return JSONResponse(error_body('internal_error'),500)
@app.get('/health')
def health():
if not app.state.ready:return JSONResponse({'status':'not_ready'},503)
return {'status':'ok','mode':'offline-scripted-retrieval','corpus_id':app.state.snapshot['snapshot_id']}
@app.post('/retrieve')
def retrieve_endpoint(payload:RetrieveRequest,request:Request):
if not app.state.ready:return JSONResponse(error_body('not_ready'),503)
code,body=retrieve(payload,app.state.snapshot,tool_factory)
response=JSONResponse(body,code)
response.headers['X-Retrieval-Body-SHA256']=hashlib.sha256(response.body).hexdigest()
return response
return app
app=create_app()The retrieval projection connects the unchanged core to the response contract. From the unpacked lab, use the prepared environment:
python -m uvicorn api:app --host 127.0.0.1 --port 8765In a second terminal, open the same extracted lab and activate its virtual environment. The driver starts its own temporary service for the checks.
source .venv/bin/activate
python run.py --output scratch-result.json
python -m unittest discover -v{
"cases": [
{
"http_status": 200,
"scenario": "completed",
"status": "completed"
},
{
"http_status": 200,
"scenario": "incomplete",
"status": "incomplete"
},
{
"http_status": 200,
"scenario": "empty_eligible",
"status": "incomplete"
},
{
"http_status": 200,
"scenario": "limited",
"status": "limited"
},
{
"http_status": 422,
"scenario": "invalid_boolean_limit",
"status": "invalid_request"
},
{
"http_status": 422,
"scenario": "extra_field",
"status": "invalid_request"
},
{
"http_status": 422,
"scenario": "invalid_json",
"status": "invalid_json"
},
{
"http_status": 413,
"scenario": "body_too_large_chunked",
"status": "body_too_large"
},
{
"http_status": 415,
"scenario": "unsupported_media",
"status": "unsupported_media_type"
}
],
"clean_shutdown": true,
"execution_mode": "actual-loopback-fastapi-http-offline-scripted-retrieval",
"trusted_fault_http_status": 503
}Because the driver uses its own server, it does not need the port from Terminal 1. It records startup readiness, shutdown completion and the subprocess’s raw exit status. Process IDs, ports and lifecycle logs can change on rerun. A signal exit stays recorded as a signal exit, not as a clean zero return.
This loopback demonstration has no authentication, permission-aware search, cross-origin client policy, production deployment, concurrency admission or capacity measurement. A released service would need those contracts, operational timeouts and merged release checks. The fixture’s corpus loading and policy computation remain outside action counters.
Inspect the complete saved result
{
"execution_mode": "actual-loopback-fastapi-http-offline-scripted-retrieval",
"model_called": false,
"health": {
"status": "ok",
"mode": "offline-scripted-retrieval",
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e"
},
"cases": [
{
"scenario": "completed",
"http_status": 200,
"response": {
"schema_version": 1,
"execution_mode": "offline-scripted-retrieval-http",
"model_called": false,
"request_id": "c4b35bcad796671fdb9ebd92411172aa68574ee99fecbd854bcef13db24dc067",
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"request": {
"question": "Will write_text replace the contents of an existing file?",
"version": "3.12",
"max_steps": 6,
"max_searches": 2,
"max_reads": 2,
"max_source_bytes": 4096
},
"status": "completed",
"reason": "configured_context_marker_found",
"admission": {
"accepted": true,
"limits": {
"max_steps": 6,
"max_searches": 2,
"max_reads": 2,
"max_source_bytes": 4096
}
},
"usage": {
"steps": 4,
"searches": 2,
"reads": 2,
"reserved_source_bytes": 378,
"delivered_source_bytes": 378
},
"trace": [
{
"action": {
"tool": "search",
"arguments": {
"query": "text",
"version": "3.12",
"k": 2
}
},
"decision": "executed",
"invoked": true,
"reserved_source_bytes": 0,
"status": "succeeded",
"result": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"query": "text",
"version": "3.12",
"k": 2,
"results": [
{
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
"source_id": "path-read",
"version": "3.12",
"document_revision": "b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2",
"source_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"start_line": 1,
"end_line": 1,
"text_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"byte_count": 154,
"native_score": -1.4220532319391636e-06,
"rank": 1,
"read_token": "72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124"
},
{
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
"source_id": "path-write",
"version": "3.12",
"document_revision": "28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7",
"source_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"start_line": 1,
"end_line": 1,
"text_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"byte_count": 224,
"native_score": -1.3203883495145633e-06,
"rank": 2,
"read_token": "189bf56802f958924691f452106802696dcd22186df4ee9c03bf0efecf1e1f81"
}
]
},
"usage_after": {
"steps": 1,
"searches": 1,
"reads": 0,
"reserved_source_bytes": 0,
"delivered_source_bytes": 0
}
},
{
"action": {
"tool": "read",
"arguments": {
"handle": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
"source_id": "path-read",
"version": "3.12",
"document_revision": "b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2",
"source_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"start_line": 1,
"end_line": 1,
"text_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"byte_count": 154,
"native_score": -1.4220532319391636e-06,
"rank": 1,
"read_token": "72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124"
}
}
},
"decision": "executed",
"invoked": true,
"reserved_source_bytes": 154,
"status": "succeeded",
"result": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
"source_id": "path-read",
"version": "3.12",
"document_revision": "b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2",
"source_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"start_line": 1,
"end_line": 1,
"text_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"byte_count": 154,
"native_score": -1.4220532319391636e-06,
"rank": 1,
"read_token": "72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124",
"text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
"url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
"read_request_id": "b2ce4d1e809a197df6c864261264b583737b1f41c59f8a4b6e353911b84c5bfe",
"result_sha256": "2d855cfa0b4f7e90c3711783b7779709f3b964760fd789d0d65b11f9b3604ac5"
},
"usage_after": {
"steps": 2,
"searches": 1,
"reads": 1,
"reserved_source_bytes": 154,
"delivered_source_bytes": 154
}
},
{
"action": {
"tool": "search",
"arguments": {
"query": "overwritten",
"version": "3.12",
"k": 2
}
},
"decision": "executed",
"invoked": true,
"reserved_source_bytes": 0,
"status": "succeeded",
"result": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "aeffc68efdee46b8d23c597f651143424c575c0c1a4699ab08a48734d011f127",
"query": "overwritten",
"version": "3.12",
"k": 2,
"results": [
{
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "aeffc68efdee46b8d23c597f651143424c575c0c1a4699ab08a48734d011f127",
"passage_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
"source_id": "path-write",
"version": "3.12",
"document_revision": "28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7",
"source_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"start_line": 1,
"end_line": 1,
"text_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"byte_count": 224,
"native_score": -0.7992166451067194,
"rank": 1,
"read_token": "93594ba3ddd6fd296ba70304fa0bd5bf8c8c5d39e1d4d3b97db54d31c512fb84"
}
]
},
"usage_after": {
"steps": 3,
"searches": 2,
"reads": 1,
"reserved_source_bytes": 154,
"delivered_source_bytes": 154
}
},
{
"action": {
"tool": "read",
"arguments": {
"handle": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "aeffc68efdee46b8d23c597f651143424c575c0c1a4699ab08a48734d011f127",
"passage_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
"source_id": "path-write",
"version": "3.12",
"document_revision": "28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7",
"source_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"start_line": 1,
"end_line": 1,
"text_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"byte_count": 224,
"native_score": -0.7992166451067194,
"rank": 1,
"read_token": "93594ba3ddd6fd296ba70304fa0bd5bf8c8c5d39e1d4d3b97db54d31c512fb84"
}
}
},
"decision": "executed",
"invoked": true,
"reserved_source_bytes": 224,
"status": "succeeded",
"result": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "aeffc68efdee46b8d23c597f651143424c575c0c1a4699ab08a48734d011f127",
"passage_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
"source_id": "path-write",
"version": "3.12",
"document_revision": "28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7",
"source_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"start_line": 1,
"end_line": 1,
"text_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"byte_count": 224,
"native_score": -0.7992166451067194,
"rank": 1,
"read_token": "93594ba3ddd6fd296ba70304fa0bd5bf8c8c5d39e1d4d3b97db54d31c512fb84",
"text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
"url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
"read_request_id": "ebff16e2002855a51b3a7f1ce690d01e0e29c9bc77e4e87001979c0a88be7db4",
"result_sha256": "b6df6bc29cc62ee7c203fe983839c14991b707c9c2d312b3f5561b40769b2c38"
},
"usage_after": {
"steps": 4,
"searches": 2,
"reads": 2,
"reserved_source_bytes": 378,
"delivered_source_bytes": 378
}
}
],
"evidence": [
{
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
"source_id": "path-read",
"version": "3.12",
"document_revision": "b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2",
"source_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"start_line": 1,
"end_line": 1,
"text_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"byte_count": 154,
"native_score": -1.4220532319391636e-06,
"rank": 1,
"read_token": "72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124",
"text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
"url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
"read_request_id": "b2ce4d1e809a197df6c864261264b583737b1f41c59f8a4b6e353911b84c5bfe",
"result_sha256": "2d855cfa0b4f7e90c3711783b7779709f3b964760fd789d0d65b11f9b3604ac5"
},
{
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "aeffc68efdee46b8d23c597f651143424c575c0c1a4699ab08a48734d011f127",
"passage_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
"source_id": "path-write",
"version": "3.12",
"document_revision": "28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7",
"source_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"start_line": 1,
"end_line": 1,
"text_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"byte_count": 224,
"native_score": -0.7992166451067194,
"rank": 1,
"read_token": "93594ba3ddd6fd296ba70304fa0bd5bf8c8c5d39e1d4d3b97db54d31c512fb84",
"text": "Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\"utf-8\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.",
"url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text",
"read_request_id": "ebff16e2002855a51b3a7f1ce690d01e0e29c9bc77e4e87001979c0a88be7db4",
"result_sha256": "b6df6bc29cc62ee7c203fe983839c14991b707c9c2d312b3f5561b40769b2c38"
}
],
"policy": {
"name": "existing-path",
"initial_query": "text",
"refinement_query": "overwritten",
"required_marker": "overwritten",
"max_rounds": 2
},
"result_sha256": "dc00e17712c2fc6cde273b32d458f15615496490bf7b5e54093e866fd7b7773b"
},
"body_sha256_header": "6e1fc046cc30d8fad53ab0fa558a3749928da7efd5e50d5f2b8f9d2e5bd3e55d",
"raw_body_sha256": "6e1fc046cc30d8fad53ab0fa558a3749928da7efd5e50d5f2b8f9d2e5bd3e55d",
"raw_response_text": "{\"schema_version\":1,\"execution_mode\":\"offline-scripted-retrieval-http\",\"model_called\":false,\"request_id\":\"c4b35bcad796671fdb9ebd92411172aa68574ee99fecbd854bcef13db24dc067\",\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"request\":{\"question\":\"Will write_text replace the contents of an existing file?\",\"version\":\"3.12\",\"max_steps\":6,\"max_searches\":2,\"max_reads\":2,\"max_source_bytes\":4096},\"status\":\"completed\",\"reason\":\"configured_context_marker_found\",\"admission\":{\"accepted\":true,\"limits\":{\"max_steps\":6,\"max_searches\":2,\"max_reads\":2,\"max_source_bytes\":4096}},\"usage\":{\"steps\":4,\"searches\":2,\"reads\":2,\"reserved_source_bytes\":378,\"delivered_source_bytes\":378},\"trace\":[{\"action\":{\"tool\":\"search\",\"arguments\":{\"query\":\"text\",\"version\":\"3.12\",\"k\":2}},\"decision\":\"executed\",\"invoked\":true,\"reserved_source_bytes\":0,\"status\":\"succeeded\",\"result\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"query\":\"text\",\"version\":\"3.12\",\"k\":2,\"results\":[{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900\",\"source_id\":\"path-read\",\"version\":\"3.12\",\"document_revision\":\"b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2\",\"source_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"byte_count\":154,\"native_score\":-1.4220532319391636e-06,\"rank\":1,\"read_token\":\"72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124\"},{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7\",\"source_id\":\"path-write\",\"version\":\"3.12\",\"document_revision\":\"28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7\",\"source_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"byte_count\":224,\"native_score\":-1.3203883495145633e-06,\"rank\":2,\"read_token\":\"189bf56802f958924691f452106802696dcd22186df4ee9c03bf0efecf1e1f81\"}]},\"usage_after\":{\"steps\":1,\"searches\":1,\"reads\":0,\"reserved_source_bytes\":0,\"delivered_source_bytes\":0}},{\"action\":{\"tool\":\"read\",\"arguments\":{\"handle\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900\",\"source_id\":\"path-read\",\"version\":\"3.12\",\"document_revision\":\"b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2\",\"source_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"byte_count\":154,\"native_score\":-1.4220532319391636e-06,\"rank\":1,\"read_token\":\"72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124\"}}},\"decision\":\"executed\",\"invoked\":true,\"reserved_source_bytes\":154,\"status\":\"succeeded\",\"result\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900\",\"source_id\":\"path-read\",\"version\":\"3.12\",\"document_revision\":\"b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2\",\"source_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"byte_count\":154,\"native_score\":-1.4220532319391636e-06,\"rank\":1,\"read_token\":\"72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124\",\"text\":\"Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\\\"utf-8\\\" when reading a UTF-8 file.\",\"url\":\"https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text\",\"read_request_id\":\"b2ce4d1e809a197df6c864261264b583737b1f41c59f8a4b6e353911b84c5bfe\",\"result_sha256\":\"2d855cfa0b4f7e90c3711783b7779709f3b964760fd789d0d65b11f9b3604ac5\"},\"usage_after\":{\"steps\":2,\"searches\":1,\"reads\":1,\"reserved_source_bytes\":154,\"delivered_source_bytes\":154}},{\"action\":{\"tool\":\"search\",\"arguments\":{\"query\":\"overwritten\",\"version\":\"3.12\",\"k\":2}},\"decision\":\"executed\",\"invoked\":true,\"reserved_source_bytes\":0,\"status\":\"succeeded\",\"result\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"aeffc68efdee46b8d23c597f651143424c575c0c1a4699ab08a48734d011f127\",\"query\":\"overwritten\",\"version\":\"3.12\",\"k\":2,\"results\":[{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"aeffc68efdee46b8d23c597f651143424c575c0c1a4699ab08a48734d011f127\",\"passage_id\":\"c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7\",\"source_id\":\"path-write\",\"version\":\"3.12\",\"document_revision\":\"28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7\",\"source_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"byte_count\":224,\"native_score\":-0.7992166451067194,\"rank\":1,\"read_token\":\"93594ba3ddd6fd296ba70304fa0bd5bf8c8c5d39e1d4d3b97db54d31c512fb84\"}]},\"usage_after\":{\"steps\":3,\"searches\":2,\"reads\":1,\"reserved_source_bytes\":154,\"delivered_source_bytes\":154}},{\"action\":{\"tool\":\"read\",\"arguments\":{\"handle\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"aeffc68efdee46b8d23c597f651143424c575c0c1a4699ab08a48734d011f127\",\"passage_id\":\"c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7\",\"source_id\":\"path-write\",\"version\":\"3.12\",\"document_revision\":\"28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7\",\"source_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"byte_count\":224,\"native_score\":-0.7992166451067194,\"rank\":1,\"read_token\":\"93594ba3ddd6fd296ba70304fa0bd5bf8c8c5d39e1d4d3b97db54d31c512fb84\"}}},\"decision\":\"executed\",\"invoked\":true,\"reserved_source_bytes\":224,\"status\":\"succeeded\",\"result\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"aeffc68efdee46b8d23c597f651143424c575c0c1a4699ab08a48734d011f127\",\"passage_id\":\"c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7\",\"source_id\":\"path-write\",\"version\":\"3.12\",\"document_revision\":\"28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7\",\"source_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"byte_count\":224,\"native_score\":-0.7992166451067194,\"rank\":1,\"read_token\":\"93594ba3ddd6fd296ba70304fa0bd5bf8c8c5d39e1d4d3b97db54d31c512fb84\",\"text\":\"Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\\\"utf-8\\\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.\",\"url\":\"https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text\",\"read_request_id\":\"ebff16e2002855a51b3a7f1ce690d01e0e29c9bc77e4e87001979c0a88be7db4\",\"result_sha256\":\"b6df6bc29cc62ee7c203fe983839c14991b707c9c2d312b3f5561b40769b2c38\"},\"usage_after\":{\"steps\":4,\"searches\":2,\"reads\":2,\"reserved_source_bytes\":378,\"delivered_source_bytes\":378}}],\"evidence\":[{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900\",\"source_id\":\"path-read\",\"version\":\"3.12\",\"document_revision\":\"b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2\",\"source_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"byte_count\":154,\"native_score\":-1.4220532319391636e-06,\"rank\":1,\"read_token\":\"72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124\",\"text\":\"Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\\\"utf-8\\\" when reading a UTF-8 file.\",\"url\":\"https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text\",\"read_request_id\":\"b2ce4d1e809a197df6c864261264b583737b1f41c59f8a4b6e353911b84c5bfe\",\"result_sha256\":\"2d855cfa0b4f7e90c3711783b7779709f3b964760fd789d0d65b11f9b3604ac5\"},{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"aeffc68efdee46b8d23c597f651143424c575c0c1a4699ab08a48734d011f127\",\"passage_id\":\"c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7\",\"source_id\":\"path-write\",\"version\":\"3.12\",\"document_revision\":\"28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7\",\"source_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"byte_count\":224,\"native_score\":-0.7992166451067194,\"rank\":1,\"read_token\":\"93594ba3ddd6fd296ba70304fa0bd5bf8c8c5d39e1d4d3b97db54d31c512fb84\",\"text\":\"Path.write_text(data, encoding=None, errors=None, newline=None) writes text to a file and closes it. Set encoding=\\\"utf-8\\\" to select UTF-8. An existing file is overwritten. The method returns the number of characters written.\",\"url\":\"https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.write_text\",\"read_request_id\":\"ebff16e2002855a51b3a7f1ce690d01e0e29c9bc77e4e87001979c0a88be7db4\",\"result_sha256\":\"b6df6bc29cc62ee7c203fe983839c14991b707c9c2d312b3f5561b40769b2c38\"}],\"policy\":{\"name\":\"existing-path\",\"initial_query\":\"text\",\"refinement_query\":\"overwritten\",\"required_marker\":\"overwritten\",\"max_rounds\":2},\"result_sha256\":\"dc00e17712c2fc6cde273b32d458f15615496490bf7b5e54093e866fd7b7773b\"}"
},
{
"scenario": "incomplete",
"http_status": 200,
"response": {
"schema_version": 1,
"execution_mode": "offline-scripted-retrieval-http",
"model_called": false,
"request_id": "f0ede4487c62ef1467442f2b84067ce89f9a83216123911eb086f92c19afdc5c",
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"request": {
"question": "How frequently does our cloud provider back up these files?",
"version": "3.12",
"max_steps": 6,
"max_searches": 2,
"max_reads": 2,
"max_source_bytes": 4096
},
"status": "incomplete",
"reason": "no_refinement_rule",
"admission": {
"accepted": true,
"limits": {
"max_steps": 6,
"max_searches": 2,
"max_reads": 2,
"max_source_bytes": 4096
}
},
"usage": {
"steps": 2,
"searches": 1,
"reads": 1,
"reserved_source_bytes": 154,
"delivered_source_bytes": 154
},
"trace": [
{
"action": {
"tool": "search",
"arguments": {
"query": "text",
"version": "3.12",
"k": 2
}
},
"decision": "executed",
"invoked": true,
"reserved_source_bytes": 0,
"status": "succeeded",
"result": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"query": "text",
"version": "3.12",
"k": 2,
"results": [
{
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
"source_id": "path-read",
"version": "3.12",
"document_revision": "b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2",
"source_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"start_line": 1,
"end_line": 1,
"text_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"byte_count": 154,
"native_score": -1.4220532319391636e-06,
"rank": 1,
"read_token": "72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124"
},
{
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
"source_id": "path-write",
"version": "3.12",
"document_revision": "28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7",
"source_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"start_line": 1,
"end_line": 1,
"text_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"byte_count": 224,
"native_score": -1.3203883495145633e-06,
"rank": 2,
"read_token": "189bf56802f958924691f452106802696dcd22186df4ee9c03bf0efecf1e1f81"
}
]
},
"usage_after": {
"steps": 1,
"searches": 1,
"reads": 0,
"reserved_source_bytes": 0,
"delivered_source_bytes": 0
}
},
{
"action": {
"tool": "read",
"arguments": {
"handle": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
"source_id": "path-read",
"version": "3.12",
"document_revision": "b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2",
"source_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"start_line": 1,
"end_line": 1,
"text_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"byte_count": 154,
"native_score": -1.4220532319391636e-06,
"rank": 1,
"read_token": "72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124"
}
}
},
"decision": "executed",
"invoked": true,
"reserved_source_bytes": 154,
"status": "succeeded",
"result": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
"source_id": "path-read",
"version": "3.12",
"document_revision": "b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2",
"source_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"start_line": 1,
"end_line": 1,
"text_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"byte_count": 154,
"native_score": -1.4220532319391636e-06,
"rank": 1,
"read_token": "72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124",
"text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
"url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
"read_request_id": "b2ce4d1e809a197df6c864261264b583737b1f41c59f8a4b6e353911b84c5bfe",
"result_sha256": "2d855cfa0b4f7e90c3711783b7779709f3b964760fd789d0d65b11f9b3604ac5"
},
"usage_after": {
"steps": 2,
"searches": 1,
"reads": 1,
"reserved_source_bytes": 154,
"delivered_source_bytes": 154
}
}
],
"evidence": [
{
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
"source_id": "path-read",
"version": "3.12",
"document_revision": "b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2",
"source_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"start_line": 1,
"end_line": 1,
"text_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"byte_count": 154,
"native_score": -1.4220532319391636e-06,
"rank": 1,
"read_token": "72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124",
"text": "Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\"utf-8\" when reading a UTF-8 file.",
"url": "https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text",
"read_request_id": "b2ce4d1e809a197df6c864261264b583737b1f41c59f8a4b6e353911b84c5bfe",
"result_sha256": "2d855cfa0b4f7e90c3711783b7779709f3b964760fd789d0d65b11f9b3604ac5"
}
],
"policy": {
"name": "no-matching-rule",
"initial_query": "text",
"refinement_query": null,
"required_marker": null,
"max_rounds": 2
},
"result_sha256": "d9b383bf67df785a022be61316e488d738dcb3c2bd921bef7543b99997bc1446"
},
"body_sha256_header": "692af09096ceb6f12da0167f6de42415a8c961a4a03f83582fcbd6ab1561a373",
"raw_body_sha256": "692af09096ceb6f12da0167f6de42415a8c961a4a03f83582fcbd6ab1561a373",
"raw_response_text": "{\"schema_version\":1,\"execution_mode\":\"offline-scripted-retrieval-http\",\"model_called\":false,\"request_id\":\"f0ede4487c62ef1467442f2b84067ce89f9a83216123911eb086f92c19afdc5c\",\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"request\":{\"question\":\"How frequently does our cloud provider back up these files?\",\"version\":\"3.12\",\"max_steps\":6,\"max_searches\":2,\"max_reads\":2,\"max_source_bytes\":4096},\"status\":\"incomplete\",\"reason\":\"no_refinement_rule\",\"admission\":{\"accepted\":true,\"limits\":{\"max_steps\":6,\"max_searches\":2,\"max_reads\":2,\"max_source_bytes\":4096}},\"usage\":{\"steps\":2,\"searches\":1,\"reads\":1,\"reserved_source_bytes\":154,\"delivered_source_bytes\":154},\"trace\":[{\"action\":{\"tool\":\"search\",\"arguments\":{\"query\":\"text\",\"version\":\"3.12\",\"k\":2}},\"decision\":\"executed\",\"invoked\":true,\"reserved_source_bytes\":0,\"status\":\"succeeded\",\"result\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"query\":\"text\",\"version\":\"3.12\",\"k\":2,\"results\":[{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900\",\"source_id\":\"path-read\",\"version\":\"3.12\",\"document_revision\":\"b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2\",\"source_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"byte_count\":154,\"native_score\":-1.4220532319391636e-06,\"rank\":1,\"read_token\":\"72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124\"},{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7\",\"source_id\":\"path-write\",\"version\":\"3.12\",\"document_revision\":\"28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7\",\"source_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"byte_count\":224,\"native_score\":-1.3203883495145633e-06,\"rank\":2,\"read_token\":\"189bf56802f958924691f452106802696dcd22186df4ee9c03bf0efecf1e1f81\"}]},\"usage_after\":{\"steps\":1,\"searches\":1,\"reads\":0,\"reserved_source_bytes\":0,\"delivered_source_bytes\":0}},{\"action\":{\"tool\":\"read\",\"arguments\":{\"handle\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900\",\"source_id\":\"path-read\",\"version\":\"3.12\",\"document_revision\":\"b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2\",\"source_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"byte_count\":154,\"native_score\":-1.4220532319391636e-06,\"rank\":1,\"read_token\":\"72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124\"}}},\"decision\":\"executed\",\"invoked\":true,\"reserved_source_bytes\":154,\"status\":\"succeeded\",\"result\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900\",\"source_id\":\"path-read\",\"version\":\"3.12\",\"document_revision\":\"b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2\",\"source_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"byte_count\":154,\"native_score\":-1.4220532319391636e-06,\"rank\":1,\"read_token\":\"72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124\",\"text\":\"Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\\\"utf-8\\\" when reading a UTF-8 file.\",\"url\":\"https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text\",\"read_request_id\":\"b2ce4d1e809a197df6c864261264b583737b1f41c59f8a4b6e353911b84c5bfe\",\"result_sha256\":\"2d855cfa0b4f7e90c3711783b7779709f3b964760fd789d0d65b11f9b3604ac5\"},\"usage_after\":{\"steps\":2,\"searches\":1,\"reads\":1,\"reserved_source_bytes\":154,\"delivered_source_bytes\":154}}],\"evidence\":[{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900\",\"source_id\":\"path-read\",\"version\":\"3.12\",\"document_revision\":\"b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2\",\"source_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"byte_count\":154,\"native_score\":-1.4220532319391636e-06,\"rank\":1,\"read_token\":\"72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124\",\"text\":\"Path.read_text(encoding=None, errors=None) opens a file, returns its text as a string and closes the file. Set encoding=\\\"utf-8\\\" when reading a UTF-8 file.\",\"url\":\"https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.read_text\",\"read_request_id\":\"b2ce4d1e809a197df6c864261264b583737b1f41c59f8a4b6e353911b84c5bfe\",\"result_sha256\":\"2d855cfa0b4f7e90c3711783b7779709f3b964760fd789d0d65b11f9b3604ac5\"}],\"policy\":{\"name\":\"no-matching-rule\",\"initial_query\":\"text\",\"refinement_query\":null,\"required_marker\":null,\"max_rounds\":2},\"result_sha256\":\"d9b383bf67df785a022be61316e488d738dcb3c2bd921bef7543b99997bc1446\"}"
},
{
"scenario": "empty_eligible",
"http_status": 200,
"response": {
"schema_version": 1,
"execution_mode": "offline-scripted-retrieval-http",
"model_called": false,
"request_id": "965bab2126eead5f02fa7d6bdc7dc544e6a2c9a9fa40c43a9a0ed6489521b32d",
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"request": {
"question": "Will write_text replace the contents of an existing file?",
"version": "9.99",
"max_steps": 6,
"max_searches": 2,
"max_reads": 2,
"max_source_bytes": 4096
},
"status": "incomplete",
"reason": "round_limit",
"admission": {
"accepted": true,
"limits": {
"max_steps": 6,
"max_searches": 2,
"max_reads": 2,
"max_source_bytes": 4096
}
},
"usage": {
"steps": 2,
"searches": 2,
"reads": 0,
"reserved_source_bytes": 0,
"delivered_source_bytes": 0
},
"trace": [
{
"action": {
"tool": "search",
"arguments": {
"query": "text",
"version": "9.99",
"k": 2
}
},
"decision": "executed",
"invoked": true,
"reserved_source_bytes": 0,
"status": "succeeded",
"result": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "fefe356a697d65ea81980cd228d12ddde25c3d62fe8a4badbaafc3f385052d97",
"query": "text",
"version": "9.99",
"k": 2,
"results": []
},
"usage_after": {
"steps": 1,
"searches": 1,
"reads": 0,
"reserved_source_bytes": 0,
"delivered_source_bytes": 0
}
},
{
"action": {
"tool": "search",
"arguments": {
"query": "overwritten",
"version": "9.99",
"k": 2
}
},
"decision": "executed",
"invoked": true,
"reserved_source_bytes": 0,
"status": "succeeded",
"result": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "39a9d404c56be7c96dadecd7ef9d361f8f749b4b62d095516e9fa8c864e7941a",
"query": "overwritten",
"version": "9.99",
"k": 2,
"results": []
},
"usage_after": {
"steps": 2,
"searches": 2,
"reads": 0,
"reserved_source_bytes": 0,
"delivered_source_bytes": 0
}
}
],
"evidence": [],
"policy": {
"name": "existing-path",
"initial_query": "text",
"refinement_query": "overwritten",
"required_marker": "overwritten",
"max_rounds": 2
},
"result_sha256": "4f36a6fdd57146040e4c5c62173d154e1d6075abb42f8a209df9bde2b43e1da6"
},
"body_sha256_header": "5839179940b4a494b77eee660b2ae3df9fdc753dc2e1fac17233e9352711a06d",
"raw_body_sha256": "5839179940b4a494b77eee660b2ae3df9fdc753dc2e1fac17233e9352711a06d",
"raw_response_text": "{\"schema_version\":1,\"execution_mode\":\"offline-scripted-retrieval-http\",\"model_called\":false,\"request_id\":\"965bab2126eead5f02fa7d6bdc7dc544e6a2c9a9fa40c43a9a0ed6489521b32d\",\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"request\":{\"question\":\"Will write_text replace the contents of an existing file?\",\"version\":\"9.99\",\"max_steps\":6,\"max_searches\":2,\"max_reads\":2,\"max_source_bytes\":4096},\"status\":\"incomplete\",\"reason\":\"round_limit\",\"admission\":{\"accepted\":true,\"limits\":{\"max_steps\":6,\"max_searches\":2,\"max_reads\":2,\"max_source_bytes\":4096}},\"usage\":{\"steps\":2,\"searches\":2,\"reads\":0,\"reserved_source_bytes\":0,\"delivered_source_bytes\":0},\"trace\":[{\"action\":{\"tool\":\"search\",\"arguments\":{\"query\":\"text\",\"version\":\"9.99\",\"k\":2}},\"decision\":\"executed\",\"invoked\":true,\"reserved_source_bytes\":0,\"status\":\"succeeded\",\"result\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"fefe356a697d65ea81980cd228d12ddde25c3d62fe8a4badbaafc3f385052d97\",\"query\":\"text\",\"version\":\"9.99\",\"k\":2,\"results\":[]},\"usage_after\":{\"steps\":1,\"searches\":1,\"reads\":0,\"reserved_source_bytes\":0,\"delivered_source_bytes\":0}},{\"action\":{\"tool\":\"search\",\"arguments\":{\"query\":\"overwritten\",\"version\":\"9.99\",\"k\":2}},\"decision\":\"executed\",\"invoked\":true,\"reserved_source_bytes\":0,\"status\":\"succeeded\",\"result\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"39a9d404c56be7c96dadecd7ef9d361f8f749b4b62d095516e9fa8c864e7941a\",\"query\":\"overwritten\",\"version\":\"9.99\",\"k\":2,\"results\":[]},\"usage_after\":{\"steps\":2,\"searches\":2,\"reads\":0,\"reserved_source_bytes\":0,\"delivered_source_bytes\":0}}],\"evidence\":[],\"policy\":{\"name\":\"existing-path\",\"initial_query\":\"text\",\"refinement_query\":\"overwritten\",\"required_marker\":\"overwritten\",\"max_rounds\":2},\"result_sha256\":\"4f36a6fdd57146040e4c5c62173d154e1d6075abb42f8a209df9bde2b43e1da6\"}"
},
{
"scenario": "limited",
"http_status": 200,
"response": {
"schema_version": 1,
"execution_mode": "offline-scripted-retrieval-http",
"model_called": false,
"request_id": "2a05a37d5fbe61ca06db5d59beecd7361571913e7760fc5f584f2507e92ca93e",
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"request": {
"question": "Will write_text replace the contents of an existing file?",
"version": "3.12",
"max_steps": 1,
"max_searches": 2,
"max_reads": 2,
"max_source_bytes": 4096
},
"status": "limited",
"reason": "max_steps",
"admission": {
"accepted": true,
"limits": {
"max_steps": 1,
"max_searches": 2,
"max_reads": 2,
"max_source_bytes": 4096
}
},
"usage": {
"steps": 1,
"searches": 1,
"reads": 0,
"reserved_source_bytes": 0,
"delivered_source_bytes": 0
},
"trace": [
{
"action": {
"tool": "search",
"arguments": {
"query": "text",
"version": "3.12",
"k": 2
}
},
"decision": "executed",
"invoked": true,
"reserved_source_bytes": 0,
"status": "succeeded",
"result": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"query": "text",
"version": "3.12",
"k": 2,
"results": [
{
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
"source_id": "path-read",
"version": "3.12",
"document_revision": "b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2",
"source_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"start_line": 1,
"end_line": 1,
"text_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"byte_count": 154,
"native_score": -1.4220532319391636e-06,
"rank": 1,
"read_token": "72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124"
},
{
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7",
"source_id": "path-write",
"version": "3.12",
"document_revision": "28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7",
"source_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"start_line": 1,
"end_line": 1,
"text_sha256": "a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e",
"byte_count": 224,
"native_score": -1.3203883495145633e-06,
"rank": 2,
"read_token": "189bf56802f958924691f452106802696dcd22186df4ee9c03bf0efecf1e1f81"
}
]
},
"usage_after": {
"steps": 1,
"searches": 1,
"reads": 0,
"reserved_source_bytes": 0,
"delivered_source_bytes": 0
}
},
{
"action": {
"tool": "read",
"arguments": {
"handle": {
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"search_request_id": "3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f",
"passage_id": "c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900",
"source_id": "path-read",
"version": "3.12",
"document_revision": "b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2",
"source_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"start_line": 1,
"end_line": 1,
"text_sha256": "dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0",
"byte_count": 154,
"native_score": -1.4220532319391636e-06,
"rank": 1,
"read_token": "72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124"
}
}
},
"decision": "denied",
"reason": "max_steps",
"invoked": false,
"preflight_source_bytes": 154
}
],
"evidence": [],
"policy": {
"name": "existing-path",
"initial_query": "text",
"refinement_query": "overwritten",
"required_marker": "overwritten",
"max_rounds": 2
},
"result_sha256": "78e5c720039227f38ec23b0ef2161123f4f78dc2bded2cf67da62025ad9822c4"
},
"body_sha256_header": "570be3a9715888a566358d941843377c7e09db5e848c0bda35dfe2054a2227fb",
"raw_body_sha256": "570be3a9715888a566358d941843377c7e09db5e848c0bda35dfe2054a2227fb",
"raw_response_text": "{\"schema_version\":1,\"execution_mode\":\"offline-scripted-retrieval-http\",\"model_called\":false,\"request_id\":\"2a05a37d5fbe61ca06db5d59beecd7361571913e7760fc5f584f2507e92ca93e\",\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"request\":{\"question\":\"Will write_text replace the contents of an existing file?\",\"version\":\"3.12\",\"max_steps\":1,\"max_searches\":2,\"max_reads\":2,\"max_source_bytes\":4096},\"status\":\"limited\",\"reason\":\"max_steps\",\"admission\":{\"accepted\":true,\"limits\":{\"max_steps\":1,\"max_searches\":2,\"max_reads\":2,\"max_source_bytes\":4096}},\"usage\":{\"steps\":1,\"searches\":1,\"reads\":0,\"reserved_source_bytes\":0,\"delivered_source_bytes\":0},\"trace\":[{\"action\":{\"tool\":\"search\",\"arguments\":{\"query\":\"text\",\"version\":\"3.12\",\"k\":2}},\"decision\":\"executed\",\"invoked\":true,\"reserved_source_bytes\":0,\"status\":\"succeeded\",\"result\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"query\":\"text\",\"version\":\"3.12\",\"k\":2,\"results\":[{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900\",\"source_id\":\"path-read\",\"version\":\"3.12\",\"document_revision\":\"b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2\",\"source_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"byte_count\":154,\"native_score\":-1.4220532319391636e-06,\"rank\":1,\"read_token\":\"72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124\"},{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c66643a4609c6ee157458bf4353f7446b9c6a200a3ef453846d6a18d5b5069a7\",\"source_id\":\"path-write\",\"version\":\"3.12\",\"document_revision\":\"28c6349eaf80b629322edb310bb871dc45a04af9fad3b752bc75d12f0d7314e7\",\"source_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"a48b4b9f763cd6309ebe32af19c5a814adcf810c2259683da9f328ccee46948e\",\"byte_count\":224,\"native_score\":-1.3203883495145633e-06,\"rank\":2,\"read_token\":\"189bf56802f958924691f452106802696dcd22186df4ee9c03bf0efecf1e1f81\"}]},\"usage_after\":{\"steps\":1,\"searches\":1,\"reads\":0,\"reserved_source_bytes\":0,\"delivered_source_bytes\":0}},{\"action\":{\"tool\":\"read\",\"arguments\":{\"handle\":{\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"search_request_id\":\"3f33383e706e36449e22c380704d880d5e2b8a4b1f6b779b8aa54206e072ad5f\",\"passage_id\":\"c737db948e8111ae00e3442d8a22c80c876e43446dc1ee176ffe8ce142a41900\",\"source_id\":\"path-read\",\"version\":\"3.12\",\"document_revision\":\"b58385b9bf597a951c16c035653d639929924e53eae3e5ada255afd6ee1592f2\",\"source_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"start_line\":1,\"end_line\":1,\"text_sha256\":\"dc097ca63486ace45279f412ea266bf754fcd2f0b1153f5d763ce905dafbc2c0\",\"byte_count\":154,\"native_score\":-1.4220532319391636e-06,\"rank\":1,\"read_token\":\"72abbf5e0022ef780447ed8c2322b711cac8b4971d817a440bc02dfa28b07124\"}}},\"decision\":\"denied\",\"reason\":\"max_steps\",\"invoked\":false,\"preflight_source_bytes\":154}],\"evidence\":[],\"policy\":{\"name\":\"existing-path\",\"initial_query\":\"text\",\"refinement_query\":\"overwritten\",\"required_marker\":\"overwritten\",\"max_rounds\":2},\"result_sha256\":\"78e5c720039227f38ec23b0ef2161123f4f78dc2bded2cf67da62025ad9822c4\"}"
},
{
"scenario": "invalid_boolean_limit",
"http_status": 422,
"response": {
"error": {
"code": "invalid_request",
"issues": [
{
"path": [
"body",
"max_steps"
],
"type": "int_type"
}
]
},
"admission": {
"accepted": false
}
},
"body_sha256_header": null,
"raw_body_sha256": "9a36c99280174accd76e3feedc0dc67dd50ae4b3c56c7fd019830530a332ee05",
"raw_response_text": "{\"error\":{\"code\":\"invalid_request\",\"issues\":[{\"path\":[\"body\",\"max_steps\"],\"type\":\"int_type\"}]},\"admission\":{\"accepted\":false}}"
},
{
"scenario": "extra_field",
"http_status": 422,
"response": {
"error": {
"code": "invalid_request",
"issues": [
{
"path": [
"body",
"fault"
],
"type": "extra_forbidden"
}
]
},
"admission": {
"accepted": false
}
},
"body_sha256_header": null,
"raw_body_sha256": "9bb56b2023846ce252ee8aec429d7a45be4e5a6f3ca5f055cc805f2315a94160",
"raw_response_text": "{\"error\":{\"code\":\"invalid_request\",\"issues\":[{\"path\":[\"body\",\"fault\"],\"type\":\"extra_forbidden\"}]},\"admission\":{\"accepted\":false}}"
},
{
"scenario": "invalid_json",
"http_status": 422,
"response": {
"error": {
"code": "invalid_json"
},
"admission": {
"accepted": false
}
},
"body_sha256_header": null,
"raw_body_sha256": "58156c25177f55a196e09977a5ef68d844004fdc57077b4a0493d871b1bf1233",
"raw_response_text": "{\"error\":{\"code\":\"invalid_json\"},\"admission\":{\"accepted\":false}}"
},
{
"scenario": "body_too_large_chunked",
"http_status": 413,
"response": {
"error": {
"code": "body_too_large"
},
"admission": {
"accepted": false
}
},
"body_sha256_header": null,
"raw_body_sha256": "6ccdbd168b3329805bf785c2848e9280055cef5672ebc0da8a5fadb8cb2ea35c",
"raw_response_text": "{\"error\":{\"code\":\"body_too_large\"},\"admission\":{\"accepted\":false}}"
},
{
"scenario": "unsupported_media",
"http_status": 415,
"response": {
"error": {
"code": "unsupported_media_type"
},
"admission": {
"accepted": false
}
},
"body_sha256_header": null,
"raw_body_sha256": "94746bc9fb69e2f66ad1afc8688d2dfdf2c4fa9a08d7151a9935d18bdebd760c",
"raw_response_text": "{\"error\":{\"code\":\"unsupported_media_type\"},\"admission\":{\"accepted\":false}}"
}
],
"trusted_fault": {
"scenario": "trusted_controlled_tool_failure",
"http_status": 503,
"response": {
"schema_version": 1,
"execution_mode": "offline-scripted-retrieval-http",
"model_called": false,
"request_id": "c4b35bcad796671fdb9ebd92411172aa68574ee99fecbd854bcef13db24dc067",
"corpus_id": "0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e",
"request": {
"question": "Will write_text replace the contents of an existing file?",
"version": "3.12",
"max_steps": 6,
"max_searches": 2,
"max_reads": 2,
"max_source_bytes": 4096
},
"status": "failed",
"reason": "retrieval_failed",
"admission": {
"accepted": true,
"limits": {
"max_steps": 6,
"max_searches": 2,
"max_reads": 2,
"max_source_bytes": 4096
}
},
"usage": {
"steps": 1,
"searches": 1,
"reads": 0,
"reserved_source_bytes": 0,
"delivered_source_bytes": 0
},
"trace": [
{
"action": {
"tool": "search",
"arguments": {
"query": "text",
"version": "3.12",
"k": 2
}
},
"decision": "executed",
"invoked": true,
"reserved_source_bytes": 0,
"status": "failed",
"reason": "tool_failure",
"usage_after": {
"steps": 1,
"searches": 1,
"reads": 0,
"reserved_source_bytes": 0,
"delivered_source_bytes": 0
}
}
],
"evidence": [],
"policy": {
"name": "existing-path",
"initial_query": "text",
"refinement_query": "overwritten",
"required_marker": "overwritten",
"max_rounds": 2
},
"result_sha256": "735b9907d3f2670aca53e2608a616dbd1becbb5124335b231b3ff13409f0f80d"
},
"body_sha256_header": "16208bae1e792e807e6b8007af051170e0b8a18f6b514ba020606574597b312e",
"raw_body_sha256": "16208bae1e792e807e6b8007af051170e0b8a18f6b514ba020606574597b312e",
"raw_response_text": "{\"schema_version\":1,\"execution_mode\":\"offline-scripted-retrieval-http\",\"model_called\":false,\"request_id\":\"c4b35bcad796671fdb9ebd92411172aa68574ee99fecbd854bcef13db24dc067\",\"corpus_id\":\"0615d22a3315e97c0a88c6c566c546877304f5a28a97e83f68dd36881d4bbd0e\",\"request\":{\"question\":\"Will write_text replace the contents of an existing file?\",\"version\":\"3.12\",\"max_steps\":6,\"max_searches\":2,\"max_reads\":2,\"max_source_bytes\":4096},\"status\":\"failed\",\"reason\":\"retrieval_failed\",\"admission\":{\"accepted\":true,\"limits\":{\"max_steps\":6,\"max_searches\":2,\"max_reads\":2,\"max_source_bytes\":4096}},\"usage\":{\"steps\":1,\"searches\":1,\"reads\":0,\"reserved_source_bytes\":0,\"delivered_source_bytes\":0},\"trace\":[{\"action\":{\"tool\":\"search\",\"arguments\":{\"query\":\"text\",\"version\":\"3.12\",\"k\":2}},\"decision\":\"executed\",\"invoked\":true,\"reserved_source_bytes\":0,\"status\":\"failed\",\"reason\":\"tool_failure\",\"usage_after\":{\"steps\":1,\"searches\":1,\"reads\":0,\"reserved_source_bytes\":0,\"delivered_source_bytes\":0}}],\"evidence\":[],\"policy\":{\"name\":\"existing-path\",\"initial_query\":\"text\",\"refinement_query\":\"overwritten\",\"required_marker\":\"overwritten\",\"max_rounds\":2},\"result_sha256\":\"735b9907d3f2670aca53e2608a616dbd1becbb5124335b231b3ff13409f0f80d\"}"
},
"lifecycle": {
"command": [
"python3",
"serve.py",
"--fd",
"<inherited-loopback-socket>",
"--app",
"api:app"
],
"startup_observed": true,
"shutdown_exit_status": -15,
"stdout": "",
"stderr": "INFO: Started server process [16900]\nINFO: Waiting for application startup.\nINFO: Application startup complete.\nINFO: Shutting down\nINFO: Waiting for application shutdown.\nINFO: Application shutdown complete.\nINFO: Finished server process [16900]\n",
"shutdown_complete_observed": true,
"server_process_reaped": true
},
"fault_lifecycle": {
"command": [
"python3",
"serve.py",
"--fd",
"<inherited-loopback-socket>",
"--app",
"fault_fixture:app"
],
"startup_observed": true,
"shutdown_exit_status": -15,
"stdout": "",
"stderr": "INFO: Started server process [16908]\nINFO: Waiting for application startup.\nINFO: Application startup complete.\nINFO: Shutting down\nINFO: Waiting for application shutdown.\nINFO: Application shutdown complete.\nINFO: Finished server process [16908]\n",
"shutdown_complete_observed": true,
"server_process_reaped": true
},
"interpretation": "Real local HTTP boundary plus scripted retrieval; no generated answers, external deployment, authorization, capacity or quality claim."
}
Trace a refusal and a limited request
Compare an invalid request with a valid request that reaches its source-byte allowance. Locate the HTTP status, admission flag, trace and usage counters in each response. Then check a successful reply’s raw byte digest against its header and explain why that check is not server authentication.
Read the explanation
Read the HTTP status, retrieval status, admission decision and source data together.
What’s next
Continue with Build a retrieval inspector.
References
The official FastAPI request-body guide and lifespan documentation, checked on 23 October 2026, describe request models and startup/shutdown hooks used by the pinned installation. Byte admission, strict JSON parsing, response hashes and the retrieval status policy are application code choices verified by this lab’s actual HTTP cases.