meta.book.crates_landing

The Crates landing page preserves handwritten Markdown from design/crates/README.md. Its curated subsystem introductions link to rendered crate chapters and modeled entities. Generated crate and module chapters are children of this page; generation does not replace its prose with the explorer. Links written to .sage source chapters resolve to their rendered chapters.

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

Implementation

Implemented crates/sage-meta/src/spec.rs:991–996

sage_meta::spec · lib:sage_meta

#![allow(unused)]
fn main() {
    // {anchor}`meta.book.crates_landing`
    pub fn render_chapter(&self, file: &str, source: &str) -> Result<String, Vec<Diagnostic>> {
        let replacements = self.chapter_replacements(file, source)?;
        let mut output = String::new();
        let mut cursor = 0;
        for (span, html) in replacements {

}

See more source ↗

Implemented crates/sage-meta/src/book.rs:106–111

sage_meta::book · bin:sage-meta

#![allow(unused)]
fn main() {
// {anchor}`meta.book.crates_landing`
// {anchor}`meta.book.crate_ownership`
fn generate_crates(
    context: &Value,
    sections: &mut [Value],
    spec: &sage_meta::spec::SpecIndex,

}

See more source ↗

Tests and review

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

Implemented sage_meta::curated_crates_landing_preserves_prose_and_links_to_generated_chapters

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.book.crates_landing)]
#[sage::test(meta.anchors.book_explorer)]
fn curated_crates_landing_preserves_prose_and_links_to_generated_chapters() {
    let fixture = Fixture::new("manual");
    let landing = "# Crates\n\nStart with [symbols](demo/symbols.sage#item:demo::symbols::Item).\n\nOur handwritten tour.\n";
    fixture.doc("design/crates/README.md", landing);
    fixture.doc(
        "design/crates/demo/guide.md",
        "# Semantic guide\n\nRead [symbols](symbols.sage).\n",
    );
    let mut input = fixture.input("items");
    input[1]["items"][0]["Chapter"]["sub_items"][0]["Chapter"]["content"] = json!(landing);
    let output = fixture.run(&input);
    assert!(
        output.status.success(),
        "{}",
        String::from_utf8_lossy(&output.stderr)
    );
    let book: Value = serde_json::from_slice(&output.stdout).unwrap();
    let entries = chapters(book["items"].as_array().unwrap());
    let rendered = entries["design/crates/README.md"]["content"]
        .as_str()
        .unwrap();
    assert!(rendered.contains("Our handwritten tour."));
    assert!(rendered.contains("demo/symbols.html#item:demo::symbols::Item"));
    assert_eq!(rendered, landing.replace(".sage", ".html"));
    assert!(!rendered.contains("<iframe"));
    let crate_children = entries["design/crates/README.md"]["sub_items"]
        .as_array()
        .unwrap();
    assert!(
        crate_children
            .iter()
            .any(|child| { child["Chapter"]["source_path"] == "design/crates/demo/crate.sage" })
    );
    let module_children = entries["design/crates/demo/crate.sage"]["sub_items"]
        .as_array()
        .unwrap();
    assert!(
        module_children
            .iter()
            .any(|child| { child["Chapter"]["source_path"] == "design/crates/demo/symbols.sage" })
    );
    let guide = entries["design/crates/demo/guide.md"];
    assert!(guide["content"].as_str().unwrap().contains("symbols.html"));
    assert_eq!(guide["parent_names"], json!(["Design", "Crates", "demo"]));
    let data = script_data(
        &std::fs::read_to_string(fixture.asset()).unwrap(),
        "book-data",
    );
    assert_eq!(data["home"], "design/crates/index.html");
}
}

See more source ↗

Review: Accepted · final_quality.

Fresh final marker followup of meta.book.crates_landing. Preserved previous input/output, started fresh, read the complete claim, both ordinary implementation entries and complete associated test, and recaptured prior book Fixture/chapter/script-data helpers, workspace.rs and browser entry-point range. Compared every prior/current fragment by path/selector and both association metadata collections. Only an implementation_references association comment in spec.rs changed. All behavior, claim, test assertions, helper captures and metadata are unchanged; no fragments were removed. I assessed this isolated marker against the complete previous findings below.

Both implementation entries are accounted for. book.rs preprocessing renders existing Markdown through render_sections before generate_crates. Generation finds the existing Crates landing and replaces its sub_items, preserving its content. Modeled crates become children with their modules nested beneath them; owned companion Markdown is rendered and attached to its crate. Explorer frames belong to generated children, not the handwritten landing. Captured workspace helpers resolve the configured source root and ownership, and the browser entry receives the landing URL as home. spec.rs chapter_replacements rewrites registered local .sage destinations to rendered chapter URLs, preserving entity fragments and rejecting unpublished targets. render_chapter applies those targeted spans while copying intervening Markdown verbatim. Thus handwritten introductions and curated links survive generation.

curated_crates_landing_preserves_prose_and_links_to_generated_chapters uses the nondefault manual source root, a handwritten landing with a modeled-entity fragment link and an owned companion guide. It invokes the real preprocess binary and parses its output. Exact equality to landing.replace(.sage,.html), retained tour/entity fragment and no iframe establish prose preservation and source-link rewriting. Direct-child assertions establish the demo crate beneath the landing and symbols beneath its crate. The guide's rewritten URL and Design/Crates/demo parent_names establish companion placement. Decoded generated book-data home equals design/crates/index.html. Captured chapters recursively indexes real output and rejects duplicates; script_data parses actual asset JSON; substantive assertions remain visible in the test body.

These assertions and current source account for preserved handwritten content, curated rendered chapter/entity links, generated hierarchy, absence of an explorer replacement on the landing and .sage destination rewriting. No TODO/N/A entries exist. The unrelated marker introduces no change to those conclusions. No source edits, formatting, test runs or workspace build were performed in this followup; executed review start/read, capture comparison and record only. 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