meta.book.sage_chapters

.sage sources reside within the book’s configured source directory and each is rendered as a Design chapter. Design contains a Crates chapter listing the modeled crates. Each crate has an overview chapter showing its purpose, dependencies, and modules, with its remaining .sage source chapters nested beneath it. These chapters present the design/crates/ source tree using the architecture browser specified below. Each source has one chapter in the shared inventory; rendering does not create a second canonical copy. Rendering requires no hand-maintained Markdown copies of .sage sources and the built book works without a running Sage server.

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

Implementation

TODO crates/sage-meta/tests/spec_plan.rs:125–132

sage_meta::todo · test:spec_plan

TODO: Render .sage chapters with shared search, declaration links, and Rust context, independent of how the Crates chapter is inserted.

#![allow(unused)]
fn main() {
    // {anchor}`meta.book.sage_chapters`<<
    #[test]
    #[sage::test(meta.book.sage_chapters)]
    fn sage_sources_render_as_book_chapters() {
        // TODO: Render .sage chapters with shared search, declaration links,
        // and Rust context, independent of how the Crates chapter is inserted.
    }
    // >>

}

See more source ↗

Tests and review

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

Implemented sage_meta::generates_crate_and_module_chapters_for_both_mdbook_protocols

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.book.sage_chapters)]
#[sage::test(meta.anchors.book_explorer)]
fn generates_crate_and_module_chapters_for_both_mdbook_protocols() {
    for items_key in ["items", "sections"] {
        let fixture = Fixture::new("manual/src");
        let input = fixture.input(items_key);
        let book = fixture.book(items_key);
        let entries = chapters(book[items_key].as_array().unwrap());
        assert_eq!(
            entries.keys().map(String::as_str).collect::<Vec<_>>(),
            [
                "design/README.md",
                "design/crates/README.md",
                "design/crates/demo/crate.sage",
                "design/crates/demo/symbols.sage",
                "design/crates/support/crate.sage",
                "design/handwritten.md",
            ]
        );
        assert_eq!(
            entries["design/handwritten.md"],
            &input[1][items_key][0]["Chapter"]["sub_items"][1]["Chapter"]
        );
        let overview = entries["design/crates/demo/crate.sage"];
        assert_eq!(overview["name"], "demo");
        assert_eq!(overview["number"], json!([2, 1, 1]));
        assert_eq!(overview["parent_names"], json!(["Design", "Crates"]));
        assert_eq!(overview["sub_items"].as_array().unwrap().len(), 1);
        let module = entries["design/crates/demo/symbols.sage"];
        assert_eq!(module["name"], "symbols");
        assert_eq!(module["number"], json!([2, 1, 1, 1]));
        assert_eq!(module["parent_names"], json!(["Design", "Crates", "demo"]));
        for (path, chapter) in entries.iter().filter(|(path, _)| path.ends_with(".sage")) {
            assert_eq!(
                Path::new(chapter["path"].as_str().unwrap()).with_extension("html"),
                Path::new(path).with_extension("html")
            );
            let content = chapter["content"].as_str().unwrap();
            assert!(content.contains("<iframe"), "{path}: {content}");
            assert!(content.contains("data-sage-full-page"));
            assert!(content.contains("../../../sage-explorer.html"));
            assert!(!fixture.source.join(path).with_extension("md").exists());
        }
        let overview_text = overview["content"].as_str().unwrap();
        assert!(overview_text.contains("Compile demo programs."));
        assert!(overview_text.contains("support"));
        let module_text = module["content"].as_str().unwrap();
        assert!(module_text.contains("Item"));
        assert!(module_text.contains("A compiler symbol."));
        assert!(fixture.asset().is_file());
    }
}
}

See more source ↗

TODO sage_meta::todo::sage_sources_render_as_book_chapters

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

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(meta.book.sage_chapters)]
    fn sage_sources_render_as_book_chapters() {
        // TODO: Render .sage chapters with shared search, declaration links,
        // and Rust context, independent of how the Crates chapter is inserted.
    }
}

See more source ↗

Review: Accepted · Codex /root/anchor_094.

Fresh followup review of the complete sage_chapters claim. Saved and read the previous report/inputs before start, recaptured all prior dependencies, and compared every fragment. The only delta is the unrelated envelope-clause prerequisite comment in spec_plan.rs. The claim, associated ordinary and TODO tests, renderer book.rs, complete book test source, fixture helpers, and captured design/review context are unchanged. No rendering behavior changed.

Full requirement assessment remains partial implementation with explicit deferral. The ordinary test generates actual temporary sources under configured manual/src, supplies matching book.toml/mdBook context, and runs both items and sections protocols. Its exact six-entry chapter inventory includes Design, Crates, two crate overviews, the demo module and original handwritten chapter. Recursive chapters rejects duplicate paths, so equality establishes one occurrence in this fixture. Direct assertions check crate/module names, numbers, parent hierarchy and one nested child. Overview content must include purpose and support dependency; module content must include its declaration and prose. Each Sage chapter must resolve to its corresponding HTML output, contain iframe/full-page controls and the relative shared explorer URL, and have no sibling hand-maintained Markdown file. The local explorer asset must exist, and handwritten chapter JSON remains unchanged.

These assertions substantiate configured placement, basic Crates/overview nesting, source uniqueness in this fixture, static browser embedding, generated local asset and no Markdown copies. They do not execute browser interaction, separately assert the Modules field, exercise every shared-inventory/insertion configuration, or prove offline browser search/navigation/Rust context. Captured book.rs supplies partial supporting machinery: configured source/model loading, generated crate/module hierarchy, source outline purpose/dependencies/modules, explorer embedding and local asset generation. It is supplemental code context, not an ordinary implementation association for complete delivery. The renderer's existence cannot erase the anchor's explicit deferred status.

The sole associated implementation is the TODO region todo::sage_sources_render_as_book_chapters; its paired empty test is also TODO. Its comment expressly defers shared search, declaration links and Rust context independent of Crates chapter insertion. Completion requires associated integrated rendering/inventory behavior and substantive browser-level assertions for those features and server-independent operation across insertion scenarios. The current fixture invokes only preprocessing and demonstrates no server requirement for generation; actual built-book offline operation is still outside its assertions. The ordinary test remains useful partial coverage; neither that passing source test nor the empty TODO establishes the full claim. No N/A entries exist.

The captured Fixture writes real Cargo/book/model files and runs the actual preprocess executable, checking success and decoding output; the chapter helper detects duplicate paths. Both associated test bodies and the entire prior claim accounting were reviewed against unchanged current evidence. The comment-only delta has no effect on any requirement. This review ran start/read/record and source inspection only, no behavior tests, build or browser; central suite execution is separately reported. No source edits or 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