meta.reviews.review_diagnostics

CLI and Cargo-test failures identify every anchor requiring re-evaluation and explain why: missing or unfinished validation, changed inputs or associations, unsupported versions, malformed records, or requested edits. Changed-input diagnostics identify the affected fragment or association. Failures direct the main agent to invoke .agents/skills/sage-review-checklist/SKILL.md; they do not start reviews or alter saved records themselves.

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

Implementation

Implemented crates/sage-meta/src/check.rs:103–108

sage_meta::check · lib:sage_meta

#![allow(unused)]
fn main() {
// {anchor}`meta.reviews.review_diagnostics`
impl CheckReport {
    pub fn is_valid(&self) -> bool {
        self.model.valid
            && self.correspondence.as_ref().is_some_and(|r| r.valid)
            && self.specification.as_ref().is_some_and(|r| r.valid)

}

See more source ↗

Implemented crates/sage-meta/src/check.rs:139–144

sage_meta::check · lib:sage_meta

#![allow(unused)]
fn main() {
// {anchor}`meta.reviews.review_diagnostics`
impl fmt::Display for CheckReport {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        if !self.is_valid() {
            let count = self.rendered_errors.len();
            writeln!(

}

See more source ↗

Implemented crates/sage-meta/src/check.rs:438–443

sage_meta::check · lib:sage_meta

#![allow(unused)]
fn main() {
// {anchor}`meta.reviews.review_diagnostics`
fn check_reviews(
    report: &mut CheckReport,
    spec: &SpecIndex,
    rust: &CorrespondenceIndex,
    workspace: &Path,

}

See more source ↗

Implemented crates/sage-meta/src/review.rs:676–681

sage_meta::review · lib:sage_meta

#![allow(unused)]
fn main() {
// {anchor}`meta.reviews.review_diagnostics`
pub fn validate(
    workspace: &Path,
    current: &BTreeMap<String, ReviewInput>,
    checklist: &ReviewChecklist,
) -> Vec<ReviewIssue> {

}

See more source ↗

Implemented crates/sage-meta/src/main.rs:140–145

sage_meta · bin:sage-meta

#![allow(unused)]
fn main() {
// {anchor}`meta.reviews.review_diagnostics`
fn check(args: &[std::ffi::OsString]) -> Result<(), Box<dyn std::error::Error>> {
    let mut json = false;
    let mut root = None;
    for argument in args {
        if argument == "--correspondence" {

}

See more source ↗

Tests and review

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

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::checking_is_read_only_and_recording_preserves_obsolete_records

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.gate)]
#[sage::test(meta.reviews.recording)]
#[sage::test(meta.reviews.review_diagnostics)]
fn checking_is_read_only_and_recording_preserves_obsolete_records() {
    let fixture = Fixture::new();
    assert!(!fixture.run(&["check"]).status.success());
    assert!(!fixture.0.join("validations").exists());
    fixture.approve();
    let snapshot = |name: &str| {
        ["input.json", "output.json", "summary.json"]
            .map(|file| std::fs::read(fixture.0.join("validations").join(name).join(file)).unwrap())
    };
    let original = snapshot("demo.rule");
    assert!(fixture.run(&["check"]).status.success());
    assert!(sage_meta::check(&fixture.0).is_valid());
    assert_eq!(snapshot("demo.rule"), original);
    let obsolete = fixture.0.join("validations/demo.retired");
    std::fs::create_dir(&obsolete).unwrap();
    for (index, file) in ["input.json", "output.json", "summary.json"]
        .iter()
        .enumerate()
    {
        std::fs::write(obsolete.join(file), &original[index]).unwrap();
    }
    let mut summary = fixture.summary();
    summary["anchor"] = "demo.retired".into();
    std::fs::write(
        obsolete.join("summary.json"),
        serde_json::to_vec(&summary).unwrap(),
    )
    .unwrap();
    let retired = snapshot("demo.retired");
    assert!(!sage_meta::check(&fixture.0).is_valid());
    assert_eq!(snapshot("demo.rule"), original);
    assert_eq!(snapshot("demo.retired"), retired);
    fixture.start();
    review::record(&fixture.0, "demo.rule", &Fixture::report()).unwrap();
    assert_eq!(snapshot("demo.retired"), retired);
    assert!(!sage_meta::check(&fixture.0).is_valid());
}
}

See more source ↗

Implemented sage_meta::completed_corrupt_records_and_invalid_layout_cannot_pass

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.gate)]
#[sage::test(meta.reviews.validation_layout)]
#[sage::test(meta.reviews.output_format)]
#[sage::test(meta.reviews.review_diagnostics)]
fn completed_corrupt_records_and_invalid_layout_cannot_pass() {
    for fault in [
        "malformed",
        "blank reviewer",
        "blank report",
        "blank edit",
        "extra field",
        "missing summary",
        "missing input",
        "missing output",
        "non-directory",
    ] {
        let fixture = Fixture::new();
        fixture.approve();
        let directory = fixture.0.join("validations/demo.rule");
        match fault {
            "malformed" => fixture.write("validations/demo.rule/output.json", "{"),
            "missing summary" => std::fs::remove_file(directory.join("summary.json")).unwrap(),
            "missing input" => std::fs::remove_file(directory.join("input.json")).unwrap(),
            "missing output" => std::fs::remove_file(directory.join("output.json")).unwrap(),
            "non-directory" => {
                fixture.write("validations/unexpected", "not a validation directory")
            }
            _ => {
                let mut output = serde_json::to_value(Fixture::report()).unwrap();
                match fault {
                    "blank reviewer" => output["reviewer"] = " ".into(),
                    "blank report" => output["report"] = "\n".into(),
                    "blank edit" => output["requested_edits"] = serde_json::json!([""]),
                    _ => output["outcome"] = true.into(),
                }
                fixture.write(
                    "validations/demo.rule/output.json",
                    &serde_json::to_string(&output).unwrap(),
                );
            }
        }
        assert!(!sage_meta::check(&fixture.0).is_valid(), "{fault}");
        let output = fixture.run(&["check"]);
        assert!(!output.status.success(), "{fault}");
        let error = String::from_utf8_lossy(&output.stderr);
        let anchor = if fault == "non-directory" {
            "unexpected"
        } else {
            "demo.rule"
        };
        assert!(error.contains(anchor), "{error}");
        assert!(error.contains("invalid validation"), "{error}");
        assert!(error.contains("sage-review-checklist/SKILL.md"), "{error}");
        let reason = match fault {
            "malformed" => "EOF",
            "blank reviewer" | "blank report" => "nonblank reviewer and report",
            "blank edit" => "nonblank strings",
            "extra field" => "unknown field",
            "missing summary" | "missing input" | "missing output" => "No such file",
            "non-directory" => "not a real directory",
            _ => unreachable!(),
        };
        assert!(error.contains(reason), "{fault}: {error}");
    }
}
}

See more source ↗

Implemented sage_meta::diagnostics_identify_missing_unfinished_stale_and_requested_edit_reviews

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.gate)]
#[sage::test(meta.reviews.review_diagnostics)]
#[sage::test(meta.reviews.record_required)]
fn diagnostics_identify_missing_unfinished_stale_and_requested_edit_reviews() {
    let fixture = Fixture::new();
    for state in ["missing", "unfinished", "stale", "requested edits"] {
        match state {
            "unfinished" => {
                fixture.start();
            }
            "stale" => {
                fixture.approve();
                fixture.write(
                    "src/behavior.rs",
                    "// {anchor}`demo.rule`\npub fn result() -> u32 { 5 }\n",
                );
            }
            "requested edits" => {
                fixture.start();
                let mut output = Fixture::report();
                output
                    .requested_edits
                    .push("Fix the implementation.".into());
                review::record(&fixture.0, "demo.rule", &output).unwrap();
            }
            _ => {}
        }
        let output = fixture.run(&["check"]);
        assert!(!output.status.success(), "{state}");
        let stderr = String::from_utf8_lossy(&output.stderr);
        assert!(stderr.contains("demo.rule"), "{stderr}");
        assert!(
            stderr.contains("sage-review-checklist/SKILL.md"),
            "{stderr}"
        );
        if matches!(state, "missing" | "unfinished") {
            assert!(stderr.contains(state), "{stderr}");
        }
        if state == "stale" {
            assert!(stderr.contains("src/behavior.rs"), "{stderr}");
        }
        if state == "requested edits" {
            assert!(stderr.contains("edit"), "{stderr}");
        }
    }
}
}

See more source ↗

Implemented sage_meta::retired_records_fail_even_when_every_remaining_anchor_passes

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.gate)]
#[sage::test(meta.reviews.review_diagnostics)]
fn retired_records_fail_even_when_every_remaining_anchor_passes() {
    let fixture = Fixture::new();
    fixture.approve();
    fixture.write("md/design/README.md", "# Retired\n");
    fixture.write("src/behavior.rs", "pub fn result() -> u32 { 4 }\n");
    fixture.write("src/tests.rs", "");
    let output = fixture.run(&["check"]);
    assert!(!output.status.success());
    let stderr = String::from_utf8_lossy(&output.stderr);
    assert!(stderr.contains("demo.rule"), "{stderr}");
    assert!(stderr.contains("remove"), "{stderr}");
    assert!(fixture.0.join("validations/demo.rule/output.json").exists());
    std::fs::remove_dir_all(fixture.0.join("validations/demo.rule")).unwrap();
    assert!(sage_meta::check(&fixture.0).is_valid());
}
}

See more source ↗

Implemented sage_meta::unsupported_versions_and_mismatched_identity_cannot_pass

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

#![allow(unused)]
fn main() {
#[test]
#[sage::test(meta.reviews.gate)]
#[sage::test(meta.reviews.summary_format)]
#[sage::test(meta.reviews.review_diagnostics)]
#[sage::test(meta.reviews.staleness)]
#[sage::test(meta.reviews.validation_layout)]
fn unsupported_versions_and_mismatched_identity_cannot_pass() {
    for field in ["schema_version", "policy_version", "anchor"] {
        let fixture = Fixture::new();
        fixture.approve();
        let mut summary = fixture.summary();
        summary[field] = if field == "anchor" {
            "demo.other".into()
        } else {
            999.into()
        };
        fixture.write(
            "validations/demo.rule/summary.json",
            &serde_json::to_string(&summary).unwrap(),
        );
        let report = sage_meta::check(&fixture.0);
        let error = report.ensure_valid().unwrap_err().to_string();
        assert!(error.contains("demo.rule"), "{error}");
        assert!(error.contains("sage-review-checklist/SKILL.md"), "{error}");
        let reason = if field == "anchor" {
            "does not match"
        } else {
            "unsupported schema/policy"
        };
        assert!(error.contains(reason), "{error}");
    }
}
}

