Add Entity Registration to @refrakt-md/plan
Summary
The @refrakt-md/plan package defines five rune types (spec, work, bug, decision, milestone), each with an id attribute — but the package has no pipelineHooks. This means plan entities are invisible to the xref resolution pipeline.
Add a register() hook to the plan package that scans transformed pages for plan runes and registers them in the EntityRegistry. Once registered, any page can use {% xref "SPEC-008" /%} or {% xref "WORK-015" /%} to link to plan documents.
Acceptance Criteria
- Plan package exports
pipelineHookswith aregister()hook - The hook registers entities for all five rune types:
spec,work,bug,decision,milestone - Each entity includes:
id,title(from heading),url(page URL),status, and type-specific fields {% xref "SPEC-008" /%}resolves to a link when plan content is in the pipeline{% xref "WORK-015" /%}resolves with typework- Type hints work:
{% xref "ADR-001" type="decision" /%}narrows the search - Tests cover registration and resolution of all five entity types
Approach
Follow the pattern in corePipelineHooks.register (packages/runes/src/config.ts). Walk each page's renderable tree, find nodes with typeof matching plan schema types (Spec, Work, Bug, Decision, Milestone), extract the id property meta tag, and call registry.register() with the appropriate entity type and data fields.
Relationships
Related
- WORK-022doneworkBuild backlog Rune
- WORK-049doneworkDependency visualization for plan site
- SPEC-008reviewspecUnbuilt Runes — High-Level Spec
- WORK-015doneworkBuild track and playlist Runes
- ADR-001accepteddecisionAstro Readiness Investigation
- WORK-035doneworkplan serve and plan build Commands
- WORK-030doneworkplan update Command
- WORK-021doneworkUpdate Plan Documents to Use Xref Syntax