Skip to content

Commit 6d18e0a

Browse files
olwangclaude
andcommitted
feat(selfhost): checker step-2 milestone 2c — RS0010/RS0011 (profile, share)
Adds two purely-structural signature-family diagnostics: - RS0010 REMOVED_PROFILE_DECLARATION: any `profile:` declaration. - RS0011 REMOVED_SHARE_EFFECT: a parameter `name: share …` (no data effect, type name `share`). CHECKER_TARGET_CODES now 8 codes; checker_parity_corpus byte-exact over 619 files, 0 mismatches, 0 run-failures. The effects-clause family (RS0004/RS0007/RS0012) was measured (19-file footprint) but deferred: it needs a parse_effects port (malformed clauses recover to RS0015, not the effect-name checks) plus RS0007's semantic type_ref_is_copy sub-condition. Documented in the ledger (SH-026 milestone 2c) as the scoped remainder. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 78e9c9a commit 6d18e0a

4 files changed

Lines changed: 88 additions & 20 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] = &["RS0002", "RS0003", "RS0005", "RS0006", "RS0016", "RS0017"];
506+
const CHECKER_TARGET_CODES: &[&str] = &["RS0002","RS0003","RS0005","RS0006","RS0010","RS0011","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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -979,9 +979,21 @@ gap is VM value-representation / intrinsic-dispatch cost (the next big lever).
979979
sole corpus trigger is `fail/missing-signature-pieces.rss` (expects both). SCOPE:
980980
covers top-level `fn` decls (the only corpus source of these codes); protocol/
981981
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).
982+
extension point.
983+
- **Diagnostics (step 2, milestone 2c — DONE, 2026-07-02):** added **RS0010**
984+
(REMOVED_PROFILE_DECLARATION — any `profile:` decl) and **RS0011**
985+
(REMOVED_SHARE_EFFECT — a parameter written `name: share …`, no data effect,
986+
type name `share`). Both purely structural. `CHECKER_TARGET_CODES` = **8 codes**;
987+
`checker_parity_corpus` byte-exact **619 files, 0 mismatches, 0 run-failures**.
988+
MEASURED-BUT-DEFERRED (footprint known, 19 corpus files): the effects-clause
989+
family RS0004/RS0007/RS0012 needs a `parse_effects` port — malformed clauses
990+
(`effects(a,,b)`, `effects(retains())`, `effects(custom(x))`) must recover to
991+
RS0015, NOT the effect-name checks, and RS0007 has a semantic `type_ref_is_copy`
992+
sub-condition; RS0008 (missing-effect) needs a Copy/sum-type table; RS0009
993+
(invalid-pure) needs body analysis; RS0033 (int-range) needs literal-value
994+
parsing; RS0028 (invalid-self) needs the protocol-method + first-param rules.
995+
Next genuinely semantic tier: RS0021 exhaustiveness / RS0024 unknown-type (need a
996+
`Map<String,Def>` symbol-table pass).
985997
- **Lexer spans (step 3):** added a `len` field to the shared `Tok`
986998
(= consumed source span `j-i`, matching the Rust lexer's `index-start`) and made
987999
`lexer.rss` emit the real `<line>:<col>:<len>` prefix. `lexer_parity_corpus` is

0 commit comments

Comments
 (0)