See more source ↗

Review: Accepted · anchor_094 fresh final review.

Reviewed the complete review_diagnostics claim, all five ordinary implementation entries across review.rs/check.rs/main.rs, and all six ordinary associated tests. No TODO/N/A entries are present. Captured fixture helpers and the workspace Cargo validation test as dependencies.

Requirement mapping: review::validate iterates all current anchors and accumulates per-anchor reasons rather than returning after the first stale record. It identifies missing or unfinished validation, invalid output, concrete requested edits, input/association mismatches and missing evidence. load_saved preserves malformed-record and unsupported-version errors with the directory identity; obsolete records receive explicit retirement/rename guidance. input_errors names implementation or test association/metadata changes separately and names affected fragment paths/selectors for changed or unresolvable context. Thus the diagnostic identifies the anchor and actionable cause, including the affected source/association category rather than a generic failed boolean.

check_reviews translates every ReviewIssue into a Diagnostic at the current anchor's source/span when available, or the validation location otherwise, and retains all rendered errors. It includes review-skill guidance and instructions to delegate/start/record instead of automatically initiating review. CheckReport Display prints every rendered error and ensure_valid returns that same report in CheckError; CheckError Debug forwards Display so both main's Result handler and Cargo Result-test failures show readable diagnostics. main::check uses ensure_valid, and the captured repository validation test uses the identical library call. No checking path invokes review start or record; load_saved only reads under its directory lock. Explicit start/record remain separate operations.

Tests: diagnostics_identify_missing_unfinished_stale_and_requested_edit_reviews drives all four states through the CLI and asserts failed status, anchor and review-skill guidance, plus missing/unfinished labels, stale implementation source path or edit reason. added_or_removed_associations_invalidate_unchanged_saved_fragments verifies adding and removing tests reports test associations while unchanged prior test metadata is retained, then adding implementation evidence reports implementation associations; every case names the anchor and skill. unsupported_versions_and_mismatched_identity_cannot_pass asserts schema/policy and directory/summary identity faults produce anchored, reason-specific library errors with the skill path.

completed_corrupt_records_and_invalid_layout_cannot_pass asserts CLI/library failure and exact relevant diagnostic categories for malformed JSON, blank reviewer/report/edit, unknown output fields, missing summary/input/output and nondirectory entries. Its assertions require the offending anchor/directory, invalid-validation wording, skill and underlying parse/format/filesystem cause. retired_records_fail_even_when_every_remaining_anchor_passes verifies a retired ID is named with removal guidance and that checking leaves its output in place until the test explicitly removes it. checking_is_read_only_and_recording_preserves_obsolete_records proves checking without records creates no validation directory and accepted/failing checks preserve record bytes; even later recording of another current anchor does not prune the obsolete record.

The tests directly exercise the advertised diagnostic categories through both CLI and library errors, and source inspection establishes exhaustive iteration and the shared Cargo display path. They do not imply an automated review was performed in response to an error. Fixture helpers construct isolated real claim/model/source workspaces and invoke production APIs or the check binary; assertions are present in the test bodies. No source changes or unresolved defect were identified.

This pass executed review start/read/record and source inspection only. No behavioral suites or failing Cargo invocation were rerun, consistent with central-suite coordination; test assertions are inspected evidence rather than newly observed executions. Dependency capture is complete for this assessment. 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