docbridge 0.11.0 → 0.12.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 +56 -1
- package/README.md +16 -9
- package/dist/bin/darwin-arm64/SHA256SUMS +3 -3
- package/dist/bin/darwin-arm64/docbridge-go-scanner +0 -0
- package/dist/bin/darwin-arm64/docbridge-swift-scanner +0 -0
- package/dist/bin/darwin-arm64/docbridge_dart_scanner +0 -0
- package/dist/bin/linux-x64/SHA256SUMS +2 -2
- package/dist/bin/linux-x64/docbridge-go-scanner +0 -0
- package/dist/bin/linux-x64/docbridge-swift-scanner +1 -1
- package/dist/index.js +1761 -678
- package/dist/workers/java/docbridge-java-scanner.jar +0 -0
- package/dist/workers/python/docbridge_python_scanner/__init__.py +6 -0
- package/dist/workers/python/docbridge_python_scanner/comments.py +177 -0
- package/dist/workers/python/docbridge_python_scanner/declarations.py +318 -0
- package/dist/workers/python/docbridge_python_scanner/links.py +62 -0
- package/dist/workers/python/docbridge_python_scanner/positions.py +75 -0
- package/dist/workers/python/docbridge_python_scanner/protocol.py +105 -0
- package/dist/workers/python/docbridge_python_scanner/scanner.py +214 -0
- package/dist/workers/python/docbridge_python_scanner.py +16 -0
- package/dist/workers/ruby/bin/docbridge-ruby-scanner +10 -0
- package/dist/workers/ruby/lib/docbridge_ruby_scanner/cli.rb +30 -0
- package/dist/workers/ruby/lib/docbridge_ruby_scanner/comments.rb +55 -0
- package/dist/workers/ruby/lib/docbridge_ruby_scanner/compat.rb +39 -0
- package/dist/workers/ruby/lib/docbridge_ruby_scanner/declarations.rb +230 -0
- package/dist/workers/ruby/lib/docbridge_ruby_scanner/links.rb +38 -0
- package/dist/workers/ruby/lib/docbridge_ruby_scanner/positions.rb +50 -0
- package/dist/workers/ruby/lib/docbridge_ruby_scanner/probe.rb +28 -0
- package/dist/workers/ruby/lib/docbridge_ruby_scanner/protocol.rb +161 -0
- package/dist/workers/ruby/lib/docbridge_ruby_scanner.rb +21 -0
- package/docs/README.md +10 -3
- package/docs/user/automation.md +8 -4
- package/docs/user/commands.md +11 -3
- package/docs/user/configuration.md +104 -17
- package/docs/user/getting-started.md +1 -1
- package/docs/user/linking.md +79 -10
- package/docs/user/troubleshooting.md +22 -9
- package/package.json +1 -1
- package/schemas/common-output.schema.json +11 -1
- package/schemas/context-output.schema.json +1 -1
- package/schemas/docbridge.schema.json +95 -2
- package/schemas/graph-output.schema.json +1 -1
- package/schemas/scanner-worker.schema.json +1 -1
- package/templates/skills/docbridge/SKILL.md +12 -2
|
@@ -6,7 +6,9 @@ description: "Configure docbridge.config.json: roots, include patterns, language
|
|
|
6
6
|
|
|
7
7
|
DocBridge loads `docbridge.config.json` from the project root supplied by
|
|
8
8
|
`--root`, or from the current directory by default. Paths and glob patterns are
|
|
9
|
-
interpreted relative to that root.
|
|
9
|
+
interpreted relative to that root. The exact rules for every key, pattern, and
|
|
10
|
+
value are in the
|
|
11
|
+
[Configuration specification](https://github.com/salan70/docbridge/blob/main/docs/specs/configuration.md).
|
|
10
12
|
|
|
11
13
|
<!-- @code src/config/config.ts#loadConfig -->
|
|
12
14
|
|
|
@@ -33,28 +35,104 @@ Declare documentation patterns and at least one supported code language:
|
|
|
33
35
|
}
|
|
34
36
|
```
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
Other languages use the same shape under their own key. A Go project that
|
|
39
|
+
documents its `internal` packages:
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"$schema": "./node_modules/docbridge/schemas/docbridge.schema.json",
|
|
44
|
+
"include": {
|
|
45
|
+
"code": {
|
|
46
|
+
"go": {
|
|
47
|
+
"patterns": ["internal/**/*.go"]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"docs": ["docs/**/*.md"]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
46
54
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
A project can enable more than one language, each with its own patterns, but a
|
|
56
|
+
source file may match only one language.
|
|
57
|
+
|
|
58
|
+
## Languages
|
|
59
|
+
|
|
60
|
+
| Key | Files | `visibility` values | Default | Scanner |
|
|
61
|
+
| ------------ | ---------------------------------------------------- | -------------------------------- | --------------------- | ------------------------- |
|
|
62
|
+
| `typescript` | `.ts`, `.tsx`, `.mts`, `.cts`, not declaration files | `public`, `protected`, `private` | `public`, `protected` | built in |
|
|
63
|
+
| `javascript` | `.js`, `.jsx`, `.mjs`, `.cjs` | `public`, `protected`, `private` | `public`, `protected` | built in |
|
|
64
|
+
| `swift` | `.swift` | `public`, `open`, `internal` | `public`, `open` | `docbridge-swift-scanner` |
|
|
65
|
+
| `dart` | `.dart` | `public` | `public` | `docbridge_dart_scanner` |
|
|
66
|
+
| `rust` | `.rs` | `pub`, `private` | `pub` | `docbridge-rust-scanner` |
|
|
67
|
+
| `go` | `.go` | `exported`, `unexported` | `exported` | `docbridge-go-scanner` |
|
|
68
|
+
| `python` | `.py` | `public`, `private` | `public` | CPython 3.10 or later |
|
|
69
|
+
| `ruby` | `.rb` | `public`, `protected`, `private` | `public` | CRuby 3.3 or later |
|
|
70
|
+
|
|
71
|
+
Patterns must end with one of the language's extensions. The npm package
|
|
72
|
+
bundles the Swift, Dart, Rust, and Go scanners for `darwin-arm64` and
|
|
73
|
+
`linux-x64`; TypeScript, JavaScript, and Markdown need no scanner binary.
|
|
74
|
+
Python and Ruby are scanned by scripts in the package that run on the
|
|
75
|
+
interpreter installed on the machine, on any platform; see
|
|
76
|
+
[Scanner runtimes](#scanner-runtimes).
|
|
77
|
+
|
|
78
|
+
Each language accepts an optional `visibility` array; omitting it uses the
|
|
79
|
+
default above. TypeScript and JavaScript `visibility` applies only to class and
|
|
80
|
+
type members; top-level declarations must be exported, and every JavaScript
|
|
81
|
+
member is `public`. Rust `pub` means unrestricted `pub`, and `private` covers
|
|
82
|
+
every narrower visibility. A declaration excluded by visibility is not an
|
|
83
|
+
endpoint. An `@doc` on an excluded TypeScript or JavaScript member, or on an
|
|
84
|
+
excluded Python or Ruby declaration, is `unsupported_declaration`; the Swift,
|
|
85
|
+
Dart, Rust, and Go scanners ignore an `@doc` on an excluded declaration
|
|
86
|
+
without a diagnostic. See `docbridge docs show linking` for the per-language
|
|
87
|
+
declaration rules, including Dart's and Python's leading-underscore privacy,
|
|
88
|
+
Go's exported-name rule for methods, and Ruby's `private` calls. The
|
|
89
|
+
[Scanning specification](https://github.com/salan70/docbridge/blob/main/docs/specs/scanning.md)
|
|
90
|
+
owns the exact scanner behavior and platform keys.
|
|
91
|
+
|
|
92
|
+
<!-- @code src/config/scanner-runtimes.ts#ScannerRuntimes -->
|
|
93
|
+
|
|
94
|
+
## Scanner runtimes
|
|
95
|
+
|
|
96
|
+
Python and Ruby files are scanned by scripts that run on an interpreter
|
|
97
|
+
installed on the machine: CPython 3.10 or later, and CRuby 3.3 or later, whose
|
|
98
|
+
bundled Prism parses the source. DocBridge looks for `python3`, then `python`
|
|
99
|
+
(`py -3`, then `python` on Windows), and for `ruby` on `PATH`, and checks each
|
|
100
|
+
candidate before using it. The scripts never import or run project code.
|
|
101
|
+
|
|
102
|
+
To use another interpreter, name it under `scanners`:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"include": {
|
|
107
|
+
"code": { "python": { "patterns": ["src/**/*.py"] } },
|
|
108
|
+
"docs": ["docs/**/*.md"]
|
|
109
|
+
},
|
|
110
|
+
"scanners": {
|
|
111
|
+
"python": { "command": ["/opt/python3.12/bin/python3"] }
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`command` is the interpreter followed by its own arguments, as an array rather
|
|
117
|
+
than a shell string; a relative path resolves against the project root.
|
|
118
|
+
Without a configured command, the environment variable
|
|
119
|
+
`DOCBRIDGE_PYTHON_RUNTIME` or `DOCBRIDGE_RUBY_RUNTIME` can name one
|
|
120
|
+
interpreter executable instead. A configured command or variable is the only
|
|
121
|
+
interpreter tried: when it is missing or unusable, the files report
|
|
122
|
+
`code_scanner_unavailable` instead of falling back to `PATH`.
|
|
123
|
+
|
|
124
|
+
A configured command runs with your permissions in the CLI and in the editor
|
|
125
|
+
extension. Review `scanners` in a repository you do not trust before running
|
|
126
|
+
DocBridge there.
|
|
50
127
|
|
|
51
128
|
<!-- @code src/shared/glob.ts#collectFiles -->
|
|
129
|
+
<!-- @code src/config/code-language.ts#collectCodeFiles -->
|
|
52
130
|
|
|
53
131
|
## Excluded files
|
|
54
132
|
|
|
55
|
-
The configuration has no `exclude` property. Narrow the
|
|
56
|
-
tests, fixtures, generated files, or general
|
|
57
|
-
the graph:
|
|
133
|
+
The configuration has no `exclude` property and no glob negation. Narrow the
|
|
134
|
+
positive include patterns when tests, fixtures, generated files, or general
|
|
135
|
+
documentation should stay outside the graph:
|
|
58
136
|
|
|
59
137
|
```json
|
|
60
138
|
{
|
|
@@ -69,8 +147,14 @@ the graph:
|
|
|
69
147
|
}
|
|
70
148
|
```
|
|
71
149
|
|
|
150
|
+
For Go, `cmd/**/*.go` and `internal/**/*.go` scan fewer files than
|
|
151
|
+
`**/*.go`, but `_test.go` files under them are still scanned. For Python and
|
|
152
|
+
Ruby, keep test directories such as `tests/` and `spec/` outside the patterns
|
|
153
|
+
in the same way.
|
|
154
|
+
|
|
72
155
|
DocBridge always ignores dependency directories, Git metadata, dot-prefixed
|
|
73
|
-
path segments, symbolic links, and TypeScript declaration files (`.d.ts
|
|
156
|
+
path segments, symbolic links, and TypeScript declaration files (`.d.ts`,
|
|
157
|
+
`.d.mts`, and `.d.cts`).
|
|
74
158
|
Keep patterns narrow enough that `docbridge check --audit` reports useful
|
|
75
159
|
coverage gaps rather than every implementation detail or general prose file.
|
|
76
160
|
|
|
@@ -81,3 +165,6 @@ file, or invalid JSON, produces `config_file_invalid`. An unknown key produces
|
|
|
81
165
|
`config_unknown_key`, and a rejected value produces `config_invalid_value`. Use
|
|
82
166
|
`docbridge init --dry-run` to inspect a safe generated starting point without
|
|
83
167
|
overwriting an existing file.
|
|
168
|
+
|
|
169
|
+
Next, read `docbridge docs show linking` to add the first links, or
|
|
170
|
+
`docbridge docs show commands` to choose how to check them.
|
package/docs/user/linking.md
CHANGED
|
@@ -7,13 +7,22 @@ description: Choose, create, and semantically review @doc and @code links.
|
|
|
7
7
|
DocBridge connects supported code declarations to Markdown headings. This
|
|
8
8
|
guide covers the complete workflow: choose meaningful sections, create a
|
|
9
9
|
reciprocal annotation pair, and review whether the relationship is still true.
|
|
10
|
+
The exact contracts are in the
|
|
11
|
+
[Annotations](https://github.com/salan70/docbridge/blob/main/docs/specs/annotations.md),
|
|
12
|
+
[Link resolution](https://github.com/salan70/docbridge/blob/main/docs/specs/link-resolution.md),
|
|
13
|
+
and [Link manifest](https://github.com/salan70/docbridge/blob/main/docs/specs/link-manifest.md)
|
|
14
|
+
specifications.
|
|
10
15
|
|
|
11
16
|
## Choose what to link
|
|
12
17
|
|
|
13
18
|
Prefer sections that define behavior, contracts, inputs and outputs,
|
|
14
|
-
constraints, user-visible behavior, or design decisions. README
|
|
15
|
-
changelogs, contribution guides, runbooks,
|
|
16
|
-
|
|
19
|
+
constraints, user-visible behavior, or design decisions. Do not link README
|
|
20
|
+
files, changelogs, contribution guides, runbooks, or release notes unless a
|
|
21
|
+
specific section acts as an enduring specification. `docbridge init` skips
|
|
22
|
+
conventional files such as `README.md`, `CHANGELOG.md`, and `CONTRIBUTING.md`
|
|
23
|
+
when it chooses a documentation directory. DocBridge still scans every
|
|
24
|
+
Markdown file that the configured `docs` patterns match, including a proposed
|
|
25
|
+
`docs/**/*.md`, so narrow the patterns to keep these files out of the graph.
|
|
17
26
|
|
|
18
27
|
Prefer supported public API declarations as code targets. Do not force a link
|
|
19
28
|
when no declaration implements or represents the section, and do not use link
|
|
@@ -79,17 +88,39 @@ pub fn login(email: &str, password: &str) {}
|
|
|
79
88
|
func Login(email, password string) error { return nil }
|
|
80
89
|
```
|
|
81
90
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
```js
|
|
92
|
+
/** @doc docs/auth.md#login-flow */
|
|
93
|
+
export function login(email, password) {}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
def login(email: str, password: str) -> None:
|
|
98
|
+
"""Start the login flow.
|
|
99
|
+
|
|
100
|
+
@doc docs/auth.md#login-flow
|
|
101
|
+
"""
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```ruby
|
|
105
|
+
# @doc docs/auth.md#login-flow
|
|
106
|
+
def login(email, password); end
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Paths are relative to the configured root. An annotation on an unsupported
|
|
110
|
+
declaration, or on a TypeScript, JavaScript, Python, or Ruby declaration
|
|
111
|
+
excluded by visibility, produces `unsupported_declaration`; the same
|
|
112
|
+
declaration without an annotation is ignored. Swift, Dart, Rust, and Go ignore
|
|
113
|
+
an annotation on a declaration excluded by visibility without a diagnostic. To link such a declaration, add
|
|
114
|
+
its tier to `visibility` where the language accepts one; Dart accepts only
|
|
115
|
+
`public`, so a private Dart declaration cannot be linked.
|
|
85
116
|
|
|
86
117
|
### TypeScript declarations
|
|
87
118
|
|
|
88
119
|
Supported top-level exported forms include functions, classes, interfaces,
|
|
89
|
-
type aliases, enums, and single-declarator
|
|
90
|
-
`declare` and named default forms. Supported members
|
|
91
|
-
properties, accessors, constructors, and static members;
|
|
92
|
-
and members of object-literal type aliases.
|
|
120
|
+
type aliases, enums, and single-declarator variables (`const`, `let`, or
|
|
121
|
+
`var`), including supported `declare` and named default forms. Supported members
|
|
122
|
+
include class methods, properties, accessors, constructors, and static members;
|
|
123
|
+
interface members; and members of object-literal type aliases.
|
|
93
124
|
|
|
94
125
|
Members use type-qualified IDs without parameter signatures, such as
|
|
95
126
|
`AuthService.login` and `AuthService.constructor`. Visibility defaults to
|
|
@@ -140,6 +171,44 @@ clause, imports, `init`, and `_` are not endpoints. The scanner is syntactic:
|
|
|
140
171
|
`_test.go` files and `//go:build`-constrained files are scanned whenever the
|
|
141
172
|
patterns match them.
|
|
142
173
|
|
|
174
|
+
### JavaScript declarations
|
|
175
|
+
|
|
176
|
+
JavaScript follows the TypeScript rules for the forms an ES module can
|
|
177
|
+
express: exported functions, classes, and single-declarator variables, named
|
|
178
|
+
default exports, and the members of exported classes, with the same JSDoc
|
|
179
|
+
comments and IDs such as `AuthService.login`. Every member is `public`;
|
|
180
|
+
`#private` members are not endpoints. CommonJS assignments such as
|
|
181
|
+
`module.exports = ...` and `exports.name = ...` are not endpoints, so an
|
|
182
|
+
`@doc` on one is `unsupported_declaration`. JSX parses in every JavaScript
|
|
183
|
+
file. TypeScript-only syntax, such as an `interface`, a `type` alias, or a type
|
|
184
|
+
annotation, is a syntax error in a JavaScript file and is reported as
|
|
185
|
+
`code_parse_error`; JSDoc types stay valid.
|
|
186
|
+
|
|
187
|
+
### Python declarations
|
|
188
|
+
|
|
189
|
+
Supported forms are module-level functions and classes, and the methods and
|
|
190
|
+
nested classes of a class, including those under `if`, `try`, and `with`
|
|
191
|
+
blocks; nothing inside a function body is an endpoint. Put `@doc` in the
|
|
192
|
+
docstring or in the `#` comment block directly above the declaration or its
|
|
193
|
+
first decorator. IDs are dot-qualified, such as `AuthService.login`. A
|
|
194
|
+
property's getter, setter, and deleter share one endpoint, as do `@overload`
|
|
195
|
+
stubs and their implementation. A name that starts with `_`, other than a
|
|
196
|
+
`__dunder__` name, is `private`, and so is every member of a private class.
|
|
197
|
+
Module docstrings, assignments, and nested functions are not endpoints.
|
|
198
|
+
|
|
199
|
+
### Ruby declarations
|
|
200
|
+
|
|
201
|
+
Supported forms are classes, modules, constants, instance methods, singleton
|
|
202
|
+
methods (`def self.x` and `def x` inside `class << self`), and top-level
|
|
203
|
+
methods. Put `@doc` in the `#` comment block directly above the declaration.
|
|
204
|
+
IDs use `::` between constants and `.` before a method name, such as
|
|
205
|
+
`Auth::Service`, `Auth::MAX_ATTEMPTS`, `Auth::Service.login`, and
|
|
206
|
+
`Auth::Service.self.build` for a singleton method. A class reopened in the same
|
|
207
|
+
file is one endpoint. Bare `private`, `protected`, and `public` calls,
|
|
208
|
+
`private def x`, and `private_class_method` set method visibility; classes,
|
|
209
|
+
modules, and constants are always `public`. `attr_reader` and its siblings,
|
|
210
|
+
`alias`, and `define_method` are not endpoints.
|
|
211
|
+
|
|
143
212
|
<!-- @code src/scan/markdown/markdown.ts#scanMarkdown -->
|
|
144
213
|
|
|
145
214
|
## Documentation to code
|
|
@@ -14,8 +14,8 @@ stderr. Use `docbridge <command> --help` for invocation errors and
|
|
|
14
14
|
(for example, the path is a directory or lacks read permission), or is not
|
|
15
15
|
valid JSON. The message says the file was not found in both of the first two
|
|
16
16
|
cases. Run `docbridge init --dry-run` when the file is missing. When the path
|
|
17
|
-
exists, make it a readable file with valid JSON, or remove it
|
|
18
|
-
`check` again.
|
|
17
|
+
exists, make it a readable file with valid JSON, or remove it and create a new
|
|
18
|
+
one with `docbridge init`, before running `check` again.
|
|
19
19
|
|
|
20
20
|
`config_unknown_key` means a parsed file has a key DocBridge does not know,
|
|
21
21
|
such as a misspelled property. `config_invalid_value` means a known key has a
|
|
@@ -36,14 +36,27 @@ lacks a binary for the current platform or the binary cannot execute.
|
|
|
36
36
|
Reinstall the package first. If the platform is not supported, run DocBridge
|
|
37
37
|
in a supported environment or build the scanner from the repository.
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
Python and Ruby run on the interpreter installed on the machine. For them,
|
|
40
|
+
`code_scanner_unavailable` names the interpreter DocBridge needs, the minimum
|
|
41
|
+
version, and what it found for each candidate: no interpreter on `PATH`, a
|
|
42
|
+
version below CPython 3.10 or CRuby 3.3, or a Ruby whose bundled Prism does not
|
|
43
|
+
load. Install a supported version on `PATH`, or point `scanners.python.command`
|
|
44
|
+
or `scanners.ruby.command` in the configuration, or `DOCBRIDGE_PYTHON_RUNTIME`
|
|
45
|
+
or `DOCBRIDGE_RUBY_RUNTIME` in the environment, at one; see
|
|
46
|
+
[Configuration](configuration.md#scanner-runtimes). When the message names
|
|
47
|
+
one of those overrides, DocBridge tried only that interpreter, so fix or remove
|
|
48
|
+
the override instead of installing another one.
|
|
43
49
|
|
|
44
|
-
`
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
`code_scanner_failed` diagnostics contain the worker failure rather than
|
|
51
|
+
converting it into a broken link. One worker run scans every file of its
|
|
52
|
+
language, so a failed run reports the same message on each of those files.
|
|
53
|
+
Check that the source parses with the project's own toolchain, then reproduce
|
|
54
|
+
with the smallest configured file set.
|
|
55
|
+
|
|
56
|
+
`code_parse_error` means a TypeScript, JavaScript, Swift, Dart, Rust, Go,
|
|
57
|
+
Python, or Ruby source file has a syntax error. The diagnostic points at the
|
|
58
|
+
first error the language's parser found and includes the parser's message; for
|
|
59
|
+
Python and Ruby, the wording comes from the installed interpreter. DocBridge extracts no links or symbols
|
|
47
60
|
from that file, so fix the syntax before judging link diagnostics that involve
|
|
48
61
|
it. Unlike
|
|
49
62
|
`code_scanner_failed`, the worker ran correctly; the source itself did not
|
package/package.json
CHANGED
|
@@ -44,7 +44,17 @@
|
|
|
44
44
|
"target": { "type": "string" },
|
|
45
45
|
"language": {
|
|
46
46
|
"type": "string",
|
|
47
|
-
"enum": [
|
|
47
|
+
"enum": [
|
|
48
|
+
"typescript",
|
|
49
|
+
"swift",
|
|
50
|
+
"dart",
|
|
51
|
+
"rust",
|
|
52
|
+
"go",
|
|
53
|
+
"javascript",
|
|
54
|
+
"python",
|
|
55
|
+
"ruby",
|
|
56
|
+
"java"
|
|
57
|
+
]
|
|
48
58
|
},
|
|
49
59
|
"source": { "type": "string" },
|
|
50
60
|
"message": { "type": "string" },
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"language": {
|
|
37
37
|
"type": "string",
|
|
38
|
-
"enum": ["typescript", "swift", "dart", "rust", "go"],
|
|
38
|
+
"enum": ["typescript", "swift", "dart", "rust", "go", "javascript", "python", "ruby"],
|
|
39
39
|
"description": "Code language for code context blocks."
|
|
40
40
|
},
|
|
41
41
|
"startLine": {
|
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
"swift": { "$ref": "#/$defs/swiftEntry" },
|
|
23
23
|
"dart": { "$ref": "#/$defs/dartEntry" },
|
|
24
24
|
"rust": { "$ref": "#/$defs/rustEntry" },
|
|
25
|
-
"go": { "$ref": "#/$defs/goEntry" }
|
|
25
|
+
"go": { "$ref": "#/$defs/goEntry" },
|
|
26
|
+
"javascript": { "$ref": "#/$defs/javascriptEntry" },
|
|
27
|
+
"python": { "$ref": "#/$defs/pythonEntry" },
|
|
28
|
+
"ruby": { "$ref": "#/$defs/rubyEntry" }
|
|
26
29
|
}
|
|
27
30
|
},
|
|
28
31
|
"docs": {
|
|
@@ -34,9 +37,33 @@
|
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
}
|
|
40
|
+
},
|
|
41
|
+
"scanners": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"additionalProperties": false,
|
|
44
|
+
"properties": {
|
|
45
|
+
"python": { "$ref": "#/$defs/scannerRuntime" },
|
|
46
|
+
"ruby": { "$ref": "#/$defs/scannerRuntime" },
|
|
47
|
+
"java": { "$ref": "#/$defs/scannerRuntime" }
|
|
48
|
+
}
|
|
37
49
|
}
|
|
38
50
|
},
|
|
39
51
|
"$defs": {
|
|
52
|
+
"scannerRuntime": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"additionalProperties": false,
|
|
55
|
+
"required": ["command"],
|
|
56
|
+
"properties": {
|
|
57
|
+
"command": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"minItems": 1,
|
|
60
|
+
"items": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"minLength": 1
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
40
67
|
"typescriptEntry": {
|
|
41
68
|
"type": "object",
|
|
42
69
|
"additionalProperties": false,
|
|
@@ -47,7 +74,7 @@
|
|
|
47
74
|
"minItems": 1,
|
|
48
75
|
"items": {
|
|
49
76
|
"type": "string",
|
|
50
|
-
"pattern": "^(?!.*\\.d\\.ts$).*\\.ts$"
|
|
77
|
+
"pattern": "^(?!.*\\.d\\.[cm]?ts$).*\\.(ts|tsx|mts|cts)$"
|
|
51
78
|
}
|
|
52
79
|
},
|
|
53
80
|
"visibility": {
|
|
@@ -146,6 +173,72 @@
|
|
|
146
173
|
}
|
|
147
174
|
}
|
|
148
175
|
}
|
|
176
|
+
},
|
|
177
|
+
"javascriptEntry": {
|
|
178
|
+
"type": "object",
|
|
179
|
+
"additionalProperties": false,
|
|
180
|
+
"required": ["patterns"],
|
|
181
|
+
"properties": {
|
|
182
|
+
"patterns": {
|
|
183
|
+
"type": "array",
|
|
184
|
+
"minItems": 1,
|
|
185
|
+
"items": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"pattern": "\\.(js|jsx|mjs|cjs)$"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"visibility": {
|
|
191
|
+
"type": "array",
|
|
192
|
+
"items": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"enum": ["public", "protected", "private"]
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"pythonEntry": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"additionalProperties": false,
|
|
202
|
+
"required": ["patterns"],
|
|
203
|
+
"properties": {
|
|
204
|
+
"patterns": {
|
|
205
|
+
"type": "array",
|
|
206
|
+
"minItems": 1,
|
|
207
|
+
"items": {
|
|
208
|
+
"type": "string",
|
|
209
|
+
"pattern": "\\.py$"
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"visibility": {
|
|
213
|
+
"type": "array",
|
|
214
|
+
"items": {
|
|
215
|
+
"type": "string",
|
|
216
|
+
"enum": ["public", "private"]
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"rubyEntry": {
|
|
222
|
+
"type": "object",
|
|
223
|
+
"additionalProperties": false,
|
|
224
|
+
"required": ["patterns"],
|
|
225
|
+
"properties": {
|
|
226
|
+
"patterns": {
|
|
227
|
+
"type": "array",
|
|
228
|
+
"minItems": 1,
|
|
229
|
+
"items": {
|
|
230
|
+
"type": "string",
|
|
231
|
+
"pattern": "\\.rb$"
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"visibility": {
|
|
235
|
+
"type": "array",
|
|
236
|
+
"items": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"enum": ["public", "protected", "private"]
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
149
242
|
}
|
|
150
243
|
}
|
|
151
244
|
}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"language": {
|
|
33
33
|
"type": "string",
|
|
34
|
-
"enum": ["typescript", "swift", "dart", "rust", "go"],
|
|
34
|
+
"enum": ["typescript", "swift", "dart", "rust", "go", "javascript", "python", "ruby"],
|
|
35
35
|
"description": "Code language for code nodes."
|
|
36
36
|
},
|
|
37
37
|
"location": { "$ref": "common-output.schema.json#/$defs/location" },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: docbridge
|
|
3
|
-
description: Adopt or introduce DocBridge, choose docs and code scope, create or improve docbridge.config.json, add @doc and @code annotations, fix link diagnostics, triage related --gate findings, and review existing links for stale docs or semantic validity.
|
|
3
|
+
description: Adopt or introduce DocBridge, choose docs and code scope, create or improve docbridge.config.json, add @doc and @code annotations or docbridge.links.json entries, fix link diagnostics, triage related --gate findings, and review existing links for stale docs or semantic validity.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# docbridge
|
|
@@ -22,7 +22,7 @@ Pick **one** job before editing. The first matching question wins:
|
|
|
22
22
|
| ----------------- | ------------------------------------------------------------------------------ | --------------------------------------------- |
|
|
23
23
|
| Adopt | Introduce DocBridge, choose docs/code scope, or write `docbridge.config.json`? | Linking existing files |
|
|
24
24
|
| Discover and link | Choose what to link in existing docs, docs-first? | A known pair already confirmed |
|
|
25
|
-
| Annotate | Add or fix a `@doc` / `@code` pair, or clear
|
|
25
|
+
| Annotate | Add or fix a `@doc` / `@code` pair or a manifest entry, or clear diagnostics? | Deciding _whether_ a section should be linked |
|
|
26
26
|
| Review | Check whether the docs still match the code, with no change set? | Gate findings on a diff |
|
|
27
27
|
| Sync | A Git hook, CI comment, or `related --gate` flagged unchanged counterparts? | Auditing the whole graph |
|
|
28
28
|
|
|
@@ -73,6 +73,16 @@ no diagnostic mentions either endpoint.
|
|
|
73
73
|
Do not split or rename headings in this job. Preserve existing annotations
|
|
74
74
|
unless the user asked to fix a wrong link.
|
|
75
75
|
|
|
76
|
+
### Manifest links
|
|
77
|
+
|
|
78
|
+
Use `docbridge.links.json` when the project already declares links there, or
|
|
79
|
+
when the user does not accept markers in a file. Read
|
|
80
|
+
`docbridge docs show linking` for its format. Add one entry per link with the
|
|
81
|
+
same `code` and `doc` targets an annotation pair would use; never declare a
|
|
82
|
+
link that an annotation pair already provides. Fix `code_symbol_not_found` with
|
|
83
|
+
the printed suggestion only after confirming it names the intended symbol.
|
|
84
|
+
Verify with `docbridge check`.
|
|
85
|
+
|
|
76
86
|
## Sync
|
|
77
87
|
|
|
78
88
|
A `related --gate` violation means nobody has decided yet, not that the
|