feat: schema reorganization, strict_ost schema, and terminology updates#24
Merged
Conversation
8fd1b83 to
0234438
Compare
This PR consolidates multiple related improvements to the schema system and terminology across the codebase. **Schema Organization (#13, #20)** - Move command files to src/commands/ directory - Create new src/schema.ts with consolidated schema loading functions - buildSchemaRegistry(), loadSchema(), createValidator() - New: loadHierarchy(), resolveRef() helpers - Extract schema-specific logic from config.ts **New strict_ost Schema (#15)** - Add schemas/strict_ost.json for 4-level OST hierarchy - Add schemas/_strict.json for shared strict schema definitions - Enforce required fields: metric (outcome), source (opportunity), assumption (experiment) - Add experiment category enum validation - Comprehensive test coverage in tests/validate-strict.test.ts - Fix: schemas/ directory with shared $refs and registry loading **Schema Enhancements (#14)** - Add type aliases: assumption_test, test → experiment - Add fourth-layer entity type to general schema - Move hardcoded concepts into schema definitions **Terminology Updates (#22)** - Rename: "OST node" → "space node" throughout codebase - Rename: readOstPage → readSpaceOnAPage - Rename: readOst* → readSpace* functions - Rename: tests/fixtures/ost/ → tests/fixtures/general/ - Rename: tests/fixtures/invalid-ost/ → tests/fixtures/general/invalid-ost/ - Rename: tests/fixtures/valid-ost/ → tests/fixtures/general/valid-ost/ **Related Changes** - Reorganize fixtures by schema (general/, strict_ost/) - Update all imports and references - Add vscode/settings.json for project workspace - Update docs/concepts.md with canonical terminology Closes #13, #14, #15, #20, #22
0234438 to
a4b89a0
Compare
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
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.
Summary
This PR consolidates multiple related improvements to the schema system and terminology across the codebase, addressing issues #13, #14, #15, #20, and #22.
Schema Organization (#13, #20)
src/schema.ts: Consolidated schema loading functionsbuildSchemaRegistry()- builds registry of schemas by $idloadSchema()- loads and bundles schemas with resolved external refscreateValidator()- compiles AJV validatorsloadHierarchy()- extracts hierarchy array from schema metadataresolveRef()- resolves $refs within schemassrc/commands/directoryconfig.tsNew strict_ost Schema (#15)
schemas/strict_ost.json: Canonical 4-level OST hierarchymetric(outcome),source(opportunity),assumption(experiment)assumption_test,test→experimentschemas/_strict.json: Shared strict schema definitionstests/validate-strict.test.tsSchema Enhancements (#14)
Terminology Updates (#22)
readOstPage→readSpaceOnAPagereadOst*→readSpace*functionstests/fixtures/ost/→tests/fixtures/general/tests/fixtures/invalid-ost/→tests/fixtures/general/invalid-ost/tests/fixtures/valid-ost/→tests/fixtures/general/valid-ost/tests/fixtures/strict_ost/for strict_ost fixturesRelated Changes
.vscode/settings.jsonfor project workspacedocs/concepts.mdwith canonical terminologydocs/schemas.mdfor schema documentationTest Plan
tsc --noEmitbiome checkCloses #13, #14, #15, #20, #22