docbridge 0.6.1 → 0.7.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/CHANGELOG.md CHANGED
@@ -7,6 +7,99 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.7.0] - 2026-08-16
11
+
12
+ ### Added
13
+
14
+ - Rust is a first-party code language. Configure `include.code.rust`, place
15
+ `@doc` in `///` / `//!` / `/** */` comments on modules, structs, enums, free
16
+ functions, and inherent `impl` methods, and check links with the bundled
17
+ `docbridge-rust-scanner` worker (same platforms as Swift/Dart). Default
18
+ visibility is `pub` only; set `visibility` to include `private` for
19
+ non-`pub` items. Canonical IDs use Rust path style (`Type::method`).
20
+ - `docbridge docs list [--json]` and `docbridge docs show <name>` provide six
21
+ task-oriented, version-matched guides from the installed npm package, with
22
+ packed-package smoke coverage under Node.js and Bun.
23
+ - CLI invocation errors now list valid commands, suggest close command names,
24
+ and include runnable command-specific recovery guidance. Missing check
25
+ configuration also points to `docbridge init` and `docbridge init-with-agent`.
26
+ - TypeScript type members can be link endpoints, closing the last functional
27
+ asymmetry with Swift and Dart. `@doc` on a class method, property, getter,
28
+ setter, constructor, or static member, on an interface member, or on a member
29
+ of a type alias written directly as an object type literal resolves to a
30
+ type-qualified endpoint such as `AuthService.login`. Canonical IDs carry no
31
+ parameter signatures: overload groups and getter/setter pairs each describe
32
+ one member and collapse to one endpoint, and a collision — including a static
33
+ and an instance member of the same name — reports `duplicate_code_symbol`.
34
+ Only identifier-named members qualify, because a link target is
35
+ `file#fragment` with one `#` and no whitespace.
36
+ - `include.code.typescript.visibility` accepts `public`, `protected`, and
37
+ `private`, defaulting to `public` and `protected`. It scopes type members
38
+ only; top-level declarations remain scoped by `export`.
39
+
40
+ ### Changed
41
+
42
+ - Scanner worker request and response payloads now have a published JSON Schema,
43
+ and malformed nested worker output fails explicitly instead of degrading into
44
+ incomplete scan data. Graph and context output schemas share their diagnostic
45
+ definitions and are checked against real CLI output. The configuration schema
46
+ now matches the CLI's per-language suffix and visibility rules.
47
+ - `docbridge context` and `docbridge graph --include-content` strip the common
48
+ leading indentation from an extracted declaration, so a type member reads at
49
+ its own level. Output for top-level declarations is unchanged.
50
+ - A `@doc` on a TypeScript type member was previously collected by nothing and
51
+ silently ignored. It is now a real annotation, so an existing one can surface
52
+ link diagnostics — `invalid_link_target`, `doc_file_not_found`,
53
+ `doc_anchor_not_found`, `doc_backlink_not_found` — that were always latent,
54
+ and an annotation on a `private` member becomes `unsupported_declaration`.
55
+ `check --audit` output is unchanged: members never count as
56
+ `undocumented_symbol`.
57
+ - `docbridge check --audit` reports `unlinked_doc_section`, a warning for
58
+ in-scope documentation sections that carry no `@code` annotation. It is the
59
+ documentation-side counterpart to `undocumented_symbol`, so the audit now
60
+ covers both directions of the link graph. Reporting is rolled up over the
61
+ heading tree: only the topmost heading of a fully unannotated subtree is
62
+ reported, and a heading is treated as annotated whenever a `@code` comment is
63
+ attached to it, even if that annotation fails to parse or resolve. Empty
64
+ headings create no anchor and are never reported, but they still close the
65
+ section before them, so a deeper heading following one is a separate region
66
+ rather than a suppressed descendant. Runs
67
+ without `--audit` are unaffected, and the diagnostic is a warning, so exit
68
+ codes do not change.
69
+
70
+ ### Fixed
71
+
72
+ - Swift and Dart scanners now report malformed and duplicate `@doc` targets as
73
+ `invalid_link_target` and `duplicate_link`, matching TypeScript instead of
74
+ silently accepting or discarding the annotations.
75
+ - `docbridge graph --include-content` no longer truncates a signature at an
76
+ object type. It cut the rendered text at the first `{`, which for
77
+ `login(options: { verbose: boolean })` produced `login(options: {}`. A
78
+ `signatureRange` already ends where the implementation body begins in every
79
+ language, so no body has to be cut out of it.
80
+ - The VS Code extension manifest is version-aligned with the npm package again
81
+ (`0.4.1` had drifted from `0.6.1`), so a checkout of `main` is a valid input
82
+ to `just package-vsix`. Release Prepare now bumps both manifests through
83
+ `scripts/set-release-version.ts` and stages both in the release commit, so a
84
+ CLI release can no longer leave the extension version behind.
85
+ - `just package-vsix` bundles the server the VSIX ships with `--target node`,
86
+ matching the npm build. The Bun-targeted bundle it built before still carried
87
+ a `#!/usr/bin/env node` shebang and crashed with `__require is not a function`
88
+ when the packaging flow's own `verify-dist` step executed it.
89
+
90
+ ### Removed
91
+
92
+ - The agent-hook integration is gone from the product surface: the copyable
93
+ scripts under `examples/hooks/` and the hook recipes in
94
+ `docs/integrations/claude-code.md` and `docs/integrations/codex.md` no longer
95
+ ship. Wiring DocBridge into an agent's `PostToolUse`/`Stop` hooks covered only
96
+ the agents that read those configuration files; the documented guardrail is
97
+ now a Git `pre-commit` hook, which applies to every contributor and every
98
+ tool. Both integration documents survive as skill-installation guides,
99
+ `docbridge context` and `docbridge related --gate` are unchanged, and
100
+ `docbridge docs show agent-integration` describes the Git-hook shape instead.
101
+ Copies already installed in adopters' repositories keep working.
102
+
10
103
  ## [0.6.1] - 2026-07-27
