Skip to content

Releases

v0.2.4

Choose a tag to compare

@WJDdidi-1 WJDdidi-1 released this 16 Nov 14:59

0.2.4 — 2026-11-15

  • New: a nested .aiignore now works — an .aiignore in a subdirectory applies to that directory, git's per-directory rule: pkg/.aiignore with big.log hides pkg/big.log and nothing else, so a package can ignore its own generated files without touching the repo-root file. Before this, a nested .aiignore was silently ignored (a 200 KB pkg/big.log still cost 15 points) while a nested .gitignore already worked — a user writing .aiignore by gitignore semantics hit a silent trap. The patterns keep their existing meaning (directory dir/, basename globs, /-anchored paths, relative to the file's own directory); --fix still writes only the root .aiignore, and a nested .aiignore file itself is counted like any other small file. The scan cache fingerprints every .aiignore the walk reads (not just the root one), so a rule change at any level forces a full re-scan; a cache file from before this change degrades to one full re-scan and is rewritten in the new shape. The method is git's own per-directory .gitignore (gitignore(5)): patterns are read from the file in the same directory as the path, or any parent directory, and match relative to that file's location.
  • New: context --min-score N / all --min-score N — pass at this context score instead of 85 (a whole number from 0 to 100): a strict team passes at 95, an old repo starts at 70 and raises the bar as it cleans up. The verdict, the exit code, the GitHub annotations and the report all follow the bar, and the result carries it as minScore, so --json and MCP consumers can read the bar the verdict was judged against; a --fix re-scan keeps the same bar instead of silently falling back to 85. The default stays 85, so existing gates, hooks and docs keep meaning what they meant. The method is Biome's --max-diagnostics with --error-on-warnings (26,105 stars): the threshold is a number the user sets, not a constant baked into the verdict.
  • New: --fix --dry-run now exits 1 when the fix would change .aiignore, even when the score passes — a repo at 85/100 with a pending *.log entry used to exit 0, so no CI gate could tell "clean" from "fix pending". The preview itself is unchanged (same diff-style listing, nothing written); the dry run now answers "would the fix change anything?", and --json / MCP carry the same answer as fix.wouldChange. The method is prettier's --check (52,413 stars): exit 1 when something would change, because that is what makes a preview usable as a CI gate. No new flag on purpose — the preview already is the check, so a second flag would split one question in two.
  • New: MCP structured output — every tool now declares a loose outputSchema: { type: 'object' } in tools/list, and a successful tools/call returns the same object as structuredContent alongside the unchanged text block, so a calling application (the MCP Inspector's Structured Output panel, a host that routes on fields) can read the result typed instead of parsing the text. Error results carry no structuredContent. The schema stays loose on purpose: the payloads are dynamic nested objects with optional fields, and the Inspector validates structuredContent against outputSchema with AJV, so a detailed schema would warn on any property it does not list. The declared protocol version stays 2024-11-05: the fields are additive and older clients ignore them, the same precedent as annotations. The method is the MCP Inspector's (11,297 stars) structured-output panel.
  • New: context --new-from-rev[=<ref>] / all --new-from-rev[=<ref>] — report only noise that is new since the ref (default HEAD, or --changed's ref when it names one): it implies --changed, and a file already noisy at the ref counts only its growth, so touching a 2 MB lockfile to bump one version adds no noise, while growing it by 100 KB reports exactly those 100 KB. Two different refs (--changed=X --new-from-rev=Y) is a usage error: one ref governs both the changed set and the new-noise baseline. A renamed file counts as new (its old path is not traced); review items and secret findings are still reported for every changed file. The ref sizes come from one git ls-tree call, so the baseline costs one git invocation however many files changed. The MCP diagnose_context / diagnose_all tools take the same behaviour as newFromRev. The method is golangci-lint's --new-from-rev, at file level.
  • New: context --cache / all --cache — reuse the scan cache for unchanged files (.dev-diagnosis-cache.json at the scan root): a second scan of an unchanged tree skips re-reading files whose size and mtime still match, so a 44-second scan of a 53,000-file repo comes back in about 5 seconds (measured on a Node.js checkout: 43.9 s fresh, 5.4–6.1 s cached — about 8×, not the 20–40× first predicted: the walk, ignore matching and aggregation still run, only the content reads are skipped). A fully-cached run does not rewrite the cache file: when nothing changed, its bytes and mtime stay as they were. Opt-in, off by default; --cache-location <file> moves the cache file. The cache file is plain JSON (fingerprints only — findings carry rule and line, never a value) and is excluded from the scan. A changed .aiignore or .gitignore, a new tool version or a corrupt cache means a full re-scan; a --changed scan only adds or updates entries, never drops the rest. The result says when the cache was used (cached in --json, one Cache: line in the terminal and --report), and a cache hit is a fingerprint-verified earlier observation, not a blind spot — cached files are never unknowns. The cache is a local performance artifact, not a security boundary: a hand-edited cache file could hide a finding, the same as a hand-edited .eslintcache — delete the file to force a fresh scan. CI and the pre-commit hook never use it by default. The method is ESLint's --cache, metadata strategy only — hashing would cost the reads the cache exists to avoid. The MCP diagnose_context / diagnose_all tools take the same behaviour as cache: true.
  • New: all --annotations / context --annotations — also print the top noise items as GitHub Actions workflow commands (::warning file=...::...), so they surface on the run's annotations panel without opening the log: no token, no file, no upload. A failing score adds one run-level ::error::. At most 10 items (the platform's per-level cap); directory rollups are skipped (an annotation needs a file) and secret findings are never annotated. With --json the lines go to stderr so stdout stays parseable, and with --fix they follow the post-fix re-scan. The Action needs no change — args: --annotations passes straight through. The method is golangci-lint's github-actions output format.
  • New: binaries check — dev-diagnosis binaries [path] (and all, plus the MCP diagnose_binaries tool) checks up the largest native binaries in a repo (ELF, PE, Mach-O, 16 KB or larger; .git, node_modules and hidden directories skipped, like the context scan): one hardening table each — PIE, NX, RELRO, stripped, stack protector, fortify, CET/BTI-PAC, RPATH, RUNPATH — plus whole-file entropy. The headers are read with the Node standard library only: no engine, no network, no REA dependency. A value the headers cannot determine is unknown with a note saying why (a static binary has no dynamic symbol table, so its stack protector cannot be told from headers), never guessed. This is a checkup, not a security audit: it reports what the headers say, never assesses exploitability, and it always passes — a binary with PIE disabled is a fact, not a failure. --top N shows the N largest (default 5, max 20). Verified against REA's ground truth for esbuild 0.25.0: all ten hardening fields and the entropy (6.18 vs REA's 6.1813) agree. The method is REA's no-engine probes, re-implemented.
  • New: unknowns in the context report — all (terminal, --json, --report, MCP diagnose_all) now reports what the scan does not know: files past the file limit that were never counted, paths that could not be read (including dangling symlinks), and files over 1 MB that were not content-scanned for secrets. In --json the field is unknowns (each entry a kind, a plain detail, and counts) with visibleFilesPct, the share of the repo's files the score is based on; the terminal prints an Unknowns: list, and the score note now says the exact coverage instead of "totals are a lower bound". An unknown costs no score points — it is a measured blind spot, not a failure — but a 100/100 on a half-scanned repo is not a clean bill for the whole repo, so the report says how much it saw. The method is REA's Evidence/Unknown model: unknown is a first-class answer, not a missing one. (A symlink to a real file is counted as that file now — the agent is handed the target's contents either way — where the walk used to skip every symlink silently.)
  • New: all --only <checks> / all --skip <checks> — run only the named checks, or every check except the named ones (comma-separated: context, binaries, path, flakes, cache; the two flags cannot be combined). The cache check runs the build twice, so all --skip cache is the fast path when the build itself is not under suspicion; checks skipped this way are listed as skipped, so the summary stays honest, and --fix refuses to run when context is skipped (it writes the context check's suggestions). The MCP diagnose_all tool takes the same selection as only / skip arrays. The method is super-linter's VALIDATE_ toggles: one list selects the checks, the rest are skipped.
  • New: secrets command — dev-diagnosis secrets <file>... scans named files for secrets only (the same credential shapes the context check looks for), prints file + rule + line, never the value, and exits 1 when one is found. It is the command the new dev-diagnosis-commit-msg pre-commit hook runs on the commit mess...
Read more

v0.2.2

Choose a tag to compare

@WJDdidi-1 WJDdidi-1 released this 13 Nov 14:41
46f1fab

What's new in 0.2.2

  • The MCP server is now listed in the official MCP registry (io.github.WJDdidi-1/dev-diagnosis). A release-triggered workflow publishes the listing via GitHub OIDC, so agents can find and install the server from the registry. server.json carries the registry metadata, scripts/check-registry-release.mjs waits for the new npm version to be live before the listing is published, and test/registry.test.mjs keeps the metadata in sync with the package version.
  • llms.txt at the repo root — a short machine-readable summary for AI search and retrieval, pointing agents at the install and usage commands.
  • package.json carries mcpName and expanded keywords (ai-agent, mcp, model-context-protocol, claude, context-window, agent-skills, token-optimization) so the package is discoverable by agents searching npm.

Verification

v0.2.1

Choose a tag to compare

@WJDdidi-1 WJDdidi-1 released this 12 Nov 14:21

0.2.1 — 2026-11-12

  • Fix: dev-diagnosis setup and --skill-generate --global wrote MCP configs and skills to the wrong home directory on macOS and Windows (they ignored $HOME). They now honour $HOME on all platforms. v0.2.0 shipped with this bug on macOS/Windows; CI caught it after the release (8 of 12 matrix jobs red) and this patch is the fix.
  • Fix: test fixtures and tests are now CRLF-safe, so the suite passes on Windows checkouts as well as macOS and Linux.
  • Verified: CI 12/12 green (Ubuntu/macOS/Windows × Node 18/20/22/24).

v0.2.0 — MCP server, one-command setup, and a screencast

Choose a tag to compare

@WJDdidi-1 WJDdidi-1 released this 12 Nov 12:23
ced617d

What's new

  • dev-diagnosis --mcp — the four checks as an MCP server on stdio (pure Node.js standard library, no new dependencies): five tools (diagnose_context, diagnose_path, diagnose_cache, diagnose_flakes, diagnose_all), each returning the same JSON the CLI's --json produces. --sandbox <dir> restricts every path the tools touch to that directory.
  • dev-diagnosis --skill-generate — writes a Claude Agent Skills SKILL.md (project or --global) telling an agent to run dev-diagnosis all when it starts work in a repo, fix what FAILs, and re-run to confirm. Never overwrites an existing SKILL.md.
  • dev-diagnosis setup — wires the MCP server into Claude Code, Codex CLI, Cursor and VS Code in one command. Previews exactly what will be written first; merges into existing configs without touching other entries; --dry-run previews, --check reports.
  • GitHub Action — action.yml at the repo root runs dev-diagnosis all in one CI step and fails the job when a check fails.
  • context now reports token cost — ≈ 439k tokens (estimate) next to the noise list, and estimatedTokens in --json.
  • all ends with a one-line summary — passed/failed/skipped counts, context noise bytes, cache saving — in text and --json.
  • README screencast — a 22 s terminal recording (docs/demo.gif): all finds ≈439k tokens of noise, --fix writes one .aiignore entry, a re-run comes back 94/100 PASS. Every line is verbatim CLI output.

Fixes

  • context --fix / all --fix (and MCP tools with fix: true) used to report the pre-fix verdict — exit 1 and FAIL — even though the fix had landed and a re-run scores clean. They now re-scan after writing .aiignore and report the post-fix score, verdict and exit code. Other failures are still not masked: all --fix exits 1 when flakes, path or cache still fail.
  • context --fix no longer writes review suggestions (e.g. secret-like files) into .aiignore — a basename pattern like secret.js hid every same-named file in the repo while fixing nothing. Review suggestions are advisory only (reviewSuggestions in --json).
  • context no longer lists noise that costs no points and tells you to fix it — on a 100/100 repo it still printed a fix for the lockfile, contradicting its own PASS.
  • Test suite now runs serially (cache timing skewed under parallel runs) and no longer leaks ~100 MB of temp dirs per run.

Verified

124/124 tests, self-check 100/100, real MCP protocol check 25/25 (JSON-RPC 2.0, sandboxing, error handling), real setup + skill end-to-end 33/33. Cold npx start 0.77 s to the first conclusion. No new runtime dependencies; Node >= 18; fully offline.

Install: npx dev-diagnosis-cli or npm install -g dev-diagnosis-cli

v0.1.8

Choose a tag to compare

@WJDdidi-1 WJDdidi-1 released this 12 Nov 08:13

0.1.8 — 2026-11-12

  • Fix: all --json embedded the build's full stdout (coldStdout / warmStdout) in the cache check, while standalone cache --json already left it out — a chatty build bloated the machine-readable output. Both shapes are now the same: timings and verdict only. The --json option also now documents cache (the usage line and help text listed only context, path, flakes and all, although standalone cache --json already worked).
  • New: context now also honours .gitignore — files and directories it lists are excluded from the scan, at the repo root and in nested .gitignore files alike, so a repo whose build output, logs or data dumps are already git-ignored no longer gets flagged for them, and --fix no longer duplicates those entries into .aiignore. The common pattern forms work (*, ?, [...], **, /-anchored paths, directory-only dir/, ! negation with last-match-wins); .git/info/exclude and the global gitignore are not read. (82 tests.)
  • Dogfood: the repo now ships a .aiignore excluding the demo fixture (examples/demo-repo/), so dev-diagnosis all on a checkout passes its own context check (was 77/100 FAIL, now 100/100 PASS). The fixture is intentionally noisy test data and stays noisy when scanned directly — npm run example output is unchanged.

v0.1.7

Choose a tag to compare

@WJDdidi-1 WJDdidi-1 released this 12 Nov 02:38

0.1.7 — 2026-11-12

  • Fix: dev-diagnosis <path> no longer errors with "unknown command" — the usage line promises [all] [path], but a bare path was treated as a command name. A bare positional that is an existing directory now means all on that path (options like --command still apply); a word that is neither a known command nor a directory is still a usage error, so a typo stays a typo. The help text and README say so.
  • Fix: --top N was silently ignored in --json output — flakes <dir> --json --top 1 returned all five demo tests instead of one. The JSON tests array is now limited to the N highest-ranked tests, in standalone flakes and in all --json alike; totals still describes the whole run set, the same split the text table makes.
  • Fix: all --json dropped the reason a check could not run — a missing runs directory or a failing build came out as "flakes": null / "cache": null next to overall: FAIL, with nothing saying why. A check with no result now reports { "error": "<reason>" } instead, so a script consuming the JSON can tell which check failed and why.
  • Fix: a run directory with no JUnit XML files was silently dropped — flakes on two run directories, one of them empty, reported "runs: 1" with no mention of the second run. An empty run directory is now named in the output (and in --json under skippedRuns) and fails the check: a CI run that produced no reports is a broken upload, not a run with zero tests. (72 tests.)

v0.1.6

Choose a tag to compare

@WJDdidi-1 WJDdidi-1 released this 11 Nov 16:59

0.1.6 — 2026-11-12

  • Fix: an empty JUnit file (0 bytes, whitespace only, or a declaration/comment and nothing else) no longer parses as a clean run of zero tests — the XML reader now requires a root element, so the file is reported as "no root element", listed in the warnings, and the flakes check fails instead of silently reporting on half-read data. A genuinely empty report (<testsuites></testsuites>) still parses to zero tests. (62 tests.)
  • Docs: the 0.1.5 entry is now dated 2026-11-11.

v0.1.5

Choose a tag to compare

@WJDdidi-1 WJDdidi-1 released this 11 Nov 12:49

0.1.5 — 2026-11-11

  • Fix: a JUnit file that cannot be parsed no longer passes silently — flakes used to collect the parse error into a warnings list nothing ever printed, so a run set of only corrupt XML reported "no flaky tests" and exited 0. The warning is now printed with the file and the parse position, and the check fails with how many files could not be parsed, so the verdict is never based on half-read data. (58 tests.)
  • Docs: a Troubleshooting note for running npx inside a checkout of this repo — npx prefers the checkout's own package.json and fails with dev-diagnosis: not found; npm install does not fix it (no dependencies, so no node_modules is created). Run node bin/dev-diagnosis.js directly, npm link, or run npx from another directory.

v0.1.4

Choose a tag to compare

@WJDdidi-1 WJDdidi-1 released this 11 Nov 09:29

0.1.4 — 2026-11-11

  • Fix: large files now get an exact-path .aiignore suggestion (their repo-relative path), so context --fix can hide them — previously large files had no suggestion at all, so --fix could never clean a repo with an oversized file and re-scanning still failed (the demo fixture's 1.68 MB data/export.json proved it). After the fix, fix then re-scan comes back clean (Score 100/100). (54 tests.)
  • Docs: CHANGELOG 0.1.3 entry now dated 2026-11-11.

v0.1.3

Choose a tag to compare

@WJDdidi-1 WJDdidi-1 released this 11 Nov 06:00

0.1.3 — 2026-11-11

  • Fix: nested build-output directories are reported by their full path from the repo root (packages/foo/dist/) instead of a bare dist/ — the bare entry only matches top-level output, so --fix on a repo whose build output lives in a subdirectory wrote an .aiignore entry the next scan ignored, and the scan kept failing after the fix. Files under one build directory are also rolled up into a single row instead of one row per file. (53 tests.)