meta.book.index_groups

The anchor index groups entries hierarchically by their name prefixes, such as meta and meta.book. Each group can reveal or hide all its descendants, and reports implementation and test status counts for that subtree. Grouping and counts are derived from the same active anchors displayed in the index.

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

Implementation

Implemented crates/sage-meta/src/book/anchors.rs:284–289

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

#![allow(unused)]
fn main() {
    // {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();
        for name in &names {

}

See more source ↗

TODO crates/sage-meta/tests/spec_plan.rs:225–232

sage_meta::todo · test:spec_plan

TODO: Expand/collapse each prefix subtree and verify counts against its actual descendant anchors and their implementation/test entries.

#![allow(unused)]
fn main() {
    // {anchor}`meta.book.index_groups`<<
    #[test]
    #[sage::test(meta.book.index_groups)]
    fn anchor_index_prefix_groups() {
        // TODO: Expand/collapse each prefix subtree and verify counts against its
        // actual descendant anchors and their implementation/test entries.
    }
    // >>

}

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_prefix_groups

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

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(meta.book.index_groups)]
    fn anchor_index_prefix_groups() {
        // TODO: Expand/collapse each prefix subtree and verify counts against its
        // actual descendant anchors and their implementation/test entries.
    }
}

See more source ↗

Review: Accepted · Codex /root/anchor_094.

Fresh followup assessment of meta.book.index_groups. Before resetting validation I saved/read the previous complete report and inputs. Compared fresh captures with every previous fragment, including recaptured JavaScript and Fixture/chapters helpers. Claim, ordinary test, TODO test, JavaScript and helpers are unchanged. anchors.rs changed only by evidence_status/placeholder_status association comments on page(); spec_plan.rs changed only by the unrelated explicit envelope-clause ownership prerequisite comment. There is no grouping, counting, interaction or test behavior delta.

Full claim assessment: the index must form hierarchical name-prefix groups, allow descendant visibility control, provide separate implementation/test subtree status counts, and use the same active anchor set for groups/counts/rows. The ordinary table implementation obtains names from SpecIndex anchor keys, filters using equality or a dot-delimited prefix, emits each proper prefix once, and selects members from that same names list. Thus sibling string prefixes do not leak and namespace-only groups do not invent anchor rows. Each group has a toggle and independently calculated implementation/test count cells. counts iterates names and the set of statuses present per anchor, so repeated sites do not inflate one status, while a mixed-status anchor contributes to each applicable status. The captured JavaScript maintains per-index collapsed prefixes and separately expanded text. It hides descendant group/anchor/text rows through dot-delimited matching, supports individual and all-group controls, and updates aria state. An anchor identical to a group name is not its own descendant; retained nested collapse state and text-disclosure state remain intentional. These current implementations support the same interpretation as the prior assessment.

Both implementation entries and both tests were reviewed. The ordinary generated_anchor_pages_join_namespaces_claims_implementations_tests_and_reviews test constructs three canonical anchors across parent/child/sibling branches and ordinary/TODO/N/A associations. Assertions require meta and meta.foo group markup, three anchors, visible status counts, exact overview/scoped row membership, sibling isolation, a rule which also owns a namespace, and exactly three canonical definitions after generation. Fixture runs the actual preprocess executable against a temporary workspace; chapters recursively collects paths and rejects duplicates. Assertions are meaningful for generated grouping, membership and basic counts, but the substring count checks do not independently prove every group/column count, and this Rust test does not execute browser interaction.

The associated TODO implementation region and todo::anchor_index_prefix_groups test explicitly retain exhaustive subtree expand/collapse and count verification. The empty body is not proof. Completion requires a DOM/browser fixture with nested/sibling groups, independent implementation/test status combinations, per-group expected counts, and visibility transitions including text rows. This remains a justified visible coverage deferral, not a claim that interaction tests now exist. No N/A entries exist.

The actual marker/comment-only changes do not affect any claim obligation, and all other relied-on captures were verified unchanged. No source changes or test executions occurred in this review; central suites are separately reported. This is a complete current source assessment with preserved limitations, not a blind refresh. 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