meta.book.chapter_names

An anchor’s full name combines its chapter namespace with the local name written at its definition. The namespace is derived from the chapter source path relative to Design, removing the extension and joining path components with dots. For example, local point_excerpts in design/meta/anchors.md names meta.anchors.point_excerpts. The same derivation applies to .sage chapters. Section headings, chapter titles, and sidebar ordering do not change these names; only the source path and local name contribute. Ambiguous namespace derivations or duplicate full names are errors.

The intended Markdown source spelling is local:

{anchor}`point_excerpts`
A point reference displays its marker line and the next five source lines.

Rust references use the resolved full name, such as #[sage::test(meta.anchors.point_excerpts)] or <code>// {anchor}`meta.anchors.point_excerpts`</code>. Filename components must normalize to ASCII identifiers; different source paths that normalize to the same chapter namespace are rejected.

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

Implementation

Implemented crates/sage-meta/src/spec.rs:591–596

sage_meta::spec · lib:sage_meta

#![allow(unused)]
fn main() {
// {anchor}`meta.book.chapter_names`
pub fn chapter_namespace(file: &str) -> Result<String, String> {
    let path = file
        .strip_prefix("design/")
        .ok_or("specification chapters must be below design/")?;
    let mut parts = path.split('/').map(str::to_owned).collect::<Vec<_>>();

}

See more source ↗

TODO crates/sage-meta/tests/spec_plan.rs:198–205

sage_meta::todo · test:spec_plan

TODO: Qualify local names in .md/.sage chapters, reject namespace collisions, and ignore display-title/sidebar-order changes.

#![allow(unused)]
fn main() {
    // {anchor}`meta.book.chapter_names`<<
    #[test]
    #[sage::test(meta.book.chapter_names)]
    fn names_derive_from_chapter_paths() {
        // TODO: Qualify local names in .md/.sage chapters, reject namespace
        // collisions, and ignore display-title/sidebar-order changes.
    }
    // >>

}

See more source ↗

Tests and review

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

Implemented sage_meta::canonical_inventory_uses_configured_chapters_and_local_names

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.book.chapter_names)]
#[sage::test(meta.book.authority)]
#[sage::test(meta.book.shared_model)]
#[sage::test(meta.anchors.unique_names)]
fn canonical_inventory_uses_configured_chapters_and_local_names() {
    let fixture = BookFixture::new(
        "- [Design](design/README.md)\n  - [Meta](design/meta/README.md)\n  - [Rules](design/meta/call-rules.md)\n  - [Tenets](design/tenets.md)\n- [RFD](rfds/proposal.md)\n",
    );
    fixture.write("design/README.md", "# Design\n");
    fixture.write(
        "design/meta/README.md",
        "{anchor}`authority` Meta is normative.\n",
    );
    fixture.write(
        "design/meta/call-rules.md",
        "{anchor}`declared` Calls are declared.\n",
    );
    fixture.write("design/tenets.md", "{anchor}`not_a_rule` A motivation.\n");
    fixture.write(
        "rfds/proposal.md",
        "{anchor}`not_a_rule` Historical rationale.\n",
    );
    let index = fixture.load();
    assert!(index.diagnostics.is_empty(), "{:?}", index.diagnostics);
    assert_eq!(
        index.anchors.keys().map(String::as_str).collect::<Vec<_>>(),
        ["meta.authority", "meta.call_rules.declared"]
    );
    assert_eq!(index.chapters["design/meta/README.md"].namespace, "meta");
    assert_eq!(
        index.anchors["meta.authority"].context_url,
        "design/meta/index.html#meta.authority"
    );
    assert_eq!(index.documents, 3);
}
}

See more source ↗

Implemented sage_meta::chapter_namespace_collisions_and_duplicate_local_rules_are_errors

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.book.chapter_names)]
#[sage::test(meta.anchors.unique_names)]
fn chapter_namespace_collisions_and_duplicate_local_rules_are_errors() {
    let fixture =
        BookFixture::new("- [One](design/call-rules.md)\n- [Two](design/call_rules.md)\n");
    fixture.write("design/call-rules.md", "{anchor}`same` First rule.\n");
    fixture.write("design/call_rules.md", "{anchor}`same` Second rule.\n");
    let index = fixture.load();
    assert!(
        index
            .diagnostics
            .iter()
            .any(|error| error.message.contains("namespace `call_rules` collides"))
    );
    assert!(index.diagnostics.iter().any(|error| {
        error
            .message
            .contains("duplicate specification anchor `call_rules.same`")
    }));
    assert!(sage_meta::spec::chapter_namespace("design/bad.name.md").is_err());
    assert!(sage_meta::spec::chapter_namespace("outside/design.md").is_err());
}
}

See more source ↗

Implemented sage_meta::distinct_namespaces_cannot_publish_the_same_output_url

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.book.chapter_names)]
fn distinct_namespaces_cannot_publish_the_same_output_url() {
    let fixture = BookFixture::new("- [Landing](design/README.md)\n- [Other](design/index.md)\n");
    fixture.write("design/README.md", "# Landing\n");
    fixture.write("design/index.md", "# Other\n");
    let index = fixture.load();
    assert!(index.diagnostics.iter().any(|diagnostic| {
        diagnostic
            .message
            .contains("chapter output URL `design/index.html` collides")
    }));
}
}

See more source ↗

TODO sage_meta::todo::names_derive_from_chapter_paths

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

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(meta.book.chapter_names)]
    fn names_derive_from_chapter_paths() {
        // TODO: Qualify local names in .md/.sage chapters, reject namespace
        // collisions, and ignore display-title/sidebar-order changes.
    }
}

See more source ↗

Review: Accepted · final_quality.

Fresh final marker followup of meta.book.chapter_names. Preserved prior input/output, started fresh, read the full claim, both implementation entries and all four associated tests, and recaptured BookFixture lines 536–565 and workspace.rs. Compared every fragment by path/selector and both metadata sets. The only delta is an implementation_references association comment in spec.rs. All claim, behavior, tests, helpers, TODO text and metadata are unchanged; no fragments were removed. This isolated marker was assessed against the complete prior findings below.

The ordinary chapter_namespace implementation strips design/, accepts .md/.sage, treats README as its directory, normalizes hyphens to underscores, rejects dotted or invalid ASCII identifier components and joins components with dots. valid_anchor_name enforces ASCII letter/underscore first and ASCII alphanumeric/underscore remainder; qualified combines namespace and local definition. Workspace loading uses SUMMARY destination paths rather than display labels and applies the shared namespace/add_chapter_text path to Markdown and Sage. Headings, titles, sidebar order and source positions do not supply identity. Distinct source paths normalizing to one namespace diagnose collisions; add_chapter_text separately diagnoses duplicate full names, and output URL collisions diagnose distinct namespaces publishing the same page. Rust references resolve exact full inventory keys. The added marker annotates that existing lookup behavior without changing it.

Three ordinary tests provide positive/negative assertions. canonical_inventory_uses_configured_chapters_and_local_names checks exact names meta.authority and meta.call_rules.declared from README/hyphenated Markdown local definitions, the README namespace/context URL and document count. Captured BookFixture/workspace setup uses actual files and configured manual source root. chapter_namespace_collisions_and_duplicate_local_rules_are_errors creates call-rules.md and call_rules.md, requires both namespace and duplicate-full-name diagnostics and rejects an embedded-dot filename and outside-Design path. distinct_namespaces_cannot_publish_the_same_output_url checks README versus index yields the exact output collision diagnostic.

The second implementation entry and fourth test are the explicit TODO names_derive_from_chapter_paths. They retain the broader Markdown/Sage parity and presentation-invariance matrix. Ordinary Markdown qualification/collision assertions do not discharge that TODO. Completing it requires owned Sage fixtures and before/after heading/title/sidebar-order changes with exact unchanged full-name assertions, plus full-name-reference validation and broader invalid ASCII-component cases. The existing comment names format qualification, collisions and display/order invariance; its empty body is not behavioral proof. No N/A entries exist. Current code supports the claim mechanism, while complete behavioral coverage remains visibly deferred.

No source edits, formatting, tests or workspace build were performed in this followup; executed review start/read, capture comparison and record only. The marker-only delta adds no new defect or uncovered behavior. 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