Skip to content

Add urlcode report: a read-only review page for a project or a change - #749

Merged
jimhoyd merged 1 commit into
mainfrom
claude/urlcode-yaml-ui-design-bd670c
Sep 25, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
claude/urlcode-yaml-ui-design-bd670c

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Problem and change

Reviewing an agent-made change meant reading urlcode diff, review and explain output separately, as YAML or JSON. urlcode report [BEFORE] [--policy F] [--host-file F] [--json] > report.html puts them on one self-contained page for a person:

  • Needs attention. Fix items: an operator policy pinned to another revision or missing an env, secret or egress grant the project requests (compared by name with urlcode permissions); an add-on the host file does not register or registers for another revision; an add-on requirement that fails its policy schema. Check items: disabled or expired routes, review findings, and with BEFORE: new function or middleware code, sandbox: flips, newly requested grants and removed routes.
  • Changes since BEFORE, as plain sentences, with project-wide grant releases grouped by name.
  • Routes, each opening to its request path: match, policies, add-on requirements, middleware, handler, caching and the targets that refuse it.

It is a view over existing contracts, not a new analysis: routes are exactly explainProject's output (a test asserts this), findings are reviewProject's and changes are summarizeChange's. Handler details render generically, so new handlers and fields appear without a change to the report. The only derived logic is the attention list (packages/core/src/project-report.ts).

Docs: new review report section, the AI-AUTHORING hand-back step, llms.txt, and one sentence in the generated starter guidance (edited through agents-guide.ts, kept within its 80-line budget).

Verification

  • npm run verify: pass, 0 failures.
  • npm run test:package: pass (packed install and starter/cookbook checks).
  • test/project-report.test.ts (8 tests): routes equal explain's output; output is deterministic; project text is escaped and no <script> is emitted; a before/after change (new code, sandbox flip, requested secret, removed route, YAML-file side); missing and stale host registrations; policy with all grants, partial grants and a stale pin; grouped grant releases; the CLI with --json and --policy.
  • Tried on a private production project against an older revision, with node dist/cli.js: it listed the new trusted function, the removed route and the released grants, and with its local policy flagged a stale pin and one ungranted env name. That finding was checked: two core versions compute the same revision hash.

Not run: a real host.mjs (host checks are tested with synthetic registrations).

Compatibility and security

  • New CLI command; report joins hostFileCommands and policyCommands. No YAML, schema or runtime change.

  • Read-only: no project code runs, no binding value is read (a policy holds names only), and nothing is granted. It shows no value its sources omit.

  • The page escapes all project text and carries Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline', so it is safe to publish as a PR artifact.

  • Passing --policy and --host-file whose pins disagree stops with the same error dev gives (documented).

  • Changes match the documented portable contract; docs/examples are updated where needed.

  • Relevant tests and package checks pass, or limitations are explained above.

  • No credentials, customer data or private project material are included.

  • Runtime/starter changes remain aligned where applicable.

🤖 Generated with Claude Code

…a change

`urlcode report [BEFORE] [--policy F] [--host-file F] [--json]` prints one
self-contained HTML page for the person reviewing a change: what needs
attention, what changed since BEFORE and, per route, what happens to a
request.

It is a view over existing contracts, not a new analysis: routes are exactly
explainProject's output, findings are reviewProject's and changes are
summarizeChange's, so the page follows those contracts as they grow and
handler details render generically. The only derived data is the attention
list: add-ons the host file does not register or registers for another
revision, invalid add-on requirements, disabled/expired routes, review
findings, new code, sandbox flips, newly requested grants and removed routes,
plus a by-name comparison of an operator policy with requestedPermissions
(stale pin, ungranted env/secret/egress).

No value reaches the page that those outputs omit and no project code runs.
Project text is escaped and the page carries a CSP allowing no script, so it
is safe to publish as a PR artifact. Output is deterministic.

Docs: TOOLING.md review-report section, the AI-AUTHORING hand-back step,
llms.txt and the generated starter guidance.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jimhoyd
jimhoyd enabled auto-merge (squash) September 25, 2026 13:25
@jimhoyd
jimhoyd merged commit f185c0e into main Sep 25, 2026
27 checks passed
@jimhoyd
jimhoyd deleted the claude/urlcode-yaml-ui-design-bd670c branch September 25, 2026 13:30
jimhoyd added a commit that referenced this pull request Sep 25, 2026
Studio (#751) and the report (#749) were documented only in TOOLING.md,
llms.txt and the CLI help. Add a row to the docs index, a sentence in the
README's "Try it", and name studio next to report in the AI-authoring
hand-back step. llms-full.txt regenerated.

Co-authored-by: Claude Opus 5.5 <[email protected]>
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