@adlc/parallax

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

Measured-ambiguity interrogation via sampling diversity — fan N completions, surface only the divergences (D3).

原始使用文档
文档目录13 节
  1. Modes
  2. SPEC MODE (default)
  3. EDGE MODE
  4. ROUTE MODE (ambiguity router)
  5. Flags
  6. Exit codes
  7. What a verdict requires
  8. Report format
  9. JSON output ( --json )
  10. Ambiguity score
  11. Relationship to sibling tools
  12. Recording the operator's prompt-only verdict
  13. Core gaps

@adlc/parallax

Measured-ambiguity interrogation for feature requests, ticket edge contracts, and mid-build routing questions. Replaces single-model introspection with sampling diversity as an instrument: fan N independent cheap-tier completions, diff the readings, surface only the divergences as multiple-choice questions.

ADLC phase: D3 — Measured Ambiguity


Modes

SPEC MODE (default)

Fan N independent readers over a raw feature request. Each commits to one reading and outputs a structured spec. A mid-tier completion diffs the readings into an agreement set (draft spec) and divergences (questions only humans can answer). An ambiguity score gates the output.

parallax --request "text"
parallax --file req.md
echo "feature request" | parallax

EDGE MODE

Fan N agents over two adjacent tickets in the development DAG. Each independently authors the interface/contract implied between them. Same divergence analysis gates whether the edge contract is safe to speculate on.

parallax --edge T1 T2
parallax --edge T1 T2 --tickets path/to/tickets.json

ROUTE MODE (ambiguity router)

Fan N agents to answer a question given optional context files. A judge completion decides whether the answers are semantically equivalent. If yes, print the answer and exit 0. If no, print multiple-choice divergences and exit 2.

parallax --route "question"
parallax --route "question" --context spec.md --context arch.md

Flags

FlagDefaultDescription
--request <text>—Spec mode: feature request inline
--file <path>—Spec mode: feature request from file
--edgefalseEdge mode: follow with two ticket IDs as positionals
--route <text>—Route mode: question to route
--context <file>—Route mode: context file (repeatable)
--context-cap <n>6000Route mode: max chars embedded per --context file (tail-biased). A file over the cap is marked truncated in-prompt.
--tickets <path>.adlc/tickets.jsonTickets file for edge mode
--n <int>3Fan width (number of independent readings). Minimum 2 — one reading cannot be compared against another.
--allow-partial-fanfalseAccept a verdict computed from fewer readings than --n requested. Off by default: a narrowed sample biases the score toward a pass.
--threshold <0-1>0.25Ambiguity score gate threshold
--tier cheap|mid|frontiercheap for fan, mid for divergenceOverride LLM tier
--jsonfalseMachine-readable output (score + divergences)
--prompt-onlyfalsePrint exact prompts, exit 0 — no API key needed
--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 (all three modes). Requires --ticket.
--ticket <id>—Ticket this run is evidence for. Required with --record-verdict — an unbound record can satisfy any ticket's P1 gate.

--context file content (route mode) and ticket titles and bodies (edge mode) are repository-controlled — anyone who can open a PR against this repo, or add a ticket, controls them — and the fan's readings and answers are model output derived from that text before a judge reads them. All of it is treated as untrusted data: they are wrapped in an unguessable fence before being embedded in a prompt, with a standing directive telling the model the fenced content is data to analyze, never an instruction to follow, even if it reads like one.


Exit codes

CodeMeaning
0Gate passes — ambiguity score ≤ threshold (spec/edge), or answers equivalent (route)
1Operational error — bad input, missing file, network failure, insufficient readings, a shrunken fan without --allow-partial-fan, or an off-schema divergence or route judge payload
2Gate fails — ambiguity score > threshold (spec/edge), or answers diverge (route)

What a verdict requires

parallax refuses to certify a reading it did not actually take. Three guards, all operational errors (exit 1), never a score:

  • Off-schema divergence payload. The mid-tier divergence call is asked for {agreements: [...], divergences: [...]}. A refusal object, a truncated {}, a bare array or a {result: ...} wrapper used to fall through to "zero divergences, zero agreements", which scores 0 and passes the gate — an unanalysed spec reported as unambiguous. Such a payload is now refused.
  • Off-schema route judge payload. The route equivalence judge is asked for {equivalent: boolean, answer, variants}. equivalent must be a real boolean (a string such as "false" is refused, not coerced), an equivalent verdict must carry a non-empty answer, and a non-equivalent one at least one string variant. Anything else is refused rather than reported as a pass (with --questions-json, an empty frontier) or as an unmeasured divergence.
  • Shrunken fan. The score is measured across --n independent readings, so a fan narrowed by rate limits, timeouts or unparseable JSON measures a smaller sample and scores systematically LOWER — it biases toward a pass. When fewer readings survive than were requested, the verdict is refused unless --allow-partial-fan is given. requested and used appear in both --json and --questions-json so a machine consumer can see the effective width instead of having to notice a warnings entry.

