docorbit 0.1.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 (144) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +660 -0
  3. package/apps/cli/bin/docorbit.js +8 -0
  4. package/apps/cli/src/commands/add.ts +44 -0
  5. package/apps/cli/src/commands/api.ts +38 -0
  6. package/apps/cli/src/commands/context.ts +47 -0
  7. package/apps/cli/src/commands/dashboard.ts +55 -0
  8. package/apps/cli/src/commands/diff.ts +30 -0
  9. package/apps/cli/src/commands/evaluate.ts +133 -0
  10. package/apps/cli/src/commands/examples.ts +39 -0
  11. package/apps/cli/src/commands/export.ts +89 -0
  12. package/apps/cli/src/commands/impact.ts +31 -0
  13. package/apps/cli/src/commands/init.ts +69 -0
  14. package/apps/cli/src/commands/inspect.ts +30 -0
  15. package/apps/cli/src/commands/mcp.ts +72 -0
  16. package/apps/cli/src/commands/pitfalls.ts +38 -0
  17. package/apps/cli/src/commands/recipes.ts +35 -0
  18. package/apps/cli/src/commands/search.ts +48 -0
  19. package/apps/cli/src/commands/update.ts +73 -0
  20. package/apps/cli/src/commands/verify.ts +48 -0
  21. package/apps/cli/src/formatters/colors.ts +23 -0
  22. package/apps/cli/src/formatters/inspection.ts +102 -0
  23. package/apps/cli/src/formatters/knowledge.ts +272 -0
  24. package/apps/cli/src/formatters/retrieval.ts +74 -0
  25. package/apps/cli/src/formatters/terminal.ts +6 -0
  26. package/apps/cli/src/formatters/verification.ts +126 -0
  27. package/apps/cli/src/index.ts +409 -0
  28. package/bin/docorbit.js +8 -0
  29. package/package.json +46 -0
  30. package/packages/core/src/dashboard/server.ts +314 -0
  31. package/packages/core/src/dashboard/ui.ts +586 -0
  32. package/packages/core/src/implementation-service.ts +451 -0
  33. package/packages/core/src/index.ts +7 -0
  34. package/packages/core/src/inspector.ts +71 -0
  35. package/packages/core/src/pipeline.ts +331 -0
  36. package/packages/crawler/src/config.ts +12 -0
  37. package/packages/crawler/src/fetcher.ts +185 -0
  38. package/packages/crawler/src/index.ts +2 -0
  39. package/packages/discovery/src/index.ts +31 -0
  40. package/packages/discovery/src/provider.ts +47 -0
  41. package/packages/discovery/src/providers/generic.ts +98 -0
  42. package/packages/discovery/src/providers/github.ts +61 -0
  43. package/packages/discovery/src/providers/llms-txt.ts +73 -0
  44. package/packages/discovery/src/providers/markdown.ts +48 -0
  45. package/packages/discovery/src/providers/openapi.ts +91 -0
  46. package/packages/discovery/src/providers/sitemap.ts +62 -0
  47. package/packages/discovery/src/providers/skill.ts +54 -0
  48. package/packages/discovery/src/ranker.ts +123 -0
  49. package/packages/evaluation/src/dataset.ts +963 -0
  50. package/packages/evaluation/src/index.ts +8 -0
  51. package/packages/evaluation/src/runner.ts +241 -0
  52. package/packages/evaluation/src/strategies/context7-runner.ts +269 -0
  53. package/packages/evaluation/src/strategies/docorbit-runner.ts +228 -0
  54. package/packages/evaluation/src/strategies/firecrawl-runner.ts +172 -0
  55. package/packages/evaluation/src/strategies/web-search-runner.ts +194 -0
  56. package/packages/evaluation/src/types.ts +34 -0
  57. package/packages/evaluation/src/version-matcher.ts +73 -0
  58. package/packages/export/src/agents-md.ts +200 -0
  59. package/packages/export/src/claude-md.ts +141 -0
  60. package/packages/export/src/docs-map.ts +150 -0
  61. package/packages/export/src/index.ts +6 -0
  62. package/packages/export/src/llms-txt.ts +96 -0
  63. package/packages/export/src/service.ts +250 -0
  64. package/packages/export/src/skill-md.ts +128 -0
  65. package/packages/mcp/src/index.ts +46 -0
  66. package/packages/mcp/src/resources/index.ts +189 -0
  67. package/packages/mcp/src/server.ts +278 -0
  68. package/packages/mcp/src/tools/analyze-impact.ts +74 -0
  69. package/packages/mcp/src/tools/check-api.ts +86 -0
  70. package/packages/mcp/src/tools/diff-docs.ts +68 -0
  71. package/packages/mcp/src/tools/export-context.ts +73 -0
  72. package/packages/mcp/src/tools/find-api.ts +99 -0
  73. package/packages/mcp/src/tools/find-example.ts +100 -0
  74. package/packages/mcp/src/tools/find-pitfall.ts +94 -0
  75. package/packages/mcp/src/tools/find-recipe.ts +98 -0
  76. package/packages/mcp/src/tools/get-doc.ts +130 -0
  77. package/packages/mcp/src/tools/get-docs-map.ts +64 -0
  78. package/packages/mcp/src/tools/get-version.ts +118 -0
  79. package/packages/mcp/src/tools/implementation-context.ts +88 -0
  80. package/packages/mcp/src/tools/index.ts +59 -0
  81. package/packages/mcp/src/tools/list-sources.ts +85 -0
  82. package/packages/mcp/src/tools/search-docs.ts +123 -0
  83. package/packages/mcp/src/tools/types.ts +28 -0
  84. package/packages/mcp/src/transports/http.ts +256 -0
  85. package/packages/mcp/src/transports/stdio.ts +105 -0
  86. package/packages/mcp/src/transports/types.ts +6 -0
  87. package/packages/mcp/src/types.ts +102 -0
  88. package/packages/normalizer/src/example-indexer.ts +240 -0
  89. package/packages/normalizer/src/html.ts +253 -0
  90. package/packages/normalizer/src/index.ts +8 -0
  91. package/packages/normalizer/src/llms.ts +83 -0
  92. package/packages/normalizer/src/openapi/endpoint-parser.ts +406 -0
  93. package/packages/normalizer/src/openapi/schema-resolver.ts +111 -0
  94. package/packages/normalizer/src/openapi.ts +2 -0
  95. package/packages/normalizer/src/page.ts +184 -0
  96. package/packages/normalizer/src/pitfall-extractor.ts +190 -0
  97. package/packages/normalizer/src/slicer.ts +455 -0
  98. package/packages/retrieval/src/engine.ts +120 -0
  99. package/packages/retrieval/src/index.ts +7 -0
  100. package/packages/retrieval/src/intent.ts +43 -0
  101. package/packages/retrieval/src/packer.ts +145 -0
  102. package/packages/retrieval/src/recipe-engine.ts +313 -0
  103. package/packages/retrieval/src/scorer.ts +139 -0
  104. package/packages/retrieval/src/weights.ts +31 -0
  105. package/packages/security/src/annotations.ts +112 -0
  106. package/packages/security/src/index.ts +2 -0
  107. package/packages/security/src/ssrf.ts +153 -0
  108. package/packages/shared/src/errors.ts +53 -0
  109. package/packages/shared/src/hashing.ts +23 -0
  110. package/packages/shared/src/index.ts +3 -0
  111. package/packages/shared/src/types.ts +881 -0
  112. package/packages/storage/src/db.ts +72 -0
  113. package/packages/storage/src/index.ts +11 -0
  114. package/packages/storage/src/interfaces.ts +115 -0
  115. package/packages/storage/src/repositories/api-repository.ts +219 -0
  116. package/packages/storage/src/repositories/chunk-repository.ts +316 -0
  117. package/packages/storage/src/repositories/example-repository.ts +206 -0
  118. package/packages/storage/src/repositories/page-repository.ts +205 -0
  119. package/packages/storage/src/repositories/pitfall-repository.ts +188 -0
  120. package/packages/storage/src/repositories/source-repository.ts +205 -0
  121. package/packages/storage/src/repository.ts +256 -0
  122. package/packages/storage/src/schema.ts +269 -0
  123. package/packages/storage/src/search-tokens.ts +28 -0
  124. package/packages/verification/src/diff-engine.ts +258 -0
  125. package/packages/verification/src/extractor.ts +339 -0
  126. package/packages/verification/src/impact-scanner.ts +203 -0
  127. package/packages/verification/src/index.ts +5 -0
  128. package/packages/verification/src/services.ts +238 -0
  129. package/packages/verification/src/verifier.ts +375 -0
  130. package/packages/workspace/src/detector.ts +143 -0
  131. package/packages/workspace/src/ecosystems/cargo.ts +84 -0
  132. package/packages/workspace/src/ecosystems/composer.ts +42 -0
  133. package/packages/workspace/src/ecosystems/go.ts +54 -0
  134. package/packages/workspace/src/ecosystems/index.ts +34 -0
  135. package/packages/workspace/src/ecosystems/maven.ts +34 -0
  136. package/packages/workspace/src/ecosystems/npm.ts +83 -0
  137. package/packages/workspace/src/ecosystems/pub.ts +40 -0
  138. package/packages/workspace/src/ecosystems/pypi.ts +100 -0
  139. package/packages/workspace/src/ecosystems/rubygems.ts +30 -0
  140. package/packages/workspace/src/ecosystems/types.ts +18 -0
  141. package/packages/workspace/src/index.ts +5 -0
  142. package/packages/workspace/src/lockfile.ts +194 -0
  143. package/packages/workspace/src/resolver.ts +234 -0
  144. package/packages/workspace/src/semver.ts +259 -0
