Repository navigation
feat!: annotationsFrom takes structured-context's per-node issues - #30
Merged
Merged
Conversation
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Rog · project thread
Why
annotationsFromread three parts ofValidationResultand 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) addednodeIssues(result), and 0.22.1 (#214) addedVALIDATION_ISSUE_KINDS/ValidationIssueKind. With both, each result's kind and severity come from one place.What
annotationsFromtakes{ issues, ruleViolations? }.issuescomes from core'snodeIssues(result)or from theissuesofsctx validate --json. Only global-scope rule violations are read fromruleViolations.sctx validate --jsonoutput can be passed in as it is.AnnotationSourceis core'sValidationIssueKind.nodes.validationSourcestakes its enum and default from core'sVALIDATION_ISSUE_KINDS, so map-views keeps no list of its own. Severity is read from each issue.structured-context/types, which imports nothing itself and so is browser-safe. AGENTS.md says so.nodes.validationSourcesaccepts all seven kinds and defaults to all of them.schemas/generated/latestis regenerated.UnattachedAnnotationhasline/columninstead oflocation. The navigator's panel shows the line.validationis now theValidationInput. So is the navigator's/api/validationresponse.structured-contextis now^0.22.1.Breaking:
ValidationInputchanges shape andUnattachedAnnotation.locationis gone, so this needs a minor release. After it, the #205 map pane can droppaneValidation.Checks
bun test(78 pass),bun run typecheckandbun run lintpass locally.test:packagecan't build in my sandbox, because a CDN fetch is blocked there (main fails the same way), so CI covers it. Docs are updated inapi.md,definitions.md,concepts.md,architecture.mdand AGENTS.md.🤖 Generated with Claude Code
https://claude.ai/code/session_019XphpeYuD7ZmLX2HstqAK2