Skip to content

About

Firecrawl-powered upgrade drift detection, dead-workaround pruning, and isolated B-vs-C verification for AI coding harnesses

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

deadcodefix

Firecrawl-powered upgrade drift detection, dead-workaround pruning, and isolated B-vs-C verification for AI coding harnesses.

When a model or AI SDK upgrades, teams accumulate two expensive problems:

  1. Broken harness contracts (e.g., AI SDK tool({ parameters }) → inputSchema, maxSteps → stopWhen: stepCountIs(n)).
  2. Dead workarounds & prompt sediment — legacy regex fence strippers, defensive prompt rules, and redundant prose in CODING_STANDARDS.md that waste hundreds to thousands of tokens on every turn.

deadcodefix closes the loop with Firecrawl v2 + isolated supervisor verification:

  • Firecrawl Change Tracking (modes: ["git-diff", "json"]): detects exact doc & schema drift in official SDK/model migration guides.
  • Firecrawl Developer Index (POST /v2/search/developer): searches primary GitHub issues, merged PRs, READMEs, and agent-skill files (skills="only") with verbatim markdown passages.
  • Firecrawl Map + Structured Scrape: discovers migration surfaces and freezes SHA-256-hashed EvidencePacket bundles.
  • Multi-Provider LLM Evaluation: the Web Studio tries Vercel AI Gateway → OpenAI direct → OpenRouter. Web evaluations are separate from the offline comparison and its budget ledger.
  • Isolated B-vs-C Supervisor Verification: runs the owned fixture's checks against replayed responses. Replay results do not establish that a live model upgrade or an unrelated harness will pass.

Quick Start (CLI)

Requires Node.js 22.18 or later in the 22.x line, or Node.js 24 and later, plus Git.

npm ci
npm test
npm run check

List built-in open-source harness upgrade cases (Pi / pi-pstack, Matt Pocock Software Factories CODING_STANDARDS.md pruning):

node src/cli/main.ts cases

Generate a human-gated dry-run Pull Request draft (Summary sketch, Before/After evidence, Merge Danger Door + Blast Radius) and a 5-category Software Factory Retrospective:

node src/cli/main.ts pr --case pi-sdk-tool-upgrade --dry-run --repo gabchess/deadcodefix
node src/cli/main.ts retro --case pi-sdk-tool-upgrade

Run a live Firecrawl documentation drift + Developer Index scan (set FIRECRAWL_API_KEY in .env.local). This retrieves evidence; run and evidence only support replay:

node src/cli/main.ts drift --url https://ai-sdk.dev/docs/migration-guides/migration-guide-5-0 --tag ai-sdk-v6 --query "ai sdk tool inputSchema pi coding agent"

Run the zero-key reproducible offline replay pipeline:

mkdir -p artifacts
node src/cli/main.ts demo --out artifacts/case
node src/cli/main.ts evidence --case artifacts/case --mode replay
node src/cli/main.ts run --case artifacts/case --mode replay --out artifacts/run
node src/cli/main.ts report --run artifacts/run

Interactive Web App (web/)

The live Hack Brasil demo is deployed manually; pushes and merges to main do not trigger a Vercel deployment.

This repo contains the original Next.js Studio, which shows the built-in demo cases, diffs, and verifier checks. For a local instance, start it from web/. Add FIRECRAWL_API_KEY to web/.env.local to enable live Firecrawl scans; live LLM evaluation also requires provider credentials (see .env.example).

cd web
npm ci
npm run dev

Run npm run build from web/ to verify the production build.


Architecture

Path Responsibility
src/firecrawl/ Firecrawl v2 Change Tracking (git-diff + json), Developer Index (passages + skills="only"), Map, SSRF guard
src/llm/ Test-covered LLM fallback and budget-estimation prototype, not wired into the CLI or Web Studio
src/harnesses/ Real OSS harness upgrade & sediment-pruning cases (Pi / pi-pstack, Software Factories CODING_STANDARDS.md)
src/inspect-repository/ Read-only Git object & tree pinning without executing target hooks
src/collect-evidence/ Frozen SHA-256 EvidencePacket validation
src/design-comparison/ Experiment & exact repair.patch contract validation
src/run-comparison/ Immutable append-only attempt receipts, resume, and budget ledger
src/verify-artifacts/ Isolated out-of-process supervisor checks
src/prepare-repair/ Reproducible HTML/Markdown reports and SHA-256 review packages
web/ Interactive Next.js Evidence Inspector & Live Firecrawl Drift Studio (Vercel)
.agents/skills/ Official Firecrawl agent skills (firecrawl-build, firecrawl-developer-index, firecrawl-map, firecrawl-scrape)

License

MIT — see LICENSE.

About

Firecrawl-powered upgrade drift detection, dead-workaround pruning, and isolated B-vs-C verification for AI coding harnesses

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages