meta.language.classes.abstract_complete

A concrete class must implement every inherited abstract method.

Read in specification context · design/meta/language.md

Implementation

Implemented crates/sage-meta/src/validate.rs:554–559

sage_meta::validate · lib:sage_meta

#![allow(unused)]
fn main() {
                // {anchor}`meta.language.classes.abstract_complete`
                for ancestor in self.ancestors(key) {
                    if let Some(base) = self.classes.get(&ancestor) {
                        for method in &base.class.methods {
                            if let Some(selected) = self.method(key, &method.name) {
                                let (owner, name) = selected.rsplit_once("::").unwrap();

}

See more source ↗

Tests and review

Indexed tests and the implementation-completeness and test-adequacy review; no test run is implied.

Implemented sage_meta::rejects_cycles_and_incomplete_concrete_classes

crates/sage-meta/tests/language.rs · test:language

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.language.classes.abstract_complete)]
fn rejects_cycles_and_incomplete_concrete_classes() {
    let errors = check(
        r#"
        abstract class Base { """Base.""" fn run() -> crate::Value { """Run.""" abstract; } }
        class Concrete extends crate::Base { """Missing implementation.""" }
        class A extends crate::B { """Cycle.""" }
        class B extends crate::A { """Cycle.""" }
    "#,
    );
    assert!(
        errors
            .iter()
            .any(|e| e.message.contains("does not implement"))
    );
    assert!(
        errors
            .iter()
            .any(|e| e.message.contains("inheritance cycle"))
    );
}
}

See more source ↗

Review: Accepted · Codex /root/anchor_189.

Source review: the complete claim requires every inherited abstract method to have an implementation in a concrete class. The sole ordinary implementation association is Model::check in validate.rs. Its non-Abstract guard exempts abstract classes; nested ancestor/method iteration covers all inherited declarations, including distant ancestors. method selects the nearest declaration using the cycle-bounded ancestors traversal, so a concrete override or inherited concrete implementation satisfies the obligation, while a selected declaration with no envelope emits the concrete-class-does-not-implement diagnostic. All these helpers are in the captured implementation file. The sole ordinary associated test, rejects_cycles_and_incomplete_concrete_classes, visibly constructs Base.run as abstract and Concrete without an override, then asserts a does-not-implement diagnostic. Removing completeness checking would fail that assertion; its separate cyclic classes and inheritance-cycle assertion also exercise safe traversal. The captured check helper parses the supplied model and passes it directly to validate. This meaningful negative case, together with inspection of exhaustive traversal and nearest-method selection, supports the complete claim. There are no TODO/N/A entries or deferred prerequisites. Baseline: independently verified exact byte equality of both current validate.rs and language.rs with historical source snapshots; reassessed the supplied prior rationale against current claim, full association set, implementation and test assertions. Execution: ran review start/read and byte comparisons; no behavioral tests or build were run by this reviewer. The coordinator separately reports 321 functional tests and cargo build passing; that is not personal execution evidence. No edits requested.

Browse meta anchors

116 anchors

Specification anchors and declared coverage
AnchorImplementationTests
meta (116)102 Implemented24 TODO103 Implemented36 TODO
meta.anchors (22)22 Implemented21 Implemented12 TODO
anchor_pagesImplementedImplementedTODO
book_explorerImplementedImplementedTODO
canonical_sourcesImplementedImplementedTODO
meta.anchors.content (7)7 Implemented7 Implemented
blocksImplementedImplemented
explicit_endImplementedImplemented
headingImplementedImplemented
literal_syntaxImplementedImplemented
next_anchorImplementedImplemented
source_endImplementedImplemented
unmatched_endImplementedImplemented
context_navigationImplementedImplementedTODO
evidence_statusImplementedImplementedTODO
explorer_navigationImplementedTODO
implementation_coverageImplementedImplementedTODO
implementation_referencesImplementedImplementedTODO
placeholder_statusImplementedImplementedTODO
point_excerptsImplementedImplementedTODO
region_balanceImplementedImplemented
region_excerptsImplementedImplementedTODO
test_coverageImplementedImplemented
test_referencesImplementedImplemented
unique_namesImplementedImplementedTODO
meta.book (21)10 Implemented18 TODO12 Implemented18 TODO
anchor_movesImplementedTODOImplementedTODO
authorityImplementedTODOImplementedTODO
browser_deliveryTODOImplementedTODO
browser_dependenciesTODOTODO
browser_rust_sourceTODOTODO
browser_searchTODOTODO
browser_serveTODOTODO
browser_structureTODOTODO
chapter_namesImplementedTODOImplementedTODO
crate_ownershipImplementedImplemented
crates_landingImplementedImplemented
entity_linksTODOTODO
index_groupsImplementedTODOImplementedTODO
index_namespace_pagesImplementedImplemented
index_rowsImplementedTODOImplementedTODO
index_statusImplementedTODOImplementedTODO
rfd_changesTODOTODO
sage_chaptersTODOImplementedTODO
self_descriptionTODOTODO
shared_modelImplementedTODOImplementedTODO
source_rolesTODOTODO
meta.contracts (4)4 Implemented3 TODO4 Implemented3 TODO
cache_invocationsImplementedTODOImplementedTODO
correspondenceImplementedImplemented
observation_coverageImplementedTODOImplementedTODO
validated_sessionImplementedTODOImplementedTODO
meta.language (39)39 Implemented39 Implemented
meta.language.calls (2)2 Implemented2 Implemented
declaredImplementedImplemented
forbiddenImplementedImplemented
meta.language.classes (3)3 Implemented3 Implemented
abstract_completeImplementedImplemented
override_signatureImplementedImplemented
single_inheritanceImplementedImplemented
meta.language.contexts (1)1 Implemented1 Implemented
inheritanceImplementedImplemented
meta.language.envelopes (7)7 Implemented7 Implemented
class_callsImplementedImplemented
createsImplementedImplemented
direct_callsImplementedImplemented
leafImplementedImplemented
permissionsImplementedImplemented
readsImplementedImplemented
receiver_callsImplementedImplemented
meta.language.fields (2)2 Implemented2 Implemented
context_stateImplementedImplemented
kindsImplementedImplemented
meta.language.methods (2)2 Implemented2 Implemented
kindsImplementedImplemented
proseImplementedImplemented
meta.language.model (3)3 Implemented3 Implemented
forbidden_pathsImplementedImplemented
inherited_prohibitionsImplementedImplemented
virtual_dispatchImplementedImplemented
meta.language.types (19)19 Implemented19 Implemented
argument_arityImplementedImplemented
declaration_proseImplementedImplemented
enum_variantsImplementedImplemented
field_proseImplementedImplemented
generic_parametersImplementedImplemented
member_commasImplementedImplemented
name_resolutionImplementedImplemented
opaque_representationImplementedImplemented
preludeImplementedImplemented
qualified_namesImplementedImplemented
recursive_valuesImplementedImplemented
struct_fieldsImplementedImplemented
tuplesImplementedImplemented
type_expressionsImplementedImplemented
unique_fieldsImplementedImplemented
unique_parametersImplementedImplemented
unique_variantsImplementedImplemented
unknown_namesImplementedImplemented
variant_proseImplementedImplemented
meta.reviews (27)27 Implemented27 Implemented
claim_textImplementedImplemented
complete_test_setImplementedImplemented
decisionsImplementedImplemented
fragment_associationsImplementedImplemented
fragment_formatImplementedImplemented
fragment_freshnessImplementedImplemented
gateImplementedImplemented
input_formatImplementedImplemented
input_fragmentsImplementedImplemented
output_formatImplementedImplemented
preparationImplementedImplemented
record_requiredImplementedImplemented
recorded_readsImplementedImplemented
recordingImplementedImplemented
review_delegationImplementedImplemented
review_diagnosticsImplementedImplemented
review_instructionsImplementedImplemented
review_scopeImplementedImplemented
selector_claimImplementedImplemented
selector_line_rangeImplementedImplemented
selector_testImplementedImplemented
selector_whole_fileImplementedImplemented
source_representationImplementedImplemented
stalenessImplementedImplemented
summary_formatImplementedImplemented
test_sourceImplementedImplemented
validation_layoutImplementedImplemented
meta.validation (3)3 TODO3 TODO
claim_specific_evidenceTODOTODO
independent_inspectionTODOTODO
review_packetsTODOTODO