Skip to content

feat(cli): report render block and a console line when cloud rendering falls back - #1707

Closed
nc9 wants to merge 2 commits into
mainfrom
feat/report-render-block-1664
Closed

nc9 wants to merge 2 commits into
mainfrom
feat/report-render-block-1664

Conversation

@nc9

@nc9 nc9 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1664 (the report half; the waiter union is #1704). Schema 1.11, claimed by lead: 1.10 is #1692 (storeIntegrity). The bump is the LAST commit, so after #1692 merges this rebases with the version line, the docs sentence and the four version assertions kept in order 1.9, 1.10, 1.11.

When cloud rendering stopped partway, the reason was only a logger.warn, so a user paying for render could get plain-HTTP pages with no report-level note, and an agent could not tell which pages were rendered.

What

  • Report JSON gets a top-level render block, the LLM report a <render .../> element, and the console one line when rendering fell back:
"render": { "requested": true, "mode": "all", "fallbackReason": "out of credits", "pagesRendered": 12, "pagesFetchedPlain": 28 }

Cloud rendering fell back to plain HTTP (out of credits): 12 of 40 pages were rendered, the rest fetched as plain HTML.

  • requested: cloud rendering was asked for (flag, config or level). mode: all, auto (HTTP first, render client-rendered shells) or http, from the resolved fetcher's id. fallbackReason: only when rendering was asked for and did not carry the crawl: the render fetcher's own terminal reason (out of credits, not authenticated, run no longer active, N consecutive cloud failures; via terminalFallbackReason, not reimplemented) plus the two cases that never built a render fetcher (not logged in, cloud unavailable (signed out or unreachable)).
  • Counts come from the fetcherId each page:fetched event reports (cloud-render or browser = rendered), so they are pages THIS audit fetched; a page reused unchanged from an earlier audit is in neither. A single page the renderer could not reach is fetched directly and counted plain, with no fallbackReason.
  • Pure and table-tested in apps/cli/src/audit/render-summary.ts; resolveDocumentFetcher takes an optional hook so the controller hears the reason. No behaviour of rendering itself changes.

Acceptance criteria

  • JSON and LLM output state the render mode, rendered vs plain page counts and the fallback reason: render-summary.test.ts, render-1664.test.ts
  • Console prints one line when render fell back, with the reason: renderFallbackLine (tested); wired after the cloud spend line
  • Waiter state is one union: refactor(audit-engine): cloud-fetcher waiter state is one union, not three booleans #1704
  • Docs: configuration/output lists the render block and cli/audit has "When rendering falls back"

Checks

render-summary (21), resolve-document-fetcher (5, incl. the two hook cases), report render-1664 (7) and outcome-1657, json-pages-1260, reconstruct-page-rule-counts-1260, the include-pages and unstored-pages e2e (schema 1.11). tsgo (cli, report, core-contracts), root lint, cli format:check, make validate. Temp HOME. Goldens not run locally. CHANGELOG bullet under Unreleased.

Agent skill and docs

  • squirrelscan agent skill (squirrelscan/skills): No change required. The skill does not describe the report JSON or the render settings, so nothing in it goes stale. An agent that wants the new render block reads it from the report; if we later want agents to re-run with --render when render.fallbackReason is set, that is a separate skill change with its own issue.
  • Docs: docs/configuration/output.mdx (the render block and the schema 1.11 line) and docs/cli/audit.mdx ("When rendering falls back") are present.

@nc9

nc9 commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Landed on main as af70284, a9a5931 (later commits there carry the review fixes). Closing this draft as superseded.

nik

@nc9 nc9 closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant