meta.book.index_rows

The Design section includes an automatically generated index of every active anchor. Each anchor has a main row containing the final component of its name, with the namespace supplied by the enclosing group or page heading, and separate implementation and test statuses. The name’s tooltip shows its full identity. A disclosure control opens a second row containing its rendered specification text. Hiding the text preserves the main row. The linked name opens that anchor’s own page, independently of expanding or collapsing the text.

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

Implementation

Implemented crates/sage-meta/src/book/anchors.rs:283–288

sage_meta::book::anchors · bin:sage-meta

#![allow(unused)]
fn main() {
    // {anchor}`meta.book.index_rows`
    // {anchor}`meta.book.index_groups`
    fn table(&self, prefix: &str, url: &str, selected: Option<&str>) -> String {
        let names = self.names(prefix);
        let mut rows = String::new();
        let mut groups = BTreeSet::new();

}

See more source ↗

TODO crates/sage-meta/tests/spec_plan.rs:216–223

sage_meta::todo · test:spec_plan

TODO: Render every rule with separate implementation/test statuses and independently operable text disclosure and anchor-page links.

#![allow(unused)]
fn main() {
    // {anchor}`meta.book.index_rows`<<
    #[test]
    #[sage::test(meta.book.index_rows)]
    fn anchor_index_rows_show_rules_and_status() {
        // TODO: Render every rule with separate implementation/test statuses and
        // independently operable text disclosure and anchor-page links.
    }
    // >>

}

See more source ↗

Tests and review

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

Implemented sage_meta::generated_anchor_pages_join_namespaces_claims_implementations_tests_and_reviews

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.book.index_namespace_pages)]
#[sage::test(meta.book.index_rows)]
#[sage::test(meta.book.index_groups)]
#[sage::test(meta.book.index_status)]
#[sage::test(meta.anchors.anchor_pages)]
#[sage::test(meta.anchors.context_navigation)]
fn generated_anchor_pages_join_namespaces_claims_implementations_tests_and_reviews() {
    let fixture = Fixture::new("manual");
    fixture.doc("SUMMARY.md", "# Summary\n\n- [Design](design/README.md)\n  - [Crates](design/crates/README.md)\n  - [Meta](design/meta.md)\n  - [Anchors](design/anchor/README.md)\n  - [Handwritten](design/handwritten.md)\n");
    let definitions = "# Meta\n\n{anchor}`foo`\nThe **parent rule** with `code`.\n\n{anchor}`foo.bar`\nThe child rule.\n\n{anchor}`other.leaf`\nA rule in a sibling branch.\n";
    fixture.doc("design/meta.md", definitions);
    fixture.doc("design/anchor/README.md", "# Anchors\n");
    let source = std::fs::read_to_string(fixture.root.join("src/lib.rs")).unwrap();
    fixture.write(
        "src/lib.rs",
        &format!(
            "{source}\n{}",
            r#"
// {anchor}`meta.foo`
fn implementation() {}
#[test]
#[sage::test(meta.foo)]
fn behavior() { assert_eq!(2 + 2, 4); }
mod todo {
    // {anchor}`meta.foo`
    // TODO: Additional implementation and edge case.
    #[test]
    #[sage::test(meta.foo)]
    fn remaining() {}
}
mod not_applicable {
    // {anchor}`meta.foo.bar`<<
    // N/A: This requirement describes an editorial convention.
    #[test]
    #[sage::test(meta.foo.bar)]
    fn editorial() {}
    // >>

    // {anchor}`meta.other.leaf`
    // N/A: This sibling rule is also editorial.
    #[test]
    #[sage::test(meta.other.leaf)]
    fn sibling_editorial() {}
}
"#
        ),
    );
    for anchor in ["meta.foo", "meta.foo.bar", "meta.other.leaf"] {
        sage_meta::review::start(&fixture.root, anchor, vec![]).unwrap();
        if anchor != "meta.other.leaf" {
            sage_meta::review::record(
                &fixture.root,
                anchor,
                &sage_meta::review::ValidationOutput {
                    reviewer: "fixture".into(),
                    report: "Explicit placeholder status reviewed.\n\nLiteral <p> & report detail."
                        .into(),
                    requested_edits: if anchor == "meta.foo.bar" {
                        vec!["Clarify the editorial explanation.".into()]
                    } else {
                        vec![]
                    },
                },
            )
            .unwrap();
        }
    }
    let mut input = fixture.input("items");
    let children = input[1]["items"][0]["Chapter"]["sub_items"]
        .as_array_mut()
        .unwrap();
    children.push(json!({"Chapter":{"name":"Meta","content":definitions,"path":"design/meta.md","source_path":"design/meta.md","number":[2,3],"parent_names":["Design"],"sub_items":[]}}));
    children.push(json!({"Chapter":{"name":"Anchors","content":"# Anchors\n","path":"design/anchor/README.md","source_path":"design/anchor/README.md","number":[2,4],"parent_names":["Design"],"sub_items":[]}}));
    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 overview = entries["design/anchor/README.md"]["content"]
        .as_str()
        .unwrap();
    assert!(overview.contains("data-group=\"meta\""));
    assert!(overview.contains("data-group=\"meta.foo\""));
    assert!(overview.contains("3 anchors"));
    assert!(overview.contains("1 Implemented"));
    assert!(overview.contains("1 TODO"));
    assert!(overview.contains("2 N/A"));
    assert!(overview.contains("aria-controls=\"anchor-text-meta-foo\""));
    assert!(overview.contains("<strong>parent rule</strong>"));
    let page = entries["design/anchor/meta/foo.md"]["content"]
        .as_str()
        .unwrap();
    assert!(page.contains(
        "Explicit placeholder status reviewed.<br><br>Literal &lt;p&gt; &amp; report detail."
    ));
    assert!(!page.contains("<p>Explicit placeholder status reviewed.\n"));
    let table_rows = |content: &str| {
        content
            .split("data-anchor=\"")
            .skip(1)
            .map(|tail| tail.split('"').next().unwrap().to_owned())
            .collect::<Vec<_>>()
    };
    assert_eq!(
        table_rows(overview),
        ["meta.foo", "meta.foo.bar", "meta.other.leaf"]
    );
    for prefix in ["meta", "meta/foo", "meta/other"] {
        assert!(entries.contains_key(format!("design/anchor/{prefix}.md").as_str()));
    }
    assert_eq!(
        table_rows(
            entries["design/anchor/meta.md"]["content"]
                .as_str()
                .unwrap()
        ),
        ["meta.foo", "meta.foo.bar", "meta.other.leaf"]
    );
    assert_eq!(
        table_rows(
            entries["design/anchor/meta/other.md"]["content"]
                .as_str()
                .unwrap()
        ),
        ["meta.other.leaf"]
    );
    assert!(entries.contains_key("design/anchor/meta/other/leaf.md"));
    let leaf = entries["design/anchor/meta/foo.md"];
    assert_eq!(
        leaf["sub_items"].as_array().unwrap().len(),
        1,
        "a rule can also be a namespace"
    );
    assert!(
        leaf["source_path"].is_null(),
        "generated views have no canonical source"
    );
    let content = leaf["content"].as_str().unwrap();
    assert_eq!(table_rows(content), ["meta.foo", "meta.foo.bar"]);
    assert!(content.contains("../../meta.html#meta.foo"));
    assert!(content.contains("fn implementation()"));
    assert!(content.contains("fn behavior() { assert_eq!(2 + 2, 4); }"));
    assert!(content.contains("See more source"));
    assert!(content.contains("Review: <strong>Accepted</strong>"));
    assert!(content.contains("Additional implementation and edge case."));
    let child = entries["design/anchor/meta/foo/bar.md"]["content"]
        .as_str()
        .unwrap();
    assert!(child.contains("N/A: This requirement describes an editorial convention."));
    assert!(child.contains("Review: <strong>Changes requested</strong>"));
    assert!(child.contains("Clarify the editorial explanation."));
    let unfinished = entries["design/anchor/meta/other/leaf.md"]["content"]
        .as_str()
        .unwrap();
    assert!(unfinished.contains("Review: <strong>Unfinished</strong>"));
    assert!(content.contains("data-status=\"TODO\""));
    assert!(child.contains("data-status=\"N/A\""));
    let definition = entries["design/meta.md"]["content"].as_str().unwrap();
    assert!(definition.contains("href=\"anchor/meta/foo.html\""));
    let inventory = sage_meta::spec::SpecIndex::load_workspace(&fixture.root).unwrap();
    assert_eq!(
        inventory.anchors.len(),
        3,
        "rendered copies never become definitions"
    );
}
}

See more source ↗

TODO sage_meta::todo::anchor_index_rows_show_rules_and_status

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

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(meta.book.index_rows)]
    fn anchor_index_rows_show_rules_and_status() {
        // TODO: Render every rule with separate implementation/test statuses and
        // independently operable text disclosure and anchor-page links.
    }
}

See more source ↗

Review: Accepted · final_quality.

Fresh final marker followup of meta.book.index_rows. Preserved previous input/output, started fresh and assessed the complete claim, ordinary table implementation, TODO implementation region, ordinary generated-page test and TODO test. Recaptured every prior additional dependency: anchors.js, fixture helpers, Markdown rendering, review status inventory, preprocessor invocation, escaping, canonical URLs and relative URLs. Compared all fragments by path/selector and both metadata sets. The only captured differences are one-line boundary shifts in two spec.rs line ranges: incidental leading context is added and trailing neighboring-function context removed. The complete relevant chapter URL/namespace and relative_url helpers remain present and unchanged. All other captures, claim, association metadata and tests are identical; none were removed. This reassessment accounts for actual captured changes rather than blindly refreshing a verdict.

The ordinary table implementation builds the Design Anchors index from canonical SpecIndex names. Each active name has a main data-anchor row and separate initially hidden data-anchor-text row. The main row shows its final component with namespace groups/page heading providing context, full identity in title, and a relative link to its own generated anchor page. Separate cells derive implementation and test status sets independently, including Missing where empty; runtime results are not used. The claim renderer supplies Markdown text safely within the HTML table. Disclosure buttons use aria-controls/aria-expanded and sit adjacent to name links. Captured anchors.js tracks expandedText separately from collapsed groups: toggling text affects its second row while main-row visibility depends only on enclosing groups. Its delegated handler responds to buttons, leaving name links to navigate normally. Source inspection supports these mechanisms but is not browser interaction evidence.

The ordinary generated_anchor_pages_join_namespaces_claims_implementations_tests_and_reviews test constructs three canonical anchors, including a rule namespace, nested child and sibling, with ordinary/TODO/N/A source entries and varied review outcomes. It invokes real preprocessing and asserts exact root and descendant row lists, three-anchor count, groups/status summaries, an aria-controls target, rendered strong text, generated namespace/leaf pages and unchanged canonical inventory size. Evidence/review/context assertions give additional page coverage but do not directly establish every final-component label/title, asymmetric status column, or DOM click result. Fixture helpers expose actual subprocess output and recursive chapter inspection.

The assertion-free TODO anchor_index_rows_show_rules_and_status remains both implementation and test evidence for those missing focused scenarios. Completing it requires generated DOM assertions for each label/full-name tooltip and separate status cell, disclosure open/close checks that preserve the main row, and name-link navigation without toggling. Existing rendered enumeration and source inspection do not discharge this browser/integration TODO. There are no N/A entries. Thus all requirements are supported by inspected mechanisms and ordinary assertions or remain explicitly deferred by the existing TODO, whose scope is unchanged.

No source edits, formatting, tests, browser sessions or workspace build were performed. Executed review start/read, capture comparisons and record only. The incidental capture-boundary shifts introduce no behavioral change or lost relevant dependency. 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