@adlc/coldstart

中文文档
1.12.0发布于 2026/10/10MITES Module构建来源已验证近 30 天下载 8253

Ticket executability gate (P2) — a cheap-tier LLM checks whether a ticket is self-contained before a build agent starts.

原始使用文档
文档目录12 节
  1. Usage
  2. Options
  3. Exit codes
  4. Verdict shapes — what counts as "readable"
  5. Examples
  6. Caching
  7. Recording the operator's prompt-only verdict
  8. What counts as a gap?
  9. JSON output schema
  10. Provider configuration
  11. ADLC phase served
  12. Core gaps

coldstart — ADLC P2 Ticket Executability Gate

Checks whether a ticket is fully self-contained before a build agent touches it. A cheap-tier LLM plays the role of a fresh agent with no prior context and lists every question it would have to ask a human before it could start executing. Empty gap list → gate passes (exit 0). Non-empty → exit 2 with gaps per ticket.

This is ADLC phase C3 / P2 — the last check before a ticket enters the build queue. Pennies per ticket; catches the #1 cause of build-phase flailing.


Usage

coldstart <ticket-id> [options]
coldstart --all     [options]

Options

FlagDefaultDescription
--tickets <path>.adlc/tickets.jsonPath to the tickets file
--alloffRun the gate on every ticket in the file
--offlineoffRun deterministic offline schema and input contract validation without calling an LLM or requiring API keys
--forceoffBypass the cache entirely and re-audit every target ticket
--max-age <days>30Treat a cached verdict older than this as stale; 0 treats every cache entry as stale
--prompt-onlyoffPrint the exact prompt(s) and exit 0 — no LLM call made
--record-verdict <file|->—With --prompt-only: read the operator's answer from <file> (or stdin when -) and record it into .adlc/manifest.jsonl via gate-manifest — see below
--jsonoffMachine-readable JSON output for orchestrators

Exit codes

CodeMeaning
0Gate passes — ticket(s) are fully executable
1Operational error — bad input, unknown ticket id, missing file, no provider
2Gate fails — one or more tickets have gaps

Verdict shapes — what counts as "readable"