--n 1 is rejected at parse time: one reading can never be compared against another, so it could only ever spend an API call on the way to an error.


Report format

SPEC / EDGE mode output:

## Agreement set (draft spec)
- <thing all readings agreed on>
- ...

## Divergences — answer these
**Q1: <ambiguous point>**
  A) <reading 1's choice>
  B) <reading 2's choice>

---
**Ambiguity score:** 0.33 (threshold 0.25) — gate FAILS ✗

ROUTE mode output (equivalent):

<The single consensus answer, printed directly>

ROUTE mode output (divergent):

## Route conflict — answer required

**Question:** <question>

**Interpretations:**
  A) <variant 1>
  B) <variant 2>

JSON output (--json)

Spec/edge:

{
  "mode": "spec",
  "agreements": ["..."],
  "divergences": [{"point": "...", "options": [{"label": "A", "reading": "..."}]}],
  "score": 0.33,
  "threshold": 0.25,
  "gate": false,
  "requested": 3,
  "used": 3,
  "warnings": []
}

Route:

{
  "mode": "route",
  "question": "...",
  "equivalent": false,
  "answer": "",
  "variants": ["option A", "option B"],
  "requested": 3,
  "used": 3,
  "warnings": []
}

Ambiguity score

score = divergences / (divergences + agreements), rounded to 2 decimal places.

  • 0.00 = perfect convergence (nothing to ask)
  • 1.00 = total divergence (no agreement at all)
  • Default gate threshold: 0.25

The score is the key output: a spec that converged at N=5 with score 0.00 is a measurably safer artifact than any single-model pronouncement of completeness.


Relationship to sibling tools

  • grill-me — predecessor; interrogation by introspection (single context, sequential). parallax replaces it with measurement.
  • spec-lint (C1) — can gate on the ambiguity score that parallax emits.
  • model-router (D2) — uses edge contracts that parallax --edge validates before speculative execution.
  • flail-detector — triggers parallax --route mid-build to route builder questions through the machine before escalating to humans.

Recording the operator's prompt-only verdict

In Claude Code (and similar harnesses without a bare API key) --prompt-only is how parallax is normally run: the tool prints the fan-out prompt(s), and the operator (the model itself) answers them and applies judgment. Without --record-verdict, that self-assessed verdict never enters the audit trail — only the fact that prompts were printed is observable. --record-verdict <file|-> closes that gap, in every mode (spec / edge / route): after printing the prompts 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.

# Spec mode
parallax --request "Add a login page" --prompt-only --ticket T1 --record-verdict verdict.txt

# Edge mode
parallax --edge T1 T2 --prompt-only --ticket T1 --record-verdict -

# Route mode
parallax --route "What is the retry policy?" --prompt-only --ticket T1 --record-verdict verdict.txt

--record-verdict requires --prompt-only and --ticket (exit 1 otherwise); the entry is bound to that ticket, because an unbound record could be replayed to satisfy any ticket's P1 gate. The recorded entry's gate is parallax, data.verdict holds the operator's text verbatim, and data.mode plus mode-specific context (tickets for edge, question for route, request for spec) identify what was analysed.

Spec mode + --record-verdict - gotcha: in spec mode, if the request text is also being read from stdin (i.e. neither --request nor --file was given), --record-verdict - can't be used — both would try to drain the same stdin stream, and the request read always runs first. Parallax detects this combination and exits 1 with a clear error rather than silently misreading input. Use --request/--file for the request text, or write the verdict to a file and pass --record-verdict <file> instead:

# Does NOT work: both request and verdict want stdin — exits 1 with an
# explanatory error instead of silently misreading input
echo "Add a login page" | parallax --prompt-only --ticket T1 --record-verdict -

# Works: request via --request, verdict via stdin
parallax --request "Add a login page" --prompt-only --ticket T1 --record-verdict -

# Works: request via stdin, verdict via file
echo "Add a login page" | parallax --prompt-only --ticket T1 --record-verdict verdict.txt

Core gaps

None. All required functions (fan, complete, extractJson, loadTickets, promptOnly, parseArgs, pass, gateFail, opError, printJson, readStdin) are present in @adlc/core. Recording prompt-only verdicts reuses @adlc/gate-manifest's record() directly (see lib/verdict.mjs) rather than reimplementing its hash-chain/signing logic.

版本与发布记录

@adlc/parallax 共发布 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/parallax 的常见问题

@adlc/parallax 是什么?

Measured-ambiguity interrogation via sampling diversity — fan N completions, surface only the divergences (D3).

如何安装 @adlc/parallax?

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

@adlc/parallax 支持 TypeScript 吗?

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

@adlc/parallax 支持 ESM 还是 CommonJS?

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

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

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

@adlc/parallax 可以商用吗?

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

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

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

@adlc/parallax 还在维护吗?

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