Skip to content

Database Working Output Templates

elb-pr edited this page Apr 7, 2026 · 2 revisions

Database & Working Output Templates

The following files were used as context for generating this wiki page:

This section covers the persistent storage and active workspace templates used within the DI Claudian toolkit. These templates are categorized into Database templates (structured registries for entities, evidence, and logs) and Working templates (analytical workspaces and dissemination products). Central to this workflow is the Investigation Notebook, which serves as the primary, persistent analytical environment across all investigation phases.

1. The Investigation Notebook

The Investigation Notebook is the core persistent workspace for the analyst. Unlike transient task files, the notebook is a free-form Markdown environment designed to capture the "analytical position," unresolved questions, and key decisions skills/claude-sleuth/assets/database-usage.md:56-60.

Data Flow & Persistence

The notebook bypasses local file storage and is persisted directly to the CSDb (Claude Sleuth Database) via the MCP (Model Context Protocol) layer. This ensures that the analyst's mental model and evolving hypotheses are available across different sessions and environments.

Notebook Lifecycle:

Sources: skills/claude-sleuth/assets/database-usage.md:56-90

2. Database Templates (Registries)

Database templates define the structure for the "Ground Truth" of the investigation. These are not merely documents but schemas for the data stored in the Cloudflare D1-backed CSDb skills/claude-sleuth/assets/database-usage.md:1-3.

Template / Registry Purpose Key Fields / Schema
Entity Register Central repository for all POLE (Person, Object, Location, Event) data skills/claude-sleuth/references/guidance.md:21-22. name, type, aliases, identifiers (Passport, LEI, etc.), source_grade skills/claude-sleuth/assets/database-usage.md:11-22.
Evidence Register Digital chain of custody for all preserved artifacts skills/claude-sleuth/references/guidance.md:15-17. description, artefact_type, SHA-256 hash, storage_location skills/claude-sleuth/assets/database-usage.md:44-48.
Subject Profiles Detailed dossiers on specific entities of interest skills/claude-sleuth/references/guidance.md:21-21. Biographical data, known associates, behavioral patterns, and cross-references to evidence.
Task Log Audit trail of every investigative action and its outcome skills/claude-sleuth/references/guidance.md:14-15. task_id, action_taken, outcome (including negative results), timestamp skills/claude-sleuth/assets/database-usage.md:62-66.

Entity-Registry Logic (POLE)

The Entity Register enforces deterministic matching for unique identifiers. Every entity record must maintain strict provenance, including a mandatory Admiralty 6x6 source grade skills/claude-sleuth/references/guidance.md:21-22.

Sources: skills/claude-sleuth/assets/database-usage.md:11-67, skills/claude-sleuth/references/guidance.md:14-25

3. Working & Dissemination Templates

Working templates are used in Phase 6 (findis) to synthesize structured data into products for decision-makers. These templates adhere to ICD 203 (Intelligence Community Directive) standards skills/claude-sleuth/references/findis/report-disseminate.md:1-11.

The Briefing & Reporting Suite

  1. Analytical Briefing (briefing.md): Features a BLUF (Bottom Line Up Front) structure. It strictly separates facts, assumptions, and judgments skills/claude-sleuth/references/guidance.md:40-40.
  2. Case Summary (case-summary.md): A high-level administrative overview including case reference, scope, and current status skills/claude-sleuth/references/guidance.md:41-41.
  3. Findings Memo (findings-memo.md): A concise summary of confirmed findings and unverified leads for tactical teams skills/claude-sleuth/references/guidance.md:42-42.
  4. NIM Assessment (nim.md): Strategic and tactical assessments following the National Intelligence Model skills/claude-sleuth/references/findis/report-disseminate.md:21-21.

Integration Diagram: Natural Language to CSDb

This diagram illustrates how Natural Language inputs from templates are transformed into structured CSDb entities via the MCP tool layer.

Natural Language Space to Code Entity Space Mapping

graph TD
    subgraph "Natural Language Space (Markdown Templates)"
        A["entity-register.md"]
        B["evidence-register.md"]
        C["investigation-notebook.md"]
    end

    subgraph "MCP Tool Layer (Code Entities)"
        T1["add_entity()"]
        T2["register_evidence()"]
        T3["save_notebook()"]
        T4["record_grade()"]
    end

    subgraph "CSDb (Persistence Layer)"
        D1[("SQLite D1: entities")]
        D2[("SQLite D1: evidence")]
        D3[("SQLite D1: notebook")]
        D4[("SQLite D1: source_grades")]
    end

    A --> T1
    A --> T4
    B --> T2
    C --> T3
    
    T1 --> D1
    T2 --> D2
    T3 --> D3
    T4 --> D4
Loading

Sources: skills/claude-sleuth/assets/database-usage.md:24-60, skills/claude-sleuth/references/guidance.md:21-22

4. Implementation Details

Data Integrity Rules

The system enforces specific constraints on data entry to maintain professional rigor:

Task Runner Integration

The task_log.md logic is managed by the task_runner.py state machine, which tracks progress via the save_progress and load_progress MCP tools skills/claude-sleuth/assets/database-usage.md:62-66.

Workflow Execution Diagram

sequenceDiagram
    participant A as Analyst (Template)
    participant TR as task_runner.py
    participant MCP as CSDb MCP Server
    participant DB as D1 Database

    A->>TR: sleuth-task done
    TR->>MCP: save_progress(investigation_id, task_index)
    MCP->>DB: UPDATE progress SET task_index = ?
    A->>MCP: save_notebook(content)
    MCP->>DB: INSERT INTO notebook (content, timestamp)
    Note over A, DB: State is synchronized across sessions
Loading

Sources: skills/claude-sleuth/assets/database-usage.md:62-90, skills/claude-sleuth/references/guidance.md:14-15


Clone this wiki locally