@sledorze/cairn 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -1
- package/dist/cli.js +1011 -526
- package/dist/cli.js.map +1 -1
- package/dist/core/Config.d.ts +1 -1
- package/dist/core/Config.d.ts.map +1 -1
- package/dist/core/Config.js +1 -1
- package/dist/core/Config.js.map +1 -1
- package/dist/core/hashing.d.ts +3 -0
- package/dist/core/hashing.d.ts.map +1 -0
- package/dist/core/hashing.js +16 -0
- package/dist/core/hashing.js.map +1 -0
- package/dist/core/links/Anchors.d.ts +30 -0
- package/dist/core/links/Anchors.d.ts.map +1 -0
- package/dist/core/links/Anchors.js +119 -0
- package/dist/core/links/Anchors.js.map +1 -0
- package/dist/core/links/MarkdownLinks.bench.d.ts.map +1 -0
- package/dist/core/links/MarkdownLinks.bench.js.map +1 -0
- package/dist/core/links/MarkdownLinks.d.ts +121 -0
- package/dist/core/links/MarkdownLinks.d.ts.map +1 -0
- package/dist/core/links/MarkdownLinks.js +228 -0
- package/dist/core/links/MarkdownLinks.js.map +1 -0
- package/dist/core/links/RefStore.d.ts +32 -0
- package/dist/core/links/RefStore.d.ts.map +1 -0
- package/dist/core/links/RefStore.js +60 -0
- package/dist/core/links/RefStore.js.map +1 -0
- package/dist/core/links/markdownFences.d.ts +10 -0
- package/dist/core/links/markdownFences.d.ts.map +1 -0
- package/dist/core/links/markdownFences.js +51 -0
- package/dist/core/links/markdownFences.js.map +1 -0
- package/dist/core/paths.d.ts +8 -0
- package/dist/core/paths.d.ts.map +1 -1
- package/dist/core/paths.js +13 -0
- package/dist/core/paths.js.map +1 -1
- package/dist/core/sidecar.d.ts +45 -0
- package/dist/core/sidecar.d.ts.map +1 -0
- package/dist/core/sidecar.js +83 -0
- package/dist/core/sidecar.js.map +1 -0
- package/dist/core/{DocSummaries.d.ts → summaries/DocSummaries.d.ts} +0 -2
- package/dist/core/summaries/DocSummaries.d.ts.map +1 -0
- package/dist/core/{DocSummaries.js → summaries/DocSummaries.js} +6 -8
- package/dist/core/summaries/DocSummaries.js.map +1 -0
- package/dist/core/summaries/StampStore.d.ts +19 -0
- package/dist/core/summaries/StampStore.d.ts.map +1 -0
- package/dist/core/summaries/StampStore.js +34 -0
- package/dist/core/summaries/StampStore.js.map +1 -0
- package/dist/core/summaries/SummaryTree.bench.d.ts.map +1 -0
- package/dist/core/{SummaryTree.bench.js → summaries/SummaryTree.bench.js} +2 -1
- package/dist/core/summaries/SummaryTree.bench.js.map +1 -0
- package/dist/core/summaries/SummaryTree.d.ts.map +1 -0
- package/dist/core/{SummaryTree.js → summaries/SummaryTree.js} +4 -3
- package/dist/core/summaries/SummaryTree.js.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/program/JsonReport.d.ts +2 -2
- package/dist/program/JsonReport.d.ts.map +1 -1
- package/dist/program/JsonReport.js +2 -2
- package/dist/program/JsonReport.js.map +1 -1
- package/dist/program/{CheckLinks.d.ts → links/CheckLinks.d.ts} +9 -4
- package/dist/program/links/CheckLinks.d.ts.map +1 -0
- package/dist/program/links/CheckLinks.js +243 -0
- package/dist/program/links/CheckLinks.js.map +1 -0
- package/dist/program/links/CheckRefs.d.ts +47 -0
- package/dist/program/links/CheckRefs.d.ts.map +1 -0
- package/dist/program/links/CheckRefs.js +151 -0
- package/dist/program/links/CheckRefs.js.map +1 -0
- package/dist/program/summaries/CheckSummaries.bench.d.ts.map +1 -0
- package/dist/program/{CheckSummaries.bench.js → summaries/CheckSummaries.bench.js} +6 -4
- package/dist/program/summaries/CheckSummaries.bench.js.map +1 -0
- package/dist/program/{CheckSummaries.d.ts → summaries/CheckSummaries.d.ts} +7 -7
- package/dist/program/summaries/CheckSummaries.d.ts.map +1 -0
- package/dist/program/{CheckSummaries.js → summaries/CheckSummaries.js} +13 -12
- package/dist/program/summaries/CheckSummaries.js.map +1 -0
- package/package.json +3 -2
- package/dist/core/DocSummaries.d.ts.map +0 -1
- package/dist/core/DocSummaries.js.map +0 -1
- package/dist/core/MarkdownLinks.bench.d.ts.map +0 -1
- package/dist/core/MarkdownLinks.bench.js.map +0 -1
- package/dist/core/MarkdownLinks.d.ts +0 -51
- package/dist/core/MarkdownLinks.d.ts.map +0 -1
- package/dist/core/MarkdownLinks.js +0 -115
- package/dist/core/MarkdownLinks.js.map +0 -1
- package/dist/core/StampStore.d.ts +0 -47
- package/dist/core/StampStore.d.ts.map +0 -1
- package/dist/core/StampStore.js +0 -90
- package/dist/core/StampStore.js.map +0 -1
- package/dist/core/SummaryTree.bench.d.ts.map +0 -1
- package/dist/core/SummaryTree.bench.js.map +0 -1
- package/dist/core/SummaryTree.d.ts.map +0 -1
- package/dist/core/SummaryTree.js.map +0 -1
- package/dist/program/CheckLinks.d.ts.map +0 -1
- package/dist/program/CheckLinks.js +0 -122
- package/dist/program/CheckLinks.js.map +0 -1
- package/dist/program/CheckSummaries.bench.d.ts.map +0 -1
- package/dist/program/CheckSummaries.bench.js.map +0 -1
- package/dist/program/CheckSummaries.d.ts.map +0 -1
- package/dist/program/CheckSummaries.js.map +0 -1
- /package/dist/core/{MarkdownLinks.bench.d.ts → links/MarkdownLinks.bench.d.ts} +0 -0
- /package/dist/core/{MarkdownLinks.bench.js → links/MarkdownLinks.bench.js} +0 -0
- /package/dist/core/{SummaryTree.bench.d.ts → summaries/SummaryTree.bench.d.ts} +0 -0
- /package/dist/core/{SummaryTree.d.ts → summaries/SummaryTree.d.ts} +0 -0
- /package/dist/program/{CheckSummaries.bench.d.ts → summaries/CheckSummaries.bench.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -65,11 +65,47 @@ never writes into content either.
|
|
|
65
65
|
| `cairn check --summaries-only --stamp` | Rewrite the `.cairn/` sidecar hash of existing summaries, bottom-up |
|
|
66
66
|
| `cairn check --prune` | Delete orphan summaries and orphan `.cairn/` sidecars |
|
|
67
67
|
| `cairn check --migrate-stamps` | Optional: same self-healing `--stamp` already does, as its own named step |
|
|
68
|
+
| `cairn check --refs --stamp` | Opt-in: record each real reference target's content hash |
|
|
69
|
+
| `cairn check --refs` | Opt-in: report references whose target content has drifted since |
|
|
68
70
|
| `cairn init --agent claude\|copilot\|all` | Scaffold agent guidance files |
|
|
69
71
|
|
|
72
|
+
### Link checking
|
|
73
|
+
|
|
74
|
+
A dead link is only the most obvious way a reference rots. `cairn check` (or
|
|
75
|
+
`--links-only`) verifies, for every relative Markdown link:
|
|
76
|
+
|
|
77
|
+
- **The path resolves** — including targets _outside_ your configured `roots`, as long as
|
|
78
|
+
they stay inside the repository checkout (e.g. a doc in `docs/` linking to `../src/foo.ts`).
|
|
79
|
+
Nothing outside the checkout root is ever touched, even to check existence — this bound is
|
|
80
|
+
deliberate: CI runs over untrusted PR content, and an unbounded filesystem check would be
|
|
81
|
+
an existence oracle.
|
|
82
|
+
- **The `#heading` fragment exists** — same-page (`[intro](#getting-started)`) and
|
|
83
|
+
cross-file (`[intro](./guide.md#getting-started)`), slugged the same way GitHub does.
|
|
84
|
+
- **A `#L10`/`#L10-L20` line-fragment is in range**, for links to source files outside `roots`.
|
|
85
|
+
|
|
86
|
+
A broken heading or out-of-range line reports with the reason (`path` / `anchor` / `line`)
|
|
87
|
+
and, where possible, what's actually there (the target's real headings, or its real line
|
|
88
|
+
count) — so fixing it doesn't require opening the target file first.
|
|
89
|
+
|
|
90
|
+
`cairn check --refs` is a separate, **opt-in** signal, off by default and not part of the
|
|
91
|
+
`path`/`anchor`/`line` checks above: it tracks the _content_ of what a link points to, not
|
|
92
|
+
just whether the link resolves. `--refs --stamp` records a hash of every reference target;
|
|
93
|
+
a later `--refs` run reports any that changed since — "this doc's claim about that file may
|
|
94
|
+
be stale," distinct from a broken link (the link still resolves; what it once meant may not
|
|
95
|
+
still hold). Still v1/experimental (whole-file hashing only — a one-line unrelated change to
|
|
96
|
+
a large target file is reported the same as a change to the exact part being referenced).
|
|
97
|
+
|
|
70
98
|
### Upgrading from an older cairn
|
|
71
99
|
|
|
72
|
-
|
|
100
|
+
**If you're upgrading past `0.3.0`**: link checking got stricter. Anchors and links outside
|
|
101
|
+
`roots` were previously accepted unconditionally, whether or not they actually resolved —
|
|
102
|
+
`cairn` simply never looked. If `cairn check` newly fails after upgrading, the links it's
|
|
103
|
+
flagging were already broken; nothing about your docs changed, only the tool's ability to
|
|
104
|
+
notice did. Fix the flagged link/anchor, or, if a genuine false positive (e.g. a symbol-level
|
|
105
|
+
anchor like `x.ts#someExport` — deliberately never checked, see the source's own scenario
|
|
106
|
+
notes), please open an issue.
|
|
107
|
+
|
|
108
|
+
Nothing to look up for the summary/stamp side. If a summary still carries the old in-content
|
|
73
109
|
`<!-- source-sha256: ... -->` comment, the ordinary `--stamp` command strips it and
|
|
74
110
|
writes the `.cairn/` sidecar in the same run — automatically, every time. There is no
|
|
75
111
|
separate migration step to discover: whatever `stampCommand` your repo already runs
|