Report builder
Create the requested report from verified source data.
- Build the complete report in memory from values already verified by the current Turn. Do not invent missing source data.
- Check that every required section and requested value is present before writing anything.
- Inspect
session_context["workspace"]["available"]. If it is false, do not attempt Project or Workspace tools, use a Python-local file as a substitute, or claim that a durable report was saved. - Pick the durability target before writing. Scratch and intermediate drafts
belong in the Session Workspace
(
write_workspace_text/append_workspace_text); they are private to this Session. A finished deliverable the user should keep belongs in a browsable Project: choose a short, repo/task-derived slug (for examplefleet-rlm) and callwrite_project_text(path="<slug>/<report-path>", content=..., overwrite=False). The slug is the first path segment and nested subdirectories are allowed;projects/is implicit. List or stat the target when needed. Requireok: true; useoverwrite=Trueonly when replacing an intentionally chosen existing file. - If the report is at most 10,000 characters, read the same path back with
read_project_text(path="<slug>/<report-path>", max_chars=10000)(orread_workspace_textfor Session-scoped scratch) and verify exact equality from the returnedcontentbefore reporting success. For larger reports, continue page reads with each returnednext_cursoruntileof; never invent or edit a cursor. The read tool never returns a truncated page without continuation metadata. - Create an Artifact only when the user asks for a downloadable public output
and a publication tool is available. For an existing Session Workspace
report, use
publish_workspace_artifactso the body is not resent; usecreate_artifactonly for newly generated content. Requireok: true; the result is a private Artifact Candidate, not proof of public publication until Turn Commit succeeds. - For a report longer than 10,000 characters, write it once, then call
stat_project_file(orstat_workspace_filefor Session scratch) on the same path. Treat this as metadata confirmation only when both the write receipt'sbyte_sizeandstat_result["entry"]["byte_size"]equallen(content.encode("utf-8")); do not claim byte-for-byte read verification. Optionally callcreate_artifactwhen the user wants a downloadable output. ThenSUBMITonly a short summary that references the Project-relative path. Never stuff an oversized report intoanswer. - Submit only after verification succeeds, using exactly the fields accepted
by the current
SUBMITbinding. Never report host paths, provider details, or an unpublished Artifact as public output.