2026-07-22 01:29:32 -04:00
|
|
|
# DocForge
|
|
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
DocForge is a project-scoped documentation graph for people and AI agents. It validates canonical
|
|
|
|
|
documentation, builds a disposable search and relationship index, compiles bounded context, renders
|
|
|
|
|
declared manuals, visualizes project structure, and manages reviewable documentation changesets.
|
2026-07-22 01:29:32 -04:00
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
## What it does
|
2026-07-22 01:29:32 -04:00
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
- Validates stable Markdown/TOML nodes and typed relationships.
|
|
|
|
|
- Builds a deterministic SQLite search and graph index.
|
|
|
|
|
- Exposes project-bound CLI and MCP query surfaces.
|
2026-07-26 09:32:25 -04:00
|
|
|
- Automatically synchronizes disposable indexes before MCP work.
|
2026-07-25 16:00:19 -04:00
|
|
|
- Creates, validates, diffs, and previews isolated changesets.
|
2026-07-26 09:32:25 -04:00
|
|
|
- Registers complete proposals atomically without caller-managed hash chaining.
|
2026-07-25 16:00:19 -04:00
|
|
|
- Applies one explicitly approved changeset hash through CLI or gated MCP.
|
2026-07-25 19:08:39 -04:00
|
|
|
- Supports opt-in incremental adapters with reverse-dependency invalidation and full-build
|
|
|
|
|
equivalence checks.
|
2026-07-28 19:44:25 -04:00
|
|
|
- Detects project-local adapter implementation and configuration changes and requires a fresh
|
|
|
|
|
project-bound process before any further MCP work.
|
2026-07-25 19:08:39 -04:00
|
|
|
- Keeps function-scoped control-flow projections separate from the primary architecture graph.
|
2026-07-25 17:34:58 -04:00
|
|
|
- Runs a managed loopback graph browser with neighborhood, semantic Flow, convergence Web,
|
2026-07-25 21:08:43 -04:00
|
|
|
function-scoped Logic, source inspection, and branch-aware node hiding.
|
2026-07-25 16:00:19 -04:00
|
|
|
- Supports generic documentation projects and project-owned source adapters.
|
2026-07-22 01:29:32 -04:00
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
DocForge never treats indexed text as instructions. It does not run shell commands, mutate Git,
|
|
|
|
|
build applications, deploy, publish, or select projects globally.
|
2026-07-22 01:29:32 -04:00
|
|
|
|
2026-07-28 18:23:11 -04:00
|
|
|
For implementation projects, the recommended cadence is to read canonical documentation during
|
|
|
|
|
intake, keep it read-only through implementation and focused testing, freeze and validate a release
|
|
|
|
|
candidate, then perform one atomic documentation closeout before the final commit and tag. This
|
|
|
|
|
keeps the manual authoritative without using it as an implementation notebook.
|
|
|
|
|
|
2026-07-25 18:33:42 -04:00
|
|
|
## Release 1
|
|
|
|
|
|
|
|
|
|
DocForge 1.0.0 is the first stable product release. It combines the project-scoped graph, CLI and
|
|
|
|
|
MCP query surfaces, reviewable hash-approved changesets, generic and project-owned adapters,
|
|
|
|
|
declared rendering, and the complete Nodes/Flow/Web visualization model in one supported release.
|
|
|
|
|
|
2026-07-25 19:21:23 -04:00
|
|
|
The post-1.0 incremental compiler is a backward-compatible, optional enhancement. Existing Release
|
|
|
|
|
1 adapters that implement only `load_projection()` continue to use the original complete-projection
|
|
|
|
|
path without modification. Adapters gain incremental performance only when they additionally
|
|
|
|
|
implement the source manifest and extraction methods. Incremental adapters must retain
|
|
|
|
|
`load_projection()` as their clean-rebuild fallback and equivalence oracle.
|
|
|
|
|
|
2026-07-29 02:59:15 -04:00
|
|
|
MCP bindings can additionally select `--no-ast` when an owner wants to preserve an existing
|
|
|
|
|
non-AST adapter. The binding advertises that policy to clients, forbids adapter rewrites that add
|
|
|
|
|
AST, Tree-sitter, compiler-AST, or function-Logic extraction, blocks the Logic tool, and rejects
|
|
|
|
|
nonempty Logic publication. Complete-projection adapters continue unchanged, and non-AST
|
|
|
|
|
incremental fingerprinting and caching remain allowed.
|
|
|
|
|
|
2026-07-29 06:26:40 -04:00
|
|
|
DocForge2 bindings may also declare
|
|
|
|
|
`--capability-mode read|proposal|application|operator`. Bootstrap returns one versioned effective
|
|
|
|
|
policy and the actual startup-gated capabilities. Existing tool surfaces and the legacy no-AST
|
|
|
|
|
payload remain compatible.
|
|
|
|
|
|
2026-07-25 17:43:41 -04:00
|
|
|
## Graph views
|
|
|
|
|
|
2026-07-25 21:08:43 -04:00
|
|
|
The browser presents the primary architecture graph through three complementary views and loads a
|
|
|
|
|
fourth function-scoped view only when requested:
|
2026-07-25 17:43:41 -04:00
|
|
|
|
|
|
|
|
- **Nodes** shows a bounded, relation-neutral neighborhood around the focus. It is the broad
|
|
|
|
|
inspection view for seeing stored incoming and outgoing relationships without changing their
|
2026-07-25 18:12:26 -04:00
|
|
|
direction. Semantic cards distinguish structure, behavior, dependencies, execution, data,
|
|
|
|
|
evidence, context, and other relationships.
|
2026-07-25 17:43:41 -04:00
|
|
|
- **Flow** shows semantic origin-to-destination paths that terminate at the focus. DocForge
|
|
|
|
|
reverses prerequisite-style relationships for presentation, so imports, dependencies, reads,
|
|
|
|
|
inheritance, definitions, and tests flow toward the thing they help create or exercise.
|
|
|
|
|
- **Web** shows the larger convergence picture: Flow contributors plus contextual relationships,
|
|
|
|
|
callers, containers, and direct members or execution dependencies owned by the focus.
|
2026-07-25 22:29:15 -04:00
|
|
|
- **Logic** shows the possible static control paths inside a focused Python, JavaScript, or C++
|
|
|
|
|
function or method. Entry, decisions, actions, loops, convergence points, returns, and
|
|
|
|
|
exceptions connect through explicit
|
2026-07-25 21:08:43 -04:00
|
|
|
`TRUE`, `FALSE`, `NEXT`, `CASE`, `LOOP`, `RETURN`, and `RAISE` paths. Logic is stored separately
|
|
|
|
|
and does not add statement-level noise to Nodes, Flow, Web, or search.
|
2026-07-25 17:43:41 -04:00
|
|
|
|
2026-07-25 18:12:26 -04:00
|
|
|
Graph cards show the node's readable leaf name and kind without clipping either value. The full
|
|
|
|
|
qualified identity remains available in the tooltip, compact descriptor, and full inspector.
|
2026-07-25 22:29:15 -04:00
|
|
|
The left browser panel can combine text, family, node-kind, language, and capability filters.
|
|
|
|
|
Quick presets expose Logic-ready nodes, Python callables, tests, routes, and documentation without
|
|
|
|
|
requiring users to know stable IDs. Selecting a canvas node emphasizes its directly connected
|
|
|
|
|
neighbors and edges while muting unrelated paths.
|
2026-07-25 18:12:26 -04:00
|
|
|
|
2026-07-25 17:43:41 -04:00
|
|
|
**Hide node** removes noise without changing the index. In Flow and Web, hiding a contributor also
|
|
|
|
|
removes upstream ancestors that no longer have a path to the focus. Nodes between the hidden
|
2026-07-25 21:08:43 -04:00
|
|
|
contributor and the focus stay visible, and alternate ancestor paths remain intact. In Logic,
|
|
|
|
|
hiding a step inserts an explicit omitted-path bridge so downstream control flow remains readable.
|
|
|
|
|
**Restore hidden** restores the presentation.
|
2026-07-25 17:43:41 -04:00
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
## Five-minute start
|
2026-07-24 16:01:03 -04:00
|
|
|
|
2026-07-25 16:23:23 -04:00
|
|
|
Requirements are Python 3.12+, `uv`, and Node.js/npm.
|
2026-07-24 22:26:01 -04:00
|
|
|
|
2026-07-22 01:29:32 -04:00
|
|
|
```bash
|
2026-07-29 03:12:30 -04:00
|
|
|
git clone forgejo@repo.andraxion.net:administrator/DocForge2.git /absolute/path/DocForge2
|
|
|
|
|
cd /absolute/path/DocForge2
|
2026-07-25 16:23:23 -04:00
|
|
|
uv sync --group dev
|
2026-07-24 22:36:44 -04:00
|
|
|
npm ci
|
2026-07-25 01:16:05 -04:00
|
|
|
|
|
|
|
|
PROJECT=/absolute/path/MyProject
|
2026-07-25 16:00:19 -04:00
|
|
|
.venv/bin/docforge --project-root "$PROJECT" validate
|
|
|
|
|
.venv/bin/docforge --project-root "$PROJECT" reindex
|
|
|
|
|
.venv/bin/docforge --project-root "$PROJECT" visualize
|
2026-07-25 01:16:05 -04:00
|
|
|
```
|
|
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
Install the persistent per-user graph viewer once:
|
2026-07-25 01:16:05 -04:00
|
|
|
|
|
|
|
|
```bash
|
2026-07-25 16:00:19 -04:00
|
|
|
.venv/bin/docforge-viewer-manager install-user-service
|
2026-07-25 01:16:05 -04:00
|
|
|
```
|
|
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
Start an MCP server for one project:
|
2026-07-25 01:16:05 -04:00
|
|
|
|
|
|
|
|
```bash
|
2026-07-25 16:00:19 -04:00
|
|
|
.venv/bin/docforge-mcp \
|
|
|
|
|
--project-root "$PROJECT" \
|
|
|
|
|
--proposal-writer project-editor
|
2026-07-25 01:16:05 -04:00
|
|
|
```
|
|
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
Add `--canonical-applier project-editor` only when that MCP integration should expose the
|
|
|
|
|
hash-bound `docforge_apply_changeset` tool.
|
2026-07-25 01:16:05 -04:00
|
|
|
|
2026-07-27 15:50:33 -04:00
|
|
|
For an unconfigured codebase, begin with a read-only language and documentation assessment:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
.venv/bin/docforge --project-root /absolute/path/MyProject onboard
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Add `--scaffold`, a stable project ID, and a title to create, index, and render a generic starter
|
|
|
|
|
manual. Source files are reported separately and require a validated language frontend before
|
|
|
|
|
DocForge describes them as a source graph.
|
|
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
## Documentation
|
2026-07-25 01:16:05 -04:00
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
- [User manual](docs/USER_MANUAL.md) — features, setup, visualization, CLI, MCP, apply, adapters,
|
|
|
|
|
and troubleshooting.
|
|
|
|
|
- [Core contract](docs/CONTRACT.md) — invariants and security boundary.
|
2026-07-29 03:12:30 -04:00
|
|
|
- [Milestone 0 compatibility](docs/COMPATIBILITY.md) — preserved package, CLI, MCP, adapter,
|
|
|
|
|
schema, changeset, rendering, and no-AST guarantees.
|
2026-07-29 03:20:09 -04:00
|
|
|
- [Milestone 0 baseline](docs/MILESTONE_0_BASELINE.md) — validation evidence, cold and warm
|
|
|
|
|
performance, memory, rendering and response sizes, bottlenecks, and missing coverage.
|
2026-07-29 03:29:22 -04:00
|
|
|
- [Milestone 0 closeout](docs/MILESTONE_0_CLOSEOUT.md) — lineage, migration, security scan,
|
|
|
|
|
repository state, and fresh-clone proof.
|
2026-07-25 16:00:19 -04:00
|
|
|
- [MCP contract](docs/MCP_CONTRACT.md) — exact tool and process boundary.
|
|
|
|
|
- [Viewer manager](docs/VIEWER_MANAGER.md) — native service setup and lifecycle.
|
|
|
|
|
- [Adapter decision](docs/APPLICATION_DECISION.md) — why custom adapters own canonical
|
|
|
|
|
serialization.
|
2026-07-25 19:08:39 -04:00
|
|
|
- [Incremental adapter indexing](docs/INCREMENTAL_INDEXING.md) — source-scoped extraction,
|
|
|
|
|
invalidation, equivalence, relationship changes, and the lazy Logic boundary.
|
2026-07-27 15:50:33 -04:00
|
|
|
- [Project onboarding](docs/PROJECT_ONBOARDING.md) — repository assessment, safe manual
|
|
|
|
|
scaffolding, language frontends, source/manual integration, proof, and MCP activation.
|
2026-07-27 20:29:07 -04:00
|
|
|
- [Language adapter authoring](docs/ADAPTER_AUTHORING_GUIDE.md) — implementation sequence,
|
|
|
|
|
stable identities, overlap ownership, normalization, incremental equivalence, troubleshooting,
|
|
|
|
|
and the complete adapter proof matrix.
|
2026-07-25 01:16:05 -04:00
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
## Development
|
2026-07-25 01:16:05 -04:00
|
|
|
|
2026-07-29 03:12:30 -04:00
|
|
|
Run the complete repository-native gate:
|
|
|
|
|
|
2026-07-25 01:16:05 -04:00
|
|
|
```bash
|
2026-07-29 03:12:30 -04:00
|
|
|
make gate
|
2026-07-25 01:16:05 -04:00
|
|
|
```
|
|
|
|
|
|
2026-07-29 03:12:30 -04:00
|
|
|
Focused entry points are available as `make contract`, `make test`, `make type`,
|
2026-07-29 05:07:16 -04:00
|
|
|
`make benchmark-smoke`, `make benchmark`, `make benchmark-m1-smoke`, and
|
|
|
|
|
`make benchmark-m1`.
|
2026-07-29 03:12:30 -04:00
|
|
|
|
2026-07-29 03:20:09 -04:00
|
|
|
The committed 1,000-node baseline and its measurement method are under `benchmarks/`.
|
|
|
|
|
|
2026-07-29 05:07:16 -04:00
|
|
|
Pass `--diagnostics` to `docforge` or `docforge-mcp` to attach bounded request-local stage timings
|
|
|
|
|
and compiler-work counters. Diagnostics are disabled by default and are dropped before primary MCP
|
|
|
|
|
results when the configured output budget is tight.
|
|
|
|
|
|
2026-07-25 16:00:19 -04:00
|
|
|
See [AGENTS.md](AGENTS.md) before changing core boundaries.
|