meta.reviews.input_format

The input contains these fields:

FieldMeaning
promptExact verification prompt.
coordinator_instructionsAdditional instructions supplied to the reviewer, in order.
fragmentsUniform collection of source fragments, including the claim, tests, implementation context, and additional reads.
implementationsComplete implementation association metadata.
testsComplete associated test metadata.

The following anchors define each part. Source text belongs in the uniform fragment collection; association metadata identifies the evidence and its declared status. The collection contains both initial context and later reads.

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

Implementation

Implemented crates/sage-meta/src/review.rs:45–50

sage_meta::review · lib:sage_meta

#![allow(unused)]
fn main() {
// {anchor}`meta.reviews.input_format`
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ReviewInput {
    pub prompt: String,
    pub coordinator_instructions: Vec<String>,

}

See more source ↗

Tests and review

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

Implemented sage_meta::accepted_placeholder_reports_preserve_todo_and_na_evidence

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.decisions)]
#[sage::test(meta.reviews.review_scope)]
#[sage::test(meta.reviews.input_format)]
#[sage::test(meta.reviews.test_source)]
fn accepted_placeholder_reports_preserve_todo_and_na_evidence() {
    for (module, expected) in [
        ("todo", TestStatus::Todo),
        ("not_applicable", TestStatus::NotApplicable),
    ] {
        let fixture = Fixture::new();
        fixture.write("src/behavior.rs", &format!("mod {module} {{\n// {{anchor}}`demo.rule`\n// Deferred until the concrete backend exists; editorial for N/A.\nfn placeholder() {{}}\n}}"));
        fixture.write("src/tests.rs", &format!("mod {module} {{\n// Deferred until the concrete backend exists; editorial for N/A.\n#[test] #[sage::test(demo.rule)] fn placeholder() {{}}\n}}"));
        let input = fixture.start();
        assert_eq!(input.tests[0].status, expected);
        assert_eq!(input.implementations[0].status, expected);
        assert!(
            input.implementations[0]
                .explanation
                .as_ref()
                .unwrap()
                .contains("backend")
        );
        let mut output = Fixture::report();
        output.report = "The explicit placeholder explains why concrete evidence is unavailable and names its prerequisite. This accepts the stated gap, not implemented behavior.".into();
        review::record(&fixture.0, "demo.rule", &output).unwrap();
        let check = sage_meta::check(&fixture.0);
        assert!(check.is_valid());
        let stage = check.review.unwrap();
        assert_eq!(stage.approved, 0);
        assert_eq!(
            (stage.todo, stage.not_applicable),
            if module == "todo" { (1, 0) } else { (0, 1) }
        );
    }
}
}

See more source ↗

Implemented sage_meta::added_or_removed_associations_invalidate_unchanged_saved_fragments

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.complete_test_set)]
#[sage::test(meta.reviews.fragment_associations)]
#[sage::test(meta.reviews.input_format)]
#[sage::test(meta.reviews.review_diagnostics)]
#[sage::test(meta.reviews.staleness)]
fn added_or_removed_associations_invalidate_unchanged_saved_fragments() {
    let fixture = Fixture::new();
    fixture.approve();
    let original = fixture.input();
    let second = "#[test] #[sage::test(demo.rule)] fn second() { assert_eq!(1 + 3, 4); }";
    fixture.write("src/tests.rs", &format!("{TEST}\n{second}"));
    let error = sage_meta::check(&fixture.0)
        .ensure_valid()
        .unwrap_err()
        .to_string();
    assert!(error.contains("demo.rule"), "{error}");
    assert!(error.contains("test associations"), "{error}");
    assert!(error.contains("sage-review-checklist/SKILL.md"), "{error}");
    let current = fixture.start();
    assert_eq!(current.tests.len(), 2);
    assert_eq!(current.tests, fixture.start().tests);
    assert_eq!(
        original.tests[0],
        *current
            .tests
            .iter()
            .find(|t| t.rust_path.ends_with("verifies_result"))
            .unwrap()
    );
    review::record(&fixture.0, "demo.rule", &Fixture::report()).unwrap();
    fixture.write("src/tests.rs", TEST);
    let error = sage_meta::check(&fixture.0)
        .ensure_valid()
        .unwrap_err()
        .to_string();
    assert!(error.contains("demo.rule"), "{error}");
    assert!(error.contains("test associations"), "{error}");
    assert!(error.contains("sage-review-checklist/SKILL.md"), "{error}");
    fixture.approve();
    fixture.write("src/lib.rs", "#[sage::item(crate)] mod model {}\nmod behavior;\n#[cfg(test)] mod tests;\n// {anchor}`demo.rule`\nfn another_implementation() {}\n");
    let error = sage_meta::check(&fixture.0)
        .ensure_valid()
        .unwrap_err()
        .to_string();
    assert!(error.contains("demo.rule"), "{error}");
    assert!(error.contains("implementation associations"), "{error}");
    assert!(error.contains("sage-review-checklist/SKILL.md"), "{error}");
    assert_eq!(fixture.start().implementations.len(), 2);
}
}

