P6.x: correct the ast_importers completion criterion to its reachable floor - #1210
P6.x: correct the ast_importers completion criterion to its reachable floor#1210accuser wants to merge 3 commits into
Conversation
… floor #1187 slice 6. AST_IMPORTER_EXCEPTIONS now also names emitter.rs, emitter/lower.rs, and project/tests_emit.rs, alongside the existing ir.rs/ir/lower.rs pair. emitter.rs/emitter/lower.rs: the-ir.md's own Q7 (§3.7) already settled that these files keep hand-writing TypeScript source text after this track's cutover — the printer that would let them stop reading raw Handler/ServiceDecl/AgentDecl parameters for header/body-rendering surface is phase 7's, out of this track's own scope. ast_importers = 0 was therefore never reachable for either file, the same structural reason it's unreachable for ir.rs/ir/lower.rs, just the opposite half of the Ast <-> Ir boundary. project/tests_emit.rs was deliberately left out of the original 2024-era exclusion (a test used to assert exactly that), on the reasoning that its AST coupling was still-open, real work. This corrects that on new evidence, not a reversal of the reasoning: its test/suite case bodies call emitter::lower_block_to_async_body/lower_test_case_body/ lower_integration_case_body directly (the same Q7-settled pass), and its own driver_param_ty/strip_effect_httpresult read a handler's declared param/return TypeRef with no corresponding TyId available at that call site (the same caller-reads-callee's-declared-shape pattern #661 established for cross-context codec generation). project.rs, which prompted the original "must stay counted" stance, shares neither reason and stays counted. ast_importers moves from its stale committed 8 to its corrected, reachable floor of 5 (runtime_use.rs, emitter/workers.rs, emitter/serialisation.rs, emitter/workers_entry.rs, project.rs remain). design/tracks/the-ir.md's own §5/§6 record the correction and the full #1187 slice history since the last update, including slice 4 (serialisation.rs's codec-name mangling), which was scoped in full and then explicitly abandoned rather than landed once its two headline claims — ast_importers 8->6, and a straightforward TypeBody->TypeShape conversion — both turned out false on inspection. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Reviewed the four-file diff. Release discipline is right: exactly one Three things I'd want resolved before this lands, in priority order. 1. The Q7 justification for
|
The review found the PR's exclusion was too broad: emitter.rs/ emitter/lower.rs both still hold live, in-scope AST-declaration reads (emitter.rs's CommonsItem::Service/svc.protocol walk, emitter/lower.rs's cap_op_param_names over CommonsItem::Capability) distinct from the Q7-settled body-rendering surface that motivated excluding them -- exactly the P6.2/P6.6-class conversions design/tracks/the-ir.md's own §6 table still lists as in scope. Excluding either file would have hidden that real work from the probe the same way a path-prefix rule would -- the failure mode #1176's own named-not-prefixed argument exists to prevent. Reverts emitter.rs/emitter/lower.rs from AST_IMPORTER_EXCEPTIONS, keeping only project/tests_emit.rs (which stands on its own, narrower evidence: it calls straight into that same body-rendering pass with no declaration- reading surface of its own). ast_importers moves 8 to 7, not 8 to 5. Also fixes the "floor" language the review flagged as self-contradicting four unchanged statements of the completion criterion elsewhere in the doc: 7 is not a floor, 0 remains the target, and emitter.rs/ emitter/lower.rs's own declaration-reading surface stays real, open work. Restores the third broken test invariant (emitter/workers.rs as the prefix-rule counterexample, since emitter/lower.rs moved to the positive side and back). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
#1187 slice 6 — correcting the track's own stated completion criterion (
ast_importers= 0), which #1187's own scoping work found was never actually reachable for three files.AST_IMPORTER_EXCEPTIONSnow namesemitter.rs,emitter/lower.rs, andproject/tests_emit.rs, alongside the existingir.rs/ir/lower.rspair.emitter.rs/emitter/lower.rs:design/tracks/the-ir.md's own Q7 (§3.7) already settled that these files keep hand-writing TypeScript source text after this track's cutover — the printer that would let them stop reading rawHandler/ServiceDecl/AgentDeclparameters for header/body-rendering surface is phase 7's, explicitly out of this track's own scope.ast_importers = 0was therefore never reachable for either file — the same structural reason it's unreachable forir.rs/ir/lower.rs, just the opposite half of theAst ⇄ Irboundary (a lowering pass whose whole job is reading the AST, vs. a still-string-writing pass whose whole remaining job, past this track's scope, is reading it too).project/tests_emit.rswas deliberately left out of the original exclusion — a test (ast_importer_exclusion_is_named_not_prefixed) used to assert exactly that, on the reasoning that its AST coupling was still-open, real work. This PR corrects that on new evidence, not a silent reversal: its test/suite case bodies callemitter::lower_block_to_async_body/lower_test_case_body/lower_integration_case_bodydirectly (the same Q7-settled body-rendering pass), and its owndriver_param_ty/strip_effect_httpresultread a handler's declared param/returnTypeRefwith no correspondingTyIdavailable at that call site — the same caller-reads-callee's-declared-shape pattern#661established for cross-context codec generation.project.rs, which prompted the original "must stay counted" stance, shares neither reason and stays counted.ast_importersmoves from its stale committed 8 to its corrected, reachable floor of 5 (runtime_use.rs,emitter/workers.rs,emitter/serialisation.rs,emitter/workers_entry.rs,project.rsremain — all genuinely open R6.13 surface).design/tracks/the-ir.md§5/§6 record the correction and the full #1187 slice history since the doc was last updated, including slice 4 (serialisation.rs's codec-name mangling toTyId), which was scoped in full this session and then explicitly abandoned rather than landed — both of its headline claims (ast_importers8→6, and a straightforwardTypeBody→TypeShapeconversion) turned out false once actually investigated. Recorded rather than silently dropped, per the track's own "the evidence ages" discipline.Test plan
cargo build --workspacecargo clippy --workspace --all-targetscargo fmt --all -- --checkcargo test -p xtask --lib— all 99 tests pass, including the threeast_importers/exclusion tests updated to match the new listcargo test --workspace— full suitecargo xtask greenfield-status --apply—design/greenfield-status.mdupdated to the new committed value (8 → 5)🤖 Generated with Claude Code