11
104
 
12
105
  ### Changed
@@ -222,7 +315,8 @@ Initial release of the SpecLink CLI.
222
315
  - `speclink check` command with `--root`, `--json`, and `--audit` options.
223
316
  - `speclink --version` (alias `-v`) and `speclink --help` (alias `-h`).
224
317
 
225
- [Unreleased]: https://github.com/salan70/docbridge/compare/v0.6.1...HEAD
318
+ [Unreleased]: https://github.com/salan70/docbridge/compare/v0.7.0...HEAD
319
+ [0.7.0]: https://github.com/salan70/docbridge/releases/tag/v0.7.0
226
320
  [0.6.1]: https://github.com/salan70/docbridge/releases/tag/v0.6.1
227
321
  [0.6.0]: https://github.com/salan70/docbridge/releases/tag/v0.6.0
228
322
  [0.5.2]: https://github.com/salan70/docbridge/releases/tag/v0.5.2
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Bring Markdown into the LSP world.
8
8
 
9
- DocBridge creates bidirectional links between TypeScript, Swift, or Dart code
9
+ DocBridge creates bidirectional links between TypeScript, Swift, Dart, or Rust code
10
10
  and Markdown documentation, enabling LSP-like experiences such as Hover,
11
11
  Definition, References, and Diagnostics across implementation and specification
12
12
  files.
@@ -22,13 +22,13 @@ npx docbridge check
22
22
  bunx docbridge check
23
23
  ```
24
24
 
25
- The current release is
26
- [v0.5.0](https://github.com/salan70/docbridge/releases/tag/v0.5.0), published
27
- as `docbridge@0.5.0` on npm.
25
+ See the npm badge above or
26
+ [Releases](https://github.com/salan70/docbridge/releases) for the current
27
+ version.
28
28
 
29
- The package includes prebuilt Swift and Dart scanner
29
+ The package includes prebuilt Swift, Dart, and Rust scanner
30
30
  binaries for `darwin-arm64` and `linux-x64`. TypeScript and Markdown checks run
31
- without scanner binaries. Configured Swift or Dart projects on unsupported
31
+ without scanner binaries. Configured Swift, Dart, or Rust projects on unsupported
32
32
  platforms report `code_scanner_unavailable` and name the supported platform
33
33
  keys.
34
34
 
@@ -98,6 +98,16 @@ bunx docbridge check
98
98
 
99
99
  ## Usage
100
100
 
101
+ Discover a command:
102
+
103
+ ```sh
104
+ bunx docbridge --help
105
+ bunx docbridge context --help
106
+ ```
107
+
108
+ Every command accepts `--help` (alias `-h`) and prints its usage, when to use
109
+ it, and its options on stdout.
110
+
101
111
  Check links:
102
112
 
103
113
  ```sh
