Skip to content

feat(research): apply #206 review to the four-arm pilot - #248

Merged
mirror29 merged 2 commits into
mirror29:mainfrom
14H034160212:pilot-review-fixes
Oct 20, 2026
Merged

mirror29 merged 2 commits into
mirror29:mainfrom
14H034160212:pilot-review-fixes

Conversation

@14H034160212

Copy link
Copy Markdown
Contributor

Summary

Concrete implementation of the #226 review posted on #206 (comment), offered for discussion. Nothing here needs to merge before the protocol choices are agreed. Data changes are opt-in, and every default except invalid-run scoring keeps current behaviour. No paid calls were made.

Related: #206, #208.

Changes

Materials (opt-in; defaults reproduce the 2026-10-12 packet, τ = 3.79538%)

  • --benchmark-dividends: benchmark cash dividends whose ex-date falls in (entry, exit] are added to the benchmark return.
  • --tau-windows N: τ is estimated from the trailing N eligible windows instead of all of them.
  • The protocol now records tau_calibration_windows, benchmark_return and the calibration-window climatology (UP/FLAT/DOWN base rates).

Scoring (report.py)

  • Invalid runs are scored strictly: Brier 2.0, action 0. Under the v0.1 uniform fallback, an invalid run (0.667) scored better than every arm's mean on the development cases. Uniform and climatology fallbacks are kept as itt_sensitivity_brier. This is the only default behaviour change; development results are unaffected because no run was invalid.
  • Uniform and climatology reference Brier, Brier skill vs climatology for every arm, and per-class reliability (mean predicted vs observed).
  • B-mean: the mean of the completed B sample probabilities, with argmax action and neutral on ties. It reuses the same calls, so it is a scoring variant, not a separately budgeted arm. Reported with a paired B-mean − B interval, plus B's pairwise sample action disagreement.
  • build_report(..., climatology=...); the CLI report command reads it from campaign.json.

Sampling (experiment.py, campaign.py)

  • Optional sample_temperature applies only to B's independent samples. The default 0.2 is unchanged; 0.8 is the proposal for the formal arm definition. Every other call, including B's aggregation, stays at 0.2, and the temperature is recorded per call in the ledger sampling metadata.

Intervention controls (report.py, experiment.py)

  • Deletion: the turn keeps its step slot for replay alignment but is omitted from every model-visible history, so there is no {"removed": true} marker.
  • Conclusion flip: swaps p_up/p_down and the action, and keeps the original rationale verbatim. It no longer adds the "Intervention: …" text.
  • Replacement control: digit-free, topic-unrelated prose from a versioned corpus (neutral-prose-v1), cut at a word boundary, under a neutral message key. It replaces the repeated filler and the unrelated_replacement key. Matching is still by characters, not provider tokens.

Validation

  • tests/test_four_arm_pilot.py: 25 passed (5 new tests covering the dividend window and opt-in default, τ window and climatology, flip/replacement stimuli, B-only temperature, and references/skill/B-mean/strict ITT). The two existing tests were updated for strict ITT and the omitted-turn marker.
  • Research suite: 266 passed, 3 skipped (dedicated Postgres not configured).
  • ruff check is clean. mypy on pilot/ reports the same 3 errors as current main (artifacts.py, __main__.py), and no new ones.
  • On real Yahoo data via the materials CLI:
Option τ Development labels
default 3.79538% unchanged; reproduces the packet
--benchmark-dividends 3.79096% no change
--tau-windows 252 3.01326% 2 of 10 move from FLAT (to UP and DOWN)

Open for agreement

Exact tokenizer-matched controls and blinded human process review remain open as before.

🤖 Generated with Claude Code

Implements the scoring, sampling and intervention-control proposals from the
mirror29#226 review on mirror29#206 (comment 6181500755). No paid calls.

