@agentskit/doc-bridge 1.7.45 → 1.10.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.
Files changed (213) hide show
  1. package/CHANGELOG.md +488 -0
  2. package/CONTRIBUTING.md +23 -0
  3. package/README.md +87 -40
  4. package/SECURITY.md +7 -0
  5. package/action.yml +1 -1
  6. package/bin/ak-docs.js +2 -2
  7. package/bin/ak-verify.js +13 -7
  8. package/dist/cli/program.d.ts +3 -1
  9. package/dist/cli/program.js +15871 -6218
  10. package/dist/cli/program.js.map +1 -1
  11. package/dist/config/index.d.ts +1 -1
  12. package/dist/config/index.js +95 -6
  13. package/dist/config/index.js.map +1 -1
  14. package/dist/{index-BUL0q7s8.d.ts → index-7wYGbllW.d.ts} +134 -1
  15. package/dist/index.d.ts +9880 -1062
  16. package/dist/index.js +16143 -6127
  17. package/dist/index.js.map +1 -1
  18. package/docs/MARKETPLACE.md +1 -1
  19. package/docs/PRD-documentation-efficiency-study.md +406 -0
  20. package/docs/PRD-knowledge-retrieval-and-enrichment.md +466 -0
  21. package/docs/adr/0002-documentation-audit-boundary.md +22 -0
  22. package/docs/adr/0003-study-protocol-and-historical-evidence.md +40 -0
  23. package/docs/adr/0004-controlled-study-runner.md +25 -0
  24. package/docs/adr/0005-documentation-quality-and-criticality.md +20 -0
  25. package/docs/adr/0006-registry-semantic-grounding.md +20 -0
  26. package/docs/adr/0007-longitudinal-study-metrics.md +21 -0
  27. package/docs/adr/0008-study-verification-boundary.md +21 -0
  28. package/docs/adr/0009-study-provider-cli-adapter.md +25 -0
  29. package/docs/agent-corpus/INDEX.md +12 -1
  30. package/docs/agent-corpus/OVERVIEW.md +25 -0
  31. package/docs/agent-corpus/chat.md +5 -1
  32. package/docs/agent-corpus/cli.md +16 -0
  33. package/docs/agent-corpus/conformance.md +12 -0
  34. package/docs/agent-corpus/doc-bridge.md +47 -0
  35. package/docs/agent-corpus/doctor.md +8 -0
  36. package/docs/agent-corpus/gates.md +4 -0
  37. package/docs/agent-corpus/mcp.md +13 -0
  38. package/docs/agent-corpus/memory.md +4 -0
  39. package/docs/agent-corpus/query.md +33 -0
  40. package/docs/bench/README.md +122 -0
  41. package/docs/bench/retrieval-baseline-v1.json +28 -0
  42. package/docs/bench/retrieval-suite-v1.json +1033 -0
  43. package/docs/chat-and-rag.md +3 -2
  44. package/docs/for-agents.md +9 -1
  45. package/docs/getting-started.md +4 -11
  46. package/docs/guides/gate-ci.md +11 -1
  47. package/docs/guides/install-and-run.md +9 -65
  48. package/docs/index.md +22 -1
  49. package/docs/knowledge-engine-runbook.md +38 -3
  50. package/docs/landing/assets/context-payload-reduction.svg +21 -0
  51. package/docs/landing/assets/controlled-ab-comparison.svg +30 -0
  52. package/docs/landing/index.html +119 -5
  53. package/docs/loop-workflow.md +117 -0
  54. package/docs/mcp.md +6 -1
  55. package/docs/parity/public-claims-v1.json +145 -0
  56. package/docs/playbook/doc-bridge-pattern.md +1 -1
  57. package/docs/query.md +90 -2
  58. package/docs/recipes/index-pipeline.md +1 -1
  59. package/docs/schemas/agent-handoff-v1.md +15 -0
  60. package/docs/schemas/doc-bridge-index-v1.md +65 -0
  61. package/docs/spec/benchmark-v1.md +33 -1
  62. package/docs/spec/cli.md +30 -10
  63. package/docs/spec/config-v1.md +157 -8
  64. package/docs/spec/documentation-audit-v1.md +61 -0
  65. package/docs/spec/enrichment-overlay-v1.md +241 -0
  66. package/docs/spec/graph-signals-v1.md +92 -0
  67. package/docs/spec/incremental-scan-v1.md +102 -0
  68. package/docs/spec/markdown-analyzer-v1.md +73 -0
  69. package/docs/spec/mcp-knowledge-tools-v1.md +147 -0
  70. package/docs/spec/measured-enrichment-v1.md +229 -0
  71. package/docs/spec/public-parity-v1.md +119 -0
  72. package/docs/spec/registry-agents.md +6 -0
  73. package/docs/spec/render-v1.md +122 -0
  74. package/docs/spec/retrieval-index-v1.md +164 -0
  75. package/docs/spec/study-metrics-v1.md +58 -0
  76. package/docs/spec/study-protocol-v1.md +46 -0
  77. package/docs/spec/study-provider-cli-v1.md +116 -0
  78. package/docs/spec/study-runner-v1.md +35 -0
  79. package/docs/spec/study-task-suite-v1.md +41 -0
  80. package/docs/spec/study-verification-v1.md +40 -0
  81. package/docs/study/README.md +84 -0
  82. package/docs/study/ab-adjudicated-cost-analysis-v1.md +29 -0
  83. package/docs/study/ab-adjudicated-cost-plan-v1.json +33 -0
  84. package/docs/study/ab-adjudicated-cost-plan-v2-v1.json +33 -0
  85. package/docs/study/ab-adjudicated-cost-result-v1.json +80 -0
  86. package/docs/study/ab-baseline-analysis-v1.md +21 -0
  87. package/docs/study/ab-baseline-plan-v1.json +33 -0
  88. package/docs/study/ab-baseline-recovery-plan-v1.json +33 -0
  89. package/docs/study/ab-baseline-result-v1.json +79 -0
  90. package/docs/study/documentation-audit-round-2026-08-31.json +183 -0
  91. package/docs/study/historical-evidence-v1.json +252 -0
  92. package/docs/study/observation-ledger-v1.json +30632 -0
  93. package/docs/study/phase3-task-coverage-v1.json +34 -0
  94. package/docs/study/phase4-public-pilot-ledger-v1.json +1344 -0
  95. package/docs/study/phase4-public-pilot-result-v1.json +52 -0
  96. package/docs/study/phase4-public-pilot-run-plan-v1.json +26 -0
  97. package/docs/study/phase4-public-pilot-task-suite-v1.json +71 -0
  98. package/docs/study/pilot-round-2026-08-31.json +46 -0
  99. package/docs/study/protocol-v1.json +90 -0
  100. package/docs/study/publication-gate-v1.md +45 -0
  101. package/docs/study/quality-scorecard-cycle-plan.md +545 -0
  102. package/docs/study/quality-scorecard-v1.json +38 -0
  103. package/docs/study/round-1-adjudicated-smoke-v1.json +30642 -0
  104. package/docs/study/round-1-instrumentation-plan-v1.md +39 -0
  105. package/docs/study/round-2-expanded-adjudication-v1.json +91 -0
  106. package/docs/study/round-2-expanded-validation-v1.md +58 -0
  107. package/docs/study/round-3-evidence-contract-v1.json +75 -0
  108. package/docs/study/round-3-evidence-contract-v1.md +57 -0
  109. package/docs/study/round-4-confirmation-v1.json +75 -0
  110. package/docs/study/round-4-confirmation-v1.md +55 -0
  111. package/docs/study/run-plan-v1.json +33 -0
  112. package/docs/study/semantic-adjudication-cycle-8.md +20 -0
  113. package/docs/study/task-suite-v1.json +96 -0
  114. package/docs/study/token-efficiency-plan-v1.md +337 -0
  115. package/docs/study/token-efficiency-protocol-v2.json +62 -0
  116. package/docs/study/verification-binding-v1.json +27 -0
  117. package/docs/validation-cycle-plan.md +14 -0
  118. package/docs/verification-harness.md +11 -6
  119. package/ecosystem-claims.json +2 -2
  120. package/ecosystem-upstream.json +2 -2
  121. package/ecosystem.json +4 -4
  122. package/mcpb/manifest.json +9 -1
  123. package/package.json +34 -15
  124. package/scripts/check-ecosystem-upstream.mjs +34 -6
  125. package/skills/doc-bridge-handoff/fixtures/synthetic-repo/docs/for-agents/packages/payments.md +7 -0
  126. package/skills/doc-bridge-handoff/scripts/resolve-handoff.mjs +1 -1
  127. package/src/agents/registry-adapter.ts +192 -24
  128. package/src/audit/documentation.ts +513 -0
  129. package/src/bench/baseline.ts +198 -0
  130. package/src/bench/overlay-delta.ts +139 -0
  131. package/src/bench/retrieval.ts +319 -0
  132. package/src/budget/compile.ts +91 -0
  133. package/src/budget/sections.ts +70 -0
  134. package/src/cli/program.ts +684 -74
  135. package/src/cli/usage.ts +71 -0
  136. package/src/config/defaults.ts +1 -0
  137. package/src/config/index.ts +4 -0
  138. package/src/config/schema.ts +126 -2
  139. package/src/conformance/documentation-standard-v1.ts +8 -6
  140. package/src/discovery/areas.ts +197 -0
  141. package/src/discovery/documentation.ts +211 -5
  142. package/src/discovery/identity.ts +24 -0
  143. package/src/discovery/incremental.ts +314 -0
  144. package/src/discovery/inputs.ts +110 -0
  145. package/src/discovery/markdown.ts +481 -0
  146. package/src/discovery/repository.ts +485 -101
  147. package/src/doctor/run-doctor.ts +244 -12
  148. package/src/enrich/approvals.ts +190 -0
  149. package/src/enrich/cache.ts +93 -0
  150. package/src/enrich/context-pack.ts +272 -0
  151. package/src/enrich/overlay.ts +255 -0
  152. package/src/enrich/review.ts +106 -0
  153. package/src/enrich/stage.ts +374 -0
  154. package/src/enrich/stats.ts +100 -0
  155. package/src/enrich/validate.ts +410 -0
  156. package/src/federation/llms.ts +2 -4
  157. package/src/findings/report.ts +103 -0
  158. package/src/graph/build.ts +356 -0
  159. package/src/graph/memory.ts +208 -0
  160. package/src/index-builder/build-handoffs.ts +22 -11
  161. package/src/index-builder/build-index.ts +132 -3
  162. package/src/index-builder/llms-txt.ts +48 -8
  163. package/src/index-builder/project-corpus.ts +111 -0
  164. package/src/index.ts +630 -2
  165. package/src/lib/fuzzy-match.ts +235 -0
  166. package/src/mcp/knowledge.ts +554 -0
  167. package/src/mcp/server.ts +113 -18
  168. package/src/metrics/benchmark.ts +21 -0
  169. package/src/parity/check.ts +309 -0
  170. package/src/parity/claims.ts +259 -0
  171. package/src/parity/resolve.ts +160 -0
  172. package/src/query/handoff.ts +326 -0
  173. package/src/query/load-index.ts +53 -1
  174. package/src/query/query.ts +92 -59
  175. package/src/query/search.ts +289 -92
  176. package/src/query/text.ts +155 -0
  177. package/src/reconciliation/reconcile.ts +101 -10
  178. package/src/render/data.ts +356 -0
  179. package/src/render/engine.ts +398 -0
  180. package/src/render/generated.ts +77 -0
  181. package/src/render/render.ts +209 -0
  182. package/src/render/template-source.ts +52 -0
  183. package/src/render/templates.ts +289 -0
  184. package/src/report/html.ts +2 -2
  185. package/src/retrieval/bm25.ts +161 -0
  186. package/src/retrieval/project.ts +495 -0
  187. package/src/retrieval/rank.ts +383 -0
  188. package/src/retrieval/weights.ts +39 -0
  189. package/src/retriever/doc-bridge-retriever.ts +100 -15
  190. package/src/rules/engine.ts +30 -10
  191. package/src/schemas/agent-handoff.ts +56 -0
  192. package/src/schemas/budget.ts +37 -0
  193. package/src/schemas/doc-bridge-index.ts +53 -2
  194. package/src/schemas/enrichment.ts +369 -0
  195. package/src/schemas/json-schemas.ts +39 -2
  196. package/src/schemas/knowledge.ts +14 -1
  197. package/src/schemas/retrieval-index.ts +152 -0
  198. package/src/shims/graphology.d.ts +91 -0
  199. package/src/study/adjudication.ts +196 -0
  200. package/src/study/execution.ts +350 -0
  201. package/src/study/expectations.ts +219 -0
  202. package/src/study/metrics.ts +467 -0
  203. package/src/study/protocol.ts +271 -0
  204. package/src/study/provider-cli.ts +115 -0
  205. package/src/study/provider-telemetry.ts +47 -0
  206. package/src/study/quality-scorecard.ts +164 -0
  207. package/src/study/runner.ts +461 -0
  208. package/src/study/task-suite.ts +321 -0
  209. package/src/study/verification.ts +134 -0
  210. package/src/validate.ts +1 -4
  211. package/src/version.ts +1 -1
  212. package/src/workflow/engine.ts +36 -11
  213. package/scripts/verification-harness.mjs +0 -482
@@ -49,8 +49,9 @@ flowchart LR
49
49
  ## Trust model
50
50
 
51
51
  1. **`handoffFirst`** (default): if the question mentions a known package id, attach deterministic AgentHandoff context before the model answers.
52
- 2. RAG retrieves from the indexed agent corpus (and configured sources).
53
- 3. CI gates still decide merge truth — chat never auto-writes docs.
52
+ 2. Deterministic local and federated retrieval use token-boundary matching (with CJK-aware handling), so substring-only decoys do not consume model context.
53
+ 3. RAG retrieves from the indexed agent corpus (and configured sources).
54
+ 4. CI gates still decide merge truth — chat never auto-writes docs.
54
55
 
55
56
  ## Commands
56
57
 
@@ -13,6 +13,14 @@ ak-docs query ownership <id> --agent
13
13
 
14
14
  The response supplies four things: `startHere`, `readBeforeEditing`, `editRoots`, and `checks`.
15
15
 
16
+ For a documentation change, inspect the deterministic audit before editing:
17
+
18
+ ```bash
19
+ ak-docs audit documentation --json
20
+ ```
21
+
22
+ Treat `blocked` as a stop condition. Treat `not-analyzed` as missing evidence, not as a pass. When a report explicitly documents a limitation, preserve that limitation as `not-analyzed`; do not reinterpret it as a successful check or silently upgrade it to a defect. Agent proposals remain advisory until a human approves them.
23
+
16
24
  ```mermaid
17
25
  flowchart LR
18
26
  Q["Resolve ownership"] --> R["Read startHere"]
@@ -36,4 +44,4 @@ flowchart LR
36
44
  - [AgentHandoff schema](./schemas/agent-handoff-v1.md)
37
45
  - [Skill text](./skills/doc-bridge.md)
38
46
 
39
- If the task is conversational UI, continue with [AgentsKit Chat](https://chat.agentskit.io). For verification before merge, use [AgentsKit Code Review](https://github.com/AgentsKit-io/code-review-cli). For enterprise orchestration, governance, and audit, continue with [AKOS](https://akos.agentskit.io).
47
+ If the task is conversational UI, continue with [AgentsKit Chat](https://chat.agentskit.io). For verification before merge, use [AgentsKit Code Review](https://github.com/AgentsKit-io/code-review). For enterprise orchestration, governance, and audit, follow the repository's configured team workflow.
@@ -26,14 +26,7 @@ pnpm add -D @agentskit/doc-bridge
26
26
 
27
27
  CLI binary: **`ak-docs`**.
28
28
 
29
- ## 60-second demo (zero setup)
30
-
31
- ```bash
32
- npx ak-docs demo --text
33
- npx ak-docs demo --fixture monorepo --text # auth + billing monorepo
34
- ```
35
-
36
- Prints before/after, a real handoff, gate red→green, and the MCP snippet.
29
+ For the canonical zero-setup proof, see the [README's 60-second proof](../README.md#60-second-proof).
37
30
 
38
31
  ## Two-minute path (no API key)
39
32
 
@@ -62,7 +55,7 @@ ak-docs mcp
62
55
 
63
56
  ## Configuration
64
57
 
65
- Default: `doc-bridge.config.json` (also `.ts` / `.js` / `package.json#docBridge`).
58
+ Configuration is discovered in the order defined by the configuration specification; `doc-bridge.config.json` is the simplest supported fallback (along with `.ts`, `.js`, and `package.json#docBridge`).
66
59
 
67
60
  **Required:** `schemaVersion: 1` + `corpus.agent.root`.
68
61
 
@@ -82,7 +75,7 @@ See [config-v1](./spec/config-v1.md) and [examples](./examples.md).
82
75
  |---------|-------------|---------|
83
76
  | CLI | You want to inspect or debug the bridge yourself | `ak-docs query package <id> --agent` |
84
77
  | MCP | You want coding agents to resolve handoffs before editing | `ak-docs mcp install --cursor` |
85
- | CI | You want stale indexes and broken links to fail PRs | `ak-docs index && ak-docs gate run` |
78
+ | CI | You want stale indexes and explicitly configured documentation gates to fail PRs | `ak-docs gate run` (the PR action checks the committed index) |
86
79
  | Adapters | You already have Fumadocs, Docusaurus, or markdown docs | configure `corpus.human` |
87
80
  | Memory pipeline | You want agent notes turned into reviewable docs | `ak-docs memory promote --pr --dry-run` |
88
81
  | Optional RAG/chat | You want a terminal assistant grounded in the same index | `ak-docs rag ingest && ak-docs chat` |
@@ -118,7 +111,7 @@ ak-docs bootstrap agent-docs # draft agent docs from human site
118
111
  ak-docs memory ingest
119
112
  ak-docs memory classify
120
113
  ak-docs memory promote # prints a safe draft body
121
- ak-docs memory promote --pr --dry-run
114
+ ak-docs memory promote --pr --dry-run # writes a local draft and prints commands only
122
115
  ak-docs memory promote --pr # opens a GitHub draft PR via gh
123
116
  ```
124
117
 
@@ -38,13 +38,23 @@ jobs:
38
38
  runs-on: ubuntu-latest
39
39
  steps:
40
40
  - uses: actions/checkout@v4
41
- - uses: AgentsKit-io/doc-bridge@v1.4.0
41
+ - uses: AgentsKit-io/doc-bridge@ee756a13c006c597445c31e2643c1e8cece715d7 # v1.7.45
42
42
  with:
43
43
  config-path: doc-bridge.config.json
44
+ package-version: 1.7.45
44
45
  ```
45
46
 
47
+ This example pins both the published stable Action release and its matching
48
+ published package version at `v1.7.45`; the checked-in package version is
49
+ `1.8.0` and is intentionally not used by this published-release example.
50
+
46
51
  The composite Action verifies the **committed** index and configured gates — it does **not** silently rebuild and hide drift.
47
52
 
53
+ The Action runs the gates selected by the consumer's configuration. To fail on
54
+ broken human-document links, include the `human-guide-links` gate explicitly;
55
+ the minimal preset enables `index-freshness` by default, and this repository
56
+ adds `documentation-standard-v1` through `gates.include`.
57
+
48
58
  If the Action fails:
49
59
 
50
60
  1. Run `ak-docs index` locally
@@ -1,78 +1,22 @@
1
1
  ---
2
- title: Install and run
3
- description: Install Doc Bridge, run the demo, and index your repository in minutes.
2
+ title: Continue the development loop
3
+ description: Continue indexing and querying after the first Doc Bridge setup.
4
4
  ---
5
5
 
6
6
  # Install and run
7
7
 
8
- Get a deterministic AgentHandoff from your own docs — no API key required for Layer 0.
8
+ The [Getting started guide](../getting-started.md) is the canonical install,
9
+ demo, and first-index path. This page keeps the configuration and development
10
+ loop details that follow that first run.
9
11
 
10
- ## Install
12
+ ## Development loop
11
13
 
12
- ```bash
13
- pnpm add -D @agentskit/doc-bridge
14
- # or
15
- npm i -D @agentskit/doc-bridge
16
- ```
17
-
18
- CLI binary: **`ak-docs`**.
19
-
20
- ## Prove it in 60 seconds (no project setup)
21
-
22
- ```bash
23
- npx ak-docs demo --text
24
- npx ak-docs demo --fixture monorepo --text
25
- ```
26
-
27
- You should see handoffs, a gate red→green path, and an MCP install snippet.
28
-
29
- ## Two-minute path on your repo
30
-
31
- ```bash
32
- cd your-repo
33
- ak-docs init # config + optional demo ownership + AGENTS.md tip
34
- ak-docs index # build .doc-bridge/index.json
35
- ak-docs query package example --agent
36
- ak-docs doctor --text
37
- ak-docs gate run
38
- ```
39
-
40
- Expected handoff fields:
41
-
42
- | Field | Meaning |
43
- | --- | --- |
44
- | `startHere` | What the agent reads first |
45
- | `editRoots` | Where edits are allowed |
46
- | `checks` | Commands that prove the change |
47
- | `humanDoc` | Human guide for the same ownership |
48
-
49
- ## Minimal config
50
-
51
- `doc-bridge.config.json`:
52
-
53
- ```json
54
- {
55
- "schemaVersion": 1,
56
- "corpus": {
57
- "agent": { "root": "docs/for-agents" }
58
- }
59
- }
60
- ```
61
-
62
- **Required:** `schemaVersion: 1` and `corpus.agent.root`.
63
-
64
- Ownership comes from (first match wins):
65
-
66
- 1. `routing.options.ownership` in config
67
- 2. Frontmatter on agent docs (`package`, `editRoot`, `checks`)
68
- 3. Monorepo plugin discovery (`pnpm-monorepo`)
69
-
70
- ## Dev loop
14
+ After the canonical setup, use the watch command while editing. The complete
15
+ install, index, query, and gate sequence remains in the [Getting started
16
+ guide](../getting-started.md#two-minute-path-no-api-key).
71
17
 
72
18
  ```bash
73
19
  ak-docs index --watch
74
- ak-docs list packages --text
75
- ak-docs ask "where do I change auth?"
76
20
  ```
77
21
 
78
22
  ## Related
package/docs/index.md CHANGED
@@ -26,6 +26,27 @@ Doc Bridge keeps **one repository** useful to people and coding agents. Pick the
26
26
  | Every CLI command | [CLI map](./guides/cli-map.md) · [CLI reference](./spec/cli.md) |
27
27
  | Config sketches | [Examples](./examples.md) |
28
28
  | Optional chat / RAG | [Chat and RAG](./chat-and-rag.md) · [Ollama demo](./ollama-demo.md) |
29
+ | Study and measurement | [Study overview and anonymized data](./study/README.md) · [Study protocol v1](./spec/study-protocol-v1.md) |
30
+ | Controlled task suite | [Study task suite v1](./spec/study-task-suite-v1.md) |
31
+ | Phase 3 task coverage | [Task coverage contract v1](./study/phase3-task-coverage-v1.json) |
32
+ | Controlled study runner | [Study runner v1](./spec/study-runner-v1.md) |
33
+ | Provider CLI adapter | [Study provider CLI v1](./spec/study-provider-cli-v1.md) |
34
+ | Round 1 instrumentation | [Instrumentation plan v1](./study/round-1-instrumentation-plan-v1.md) · [adjudicated smoke ledger](./study/round-1-adjudicated-smoke-v1.json) |
35
+ | Longitudinal measurements | [Study metrics v1](./spec/study-metrics-v1.md) |
36
+ | Study verification | [Study verification v1](./spec/study-verification-v1.md) |
37
+ | A/B baseline result | [A/B baseline result 2026-08-31](./study/ab-baseline-result-v1.json) · [analysis](./study/ab-baseline-analysis-v1.md) |
38
+ | Documentation quality audit | [Documentation audit v1](./spec/documentation-audit-v1.md) |
39
+ | What is read from a Markdown document | [Markdown analyzer v1](./spec/markdown-analyzer-v1.md) |
40
+ | Canonicality, centrality, cycles and the graph as memory | [Graph signals v1](./spec/graph-signals-v1.md) |
41
+ | Per-file hashes and reuse between scans | [Incremental scan v1](./spec/incremental-scan-v1.md) |
42
+ | The index as a projection, explainable ranking, handoffs for any entity | [Retrieval index v1](./spec/retrieval-index-v1.md) |
43
+ | Budgeted `knowledge.search` / `knowledge.lookup`, canonical findings, the measured doctor | [MCP knowledge tools v1](./spec/mcp-knowledge-tools-v1.md) |
44
+ | Markdown renderings from templates: area pages, sidecars, change digest, overlay review | [Render v1](./spec/render-v1.md) |
45
+ | Typed agent proposals, validators, the overlay and bounded influence | [Enrichment overlay v1](./spec/enrichment-overlay-v1.md) |
46
+ | What the overlay cost, whether it helped, and the study measurements | [Measured enrichment v1](./spec/measured-enrichment-v1.md) |
47
+ | The claims this repository makes in public, and the gate that keeps them true | [Public parity v1](./spec/public-parity-v1.md) |
48
+ | Current documentation audit snapshot | [Audit round 2026-08-31](./study/documentation-audit-round-2026-08-31.json) |
49
+ | Controlled pilot evidence | [Pilot round 2026-08-31](./study/pilot-round-2026-08-31.json) |
29
50
 
30
51
  ## How it works
31
52
 
@@ -55,4 +76,4 @@ Machine surfaces: [llms.txt](/llms.txt) · [llms-full.txt](/llms-full.txt) · [r
55
76
 
56
77
  ## Ecosystem
57
78
 
58
- Part of AgentsKit — next to [AgentsKit](https://www.agentskit.io), [Registry](https://registry.agentskit.io), [Chat](https://chat.agentskit.io), [Playbook](https://playbook.agentskit.io), and [AKOS](https://akos.agentskit.io).
79
+ Part of AgentsKit — next to [AgentsKit](https://www.agentskit.io), [Registry](https://registry.agentskit.io), [Chat](https://chat.agentskit.io), and [Playbook](https://playbook.agentskit.io).
@@ -1,3 +1,10 @@
1
+ ---
2
+ owner: doc-bridge-maintainers
3
+ lifecycle: active
4
+ sourceOfTruth: src
5
+ validationPath: pnpm test && pnpm typecheck
6
+ ---
7
+
1
8
  # Knowledge Engine Runbook
2
9
 
3
10
  Doc Bridge is deterministic by default. It turns repository structure and Markdown declarations into versioned snapshot, reconciliation, rule, report, and workflow artifacts. Optional Registry assistance is explicit and never changes deterministic results.
@@ -34,10 +41,30 @@ Install the configured local Registry agent, then configure a local runner modul
34
41
 
35
42
  ```bash
36
43
  npx agentskit add ecosystem-doc-bridge-corpus-scanner
37
- ak-docs suggest --json
44
+ ak-docs suggest --documentation --json
45
+ ```
46
+
47
+ Set `intelligence.registry.enabled: true` and either `runnerModule` or the generic `cli` adapter in `doc-bridge.config.json`. The runner receives redacted immutable snapshot/report/evidence context and must return `AgentProposalV1`. Network, shell, direct file mutation, and automatic approval are not available to a module runner. A CLI receives the same context as a JSON envelope on stdin and must write exactly one `AgentProposalV1` JSON object to stdout; configure the executable and argument array without shell syntax:
48
+
49
+ ```json
50
+ {
51
+ "intelligence": {
52
+ "registry": {
53
+ "enabled": true,
54
+ "agentId": "ecosystem-doc-bridge-corpus-scanner",
55
+ "cli": {
56
+ "command": "codex",
57
+ "args": ["exec", "--json"]
58
+ },
59
+ "timeoutMs": 120000,
60
+ "maxInputBytes": 8000000,
61
+ "maxResponseBytes": 262144
62
+ }
63
+ }
64
+ }
38
65
  ```
39
66
 
40
- Set `intelligence.registry.enabled: true` and `runnerModule` in `doc-bridge.config.json`. The runner receives redacted immutable snapshot/report/evidence context and must return `AgentProposalV1`. Network, shell, direct file mutation, and automatic approval are not available.
67
+ The child runs with the project root as its working directory, never through a shell, and inherits the parent environment so the CLI can use its own login. Doc Bridge enforces timeout, output and proposal-schema limits, rejects non-zero exits, non-JSON output, mismatched hashes, and invalid origins. The CLI is an explicit trust boundary: its own network and filesystem permissions are controlled by the operator, not by Doc Bridge.
41
68
 
42
69
  ## Recovery and CI
43
70
 
@@ -45,6 +72,14 @@ Rerunning an unchanged command reuses valid stage artifacts. A changed source re
45
72
 
46
73
  The first implementation analyzes JavaScript/TypeScript and Markdown. Other languages should add analyzers that emit the same canonical entity, relation, evidence, coverage, and hash contracts.
47
74
 
75
+ ## What the Markdown analyzer reads
76
+
77
+ Documentation is parsed with remark (CommonMark plus GFM), so a document's own prose becomes
78
+ evidence: links between documents, paths and package names in inline code, and exported names all
79
+ become `observed` relations carrying the line they were claimed on. The contract — relation kinds,
80
+ the ambiguity and near-miss rules, generated regions, the document fields and the `docbridge`
81
+ schema — is [Markdown analyzer v1](./spec/markdown-analyzer-v1.md).
82
+
48
83
  ## Relation coverage policy
49
84
 
50
85
  Agent documents under the configured `corpus.agent.root` may use the conventional
@@ -52,7 +87,7 @@ Agent documents under the configured `corpus.agent.root` may use the conventiona
52
87
  `humanDoc` field. This is intentionally separate from the human bridge: `humanDoc`
53
88
  still reports whether an agent has a resolvable human-facing guide.
54
89
 
55
- Missing declarations are configurable because not every implementation import is useful documentation. In the root configuration, `reconciliation.scope` selects the semantic comparison level while `reconciliation.requiredRelationKinds` selects the observed relation kinds that must be declared in Markdown. Raw file relations remain available in the snapshot and report for evidence and exploration:
90
+ Missing declarations are configurable because not every implementation import is useful documentation. In the root configuration, `reconciliation.scope` selects the semantic comparison level while `reconciliation.requiredRelationKinds` selects the observed relation kinds that must be declared in Markdown. A single-package repository wants `scope: "area"`: at package scope its internal relations aggregate into one self-loop the comparison skips, so nothing is reported. See [areas](./spec/config-v1.md#analysisareas-optional). Raw file relations remain available in the snapshot and report for evidence and exploration:
56
91
 
57
92
  ```json
58
93
  {
@@ -0,0 +1,21 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 520" role="img" aria-labelledby="title desc">
2
+ <title id="title">Estimated context payload (not tokens)</title>
3
+ <desc id="desc">Historical anonymized dogfooding · validation-cycle-02 · Doc Bridge 1.7.20</desc>
4
+ <rect width="1200" height="520" rx="24" fill="#0b0f14"/>
5
+ <g font-family="Inter, ui-sans-serif, system-ui, sans-serif" fill="#e8eef6">
6
+ <text x="64" y="76" font-size="32" font-weight="700">Estimated context payload (not tokens)</text>
7
+ <text x="64" y="112" font-size="18" fill="#8fa3b8">Historical anonymized dogfooding · validation-cycle-02 · Doc Bridge 1.7.20</text>
8
+
9
+ <text x="64" y="192" font-size="20" font-weight="600">Repository corpus</text>
10
+ <text x="1136" y="192" text-anchor="end" font-size="24" font-weight="700">100%</text>
11
+ <rect x="64" y="216" width="1072" height="38" rx="19" fill="#1e2a38"/>
12
+ <rect x="64" y="216" width="1072" height="38" rx="19" fill="#3d9cf5"/>
13
+ <text x="64" y="326" font-size="20" font-weight="600">Estimated P95 agent context payload</text>
14
+ <text x="1136" y="326" text-anchor="end" font-size="24" font-weight="700">1%</text>
15
+ <rect x="64" y="350" width="1072" height="38" rx="19" fill="#1e2a38"/>
16
+ <rect x="64" y="350" width="11" height="38" rx="19" fill="#3ecf8e"/>
17
+ <text x="64" y="454" font-size="34" font-weight="700" fill="#3ecf8e">Up to 99% less context payload</text>
18
+ <text x="64" y="486" font-size="16" fill="#8fa3b8">Estimated payload reduction; provider tokens and correctness are separate measures.</text>
19
+
20
+ </g>
21
+ </svg>
@@ -0,0 +1,30 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 620" role="img" aria-labelledby="title desc">
2
+ <title id="title">Controlled A/B signal (operational)</title>
3
+ <desc id="desc">96 anonymized executions · 24 tasks · 2 pinned models · one replicate · bounded adjudication</desc>
4
+ <rect width="1200" height="620" rx="24" fill="#0b0f14"/>
5
+ <g font-family="Inter, ui-sans-serif, system-ui, sans-serif" fill="#e8eef6">
6
+ <text x="64" y="76" font-size="32" font-weight="700">Controlled A/B signal (operational)</text>
7
+ <text x="64" y="112" font-size="18" fill="#8fa3b8">96 anonymized executions · 24 tasks · 2 pinned models · one replicate · bounded adjudication</text>
8
+
9
+ <line x1="600" y1="158" x2="600" y2="548" stroke="#526579" stroke-width="2"/>
10
+ <text x="600" y="142" text-anchor="middle" font-size="16" fill="#8fa3b8">repository-only baseline</text>
11
+ <text x="64" y="214" font-size="20" font-weight="600">Paired provider tokens</text>
12
+ <text x="1136" y="214" text-anchor="end" font-size="24" font-weight="700" fill="#3ecf8e">−18.46%</text>
13
+ <rect x="64" y="234" width="1072" height="14" rx="7" fill="#1e2a38"/>
14
+ <rect x="470" y="234" width="130" height="14" rx="7" fill="#3ecf8e"/>
15
+ <text x="64" y="298" font-size="20" font-weight="600">P95 latency</text>
16
+ <text x="1136" y="298" text-anchor="end" font-size="24" font-weight="700" fill="#3ecf8e">−39.75 s</text>
17
+ <rect x="64" y="318" width="1072" height="14" rx="7" fill="#1e2a38"/>
18
+ <rect x="320" y="318" width="280" height="14" rx="7" fill="#3ecf8e"/>
19
+ <text x="64" y="382" font-size="20" font-weight="600">Operational completion</text>
20
+ <text x="1136" y="382" text-anchor="end" font-size="24" font-weight="700" fill="#3ecf8e">+12.50 pp</text>
21
+ <rect x="64" y="402" width="1072" height="14" rx="7" fill="#1e2a38"/>
22
+ <rect x="600" y="402" width="88" height="14" rx="7" fill="#3ecf8e"/>
23
+ <text x="64" y="466" font-size="20" font-weight="600">Evidence quality</text>
24
+ <text x="1136" y="466" text-anchor="end" font-size="24" font-weight="700" fill="#3ecf8e">−2.08 pp</text>
25
+ <rect x="64" y="486" width="1072" height="14" rx="7" fill="#1e2a38"/>
26
+ <rect x="580" y="486" width="20" height="14" rx="7" fill="#3ecf8e"/>
27
+ <text x="64" y="584" font-size="16" fill="#8fa3b8">Directional signal; see the full study for denominators and limitations.</text>
28
+
29
+ </g>
30
+ </svg>
@@ -5,6 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>doc-bridge — docs your agents can act on</title>
7
7
  <meta name="description" content="Turn human docs into executable handoffs for agents, and turn agent memory into reviewable documentation drafts. MCP, CLI, CI. No API key required." />
8
+ <link rel="icon" href="data:," />
8
9
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
10
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
11
  <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap" rel="stylesheet" />
@@ -121,6 +122,61 @@
121
122
  border-radius: var(--radius);
122
123
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
123
124
  }
125
+ .metrics {
126
+ display: grid;
127
+ gap: 1rem;
128
+ margin: 2rem 0 0;
129
+ }
130
+ .metrics-card {
131
+ background: var(--surface);
132
+ border: 1px solid var(--border);
133
+ border-radius: var(--radius);
134
+ padding: 1rem;
135
+ }
136
+ .metrics-card img { display: block; width: 100%; height: auto; border-radius: 8px; }
137
+ .metrics-note { color: var(--muted); font-size: 0.85rem; margin-top: 0.75rem; }
138
+ .metric-kicker,
139
+ .finding-kicker {
140
+ color: var(--green);
141
+ font-family: var(--mono);
142
+ font-size: 0.72rem;
143
+ font-weight: 600;
144
+ letter-spacing: 0.08em;
145
+ text-transform: uppercase;
146
+ }
147
+ .quality-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 1.25rem; align-items: start; }
148
+ .finding {
149
+ background: #0d1219;
150
+ border: 1px solid var(--border);
151
+ border-radius: var(--radius);
152
+ padding: 1.25rem;
153
+ font-family: var(--mono);
154
+ font-size: 0.86rem;
155
+ line-height: 1.7;
156
+ overflow-x: auto;
157
+ }
158
+ .finding strong { color: var(--red); font-weight: 600; }
159
+ .finding span { color: var(--muted); }
160
+ .contributor-cta { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
161
+ .contributor-cta p { color: var(--muted); max-width: 62ch; margin: 0.5rem 0 1rem; }
162
+ .metric-mobile-summary { display: none; }
163
+ @media (max-width: 480px) {
164
+ .metrics-card img { display: none; }
165
+ .metric-mobile-summary {
166
+ display: grid;
167
+ grid-template-columns: repeat(2, minmax(0, 1fr));
168
+ gap: 0.75rem;
169
+ margin-top: 1rem;
170
+ }
171
+ .metric-mobile-summary div {
172
+ padding: 0.9rem;
173
+ border: 1px solid var(--border);
174
+ border-radius: 8px;
175
+ background: #0d1219;
176
+ }
177
+ .metric-mobile-summary strong { display: block; color: var(--green); font-size: 1.35rem; line-height: 1.1; }
178
+ .metric-mobile-summary span { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.35rem; }
179
+ }
124
180
  .t-dim { color: var(--muted); }
125
181
  .t-ok { color: var(--green); }
126
182
  .t-bad { color: var(--red); }
@@ -129,7 +185,7 @@
129
185
  h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
130
186
  .section-lead { color: var(--muted); margin-bottom: 2rem; max-width: 60ch; }
131
187
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
132
- @media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } .nav-links { display: none; } }
188
+ @media (max-width: 720px) { .grid-2, .quality-grid { grid-template-columns: 1fr; } .nav-links { display: none; } }
133
189
  .card {
134
190
  background: var(--surface);
135
191
  border: 1px solid var(--border);
@@ -197,6 +253,7 @@
197
253
  <div class="logo">doc-bridge <span>/ ak-docs</span></div>
198
254
  <nav class="nav-links">
199
255
  <a href="#demo">Demo</a>
256
+ <a href="#quality">Quality</a>
200
257
  <a href="#loops">Loops</a>
201
258
  <a href="#used-by">Used by</a>
202
259
  <a href="https://github.com/AgentsKit-io/doc-bridge">GitHub</a>
@@ -256,6 +313,57 @@
256
313
  </div>
257
314
  </div>
258
315
  </div>
316
+ <div class="metrics" aria-labelledby="measured-impact-title">
317
+ <div class="metrics-card">
318
+ <h2 id="measured-impact-title">Measured context efficiency</h2>
319
+ <div class="metric-kicker">Estimated · historical benchmark</div>
320
+ <p class="section-lead">Anonymized dogfooding estimated up to 99% less context payload between the scanned repository corpus and the P95 agent payload. This is not a provider-token measurement.</p>
321
+ <img src="assets/context-payload-reduction.svg" alt="Estimated context payload reduction from 100 percent of the repository corpus to 1 percent of the agent context payload" />
322
+ <div class="metric-mobile-summary" aria-label="Estimated context efficiency summary">
323
+ <div><strong>99%</strong><span>less context payload</span></div>
324
+ <div><strong>1%</strong><span>estimated P95 payload</span></div>
325
+ </div>
326
+ <p class="metrics-note">Doc Bridge 1.7.20 · estimated payload reduction, not a guaranteed token reduction or correctness result.</p>
327
+ </div>
328
+ <div class="metrics-card">
329
+ <h2>Controlled A/B signal</h2>
330
+ <div class="metric-kicker">Operational · 46 token-complete pairs</div>
331
+ <p class="section-lead">Across 96 anonymized executions, the deterministic workflow showed fewer paired provider token-equivalent units, lower P95 latency, and higher operational completion. A bounded adjudicator found no semantic successes in either arm, so this remains an inconclusive directional signal.</p>
332
+ <img src="assets/controlled-ab-comparison.svg" alt="Controlled A/B comparison showing 18.46 percent fewer paired provider token-equivalent units, 39.75 seconds lower P95 latency, and 12.5 percentage points more operationally completed executions" />
333
+ <div class="metric-mobile-summary" aria-label="Controlled A/B signal summary">
334
+ <div><strong>−18.46%</strong><span>token-equivalent units</span></div>
335
+ <div><strong>−39.75 s</strong><span>P95 latency</span></div>
336
+ </div>
337
+ <p class="metrics-note"><a href="https://github.com/AgentsKit-io/doc-bridge/blob/master/docs/study/README.md">Read the methodology and anonymized data.</a></p>
338
+ </div>
339
+ </div>
340
+ </div>
341
+ </section>
342
+
343
+ <section id="quality">
344
+ <div class="wrap">
345
+ <h2>Find the gap between docs and reality.</h2>
346
+ <p class="section-lead">Doc Bridge compares declared documentation and ownership with the observed project graph, then keeps every finding tied to evidence and a reviewable action.</p>
347
+ <div class="quality-grid">
348
+ <div class="finding" aria-label="Anonymized documentation contradiction finding">
349
+ <div class="finding-kicker">Anonymized finding</div>
350
+ <div><strong>CONTRADICTION · high confidence</strong></div>
351
+ <div>Documentation declaration differs from the observed project relation</div>
352
+ <div><span>Evidence: 4 source files + 1 documentation declaration</span></div>
353
+ <div><span>Action: review ownership and update the canonical document</span></div>
354
+ </div>
355
+ <div>
356
+ <h3>What the deterministic audit can show</h3>
357
+ <table class="surface-table">
358
+ <tbody>
359
+ <tr><td>Coverage</td><td>Missing package or ownership documentation</td></tr>
360
+ <tr><td>Freshness</td><td>Stale declared relations and generated-document boundaries</td></tr>
361
+ <tr><td>Quality</td><td>Titles, examples, required sections, metadata, and exact duplicates</td></tr>
362
+ <tr><td>Limits</td><td>Natural-language correctness and semantic redundancy remain review work</td></tr>
363
+ </tbody>
364
+ </table>
365
+ </div>
366
+ </div>
259
367
  </div>
260
368
  </section>
261
369
 
@@ -304,7 +412,7 @@
304
412
  <div class="card">
305
413
  <div class="loop-tag">Explain</div>
306
414
  <h3>Local consult</h3>
307
- <p><code>ask</code> · optional Ollama chat</p>
415
+ <p><code>ask</code> · optional provider-backed review</p>
308
416
  </div>
309
417
  </div>
310
418
  </div>
@@ -312,8 +420,8 @@
312
420
 
313
421
  <section id="used-by">
314
422
  <div class="wrap">
315
- <h2>Used by AgentsKit (public)</h2>
316
- <p class="section-lead">Dogfooded on open surfaces — not private monorepo claims.</p>
423
+ <h2>Public dogfood surfaces</h2>
424
+ <p class="section-lead">Open AgentsKit surfaces used for validation — not independent customer or private-monorepo claims.</p>
317
425
  <div class="used-by">
318
426
  <a href="https://www.agentskit.io/docs/for-agents">AgentsKit for-agents</a>
319
427
  <a href="https://registry.agentskit.io/">AgentsKit Registry</a>
@@ -326,6 +434,12 @@
326
434
  <img src="https://img.shields.io/badge/handoff_coverage-ready-2ea44f?style=flat-square" alt="handoff coverage" />
327
435
  <img src="https://img.shields.io/github/actions/workflow/status/AgentsKit-io/doc-bridge/ci.yml?branch=master&style=flat-square&label=CI" alt="CI" />
328
436
  </div>
437
+ <div class="contributor-cta">
438
+ <h3>Help make repository knowledge verifiable.</h3>
439
+ <p>Reproduce the anonymized study, add an analyzer, contribute a documentation rule, or create a fixture for a stale relation or structured contradiction.</p>
440
+ <a class="btn btn-primary" href="https://github.com/AgentsKit-io/doc-bridge/blob/master/docs/study/README.md">Reproduce the study</a>
441
+ <a class="btn btn-ghost" href="https://github.com/AgentsKit-io/doc-bridge/blob/master/CONTRIBUTING.md">Contribute</a>
442
+ </div>
329
443
  </div>
330
444
  </section>
331
445
 
@@ -337,7 +451,7 @@
337
451
  <div class="terminal-bar"><span class="dot dot-r"></span><span class="dot dot-y"></span><span class="dot dot-g"></span></div>
338
452
  <div class="terminal-body">
339
453
  <div class="t-dim"># .github/workflows/pr.yml</div>
340
- <div>- uses: <span class="t-hi">AgentsKit-io/doc-bridge@v1.4.0</span></div>
454
+ <div>- uses: <span class="t-hi">AgentsKit-io/doc-bridge@ee756a13c006c597445c31e2643c1e8cece715d7</span> <span class="t-dim"># v1.7.45</span></div>
341
455
  <div>&nbsp;&nbsp;with:</div>
342
456
  <div>&nbsp;&nbsp;&nbsp;&nbsp;config-path: doc-bridge.config.json</div>
343
457
  </div>