Skip to content

Commit 030b803

Browse files
IMNMVclaude
andcommitted
Reviewer Zero: mandatory content-reasoning pass (Pass 5)
ClaudeR 0.12.3. The base auditing protocol was entirely tool-driven: value reconciliation, references, cross-references, and code recompute, with the content lenses living only in Referee Mode. A controlled benchmark on a synthetic manuscript showed the consequence: with the tools, a frontier model scored BELOW a native-tools baseline (16.8 vs 17.6 of 24), because the tool checklist crowded out the open critical read that catches reasoning defects (instrument misattribution, a reported test its data cannot support, a figure cited for evidence it does not contain, magnitude overstatement). Added Pass 5, a mandatory equal-weight content-reasoning pass with a gated registry and seven checks the tools cannot do: instrument/source attribution, test computability, figure-and-table content vs claim, magnitude wording, convergence across studies, causal/generality framing, and data existence for descriptive claims. Rule 15 states plainly that the tools do not reason and Pass 5 is not optional. Final Report and summary counts updated. Confirmation on the same benchmark: the revised protocol scored 21, 20, 21 (mean 20.7), recovering exactly the reasoning defects the old protocol lost, with near-zero false positives, moving ClaudeR from below the native baseline to clearly above it. R CMD check: Status OK. checks.R: all pass. Bridge unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 2856eae commit 030b803

3 files changed

Lines changed: 103 additions & 1 deletion

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: ClaudeR
22
Title: R Integration for Claude AI
3-
Version: 0.12.2
3+
Version: 0.12.3
44
Authors@R: person("Nykko", "Vitali", email = "nykvt@icloud.com", role = c("aut", "cre"))
55
Description: Connects RStudio with Claude AI to enable interactive coding sessions.
66
License: MIT + file LICENSE

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ claudeAddin()
5050
<details>
5151
<summary><b>Recent Updates</b> (click to expand)</summary>
5252

53+
- **Reviewer Zero now reasons, not just reconciles (R 0.12.3).** Added a mandatory Pass 5 (content reasoning) to the base auditing protocol. The deterministic tools (reconcile_values, verify_references, check_cross_references, probe_scripts) find numeric, reference, cross-reference, and code defects, but they do not reason about meaning, and a manuscript can clear every one of them and still be wrong. Pass 5 is a gated, equal-weight pass with seven checks the tools cannot do: instrument and source attribution, whether each reported test is computable from the data that exists, whether each cited figure or table actually contains the claimed evidence, magnitude wording, convergence across studies, causal and generality framing, and data existence for descriptive claims. In a controlled benchmark on a synthetic manuscript with a known defect set, this raised detection from below a native-tools baseline to clearly above it, recovering exactly the reasoning defects the old tool-led protocol was missing.
54+
5355
- **Shared-connection identity, coordination visibility, and a stale-session guard (R 0.12.2 / clauder-mcp 0.14.2).** Three fixes from a live three-persona field session. (1) Personas sharing one MCP connection were renaming each other, because `set_agent_name` changes the identity of the whole connection. New `as_agent` parameter on `send_message`, `check_messages`, and `wait_for_message` acts as a named persona for one call, with a separate read cursor per name. The bridge now enforces the pattern: a second `set_agent_name` with a different name is refused unless forced, every send confirmation echoes the name it was sent as, and the agent intro states where the current identity came from. (2) Coordination messages bypass R by design, so the console and the Agents panel showed nothing while agents talked. The addin now echoes each new coordination event to the console in full (no truncation), appends it to the session log, and shows a live coordination roster with last-seen ages. (3) A bridge still pointed at a dead R session used to report "success" while writing to a coordination log no live agent reads. Coordination calls now fail loudly when no live session exists, and announce it when the connection re-binds to a different live session. Also from pilot 2: `check_cross_references` understands S-prefixed supplement numbering, and the audit protocol documents `unname()` for htest fields and author-plus-year citation matching.
5456

5557
- **Agent identity and cross-restart history (R 0.11.0 / clauder-mcp 0.13.0).** Built from field reports of a multi-day, three-agent session. New `set_agent_name` tool: an agent sets its working name (for example "Claude-Stasis") once, and execution history, message attribution, presence, and its read cursor all carry that name. This fixes the case where several agents or personas share one MCP connection and collapse into a single random id. `get_session_history` gains `include_past`: it parses prior session log files on disk, so the audit of who ran what now survives R restarts. The coordination protocol now makes identity the first step of check-in.

inst/prompts/reviewer_zero.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,91 @@ After verifying statistical claims, check that the bibliography is real.
390390

391391
---
392392

