Skip to content

fix-ceremony: rewrite explicit self parameters to implicit receivers (#727) - #3654

Merged
ehartford merged 1 commit into
mainfrom
fix-ceremony-self-727
Nov 27, 2026
Merged

ehartford merged 1 commit into
mainfrom
fix-ceremony-self-727

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Part of #727 (implements the with fix-ceremony explicit-self rewrite from Eric's 2026-11-25 ruling; phase-4 refusal stays deferred until after the second half of eliminate-self lands).

Summary

  • src/CeremonyFix.with:
    • Adds cf_collect_explicit_receivers and cf_push_explicit_receiver_edits to rewrite explicit self receiver parameters (self: &Self, mut self: Self, move self: Self, with or without additional or generic parameters) in impl/extend blocks and non-read (mut/move) trait method declarations to the implicit keyword form (fn / mut fn / move fn).
    • Emits one atomic edit per method header so --report counts one rewrite per method and --check-with rolls back atomically.
    • Preserves the D7 trait-body read carve-out (fn m(self: &Self) in a trait).
    • Adds cf_top_level_self_notes so --report reports top-level dotted methods (fn T.m(self: ...)) pointing to with migrate-receivers without breaking them in place.
  • test/behavior/behav_727_fix_ceremony_self.with:
    • Verifies baseline run, --report output (including top-level dotted note), --apply rewrites across trait, impl Type:, and impl Trait for Type:, D7 trait read carve-out preservation, identical runtime behavior after rewrite, and idempotence (0 rewrite(s) on second --report).

Contract-program census (uat/ + examples/, 55 .with files)

  • Outside trait bodies (what phase-4 refusal will reject): 0 files, 0 methods.
  • Inside trait bodies (D7 read carve-out fn m(self: &Self)): 2 files, 17 methods:
    • examples/nebula/src/schema.with (2 methods in pub trait SqlRecord, lines 38–39)
    • examples/service/src/traits.with (15 methods across UserRepository, CacheService, NotificationService, AuditLog, lines 9–38)

Verification

  • with check src/main.with: ok
  • with build :dev: green
  • out/bootstrap/bin/with-stage1 test test/behavior/behav_727_fix_ceremony_self.with test/behavior/behav_3061_fix_ceremony_cli.with: 2/2 passed
  • Seed-driven battery pending (will post verdict below before marking ready).

@ehartford

Copy link
Copy Markdown
Contributor Author

Seed-driven battery green on 95a4e7435 (WITH=$PWD/src/main with run tools/battery.with, wall=1380s):

out/battery/battery.log: rc=0 green

@ehartford
ehartford marked this pull request as ready for review November 27, 2026 13:53
@ehartford
ehartford merged commit 676e3d6 into main Nov 27, 2026
1 check passed
@ehartford
ehartford deleted the fix-ceremony-self-727 branch November 27, 2026 13:53
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