Skip to content

Render Discovery/Decomposition + generic JSON fallback in ArtifactInspector#28

Merged
Extentsoftware merged 1 commit intomainfrom
claude/trusting-hamilton-3e1178
May 10, 2026
Merged

Render Discovery/Decomposition + generic JSON fallback in ArtifactInspector#28
Extentsoftware merged 1 commit intomainfrom
claude/trusting-hamilton-3e1178

Conversation

@Extentsoftware
Copy link
Copy Markdown
Owner

Summary

  • Adds explicit renderers for DiscoveryObject ({title, intent, outcomes, hypotheses, open_questions, stakeholders}) and DecompositionProposal ({children: [...]}) shapes — both were being stored under Criteria / Risks artifact kinds and falling through to raw JSON in the inspector.
  • Adds a depth-capped generic structured JSON view (headings for objects, <ul> for string arrays, ws-table for object arrays) as the final fallback.
  • Fallback chain also probes Criteria and Risks shapes, so an off-kind body still renders properly.
  • When the declared ArtifactKind has a known schema but the content didn't match it, a small muted note flags the drift: "Content didn't match expected schema for {Kind} — rendering generically."

All changes are in src/Loom.Web/Components/Pages/ArtifactInspector.razor. No new projects, no new packages.

Test plan

  • Open the affected Risks-kind artifact carrying decomposition data — should now render as a Slug/Title/Type/Parent/Intent table with the muted mismatch note.
  • Open the affected Criteria-kind artifact carrying discovery data — should render the discovery view (outcomes list, hypotheses + stakeholders tables, open-questions list) with the mismatch note.
  • Open a correctly-shaped Criteria artifact — renders unchanged, no warning.
  • Open a correctly-shaped Risks artifact — renders unchanged, no warning.
  • Body that isn't valid JSON — still renders as <pre>, no warning.

🤖 Generated with Claude Code

…factInspector

The per-kind Content renderer fell through to a raw <pre> blob whenever
the body didn't match the renderer's expected schema. In practice this
hit two real shapes — DiscoveryObject stored as Criteria, and
DecompositionProposal stored as Risks — leaving users staring at raw
JSON.

Add explicit renderers for those two shapes, plus a depth-capped generic
JSON view for anything else that parses as JSON but matches no known
schema. The fallback also probes Criteria and Risks shapes, so a body
that happens to match those still renders properly regardless of the
declared kind. When the artifact's declared kind has a known schema but
the content didn't match, a small muted note flags the drift.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Extentsoftware Extentsoftware merged commit 4aceadf into main May 10, 2026
1 check passed
@Extentsoftware Extentsoftware deleted the claude/trusting-hamilton-3e1178 branch May 10, 2026 19:50
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