See more source ↗

Implemented sage_meta::initial_context_preserves_instructions_and_exact_uniform_fragments

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.input_format)]
#[sage::test(meta.reviews.input_fragments)]
#[sage::test(meta.reviews.fragment_format)]
#[sage::test(meta.reviews.review_instructions)]
#[sage::test(meta.reviews.review_scope)]
#[sage::test(meta.reviews.source_representation)]
#[sage::test(meta.reviews.preparation)]
fn initial_context_preserves_instructions_and_exact_uniform_fragments() {
    let fixture = Fixture::new();
    let instructions = vec![
        "Check all scenarios.\nKeep this newline.".into(),
        "Account for TODO rationale.".into(),
    ];
    let input = review::start(&fixture.0, "demo.rule", instructions.clone()).unwrap();
    assert_eq!(input.coordinator_instructions, instructions);
    assert_eq!(input.prompt, review::PROMPT);
    assert_eq!(input, fixture.input());
    let claim = input
        .fragments
        .iter()
        .find(|f| matches!(&f.selector, Selector::Claim { anchor_id } if anchor_id == "demo.rule"))
        .unwrap();
    assert_eq!(claim.path, "md/design/README.md");
    assert_eq!(claim.contents.join("\n"), "The result is four.");
    let implementation = input
        .fragments
        .iter()
        .find(|f| f.path == "src/behavior.rs" && matches!(f.selector, Selector::WholeFile))
        .unwrap();
    assert_eq!(
        implementation.contents.join("\n"),
        std::fs::read_to_string(fixture.0.join("src/behavior.rs")).unwrap()
    );
    let test = input
        .fragments
        .iter()
        .find(|f| matches!(f.selector, Selector::Test { .. }))
        .unwrap();
    assert_eq!(test.path, "src/tests.rs");
    assert_eq!(test.contents.join("\n"), TEST);
    assert!(
        !input
            .fragments
            .iter()
            .any(|f| f.path == "src/tests.rs" && matches!(f.selector, Selector::WholeFile))
    );
    assert_eq!(input.implementations.len(), 1);
    assert_eq!(input.implementations[0].file, "src/behavior.rs");
    assert_eq!(input.implementations[0].status, TestStatus::Ordinary);
    assert_eq!(input.tests.len(), 1);
}
}

See more source ↗

Implemented sage_meta::input_keeps_complete_association_metadata_and_appends_context_in_one_collection

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.input_format)]
#[sage::test(meta.reviews.review_scope)]
#[sage::test(meta.reviews.input_fragments)]
#[sage::test(meta.reviews.preparation)]
fn input_keeps_complete_association_metadata_and_appends_context_in_one_collection() {
    let fixture = Fixture::new();
    fixture.write(
        "src/lib.rs",
        "#[sage::item(crate)] mod model {}\n#[cfg(unix)] mod behavior;\n#[cfg(test)] mod tests;\n",
    );
    let initial = fixture.start();
    let implementation = &initial.implementations[0];
    assert_eq!(implementation.crate_name, "demo");
    assert_eq!(implementation.target, "lib:demo");
    assert_eq!(implementation.module, "demo::behavior");
    assert_eq!(implementation.file, "src/behavior.rs");
    assert!(implementation.cfg.iter().any(|cfg| cfg.contains("unix")));
    assert!(
        implementation
            .excerpt
            .join("\n")
            .contains("pub fn result() -> u32 { 4 }")
    );
    assert!(!implementation.region);
    assert_eq!(implementation.status, TestStatus::Ordinary);
    assert_eq!(implementation.explanation, None);
    let test = &initial.tests[0];
    assert_eq!(test.crate_name, "demo");
    assert_eq!(test.target, "lib:demo");
    assert_eq!(test.rust_path, "demo::tests::verifies_result");
    assert_eq!(test.file, "src/tests.rs");
    assert!(test.cfg.iter().any(|cfg| cfg.contains("test")));
    assert_eq!(test.status, TestStatus::Ordinary);
    fixture.write("helper.txt", "extra context\n");
    assert_eq!(
        review::capture_read(&fixture.0, "demo.rule", "helper.txt", Selector::WholeFile).unwrap(),
        "extra context\n"
    );
    let captured = fixture.input();
    assert_eq!(captured.implementations, initial.implementations);
    assert_eq!(captured.tests, initial.tests);
    assert_eq!(
        &captured.fragments[..initial.fragments.len()],
        initial.fragments
    );
    assert_eq!(captured.fragments.len(), initial.fragments.len() + 1);
    assert_eq!(
        captured.fragments.last().unwrap().contents.join("\n"),
        "extra context\n"
    );
    let json = serde_json::to_value(&captured).unwrap();
    let mut keys: Vec<_> = json
        .as_object()
        .unwrap()
        .keys()
        .map(String::as_str)
        .collect();
    keys.sort();
    assert_eq!(
        keys,
        [
            "coordinator_instructions",
            "fragments",
            "implementations",
            "prompt",
            "tests"
        ]
    );
}
}

See more source ↗

Implemented sage_meta::region_association_preserves_placeholder_explanation_and_excerpt

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.input_format)]
#[sage::test(meta.reviews.review_scope)]
fn region_association_preserves_placeholder_explanation_and_excerpt() {
    let fixture = Fixture::new();
    fixture.write("src/behavior.rs", "mod todo {\n// {anchor}`demo.rule`<<\n// TODO: Implement arithmetic after the numeric type model is available.\npub fn result() -> u32 { 4 }\n// >>\n}\n");
    let input = fixture.start();
    let site = &input.implementations[0];
    assert!(site.region);
    assert_eq!(site.module, "demo::behavior::todo");
    assert_eq!(site.status, TestStatus::Todo);
    assert!(
        site.explanation
            .as_ref()
            .unwrap()
            .contains("numeric type model")
    );
    let excerpt = site.excerpt.join("\n");
    assert!(excerpt.contains("pub fn result() -> u32 { 4 }"));
    assert!(excerpt.contains("TODO: Implement arithmetic"));
    let saved = fixture.input();
    assert_eq!(saved.implementations, input.implementations);
}
}

See more source ↗

Implemented sage_meta::test_selector_preserves_metadata_and_ignores_unrelated_line_movement

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.test_source)]
#[sage::test(meta.reviews.selector_test)]
#[sage::test(meta.reviews.staleness)]
#[sage::test(meta.reviews.fragment_associations)]
#[sage::test(meta.reviews.input_format)]
#[sage::test(meta.reviews.fragment_freshness)]
fn test_selector_preserves_metadata_and_ignores_unrelated_line_movement() {
    let fixture = Fixture::new();
    fixture.write(
        "src/tests.rs",
        &format!("#[cfg(unix)]\nmod nested {{\n{TEST}\n}}\n"),
    );
    let input = fixture.start();
    let test = &input.tests[0];
    assert_eq!(test.crate_name, "demo");
    assert_eq!(test.target, "lib:demo");
    assert_eq!(test.rust_path, "demo::tests::nested::verifies_result");
    assert_eq!(test.file, "src/tests.rs");
    assert!(test.cfg.iter().any(|cfg| cfg.contains("unix")));
    assert!(test.cfg.iter().any(|cfg| cfg.contains("test")));
    assert_eq!(test.status, TestStatus::Ordinary);
    let selector = Selector::Test {
        crate_name: test.crate_name.clone(),
        target: test.target.clone(),
        rust_path: test.rust_path.clone(),
    };
    assert_eq!(
        review::capture_read(&fixture.0, "demo.rule", "src/tests.rs", selector).unwrap(),
        TEST
    );
    review::record(&fixture.0, "demo.rule", &Fixture::report()).unwrap();
    fixture.write(
        "src/tests.rs",
        &format!("// Unrelated\n\n#[cfg(unix)]\nmod nested {{\n{TEST}\n}}\n"),
    );
    assert!(sage_meta::check(&fixture.0).is_valid());
    fixture.write(
        "src/tests.rs",
        &format!("#[cfg(windows)]\nmod nested {{\n{TEST}\n}}\n"),
    );
    assert!(!sage_meta::check(&fixture.0).is_valid());
}
}

See more source ↗

Implemented sage_meta::whole_files_and_ranges_preserve_exact_line_endings_and_detect_selected_edits

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.selector_whole_file)]
#[sage::test(meta.reviews.selector_line_range)]
#[sage::test(meta.reviews.recorded_reads)]
#[sage::test(meta.reviews.fragment_freshness)]
#[sage::test(meta.reviews.input_format)]
#[sage::test(meta.reviews.input_fragments)]
#[sage::test(meta.reviews.source_representation)]
#[sage::test(meta.reviews.staleness)]
fn whole_files_and_ranges_preserve_exact_line_endings_and_detect_selected_edits() {
    let fixture = Fixture::new();
    fixture.start();
    fixture.write("helper.txt", "first\r\n\r\nthird\nlast");
    assert_eq!(
        review::capture_read(
            &fixture.0,
            "demo.rule",
            "helper.txt",
            Selector::LineRange { start: 1, end: 2 }
        )
        .unwrap(),
        "first\r\n\r\n"
    );
    assert_eq!(
        review::capture_read(
            &fixture.0,
            "demo.rule",
            "helper.txt",
            Selector::LineRange { start: 4, end: 4 }
        )
        .unwrap(),
        "last"
    );
    for (start, end) in [(0, 1), (3, 2), (1, 5), (5, 5)] {
        assert!(
            review::capture_read(
                &fixture.0,
                "demo.rule",
                "helper.txt",
                Selector::LineRange { start, end }
            )
            .is_err()
        );
    }
    review::record(&fixture.0, "demo.rule", &Fixture::report()).unwrap();
    fixture.write("helper.txt", "first\r\n\r\nUNSELECTED\nlast");
    assert!(sage_meta::check(&fixture.0).is_valid());
    fixture.write("helper.txt", "changed\r\n\r\nthird\nlast");
    assert!(!sage_meta::check(&fixture.0).is_valid());
    fixture.start();
    for _ in 0..2 {
        assert_eq!(
            review::capture_read(&fixture.0, "demo.rule", "helper.txt", Selector::WholeFile)
                .unwrap(),
            "changed\r\n\r\nthird\nlast"
        );
    }
    let input = fixture.input();
    let tail = &input.fragments[input.fragments.len() - 2..];
    assert_eq!(tail[0], tail[1]);
    assert_eq!(tail[0].contents.join("\n"), "changed\r\n\r\nthird\nlast");
    review::record(&fixture.0, "demo.rule", &Fixture::report()).unwrap();
    fixture.write("helper.txt", "changed\r\n\r\nthird\nlast\n");
    assert!(!sage_meta::check(&fixture.0).is_valid());
}
}

See more source ↗

Review: Accepted · final_quality.

Reviewed meta.reviews.input_format's complete claim, associated review.rs implementation, and all seven associated tests. This was source inspection; no behavior tests were executed by this reviewer. Central suite execution remains separate evidence.

ReviewInput defines exactly prompt, coordinator_instructions, fragments, implementations and tests, with unknown fields rejected on deserialization. inventory assigns the exact PROMPT, creates claim/whole-implementation-file/semantic-test InputFragments and copies complete association identity, cfg, excerpt/region/explanation where applicable, and declared status into separately ordered metadata vectors. start replaces coordinator_instructions with the supplied ordered vector without rewriting strings, writes that same input and returns it. capture_read appends another InputFragment to the existing collection and preserves the initial fragments and metadata. Source strings use reversible newline splitting. Captured correspondence/evidence helpers establish eligible-test metadata, implementation regions and inherited cfg/status; captured shared check code confirms accepting a report does not rewrite TODO/N/A into ordinary status.

Every associated test was inspected. initial_context_preserves_instructions_and_exact_uniform_fragments asserts exact ordered instructions (including embedded newline), exact prompt, returned-versus-saved input equality, claim path/text, entire implementation text, semantic test text, absence of whole-file test substitution and association counts. input_keeps_complete_association_metadata_and_appends_context_in_one_collection asserts every implementation metadata field, test identity/cfg/status, preserved initial arrays after an extra read, one appended exact fragment and exactly the five schema keys. region_association_preserves_placeholder_explanation_and_excerpt checks region=true, enclosing TODO module/status, retained prerequisite explanation/excerpt and saved metadata equality. accepted_placeholder_reports_preserve_todo_and_na_evidence checks both placeholder classes on implementation/test sides, explanations, accepted validation and zero ordinary approvals with the correct separate placeholder counts.

added_or_removed_associations_invalidate_unchanged_saved_fragments requires failures for adding/removing tests and adding implementation metadata, plus a complete deterministic refreshed set preserving the original record. test_selector_preserves_metadata_and_ignores_unrelated_line_movement asserts crate/target/path/file/inherited cfg/status, exact semantic source capture, acceptance after unrelated line movement and rejection after inherited cfg changes with identical test text. whole_files_and_ranges_preserve_exact_line_endings_and_detect_selected_edits exercises CRLF blank lines, LF and unterminated final line, exact range results, invalid range rejection, selection-sensitive freshness, repeated identical appended fragments and joined-content equality, and trailing-newline freshness. Captured Fixture/TEST helpers create actual workspace and persisted review files; meaningful assertions remain visible in each annotated body.

Together these cover all five fields, exact prompt and instruction ordering, initial and later source context in one representation, full association metadata and preserved declared status. No TODO/N/A evidence is associated with this anchor itself; placeholder statuses in its tests are scenarios being asserted. No concrete defect or additional required source change was found. Requested edits are empty.

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