393+
## Pass 5: Content reasoning (the defects no tool can surface)
394+
395+
Passes 1-4 and their tools (`reconcile_values`, `verify_references`,
396+
`check_cross_references`, `probe_scripts`) find numeric, reference,
397+
cross-reference, and code defects. They do not reason about meaning. A
398+
manuscript can clear every gate above and still contain serious defects that
399+
only a close, skeptical read finds, and those are the defects that separate a
400+
real audit from a checklist.
401+
402+
This pass is mandatory and carries equal weight with the tool passes. Do not
403+
treat it as optional, and do not let the tool output stand in for it: the
404+
tools have already told you everything they can. Read the manuscript prose
405+
again, slowly, with the tool output in hand, and bring outside domain
406+
knowledge the tools do not have. A claim can be false when every number in it
407+
reconciles.
408+
409+
Build a reasoning registry so the checks are tracked and gated like every
410+
other pass:
411+
412+
```r
413+
reasoning_registry <- data.frame(
414+
check = c("instrument_attribution", "test_computability",
415+
"figure_claim_match", "magnitude_wording",
416+
"convergence_consistency", "causal_generality_framing",
417+
"data_existence"),
418+
status = "unrun", # unrun -> clear | defect
419+
finding = "", # verbatim claim + what is wrong
420+
stringsAsFactors = FALSE)
421+
```
422+
423+
Run every check. For each, quote the verbatim claim, state the finding, and
424+
set `status` to `clear` or `defect`. A defect here is reported exactly like a
425+
Pass 3 discrepancy.
426+
427+
1. **Instrument and source attribution.** For every named scale, task, or
428+
measure with a citation, does the cited source match the instrument as
429+
described (item count, version, authorship)? Example defect: a "22-item"
430+
scale attributed to the paper that introduced the 10-item version. This
431+
needs knowledge of the instrument, not a value check.
432+
2. **Test computability.** For every reported test or statistic, can it
433+
actually be computed from the variables that exist in the data? Inspect the
434+
data columns with `execute_r`. A reported p-value or group comparison for
435+
which no supporting variable exists is a defect, not a number to reconcile
436+
(e.g. "accuracy did not differ across conditions" when only one accuracy
437+
value per participant exists).
438+
3. **Figure and table content versus claim.** For every figure or table cited
439+
in support of a claim, does it actually contain the evidence claimed? A
440+
figure cited for a relationship it does not plot (a speed-only boxplot
441+
cited for a speed-accuracy trade-off) is a defect even though the
442+
cross-reference resolves.
443+
4. **Magnitude wording.** For every qualitative magnitude word ("roughly
444+
twice", "comparable", "doubled", "small"), recompute the actual
445+
ratio or difference and check the word fits. "Roughly twice" for a computed
446+
2.8x is a defect.
447+
5. **Convergence and consistency of argument.** Does any claim that results
448+
"converge", "replicate", or "hold across both studies" survive when a
449+
measure was collected in only one study, or a construct was operationalized
450+
differently across them? Cross-check what each study actually measured.
451+
6. **Causal and generality framing.** Does any causal-mechanism claim rest on
452+
a manipulated cause with only a measured (correlational) mediator, with no
453+
mediation test? Does any generality claim ("generalize across populations
454+
and contexts") exceed a single sample and a stylized task, especially where
455+
the paper's own limitations contradict it?
456+
7. **Data existence for descriptive claims.** For every descriptive or
457+
reliability claim (demographics, Cronbach's alpha, "measures collected"),
458+
does the supporting data exist anywhere in the project? A claim resting on
459+
data absent from the corpus must be flagged as unverifiable.
460+
461+
### Reasoning-pass gate
462+
463+
You cannot proceed to the Final Report until every check has been run:
464+
465+
```r
466+
unrun_checks <- sum(reasoning_registry$status == "unrun")
467+
cat(sprintf("Reasoning pass: %d / %d checks run (%d defects, %d unrun)\n",
468+
sum(reasoning_registry$status != "unrun"), nrow(reasoning_registry),
469+
sum(reasoning_registry$status == "defect"), unrun_checks))
470+
stopifnot(unrun_checks == 0)
471+
```
472+
473+
A clean result (all checks `clear`) on a sound paper is a valid outcome. Do
474+
not invent a reasoning defect to fill the pass.
475+
476+
---
477+
393478
## Final Report
394479

395480
After all claims and references are processed, generate a summary:
@@ -410,6 +495,9 @@ cat(sprintf("Rounding only: %d\n", sum(claim_registry$status == "rounding")))
410495
cat(sprintf("Discrepancies: %d\n", sum(claim_registry$status == "discrepancy")))
411496
cat(sprintf("Not found in code: %d\n", sum(claim_registry$status == "not_found")))
412497
cat(sprintf("Errors: %d\n", sum(claim_registry$status == "error")))
498+
cat(sprintf("Reasoning checks: %d run | %d defects\n",
499+
sum(reasoning_registry$status != "unrun"),
500+
sum(reasoning_registry$status == "defect")))
413501
```
414502

415503
Then print the full registry and highlight every discrepancy with:
@@ -430,6 +518,12 @@ Include an internal consistency section listing:
430518
elsewhere in the code, with both results shown
431519
- If no inconsistencies were found, state that explicitly
432520

521+
Include a content-reasoning section (Pass 5) listing:
522+
- Each reasoning check and its result (clear or defect)
523+
- For each defect, the verbatim claim and why it fails, treated with the
524+
same weight as a numeric discrepancy
525+
- If all checks were clear, state that explicitly
526+
433527
---
434528

435529
## Rules
@@ -463,3 +557,9 @@ Include an internal consistency section listing:
463557
14. Final verdicts come from clean-room recomputation
464558
(`probe_scripts(capture_output = TRUE)` or a fresh background session),
465559
never from a long-lived environment that may hold stale objects.
560+
15. The tools do not reason. Pass 5 is not optional and is not covered by any
561+
tool: a manuscript can pass every numeric, reference, and cross-reference
562+
gate and still misattribute an instrument, cite a figure for evidence it
563+
does not contain, report a test its data cannot support, or overstate a
564+
magnitude or a causal claim. Run every reasoning check and weight its
565+
findings equally with the numeric ones.

0 commit comments

Comments
 (0)