Skip to content

Add schema validation for .thinktank result files#126

Merged
that-github-user merged 1 commit into
mainfrom
issue-69-schema-validation
Mar 29, 2026
Merged

Add schema validation for .thinktank result files#126
that-github-user merged 1 commit into
mainfrom
issue-69-schema-validation

Conversation

@that-github-user

Copy link
Copy Markdown
Owner

Summary

  • parseAndValidateResult() validates required EnsembleResult fields
  • All commands (list, apply, stats, evaluate) validate before use
  • Invalid files skipped with warning instead of crashing
  • 24 new tests for schema validation

Generated by thinktank Opus — 5 agents, 4/5 pass, Copeland: #1 at +3.

Change type

  • New feature

Related issue

Closes #69

How to test

npm test  # 215 tests pass
echo '{"bad": "data"}' > .thinktank/run-test.json
thinktank list  # should skip the bad file with warning
rm .thinktank/run-test.json

Breaking changes

  • This PR introduces breaking changes

🤖 Generated with thinktank (Opus)

parseAndValidateResult() checks required fields before use. All commands
that load result files now validate and skip/warn on invalid data instead
of crashing. 24 new tests for valid/invalid schemas.

Generated by thinktank Opus (5 agents, 4 pass, Copeland: #1 at +3).

Closes #69

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@that-github-user that-github-user merged commit 7ada8e3 into main Mar 29, 2026
4 checks passed
@that-github-user that-github-user deleted the issue-69-schema-validation branch March 29, 2026 01:59
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.

Add schema validation when loading .thinktank result files to prevent cryptic crashes

1 participant