Skip to content

Commit 78e9c9a

Browse files
olwangclaude
andcommitted
feat(selfhost): checker step-2 milestone 2b — RS0002/RS0003 signature explicitness
check.rss now reproduces MISSING_RETURN_TYPE (RS0002) and MISSING_PARAMETER_TYPE (RS0003), extending CHECKER_TARGET_CODES to 6 codes. Token predicates mirror the analyzer faithfully: - RS0002: no top-level `->` after the param list (check_return_type_explicit). - RS0003: a param whose first token is a non-effect ident not followed by `:` (parse_params → empty ty.name); effect-first / non-ident segments are malformed and yield no Param, so they don't trigger it. checker_parity_corpus byte-exact over 619 files, 0 code-mismatches, 0 run-failures. Scope: top-level fn decls (the only corpus trigger, fail/missing-signature-pieces.rss); protocol/native-block methods noted as an extension point. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 6d14b18 commit 78e9c9a

5 files changed

Lines changed: 321 additions & 7 deletions

File tree

crates/rsscript/src/selfhost_parity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ fn parser_parity_corpus() {
503503
// ---------------------------------------------------------------------------
504504

505505
/// Diagnostic codes the rss checker is expected to reproduce.
506-
const CHECKER_TARGET_CODES: &[&str] = &["RS0005", "RS0006", "RS0016", "RS0017"];
506+
const CHECKER_TARGET_CODES: &[&str] = &["RS0002", "RS0003", "RS0005", "RS0006", "RS0016", "RS0017"];
507507

508508
fn is_target_code(code: &str) -> bool {
509509
CHECKER_TARGET_CODES.contains(&code)

docs/ledgers/rss-selfhost-ledger.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -967,11 +967,21 @@ gap is VM value-representation / intrinsic-dispatch cost (the next big lever).
967967
top-level token scan (per-header seen-set matches `parse_features`).
968968
`CHECKER_TARGET_CODES` extended to the 4 codes; `checker_parity_corpus` is
969969
byte-exact over **576 files, code-mismatches 0**; each code + CLEAN verified
970-
firing on crafted inputs and the `unknown-file-feature` fixture. Next increments
971-
(scoped, not done): RS0002/RS0003 (signature explicitness — needs all-function
972-
traversal incl. protocol/native blocks); RS0021 exhaustiveness / RS0024
973-
unknown-type (needs a `Map<String,Def>` symbol-table pass — the first genuinely
974-
semantic self-hosted check).
970+
firing on crafted inputs and the `unknown-file-feature` fixture.
971+
- **Diagnostics (step 2, milestone 2b — DONE, 2026-07-02):** added **RS0002**
972+
(MISSING_RETURN_TYPE) and **RS0003** (MISSING_PARAMETER_TYPE) — signature
973+
explicitness. Faithful token predicates mirror `check_return_type_explicit`
974+
(no top-level `->` after the param list) and `check_params` (a param whose first
975+
token is a non-effect ident NOT followed by `:` → empty `ty.name`; effect-first /
976+
non-ident segments are malformed and produce no Param, so no RS0003). Comparison
977+
is a sorted+deduped SET, so only presence matters. `CHECKER_TARGET_CODES` = 6
978+
codes; `checker_parity_corpus` byte-exact **619 files, code-mismatches 0**; the
979+
sole corpus trigger is `fail/missing-signature-pieces.rss` (expects both). SCOPE:
980+
covers top-level `fn` decls (the only corpus source of these codes); protocol/
981+
native-block methods are in skipped decl branches — sound for the corpus, a noted
982+
extension point. Next increments (scoped, not done): RS0021 exhaustiveness /
983+
RS0024 unknown-type (need a `Map<String,Def>` symbol-table pass — the first
984+
genuinely semantic self-hosted check).
975985
- **Lexer spans (step 3):** added a `len` field to the shared `Tok`
976986
(= consumed source span `j-i`, matching the Rust lexer's `index-start`) and made
977987
`lexer.rss` emit the real `<line>:<col>:<len>` prefix. `lexer_parity_corpus` is

docs/planning/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ tests.
2323
|-----|------------|
2424
| [`spec-todo.md`](spec-todo.md) | Current v0.7 implementation backlog and explicitly removed non-goals. |
2525
| [`vm-optimizing-jit-plan.md`](vm-optimizing-jit-plan.md) | Current VM/JIT optimization state, shipped slices, and remaining perf work. |
26+
| [`jit-production-readiness-plan.md`](jit-production-readiness-plan.md) | Phased plan to promote the native JIT to the production execution tier (findings register F1–F11, phases P0–P4). |
2627
| [`dev-build-test-speed-plan.md`](dev-build-test-speed-plan.md) | Proposed developer-loop speed work. |
2728
| [`refactor-plan.md`](refactor-plan.md) | Proposed behavior-preserving module decomposition. |
2829
| [`declarative-rewrite-roadmap.md`](declarative-rewrite-roadmap.md) | Design path for graph rewrite / tinygrad-style scheduler work. |

0 commit comments

Comments
 (0)