Skip to content

Codebase cleanup: schema fixes, CI validation, and documentation improvements#14

Merged
gvonness-apolitical merged 1 commit intomainfrom
cleanup/codebase-improvements-v2
Feb 1, 2026
Merged

Codebase cleanup: schema fixes, CI validation, and documentation improvements#14
gvonness-apolitical merged 1 commit intomainfrom
cleanup/codebase-improvements-v2

Conversation

@gvonness-apolitical
Copy link
Copy Markdown
Collaborator

Summary

  • Schema fixes: Add missing allOf conditions for horizontalRule and break block types; fix tableCell children to require blocks only (resolving oneOf validation ambiguity); fix cross-schema references to use full URLs
  • CI/CD: Add GitHub Action for automated schema compilation and example document validation
  • Documentation: Create comprehensive example document demonstrating all block types; update spec for tableCell changes; add strategic insights to design-decisions.md; archive strategy notes

Details

Schema Fixes

  1. horizontalRule/break validation (content.schema.json): These block types were defined in $defs but missing from the allOf conditional chain, causing documents using them to not validate correctly.

  2. tableCell children ambiguity (content.schema.json): The oneOf: [textNode, block] pattern was ambiguous because both schemas have a type field. Changed to block-only (consistent with listItem). Updated spec documentation and examples accordingly.

  3. Cross-schema references (annotations.schema.json, phantoms.schema.json): Changed relative references like anchor.schema.json#/$defs/contentAnchor to full URLs https://codex.document/schemas/anchor.schema.json#/$defs/contentAnchor for proper JSON Schema resolution.

CI/CD

New GitHub Action (.github/workflows/validate-schemas.yml) that:

  • Compiles all schemas to verify they're valid JSON Schema
  • Validates example documents against their schemas
  • Handles cross-schema references properly

Documentation

  • Comprehensive example: New examples/comprehensive-document/ demonstrating all block types including horizontalRule, break, definitionList, measurement, signature, svg, barcode, and figure
  • Spec updates: Updated spec/core/03-content-blocks.md with tableCell block-only requirement and fixed all table examples
  • Strategic insights: Added summary of key strategic decisions to docs/design-decisions.md
  • Archive: Moved raw strategy conversation notes to docs/archive/

Test plan

  • All schemas compile successfully with ajv-cli
  • All example documents validate against their schemas
  • horizontalRule and break blocks validate correctly
  • Cross-schema references resolve properly

Schema fixes:
- Add missing allOf conditions for horizontalRule and break block types
- Fix tableCell children to require blocks only (not textNode), resolving oneOf ambiguity
- Fix cross-schema references to use full URLs instead of relative paths

CI/CD:
- Add GitHub Action for automated schema and example validation
- Handle cross-schema references with -r flag for annotations and phantoms schemas

Documentation:
- Create comprehensive example document demonstrating all block types
- Update spec to reflect tableCell block-only children requirement
- Add tableCell content rule and update examples in spec
- Update Editors field in introduction
- Add strategic insights summary to design-decisions.md
- Archive strategy conversation notes to docs/archive/
@gvonness-apolitical gvonness-apolitical merged commit 80eb0bb into main Feb 1, 2026
2 checks passed
@gvonness-apolitical gvonness-apolitical deleted the cleanup/codebase-improvements-v2 branch February 1, 2026 04:55
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.

1 participant