Skip to content

feat: add local proof report command - #443

Merged
mohanagy merged 2 commits into
nextfrom
issue-422-local-proof-report
May 31, 2026
Merged

mohanagy merged 2 commits into
nextfrom
issue-422-local-proof-report

Conversation

@mohanagy

@mohanagy mohanagy commented May 31, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add madar proof-report [graph.json] plus parser/main wiring for local proof reports
  • derive pack diagnostics from the real saved context-pack schema and degrade cleanly when pack or compare evidence is missing
  • add regressions for parser defaults, CLI routing, missing evidence fallback, and custom graph-path guidance

Verification

  • npm run test:run -- tests/unit/cli.test.ts tests/unit/proof-report.test.ts
  • npm run typecheck
  • npm run build
  • npm pack --dry-run

Known repo baseline issue

  • CI=1 npm run test:run still fails on plain next at tests/unit/benchmark-quality.test.ts
  • failure: Gold label "cluster" (normalized: "cluster") not found in graph for question: "how does louvain clustering work"
  • reproduced after stashing this diff and checking out detached next in the same worktree

Closes #422

Summary by CodeRabbit

  • New Features

    • Added madar proof-report CLI command to generate local markdown proof reports with optional --output-dir, --compare-dir, and --pack flags.
  • Documentation

    • Revised "Getting Started" tutorial with streamlined 10-minute first-run path using sample workspace.
    • Updated tutorial steps to include new commands: madar summary, madar pack, madar prompt, and madar compare.
    • Expanded troubleshooting section with additional diagnostic guidance.

@coderabbitai

coderabbitai Bot commented May 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ac74d68e-1dbe-4006-80f0-c17499692ad0

📥 Commits

Reviewing files that changed from the base of the PR and between 80a96d7 and d1ffb90.

📒 Files selected for processing (7)
  • docs/tutorials/getting-started.md
  • src/cli/main.ts
  • src/cli/parser.ts
  • src/infrastructure/proof-report.ts
  • tests/unit/cli.test.ts
  • tests/unit/getting-started-docs.test.ts
  • tests/unit/proof-report.test.ts
✅ Files skipped from review due to trivial changes (1)
  • docs/tutorials/getting-started.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • tests/unit/getting-started-docs.test.ts
  • src/cli/parser.ts
  • src/infrastructure/proof-report.ts
  • src/cli/main.ts
  • tests/unit/proof-report.test.ts
  • tests/unit/cli.test.ts

📝 Walkthrough

Walkthrough

This PR introduces a new madar proof-report CLI command that generates a local markdown proof report. It includes the core implementation that assembles graph quality, workflows, pack quality, and compare results; full CLI integration with parser support; comprehensive test coverage for both the command and CLI routing; and a documentation update about extended agent detection.

Changes

Proof Report Feature

Layer / File(s) Summary
Proof-report command implementation
src/infrastructure/proof-report.ts
Core command loads graph/compare/pack data, parses receipts into metrics, synthesizes diagnostics when needed, assembles markdown sections with graph/pack/workflow/compare quality, and writes proof-report.md with de-duplicated limitations and next commands.
CLI parser and main wiring
src/cli/parser.ts, src/cli/main.ts
Parser handles --output-dir, --compare-dir, --pack flags and derives default directories from the graph path; CLI main adds ProofReportCommandContext, extends CliDependencies, updates help text, and routes proof-report to the command.
CLI routing and parsing tests
tests/unit/cli.test.ts
Tests validate parseProofReportArgs with defaults/overrides/errors, extend help-text assertions, verify compare routing confirmation, and assert proof-report routing with correct directory resolution and pack handling.
Proof-report implementation tests
tests/unit/proof-report.test.ts
Fixture-backed tests generate graph/compare/pack data and validate report markdown, section headers, metrics, and next-command interpolation; covers missing receipts, absent packs, and custom graph paths.
Getting-started tutorial update
docs/tutorials/getting-started.md, tests/unit/getting-started-docs.test.ts
Clarifies that madar doctor/status report codex/aider/opencode when their signals are present, and updates related test assertion.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A report hops forth from graphs and packs,
⚙️ Proof of work in markdown's tracks,
📋 Metrics dance, commands compile true,
✨ Local wisdom shared anew!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add local proof report command' directly and clearly summarizes the main change: adding a new CLI command for generating local proof reports.
Description check ✅ Passed The PR description includes all required sections: Summary of changes, Verification steps with explicit test commands, and Checklist items (implicitly satisfied through verification steps). The description is comprehensive and complete.
Linked Issues check ✅ Passed The PR addresses all coding requirements from #422: implements a local proof-report command, includes graph quality/top workflows/pack quality/compare results/limitations/next commands in the report, provides share-safe output, includes regression tests, and documents user-facing tutorial changes.
Out of Scope Changes check ✅ Passed All changes are in-scope: CLI wiring for proof-report, parser logic, infrastructure implementation, documentation updates, and comprehensive test coverage. No unrelated or extraneous modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-422-local-proof-report

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/tutorials/getting-started.md`:
- Line 50: The guidance is stale: update the sentence that claims "Codex, Aider,
and OpenCode still install correctly, but these verification commands do not
report them yet" to reflect the current behavior of the `doctor` and `status`
commands — state that `doctor` checks graph freshness and wiring and `status`
gives a compact readiness summary and that both will report Codex, Aider, and
OpenCode when their signals are present; replace the outdated line (mentioning
Codex, Aider, and OpenCode not being reported) with a concise note that these
optional agents are now included in `doctor`/`status` outputs when applicable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a37fd704-c1a5-4241-9540-2d898cc39b8c

📥 Commits

Reviewing files that changed from the base of the PR and between 32ff4de and 961c638.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (23)
  • .github/scripts/validate-mcp-registry.mjs
  • .github/scripts/verify-release-hygiene.mjs
  • .github/workflows/ci.yml
  • README.md
  • docs/integrations/compatibility.md
  • docs/mcp-registry/server.json
  • docs/release.md
  • docs/tutorials/getting-started.md
  • package.json
  • src/cli/main.ts
  • src/cli/parser.ts
  • src/infrastructure/doctor.ts
  • src/infrastructure/install.ts
  • src/infrastructure/proof-report.ts
  • tests/unit/cli.test.ts
  • tests/unit/doctor.test.ts
  • tests/unit/getting-started-docs.test.ts
  • tests/unit/install-compatibility.test.ts
  • tests/unit/install-docs.test.ts
  • tests/unit/mcp-registry-metadata.test.ts
  • tests/unit/proof-report.test.ts
  • tests/unit/release-hygiene.test.ts
  • tests/unit/why-madar-doc.test.ts

Comment thread docs/tutorials/getting-started.md Resolved
mohanagy and others added 2 commits May 31, 2026 23:12
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mohanagy
mohanagy force-pushed the issue-422-local-proof-report branch from 80a96d7 to d1ffb90 Compare May 31, 2026 19:12
@mohanagy
mohanagy merged commit 9c7dca5 into next May 31, 2026
7 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request May 31, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant