Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
node_modules
target
.git
out
dist
*.lock

doc/templates/**
8 changes: 8 additions & 0 deletions doc/actors/systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ An automated Continuous Integration system that runs Docgraph checks.
- Run automated tests.
- Verify relationship rules.

### Participates in

- [UC_CLI_ANALYSIS (CLI Traceability Analysis)](../usecases/cli-analysis.md#UC_CLI_ANALYSIS)

<a id="ACT_AGENT"></a>

## AI Agent
Expand All @@ -21,3 +25,7 @@ An AI agent that consumes the document graph to build knowledge and assist users

- Assist in documentation writing.
- Verify rule compliance.

### Participates in

- [UC_AI_ASSISTANCE (AI-Assisted Documentation)](../usecases/ai-assistance.md#UC_AI_ASSISTANCE)
16 changes: 16 additions & 0 deletions doc/actors/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ A human user who interacts with the Docgraph CLI or VS Code extension.
- Read documentation.
- Browse the graph.

### Participates in

- [UC_CLI_ANALYSIS (CLI Traceability Analysis)](../usecases/cli-analysis.md#UC_CLI_ANALYSIS)

<a id="ACT_DEV"></a>

## Developer
Expand All @@ -21,3 +25,15 @@ A software developer who writes code and specifications, and runs Docgraph local

- Write specifications.
- Maintain relationships.

### Participates in

- [UC_WRITE (Write Specifications)](../usecases/writing-specification.md#UC_WRITE)
- [UC_CLI_ANALYSIS (CLI Traceability Analysis)](../usecases/cli-analysis.md#UC_CLI_ANALYSIS)
- [UC_INSTALL_MANUAL (Install Manual Setup)](../usecases/setup.md#UC_INSTALL_MANUAL)
- [UC_INSTALL_BINARY (Install via Binary Script)](../usecases/setup.md#UC_INSTALL_BINARY)
- [UC_CLAUDE_INSTALL (Install Claude Plugin)](../usecases/setup.md#UC_CLAUDE_INSTALL)
- [UC_VSCODE_INSTALL (Install VS Code Extension)](../usecases/setup.md#UC_VSCODE_INSTALL)
- [UC_ZED_INSTALL (Install Zed Extension)](../usecases/setup.md#UC_ZED_INSTALL)
- [UC_PREK_SETUP (Set Up Development Hooks)](../usecases/setup.md#UC_PREK_SETUP)
- [UC_EDITOR_LSP (Editor Support via LSP)](../usecases/lsp-editing.md#UC_EDITOR_LSP)
4 changes: 0 additions & 4 deletions doc/architecture/design/cicd.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ validated, tested, and released.
- [ADR_CI_ENV_PARITY (CI Environment Parity)](../../decisions/ci-env-parity.md#ADR_CI_ENV_PARITY) To minimize
environmental discrepancies.

### Realized by

- [MOD_CICD (CI/CD Pipelines)](../view/module.md#MOD_CICD)

Triggered when PR is merged to `main`.

- **Publish**: (Planned) Publish binary or crate to registry.
Expand Down
23 changes: 10 additions & 13 deletions doc/architecture/design/dependency-rule.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
# The Dependency Rule

<a id="CC_DEPENDENCY_RULE"></a>

## The Dependency Rule

Dependencies must point inwards, towards high-level policies.

**Direction:**

- **Outer Layers** (Infrastructure, adapters) depend on **Inner Layers** (Use Cases, Entities).
- **Inner Layers** MUST NOT depend on **Outer Layers**.
Source code dependencies must point only inward, toward higher-level policies.

**Core Layer Independence:**
**Rules:**

The `src/core/` module contains only domain types and business logic. It has NO references to CLI or LSP types.
1. Nothing in an inner circle (Core) can know anything at all about something in an outer circle (Handlers, UI).
2. The name of something declared in an outer circle must not be mentioned by the code in the an inner circle.

**Handler Layer Dependency:**
### Decided by

CLI and LSP handlers import from Core, but Core never imports from handlers.
- [ADR_LAYERED_ARCH (Layered Architecture)](../../decisions/layered-architecture.md#ADR_LAYERED_ARCH)

### Decided by
### Reflected in (Optional)

- [ADR_LAYERED_ARCH (Layered Architecture)](../../decisions/layered-architecture.md#ADR_LAYERED_ARCH) To enforce
directional dependency.
- [NFR_EXT (Modular Design)](../../requirements/non-functional/extensibility.md#NFR_EXT)
12 changes: 0 additions & 12 deletions doc/architecture/design/development-norm.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ Defined in [.devcontainer/devcontainer.json](../../../.devcontainer/devcontainer
- [ADR_CI_ENV_PARITY (CI Environment Parity)](../../decisions/ci-env-parity.md#ADR_CI_ENV_PARITY) To ensure consistent
development experience.

### Realized by

- [MOD_DEV_CONTAINER (Dev Container)](../view/module.md#MOD_DEV_CONTAINER)

---

<a id="CC_CONVENTIONAL_COMMITS"></a>
Expand All @@ -56,10 +52,6 @@ generation and versioning.
- **test**: Adding missing tests or correcting existing tests
- **chore**: Changes to the build process or auxiliary tools and libraries

### Realized by

- [MOD_CICD (CI/CD Pipelines)](../view/module.md#MOD_CICD)

---

<a id="CC_SEMANTIC_VERSIONING"></a>
Expand All @@ -75,7 +67,3 @@ Given a version number **MAJOR.MINOR.PATCH**, increment the:
1. **MAJOR** version when you make incompatible API changes.
2. **MINOR** version when you add functionality in a backwards compatible manner.
3. **PATCH** version when you make backwards compatible bug fixes.

### Realized by

- [MOD_CICD (CI/CD Pipelines)](../view/module.md#MOD_CICD)
4 changes: 0 additions & 4 deletions doc/architecture/design/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,3 @@ Errors automatically convert across boundaries:

- [ADR_ERROR_HANDLING (Error Handling Strategy: thiserror for Core, anyhow for Binaries)](../../decisions/error-handling.md#ADR_ERROR_HANDLING)
To unify error reporting.

### Realized by

- [MOD_CORE_ERRORS (Error Definitions)](../view/module.md#MOD_CORE_ERRORS)
16 changes: 0 additions & 16 deletions doc/architecture/design/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ We employ a pyramid testing strategy to ensure reliability and velocity.
2. **Integration Tests (Middle)**: Verify component interactions.
3. **E2E Tests (Top)**: Verify full system behavior via LSP.

### Realized by

- [MOD_TEST_INFRA (Test Infrastructure)](../view/module.md#MOD_TEST_INFRA)

---

<a id="CC_UNIT_TESTING"></a>
Expand All @@ -30,11 +26,6 @@ Unit tests should cover all public functions and complex private logic.
- **Speed**: Tests must run per commit.
- **Coverage**: Aim for high branch coverage in core logic.

### Realized by

- [MOD_CORE_RULES (Validation Rules)](../view/module.md#MOD_CORE_RULES)
- [MOD_CORE_GRAPH (Graph Logic)](../view/module.md#MOD_CORE_GRAPH)

---

<a id="CC_E2E_TESTING"></a>
Expand All @@ -53,11 +44,6 @@ E2E tests verify the system from the user's perspective (LSP client).

- Rust standard test framework with a mock LSP client.

### Realized by

- [MOD_LSP_SERVER (LSP Server)](../view/module.md#MOD_LSP_SERVER)
- [MOD_TEST_INFRA (Test Infrastructure)](../view/module.md#MOD_TEST_INFRA)

---

<a id="CC_COVERAGE"></a>
Expand All @@ -66,8 +52,6 @@ E2E tests verify the system from the user's perspective (LSP client).

We use `cargo-llvm-cov` to measure test effectiveness.

**Realized by**: [MOD_LSP (LSP Library)](../../architecture/view/module.md#MOD_LSP)

**Running Coverage Locally:**

1. Install: `cargo install cargo-llvm-cov`
Expand Down
4 changes: 0 additions & 4 deletions doc/architecture/design/thin-handlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ Request handlers should be "thin," delegating business logic to core modules.

- [ADR_THIN_HANDLERS (Thin Handlers)](../../decisions/thin-handlers.md#ADR_THIN_HANDLERS) To maintain separation of
concerns.

### Realized by

- [MOD_LSP_HANDLERS (LSP Handlers)](../view/module.md#MOD_LSP_HANDLERS)
100 changes: 99 additions & 1 deletion doc/architecture/view/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,52 +41,114 @@ The `core` module contains the fundamental logic for analyzing documentation gra
- **`parse`**: Responsible for extracting `{document}` blocks and HTML anchors from Markdown files.
- **`collect`**: Orchestrates the scanning of directories and aggregation of nodes.

### Realizes

- [FR_CORE_VALID_REF (Valid References)](../../requirements/functional/core.md#FR_CORE_VALID_REF)
- [FR_CORE_UNIQUE (Unique Node IDs)](../../requirements/functional/core.md#FR_CORE_UNIQUE)
- [FR_CORE_AUDIT (Audit Logging)](../../requirements/functional/core.md#FR_CORE_AUDIT)
- [FR_CORE_AUTH (Authentication)](../../requirements/functional/core.md#FR_CORE_AUTH)
- [FR_CORE_TEMPLATE_VALIDATION (Template Validation)](../../requirements/functional/core.md#FR_CORE_TEMPLATE_VALIDATION)
- [FR_CORE_CONFIGURATION (Configuration)](../../requirements/functional/core.md#FR_CORE_CONFIGURATION)
- [NFR_AVAILABILITY (System Availability)](../../requirements/non-functional/performance.md#NFR_AVAILABILITY)
- [IF_CONFIG (docgraph.toml Configuration)](../../requirements/interfaces/interfaces.md#IF_CONFIG)

<a id="MOD_CORE_RULES"></a>

### Validation Rules

- **`lint`**: Implements the validation engine and individual rules (DG001-DG006).

### Realizes

- [FR_CORE_TEMPLATE_VALIDATION (Template Validation)](../../requirements/functional/core.md#FR_CORE_TEMPLATE_VALIDATION)

<a id="MOD_CORE_GRAPH"></a>

### Graph Logic

- **`graph`**: Manages the construction and traversal of the dependency graph.

### Realizes

- [FR_CORE_VALID_REF (Valid References)](../../requirements/functional/core.md#FR_CORE_VALID_REF)
- [FR_CORE_UNIQUE (Unique Node IDs)](../../requirements/functional/core.md#FR_CORE_UNIQUE)

<a id="MOD_CORE_ERRORS"></a>

### Error Definitions

- **`error`**: Defines the unified error types and handling strategies.

### Realizes

- [CC_ERROR_HANDLING (Error Handling Strategy)](../design/error-handling.md#CC_ERROR_HANDLING)

<a id="MOD_CLI"></a>

### CLI Application

The `cli` module handles user interaction via the terminal.

- **`handlers`**: Contains the logic for each CLI command (`check`, `list`, `describe`, `graph`, `trace`, `rule`).
- **`handlers`**: Contains the logic for each CLI command (`check`, `describe`, `graph`, `rule`).
- **`output`**: Manages the formatting of results (Text, JSON).

### Realizes

- [FR_CLI_LINT (Lint Command)](../../requirements/functional/cli.md#FR_CLI_LINT)
- [FR_CLI_GRAPH (Graph Command)](../../requirements/functional/cli.md#FR_CLI_GRAPH)
- [FR_CLI_LIST (List Capability)](../../requirements/functional/cli.md#FR_CLI_LIST)
- [FR_CLI_TRACE (Trace Capability)](../../requirements/functional/cli.md#FR_CLI_TRACE)
- [FR_CLI_DESCRIBE (Describe Command)](../../requirements/functional/cli.md#FR_CLI_DESCRIBE)
- [FR_CLI_TYPE (Type Command)](../../requirements/functional/cli.md#FR_CLI_TYPE)
- [FR_CLI_VERSION (Version Command)](../../requirements/functional/cli.md#FR_CLI_VERSION)
- [FR_CLI_HELP (Help Command)](../../requirements/functional/cli.md#FR_CLI_HELP)
- [FR_CLI_QUERY (Query Command)](../../requirements/functional/cli.md#FR_CLI_QUERY)
- [FR_INSTALL_MANUAL (Manual Installation)](../../requirements/functional/installation.md#FR_INSTALL_MANUAL)
- [FR_INSTALL_BINARY (Binary Installation Support)](../../requirements/functional/installation.md#FR_INSTALL_BINARY)
- [FR_INSTALL_PREK (Pre-commit Hook Support)](../../requirements/functional/installation.md#FR_INSTALL_PREK)
- [IF_CLI (Command Line Interface)](../../requirements/interfaces/interfaces.md#IF_CLI)

<a id="MOD_LSP"></a>

### LSP Library

The `lsp` module provides the Language Server Protocol implementation.

### Realizes

- [FR_LSP_GOTO (Go to Definition)](../../requirements/functional/lsp.md#FR_LSP_GOTO)
- [FR_LSP_HOVER (Hover Information)](../../requirements/functional/lsp.md#FR_LSP_HOVER)
- [FR_LSP_COMP (Auto-completion)](../../requirements/functional/lsp.md#FR_LSP_COMP)
- [FR_LSP_REFS (Find References)](../../requirements/functional/lsp.md#FR_LSP_REFS)
- [FR_LSP_RENAME (Symbol Rename)](../../requirements/functional/lsp.md#FR_LSP_RENAME)
- [FR_LSP_HIERARCHY (Call Hierarchy)](../../requirements/functional/lsp.md#FR_LSP_HIERARCHY)
- [FR_LSP_DOC_SYMBOL (Document Symbol)](../../requirements/functional/lsp.md#FR_LSP_DOC_SYMBOL)
- [FR_LSP_WS_SYMBOL (Workspace Symbol)](../../requirements/functional/lsp.md#FR_LSP_WS_SYMBOL)
- [FR_LSP_SUPPORT (LSP Server)](../../requirements/functional/lsp.md#FR_LSP_SUPPORT)
- [NFR_LATENCY (System Latency)](../../requirements/non-functional/performance.md#NFR_LATENCY)
- [CC_COVERAGE (3. Code Coverage Standards)](../design/testing.md#CC_COVERAGE)

<a id="MOD_LSP_SERVER"></a>

### LSP Server

- **`server`**: Implements the main event loop and lifecycle management.

### Realizes

- [FR_LSP_SUPPORT (LSP Server)](../../requirements/functional/lsp.md#FR_LSP_SUPPORT)

<a id="MOD_LSP_HANDLERS"></a>

### LSP Handlers

- **`handlers`**: Implements LSP capabilities such as `textDocument/definition`, `textDocument/references`, and
`textDocument/hover`.

### Realizes

- [CC_THIN_HANDLERS (Thin Handlers Pattern)](../design/thin-handlers.md#CC_THIN_HANDLERS)

<a id="MOD_VSEX"></a>

### VS Code Extension
Expand All @@ -96,6 +158,15 @@ The `vsix` module is a TypeScript-based project that acts as the LSP client.
- **`src/extension.ts`**: Manages the lifecycle of the `docgraph` language server and registers editor-specific
commands.

### Realizes

- [FR_VSC_LSP_CLIENT (LSP Client Integration)](../../requirements/functional/vscode.md#FR_VSC_LSP_CLIENT)
- [FR_VSC_BINARY_PATH (Binary Path Configuration)](../../requirements/functional/vscode.md#FR_VSC_BINARY_PATH)
- [FR_VSC_MARKDOWN_ACTIVATION (Markdown Activation)](../../requirements/functional/vscode.md#FR_VSC_MARKDOWN_ACTIVATION)
- [FR_VSC_SERVER_LIFECYCLE (Server Lifecycle Commands)](../../requirements/functional/vscode.md#FR_VSC_SERVER_LIFECYCLE)
- [NFR_VSCODE_PORTABILITY (Cross-platform Portability)](../../requirements/non-functional/vscode.md#NFR_VSCODE_PORTABILITY)
- [NFR_VSCODE_PACKAGING (Lightweight Packaging)](../../requirements/non-functional/vscode.md#NFR_VSCODE_PACKAGING)

<a id="MOD_EXT_ZED"></a>

### Zed Editor Extension
Expand All @@ -105,6 +176,11 @@ The `zed-extension` is a WASM-based extension for the Zed editor.
- **`zed-extension/src/lib.rs`**: Implements the `zed::Extension` trait and the `language_server_command` to bridge Zed
and the `docgraph` binary.

### Realizes

- [FR_INSTALL_EXT_ZED (Zed Editor Extension)](../../requirements/functional/installation.md#FR_INSTALL_EXT_ZED)
- [IF_ZED_UI (Zed UI)](../../requirements/interfaces/interfaces.md#IF_ZED_UI)

<a id="MOD_CICD"></a>

### CI/CD Pipelines
Expand All @@ -115,6 +191,14 @@ The `.github` directory contains the CI/CD pipeline configuration.
- **`.github/workflows/codeql.yml`**: Static application security testing.
- **`.github/dependabot.yml`**: Automated dependency updates.

### Realizes

- [FR_DEV_CI (Automated Validation)](../../requirements/functional/development.md#FR_DEV_CI)
- [FR_DEV_STANDARDS (Development Standards)](../../requirements/functional/development.md#FR_DEV_STANDARDS)
- [CC_CICD (CI/CD Pipeline)](../design/cicd.md#CC_CICD)
- [CC_CONVENTIONAL_COMMITS (Commit Messages)](../design/development-norm.md#CC_CONVENTIONAL_COMMITS)
- [CC_SEMANTIC_VERSIONING (Versioning)](../design/development-norm.md#CC_SEMANTIC_VERSIONING)

<a id="MOD_PLUGIN"></a>

### Claude Code Plugin
Expand All @@ -124,6 +208,12 @@ The `docgraph-plugin` provides a Model Context Protocol (MCP) server for Claude
- **`skills/docgraph`**: Defines the tools and resources available to the AI agent.
- **`.claude-plugin`**: Contains the plugin manifest and capability definitions.

### Realizes

<!-- Implements the plugin interface -->

- [IF_CLAUDE_CODE (Interface: Claude Code Plugin)](../../requirements/interfaces/interfaces.md#IF_CLAUDE_CODE)

<a id="MOD_DEV_CONTAINER"></a>

### Dev Container
Expand All @@ -134,6 +224,10 @@ The `.devcontainer` directory contains the development environment configuration
- **`postCreateCommand`**: Installs additional tools (docgraph, Claude Code).
- **Extensions**: Pre-configured VS Code extensions for Rust, TOML, debugging, and AI assistance.

### Realizes

- [CC_DEV_ENV (Development Environment)](../design/development-norm.md#CC_DEV_ENV)

<a id="MOD_TEST_INFRA"></a>

### Test Infrastructure
Expand All @@ -142,3 +236,7 @@ The `tests` directory and test utilities.

- **`tests/`**: Integration and E2E tests.
- **`src/test_utils`**: Helper functions and mocks for testing.

### Realizes

- [CC_TESTING_STRATEGY (Testing Strategy)](../design/testing.md#CC_TESTING_STRATEGY)
Loading