Conversation
compiler.rs:8322 maps "str" | "string" to []const u8 for Zig and
compiler.rs:18248 maps it to const char* for C. compiler.rs:24426 mapped it to
the owned String for Rust, and String is not constructible in a `const` item,
which is where the corpus mostly uses it:
pub const DEFAULT_NOTEBOOK: String = "t27-QUEEN-BRAIN";
error[E0308]: expected `String`, found `&str`
48 of the 75 specs whose first error was E0308 carried that mismatch.
Measured by name over all 650 corpus specs: rustc accepts 288 -> 314, +26, zero
regressions.
The judgement is stated rather than hidden. `&'static str` is narrower than
String -- a field of that type holds only a string living for the program -- and
that narrowing is what both siblings already chose, neither []const u8 nor
const char* owning its bytes. Zero regressions says nothing in the corpus needed
the owned form.
Also records the boundary my predictor from #3219 was missing. That rule ties a
fix's yield to the stub-bodied share of its class; this class is 3% stub-bodied
and I predicted +2..+8 against a measured +26. The rule holds for a fix repairing
a SIGNATURE while leaving a body, and not for one repairing a COMPLETE
DECLARATION: a const is correct or not on its own.
Seal and 92 drifted seals move in the same commit.
Closes #3239
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
PR DashboardGenerated at: 2026-09-05 04:10:35 UTC
Summary
Seal Status
|
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
PR DashboardGenerated at: 2026-09-05 05:18:23 UTC
Summary
Seal Status
|
PR DashboardGenerated at: 2026-09-05 05:49:37 UTC
Summary
Seal Status
|
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
PR DashboardGenerated at: 2026-09-05 06:05:00 UTC
Summary
Seal Status
|
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
PR DashboardGenerated at: 2026-09-05 06:16:33 UTC
Summary
Seal Status
|
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
t27_type_to_rustmaps the spec typestrto the ownedString. Both siblingbackends map it to a borrowed form — Zig writes
[]const u8(compiler.rs:8322)and C writes
const char*— and Rust's borrowed spelling is&'static str.The owned mapping is not constructible in a
constitem, which is where most specsuse it:
48 of the 75 specs whose first error is E0308 carry this exact mismatch.
Measured, 650 corpus specs, by name
The judgement, stated
&'static stris narrower thanString: a field of that type can only hold a stringthat lives for the program. That narrowing is what both siblings already chose —
neither
[]const u8norconst char*owns its bytes — and it is the only spellingthat works in the
constposition the corpus actually uses. Zero regressions across650 specs says nothing in the corpus needed the owned form.
A correction to my own predictor
#3219 established that the yield of a fix tracks the stub-bodied share of its
class. This class is 3% stub-bodied (20 of 797 functions), so I predicted +2 to
+8 and measured +26.
The rule needed a boundary it did not have. It applies to a fix that repairs a
signature while leaving a body behind — there, a real body carries further defects
and the fix cannot clear the file. It does not apply to a fix that repairs a
complete declaration:
pub const X: T = literal;is correct or not on its own, andno body's state bears on it. Consts are why this class cleared 26 files whose bodies
are not stubs at all.
Closes #3239