The auditor is asked to reply {"gaps": [...]}. A bare array ([{"what": …, "why_blocking": …}] — the most common model deviation) is accepted as the gaps list, and a string entry is wrapped as {"what": "<text>", "why_blocking": "unspecified"}. Anything else is not a pass: {}, {"result": "ok"}, {"blockers": [...]}, {"gaps": null}, {"gaps": "two gaps found"}, or an entry without a string what makes coldstart exit 1 with coldstart: unreadable executability verdict — … — the tool could not read the verdict, so it reports an operational error, records nothing, and never caches. A previously cached entry whose stored gaps is not a readable list is skipped rather than served as a hit (issue #594). The ADLC_GATE_MOCK_RESPONSE test seam follows the same rule: an unparseable or shape-deviant mock is exit 1, not [].


Examples

# Check a single ticket
coldstart T1

# Check all tickets, output JSON
coldstart --all --json

# Print the exact prompt without calling an LLM (paste into any harness)
coldstart T1 --prompt-only

# Use a custom tickets file
coldstart T3 --tickets path/to/tickets.json

Caching

A real (non---prompt-only) audit records {ticketHash, model, gaps} into .adlc/manifest.jsonl after it runs. The NEXT run, for the SAME ticket, skips the LLM call entirely when it finds a matching entry: same ticketHash (the ticket's content is unchanged — editing anything about it produces a different hash) and same resolved model id (not just the same --tier — switching ADLC_MODEL_CHEAP invalidates the cache even though --tier cheap stays the same flag). A cached run reports "cached": true in --json output and (cached) in the human-readable report.

# First run audits for real and records the verdict
coldstart --all

# Second run, nothing changed: instant, no LLM calls
coldstart --all

# Force a fresh audit regardless of any cache entry
coldstart --all --force

# Don't trust anything cached more than a week ago
coldstart --all --max-age 7

Caching only applies to the real LLM path — --prompt-only (with or without --record-verdict) is unaffected, and the ADLC_GATE_MOCK_RESPONSE test seam never reads or writes the cache (a mocked verdict must never be able to shadow, or be shadowed by, a real one).


Recording the operator's prompt-only verdict

In Claude Code (and similar harnesses without a bare API key) --prompt-only is how coldstart is normally run: the tool prints the audit prompt, and the operator (the model itself) answers it and applies judgment. Without --record-verdict, that self-assessed verdict is never captured — only the fact that a prompt was printed is observable. --record-verdict <file|-> closes that gap: after printing the prompt(s) as usual, it reads the operator's answer from <file> (or stdin when -) and records it into .adlc/manifest.jsonl via @adlc/gate-manifest's own record() — reusing its hash-chaining/signing logic rather than reimplementing it.

# Operator writes their answer to a file, then records it
coldstart T1 --prompt-only --record-verdict verdict.txt

# Or pipe the answer straight from stdin
echo '{"gaps":[],"ticketHash":"<ticketHash from `adlc ticket show T1 --json`>"}' \
  | coldstart T1 --prompt-only --record-verdict -

--record-verdict requires --prompt-only (exit 1 otherwise). The recorded entry's gate is coldstart, data.verdict holds the operator's text verbatim, and data.ticketIds lists every ticket the prompt covered (useful with --all). The P0 gate (packages/runner/lib/assertions.mjs) further requires data.verdict to be JSON matching {"gaps":[...],"ticketHash":"…"} with an empty gaps array and a ticketHash matching the ticket's current definition — free-form prose (e.g. "PASS: no gaps found") records successfully but fails the P0 assertion as invalid JSON.


What counts as a gap?

The model is instructed that information derivable from the repo does not count as missing. Only genuine human-only questions are gaps:

  • Data shapes referenced but not embedded (e.g. "use the UserSchema" with no schema)
  • Contracts named but absent (edge points to a missing type file)
  • Acceptance criteria that cannot be mechanically verified
  • Vague scope ("improve", "clean up", "fix")
  • Unstated target files when they cannot be inferred from context

JSON output schema

{
  "ok": true,
  "results": [
    {
      "id": "T1",
      "pass": true,
      "gaps": []
    },
    {
      "id": "T2",
      "pass": false,
      "gaps": [
        { "what": "UserSchema", "why_blocking": "Shape referenced in body but not defined." }
      ]
    }
  ]
}

Provider configuration

The tool auto-detects the first available provider in order: ANTHROPIC_API_KEY → OPENAI_API_KEY → GEMINI_API_KEY.

Force a provider: ADLC_PROVIDER=openai. Override the cheap-tier model: ADLC_MODEL_CHEAP=claude-haiku-4-5.

Without a provider, the tool exits 1 unless --prompt-only is passed.


ADLC phase served

C3 / P2 — ticket executability gate. Runs after spec-lint (C1) and before the ticket enters the build queue. Part of the Cheap Wins cluster alongside C1 and C5 (rails-guard).


Core gaps

@adlc/core provides activeTickets to filter completed tickets (dropping them and stripping edges pointing to them, keeping the remaining DAG valid) when auditing open backlog. A by-id coldstart still uses the full set, so you can always audit a completed ticket you name explicitly. Everything else is available in @adlc/core: loadTickets, complete, extractJson, parseArgs, pass, gateFail, opError, printJson, promptOnly, detectProvider.

版本与发布记录

@adlc/coldstart 共发布 18 个版本,首次发布于 2026/06/14;过去 12 个月发布了 18 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.12.0latest2026/10/1027 天前
1.11.12026/09/091 个月前
1.11.02026/08/252 个月前
1.10.02026/08/112 个月前
1.9.02026/08/092 个月前
1.8.02026/08/082 个月前

关于 @adlc/coldstart 的常见问题

@adlc/coldstart 是什么?

Ticket executability gate (P2) — a cheap-tier LLM checks whether a ticket is self-contained before a build agent starts.

如何安装 @adlc/coldstart?

在项目目录运行 npm install @adlc/coldstart,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 coldstart,可以用 npx coldstart 直接运行。

@adlc/coldstart 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/adlc__coldstart 是否存在。

@adlc/coldstart 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@adlc/coldstart 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@adlc/coldstart 可以商用吗?

@adlc/coldstart 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@adlc/coldstart 的下载量有多少?

根据 npm 官方下载统计,@adlc/coldstart 在 2026/10/05 – 2026/11/03 这 30 天内被下载 8,253 次,日均约 275 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adlc/coldstart 还在维护吗?

最新版本 1.12.0 发布于 2026/10/10(27 天前);至今共发布 18 个版本,其中过去 12 个月发布了 18 个;首次发布于 2026/06/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。