Skip to content

Emit SVG materials as inspect pointers - #300

Open
laznuzzi wants to merge 1 commit into
block:mainfrom
laznuzzi:codex-svg-material-inspect-pointers
Open

laznuzzi wants to merge 1 commit into
block:mainfrom
laznuzzi:codex-svg-material-inspect-pointers

Conversation

@laznuzzi

Copy link
Copy Markdown

Why

Ghost currently treats SVG files as inlineable text during pull. That sends the complete SVG source and path data into the generation context, where an agent can truncate, transcribe, or reconstruct the artwork instead of reusing the approved file. This is especially visible with logo assets: Square and Cash App both supply complete SVG marks, but the transport contract makes their path data look like source to reproduce.

Raster images already travel as inspect pointers. SVGs should follow the same visual-asset path so every harness receives the exact reusable file rather than a textual approximation opportunity.

What

  • Classify SVG and other recognized image materials as image inspect pointers during pull
  • Keep SVG path data out of Markdown and JSON pull payloads
  • Emit an explicit inspect path and agent-facing action for visual assets
  • Tell agents to copy or reference the complete inspected asset rather than transcribing its path data
  • Add focused Square- and Cash App-style SVG logo regression coverage
  • Add a patch changeset for @design-intelligence/ghost

How

Material transport now checks the inferred content kind before text inlining. Recognized image MIME types return image inspect-pointer; other binary assets retain binary inspect-pointer, and eligible text materials continue to inline as untrusted reference data.

The pull formatter handles both pointer reasons, using the inferred material kind to distinguish viewable images from other available assets. The installed skill guidance and material references describe the same delivery contract.

Risk

Low to moderate. This intentionally changes SVG pull behavior from inline source to an inspect pointer. Consumers that relied on SVG source appearing directly in a pull packet will need to inspect the supplied path instead. Text materials and non-image binary assets keep their existing behavior.

Testing

  • pnpm build — passed
  • pnpm test — 332 passed, 1 skipped
  • pnpm check — passed
  • Commit hooks (check, format, sadscan, test) — passed
  • Push hooks (check-push-org, ci) — passed
  • Real Square foundation.logo assets — 4/4 SVGs delivered as inspect pointers with no path payloads
  • Real Cash App foundation.identity assets — 7/7 SVGs delivered as inspect pointers with no path payloads

Generated with Codex

@nahiyankhan
nahiyankhan self-requested a review September 18, 2026 20:05
await writeBareTestPackage(dir);
await mkdir(join(dir, "brand"), { recursive: true });
const svg = '<svg viewBox="0 0 10 10"><path d="M0 0h10v10H0z"/></svg>';
await writeFile(join(dir, "brand", "square-logo.svg"), svg);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove square or cash app specific tests

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.

2 participants