tasks
Implement Resource Description Health Diagnostics
Goal
Detect resource description documents whose target resource file is missing.
Sources
- tasks/implement-workspace-resource-routes
- tasks/expose-read-only-knowledge-health-in-webapp
- architecture/forma-p0-check-index-spec
- architecture/forma-p0-operation-api-spec
Context
Workspace resource routes and resource file inventory are separate from knowledge-entry checks. A non-Markdown resource such as assets/logo.png may exist without a Markdown description document. When a description document such as assets/logo.png.md exists, it represents knowledge about the resource and the described target should exist.
The raw route/resource inventory baseline does not need to own this health rule. The rule belongs with diagnostic and health behavior so users can find broken resource documentation without making resources part of spaces, graph nodes, backlinks, or normal knowledge-entry validation.
In Scope
- Detect Markdown resource description documents whose filename-derived target resource is missing.
- Emit a diagnostic such as
resource.description.missingTargetwith the description document path and missing target path. - Keep resource files themselves out of spaces, graph nodes, backlinks, and knowledge-entry checks by default.
- Add focused Rust coverage for present-resource and missing-resource cases.
- Update operation or health documentation if the diagnostic becomes an API contract.
Out Of Scope
- Requiring every resource file to have a description document.
- Adding a required
targetfrontmatter field. - Full media preview UI.
- Automatic fixes or file creation.
- Changing raw route access rules.
Acceptance Criteria
assets/logo.png.mdwith an existingassets/logo.pngdoes not produce a missing-target diagnostic.assets/logo.png.mdwithoutassets/logo.pngproduces aresource.description.missingTargetdiagnostic.- The diagnostic uses workspace-relative POSIX paths only.
- Non-Markdown resources do not become space entries, graph nodes, or backlink participants because of this check.
- Focused Rust checks pass for the changed diagnostic behavior.
Relationship Notes
This task follows the raw route/resource inventory baseline. The blockedBy entry records dependency history and is resolved once tasks/implement-workspace-resource-routes is in Done.
It can feed the read-only workspace health WebApp task.
Validation Notes
- Implemented
resource.description.missingTargetin core workspace discovery. - Added focused Rust coverage for present-resource and missing-resource description documents.
- Updated check/index and operation API architecture docs for the new diagnostic contract.
- Validation passed on 2026-05-25:
cargo test -p forma-core resource_description_documents_report_missing_targetscargo test -p forma-corecargo test -p forma-rpcpnpm exec prettier --check "knowledge/**/*.md"mise run check:rustgit diff --check