{
  "schemaVersion": 1,
  "date": "2026-10-14",
  "sourceCommit": "48d788a0be3f0a94384ceb9c5939ad484db45e99",
  "scope": "Every non-test JavaScript file in scripts/ai-pilot at the pinned source commit",
  "scriptCount": 32,
  "scripts": [
    {
      "path": "scripts/ai-pilot/budget.mjs",
      "sha256": "111fd7d2e8549c418c5f712272f8923a7e3a701cf46a32ec63d6d6a7cd9ce47a",
      "category": "support-module",
      "referenceSummary": "Attempt/overshoot/recovery arithmetic, result classification, repeat-attempt rules, lean settings, context ranges and worker/recovery prompts/tool lists",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/codex-cost.mjs",
      "sha256": "4340a2e896323765b136dc467c428d97675ec41f8a1ada336059e674577f96f4",
      "category": "support-module",
      "referenceSummary": "Codex pricing and usage validation, deduplication, selected rollout metadata and completeness-aware summaries; separates equivalent value from actual charges",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/codex-spend.mjs",
      "sha256": "e74caaaba076f475698f066532e11c960fd42069135a391beb47a54b7f06568c",
      "category": "command",
      "referenceSummary": "Repeated `--ledger FILE` / `--rollout FILE`; `--pricing-model`, `--speed` | Reads selected local usage metadata, deduplicates attempts and reports API-equivalent estimates. Missing rates or incomplete usage can leave totals unknown; `actualUsd` stays null. It makes no model call and prints no message text",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/codex-stage.mjs",
      "sha256": "1c3eaa3c8b8ab8d8558553e7f849fe96aaa87836d79a51e8e296af60ae5f409b",
      "category": "support-module",
      "referenceSummary": "Native Codex arguments, prompts, sandbox/auth environment, timeouts, JSON event parsing, readiness artifacts and optional usage ledger; no recovery resume",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/decisions.mjs",
      "sha256": "3ebd0278f11fbe82812113a518e800adc00e053563c500763a0381805833947e",
      "category": "command",
      "referenceSummary": "`add --task KEY --question TEXT`, optional options/recommendation/link; `list --json`; `answer ID TEXT`; `--file` | Maintains `inbox/DECISIONS-PENDING.md` with Open and Answered sections. Uses temporary write + rename. An answer records the human's decision; it does not automatically grant a run new permissions. Single-file replacement is not a distributed writer lock",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/entry-args.mjs",
      "sha256": "53366ebe688e3e39448c8858b437189456a389cbf6666a46cbae98d057aaa59f",
      "category": "support-module",
      "referenceSummary": "Side-effect-free parsers for run-task/prep; require an explicit permitted base and reject unknown flags",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/ext-review.mjs",
      "sha256": "4b4acaef2b1bb8a6202165bcb7688a3980b2446eaee25bd8ba7aaa780fc7e345",
      "category": "support-module",
      "referenceSummary": "Imported reviewer adapter; pipeline `--ext-review codex-github`, `--ext-rounds`, `--ext-flow v2` | Requests/polls GitHub Codex review for the exact SHA, parses severity and deduplicates findings. The module itself has no local model call; external review consumes its service allowance and fix/review stages consume theirs. Requesting review can mark a draft ready and post a review-request comment",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/fetch-lock.mjs",
      "sha256": "36a666ecf76e9bc74cf1f925f74efe6424f58644a8259261a35827332d2bad4d",
      "category": "support-module",
      "referenceSummary": "Exclusive local lock file around shared Git fetch, timeout and stale-lock policy. It protects fetch operations, not all Git operations or task ownership",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/hooks/guard-review-subagents.mjs",
      "sha256": "6ed041c6307711348a10627ec8c362fe76115a2819e258ceadff6e9b5b10e485",
      "category": "hook",
      "referenceSummary": "Claude Agent/Task hook: rejects recognized review calls without an eligible small-model choice and explicit dollar budget. Has exemptions and fails open on malformed input; it is not a general spending cap",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/land-pr-lib.mjs",
      "sha256": "b6666e224e3f2f0962298e0a8c1815c017252c3e31f8a34ca9a6d99d1db6761a",
      "category": "support-module",
      "referenceSummary": "Landing arguments, exact-head review selection, test mapping/base-failure comparison, typecheck parsing, Postgres/drift selection and report formatting",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/land-pr.mjs",
      "sha256": "12e41637ebf67e729f0fd13fe47a10e4921e9ffd6e610fca078687ef65113811",
      "category": "command",
      "referenceSummary": "`--pr N --into BRANCH`; `--apply`, `--try-tsc`, `--keep-worktree`; optional task/status preconditions | Checks PR, exact-head deep review, merge conflicts, typecheck policy, tests, real Postgres, structured conditions and drift. Appends `landings.jsonl`; prints BLOCKED, READY or LANDED. Dry-run landing still performs checks and local worktree/test operations",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/make-fix-brief.mjs",
      "sha256": "5233b5765fb88b9f5bab9b4607f1a96f14358cd46df9bc70a68e4880a5fde24f",
      "category": "command",
      "referenceSummary": "`--pr N --report FILE --head pilot/KEY`; `--task-key`, `--verify`, `--out-dir` | Converts BLOCKING and fix conditions into `inbox/fixspecs/KEY-fixN.md`. Keeps report text fenced as untrusted data. Writes a fix specification; does not run or approve it",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/merge-train-lib.mjs",
      "sha256": "d78ef9ae3b74012e79f8e6636afc91b50e841488367f218b380b89af6d8df14d",
      "category": "support-module",
      "referenceSummary": "Train arguments, risk tiers, PR ordering, current-head deep-review selection and agreement between exit/summary/landing record",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/merge-train.mjs",
      "sha256": "13329d22150b543c32c321767f3bdc9c65370a8b98b8d3e283d70c30dc3e4d5d",
      "category": "command",
      "referenceSummary": "`--into BRANCH`, `--prs 1,2` or `--from-ledger`; `--max-prs`, `--max-minutes`, `--apply`, `--dry-run` | Sorts/deduplicates PRs and serially calls `land-pr`. Holds high-risk paths. Leaves `merge-train.jsonl` and `.log`; the train does not bypass the landing gate",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/pipeline-lib.mjs",
      "sha256": "0794c2584a7f13f78e7ff508a74fed4c4893d1dbc7bc39c15ebb34c491928978",
      "category": "support-module",
      "referenceSummary": "Routing/outcomes, stage budgets, environment profile checks/verification facts, fix briefs, deep/external findings, spec sensitivity and human-gate rules",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/pipeline.mjs",
      "sha256": "eafdce281f294f26afbf06ff1445eaca3e0f45118a383fb13a31746e934e03e6",
      "category": "command",
      "referenceSummary": "`--task KEY --base BRANCH`, either `--spec` or `--brief`; `--max-usd`, `--model`, `--review-model`, `--max-fix-rounds`, `--verify-cmd`, `--dry-run` | Chains prep, worker, verification and review. Reserves the remaining estimated budget before starting each stage. Writes `pipelines/KEY.json` and `pipelines.jsonl`; returns a machine outcome. Does not merge the task PR into its base",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/prep-brief.mjs",
      "sha256": "3503dfc321a9f929ca6549a24b5c047f25c30dfbdb2efaba8f3a4ebc4c467258",
      "category": "command",
      "referenceSummary": "`--task KEY --spec FILE --base BRANCH`; `--notes`, `--out`, `--model`, `--budget`, `--keep` | Fetches the base, uses a detached worktree and lean read-only model to write a six-field brief or NOT READY. Writes `prep.jsonl`. **No standalone `--dry-run` option** in this snapshot",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/probe-providers.mjs",
      "sha256": "55978f19a460e2dd4ad591c4d46182bd4c1ead49778922a2d866f6e706ad1008",
      "category": "command",
      "referenceSummary": "`--provider openrouter`, `deepseek` or `all`; optional `--model` | Sends tiny real model requests for configured providers, nominal $0.05 stage caps. **Paid maintenance probe**, especially after CLI upgrades; not an offline compatibility test",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/providers.mjs",
      "sha256": "4ff82ae8bb07da73cd746e969655241aae5bcc1d49a0141d69d270d91c6321c5",
      "category": "support-module",
      "referenceSummary": "Prefix parsing, provider endpoints/key mapping, price lookup, token/cost conversion and CLI price-basis checks; OpenRouter catalog caching is an I/O operation",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/read-guard.mjs",
      "sha256": "3d881daec27b0a34a1cdfcb6253df0867812272df9ba9ce851ec7761d7dae7c9",
      "category": "hook",
      "referenceSummary": "Claude Read hook: requires bounded reads for large files, up to 150 lines. Applies to that tool, not every way to read a file; parse/read errors can allow the operation",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/readonly.mjs",
      "sha256": "2759a76ac9f9b18f57c496994b9bd366695709162efdebc2cadba03cfb09fdc5",
      "category": "support-module",
      "referenceSummary": "Prep/review prompts, read-only tool lists, credential scrubbing, sensitive-path selection, spec facts, diff packing and verdict helpers",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/review-conditions.mjs",
      "sha256": "3dcad8924b5ca3bf790d3a30ad6d4b1c9ab2cab62c94b8df4607a04f5f66f121",
      "category": "support-module",
      "referenceSummary": "Strict CONDITIONS parsing and command allowlist; malformed/unmatched/fix/human conditions cannot be silently accepted",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/review-pr.mjs",
      "sha256": "9e7c7549983ad7a2bd906df89046747d79c4e9a73dd0b3d3f09b90034be5cd87",
      "category": "command",
      "referenceSummary": "`--pr N`; `--acceptance FILE`, `--model`, `--budget`, `--max-diff-lines`, `--deep`, `--sha`, `--verify-file`, `--dry-run`, `--force`, `--keep` | Collects PR metadata, diff, CI and threads before a fresh model review. Pins the head; emits MERGE, MERGE AFTER or DO NOT MERGE and conditions. Writes `reviews/N-SHA.md` and `reviews.jsonl`. Ordinary reviews can omit oversized diff chunks; deep review inspects wider feature/invariant scope",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/review-spec.mjs",
      "sha256": "a2da61a2c83b9e6539d325536d406cbde1acd6bdf8e667f494990fa6e8280677",
      "category": "command",
      "referenceSummary": "Repeated `--spec FILE`, required `--base BRANCH`; `--model`, `--budget`, `--dry-run`, `--force` | Checks source facts and asks a fresh reviewer for READY, FIX SPEC, SPLIT or NEEDS HUMAN. Caches by spec basename/content hash; writes `spec-reviews/*.md` and `spec-reviews.jsonl` on review",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/run-plan.mjs",
      "sha256": "9ffc4e2743eff93342ffff4ea4bc3731197caea63fca1786c4f622db7d11dc05",
      "category": "command",
      "referenceSummary": "`--plan FILE`; `--parallel` 1\u20134, `--cap`, repeated `--coordinator`, `--resume`, `--dry-run`, `--apply`, `--auto-fix` | Orders parts by dependencies, checks spec/spend gates, runs pipeline, deep review and landing. Saves `plans/NAME/state.json`, `ESCALATIONS.md`, `run.log`, `notify.log` and decisions. Resume requires the same plan hash and fix mode",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/run-queue-lib.mjs",
      "sha256": "ff0123ff0da7719fa1302371e480e4826ad229d2b265e190e31c7facbd124d4b",
      "category": "support-module",
      "referenceSummary": "Queue validation, task-key normalization, claim fields, human-gate parsing, outcome-to-status fields and summary formatting",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/run-queue.mjs",
      "sha256": "5ebd1272e0c5853dbdfaba605e8a65313ca49e9b17705d5d22fcbf6c1633a244",
      "category": "command",
      "referenceSummary": "`--queue FILE`; `--parallel`, `--stagger`, `--claim-wait`, `--owner`, `--dry-run` | Re-reads selected backlog tasks, checks exact spec content and environment, claims by write/wait/re-read, launches pipelines and writes outcomes while the lease is still its own. Leaves `queue/RUN/summary.{md,json}` and child logs. `--no-spec-gate` exists but weakens the readiness check",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/run-task.mjs",
      "sha256": "80f4a9f5e77e67d7564cd9cbaf6791745bc4b7c4c7e04a3f78f9baa3b3e77f13",
      "category": "command",
      "referenceSummary": "`--task KEY --brief FILE --base BRANCH`; `--model`, `--soft`, `--hard`, `--recovery`, `--reserve`, `--from`, `--new-attempt`, `--dry-run`, `--full`, `--mcp-config` | Validates budget and repeat-attempt policy, creates an isolated `pilot/KEY` worktree, starts one worker, records attempts in `ledger.jsonl`. Claude can run one handoff-only recovery; Codex cannot. Authorized normal worker publication opens a draft PR on its task branch",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/spec-gate.mjs",
      "sha256": "7c2f64a02902656cae3f361e88efb42665ec8a339c4e673d8a19ec7fe3ab0dd9",
      "category": "command",
      "referenceSummary": "`accept --spec FILE --by IDENTITY`; optional `--pilot-dir` | Records ACCEPTED for a reviewed spec's coordinator patch. Requires the specific patch marker and a prior matching prefix review. Any later content edit invalidates the gate; it does not substitute for human acceptance of product decisions",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/spend.mjs",
      "sha256": "f07268629e900d0ca4e2bcf6bdafc77303b1c5df8321c03df71b656cab99a74c",
      "category": "command",
      "referenceSummary": "`--since DATE`, `--session ID`, repeated `--coordinator ID`, `--projects-dir DIR`, `--cap USD`, `--json` | Totals recorded stage ledgers and selected Claude helper/coordinator usage. A cap breach exits 3; a missing selected coordinator transcript also blocks a cap check. Without coordinator IDs, those sessions are not counted. This is scoped accounting, not a complete bill",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/stage.mjs",
      "sha256": "2ded10325046cfde5028b0d7047131f1a229b7044e0bc4dbcec45b8b52ac054d",
      "category": "support-module",
      "referenceSummary": "Shared process runner and provider dispatch; streams Claude events, deduplicates usage counters, measures context/tools, creates/removes detached worktrees and links build artifacts",
      "sourceIncludedInBundle": false
    },
    {
      "path": "scripts/ai-pilot/team-memory.mjs",
      "sha256": "a15dc833741b9586eae8062e6aa96c617a6a944fd294d1a78697ebe437296913",
      "category": "support-module",
      "referenceSummary": "Config lookup and task-record count/update/note requests. It implements the queue's REST calls, not atomic compare-and-swap claims or session-to-session messaging",
      "sourceIncludedInBundle": false
    }
  ],
  "configurationFiles": [
    {
      "path": "scripts/ai-pilot/GUARDRAILS.md",
      "sha256": "334a0a159e89fbb92e33430b1e439fde14f62d73d03d250d876069e39d4c50e1"
    },
    {
      "path": "scripts/ai-pilot/README.md",
      "sha256": "b262bf81d56ee1b249008649d1640518016ada2247ab9d633670b01f4f27fce7"
    },
    {
      "path": "scripts/ai-pilot/env-profiles.example.json",
      "sha256": "b3d5c0509f59d238d6606b45d03bbc939591f45e40986203c7bb34701c13ee28"
    },
    {
      "path": "scripts/ai-pilot/examples/plan.example.json",
      "sha256": "444c53b538d1a8188e6ae0993374f827d92bfcac752b41372b47231405c37919"
    },
    {
      "path": "scripts/ai-pilot/examples/specs/part-a.md",
      "sha256": "c148ade21e066d5afddb21ffbfd7c85a0f629452d48aa38cb33a4d0441674441"
    },
    {
      "path": "scripts/ai-pilot/examples/specs/part-b.md",
      "sha256": "992ee3ff5de3241d206ca2ba7ccaeabec1e2df307bb7870906ac9e960102192c"
    },
    {
      "path": "scripts/ai-pilot/land-pr.pg-suites.json",
      "sha256": "2977a5e0fe858136950892fba8093ebd679fe12ca940b782a5f1fdc91c895a22"
    },
    {
      "path": "scripts/ai-pilot/prices.example.json",
      "sha256": "019d7c2b652596426f9eb8d05e6f9c2a888788bcc6406192be4116b051841167"
    }
  ],
  "verification": "Source inspection only; no live task, provider probe, review request, board write, merge or deployment"
}
