cross-source-review
Skill1 starsChanged 3 months agoApache-2.0View on GitHub
cross-source-review — a same-family (同源, fresh-context) + different-family (异源) cross multi-round review engine that drives a doc-shaped artifact to SUBSTANTIVE convergence. Use it when a high-quality document needs adversarial cross-source review to convergence — "cross-review this requirements doc", "converge this design doc", "异源 review this spec/wiki page", "drive 同源+异源 review on this artifact". Produces a converged artifact + an honest convergence-record. NOT for code review (route to parallel-development), spec/arch-design authoring (blueprint-crafting), or research gathering (blueprint-crafting researcher). Does NOT judge whether the doc is "right" (outcome-axis — human). Phase A activation is EXPLICIT invocation (`/cross-source-review`); auto-routing is deferred.
- Reads credentials
In this repository5 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- blueprint-craftingSkill
- parallel-developmentSkill
- primary-source-verificationSkill
- prior-art-searchSkill
The file
Files
Cross Source Review
Drives same-family (same-family, fresh-context) + different-family (different-family, different-family) LLM cross multi-round review to substantive convergence on doc-shaped artifacts — a requirements input before blueprint-crafting, a design doc, a wiki page. It is the missing convergence layer upstream of blueprint-crafting (which is process-axis, same-family only) and reusable externally (e.g. fedaot wiki review).
Core Positioning
Substantive convergence, not zero-finding
A persistent adversarial reviewer always finds finer citation flaws; demanding zero findings loops forever. Substantive convergence = the core claims are coverage-verified AND no new BLOCKER-class finding appears for ≥2 rounds. Advisory findings never block (workspace rule 4). Caps bound the loop; cap-hit escalates to the human, never silent-pick (pd ADR #40 (e)).
Process-axis, not outcome-axis
The skill converges a doc's PROCESS-AXIS quality (well-formed, internally consistent, citation-accurate, coverage-complete). Whether the doc captures the RIGHT requirement is OUTCOME-AXIS — human only. The convergence-record carries substantive_converged (process) and never claims outcome correctness.
Same-family primary; different-family additive
The same-family leg (fresh-context, same family) is PRIMARY and always runs. The different-family leg (cross-family, e.g. DeepSeek) is an opt-in adversarial second opinion that catches same-family blind spots. Both legs are read-only and barred from outcome-axis judgment.
Scope
- In: drive same-family + different-family cross multi-round review of a doc-shaped artifact to substantive convergence; emit the converged artifact + a convergence-record.
- Out: code review (
parallel-development); spec/arch-design authoring (blueprint-crafting); research gathering (blueprint-craftingresearcher); outcome-axis judgment (human).
Scope Guard (entry-time detection)
- Deliverable is source/test code, or a code diff under review → route to
parallel-development. - Deliverable is authoring/rewriting a spec, arch-design, iteration-plan, or research → route to
blueprint-crafting. - The request is "is this the right requirement / right conclusion?" → outcome-axis, human only.
The guard is soft (remind + route, not refuse). Phase A relies on explicit invocation (/cross-source-review); the 3-way trigger_check activation partition is DEFERRED to maturation (proposal §9 Q4) — explicit invocation minimizes, but does not zero, routing collision, which is why a Scope Guard still ships.
Quick Start
You are the orchestrator. The legs are read-only agents/subprocesses; the driver alternates them. Run in order; do not wait for the user between rounds.
Act from this Quick Start — don't reverse-engineer the legs. The protocol is this section; the legs are INVOKED, not read: spawn solidforge:doc-reviewer (its system prompt is its own — do NOT open agents/doc-reviewer.agent.md); spawn solidforge:web-claim-verifier at reconcile moments under the step-2 spawn condition (likewise — do NOT open its agent file); run hetero_doc_review.py (the different-family leg — throughout this skill, the hetero_* code prefix names the different-family substrate) via the step-2 CLI (do NOT read its source — the CLI is the contract). Do not hand-validate the schemas — converge.py does that; you pass each leg's findings to it. Open references/install.md ONLY on a first run in a new project if the provider token/profile is not already clear from the env. The different-family leg's provider(s) are selected by the wrapper from HETERO_DOC_PROFILE (settable in <cwd>/.env.solidforge; comma-list = dual-different-family; default deepseek) — do NOT pass a hardcoded --profile. Each profile's token is its <NAME>_ANTHROPIC_AUTH_TOKEN env var (e.g. DEEPSEEK_ANTHROPIC_AUTH_TOKEN) — the SOLE source for that profile; do NOT look for or set <NAME>_API_KEY (namespace isolation — the _ANTHROPIC_AUTH_TOKEN suffix scopes the credential to this substrate; see install.md). The wrapper self-loads <cwd>/.env.solidforge then <cwd>/.env (shell wins) before reading the token, so a token set in .env.solidforge is absent from the shell env — do NOT preflight the token via echo $VAR / os.environ (a false negative); run the step-2 wrapper directly, which fail-fasts with a clear error if the token is genuinely missing.
- Frame — identify the artifact under review + its authoritative reference (a source doc, or "self-contained / no external authority"). Enumerate the core claims (the load-bearing assertions each leg must verify — the coverage-verified prong checks these; omit them and that prong is vacuously true). Declare the size tier: short (cap=2) for a single-section / few-claim doc; long (cap=5–7) for a multi-section doc (heuristic: ≥~5 sections or ≥~300 lines — orchestrator judgment, stated in the record). Then open the run-progress sidecar (see the section below): append
run-start(artifact / tier / cap) — this append also atomically pointsruns/LATESTat the new run dir (best-effort; the single-active-run convenience — under concurrent sessions another run'srun-startre-points it). ALSO state the run-dir path in the conversation AT Frame (minute-0 self-identification; the conversation is the session-scoped pointer no other session can steal, ADR #69). - Round loop (same-family ↔ different-family, orchestrator-driven) — each round:
- Run the same-family leg — spawn
solidforge:doc-reviewerFOREGROUND (a fresh, independent context; it returns a doc-findings object; never a background spawn — the subagent's own streamed activity IS the in-leg report, the same-family counterpart of the different-family execution stream; no polling and no sidecar narration during this leg, ADR #69). Appendsame-family-spawnbefore andsame-family-complete(with the findings count) after (run-progress sidecar, below). THEN persist the returnedexecution_trace(the reviewer's between-step narration lines, per its narration discipline) as<run-dir>/round<k>-same-family.stream.jsonlviacsr_progress.py trace-append --file <run-dir>/round<k>-same-family.stream.jsonl --entries <json-array>— the POST-HOC distilled execution record, same format + samestreamrenderer as the different-family log (ADR #69; absent trace → skip silently, it is optional in the schema). - Web-grounded claim verification (the web-claim-verifier spawn condition) — at each reconcile moment, when a finding whose EVIDENCE — or whose
rejectedrationale — cites an external, FETCHABLE claim (fetchable = the claim names or cites an identifiable source — a URL, a standard/doc, a versioned product behavior — that a web fetch can retrieve; purely interpretive findings are not fetchable and take no spawn), and the finding's disposition is headed tofixedorrejected, spawnsolidforge:web-claim-verifier(fresh context, read-only; its contract is its own — do NOT openagents/web-claim-verifier.agent.md) BEFORE recording that disposition — bounded per reconcile moment (two moments per round — a round's composed ceiling is 4): at most 2 spawns per moment, highest-severity findings first; un-spawned claims carry the finding's own evidence and surface in the convergence-record's coverage notes (never silently skipped).escalatedfindings are already human-bound — no fetch spent (a fetch cannot change their destination). The spawn prompt: the finding's claim text + its defect_id (passed as the verifier's caller-supplied claim_id; stateclaimmode explicitly) + the cited URL or named source (+ optional version/scope context). The returned verdict block's quote/URL/date drops into<run-dir>/evidence/and the disposition rationale cites it; if the verdict carries anexecution_trace, persist it viacsr_progress.py trace-append --file <run-dir>/verify-<claim_id>.stream.jsonl --entries <json-array>— the spawn's post-hoc distilled execution record, same format + samestreamrenderer as both legs' logs (absent trace → skip silently; ADR #69). - Reconcile: revise the artifact per accepted findings, or reject a finding with rationale. RECORD each finding's disposition at reconcile time (the producing step for the record's per-round dispositions — fix A):
fixed= accepted, artifact revised;rejected= declined, with rationale (incl. coverage disclosures — not defects, carried in coverage notes);escalated= different-family-only findings, escalating to the human (the skill's only named escalation target). Appendreconcile(fixed / rejected / escalated counts) to the sidecar at each reconcile. - Run the different-family leg — from the project root (the wrapper reads
<cwd>/.env.solidforge), launchpython3 "${CLAUDE_PLUGIN_ROOT}/skills/cross-source-review/infra/scripts/hetero_doc_review.py" --artifact <doc> --authority <ref-or-empty> --prior-findings <round-json> --round-index <k> --progress-file <run-dir>/progress.jsonl 2>>"<run-dir>/wrapper.stderr"as a BACKGROUND task (run_in_background; stderr — heartbeat lines, already tee'd to the progress file (ADR #61), plus pre-leg fail-fast diagnostics — is captured to<run-dir>/wrapper.stderr, keeping the task's output file a pure result JSON) on the revised artifact (fed the same-family findings as prior, so it hunts the gap, not restatements) → doc-findings. Do NOT pass--profile— the wrapper resolves the provider(s) fromHETERO_DOC_PROFILE(loaded from<cwd>/.env.solidforge, shell wins; comma-list = dual-different-family; defaultdeepseek); a hardcoded--profilesilently drops every other configured provider. Pass--round-index <k>with the current round (if you forget, the wrapper derives it from the prior-findings JSON'sroundfield — but pass it: the sidecar's round labels are only as good as this value). Use the absolute path; do NOTcdinto the skill dir — cwd must stay at the project root or the token will not resolve. While it runs, do NOT block silently (ADR #62): poll the background task roughly every 2 minutes (e.g. a foregroundsleep 120between status renders); at each poll render ONE narration line to the conversation from the sidecar (csr_progress.py status <run-dir>, condensed — round k/cap · phase · findings · idle). The FIRST narration of each different-family leg must ALSO hand the human the on-demand watch pointer — the zero-interaction channel advertises the interactive one (observability-affordance, 2026-09-07, re-scoped ADR #69): ONE line printing THIS session's own run dir + its watch commands — the<run-dir>path,csr_progress.py stream <run-dir> --watch 5(the RENDERED execution stream: reviewer prose + tool calls in human form),tail -f <run-dir>/progress.jsonl, and the raw escape hatchtail -f <run-dir>/round<k>-*.stream.jsonlfor the wrapper-distilled execution stream (ADR #69; the conversation is the session-scoped pointer —runs/LATESTis only the single-active-run one-linercsr_progress.py status workspace/cross-source-review/runs/LATEST --watch 5, and the all-runs view iscsr_progress.py status workspace/cross-source-review/runs/ --watch 5); subsequent condensed lines omit it. The CC task-manager view stays empty until the result JSON lands (stdout purity, ADR #62) — the sidecar watch is the ONLY live view on this substrate, so the pointer is not optional. Narration lines are ordinary assistant text — they stream to the user live, which IS the zero-interaction status report. When the task completes, parse the result JSON from the task's output file (stdout carries ONLY the result, withprovider_runs[]stamped in it); if it exited non-zero with EMPTY stdout, read<run-dir>/wrapper.stderrfor the cause (a pre-leg fail-fast: missing token / unknown profile). Where the harness lacks background execution, a synchronous call is the documented fallback — in that mode the stderr heartbeat lands in the tool result; treat those lines as progress, not errors (ADR #52) — then continue the round loop. - Reconcile again — the web-claim-verifier spawn condition above applies at THIS reconcile moment too (same trigger, same ≤2-per-moment cap). Apply the per-round reconciliation table (both-report→adopt; same-family-only→adopt; different-family-only→escalate; neither→pass; DEGRADED→adopt same-family).
- Run the same-family leg — spawn
- Convergence judgment — substantive_converged when core claims are coverage-verified AND no new Blocker for ≥2 rounds. If the cap is hit without convergence →
adversarial-stalemate, escalate to human (never silent-pick). Verify each leg's factual/citation claims against source independently — do not blind-trust either source. Appendround-end(round / new_blockers) after each round, andrun-end(outcome: converged or adversarial-stalemate or cap-hit or aborted) at the terminal judgment (run-progress sidecar, below). - Emit — the converged artifact + a
convergence-record(infra/schemas/convergence-record.schema.json): rounds — each carrying the reconciled findings AND their per-finding dispositions, so a reader can list what was found and what was done about it (retention fix A; the counts-only record is obsolete) —substantive_converged, coverage notes, stalemate flag.
The pluggable seam: the driver takes findings-schema as a parameter (default doc-findings; a future code-shaped caller passes violation-log) and the same-family leg as a callback (default solidforge:doc-reviewer). This keeps a future code-domain caller a thin adaptation, not a rewrite (proposal §3).
Run-progress sidecar (ADR #61) — external live observability
A csr run is externally observable end to end: at Frame, create a run dir workspace/cross-source-review/runs/<stamp>-<slug>/ (gitignored, workspace rule 11) and append ONE JSONL event per state boundary via csr_progress.py append --file <run-dir>/progress.jsonl --type <t> [--field k=v ...] (strict registry — unknown type or field exits non-zero; bool/int/float coerced). An outside observer then watches live — tail -f <run-dir>/progress.jsonl, or csr_progress.py status workspace/cross-source-review/runs/LATEST [--watch 5] for a one-screen render (the run-start append atomically keeps runs/LATEST pointed at the current run — the stable path a human can type from memory) (round k of cap, phase + last-event age, leg + reconcile totals, terminal state). Torn last lines are counted, never fatal. The orchestrating session itself is the FIRST consumer: during each different-family leg it renders one condensed status line to the conversation per ~2-minute poll (step 2) — zero-interaction in-session reporting (ADR #62); during a same-family leg no polling happens (the foreground subagent's own streamed activity is that leg's report — the orchestrator's turn is blocked while it runs, ADR #69). status also accepts the RUNS DIR itself (csr_progress.py status workspace/cross-source-review/runs/ [--watch 5]) — one labeled block per active run, the all-runs view for concurrent sessions (ADR #69).
Event vocabulary (single-sourced with csr_progress.py EVENT_REGISTRY — the self-gate blocks drift in either direction):
run-start— artifact / tier / cap (+authority) — writer: orchestrator, once at Framesame-family-spawn— roundsame-family-complete— round / findingshetero-leg-start— round / provider — writer: the WRAPPERhetero-heartbeat— provider / elapsed_s / model / idle_s / stream_bytes / events / assistant_events / killed — writer: the WRAPPER (stream mode, every 30s)hetero-leg-end— round / provider / outcome: ok or degraded or malformed (+findings / model / elapsed_s / degraded) — writer: the WRAPPERreconcile— round / fixed / rejected / escalatedround-end— round / new_blockersrun-end— outcome: converged or adversarial-stalemate or cap-hit or aborted (+rounds)
Best-effort contract: a failed progress append NEVER aborts the review — note it in the convergence-record coverage notes and continue. Pass --progress-file <run-dir>/progress.jsonl on every wrapper invocation; the wrapper appends its own leg + heartbeat events there (its stderr heartbeat, ADR #52, is unchanged).
Authority Chain
docs/proposal.md= authoritative design (master; SUBSTANTIVE-CONVERGED).docs/iteration-plan.md= execution blueprint (Phase A work-items CSR-I0–CSR-I6).docs/proposal.convergence.md= the proposal's own cross-review trail (the skill dogfooded on its own design).
Coordination with blueprint-crafting / parallel-development
primary-source-verification(psv) is the outcome-axis additive layer (per-claim fetched-source verification). GATE MODE: when rule-13 conditions hold, psv runs FIRST as a load-bearing-claims gate (GO/NO-GO batch signal; the gate record is NOT a coverage record); its load-bearing list becomes this skill's core-claims frame; the authoritative full-M psv record follows this skill's convergence. See the psv SKILL.md.blueprint-craftingstays PURE (process-axis, same-familyplan-reviewer, deterministic inner ring). It MAY call this skill for a different-family outer pass on its draft — calling a skill, not importing code.parallel-developmentowns code review. The different-family substrate here is a copy-PATTERN of pd'sinfra/scripts/hetero_review.py(workspace rule 7 — self-contained deployability; proposal §5 — Phase-B copy-vs-share is evidence-gated, NOT pre-committed); the function-signature contract is preserved + divergences logged for Phase-B viability.- Phase-A coordination note: the bc/pd routing + call relationships above are CSR-side design intent. The reciprocal bc/pd Scope-Guard hints are DEFERRED per proposal §7 / Q4 (Phase A is explicit-invocation only); a reader following these claims into bc/pd will not yet find them mirrored there.
files_touchedboundary: this skill ownscross-source-review/. It does not modify bc or pd. Phase B (pd adopting this substrate: B1 import / B2 copy / B3 shared-lib) is evidence-gated and out of Phase-A scope.
Self-Checks (Definition of Done)
A skill change is not done while any self-check fails (workspace rule 1). Run before commit:
python3 skills/cross-source-review/infra/test/disconnect_check.py # structure + loading-chain
python3 skills/cross-source-review/infra/test/plugin_layout.py # plugin.json + hooks.json + agents well-formed
python3 skills/cross-source-review/infra/test/findings_shape_check.py # every leg emit path produces a doc-findings-valid object (mirror adapter_shape_check)
python3 skills/cross-source-review/infra/test/hetero_doc_guards.py # different-family substrate guards: max-turns argv, streamed telemetry + heartbeat, byte-cap, wall-clock kill (ADR #52)
python3 skills/cross-source-review/infra/test/csr_progress_gates.py # run-progress sidecar + narration contract: registry sync, append shape, status render, wrapper tee, step-2 background narration (ADR #61/#62)
python3 skills/cross-source-review/infra/test/convergence_policy_check.py # offline caps + stalemate + reconcile + core-claims-coverage round-trip (mirror hetero_review_wiring)
python3 skills/cross-source-review/infra/test/lint_self.py # dogfood: lints this skill's own infra (ruff)
python3 skills/cross-source-review/infra/test/dogfood.py # runs the skill's own convergence loop on its own SKILL.md (skips gracefully when no API tokens; recorded log substitutes)Reference Files
- proposal.md — authoritative design (the 3-skill inventory, non-goals, Phase-A ownership, Phase-B landing points, the §9 locked decisions).
- iteration-plan.md — Phase-A execution blueprint (CSR-I0–CSR-I6, DoD, DAG, risks).
- install.md — provisioning: the one token var,
.envresolution, adding a custom provider profile + the token-var naming rule. csr is env-armed (no arm command — its gates are self-gates).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

