Skip to content

refactor(validate): one checking core with validateSpace and validateFile as views - #159

Merged
mindsocket merged 2 commits into
mainfrom
issue-154
Oct 16, 2026
Merged

mindsocket merged 2 commits into
mainfrom
issue-154

Conversation

@mindsocket

@mindsocket mindsocket commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Closes #154. Stacked on #158.

Summary

  • One validation core, validateNodes, with validateSpace and validateFile as views over it. validateFile returns the part of a full run that belongs to one file.
  • The CLI resolves a file's space once instead of twice.
  • No behaviour change. The public validateFile signature and FileValidationResult are unchanged, and there are no new exports.

Tests

  • Parity: for every file in a fixture space, validateFile reports the issues validateSpace reports for that file.
  • Pinned existing discrepancy, not changed here: in a space without a hierarchy, a node failing an expression rule gets no judging of its semantic rules; in a hierarchy it does.
  • Invalid-type error lists allowed types alphabetically, as before.

Note

The two views key an invalid type issue differently (schema:type:… against schema:/type:enum:…). This predates the refactor (measured: same on main); the parity test normalises it.

@claude

claude Bot commented Oct 16, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Comment thread tests/validate/validate-views.test.ts Resolved
Base automatically changed from issue-147 to main October 16, 2026 04:10
…File as views

- One core, validateNodes, runs all checks.
- validateSpace and validateFile are two views over it.
- The CLI resolves a file's space once.
- No behaviour change. The no-hierarchy discrepancy is preserved and pinned by a test.
…type error

measured: directory order differs on Linux, where another fixture's AJV /type
const error came first and has no allowedValues.
@mindsocket
mindsocket merged commit e6e651f into main Oct 16, 2026
2 checks passed
@mindsocket
mindsocket deleted the issue-154 branch October 16, 2026 06:22
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.

Refactor validateSpace and validateFile into one core with two views

1 participant