Skip to content

[Epic] Make Madar a trustworthy evidence-backed context compiler #648

Description

@mohanagy

Outcome

Turn Madar from an advanced prototype / early-production DevTool into a trustworthy evidence-backed context compiler for a clearly declared TypeScript/Node support corridor.

The product north star is:

Madar turns a task and a local repository into the smallest evidence-backed context pack that preserves the critical execution and impact paths while explicitly naming what it may have missed.

This epic is the authoritative execution index for the technical roadmap. Every implementation change must be tracked by a linked child issue with an explicit dependency, scope boundary, acceptance criteria, validation gate, and rollback path.

Audited baseline

All initial findings and architecture decisions are based on remote main at:

06b373a447acfce895412ac10eb4e5228c5df0b7

This is the v0.32.1 release line.

The audit confirmed six high-impact facts:

  1. KnowledgeGraph is not a semantic multigraph. Edge identity is endpoint-only, so later facts overwrite earlier facts between the same nodes.
  2. Graph construction detects dangling endpoints and then filters/skips them without durable accounting.
  3. Production retrieval and context-pack code contains exact status-page/OpenStatus-era paths, symbols, and task concepts.
  4. Automatic TS/JS generation builds SPI information, discards SPI topology, and reruns legacy semantic extraction over the same supported files.
  5. Several common MCP installers default to a profile that does not expose context_pack.
  6. The public production-default benchmark has zero valid Native-vs-Madar outcome comparisons.

Strategic principles

  • Correctness and explicit uncertainty come before token reduction.
  • The graph is infrastructure, not the product moat.
  • A polished context pack must never hide missing, rejected, unresolved, stale, or conflicting evidence.
  • Static execution paths are hypotheses, not observed runtime traces.
  • Exact/path/symbol retrieval should seed bounded graph expansion; graph traversal should be used only where relationships add value.
  • Production behavior must remain independent from qualification repositories and benchmark prompts.
  • Pack v1, CLI, and MCP compatibility should be preserved behind adapters where safe.
  • Compatibility must not preserve silent semantic loss.
  • Do not rewrite Madar. Correct individual seams behind characterization and differential tests.

Complete dependency-ordered roadmap

Phase 0 — Trust foundations and qualification gates

Parent epic: #649

Execution note: #654 and #655 can start immediately. #656 may be implemented in parallel but cannot merge until #654 is resolved. The graph implementation sequence is strictly #656#657#658#659. Then complete #660 and #661.

Phase 1 — Trustworthy context under incomplete knowledge

Parent epic: #650

Execution note: #662#663#664. After #664, #665 and the host-qualification portions of #666 may proceed according to their stated dependencies.

Phase 2 — Measurable product advantage

Parent epic: #651

Execution note: #667 establishes the truthful development baseline. #668 and #669 qualify the product corridor and adapter contract. #670 and #671 are evidence-gated architecture/performance work. #672 follows the stable identities, adapters, and indexes. #673 is the Phase 2 decision gate. #677 remains blocked until the protected packaged release from #676 exists.

Phase 3 — Supported surface and release trust

Parent epic: #652

Execution note: #674#675#676. The protected release workflow also depends on the product-claim decision in #673.

Phase 4 — Measured scale and constrained ecosystem

Parent epic: #653

Execution note: Phase 4 is deliberately locked behind the trust, outcome, compatibility, incremental-equivalence, and protected-release gates. #679 follows #678 and must not become a marketplace project.

How agents should execute issues

  1. Give the agent one issue number, not an entire phase.
  2. The issue body is the execution contract. The agent must obey its Depends on, scope, explicit non-goals, tests, acceptance criteria, rollback, and handoff sections.
  3. One issue should normally produce one coherent PR. Epics do not produce implementation PRs.
  4. An agent must stop when completing the requested issue and must not continue into a dependent issue automatically.
  5. A PR can be ready for review while a repository-wide prerequisite is open, but it is not ready for merge until every stated merge gate passes.
  6. Any discovered work outside the issue scope becomes a new linked issue; it must not be smuggled into the current diff.
  7. Close a child issue only after its acceptance criteria pass on the protected branch/PR, not merely because code was written.
  8. Update the corresponding checkbox in this epic and the phase epic after closure.

Global execution contract

Every child issue must follow these rules:

  1. One coherent outcome per issue and normally one implementation PR per issue.
  2. Do not start an issue until every Depends on issue is complete, unless the issue explicitly permits parallel characterization work.
  3. Start with failing characterization or qualification evidence where the issue changes semantics.
  4. Separate facts observed in the repository from design inference.
  5. Do not mix unrelated cleanup, naming changes, framework expansion, or architectural refactoring into roadmap PRs.
  6. Preserve deterministic output and explain every retrieval, Pack, graph, or artifact difference.
  7. Do not update snapshots merely to accept unexplained behavior changes.
  8. Do not describe a test suite, host integration, benchmark, or release as green when it did not complete successfully.
  9. Do not publish a release from a partially completed graph-integrity migration.
  10. Each PR must identify rollback behavior and any source regeneration required.

Global protected gates

Unless a child issue defines a stricter gate, merge requires:

  • supported Node version and exact lockfile;
  • npm ci;
  • typecheck;
  • build;
  • focused tests for the affected subsystem;
  • complete protected test suite;
  • coverage gate where configured;
  • packed-package parity;
  • npm pack --dry-run or the repository's stronger package check;
  • Registry validation;
  • release verification;
  • deterministic artifact/output checks where affected;
  • exact-head protected CI.

Token, latency, or tool-call improvements count only when answer correctness and critical-fact completeness are non-inferior.

Six-month completion target

For supported TypeScript/Node patterns, Madar should be able to:

  • retain every admitted semantic fact;
  • preserve separate evidence occurrences and provenance;
  • account durably for unresolved, rejected, conflicting, and invalid graph candidates;
  • refuse ready when graph integrity or critical obligations are unproven;
  • provide direct source evidence for critical claims;
  • reconstruct qualified route/service/repository and producer/consumer paths with independently measured precision;
  • work through a context-first default in supported agent hosts;
  • demonstrate non-inferior or better agent outcomes in repeated, blinded evaluation;
  • report indexing, context-building, agent, token, latency, and cost measurements separately;
  • ship through a protected, reproducible publication process.

Not now

Do not create implementation work for these until this epic explicitly unlocks them:

  • another architecture reset or replacement beta line;
  • broad Rust/Java/PHP or deeper Python/Go expansion;
  • hosted/cloud repository indexing or team synchronization;
  • live distributed tracing;
  • autonomous code editing or security verdicts;
  • mandatory vector database or LLM-based query interpretation;
  • Neo4j-first architecture;
  • more MCP tools or new transports;
  • public plugin marketplace;
  • major new Wiki/Obsidian/federation/time-travel investment;
  • long-term repository memory before invalidation is trustworthy;
  • token-reduction headline optimization before outcome proof.

Closure criteria

Close this epic only when:

  • every non-parked child issue is complete;
  • the declared TypeScript/Node corridor has independent outcome evidence;
  • no P0 trust defect remains open;
  • the supported host matrix passes real packaged acceptance tests;
  • the final release is produced from an exact protected commit with verifiable provenance;
  • public claims are narrower than or equal to the collected evidence.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions