Skip to content

feat(lib): view-builder.mjs and view-runtime.js with report and interactive profiles #5852

Description

@kyle-sexton

Parent

Refs #5835
Source: PLAN, topic karpathy-comprehension

What to build

The shared view library: view-builder.mjs builds a page from a checked-in template plus a JSON data block, and view-runtime.js is the client runtime inlined into each page. Two profiles: report and interactive (the validator profile from rendered-views v2). Pages carry an SVG allowlist, data in an escaped JSON block, and a CSP whose script hashes match the inlined runtime. Output works opened from file:// and published as an Artifact. Distributed to plugins through the regen flow.

Settled, do not re-decide: K2 content is builder-only (template plus escaped JSON, never model-written script); the runtime is inlined per page.

Relates to #3603 (migrating grandfathered HTML surfaces).

Acceptance criteria

  • view-builder produces report and interactive pages and rejects input that breaks the selected profile.
  • A hostile-input corpus (script tags, event handlers, javascript: URLs, SVG script, JSON breakout) is in the test suite and none of it executes or escapes the data block.
  • The page's CSP hashes match its inlined scripts and the page renders under that CSP.
  • A sample page works from file:// and as a published Artifact.
  • Both files are registered with the regen flow.

Blocked by

Activity

  1. added
    area: security
    agent-ready
    on Oct 2, 2026
  2. added
    needs-triage
    on Oct 2, 2026
  3. added and removed
    needs-triage
    on Oct 2, 2026
  4. self-assigned this
    on Oct 2, 2026
  5. kyle-sexton commented on Oct 2, 2026

    @kyle-sexton
    MemberAuthor
    No description provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: security

Fields

No fields configured for Feature.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions