style: rustfmt ck_resolve/lower.rs + ck_syntax/lib.rs (TY1/N6 landed unformatted) #12
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/012-style-rustfmt-ck-resolve-lower-rs-ck-syntax-li"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
style: rustfmt ck_resolve/lower.rs + ck_syntax/lib.rs (TY1/N6 landed unformatted)
Along the way:
seedto keywordseedkeyword promotionseedkeyword promotion (#43)Touches 72 files:
docs/compiler-level-testing.md,docs/effects.md,docs/errors.md,docs/impl/02-lexer.md,docs/impl/03-parser.md,docs/impl/08-diagnostics.mdand 66 more.Split. The decision in
root_const_resolves_inside_spawnis a pure function now, with its own tests insrc/rust/crates/ck_resolve/src/actors.rs.Good. Small enough to read in one sitting, and
src/rust/crates/ck_resolve/src/actors.rsis easier to follow than it was.@ -0,0 +530,4 @@}#[test]fn root_const_resolves_inside_spawn() {root_const_resolves_inside_spawnreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?seedto keyword dd175c53f5Front-end + type-system spec cascades: - N7 (test-decl): top-level `test fn` + bundled `test { }` block, uniform across effects and actors; reserves E0307 (actor-slot in effect test block) - N8 (actor-decl): ActorDecl surface, depends on N7's test-block lowering; reserves E0306 (duplicate single-kind actor slot) - TY2–TY8: seven per-slice type-system specs drafted; ~30 design questions locked with explicit rationale (`Locked (2026-05-28)` markers in each) Cross-cutting design corrections (all locked 2026-05-28): - `data Exception { ... }` family REMOVED. Every error is `data X composes Error`; raise-vs-return is per-call-site transport, not a type-level rule. R5-exception-path → R5-raise-path; T3-unhappy-and-exception-traps → T3-unhappy-and-raise-traps; `trap<Exception::*>` → `trap<_>`; `Exception::OutOfMemory` → `OutOfMemory`. Failure modes become happy/unhappy/invalid/raise (no "exception" anywhere). - `seed` is a hard keyword (lexer/parser code change pending). The `mock.seed.X` accessor pattern was design drift — `seed fn`s run automatically as precedence-marked setup, never accessed by tests. `TestStarted.seed` → `TestStarted.rnd_seed` (random replay seed, distinct semantic). - `Nothing` reframed as stack-termination marker (not just bottom type) — the runtime instruction "this branch invalid; terminate the actor's stack." - Diagnostic collection split from reporting: passes emit per-occurrence events; the reporting layer merges/enriches. - Type-algebra (`and`/`or`/`not`/`is`/`is not`) vs value-algebra (`&&`/`||`/`==`/...) strictly separated; never mix in one expression. Memory: 5 new entries (nothing_stack_termination, errors_collect_vs_report, type_vs_value_operators, no_exception_family, seed_keyword). MEMORY.md index + project_four_failure_modes updated with the renames. No code changes — design-only.seedkeyword promotion 97b59bcd73seedkeyword promotion (#43) edf25f4867Lifts the test surface across the two contexts it appears in today. A top-level `test fn` projects through `DeclHead::Test` and allocates as an ordinary `FnId` carrying `FnKind::Test` on `FnData` — the body lowers via the N6 path verbatim, and the marker is what the test runner reads to filter. The bundled `test { … }` block inside an effect is resolved by `ck_resolve::test_blocks::resolve_effect_test_block`: members (state fields, seed fns, op fns) collect into one flat per-test-block scope (E0305 on same-block dup), threaded as an extra outer frame above each contained body so a bare reference inside an op body resolves to a sibling state field before falling back to the module. New diagnostic **E0307** rejects actor-only slots (spawn / receive / despawn) inside an effect's test block, with a secondary label on the enclosing `effect` keyword. The actor-context `test { … }` slot reuses this same lowering when N8 lands. Goldens: tests/resolve/test_fn_top_level.cktest, effect_test_block.cktest, effect_test_block_with_actor_slot.cktest.N8 lifts the actor surface through the front-end the same way N1/N3/N6 lifted fn/record/data/const. ck_syntax projects ActorDecl (state / root consts / spawn / despawn / http / receive / helper fns / test); ck_hir adds ActorId and ItemRef::Actor in the per-module flat namespace (collisions fire the existing E0304); ck_resolve's new actors.rs builds the per-actor item scope (state fields + root consts + helper fns) and lowers every slot body against it. Slot lowering reuses N6's body machinery — spawn/despawn/http/helpers feed lower_body verbatim; receive<T>(pattern) binds its pattern frame above the actor item scope; test { … } delegates to N7's test-block resolver with the actor's item scope threaded above. The actor item scope sits as scope level 2 in the lookup chain (block → actor-item → module → project-effects → stdlib → primitives), so a bare reference inside a slot resolves to a sibling state field / const / helper before falling back to the module. E0306 (duplicate single-kind slot) is registered and fires on a second spawn or despawn in one actor — primary on the duplicate keyword, "first declared here" secondary on the first — same shape as E0304 / E0305 / E0501. The polymorphic slots (receive<T> by message type, http by route, helper fns by name) are not subject to E0306; those uniqueness checks belong to later stages. Gating fixtures under tests/resolve/ cover the three locked cases from the spec: clean actor with state field referenced via item scope, duplicate spawn firing E0306, and a flat-namespace collision inside one actor. The parser fixtures for counter/http_api are re-blessed against the new ActorDecl CST shape. Deferred (per the spec's "Out"): Singleton/Bound/Ephemeral lifetime semantics, supervise/route enforcement, required-spawn / required- test, receive<T> per-message uniqueness, http route-collision, the implicit-self reference. The bare-name lookup against the actor item scope is enough for the corpus today.