Skip to content

feat: schema reorganization, strict_ost schema, and terminology updates#24

Merged
mindsocket merged 3 commits into
mainfrom
feat/schema-reorg-and-terminology
Feb 28, 2026
Merged

feat: schema reorganization, strict_ost schema, and terminology updates#24
mindsocket merged 3 commits into
mainfrom
feat/schema-reorg-and-terminology

Conversation

@mindsocket
Copy link
Copy Markdown
Owner

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)

  • New src/schema.ts: Consolidated schema loading functions
    • buildSchemaRegistry() - builds registry of schemas by $id
    • loadSchema() - loads and bundles schemas with resolved external refs
    • createValidator() - compiles AJV validators
    • loadHierarchy() - extracts hierarchy array from schema metadata
    • resolveRef() - resolves $refs within schemas
  • Command file organization: Move command files to src/commands/ directory
  • Extract schema-specific logic from config.ts

New strict_ost Schema (#15)

  • schemas/strict_ost.json: Canonical 4-level OST hierarchy
    • outcome → opportunity → solution → experiment
    • Enforces required fields: metric (outcome), source (opportunity), assumption (experiment)
    • Experiment category enum validation (desirability, viability, feasibility, usability, ethical)
    • Type aliases: assumption_test, testexperiment
  • schemas/_strict.json: Shared strict schema definitions
  • Comprehensive test coverage: 88 tests passing in tests/validate-strict.test.ts
  • Fix: Schema directory with shared $refs and registry loading

Schema Enhancements (#14)

  • Add type aliases for experiment types
  • Add fourth-layer entity type to general schema
  • Move hardcoded concepts into schema definitions

Terminology Updates (#22)

  • "OST node" → "space node" throughout codebase
  • Function renames:
    • readOstPagereadSpaceOnAPage
    • readOst*readSpace* functions
  • Fixture reorganization:
    • tests/fixtures/ost/tests/fixtures/general/
    • tests/fixtures/invalid-ost/tests/fixtures/general/invalid-ost/
    • tests/fixtures/valid-ost/tests/fixtures/general/valid-ost/
    • New tests/fixtures/strict_ost/ for strict_ost fixtures

Related Changes

  • Add .vscode/settings.json for project workspace
  • Update docs/concepts.md with canonical terminology
  • Add docs/schemas.md for schema documentation
  • Reorganize fixtures by schema (general/, strict_ost/)
  • Update all imports and references

Test Plan

  • All 88 unit tests passing
  • Type validation with tsc --noEmit
  • Linting passes with biome check
  • Existing tests work with new terminology
  • New strict_ost schema has comprehensive test coverage

Closes #13, #14, #15, #20, #22

@mindsocket mindsocket force-pushed the feat/schema-reorg-and-terminology branch 2 times, most recently from 8fd1b83 to 0234438 Compare February 28, 2026 00:51
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
@mindsocket mindsocket force-pushed the feat/schema-reorg-and-terminology branch from 0234438 to a4b89a0 Compare February 28, 2026 10:15
Comment thread tests/read-space-on-a-page-general.test.ts Outdated
Comment thread src/types.ts Outdated
mindsocket and others added 2 commits March 1, 2026 08:45
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
@mindsocket mindsocket merged commit 0ab2b62 into main Feb 28, 2026
1 of 2 checks passed
@mindsocket mindsocket deleted the feat/schema-reorg-and-terminology branch February 28, 2026 23:33
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.

Reorganize schema files into schemas/ directory with shared refs and space-level config

1 participant