@@ -124,7 +134,8 @@ bunx docbridge check --audit
124
134
 
125
135
  Audit diagnostics include:
126
136
 
127
- - `undocumented_symbol`
137
+ - `undocumented_symbol` — in-scope code endpoints with no `@doc`
138
+ - `unlinked_doc_section` — in-scope documentation sections with no `@code`
128
139
 
129
140
  List the linked counterparts of changed files:
130
141
 
@@ -193,7 +204,7 @@ Code <-> Documentation
193
204
  ```
194
205
 
195
206
  DocBridge links supported code declarations to Markdown sections. TypeScript is
196
- scanned in-process; Swift and Dart are scanned through bundled first-party
207
+ scanned in-process; Swift, Dart, and Rust are scanned through bundled first-party
197
208
  worker packages.
198
209
 
199
210
  ## Supported Inputs
@@ -205,11 +216,15 @@ Supported code declarations:
205
216
  - TypeScript top-level exported declarations: `function`, `class`,
206
217
  `abstract class`, `interface`, `type`, `const`, `enum`, and supported
207
218
  `declare` / named default forms
219
+ - TypeScript type members: class methods, properties, accessors, constructors,
220
+ and static members, plus interface and object-type-alias signatures
208
221
  - Swift public/open declarations and configured internal declarations:
209
222
  top-level and member types, functions, variables, constants, initializers,
210
223
  and extension members
211
224
  - Dart public declarations: top-level functions/variables, classes, enums,
212
225
  mixins, constructors, fields, accessors, methods, and extension members
226
+ - Rust `pub` declarations (and configured non-`pub` with `visibility`):
227
+ modules, structs, enums, free functions, and inherent `impl` methods
213
228
 
214
229
  Supported Markdown elements:
215
230
 
@@ -217,8 +232,29 @@ Supported Markdown elements:
217
232
  - HTML comments
218
233
  - `@code` annotations attached to the next heading
219
234
 
220
- Swift and Dart use the same `@doc` and `@code` model. Their code fragments are
221
- the scanner-produced canonical IDs, so members are type-qualified:
235
+ All four languages use the same `@doc` and `@code` model. Code fragments are
236
+ the scanner-produced canonical IDs, so members are type-qualified.
237
+
238
+ TypeScript member IDs carry no parameter signature; overload signatures and a
239
+ getter/setter pair each collapse to one endpoint, and the constructor is
240
+ `<Type>.constructor`. By default `public` and `protected` members are scanned;
241
+ `private` members require `include.code.typescript.visibility`. Members are
242
+ linkable but are never reported by `check --audit`.
243
+
244
+ ```ts
245
+ export class AuthService {
246
+ /** @doc docs/auth.md#login-spec */
247
+ login(email: string, password: string): void {}
248
+ }
249
+ ```
250
+
251
+ ```md
252
+ <!-- @code src/auth/service.ts#AuthService.login -->
253
+
254
+ ## Login Spec
255
+ ```
256
+
257
+ Swift, Dart, and Rust canonical IDs follow their own conventions:
222
258
 
223
259
  ```swift
224
260
  /// @doc docs/auth.md#login-spec
@@ -268,27 +304,27 @@ shape is intentionally invalid; migrate it to a `typescript` entry:
268
304
  }
