Skip to content

feat(bench): phase-7 tooling + 4 Python cascade scenarios (#104)#124

Merged
Connorrmcd6 merged 1 commit into
mainfrom
feat/104a-cascade-py-scenarios
Jun 14, 2026
Merged

feat(bench): phase-7 tooling + 4 Python cascade scenarios (#104)#124
Connorrmcd6 merged 1 commit into
mainfrom
feat/104a-cascade-py-scenarios

Conversation

@Connorrmcd6

Copy link
Copy Markdown
Owner

Summary

PR-A of the cascade-family expansion (4 → ~14), which kills the "the headline rests on 4 hand-built fixtures" critique. Ships the polarization tooling plus the first 4 new scenarios — each a new drift archetype in a new domain. Fully offline, no spend.

Tooling (foundation for PR-B/C)

  • tools/validate_scenario.py — an offline grader-polarization self-test. author.py proves the drift is real; this proves the graders discriminate. It reuses the live grade_code/grade_qa on author-provided reference solutions (.author/solution_correct.* → ok & not misled; .author/solution_stale.* → not ok & misled), catching mis-polarized graders before any API spend — the single biggest authoring risk across many fixtures.
  • scenarios.py — an edit_path meta key (the visible file the agent returns) so the self-test can build the FILE: block; backfilled into the 4 existing cascades.
  • scenarios/CHECKLIST.md — repeatable authoring steps + neutrality rules.
  • tests/test_scenarios.py — parametrized guard that every scenario with reference solutions is correctly polarized.

New scenarios (Python)

id tier domain drift archetype
cascade-ttl-units-code T1 cache units s→ms (lifetime 30s→5s)
cascade-money-rounding-code T2 currency rounding precision cents→dimes
cascade-backoff-offbyone-code T2 retries attempt indexing 1-based→0-based
cascade-signal-threshold-code T2 monitoring alert sign flip rise→drop

Each: drift is detectable by surf (a genuine "changed" divergence seals), graders probe the real hidden dependency for ground truth, and task.md is neutral (no leaked value).

Authoring note for reviewers: surf alpha-renames identifiers when hashing, so a drift must change a literal/operator/structure, not just swap a named constant (e.g. the rounding scenario uses a precision literal 0.010.1, not a ROUND_HALF_* enum swap). The CHECKLIST records this.

Verification (offline)

  • python tools/author.py seals all four (genuine changed divergence).
  • python tools/validate_scenario.py --all — green (graders discriminate).
  • Mock run over all four — 0 errors across C0–Cw.
  • uv run pytest35 passed; cargo fmt --all --check clean.

Scope

PR-A of Connorrmcd6/surface-bench#12. PR-B (3 TS code cascades) and PR-C (3 QA cascades) follow, to reach ~14 total and unblock the phase-8 pre-registration freeze.

🤖 Generated with Claude Code

PR-A of the cascade expansion (4 -> ~14): the polarization tooling plus
the first four new scenarios, each a NEW drift archetype in a NEW domain.

Tooling (foundation for the harder PRs):
- tools/validate_scenario.py: offline grader-polarization self-test. author.py
  proves the *drift* is real; this proves the *graders discriminate*. Reuses
  the live grade_code/grade_qa on author-provided reference solutions in
  .author/ (solution_correct.* -> ok & not misled; solution_stale.* -> not ok
  & misled), catching mis-polarized graders before any spend.
- scenarios.py: `edit_path` meta key (the visible file the agent returns), so
  the self-test can build the FILE: block; backfilled into the 4 existing
  cascades.
- scenarios/CHECKLIST.md: the repeatable authoring steps + neutrality rules.
- tests/test_scenarios.py: parametrized guard that every scenario with
  reference solutions has correctly-polarized graders.

New scenarios (Python, each oracle-safe: drift detectable by surf, graders
probe the real hidden dependency):
- cascade-ttl-units-code      (T1, cache)      units s->ms (lifetime 30s->5s)
- cascade-money-rounding-code (T2, currency)   rounding precision cents->dimes
- cascade-backoff-offbyone-code (T2, retries)  attempt indexing 1-based->0-based
- cascade-signal-threshold-code (T2, monitoring) alert sign flip rise->drop

Note: surf alpha-renames identifiers when hashing, so a drift must change a
literal/operator/structure, not just swap a named constant — each scenario's
drift is chosen accordingly.

Verified offline: author.py seals all four (genuine "changed" divergence),
validate_scenario --all green, a mock run over all four is error-free, and
uv run pytest passes (35).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Connorrmcd6 Connorrmcd6 merged commit 4327fc3 into main Jun 14, 2026
5 checks passed
Connorrmcd6 added a commit that referenced this pull request Jun 14, 2026
PR-B of the cascade expansion: three TS code cascades (graded by
`node --test`, Node >=22.18 type-strip), each a new drift archetype that
surf detects via a structural/literal change (not an identifier swap).

- cascade-serialize-key-order-ts-code (T2, serialization) — canonicalString
  key order insertion -> sorted (Object.keys().sort() added); the visible
  signer must reproduce the canonical string.
- cascade-default-timeout-ts-code (T1, timeouts) — totalDeadlineMs default
  param 30000 -> 5000; the visible caller reports the default budget.
- cascade-validate-guard-ts-code (T2, validation) — isValidName dropped its
  `length > 0` guard (empty names now accepted); the visible intake filter
  must mirror the rule.

Each: graders probe the real hidden dependency for ground truth, task.md is
neutral, author.py seals a genuine "changed" divergence, and
validate_scenario proves grader polarity.

Verified offline: validate_scenario --all green (7/7), a mock run over the
three is error-free, uv run pytest passes (38).

Stacked on PR-A (#124) for the validate_scenario tooling + edit_path; will
retarget to main once #124 merges.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant