Skip to content

Commit a9ec4a8

Browse files
committed
autotranslate/scratch: park phase-3 (cross-env context) behind an @Later note
BR decision 2026-07-22: don't build phase 3 now; document it in-place instead. The @Later note records the design (session grouping + \else-branch preamble + same regression rule) and the step-0 measurement done on the RENDERED English side: ~20 recoverable / ~24 external / ~37 unclassifiable of the ~81 code-bearing skips, with divergence = 0 (no skip is caused by inconsistent translation). Phases 1–2 remain the coverage line; genuinely-external cases stay under the reserved opt-out marker. Revisit if the ~20-body recoverable set becomes worth gating.
1 parent f4b4065 commit a9ec4a8

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

autotranslate/scratch/verify-mirror-examples.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,20 @@
182182
println(s"--- phase-2 SKIPPED (${rpSkip.size}) — REPL transcripts that compile in NEITHER language / no input ---")
183183
rpSkip.foreach(s => println(s" skip $s"))
184184

185+
// @later (#951 phase 3) — cross-env context. PARKED (BR decision 2026-07-22): the ~81 code-bearing skips above
186+
// (30 inline + 51 REPL-with-input) mostly compile in neither language because they reference names DEFINED in a
187+
// neighbouring env, not in the body itself. Phase 3 would supply that context: group consecutive scala-code
188+
// envs per file into "sessions" (reset at \Task/\Subtask/\SOLUTION/\section/\begin{Slide}/\QUESTBEGIN...),
189+
// prepend the preceding same-session envs' code as a preamble — taking the \else branch for \ifswedish context
190+
// envs (SV branch for the SV compile, \else for the EN compile, since defs are often hand-clamped while the
191+
// referencing REPL is auto-translated) — and compile `object Session: <preamble> <body>` under the same
192+
// regression rule. Env selection stays identical for SV and EN, so a mis-grouped boundary can only skip.
193+
// Step 0 (static, measured on the RENDERED English side — the source side is optimistic since a ref and its
194+
// def share the Swedish identifier by construction): ~20 recoverable, ~24 external (lib/cross-file/absent),
195+
// ~37 unclassifiable (lowercase/expression-only). Divergence (recoverable on SV side but NOT on the mirror
196+
// side, i.e. caused by INCONSISTENT translation) = 0 — so the current cross-refs that resolve in Swedish also
197+
// resolve in English; there is no hidden inconsistency for phase 3 to catch. Given the moderate ~20-body gain
198+
// vs the added machinery (session grouping + clamp-branch extraction), parked; phases 1–2 are the coverage
199+
// line. Genuinely-external cases stay covered by the opt-out marker (reserved "option 3"). Revisit if the
200+
// recoverable set (incl. the Task 3 solution Code envs + several w05/w11 cases) becomes worth gating.
185201
if regressions.nonEmpty || leaks.nonEmpty || inRegressions.nonEmpty || rpRegressions.nonEmpty then sys.exit(1)

0 commit comments

Comments
 (0)