package/README.md ADDED
@@ -0,0 +1,660 @@
1
+ # DocOrbit
2
+
3
+ > **The documentation intelligence layer for AI coding agents.**
4
+
5
+ DocOrbit bridges the gap between raw developer documentation websites and autonomous coding agents (Claude Code, Cursor, Codex, Windsurf, Devin, etc.).
6
+
7
+ Instead of forcing coding agents to consume bloated HTML pages, guess API signatures, or drown in 200k-token sitemaps, DocOrbit discovers authoritative machine-readable specifications (`llms.txt`, OpenAPI, Agent Skills, raw Markdown), normalizes content into structured AST representations, guards against documentation-based prompt injection and SSRF attacks, and indexes documentation into a lightning-fast local SQLite database.
8
+
9
+ ---
10
+
11
+ ## The Problem: Why Scrapers Aren't Enough
12
+
13
+ | Approach | What It Does | Why It Fails Coding Agents |
14
+ | :--- | :--- | :--- |
15
+ | **Search APIs** (Tavily, Exa) | Returns top Google/Bing web search snippets | Outdated SEO spam, blog posts from 2021, missing full API types, high latency. |
16
+ | **Web Scrapers** (Firecrawl, Jina) | Converts raw browser DOM to Markdown | Dumps navigation chrome, headers, footers, cookie banners, lacks source hierarchy. |
17
+ | **Doc Aggregators** (Context7) | Pulls central `llms.txt` / curated repositories | Narrow scope, lacks multi-source ranking, lacks local offline-first SQLite FTS5 caching, lacks prompt injection annotations. |
18
+ | **DocOrbit** | **Full documentation intelligence pipeline** | Discovers machine-readable specs, ranks by agent purpose, strips boilerplate, detects prompt injections, isolates network threats, and stores structured ASTs with FTS5 search. |
19
+
20
+ ---
21
+
22
+ ## Architectural Principles
23
+
24
+ 1. **Zero External Runtime Dependencies**: Built entirely with modern Node.js 24 ESM, native `--experimental-strip-types`, and built-in `node:sqlite`. No bloated npm dependencies, no native toolchain compilation, cold boot in < 40ms.
25
+ 2. **Authority-Driven Source Discovery**: Automatically probes and prioritizes `llms-full.txt` > `openapi.json` > `llms.txt` > `skill.md` > raw Markdown > GitHub > HTML sitemaps.
26
+ 3. **Purpose-Aware Source Ranking**: Intelligently re-ranks available sources based on the agent's immediate intent (`navigation`, `conceptual`, `api`, `examples`, `implementation`).
27
+ 4. **Security-Hardened Ingestion**:
28
+ - **SSRF Prevention**: Prohibits private IP ranges (RFC 1918, RFC 4193), loopback (`127.0.0.1`), link-local, and cloud metadata endpoints (`169.254.169.254`) on all requests and redirect hops.
29
+ - **Non-Destructive Security Annotations**: Detects suspicious instructions (prompt injection, exfiltration attempts, command execution triggers) in external documentation and tags them in metadata without mutating the text.
30
+ - **Resource Bounded**: Hard streaming byte limits (10MB default) and request timeouts prevent denial-of-service via decompression bombs or infinite streams.
31
+ 5. **Offline-First Structured Storage**: Powered by SQLite in WAL mode with relational tables for sources, pages, links, code examples, snapshots, and an FTS5 full-text search index.
32
+
33
+ ---
34
+
35
+ ## Directory Structure
36
+
37
+ ```text
38
+ docorbit/
39
+ ├── apps/
40
+ │ └── cli/ # Command-line interface (inspect, add, formatters)
41
+ ├── bin/
42
+ │ └── docorbit.js # Executable entry point
43
+ ├── docs/ # Specification & deep research
44
+ │ ├── architecture.md # Full system architecture
45
+ │ ├── competitive-analysis.md # Competitive breakdown vs Context7, Firecrawl, etc.
46
+ │ ├── product-spec.md # Product requirements & 7-milestone roadmap
47
+ │ └── research.md # Research on ecosystem capabilities
48
+ ├── packages/
49
+ │ ├── core/ # Inspection coordinator & IngestionPipeline
50
+ │ ├── crawler/ # SecureFetcher with SSRF validation & streaming limits
51
+ │ ├── discovery/ # 7 discovery providers + purpose-based ranker
52
+ │ ├── normalizer/ # HTML-to-Markdown, OpenAPI parser, llms.txt parser
53
+ │ ├── security/ # SSRF validator & security annotation detector
54
+ │ ├── shared/ # TypeScript domain types, hashing, errors
55
+ │ └── storage/ # SQLite schema, WAL setup, and repository
56
+ └── tests/
57
+ ├── fixtures/ # In-memory WHATWG fetch server (Fixtures A–J)
58
+ ├── integration/ # Real-world fixture pipeline & benchmark tests
59
+ └── unit/ # Focused unit tests across all packages
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Getting Started
65
+
66
+ ### Requirements
67
+ - **Node.js 24.0.0+** (utilizes native `--experimental-strip-types` and `node:sqlite`)
68
+ - **No `npm install` needed** for core runtime!
69
+
70
+ ### Installation
71
+ Clone the repository and link or run directly:
72
+
73
+ ```bash
74
+ # Clone repository
75
+ git clone https://github.com/your-org/docorbit.git
76
+ cd docorbit
77
+
78
+ # Run CLI directly
79
+ node --experimental-strip-types bin/docorbit.js --help
80
+ ```
81
+
82
+ ---
83
+
84
+ ## CLI Usage
85
+
86
+ ### 1. Inspect Documentation Sources (`inspect`)
87
+
88
+ Probes a target documentation URL to discover and rank all available machine-readable and human-readable documentation endpoints:
89
+
90
+ ```bash
91
+ node --experimental-strip-types bin/docorbit.js inspect https://mintlify.com/docs
92
+ ```
93
+
94
+ Sample Terminal Output:
95
+ ```text
96
+ DocOrbit — Documentation Source Discovery
97
+ Target URL: https://mintlify.com/docs
98
+ Discovered Sources: 9 total (7 machine-readable)
99
+
100
+ Machine-Readable Documentation Sources:
101
+ 1. llms_full_txt (llms-full.txt)
102
+ URL: https://mintlify.com/docs/llms-full.txt
103
+ Authority: authoritative | Confidence: 95%
104
+ Metadata: {"description":"Full AI-native documentation bundle"}
105
+
106
+ 2. openapi (OpenAPI Specification)
107
+ URL: https://mintlify.com/docs/openapi.json
108
+ Authority: authoritative | Confidence: 95%
109
+ Metadata: {"description":"REST API OpenAPI specification"}
110
+
111
+ 3. llms_txt (llms.txt)
112
+ URL: https://mintlify.com/docs/llms.txt
113
+ Authority: authoritative | Confidence: 90%
114
+ ...
115
+ ```
116
+
117
+ For JSON output (ideal for feeding into scripts or coding agents):
118
+ ```bash
119
+ node --experimental-strip-types bin/docorbit.js inspect https://mintlify.com/docs --json
120
+ ```
121
+
122
+ ### 2. Ingest Documentation (`add`)
123
+
124
+ Fetches, normalizes, extracts code blocks, tokenizes, and stores the documentation into your local SQLite database:
125
+
126
+ ```bash
127
+ node --experimental-strip-types bin/docorbit.js add https://mintlify.com/docs --max-pages 5
128
+ ```
129
+
130
+ Sample Output:
131
+ ```text
132
+ DocOrbit — Documentation Ingested Successfully
133
+ Target URL: https://mintlify.com/docs
134
+ Snapshot ID: snap_ca92c2c785b1739d
135
+ Duration: 2833ms
136
+
137
+ Ingested Pages (4):
138
+ 1. Documentation
139
+ URL: https://www.mintlify.com/docs
140
+ Tokens: ~138 | Code blocks: 0 | Hash: 4a5f740d
141
+ 2. Mintlify External API (OpenAPI 3.0.1)
142
+ URL: https://www.mintlify.com/docs/openapi.json
143
+ Tokens: ~3687 | Code blocks: 1 | Hash: ff65050a
144
+ 3. AI-native documentation
145
+ URL: https://www.mintlify.com/docs/llms-full.txt
146
+ Tokens: ~391390 | Code blocks: 746 | Hash: 4104aa48
147
+ 4. Install the CLI
148
+ URL: https://www.mintlify.com/docs/cli/install
149
+ Tokens: ~1538 | Code blocks: 10 | Hash: 21fe04e7
150
+
151
+ Ingestion Summary:
152
+ Total Pages: 4
153
+ Total Raw Bytes: 2428.7 KB
154
+ Estimated Tokens: ~396753
155
+ Total Code Examples: 757
156
+ Machine-readable types: 7
157
+ ```
158
+
159
+ ### 3. Search Documentation Chunks (`search`)
160
+
161
+ Execute deterministic hybrid search combining FTS5 lexical ranking, exact phrases, heading hierarchy breadcrumbs, shallow symbol detection, and query intent weighting:
162
+
163
+ ```bash
164
+ node --experimental-strip-types bin/docorbit.js search "webhook signature verification"
165
+ node --experimental-strip-types bin/docorbit.js search "verifySignature" --type code
166
+ node --experimental-strip-types bin/docorbit.js search "POST /v1/webhook_endpoints" --json
167
+ ```
168
+
169
+ Sample Output:
170
+ ```text
171
+ DocOrbit — Search Results for: "webhook signature verification"
172
+ ════════════════════════════════════════════════════════════════
173
+ 1. Signature Verification > Example Code (Score: 32.45)
174
+ Type: code | Est. Tokens: ~120 | Chunk: chk_a1b2c3d4
175
+ Matches: BM25 base (14.45) • Exact phrase match (+5.0) • Title match [verification] (+8.0) • Intent alignment 'examples' (+6.0)
176
+ Symbols: verifyWebhookSignature, constructEvent
177
+ │ ```typescript
178
+ │ export function verifyWebhookSignature(payload: string, headerSig: string, secret: string) {
179
+ │ const event = stripe.webhooks.constructEvent(payload, headerSig, secret);
180
+ ```
181
+
182
+ ### 4. Pack Agent Task Context (`context`)
183
+
184
+ Assembles a structured, high-signal documentation package optimized for autonomous coding agents, optimizing for relevance + coverage - redundancy under strict token budgets:
185
+
186
+ ```bash
187
+ node --experimental-strip-types bin/orbit.js context "Implement Stripe webhook signature verification in Node.js" --tokens 2000
188
+ ```
189
+
190
+ Sample Output:
191
+ ```text
192
+ DocOrbit — Assembled Context Package
193
+ ════════════════════════════════════════════════════════════════
194
+ Task: Implement Stripe webhook signature verification in Node.js
195
+ Detected Intent: examples
196
+ Estimated Tokens: ~850 / 2000 (heuristic)
197
+ Chunks Included: 4
198
+ Sources Cited: https://docs.stripe.com/webhooks/signatures
199
+
200
+ Package Markdown Preview:
201
+ ────────────────────────────────────────────────────────────────
202
+ # Context Package: Implement Stripe webhook signature verification in Node.js
203
+ - **Detected Intent**: `examples`
204
+ - **Estimated Tokens**: ~850 / 2000 tokens (heuristic estimate)
205
+ - **Sources Included**: [https://docs.stripe.com/webhooks/signatures](https://docs.stripe.com/webhooks/signatures)
206
+
207
+ ---
208
+
209
+ ### Signature Verification > Verification Overview
210
+ *Type: `prose` | Est. Tokens: ~180*
211
+ Verify event signatures using HMAC-SHA256 to ensure webhook notifications originated from Stripe...
212
+ ```
213
+
214
+ ---
215
+
216
+ ### 5. Workspace Dependency Detection & Lockfile (`init`)
217
+
218
+ Scan project manifests across 8 ecosystems (`npm`, `cargo`, `go`, `pypi`, `composer`, `rubygems`, `pub`, `maven`), correlate with lockfiles, resolve against ingested documentation versions, and generate a deterministic `docs.lock`:
219
+
220
+ ```bash
221
+ node --experimental-strip-types bin/docorbit.js init .
222
+ ```
223
+
224
+ Sample Output:
225
+ ```text
226
+ === DocOrbit Project Initialization ===
227
+ Workspace Root: /path/to/my-app
228
+ Ecosystems: npm
229
+ Manifests: package.json, package-lock.json
230
+ Dependencies: 18 detected
231
+ Locked Docs: 1 dependencies resolved to documentation
232
+
233
+ -----------------------------------------------------------------------------
234
+ | Package | Project Ver | Doc Ver | Match | Confidence |
235
+ -----------------------------------------------------------------------------
236
+ | next | 14.2.3 | v14 | major | 90% |
237
+ -----------------------------------------------------------------------------
238
+
239
+ Generated deterministic docs.lock at: /path/to/my-app/docs.lock
240
+ ```
241
+
242
+ ### 6. Refresh Locked Documentation (`update`)
243
+
244
+ Selectively update specific dependencies or globally re-sync documentation versions while preserving timestamps on unchanged entries:
245
+
246
+ ```bash
247
+ node --experimental-strip-types bin/docorbit.js update next
248
+ ```
249
+
250
+ ### 8. API Intelligence & Structured Schemas
251
+
252
+ Query parsed OpenAPI 3.x / Swagger 2.0 endpoints with parameters, JSON request/response schemas, authentication mechanisms, pagination heuristics, and deprecation markers:
253
+
254
+ ```bash
255
+ # Query endpoints by path, operation, or action
256
+ node --experimental-strip-types bin/docorbit.js api "create webhook endpoint"
257
+ node --experimental-strip-types bin/docorbit.js api "/v1/webhook_endpoints" --method POST
258
+ ```
259
+
260
+ ### 9. Code Example Intelligence
261
+
262
+ Find first-class code snippets classified by language and detected framework (`next`, `react`, `express`, `fastapi`, `flask`, `django`, `spring`, `gin`):
263
+
264
+ ```bash
265
+ # Query code examples for a specific framework or task
266
+ node --experimental-strip-types bin/docorbit.js examples "verify signature" --framework express
267
+ node --experimental-strip-types bin/docorbit.js examples "FastAPI webhook" --language python
268
+ ```
269
+
270
+ ### 10. Pitfalls, Deprecations & Runtime Restrictions
271
+
272
+ Inspect explicit admonitions, deprecation notices, breaking changes, rate limit caveats, and runtime boundary restrictions (`server_only`, `client_only`):
273
+
274
+ ```bash
275
+ # Query pitfalls for a task or filter by kind
276
+ node --experimental-strip-types bin/docorbit.js pitfalls "route params" --kind deprecated
277
+ node --experimental-strip-types bin/docorbit.js pitfalls "secret" --kind server_only
278
+ ```
279
+
280
+ ### 11. Evidence-Grounded Implementation Recipes
281
+
282
+ Compile deterministic, traceable recipes that connect prerequisites, ordered steps, code examples, pitfalls, and evidence-based validation assertions directly from indexed documentation:
283
+
284
+ ```bash
285
+ # Assemble recipe for a goal with strict evidence grounding
286
+ node --experimental-strip-types bin/docorbit.js recipes "create webhook endpoint" --doc-version v1
287
+ node --experimental-strip-types bin/docorbit.js recipes "Next.js dynamic routes" --project .
288
+ ```
289
+
290
+ ### 12. Deterministic Code Verification (`verify`)
291
+
292
+ Statically verifies agent-generated or workspace code against indexed OpenAPI schemas, parameters, required request body fields, deprecations, removed APIs, and version boundaries:
293
+
294
+ ```bash
295
+ # Verify code string against resolved project documentation
296
+ node --experimental-strip-types bin/docorbit.js verify "fetch('https://api.stripe.com/v1/webhook_endpoints', { method: 'POST', body: JSON.stringify({ url: 'https://example.com' }) })" --version v14
297
+
298
+ # Output structured JSON verdict and findings
299
+ node --experimental-strip-types bin/docorbit.js verify "fetch('/v1/charges', { method: 'POST' })" --json
300
+ ```
301
+
302
+ Sample Terminal Output:
303
+ ```text
304
+ DocOrbit — API Schema Verification
305
+ Verdict: ❌ MISMATCH (Confidence: 95%)
306
+
307
+ Findings (1):
308
+ 1. [ERROR] (required_parameters) Missing required body field "enabled_events" for "POST /v1/webhook_endpoints"
309
+ Evidence: Endpoint ID ep_post_webhooks_v14
310
+ Expected: ["enabled_events"]
311
+ Actual: missing
312
+ ```
313
+
314
+ ### 13. Semantic Documentation Diffing (`diff`)
315
+
316
+ Compares documentation versions or snapshots, pinpointing added, modified, removed, and deprecated API endpoints and breaking pitfalls while ignoring formatting-only whitespace churn:
317
+
318
+ ```bash
319
+ # Diff documentation between two versions
320
+ node --experimental-strip-types bin/docorbit.js diff --from v14 --to v15
321
+
322
+ # Diff between specific snapshots with JSON output
323
+ node --experimental-strip-types bin/docorbit.js diff --from snap_001 --to snap_002 --json
324
+ ```
325
+
326
+ Sample Terminal Output:
327
+ ```text
328
+ DocOrbit — Documentation Diff
329
+ From: v14 → To: v15
330
+
331
+ Summary:
332
+ Endpoints Added: 1
333
+ Endpoints Removed: 1
334
+ Endpoints Modified: 1
335
+ Pitfalls Added: 1
336
+
337
+ API Endpoint Changes:
338
+ • [🔴 REMOVED] POST /v1/charges (Charges API permanently removed)
339
+ • [🔵 MODIFIED] GET /v1/users (Added query parameter "starting_after")
340
+ • [🟢 ADDED] POST /v1/payment_intents (Create a PaymentIntent)
341
+
342
+ Pitfall & Breaking Changes:
343
+ • [⚠️ NEW] breaking_change: Next.js 15: Asynchronous Route Parameters
344
+ ```
345
+
346
+ ### 14. Workspace Impact Analysis (`impact`)
347
+
348
+ Scans your repository workspace source files against documentation diffs, pinpointing exact files, lines, code snippets, matched patterns, and certainty rankings (`high`, `medium`, `heuristic`):
349
+
350
+ ```bash
351
+ # Analyze impact of documentation upgrade on current project
352
+ node --experimental-strip-types bin/docorbit.js impact . --from v14 --to v15
353
+ ```
354
+
355
+ Sample Terminal Output:
356
+ ```text
357
+ DocOrbit — Project Impact Analysis
358
+ Scanned Workspace: /path/to/my-project
359
+ Files Scanned: 24
360
+ Impacted Files: 2
361
+ Total Locations: 2
362
+
363
+ Impacted Files & Locations:
364
+ 1. src/services/billing.ts:42 (High Certainty, 95% confidence)
365
+ Reason: Endpoint "POST /v1/charges" was removed in API documentation.
366
+ Matched Pattern: /v1/charges
367
+ Code:
368
+ const res = await fetch('https://api.stripe.com/v1/charges', { method: 'POST' });
369
+
370
+ 2. app/blog/[slug]/page.tsx:8 (Medium Certainty, 85% confidence)
371
+ Reason: Synchronous route parameter access detected. Documentation deprecation notice: Next.js 15: Asynchronous Route Parameters
372
+ Matched Pattern: params.
373
+ Code:
374
+ const slug = params.slug;
375
+ ```
376
+
377
+ ### 15. Local Web Dashboard & Inspector (`dashboard` / `ui`)
378
+
379
+ Launch an embedded, zero-dependency local web dashboard powered by native `node:http` (port 3737) to inspect indexed documentation, OpenAPI specifications, version matrices, pitfalls, and code examples, and run interactive code verifications:
380
+
381
+ ```bash
382
+ # Start local dashboard server on http://127.0.0.1:3737/
383
+ node --experimental-strip-types bin/docorbit.js dashboard
384
+
385
+ # Or specify custom port
386
+ node --experimental-strip-types bin/docorbit.js dashboard --port 8080
387
+ ```
388
+
389
+ Key Dashboard Capabilities:
390
+ - **Visual Overview & Health**: Live counts of indexed sources, pages, chunks, APIs, pitfalls, active documentation versions, and storage stats with explicit `untrusted: true` boundary markers.
391
+ - **Interactive API Explorer**: Filterable by HTTP method, path, and version tag, displaying parameter requirements and JSON schemas.
392
+ - **Critical Pitfalls & Caveats**: Color-coded by severity (`error`, `warning`, `info`) and category (`deprecated`, `removed`, `server_only`, `rate_limit`, `security`).
393
+ - **Curated Code Examples**: Categorized by framework and language.
394
+ - **Interactive API Verifier**: Test code snippets in real-time against indexed schemas, parameter constraints, and version rules.
395
+ - **Documentation Map & Token Tree**: Visual breakdown of page hierarchy, headings, and token allocation footprints.
396
+ - **Export Center**: One-click preview and clipboard copy for `AGENTS.md`, `CLAUDE.md`, `skill.md`, `llms.txt`, and `docs-map.md`.
397
+
398
+ ### 16. Deterministic Agent Guidance Exporters (`export`)
399
+
400
+ Generate reproducible, version-grounded agent configuration and context files directly from indexed documentation and workspace package manifests:
401
+
402
+ ```bash
403
+ # Export universal AGENTS.md guide to workspace root
404
+ node --experimental-strip-types bin/docorbit.js export agents.md
405
+
406
+ # Export Claude Code / Anthropic specific CLAUDE.md
407
+ node --experimental-strip-types bin/docorbit.js export claude.md
408
+
409
+ # Export structured agent skill definition
410
+ node --experimental-strip-types bin/docorbit.js export skill.md
411
+
412
+ # Export standard llms.txt index
413
+ node --experimental-strip-types bin/docorbit.js export llms.txt
414
+
415
+ # Export hierarchical documentation map
416
+ node --experimental-strip-types bin/docorbit.js export docs-map.md
417
+
418
+ # Output directly to stdout or custom destination
419
+ node --experimental-strip-types bin/docorbit.js export agents.md --stdout
420
+ node --experimental-strip-types bin/docorbit.js export agents.md --output docs/AGENTS.md --doc-version v14
421
+ ```
422
+
423
+ ### 17. Model Context Protocol (MCP) Server (`mcp`)
424
+
425
+ Start DocOrbit as an agent-native MCP server communicating via JSON-RPC 2.0. Coding agents (Claude Code, Cursor, Windsurf, OpenCode) can interact over standard input/output (`stdio`) or Streamable HTTP:
426
+
427
+ ```bash
428
+ # Start in Stdio mode (for CLI agents like Claude Code, Cursor, OpenCode)
429
+ node --experimental-strip-types bin/docorbit.js mcp --stdio
430
+
431
+ # Or start in Streamable HTTP mode (supports POST /mcp, GET /sse, GET /health)
432
+ node --experimental-strip-types bin/docorbit.js mcp --port 3000 --host 127.0.0.1
433
+ ```
434
+
435
+ #### The 14 Agent-Native Tools:
436
+
437
+ | Tool Name | Type | Description |
438
+ | :--- | :--- | :--- |
439
+ | `get_implementation_context` | **High-Level Centerpiece** | Orchestrates task → project/dependency detection → version resolution → intent → retrieval → APIs → examples → pitfalls → recipe → token-budgeted context → provenance → verification hints. |
440
+ | `check_api` | Verification | Deterministically checks code against indexed OpenAPI schemas, parameters, required body fields, deprecations, and version contracts. |
441
+ | `diff_docs` | Intelligence | Compares documentation versions/snapshots to detect added, removed, modified, and deprecated endpoints/pitfalls. |
442
+ | `analyze_impact` | Intelligence | Scans workspace project files for breaking changes and deprecated APIs, returning line, snippet, and certainty. |
443
+ | `get_documentation_map` | Structure | Retrieves the hierarchical documentation tree, section headings, and token footprints. |
444
+ | `export_agent_context` | Agent Export | Generates `AGENTS.md`, `CLAUDE.md`, `skill.md`, `llms.txt`, and `docs-map.md` grounded in project versions. |
445
+ | `search_docs` | Low-Level | Hybrid FTS5 retrieval over indexed documentation chunks with version boosting. |
446
+ | `get_doc` | Low-Level | Retrieves a specific document chunk or complete page by ID with untrusted annotations. |
447
+ | `find_api` | Low-Level | Inspects OpenAPI endpoints with parameters, request/response schemas, and auth. |
448
+ | `find_example` | Low-Level | Discovers verified code examples filtered by framework, language, and task. |
449
+ | `find_pitfall` | Low-Level | Finds deprecations, breaking changes, rate limits, and server-only restrictions. |
450
+ | `find_recipe` | Low-Level | Compiles evidence-grounded blueprints with documented fact vs inferred steps. |
451
+ | `get_version` | Low-Level | Reconciles workspace dependencies using the hierarchical SemVer confidence ladder. |
452
+ | `list_sources` | Low-Level | Lists indexed documentation sources, snapshots, and machine-readability status. |
453
+
454
+ #### Agent Configuration Examples:
455
+
456
+ **For Claude Code / Claude Desktop (`claude_desktop_config.json`):**
457
+ ```json
458
+ {
459
+ "mcpServers": {
460
+ "docorbit": {
461
+ "command": "node",
462
+ "args": ["--experimental-strip-types", "/path/to/docorbit/bin/docorbit.js", "mcp", "--stdio"]
463
+ }
464
+ }
465
+ }
466
+ ```
467
+
468
+ **For Cursor (`.cursor/mcp.json`):**
469
+ ```json
470
+ {
471
+ "mcpServers": {
472
+ "docorbit": {
473
+ "command": "node",
474
+ "args": ["--experimental-strip-types", "/path/to/docorbit/bin/docorbit.js", "mcp", "--stdio"]
475
+ }
476
+ }
477
+ }
478
+ ```
479
+
480
+ ---
481
+
482
+ ## Performance Benchmarks
483
+
484
+ DocOrbit is designed to run in CI/CD pipelines and local developer machines with negligible overhead.
485
+
486
+ ### Milestone 1 Ingestion & Normalization
487
+ | Documentation Size | Normalization Latency | SQLite Storage Latency | Total Processing Time |
488
+ | :--- | :--- | :--- | :--- |
489
+ | **50 KB Page** | ~7.2 ms | ~0.5 ms | **~7.7 ms** |
490
+ | **500 KB Page** | ~13.8 ms | ~1.8 ms | **~15.6 ms** |
491
+ | **5 MB Spec / Page** | ~125.5 ms | ~17.4 ms | **~142.9 ms** |
492
+
493
+ - **Batch Ingestion Rate**: ~72 ms for 50 pages (**~1.4 ms per page**).
494
+ - **Memory Footprint**: Heap allocation delta strictly bounded (< 65 MB peak for 5MB payloads).
495
+
496
+ ### Milestone 2 Retrieval & Scaling Benchmarks
497
+ Tested with 8 evaluation categories (conceptual, API, examples, configuration, troubleshooting, migration, and negative queries):
498
+
499
+ | Evaluation Metric | Measured Value | Standard Target |
500
+ | :--- | :--- | :--- |
501
+ | **Precision@3** | **0.833** | >= 0.75 |
502
+ | **Recall@3** | **0.875** | >= 0.75 |
503
+ | **Mean Reciprocal Rank (MRR)** | **1.000** | >= 0.75 (Rank 1 ground truth on all queries) |
504
+ | **Token Efficiency** | **21.6%** | High-signal core snippets packed under budget |
505
+
506
+ Scaling Performance across SQLite FTS5 Index:
507
+ - **1,000 Chunks**: Ingestion 244 ms (0.24 ms/chunk), Search query latency **1.21 ms**, Context packing latency **4.36 ms**.
508
+ - **10,000 Chunks**: Search query latency **4.58 ms**, Context packing latency **7.04 ms**, Total Heap **15.8 MB**.
509
+
510
+ ### Milestone 3 Version Disambiguation Benchmark
511
+ Tested across multi-version conflict environments (Next.js 14 project vs Next.js 14, 15, and 16 documentation chunks):
512
+
513
+ | Metric / Scenario | Result | Evaluation |
514
+ | :--- | :--- | :--- |
515
+ | **Next.js 14 Project Query** | Rank 1: `v14` (Score: 17.43) | **100% Accuracy** (v14 accurately preferred over v15/v16) |
516
+ | **Incompatible Major Penalty** | `v15` (Score: -1.90), `v16` (Score: -3.23) | Clear score separation penalizes breaking major versions |
517
+ | **Supplemental Context** | `latest` (Score: 7.43) | Neutral retention of unversioned deployment documentation |
518
+ | **docs.lock Determinism** | Bit-for-bit identical on repeated runs | **Zero git churn**; timestamps preserved for unchanged snapshots |
519
+
520
+ ### Milestone 4 Implementation Knowledge Benchmark
521
+ Evaluated across 20 tasks spanning 11 categories (API lookup, parameter constraints, schema precision, auth recognition, pagination heuristics, framework matching, deprecations, runtime restrictions, rate limits, recipe evidence grounding, and multi-version conflicts):
522
+
523
+ | Benchmark Category | Tasks | Status | Key Verification Point |
524
+ | :--- | :--- | :--- | :--- |
525
+ | **1. API Lookup** | 2 | 100% PASS | Exact method/path and natural language fuzzy matching |
526
+ | **2. Parameter Extraction** | 2 | 100% PASS | Path parameters and required query parameters extracted |
527
+ | **3. Schema Precision** | 1 | 100% PASS | Request and response properties parsed with internal `$ref` |
528
+ | **4. Auth Recognition** | 1 | 100% PASS | Header/bearer/basic authentication identification |
529
+ | **5. Pagination Discovery** | 1 | 100% PASS | Heuristic detection of cursor and offset/limit pagination |
530
+ | **6. Example Matching** | 2 | 100% PASS | Framework-specific Express and FastAPI code matching |
531
+ | **7. Deprecation Detection** | 3 | 100% PASS | API endpoint deprecations, v15 deprecated, v16 removed |
532
+ | **8. Runtime Restrictions** | 1 | 100% PASS | Strict extraction of `server_only` secret isolation |
533
+ | **9. Rate Limits & Security** | 1 | 100% PASS | Extraction of HTTP 429 warnings and security caveats |
534
+ | **10. Recipe Grounding** | 4 | 100% PASS | Prerequisites, steps, validation schemas strictly grounded; missing information flagged without assumptions |
535
+ | **11. Version Conflict** | 2 | 100% PASS | Dynamic route params correctly resolved for v14 sync vs v15 async |
536
+
537
+ - **Overall Accuracy**: **20/20 (100.0%)**
538
+ - **Strict Evidence Grounding**: **100%** (Undocumented tasks yield explicit `missing_information` and confidence 0.0)
539
+
540
+ ---
541
+
542
+ ## Test Suite & Verification
543
+
544
+ The test suite runs 100% hermetically without network access using a custom in-memory WHATWG fetch server mocking real-world edge cases.
545
+
546
+ To run the complete test suite:
547
+
548
+ ```bash
549
+ npm test
550
+ ```
551
+
552
+ ### Covered Test Matrix (105 Tests Passing)
553
+ - **Unit & Hardening Tests (79 Tests)**:
554
+ - `verification.test.ts`: Deterministic AST/token extraction (JS/TS, Python, cURL), valid endpoint verification, invalid path detection, wrong HTTP method detection, missing required body field/query parameters, deprecated API warning with provenance, Next.js version conflict detection, and dynamic/unsupported expression handling (`insufficient_evidence`).
555
+ - `diff.test.ts`: Endpoint additions, removals, modifications, parameter diffs, pitfall diffs across versions, and whitespace-invariant semantic chunk diffing.
556
+ - `impact.test.ts`: Workspace impact scanning, affected file pinpointers, exact line numbers, code snippets, matched patterns, and certainty rankings (`high`, `medium`, `heuristic`).
557
+ - `mcp.test.ts`: MCP tool factory (12 native tools), schema compliance, JSON-RPC protocol error handling, resource manager bounded reads, and individual tool execution.
558
+ - `openapi.test.ts`: OpenAPI 3.0/3.1 and Swagger 2.0 parsing, circular `$ref` recursion defense, auth schemes, and pagination heuristics.
559
+ - `examples.test.ts`: Framework identification (`next`, `express`, `fastapi`, etc.), symbol detection, and language filtering.
560
+ - `pitfalls.test.ts`: Extraction of admonitions, deprecation tags, server-only restrictions, and rate limit warnings.
561
+ - `recipes.test.ts`: Evidence-grounded recipe compilation, prerequisite extraction, evidence-based validation assertions, and missing information handling.
562
+ - `semver.test.ts`: SemVer parsing, comparisons, range satisfaction, and hierarchical confidence ladder.
563
+ - `workspace.test.ts`: Manifest scanning across 8 ecosystems, lockfile extraction, monorepos, and deterministic `docs.lock`.
564
+ - `slicer.test.ts`: Heading hierarchy breadcrumbs, atomic code blocks, and shallow symbol extraction.
565
+ - `retrieval.test.ts`: Intent detection, transactional FTS5 synchronization with triggers, scoring weights, and context packing.
566
+ - `hardening.test.ts`: IPv6 bracketed SSRF prevention, redirect loops, snapshot idempotency, `CrawlPolicy` depth bounds, and prompt injection annotations.
567
+ - `security.test.ts`: SSRF defense, loopback & private IP blocking, non-destructive prompt injection tagging.
568
+ - `discovery.test.ts`: LLMs.txt, OpenAPI, Sitemap, Markdown, GitHub, and Skill providers.
569
+ - `ranker.test.ts`: Purpose-based ranking logic (`navigation`, `api`, `examples`, `implementation`).
570
+ - `normalizer.test.ts`: HTML to Markdown conversion, code block extraction, OpenAPI schema detection, content hashing stability.
571
+ - `storage.test.ts`: SQLite schema initialization, cascading foreign keys, WAL mode, FTS5 full-text indexing, and snapshot page membership.
572
+ - **Integration & Benchmark Tests (26 Tests)**:
573
+ - `verification-e2e.test.ts`: End-to-end coding agent workflow over MCP: `get_implementation_context` with verification hints → `check_api` catching removed API, invalid HTTP method, missing required body field → ambiguous dynamic call returning `insufficient_evidence` → valid corrected code returning `verified` → `diff_docs` detecting breaking API/pitfall changes → `analyze_impact` locating affected project files with high certainty.
574
+ - `mcp-e2e.test.ts`: Full realistic coding agent lifecycle over MCP (tools/list → `get_implementation_context` → targeted follow-ups `find_pitfall`, `get_doc`, `find_example` → resource inspection).
575
+ - `mcp-transports.test.ts`: Stdio transport batching/single request/isolated stderr logs and Streamable HTTP transport (POST `/mcp` JSON & SSE stream, GET `/sse`, GET `/health`).
576
+ - `knowledge-benchmark.test.ts`: 20-task structured knowledge benchmark across 11 categories (100% pass).
577
+ - `version-benchmark.test.ts`: Next.js 14 vs 15 vs 16 version conflict resolution, score separation, and context packaging under project awareness.
578
+ - `retrieval-benchmark.test.ts`: 8-category evaluation benchmark (P@K, R@K, MRR) + 1k and 10k chunk latency and memory scaling tests.
579
+ - `fixtures.test.ts`: Fixtures A through J end-to-end crawl, normalization, chunking, and FTS retrieval verification.
580
+ - `cli.test.ts`: `--help`, `--version`, `--json`, `init`, `update`, `inspect`, `add`, `search`, `context`, `api`, `examples`, `pitfalls`, and `recipes` command validation.
581
+ - `benchmark.test.ts`: 50KB, 500KB, 5MB latency and memory profiling.
582
+
583
+ ---
584
+
585
+ ## 7-Milestone Roadmap
586
+
587
+ - [x] **Milestone 1: Ingestion, Normalization, Security, & Local SQLite** *(Completed)*
588
+ - Source discovery (`llms.txt`, OpenAPI, Sitemap, GitHub, Markdown, Skill)
589
+ - Purpose-aware source ranker
590
+ - SSRF protection & security annotations
591
+ - HTML & spec normalizer to structured AST
592
+ - Node.js 24 SQLite storage with WAL & FTS5
593
+ - CLI `inspect` and `add`
594
+ - [x] **Milestone 2: Semantic Slicing & Retrieval Foundation** *(Completed)*
595
+ - Markdown AST section-based chunking with heading hierarchy breadcrumbs
596
+ - Indivisible code fences and warning/admonition preservation
597
+ - Shallow deterministic symbol extraction (functions, classes, endpoints, config)
598
+ - Sequential, hierarchical, and semantic chunk relationship graph
599
+ - Transactionally synchronized FTS5 indexing with triggers
600
+ - Configurable/versioned scoring weights and deterministic query intent detection
601
+ - Relevance + Coverage - Redundancy token budget context packing
602
+ - CLI `search` and `context`
603
+ - Evaluation benchmark dataset (Precision@K, Recall@K, MRR, 1k/10k scaling)
604
+ - [x] **Milestone 3: Version Intelligence & Project Awareness** *(Completed)*
605
+ - Workspace scanner for 8 ecosystems (`npm`, `cargo`, `go`, `pypi`, `composer`, `rubygems`, `pub`, `maven`)
606
+ - SemVer confidence ladder (`exact` → `major_minor` → `major` → `range` → `latest_fallback` → `unresolved`)
607
+ - Reproducible `docs.lock` manifest with timestamp preservation (zero git churn)
608
+ - Project-aware `RetrievalEngine` with version bonus and major-discrepancy penalties
609
+ - CLI `init`, `update`, `--project`, and `--doc-version`
610
+ - Multi-version conflict benchmark (Next.js 14 vs 15 vs 16)
611
+ - [x] **Milestone 4: Structured Implementation Knowledge** *(Completed)*
612
+ - OpenAPI 3.x and Swagger 2.0 parser with JSON pointer `$ref` resolution, schemas, parameters, auth, pagination heuristics, and deprecation flags
613
+ - First-class code example indexer with framework detection and router call parsing
614
+ - Explicit pitfall and deprecation extractor (breaking changes, server-only restrictions, rate limits, security warnings)
615
+ - Evidence-grounded Implementation Recipe engine with explicit evidence levels (`documented_fact`, `inferred_relationship`, `missing_information`)
616
+ - CLI `api`, `examples`, `pitfalls`, and `recipes`
617
+ - 20-task knowledge benchmark across 11 categories (100% pass)
618
+ - [x] **Milestone 5: Agent-Native MCP Integration** *(Completed)*
619
+ - JSON-RPC 2.0 Stdio and Streamable HTTP (POST `/mcp`, GET `/sse`, GET `/health`) server conforming to MCP 2024-11-05
620
+ - High-level centerpiece tool `get_implementation_context` orchestrating 9-stage pipeline
621
+ - Dual response format: Structured JSON (`data`) + Concise agent Markdown (`markdown`)
622
+ - Explicit `untrusted: true` security boundary tagging on all retrieved documentation
623
+ - Dynamic MCP Resources with bounded streaming reads (`docorbit://sources`, `docorbit://pages/{id}`, `docorbit://chunks/{id}`)
624
+ - CLI `docorbit mcp [--stdio] [--port 3000] [--host 127.0.0.1]`
625
+ - [x] **Milestone 6: Verification & Documentation Diffing** *(Completed)*
626
+ - Deterministic AST and pattern code extractor (`CodeApiExtractor`) for JS/TS, Python, and cURL
627
+ - Deterministic schema and version verifier (`SchemaVerifier`) evaluating 8 rules without LLMs
628
+ - Strict verification statuses (`verified`, `warning`, `mismatch`, `insufficient_evidence`)
629
+ - Documentation diffing engine (`DocDiffEngine`) detecting endpoint and pitfall changes across versions/snapshots
630
+ - Workspace impact analyzer (`WorkspaceImpactScanner`) reporting affected files, lines, snippets, and certainty
631
+ - Expanded MCP server with 12 native tools (`check_api`, `diff_docs`, `analyze_impact`)
632
+ - Proactive `verificationHints` delivered in `get_implementation_context`
633
+ - CLI commands: `docorbit verify <code>`, `docorbit diff`, `docorbit impact`
634
+ - [x] **Milestone 7: Web Dashboard & Agent File Exports** *(Completed)*
635
+ - Local read-only dashboard via native `node:http` — no framework dependency
636
+ - Single-page HTML dashboard for sources, snapshots, APIs, pitfalls, verification results, diffs, and impact
637
+ - REST API layer at `/api/*` backed entirely by existing application services
638
+ - Deterministic agent file exports: `AGENTS.md`, `CLAUDE.md`, `skill.md`, `llms.txt`, `docs-map.md`
639
+ - Exports are reproducible: derived from indexed evidence, no runtime timestamps
640
+ - MCP tools: `get_documentation_map` and `export_agent_context` (14 tools total)
641
+ - CLI `docorbit dashboard` / `docorbit ui`, `docorbit export`
642
+ - [x] **Milestone 8: Real-World Agent Evaluation & Production Hardening** *(Completed)*
643
+ - Empirical benchmark comparing DocOrbit vs Context7 vs Web Docs Fetch across 10 tasks (4 train, 6 held-out) in 5 ecosystems
644
+ - **Real Context7 MCP integration**: spawns `context7-mcp` stdio child process querying live `context7.com` backend
645
+ - **Real Web Docs Fetch baseline**: direct HTTPS fetches to canonical official documentation URLs
646
+ - **Real DocOrbit MCP integration**: in-process `McpServer` executing the full `get_implementation_context` pipeline
647
+ - **Deterministic offline simulation mode** (`--simulation`): runs offline CI regression without network dependencies
648
+ - Metrics: task success rate, version accuracy, retrieval precision/recall, token usage, latency, AST catches, false positives
649
+ - 9 production hardening tests: large monorepo scan, 10k chunk sub-50ms search, 20 concurrent MCP calls, stale snapshots, missing version graceful fallback, malformed OpenAPI, dynamic code `insufficient_evidence`, adversarial prompt injection, SQLite rollback consistency
650
+ - CLI `docorbit eval` with `--split`, `--strategy`, `--task`, `--output`, `--json`, `--verbose`, `--simulation`
651
+ - Raw benchmark artifacts saved to `eval-results/raw/` with `isSimulation` flag — every run independently auditable
652
+ - No hardcoded winners; real results measured and auditable from saved JSON payloads
653
+
654
+
655
+
656
+ ---
657
+
658
+ ## License
659
+
660
+ MIT License. See [LICENSE](LICENSE) for details.
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env -S node --experimental-strip-types
2
+
3
+ import { main } from '../src/index.ts';
4
+
5
+ main().catch(err => {
6
+ console.error('Fatal DocOrbit Error:', err);
7
+ process.exit(1);
8
+ });