Skip to content

feat!: annotationsFrom takes structured-context's per-node issues - #30

Merged
mindsocket merged 3 commits into
mainfrom
claude/project-thread-1jqws4
Nov 9, 2026
Merged

mindsocket merged 3 commits into
mainfrom
claude/project-thread-1jqws4

Conversation

@mindsocket

@mindsocket mindsocket commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Requested by Rog · project thread

Why

annotationsFrom read three parts of ValidationResult and set their severity itself, so schema and hierarchy results were always errors. Duplicate ids, broken links, gated notes and unresolved content links didn't show at all unless a host folded them into another part, as the Claude Code mod's map pane did. structured-context 0.22 (mindsocket/structured-context#213) added nodeIssues(result), and 0.22.1 (#214) added VALIDATION_ISSUE_KINDS / ValidationIssueKind. With both, each result's kind and severity come from one place.

What

  • New input. annotationsFrom takes { issues, ruleViolations? }. issues comes from core's nodeIssues(result) or from the issues of sctx validate --json. Only global-scope rule violations are read from ruleViolations. sctx validate --json output can be passed in as it is.
  • Sources come from core. AnnotationSource is core's ValidationIssueKind. nodes.validationSources takes its enum and default from core's VALIDATION_ISSUE_KINDS, so map-views keeps no list of its own. Severity is read from each issue.
  • One runtime import from core. The module-boundaries test now allows structured-context/types, which imports nothing itself and so is browser-safe. AGENTS.md says so.
  • Definition format (additive). nodes.validationSources accepts all seven kinds and defaults to all of them. schemas/generated/latest is regenerated.
  • Unattached results. UnattachedAnnotation has line/column instead of location. The navigator's panel shows the line.
  • Hosts. The export snapshot's validation is now the ValidationInput. So is the navigator's /api/validation response.
  • Dependency. structured-context is now ^0.22.1.

Breaking: ValidationInput changes shape and UnattachedAnnotation.location is gone, so this needs a minor release. After it, the #205 map pane can drop paneValidation.

Checks

bun test (78 pass), bun run typecheck and bun run lint pass locally. test:package can't build in my sandbox, because a CDN fetch is blocked there (main fails the same way), so CI covers it. Docs are updated in api.md, definitions.md, concepts.md, architecture.md and AGENTS.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_019XphpeYuD7ZmLX2HstqAK2

annotationsFrom picked three parts of ValidationResult and decided their
severity itself: schema and hierarchy results were always errors, and
duplicate ids, broken links, gated notes and content links weren't shown
unless a host folded them into another part. It now takes each node's
issues (structured-context's `nodeIssues`, or the `issues` of
`sctx validate --json`) and the global rule violations, reading every
result's kind and severity from structured-context.

- AnnotationSource is the issue kind: schema, duplicate, broken-link,
  hierarchy, rule, gated, content-link. `nodes.validationSources` accepts
  them all and defaults to all.
- UnattachedAnnotation carries `line`/`column` instead of `location`.
- The export snapshot's `validation` is the ValidationInput.

Needs the structured-context release with `nodeIssues`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpeYuD7ZmLX2HstqAK2
AnnotationSource is structured-context's ValidationIssueKind, and the
definition format's validationSources enum and default use core's
VALIDATION_ISSUE_KINDS, so the kinds live in one place. Core is allowed
one runtime import, `structured-context/types`, which imports nothing
itself. The fallback for unknown kinds goes: the type guarantees the kind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpeYuD7ZmLX2HstqAK2
@mindsocket
mindsocket merged commit cefa9b6 into main Nov 9, 2026
1 check passed
@mindsocket
mindsocket deleted the claude/project-thread-1jqws4 branch November 9, 2026 11:46
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