tasks
Load User Authored Space Schemas
Goal
Load and validate schema definitions from .forma/spaces/*.md so repository migration can express task, member, planning, and knowledge relationship fields as Forma Schema DSL instead of relying on built-in starter schemas.
Sources
- architecture/repository-forma-workspace-migration-design
- architecture/forma-p0-schema-dsl-spec
- architecture/forma-view-query-model
- tasks/migrate-repository-knowledge-to-forma-workspace
In Scope
- Parse user-authored
schemafrontmatter from space definition files. - Preserve existing starter fallback behavior only where no schema is configured.
- Validate configured schema fields with existing Schema DSL diagnostics.
- Make schema-declared
entryReffields available to indexing and graph field edge rendering.
Out of Scope
- Migrating repository content.
- Adding write-capable repair operations.
- Implementing MCP.
- Supporting JSON Schema as the user-authored schema format.
Acceptance Criteria
- A space file can define a
schemaobject in frontmatter and have it drive entry validation. - Existing starter workspaces without explicit schemas continue to load.
- Graph views can render
source: fieldsedges from schema-declared reference fields. - Focused tests cover schema loading, fallback behavior, and at least one field-relation graph edge.
Implementation Notes
crates/forma-core/src/config.rsnow prefers user-authoredschemafrontmatter from space definition files.- Spaces without an explicit
schemastill use the existing starter fallback schema. crates/forma-core/src/render.rshas a graph rendering regression test that proves a customprojectreference field from a user-authored space schema can produce a configuredsource: fieldsedge.
Review Readiness
| Field | Evidence |
|---|---|
| Scope completed | User-authored space schemas load into runtime config; fallback behavior is preserved; schema-declared entryRef fields can drive graph field edges. |
| Files changed | crates/forma-core/src/config.rs, crates/forma-core/src/render.rs, and this task. |
| Knowledge updated | Yes: this task records implementation notes and review evidence. |
| Checks run | cargo test, Prettier check for changed knowledge files, forma check --json, forma config inspect --json, forma list --space tasks --json, and forma workspace health --json passed or returned the existing accepted health warning baseline. |
| Residual risks | Existing repository task metadata still uses wikilink strings; enabling stricter ref schemas for the real repository spaces should wait for content migration/normalization. |
| Suggested review | Verify the schema-loading fallback path and the custom field-relation graph test. |