crates.sage_test_harness.compile_tests.coordinates

The runner inspects the source string after indoc! or another supplied source expression has evaluated. It does not independently dedent it again. Line numbers refer to that resulting source, including annotation lines. Actual tab characters remain rejected for consistent fixture formatting. Type selection depends only on the target line: Unicode character widths and horizontal alignment do not affect which expressions are observed.

Read in specification context · design/crates/sage_test_harness/compile-tests.md

Implementation

Implemented crates/sage-test-harness/src/compile/annotations.rs:41–46

sage_test_harness::compile::annotations · lib:sage_test_harness

#![allow(unused)]
fn main() {
// {anchor}`crates.sage_test_harness.compile_tests.coordinates`
// {anchor}`crates.sage_test_harness.compile_tests.annotation_validation`<<
pub(super) fn parse(file: &str, source: &str) -> Result<Vec<Marker>, String> {
    if source.contains('\t') {
        return Err(format!("{file}: tabs are not allowed"));
    }

}

See more source ↗

Implemented crates/sage-test-harness/src/compile/observe.rs:21–26

sage_test_harness::compile::observe · lib:sage_test_harness

#![allow(unused)]
fn main() {
// {anchor}`crates.sage_test_harness.compile_tests.coordinates`
pub(super) fn collect(
    context: &SageContext<'_>,
    markers: &[Marker],
    queries: bool,
) -> Result<Output, String> {

}

See more source ↗

Implemented crates/sage-test-harness/src/compile/mod.rs:103–108

sage_test_harness::compile · lib:sage_test_harness

#![allow(unused)]
fn main() {
    // {anchor}`crates.sage_test_harness.compile_tests.coordinates`
    fn prepare(&self) -> Result<Output, String> {
        let files = validate_files(self.files.as_deref().ok_or("missing source or files")?)?;
        let edition = self.edition.as_deref().unwrap_or("2024");
        // {anchor}`crates.sage_test_harness.compile_tests.edition`
        if sage_ir::scope::Edition::parse(edition).is_none() {

}

See more source ↗

Tests and review

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

Implemented sage_test_harness::compile::annotations::tests::inline_stacked_and_blank_lines_use_one_rule

crates/sage-test-harness/src/compile/annotations.rs · lib:sage_test_harness

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(crates.sage_test_harness.compile_tests.target_line)]
    #[sage::test(crates.sage_test_harness.compile_tests.coordinates)]
    fn inline_stacked_and_blank_lines_use_one_rule() {
        let markers = parse("src/lib.rs", "fn f() {\n    22; //# ty\n\n    //# ERROR\n    //# WARN\n    // ordinary comment\n    //# ERROR if rustc\n}").unwrap();
        assert_eq!(
            markers.iter().map(|m| m.line).collect::<Vec<_>>(),
            vec![2, 2, 2, 6]
        );
        assert!(!markers[3].applies_to(Compiler::Sage));
        assert!(markers[3].applies_to(Compiler::Rustc));
        assert!(
            parse("src/lib.rs", "fn f() {\t}")
                .unwrap_err()
                .contains("tabs")
        );
    }
}

Conditional source: #[cfg(test)]

See more source ↗

Implemented sage_test_harness::compile::coordinate_review_tests::evaluated_source_retains_blank_lines_indentation_and_unicode

crates/sage-test-harness/src/compile/mod.rs · lib:sage_test_harness

#![allow(unused)]
fn main() {
#[test]
    #[sage::test(crates.sage_test_harness.compile_tests.coordinates)]
    #[sage::test(crates.sage_test_harness.compile_tests.compiler_conditions)]
    #[sage::test(crates.sage_test_harness.compile_tests.rendering)]
    fn evaluated_source_retains_blank_lines_indentation_and_unicode() {
        let mut test = CompileTest::default();
        // Leading blank line and indentation are intentional fixture contents.
        // Both compilers must match the same physical line after the Unicode name.
        test.source("\n    fn café() -> u8 {\n        true //# ERROR\n    }\n");
        test.diagnostics(expect_test::expect![""]);
        let output = test.prepare().unwrap();
        assert!(
            output.diagnostics.contains("src/lib.rs:2:"),
            "{}",
            output.diagnostics
        );
        assert!(
            output.diagnostics.contains("2 |       fn café()"),
            "{}",
            output.diagnostics
        );
        assert!(
            output.diagnostics.contains("3 | |         true //# ERROR"),
            "{}",
            output.diagnostics
        );
    }
}

Conditional source: #[cfg(test)]

See more source ↗

Implemented sage_test_harness::unicode_and_indentation_do_not_change_line_type_selection

crates/sage-test-harness/tests/compile_tests.rs · test:compile_tests

#![allow(unused)]
fn main() {
#[test]
#[sage::test(crates.sage_test_harness.compile_tests.coordinates)]
#[sage::test(crates.sage_test_harness.compile_tests.starting_expressions)]
fn unicode_and_indentation_do_not_change_line_type_selection() {
    compile_test! {
        source: "    fn café() -> bool { true } //# ty",
        observations: expect![[r#"
            src/lib.rs: literal `true`
              type: bool
            src/lib.rs: block `{ true }`
              type: bool
        "#]],
    }
}
}

See more source ↗

Review: Accepted · Codex anchor_006 coordinates refresh.

Fresh source assessment of crates.sage_test_harness.compile_tests.coordinates using the current start inputs and captured review_scope rule. I inspected the current claim, all three ordinary implementation associations and their whole-file context, and all three complete ordinary associated tests. No TODO/N/A evidence is present.

The claim requires (1) inspecting the evaluated source expression, including indoc! results; (2) no additional dedenting; (3) physical line coordinates including annotation lines; (4) rejection of actual tabs; and (5) type selection independent of Unicode width and horizontal alignment. In compile/mod.rs the macro accepts source as an expression and passes its value to CompileTest::source. source and files copy the resulting string; validate_files validates paths and clones source without transformation; prepare parses and writes that same source. There is no trimming or independent dedenting. The indoc! case is covered by the general expression evaluation mechanism, with no special textual macro interpretation.

annotations.rs parses the actual source, rejects source.contains('\t') before parsing, and obtains comment row/byte-column positions from tree-sitter. Splitting on newline preserves annotation and blank lines. It uses columns only to distinguish inline from annotation-only comments, and stores a one-based target line. Annotation-only lines are skipped as candidate targets but never removed from coordinate accounting. Marker has no column field that could constrain expression selection.

observe.rs builds target pairs of file and line and selects rows solely by those fields. walk_expr computes line by counting newline bytes preceding the absolute source span; unmatched-source rows use the same calculation. Unicode scalar/display widths and indentation do not participate. The relevant coordinate-preservation, marker-location, and selection helpers are in the already captured associated files; no further source helper is needed to establish these coordinate decisions. Type inference and expression enumeration are upstream inputs to these decisions, not alternate coordinate selectors.

Complete test coverage: inline_stacked_and_blank_lines_use_one_rule explicitly asserts [2, 2, 2, 6] for inline/stacked markers, blank lines and an ordinary comment after annotation lines, and requires a tabs error for a source containing an actual tab. It catches removal of annotation lines from coordinates and loss of tab rejection. evaluated_source_retains_blank_lines_indentation_and_unicode passes an intentionally leading-blank-line, indented source with café, then asserts physical line 2 and exact indentation in rendered lines 2 and 3, including the annotation text. Those assertions would fail for trimming/dedenting or renumbering. unicode_and_indentation_do_not_change_line_type_selection supplies an indented Unicode function with a trailing marker horizontally beyond its expressions; the exact inline snapshot requires both the true literal and enclosing block, each bool. This would reject column-aligned selection or selection corrupted by multibyte width. Assertions are visible in the test bodies and collectively cover the complete claim.

I found no source defect or missing test requirement and request no edits. This refresh is source inspection only: I executed review start/read/record commands, not behavior tests or a build. The coordinator owns current suite execution; earlier test outcomes are not claimed as fresh evidence. No source or test changes were made.

Browse crates anchors

139 anchors

Specification anchors and declared coverage
AnchorImplementationTests
crates (139)114 Implemented37 TODO2 N/A74 Implemented107 TODO
crates.sage_inspector (15)13 Implemented1 TODO2 N/A3 Implemented15 TODO
crates.sage_inspector.inspection (15)13 Implemented1 TODO2 N/A3 Implemented15 TODO
balanced_tracesImplementedTODO
canonical_ownershipImplementedImplementedTODO
derive_reflectionImplementedImplementedTODO
detail_free_indexImplementedTODO
deterministic_traceImplementedTODO
durable_navigationN/ATODO
generic_browserN/ATODO
owned_reflectionImplementedImplementedTODO
product_availabilityImplementedTODO
revision_and_demandImplementedTODO
semantic_phase_boundaryImplementedTODO
source_evidenceImplementedTODO
typed_serviceImplementedTODO
unknown_workImplementedTODOTODO
workspace_actorImplementedTODO
crates.sage_ir (90)67 Implemented34 TODO40 Implemented88 TODO
crates.sage_ir.checking (12)12 Implemented3 TODO5 Implemented12 TODO
crates.sage_ir.checking.body (5)5 Implemented2 TODO3 Implemented5 TODO
elaborationImplementedImplementedTODO
expected_typesImplementedTODOTODO
interface_dependenciesImplementedImplementedTODO
isolated_completionImplementedImplementedTODO
operator_callsImplementedTODOTODO
identity_mintingImplementedTODO
owned_productsImplementedImplementedTODO
crates.sage_ir.checking.signature (4)4 Implemented1 TODO1 Implemented4 TODO
body_independenceImplementedTODO
narrow_detailImplementedTODOTODO
owner_binderImplementedImplementedTODO
storageImplementedTODO
symbol_keyed_interfacesImplementedTODO
crates.sage_ir.crate (9)9 TODO9 TODO
explicit_restrictionsTODOTODO
identity_before_detailTODOTODO
incremental_evidenceTODOTODO
narrow_demandsTODOTODO
reexecution_and_invalidationTODOTODO
represented_completenessTODOTODO
restrictions_and_gapsTODOTODO
semantic_query_boundariesTODOTODO
terminal_incompletenessTODOTODO
crates.sage_ir.inference (8)8 Implemented6 Implemented8 TODO
atomic_checkingImplementedImplementedTODO
body_local_quiescenceImplementedImplementedTODO
canonical_boundaryImplementedImplementedTODO
completed_body_boundaryImplementedTODO
numeric_domainsImplementedImplementedTODO
subtyping_and_coercionImplementedImplementedTODO
terminal_obligationsImplementedTODO
transaction_isolationImplementedImplementedTODO
crates.sage_ir.metadata (4)4 Implemented1 TODO4 TODO
explicit_incompletenessImplementedTODO
keyed_reuseImplementedTODOTODO
product_boundariesImplementedTODO
provider_authorityImplementedTODO
crates.sage_ir.modules (8)7 Implemented1 TODO4 Implemented8 TODO
crates.sage_ir.modules.expand (4)4 Implemented2 Implemented4 TODO
completenessImplementedImplementedTODO
dependenciesImplementedTODO
direct_membersImplementedTODO
recursion_and_fixpointImplementedImplementedTODO
crates.sage_ir.modules.parse (4)3 Implemented1 TODO2 Implemented4 TODO
dependenciesImplementedTODO
detail_firewallImplementedImplementedTODO
recovery_completenessTODOTODO
syntax_identitiesImplementedImplementedTODO
crates.sage_ir.resolution (5)5 Implemented1 TODO3 Implemented4 TODO
crates.sage_ir.resolution.lookup (5)5 Implemented1 TODO3 Implemented4 TODO
completenessImplementedTODOImplementedTODO
dependenciesImplementedTODO
expansion_import_ambiguityImplementedImplemented
identity_onlyImplementedTODO
precedenceImplementedImplementedTODO
crates.sage_ir.solver (9)7 Implemented7 TODO5 Implemented9 TODO
alternative_isolationImplementedTODOImplementedTODO
bounded_completenessImplementedTODOTODO
candidate_completenessImplementedTODO
canonical_cyclesTODOTODO
canonical_outputsImplementedImplementedTODO
local_index_firewallTODOTODO
normalization_demandImplementedTODOImplementedTODO
schedule_independenceImplementedTODOImplementedTODO
shared_final_resultImplementedTODOImplementedTODO
crates.sage_ir.symbols (8)8 Implemented4 Implemented7 TODO
associated_identityImplementedImplemented
associated_interfacesImplementedTODO
body_interfacesImplementedImplementedTODO
definition_identityImplementedTODO
external_fact_queriesImplementedTODO
external_identityImplementedTODO
kind_wrappersImplementedImplementedTODO
local_identityImplementedImplementedTODO
crates.sage_ir.types (27)16 Implemented12 TODO13 Implemented27 TODO
crates.sage_ir.types.aliases (2)1 Implemented1 TODO1 Implemented2 TODO
identityImplementedImplementedTODO
revelationTODOTODO
crates.sage_ir.types.binder (1)1 Implemented1 TODO1 Implemented1 TODO
owner_parametersImplementedTODOImplementedTODO
crates.sage_ir.types.body (13)4 Implemented9 TODO3 Implemented13 TODO
awaitTODOTODO
closuresTODOTODO
conditional_patternsTODOTODO
coroutinesTODOTODO
diagnosed_recoveryImplementedImplementedTODO
elaboratedTODOImplementedTODO
for_iterationTODOTODO
indexingTODOTODO
macro_expansionTODOTODO
no_inferenceImplementedImplementedTODO
resolved_referencesImplementedTODO
try_residualTODOTODO
typed_provenanceImplementedTODO
crates.sage_ir.types.calls (2)1 Implemented1 TODO1 Implemented2 TODO
dispatch_familiesTODOTODO
selected_semanticsImplementedImplementedTODO
crates.sage_ir.types.lifetimes (2)2 Implemented2 Implemented2 TODO
dummyImplementedImplementedTODO
unchecked_borrowsImplementedImplementedTODO
crates.sage_ir.types.operators (2)2 Implemented1 Implemented2 TODO
lazy_control_flowImplementedTODO
trait_callsImplementedImplementedTODO
scoped_identitiesImplementedTODO
crates.sage_ir.types.spans (4)4 Implemented4 Implemented4 TODO
generated_identityImplementedImplementedTODO
item_originImplementedImplementedTODO
offset_reuseImplementedImplementedTODO
relative_compositionImplementedImplementedTODO
crates.sage_oracle_harness (4)4 Implemented2 TODO1 Implemented4 TODO
crates.sage_oracle_harness.crate (4)4 Implemented2 TODO1 Implemented4 TODO
deterministic_emissionImplementedTODO
exact_comparisonImplementedTODOImplementedTODO
fixed_projectionImplementedTODO
independent_coverageImplementedTODOTODO
crates.sage_stash (5)5 Implemented5 Implemented
crates.sage_stash.storage (5)5 Implemented5 Implemented
handle_ownershipImplementedImplemented
immutable_entriesImplementedImplemented
query_valueImplementedImplemented
rooted_equalityImplementedImplemented
typed_interningImplementedImplemented
crates.sage_test_harness (25)25 Implemented25 Implemented
crates.sage_test_harness.compile_tests (25)25 Implemented25 Implemented
annotation_validationImplementedImplemented
blessing_gateImplementedImplemented
callsite_updatesImplementedImplemented
checking_scopeImplementedImplemented
compiler_conditionsImplementedImplemented
completed_typesImplementedImplemented
coordinatesImplementedImplemented
dependenciesImplementedImplemented
diagnostic_countsImplementedImplemented
diagnostic_locationsImplementedImplemented
editionImplementedImplemented
fixturesImplementedImplemented
grouped_observationsImplementedImplemented
invocationImplementedImplemented
production_executionImplementedImplemented
project_isolationImplementedImplemented
query_captureImplementedImplemented
query_projectionImplementedImplemented
renderingImplementedImplemented
resolved_symbolsImplementedImplemented
review_visibilityImplementedImplemented
rustc_executionImplementedImplemented
rustc_lintsImplementedImplemented
starting_expressionsImplementedImplemented
target_lineImplementedImplemented