meta.anchors.content.blocks

An anchor’s content starts after its definition marker and includes every subsequent Markdown block until the first applicable closing boundary. Blank lines do not end the content: paragraphs, lists, tables, and code blocks within that extent belong to the same anchor.

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

Implementation

Implemented crates/sage-meta/src/spec.rs:415–420

sage_meta::spec · lib:sage_meta

#![allow(unused)]
fn main() {
// {anchor}`meta.anchors.content.blocks`
// {anchor}`meta.reviews.claim_text`
// {anchor}`meta.reviews.selector_claim`
fn finish_anchor(
    source: &str,
    end: usize,

}

See more source ↗

Tests and review

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

Implemented sage_meta::claims_retain_all_blocks_until_the_next_definition_or_document_end

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.anchors.content.blocks)]
#[sage::test(meta.anchors.content.next_anchor)]
#[sage::test(meta.anchors.content.source_end)]
#[sage::test(meta.anchors.content.explicit_end)]
#[sage::test(meta.anchors.content.unmatched_end)]
fn claims_retain_all_blocks_until_the_next_definition_or_document_end() {
    let body = "Cachés retain **results**.\n\nA later paragraph qualifies the rule.\n\n- Keep unchanged inputs.\n- Recompute edited inputs.\n\n| Input | Result |\n| --- | --- |\n| same | reused |\n\n```rust\nlet résultat = cached();\n```\n\n    An indented example.\n\n> A quoted qualification.";
    let text = format!(
        "# Règles\n\n{{anchor}}`meta.first`\n{body}\n\n{{anchor}}`meta.second` Réévaluate.\n\nFinal qualification.  \n\n"
    );
    let index = SpecIndex::from_sources(&[source("rules.md", &text)]);
    assert!(index.diagnostics.is_empty(), "{:?}", index.diagnostics);
    let first = &index.anchors["meta.first"];
    let second = &index.anchors["meta.second"];
    assert_eq!(first.content, body);
    assert_eq!(second.content, "Réévaluate.\n\nFinal qualification.");
    for anchor in [first, second] {
        assert_eq!(
            &text[anchor.content_span.start..anchor.content_span.end],
            anchor.content
        );
    }
    assert!(first.content_span.end < second.span.start);
}
}

See more source ↗

Review: Accepted · Codex /root/anchor_094.

Fresh complete followup review of content.blocks. Saved/read the prior report and inputs, started fresh, recaptured the source helper, and compared every fragment. Claim, complete test and helper are unchanged. The sole spec.rs change is an implementation_references association comment before its unknown-name validator; no parser or finish_anchor code changed.

The full claim requires content after the definition marker to include every subsequent Markdown block until the first applicable closing boundary, with blank lines preserving paragraphs, lists, tables and code in one claim. The sole ordinary associated implementation finish_anchor slices original source from marker end through the supplied boundary, trims only exterior whitespace, records matching source offsets and consumes the active anchor. It does not reconstruct selected Markdown events, so interior formatting and blocks remain intact. The surrounding captured parser sets the start at the definition-name token end; paragraph ends clear only paragraph tracking and code events only change literal context. Blank lines and ordinary block transitions do not finalize content. New valid definitions, actual headings, explicit ends and source end close content in source order, while literal/HTML handling prevents false boundaries. The marker-only delta cannot affect these operations.

The complete sole ordinary test claims_retain_all_blocks_until_the_next_definition_or_document_end supplies Unicode prose, a separate qualifying paragraph, multiple list items, a table, fenced Unicode Rust code, indented code and a blockquote, separated by blank lines. It requires no diagnostics and exact first.content equality with the entire body. It then requires the second anchor's same-line Unicode prose and later paragraph to equal the exact trimmed expected text. Both content spans must slice the original source into their stored content, and the first extent must end before the next marker. These assertions directly verify listed block types, blank-line continuity, marker exclusion, nonoverlap and next-definition/source-end closure. Other particular boundary permutations have dedicated claims; this assessment does not claim their exhaustive tests were run here. The recaptured source helper simply wraps the input in SpecSource and leaves assertions visible in the test.

No TODO/N/A entries or deferred aspects exist for this block-retention claim. Comparing the actual single-comment delta with the prior complete assessment confirms all requirements remain supported by current source and substantive assertions. No source changes, build or behavioral tests were performed; only fresh review commands and source inspection. 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