Materials (opt-in; defaults reproduce the 2026-10-12 packet, tau 3.79538%):
- --benchmark-dividends adds benchmark cash dividends with ex-date in
  (entry, exit] to the benchmark return.
- --tau-windows N estimates tau from the trailing N eligible windows.
- Protocol records tau_calibration_windows, benchmark_return and the
  calibration-window climatology.

Scoring:
- Invalid runs are scored strictly (Brier 2.0, action 0); uniform and
  climatology fallbacks are reported as ITT sensitivity.
- Uniform and climatology reference Brier, Brier skill vs climatology,
  per-class reliability.
- B-mean variant (mean of completed B sample probabilities) with a paired
  B-mean minus B interval, plus B sample action disagreement.

Sampling: optional sample_temperature applies only to B samples (default 0.2,
unchanged).

Intervention controls:
- Deleted contributions are omitted from model-visible history instead of
  carrying a removal marker.
- Conclusion flips keep the original rationale verbatim; no meta text.
- The replacement control uses digit-free neutral prose (neutral-prose-v1)
  under a neutral message key.

Tests: 25 pilot tests pass (5 new); research suite 244 passed, 3 skipped
(dedicated Postgres). Ruff clean; mypy unchanged from main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mirror29

Copy link
Copy Markdown
Owner

Hi Qiming,

Thanks for the focused follow-up. I reviewed ef783287 against your review on #206, the requirements in #208, and the #226 discussion. No blocking execution defect found. Local verification: 266 Research tests passed, including 25 pilot tests; three dedicated-Postgres tests were skipped; Ruff passed. No paid calls were made.

The main changes listed in this PR are covered: reference forecasts and strict ITT, B-mean, B-only sampling temperature, opt-in material adjustments, and the contribution-control changes.

Before merging, please address two points:

  1. Correct the ITT documentation. docs/usage/four-arm-pilot.md:132 still describes uniform probabilities as the primary treatment for invalid runs. Please align it with strict ITT, keeping uniform/climatology as sensitivity analyses.

  2. Explicitly record the remaining scope from your review:

    • §2b: per-case token usage, IQR, and ratios to an agreed budget target. The current report only checks per-arm medians.
    • §3d: formal intervention selection and per-intervention eligible/attempted/completed/skipped counts, with clearly defined skip-rate denominators. The current runner uses the first N cases and retains individual skip reasons.

These can be linked follow-ups; they do not need to expand this PR into the full formal experiment.

Next, please propose a short protocol revision in #206 covering the primary metric and ITT rule, dividend convention, calibration window, B temperature, budget design, and formal sample/intervention selection. Once the reporting definitions are agreed, the remaining reporting work and regression tests can proceed offline.

Existing saved outputs can also be rescored into a separate report, preserving the originals. However, the previous paid pilot does not validate the new sampling temperature or intervention stimuli; those require a separately agreed configuration and budget.

I will continue coordinating #208’s supporting data and provenance work. Exact token matching, blinded human review, formal sample separation, and model revision/cutoff limitations remain open. Merging this development improvement does not freeze the formal protocol or close #206/#208.

…ew scope

Align four-arm-pilot.md with the strict invalid-run rule (uniform and
climatology fallbacks are sensitivity analyses only) and record mirror29#206
review items 2b (budget dispersion) and 3d (formal intervention selection
and per-intervention counts) as not yet covered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@14H034160212

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Addressed in 60480bc:

  1. four-arm-pilot.md now states strict ITT (Brier 2.0, action 0) as the primary rule, with uniform and climatology fallbacks as sensitivity analyses only.
  2. §2b (budget dispersion) and §3d (formal intervention selection and per-intervention counts) are recorded in the doc as not yet covered, and are linked to the protocol revision on research: define and pilot compute-matched agent decision evaluation #206, where they are items 6 and 8.

No code changes since ef78328; tests unchanged (25 pilot / 266 suite).

@mirror29
mirror29 merged commit c5dcb00 into mirror29:main Oct 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants