Dispatch Context
Every sub-agent, workflow, and skill invocation in the cycle receives this context block verbatim. It lives in a single reference file so changes propagate everywhere without editing each skill.
Use /codebase-memory (CodeGraph Approach) and Serena MCP server (Proxy Server to relevant LSP's) for code exploration STRICTLY in parallel.
Also, dispatch parallel sub-agents or Workflow for the analysis ahead.
We use Fable model for super complex tasks, Opus model for complex tasks, Sonnet model for medium tasks and Haiku model for easy tasks ALWAYS.
We refer to /mem-search for past decisions undertaken and If REQUIRED then only check for confusions and reconcile them with the user itself wherever required.
When generating Artifacts, NEVER export them to CLAUDE. ALWAYS export them Locally either as Markdown or HTML
When updating tasks files (.agents/tasks/tasks-*.md), ALWAYS use Serena MCP server (replace_content or replace_in_files) instead of Edit/Write tools. Serena provides LSP-aware safe edits that preserve file structure.
Reference file:
.claude/dispatch-context.md
Each skill and workflow reads this file at dispatch time and injects it into every sub-agent prompt. Update once, applies everywhere — no need to paste the block manually.
Decisions Log
Key architectural and process decisions made across the project lifecycle, sourced from claude-mem observations and project memory. Organized chronologically.
Architecture & Pipeline
2026-06 · RFC-003 / RFC-005
PDF Extraction: Markdown-First + Docling CPU
PyPDF2 garbles German insurance PDFs — root cause is text extraction, not OCR. Adopted markdown-first extraction via pymupdf4llm. Docling-CPU is the config-gated converter (PDF_CONVERTER=docling, force CPU on darwin). pymupdf4llm drops the fl-ligature (Haftpflicht→Haftpficht); Docling fixes it. Docling MPS-only was NO-GO on Apple Silicon.
2026-06-12 · RFC-004 · USER-LOCKED
Granite-258M REJECTED for All Future Implementations
gpt-4.1 vision: DPI-unstable hierarchy hallucination → validates flat-doc-success route. VLM stays off by default. Granite-258M permanently rejected: 2.9 GB RSS, 38 min/page on CPU, flat-only output. RFC-004 D1/D2 adopted: deterministic-first VLM-escalation cascade (VLM_MODE=disabled default) + hybrid engine (frontier gpt-4.1 vision via OPENAI_BASE_URL; self-hosted Apache-2.0 residency floor).
2026-06-12 · RFC-004
Flat Docs: SUCCESS, Not Rejected
Clean-text-layer docs with no hierarchy are processed as SUCCESS — matches all 8 surveyed peers (Textract, Azure DI, Google Doc AI, Docling, Unstructured, LlamaParse, Reducto). "Flat" and "garbled" are orthogonal. Flat outcome: status=done + content_class ∈ {flat_table, flat_kv, flat_prose, flat_mixed}, persisted as processed/<doc_id>.flat.json; validate_tree() never called.
2026-06 · AGPL
AGPL Has THREE Pullers, Not One
pymupdf (AGPL) enters via pymupdf4llm AND docling-hierarchical-pdf AND the pageindex fork. pymupdf4llm now moved behind agpl-fallback extra (landed). Verify other two pullers before declaring venv clean. MIT escape: Docling.
Corpus Remediation (RFC-018 / RFC-019)
2026-07-27 · RFC-018
D0–D3: Marker Count, Text-Layer Probe, Arabic RTL, Garble Gate
D0 marker-count fix: WORKING. D1 text-layer skip: WORKING. D2 Arabic RTL hardening: WORKING. D3a garble probe: PARTIAL (Latin-gibberish gap on document 597). D3b per-node garble: WORKING. Full corpus validation: 25/25 processed → 23 stored (11 PASS, 9 MARGINAL, 3 FAIL), 2 errors.
2026-07-27 · RFC-019
D0–D4: Five Corpus Reingestion Fixes
5 fixes from 25-doc audit (12P/9M/3F/1E): D0 landed, D1 uncommitted, D2/D3/D4 pending. 14 tasks, 4.5 person-days estimated.
Content Recovery & Verdict Hardening (RFC-021 / RFC-023)
2026-07-28 · RFC-021
Verdict Quick-Fixes: QF1–QF4
QF1 accepts imperfect but useful tree output. QF2a/QF2b/QF2c tighten or defer garble checks. QF4 LEGACY_VERDICT_ENABLED env var provides rollback lever to restore pre-RFC-021 behavior. Cross-fix interaction risks flagged: QF2c+QF4 could PASS numeric-junk docs.
2026-07-28 · RFC-017
OCR Image Block Decoupling: Page Coverage + Standalone Image
D0: Skip regions exceeding 60% page area in _recover_picture_text() — full scanned pages handled by page-level OCR, not per-picture cropping. PICTURE_PAGE_COVERAGE_THRESHOLD env var (default 0.6). D1: Standalone image branch never calls splice_figure_markers() or _enrich_image_blocks() — chart content lost entirely. Fix: create synthetic PictureResult after image_to_markdown().
2026-07-29 · RFC-023
D0–D11: Content Recovery & Verdict Hardening (12 Decisions)
Run 6 corpus reaudit (25 docs): 11 PASS / 4 MARGINAL / 9 FAIL / 1 ERROR. 12 decisions across 3 themes:
A. Garble-aware recovery — D0: garble-check in _text_layer_has_content; D1: ordinal marker splicing; D2: decorative-icon bbox filter; D11: image-dominant OCR escalation.
B. Verdict correctness — D3: strip HTML comments before garble tokenization; D4: content-quality guard on cat_b_promoted; D5: prefer synthetic structure over rejected tree.
C. Pipeline resilience — D6: page rotation correction; D7: Tesseract-on-raster VLM-crash fallback; D8–D10: verdict hysteresis and tuning.
Projected Run 7: 18–20 PASS (up from 11).
Process & Workflow Conventions
2026-07-20
Model Tier Assignment Convention
Tiered model selection established for all sub-agent and workflow dispatching: Fable super complex tasks (RFC verification, wave checkpoints, G3 verdict) · Opus complex tasks (RFC drafting, root-cause tracing, architecture) · Sonnet medium tasks (subjective verdicts, test repair) · Haiku easy tasks (programmatic scoring, shell commands).
2026-07-20
Parallel Code Exploration: CodeGraph + Serena MCP
All code exploration must use /codebase-memory (CodeGraph) and Serena MCP server (proxy to relevant LSPs) strictly in parallel. Established as mandatory dispatch context for every sub-agent invocation.
2026-07-28
Dispatch Context Conventions
.claude/dispatch-context.md created as centralized governance document, included verbatim in every sub-agent/workflow/skill prompt. Rules: parallel CodeGraph + Serena exploration, tiered model selection, local-only artifact export (never to Claude), Serena MCP for task file edits, /mem-search for past decisions.
2026-07-27
Task Document Markdown Conventions
Phase-based structure with strict anchor-link cross-referencing. No ###/#### headings inside Tasks section — nested checkbox lists only. Every task has _Requirements:_ line with pipe-separated clickable links. All cross-references must be clickable markdown anchor links, no bare text.
2026-07-27
Corpus Trace Token Efficiency Redesign
Phase 3 trace restructured from per-document Opus/Sonnet to cluster-level Opus + selective Sonnet/Haiku drilldown. Skip PASS docs in Phase 3; focus on code changes causing regressions; prefer simple solutions over complex approaches.
2026-07-29
No Co-Authors in Corpus Sync-Commit
Corpus sync-commit workflow (.claude/workflows/corpus-sync-commit.js) must NOT include any Co-Authored-By lines or Generated with trailers in any of the 4 batched commit messages. Each batch agent explicitly instructed to omit all co-author attribution.
2026-07-28
Skills + Workflows Architecture (over hooks/plugins)
Corpus toolset built as project-local Claude Code Skills (markdown entry points in .claude/skills/) + Workflows (JS scripts in .claude/workflows/) rather than hooks or plugins. 7 skills + 6 workflows. Full loop has 5 phases with human-in-the-loop gates at G1 and G2. Shared dispatch-context.md propagates conventions to all sub-agents.
2026-07-28
Corpus Namespace Convention (corpus: prefix)
All corpus skills use a corpus: namespace prefix: /corpus:score, /corpus:diff, /corpus:trace, /corpus:plan, /corpus:mend, /corpus:cycle. Skill directories match workflow names. Gated pipeline with numbered runs and RFC-based task planning.
2026-07-28
File Organization: One-File-Per-Run + Trace Inlined
Audit scorecards moved from append-style to one-file-per-run (CORPUS_REINGESTION_AUDIT_RUN-N.md). Root-cause investigation traces are inlined directly into the RFC produced by corpus:plan, eliminating separate trace files in audit/ or .agents/state/.
2026-07-29
Serena MCP Enforced for RFC Re-Drafting
Opus re-drafting step (after Fable verification) restricted to Serena MCP tools only (replace_content / replace_in_files). Edit/Write tools forbidden for RFC file modifications. Same constraint applies to L3 checkpoint task file updates.
2026-07-29
Checkpoint Persistence + Cross-Session Resume
Phase 3 (Diagnose + Plan) persists checkpoints to .agents/checkpoints/diagnose-plan-runN/ after each sub-phase: triage, cluster-traces, drilldown. Resume via args.resume_from avoids re-running expensive Opus cluster trace work on context-limit interruptions. Phase 4 supports start_wave to skip completed waves.
2026-07-28
Auto-Convergence Criteria
Cycle auto-converges when scoring produces 0 FAIL + 0 ERROR + 0 regressions. At G1, if converged, the orchestrator reports convergence and stops. Human retains override: convergence is a judgment call at G1, not a hard threshold.
Guardrails & Lessons Learned
2026-06 · RFC-002 lesson
Verify Source Before Asserting Defects
Must read file:line before any code [FIX] claim in an RFC or queue. Established after RFC-002 fabrication incident where asserted defects did not exist in the actual code.
2026-07-17
Fabricated Corpus Report Detected
DOC_STORE_CORPUS_REPORT.md verdict table was FABRICATED. Real MinIO meta.json showed 11 PASS / 12 MARGINAL / 2 FAIL — not the claimed 15 / 10 / 0. Always verify against source data.
2026-07
Never Export Artifacts to Claude
Artifacts must always be written locally as .md or .html files. Never use the Claude Artifact tool for export. This is a hard rule in the dispatch context.
2026-07
OCR/Image-Block Conflation Confirmed
feat/image-block-picture-ocr branch conflates page-level OCR with per-picture enrichment. OCR text reclassified from prose to image blocks. Standalone images lose chart content entirely. P0–P5 fix plan documented at audit/OCR_IMAGE_BLOCK_CONFLATION_INVESTIGATION_2026-07-27.md.
Infrastructure
2026-07
Worker Deploy Rollout Fix
pageindex-mcp-worker rollout times out: new replicas stuck Pending (unschedulable) on single-node k3s, NOT a crash. Worker maxSurge:1/maxUnavailable:0 needs room for 2 pods; node over-committed. Fix: maxSurge:0/maxUnavailable:1 + bigger node.
2026-06 · PR #11
Langfuse Tracing (LLM-02)
Merged. Gotcha: litellm langfuse_otel uses a PRIVATE OTel provider (skip_set_global) → needs client.flush_litellm_tracing(); langfuse client flush alone won't reach it. Deploy manifests live in sibling hetzner-deployment-service repo.
Last updated: 2026-07-29 · Sourced from claude-mem observations + project memory