{"_id":"@appliqation/defect-fix","_rev":"4-927c05d5461019378e4ea44bad52e1ee","name":"@appliqation/defect-fix","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.1":{"name":"@appliqation/defect-fix","version":"0.1.1","_id":"@appliqation/defect-fix@0.1.1","maintainers":[{"name":"archana6","email":"accounts@appliqation.io"}],"bin":{"appliqation-defect-fix":"dist/cli/index.js"},"dist":{"shasum":"8e151a436f9f395082c902359dffca381216b307","tarball":"https://registry.npmjs.org/@appliqation/defect-fix/-/defect-fix-0.1.1.tgz","fileCount":21,"integrity":"sha512-/IU0PBrQBXZJt+tJPfn8loJnjtL/eHVMCfTDQQ6CjikdKGOMRCtKMb7F4qTKQ795i4HeUMciFnO1qeedRXz9RQ==","signatures":[{"sig":"MEUCIAcFCCqYigY/QC7ISU/Mt47GoEIx421m3ee+djIaJBFgAiEA6lfxmUIrYhDGQLYtlS932KkAuXnjnysa1kzsAfs9WBw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56440},"type":"module","engines":{"node":">=20"},"gitHead":"8abbad14bf5a093c1d883aa196505b93846bd3cd","scripts":{"dev":"tsx src/cli/index.ts","lint":"eslint src --ext .ts","test":"vitest run","build":"tsc -p tsconfig.build.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"archana6","email":"accounts@appliqation.io"},"_npmVersion":"11.7.0","description":"Standalone agent that fixes an Appliqation defect: loads full defect context, locates and applies a code fix, syncs the Appliqation scenario, and verifies the fix by actually running Playwright.","directories":{},"_nodeVersion":"23.10.0","dependencies":{"dotenv":"^16.4.7","commander":"^13.1.0","@appliqation/agent-core":"^0.1.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","vitest":"^3.2.7","typescript":"^5.8.2","@types/node":"^22.13.10"},"_npmOperationalInternal":{"tmp":"tmp/defect-fix_0.1.1_1787298554150_0.4502416960212541","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@appliqation/defect-fix","version":"0.1.2","license":"MIT","_id":"@appliqation/defect-fix@0.1.2","maintainers":[{"name":"archana6","email":"accounts@appliqation.io"}],"homepage":"https://github.com/appliqation/defect-fix#readme","bugs":{"url":"https://github.com/appliqation/defect-fix/issues"},"bin":{"appliqation-defect-fix":"dist/cli/index.js"},"dist":{"shasum":"7d25caad40a891502088bd1b1efca31ee2f87044","tarball":"https://registry.npmjs.org/@appliqation/defect-fix/-/defect-fix-0.1.2.tgz","fileCount":21,"integrity":"sha512-ydty3ws7P7BPBG3dwuKUpSeWGGU9Pa6HQEDuxWZ6pK/+B4LNex/Hi3X1+YxbgBW4Izssiwo9x/UPzsX9WUdnug==","signatures":[{"sig":"MEQCIGXu6MVW5ED0UwgVvwcvm1REpm08CPDTFISSX9IX7qTYAiADDF7Nc0m+njSslBOitmfZZsQYJ9sVIwUvvxRfAuWKhw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65995},"type":"module","engines":{"node":">=20"},"gitHead":"76598e317964bfa0684562456b5839812b2682fe","scripts":{"dev":"tsx src/cli/index.ts","lint":"eslint src --ext .ts","test":"vitest run","build":"tsc -p tsconfig.build.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"archana6","email":"accounts@appliqation.io"},"repository":{"url":"git+https://github.com/appliqation/defect-fix.git","type":"git"},"_npmVersion":"11.7.0","description":"Standalone agent that fixes an Appliqation defect: loads full defect context, locates and applies a code fix, syncs the Appliqation scenario, and verifies the fix by actually running Playwright.","directories":{},"_nodeVersion":"23.10.0","dependencies":{"dotenv":"^16.4.7","commander":"^13.1.0","@appliqation/agent-core":"^0.1.5"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","eslint":"^9.39.5","vitest":"^3.2.7","@eslint/js":"^9.39.5","typescript":"^5.8.2","@types/node":"^22.13.10","typescript-eslint":"^8.67.0"},"_npmOperationalInternal":{"tmp":"tmp/defect-fix_0.1.2_1787382400493_0.8183923106085178","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@appliqation/defect-fix","version":"0.1.3","license":"MIT","_id":"@appliqation/defect-fix@0.1.3","maintainers":[{"name":"archana6","email":"accounts@appliqation.io"}],"homepage":"https://github.com/appliqation/defect-fix#readme","bugs":{"url":"https://github.com/appliqation/defect-fix/issues"},"bin":{"appliqation-defect-fix":"dist/cli/index.js"},"dist":{"shasum":"16935f383650a3294bd371c4d65683a6c540c1a0","tarball":"https://registry.npmjs.org/@appliqation/defect-fix/-/defect-fix-0.1.3.tgz","fileCount":21,"integrity":"sha512-Sd9uaZp34Sn45EuxnLwb8icH07rGmLM/hydR3JFPwZJOZxXPqFbUtwAQEqSQAO/9SIo59YUx8kXn3zjyHZkPkA==","signatures":[{"sig":"MEQCIFhub/CBHLwZKBRQpCbHsBVTN82ZLEz/5AUxp5yWi3LrAiALjQ7a8tm87NoMkIT6iVHlCo8KbaF6MLSoXdfdIkzlmQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68770},"type":"module","engines":{"node":">=20"},"gitHead":"362ba878af5c6a2f4715dee74509e2686195044b","scripts":{"dev":"tsx src/cli/index.ts","lint":"eslint src --ext .ts","test":"vitest run","build":"tsc -p tsconfig.build.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"archana6","email":"accounts@appliqation.io"},"repository":{"url":"git+https://github.com/appliqation/defect-fix.git","type":"git"},"_npmVersion":"11.7.0","description":"Standalone agent that fixes an Appliqation defect: loads full defect context, locates and applies a code fix, syncs the Appliqation scenario, and verifies the fix by actually running Playwright.","directories":{},"_nodeVersion":"23.10.0","dependencies":{"dotenv":"^16.4.7","commander":"^13.1.0","@appliqation/agent-core":"^0.1.7"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","eslint":"^9.39.5","vitest":"^3.2.7","@eslint/js":"^9.39.5","typescript":"^5.8.2","@types/node":"^22.13.10","typescript-eslint":"^8.67.0"},"_npmOperationalInternal":{"tmp":"tmp/defect-fix_0.1.3_1788433816317_0.18870214596090773","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"_id":"@appliqation/defect-fix@0.1.4","bin":{"appliqation-defect-fix":"dist/cli/index.js"},"bugs":{"url":"https://github.com/appliqation/defect-fix/issues"},"dist":{"shasum":"790bb8dd37a5e4122bcded6a3d8ce3438df25688","tarball":"https://registry.npmjs.org/@appliqation/defect-fix/-/defect-fix-0.1.4.tgz","fileCount":21,"integrity":"sha512-7O8yDOZ8L1f0irviua5eNRWdX8PbsPbA//GWyv52yyjQjPsz9EdzI8Y3rvL5rrud1ChkXA+eR/Y42Gs44z6Jpg==","signatures":[{"sig":"MEUCIC8z2HiiuqHF292ycl6csFq45a3jrMvcgJ04kZ+IpFB3AiEA82m+w3Axo5hOwufBQLYwq89I1n2FMr49sqNvUCxIQ4o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGerU0zj5hqyJiKCLjUo8Mx1XTY7EDYVcHo3kfpHD+w/AiAXEUHu7K5dCdCzJ7Sr0RnwUdfOYVJpXE7Xof8QhNOmyQ=="}],"unpackedSize":69931},"name":"@appliqation/defect-fix","type":"module","engines":{"node":">=20"},"gitHead":"7c71aed0fbf85c638400279a75eba91064dee19a","license":"MIT","scripts":{"dev":"tsx src/cli/index.ts","lint":"eslint src --ext .ts","test":"vitest run","build":"tsc -p tsconfig.build.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"version":"0.1.4","_npmUser":{"name":"archana6","email":"accounts@appliqation.io"},"homepage":"https://github.com/appliqation/defect-fix#readme","repository":{"url":"git+https://github.com/appliqation/defect-fix.git","type":"git"},"_npmVersion":"11.7.0","description":"Standalone agent that fixes an Appliqation defect: loads full defect context, locates and applies a code fix, syncs the Appliqation scenario, and verifies the fix by actually running Playwright.","directories":{},"maintainers":[{"name":"archana6","email":"accounts@appliqation.io"}],"_nodeVersion":"23.10.0","dependencies":{"dotenv":"^16.4.7","commander":"^13.1.0","@appliqation/agent-core":"^0.1.7"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","eslint":"^9.39.5","vitest":"^3.2.7","@eslint/js":"^9.39.5","typescript":"^5.8.2","@types/node":"^22.13.10","typescript-eslint":"^8.67.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/defect-fix_0.1.4_1788493226167_0.8320240714943645"}}},"time":{"created":"2026-08-21T07:49:13.962Z","modified":"2026-09-04T03:40:26.456Z","0.1.1":"2026-08-21T07:49:14.296Z","0.1.2":"2026-08-22T07:06:40.664Z","0.1.3":"2026-09-03T11:10:16.450Z","0.1.4":"2026-09-04T03:40:26.248Z"},"bugs":{"url":"https://github.com/appliqation/defect-fix/issues"},"license":"MIT","homepage":"https://github.com/appliqation/defect-fix#readme","repository":{"url":"git+https://github.com/appliqation/defect-fix.git","type":"git"},"description":"Standalone agent that fixes an Appliqation defect: loads full defect context, locates and applies a code fix, syncs the Appliqation scenario, and verifies the fix by actually running Playwright.","maintainers":[{"name":"archana6","email":"accounts@appliqation.io"}],"readme":"# Appliqation Defect-Fix\n\n**Loads full defect context, locates and applies a real code fix, syncs the Appliqation scenario, and verifies it by actually running Playwright — never by asking the model if it thinks the fix works.**\n\nPoint it at a defect ID and it investigates like an engineer would: reads the tester's report, the failing test steps, related defects on the same component, console/network errors, and the routes involved — then reads and edits your actual source, and only calls it done once a real Playwright run against the fix passes.\n\n## Why this exists\n\nAutotest tells you a test case is failing. Scriptgen locks in coverage once behaviour is known-good. Neither one touches the underlying bug. This is the agent that closes that gap: given a defect, it does the investigation, applies the fix, and proves it — the same three-phase discipline (investigate → fix → verify with a real tool call) every other agent in this family already applies to its own narrower job.\n\n## How it works\n\n```mermaid\nflowchart TD\n    A[defect ID] --> B[load context: tester report,<br/>failing steps, defect history,<br/>console/network errors, routes]\n    B --> C[locate the code:<br/>routes_visited -> source files]\n    C --> D[apply a fix]\n    D --> E[sync the Appliqation scenario<br/>if new/changed test coverage is needed]\n    E --> F[npx playwright test]\n    F --> G{passed?}\n    G -- no --> D\n    G -- yes --> H[report: verified: true<br/>+ files changed]\n```\n\n- **The one agent besides autotest's validator with real Appliqation write access** — it can sync test cases (`update_test_cases`/`add_test_cases`) and create a verification run, gated behind `--dry-run` so you can watch it work before trusting it with real writes.\n- **`--test-instruction`** lets a caller (typically [`appliqation-autopilot`](https://github.com/appliqation/autopilot), which has the broader context to judge this) specify testing scope beyond the default single-test-case re-run — e.g. \"this touches shared validation code, re-verify the whole scenario.\"\n- **No git operation.** Like scriptgen, this agent writes local files only; [`appliqation-pr-raise`](https://github.com/appliqation/pr-raise) handles committing and opening the PR.\n\n## Quick start\n\n```bash\nnpm install -g @appliqation/defect-fix\n```\n\nCreate a `.env` file (in whatever directory you'll run it from) with:\n\n```\nAPPQ_API_KEY=your-appliqation-api-key   # needs write access\nANTHROPIC_API_KEY=your-anthropic-key    # or OPENAI_API_KEY — pick one\n```\n\n```bash\nappliqation-defect-fix fix \\\n  --defect-id <id> \\\n  --repo-path /path/to/your/checkout \\\n  --dry-run\n```\n\n`--dry-run` is the recommended default for your first run against a real project — the code investigation, fix, and Playwright verification all happen for real, but the Appliqation scenario/run writeback is suppressed and logged instead of sent. Add `--test-instruction \"<text>\"` to specify verification scope, and `--json`/`--ci` for a structured summary + CI-friendly exit code.\n\n## CLI reference\n\n`appliqation-defect-fix fix [options]`\n\n**Required:**\n\n| Option | Description |\n|---|---|\n| `--defect-id <id>` | Defect ID to fix. |\n\n**Optional:**\n\n| Option | Description |\n|---|---|\n| `--repo-path <path>` | Target repo root every file/command tool call is scoped to. Defaults to the current working directory. |\n| `--test-instruction <text>` | Testing scope required beyond `appq:fix`'s own Phase 5 default (re-running just the reproducing test case) — e.g. \"also re-run the whole scenario, this component has a history of regressions.\" Typically supplied by a caller (like `appliqation-autopilot`) that has already gathered evidence about how much verification this fix actually warrants. |\n| `--dry-run` | Apply and verify the fix normally, but suppress `update_test_cases`/`add_test_cases`/`update_run_results` — logs what would have been sent instead. |\n| `--max-turns <n>` | Override `BUDGET_MAX_TURNS` for this run. |\n| `--json` | Print a single structured JSON summary on stdout instead of a human-readable report. |\n| `--ci` | Shorthand for `--json`; exit code already reflects the real, execFile-verified outcome either way. |\n\n## Configuration\n\nCopy `.env.example` to `.env`. Requires `APPQ_API_KEY` (with write access, unless every run uses `--dry-run`) and one of `ANTHROPIC_API_KEY`/`OPENAI_API_KEY`.\n\n## Running this safely\n\nSame real shell/filesystem surface as [`appliqation-scriptgen`](https://github.com/appliqation/scriptgen) (`npm`/`npx`/`git`, gated by `commandGate.ts`'s hardcoded allowlist), plus this is the one agent besides `appliqation-autotest`'s validator with real Appliqation write access. `run_command`'s child processes get a scoped, explicit env allowlist — deliberately including `@appliqation/automation-sdk`'s own vars (`APPLIQATION_API_KEY`, `APPQ_AUTH_STATE_DIR`, per-project SUT credentials), since the fix's own Phase 5 verification genuinely needs them to authenticate and report. That's the correct trade-off, but it means a real project credential is reachable from whatever `npx playwright test` executes while investigating and verifying a fix.\n\n**Run this inside a container with an egress allowlist**, not directly on a machine with broad network access. This process (and what it spawns) only ever legitimately needs to reach:\n\n- your LLM provider (`api.anthropic.com` or `api.openai.com`)\n- your configured `APPQ_ORIGIN` (`appq.appliqation.io` by default)\n- `registry.npmjs.org` — only while `npm install -D` actually runs\n- Playwright's browser-download host — only while `npx playwright install` actually runs\n- the project's own site under test — wherever the fixed code/`login.ts` points\n\nAnything else this process (or a spawned `npm`/`npx`/`git` command) tries to reach is unexpected and worth investigating, not routing around.\n\n## Development\n\n```bash\ngit clone https://github.com/appliqation/defect-fix.git\ncd defect-fix\nnpm install\ncp .env.example .env   # fill in APPQ_API_KEY (needs write access) and one LLM provider key\nnpm run dev -- fix --defect-id <id> --repo-path <path>\nnpm run typecheck\nnpm test\n```\n\nSee `CLAUDE.md` for a map of this repo if you're working in it with an AI coding assistant.\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}