269
305
  ```
270
306
 
271
- Swift and Dart projects must build their scanner workers in source checkouts
272
- before checking those languages. Run `just build-swift-scanner` for Swift and
273
- `just build-dart-scanner` for Dart, or use the native test recipes below.
307
+ Swift, Dart, and Rust projects must build their scanner workers in source checkouts
308
+ before checking those languages. Run `just build-swift-scanner` for Swift,
309
+ `just build-dart-scanner` for Dart, and `just build-rust-scanner` for Rust, or
310
+ use the native test recipes below.
274
311
 
275
312
  ## AI agent integration
276
313
 
277
314
  DocBridge's link graph is built to be consumed by AI coding agents:
278
315
 
279
316
  - [docs/integrations](docs/integrations) — recipes for Claude Code, Codex,
280
- and CI: on-edit counterpart awareness with `docbridge context`, gate triage
281
- with `docbridge related --gate`, and PR reporting.
282
- - [examples/hooks](examples/hooks) — copyable agent hook scripts implementing
283
- those recipes.
317
+ and CI: gate triage with `docbridge related --gate`, counterpart content with
318
+ `docbridge context`, and PR reporting.
284
319
  - [templates/skills](templates/skills) — distributable agent skills installed by
285
320
  `docbridge init`; `docbridge init-with-agent` installs `docbridge-adopt`
286
- first, then `docbridge-adopt` installs the companion skills:
287
- `docbridge-annotate`, `docbridge-sync`, `docbridge-adopt`, `docbridge-link`,
288
- and `docbridge-review`.
321
+ alone, then `docbridge-adopt` installs the companion skills:
322
+ `docbridge-annotate`, `docbridge-link`, `docbridge-review`, and
323
+ `docbridge-sync`.
289
324
 
290
- This repository dogfoods the hooks and skills in its own guardrails under
291
- `.claude/`, `.codex/`, and `.agents/`.
325
+ This repository dogfoods the skills under `.claude/` and `.agents/`, and keeps
326
+ its guardrail in the Git `pre-commit` hook under `.githooks/` rather than in
327
+ any agent's configuration.
292
328
 
293
329
  ## Editor support
294
330
 
@@ -339,6 +375,8 @@ Errors:
339
375
  - `duplicate_doc_anchor`
340
376
  - `duplicate_code_symbol`
341
377
  - `code_parse_error`
378
+ - `code_scanner_unavailable`
379
+ - `code_scanner_failed`
342
380
  - `file_read_error`
343
381
 
344
382
  Warnings:
@@ -347,6 +385,7 @@ Warnings:
347
385
  - `dangling_code_annotation`
348
386
  - `unsupported_declaration`
349
387
  - `undocumented_symbol` when `--audit` is enabled
388
+ - `unlinked_doc_section` when `--audit` is enabled
350
389
 
351
390
  Exit code policy:
352
391
 
@@ -373,7 +412,7 @@ repository setup, testing matrix, commit convention, and pull request workflow.
373
412
 
374
413
  ## Roadmap
375
414
 
376
- Completed v0.1–v0.5 capabilities are documented above and in
415
+ Completed v0.1–v0.6 capabilities are documented above and in
377
416
  [CHANGELOG.md](CHANGELOG.md).
378
417
 
379
418
  Remaining editor delivery work:
@@ -1,2 +1,3 @@
1
- e5dc0117b9afe4e617fac20f9a8cf9797fa307f66d5a3f12e8ea6554639adce3 docbridge-swift-scanner
2
- 8268ae8b1d3329a96ce30590c8f177b0c19ea1a887a458647e04d8d295c74a71 docbridge_dart_scanner
1
+ bc9e7548f993e48d280c3a487be4cc90a3e6549491c6f93f0e518ccc4239d991 docbridge-swift-scanner
2
+ ceb237b7e5b2047d091f961c0a43ba436b8c624c741cc7f864e5783d9248a4eb docbridge_dart_scanner
3
+ a1b129d980c981a2d24f0c9682e614a9695d4e9f9b8174d61b0dacb3fc9e3c79 docbridge-rust-scanner
@@ -1,2 +1,3 @@
1
- 396d365794cb5c427817b358bb3d9f2280000cd33fe3fc7d6d5a772a29ebcae4 docbridge-swift-scanner
2
- b5de2b74d56c6d8c9f8edd859d4b0d8846ff32d8e1d50b6fa41683d9a310b9f5 docbridge_dart_scanner
1
+ 114f780cebfb8834f200ef60f3a828ca7dc4668b23f6e646971e3e56c377b37a docbridge-swift-scanner
2
+ 095c4c172da615be155bee15dcce7b99faaf2a8bb26f3cad3e0b17881495ddf2 docbridge_dart_scanner
3
+ d89a1146ed10dcb01151ef5351a746862c3955286431c47f3cf91cf6639866ba docbridge-rust-scanner