okf-gem · docs
CLI · judge

okf loose

Which files float in the graph?

When to use it

  • After a burst of authoring, to see which new concepts never got wired into the graph.
  • On a curation pass, as the quick answer to "which files float?" without reading a full okf lint report.
  • Before restructuring, to find the concepts nothing would miss if they moved.

How it works

loose lists every concept with graph degree 0: no cross-links in and none out. It is a focused, folder-organized view over lint's unlinked check; okf loose <dir> reports the same set as okf lint <dir> --only unlinked, regrouped by directory so you can scan a directory at a time.

A loose file is not automatically a defect. A terminal leaf (a backlog item, a spec reference) can be loose by design. The verb surfaces the set so you can judge intent: link the files that should participate in the graph, leave the deliberate leaves alone. It is advisory and always exits 0.

Try it

okf loose docs/
Loose files - docs (3)

  decisions/
    adr-0007-webhooks.md  ADR 0007: webhooks over polling

  features/bundles/
    entry-editor.md  Entry editor
    entry-history.md  Entry history

For a machine, okf loose docs/ --json emits { bundle, count, loose: [{ id, title, dir }] } as compact single-line JSON.

Pitfalls

  • Loose is not orphan. Lint's orphan check is about reachability, and an index.md listing makes a file reachable, so an indexed file is never an orphan. But an index listing is not a graph edge: a file can sit in an index and still have zero cross-links. loose catches exactly that gap.
  • An empty report is not proof of curation. Every concept having at least one link says nothing about whether the links are the right ones; run okf lint for the full reachability picture.
  • You cannot gate on it. loose always exits 0, on purpose, because a loose file can be intentional. Treat the output as a worklist to judge, not a failure list.
esc
navigate open