script/inkrail.exe is currently a small demo CLI for inspecting MyST label / ref relationships.
For this repository, it is now configured against docs/source through:
docs/source/.inkrail/config.toml
The important project-specific fix is:
roots = ["."]
Without that change, inkrail scans nothing because the generated default config pointed at a non-existent docs directory relative to docs/source/.inkrail/.
In the current DocuTouch corpus, inkrail is useful for four things:
- Checking whether MyST labels are discoverable at all.
- Locating the definition of a label quickly.
- Finding incoming references to a label before renaming or restructuring a page.
- Running lightweight broken-reference and duplicate-id checks.
It is not yet a full graph explorer for this corpus. In practice:
query --definitionworks.query --incomingworks.check --brokenworks.check --duplicatesworks.statsworks.query --outgoing,walk, andpathdid not produce useful graph edges on the current corpus during validation.
Treat it as a backlink / lookup helper, not as authoritative graph traversal.
The current docs/source corpus was validated with:
.\script\inkrail.exe stats .\docs\sourceObserved result at the time of validation:
targets: 135refs: 78broken refs: 0duplicate ids: 0
check --orphans reports many warnings on this corpus. That is expected and mainly means many labels do not currently have incoming refs.
Run commands from the repository root:
.\script\inkrail.exe stats .\docs\sourceUse this to confirm the tool is actually seeing the corpus.
.\script\inkrail.exe query docs-root-contract .\docs\source --definitionGood for jumping to the canonical location of a label.
.\script\inkrail.exe query docs-root-contract .\docs\source --incomingThis is the most useful command right now. Use it before:
- renaming a label
- moving a page
- merging pages
- deleting a page-level object
.\script\inkrail.exe check .\docs\source --brokenFor this project, this is the safest health check to run in day-to-day work.
.\script\inkrail.exe check .\docs\source --duplicatesThis is useful after adding many new labels.
.\script\inkrail.exe check .\docs\source --orphansThis is informational, not a hard failure signal for the current corpus.
.\script\inkrail.exe query docs-root-contract .\docs\source --incomingValidated result on this repository:
index.md:7730_records/20_migration/docs_markdown_migration_ledger.md:25
.\script\inkrail.exe query knowledge-interfaces-apply-patch-semantics .\docs\source --incomingValidated result on this repository shows incoming refs from:
10_knowledge/60_decisions/apply_patch_warning_first_rationale.md10_knowledge/60_decisions/apply_splice_apply_patch_separation_rationale.md15_process_assets/10_exec_plans/apply_patch_semantics_hardening_plan.mdindex.md
These behaviors were observed during validation:
query <target> --outgoingreturned no useful edges even when the page visibly contains{ref}links.walkreturned empty outgoing expansions for page labels such asdocs-rootandmeta-index.pathcould not find paths that should exist if page-level outgoing refs were modeled.
So for now, the reliable mental model is:
- labels are indexed
- incoming refs are indexed
- outgoing traversal is not yet reliable on this corpus
When editing docs/source, use inkrail like this:
- Find the label you plan to change with
query --definition. - Check backlinks with
query --incoming. - Make the doc change.
- Run
check --broken. - If you introduced many new labels, also run
check --duplicates.
This gives real value already, even with the current traversal limitation.