meta.reviews.selector_claim

Selector::Claim { anchor_id } selects the complete claim identified by its full dotted anchor ID within the fragment’s source file, using the shared anchor-content boundaries and claim-text normalization. The containing document need not be included. The selector stores no line numbers or byte offsets; inserting unrelated lines before an unchanged claim does not make the fragment stale.

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

Implementation

Implemented crates/sage-meta/src/review.rs:335–340

sage_meta::review · lib:sage_meta

#![allow(unused)]
fn main() {
        // {anchor}`meta.reviews.selector_claim`
        Selector::Claim { anchor_id } => {
            let spec = SpecIndex::load_workspace(workspace)?;
            if !spec.diagnostics.is_empty() {
                return Err("invalid or ambiguous specification inventory".into());
            }

}

See more source ↗

Implemented crates/sage-meta/src/spec.rs:417–422

sage_meta::spec · lib:sage_meta

#![allow(unused)]
fn main() {
// {anchor}`meta.reviews.selector_claim`
fn finish_anchor(
    source: &str,
    end: usize,
    active: &mut Option<SpecAnchor>,
    anchors: &mut Vec<SpecAnchor>,

}

See more source ↗

Tests and review

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

Implemented sage_meta::complete_claim_blocks_are_selected_but_unrelated_movement_is_not_stale

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.claim_text)]
#[sage::test(meta.reviews.selector_claim)]
#[sage::test(meta.reviews.staleness)]
#[sage::test(meta.reviews.source_representation)]
fn complete_claim_blocks_are_selected_but_unrelated_movement_is_not_stale() {
    let fixture = Fixture::new();
    let body = "First **paragraph**.\n\nSecond paragraph.\n\n- list item\n\n| A | B |\n|---|---|\n| 1 | 2 |\n\n```rust\nlet x = 4;\n```";
    let claim =
        format!("# Heading\n\n{{anchor}}`demo.rule`\n{body}\n\n<!-- end anchor -->\nOutside\n");
    fixture.write("md/design/README.md", &claim);
    let input = fixture.start();
    let fragment = input
        .fragments
        .iter()
        .find(|f| matches!(f.selector, Selector::Claim { .. }))
        .unwrap();
    assert_eq!(fragment.contents.join("\n"), body);
    review::record(&fixture.0, "demo.rule", &Fixture::report()).unwrap();
    fixture.write(
        "md/design/README.md",
        &format!("\n\n{}", claim.replace("Outside", "Changed outside")),
    );
    assert!(sage_meta::check(&fixture.0).is_valid());
    for text in ["Second paragraph", "list item", "| 1 | 2 |", "let x = 4"] {
        fixture.write("md/design/README.md", &claim.replace(text, "changed"));
        assert!(!sage_meta::check(&fixture.0).is_valid(), "{text}");
    }
}
}

See more source ↗

Implemented sage_meta::declared_claim_read_tracks_selected_text_without_capturing_the_document

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.selector_claim)]
#[sage::test(meta.reviews.fragment_freshness)]
#[sage::test(meta.reviews.recorded_reads)]
fn declared_claim_read_tracks_selected_text_without_capturing_the_document() {
    let fixture = Fixture::new();
    fixture.start();
    let text = review::capture_read(
        &fixture.0,
        "demo.rule",
        "md/design/README.md",
        Selector::Claim {
            anchor_id: "demo.rule".into(),
        },
    )
    .unwrap();
    assert_eq!(text, "The result is four.");
    let input = fixture.input();
    assert_eq!(input.fragments.last().unwrap().contents.join("\n"), text);
    review::record(&fixture.0, "demo.rule", &Fixture::report()).unwrap();
    fixture.write(
        "md/design/README.md",
        &format!("# An unrelated heading\n\n{CLAIM}"),
    );
    assert!(sage_meta::check(&fixture.0).is_valid());
    fixture.write("md/design/README.md", &CLAIM.replace("four", "five"));
    assert!(!sage_meta::check(&fixture.0).is_valid());
}
}

See more source ↗

Review: Accepted · Codex /root/anchor_094.

Fresh complete followup review of selector_claim. Saved/read the previous report and captures before start, recaptured every prior helper/contract dependency, and compared all fragments. The only changes are three association comments: placeholder_status in review.rs and implementation_references/crate_ownership in spec.rs. Claim, both tests and all five dependencies are unchanged. No selector, normalization or freshness behavior changed.

The complete claim requires full dotted-ID selection in the specified source, complete shared-boundary/normalized claim content, no mandatory containing-document capture, no stored positional coordinates, and freshness after unrelated preceding-line movement. Both ordinary implementation entries address these requirements. Selector::Claim contains anchor_id only. review::select loads the canonical SpecIndex, rejects invalid/ambiguous inventory and absent IDs, verifies the resolved definition belongs to the requested source path, and returns claim.content. Initial inventory uses that same content; capture_read adds the selected text without requiring a whole-document fragment, and freshness reselects and compares additional fragment contents. Source positions used internally are not persisted in the Claim selector. The associated finish_anchor and shared spec parser terminate at new definitions/headings/explicit ends/source end, trim exterior whitespace, and use common-indent removal for Sage prose before parsing. Thus review selection does not implement a divergent boundary parser. The three marker additions do not affect any of these steps.

Both ordinary tests were read fully. complete_claim_blocks_are_selected_but_unrelated_movement_is_not_stale asserts exact multiline claim text containing formatted paragraphs, a list, table and fenced code, excluding heading/end marker/outside prose. After recording it inserts preceding blank lines and changes outside prose and requires valid review status; independently changing each substantive later block must invalidate it. This guards against first-paragraph truncation, whole-document capture and positional freshness. declared_claim_read_tracks_selected_text_without_capturing_the_document explicitly selects demo.rule from its source file, asserts exact returned and appended saved content, records successfully, and requires validity after inserting an unrelated heading before the claim but invalidity after changing selected prose. Both use actual temporary workspaces and captured fixture read/write/start helpers; check::is_valid and book-source-root helpers plus review_scope/claim_text contracts were recaptured and verified unchanged. No TODO/N/A evidence or deferred requirements exist.

All full-claim obligations remain supported after examining the actual comment-only delta against the prior assessment and current code/assertions. No unrelated design investigation was introduced. This review performed start/read/record and source inspection only; no source edits or test-suite reruns. Central execution is reported separately. No requested edits.

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