Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help


id: linter.scenario_reconciliation kind: intent statement: “WHEN a lint run carries conform records (–conform-records), THE linter SHALL fire scenario_reconciliation_orphan_record on every record whose id equals no declared #### Scenario: slug under exact string equality, SHALL fire scenario_reconciliation_missing_binding on every declared slug that records exercise while its owning file carries no binding row, SHALL fire scenario_reconciliation_divergence on every record whose exercised transitions are not a subset of its binding row’s on set, SHALL run no reconciliation check over a run that carries no records, and SHALL report every reconciliation finding on the warnings channel with exit 0.”

linter-scenario_reconciliation Specification

Purpose

The conform-reconciliation checker: the evidence half of the scenario-bindings claim layer. Conform oracle records ({scenario_id, trace} JSONL) are joined to declared scenario slugs by exact string equality and compared against each binding row’s on cell — evidence that outruns the claim, claims that lack evidence, and records that name no declared slug are each labeled warnings-channel advisories, so the two ledgers can never silently diverge (tickets specodelic-vkxv + specodelic-a950’s attested tier).

Constraints

idkindexprtraces_to
exact_joininvarianta record reconciles only when its id equals — by exact string equality, never a prefix, suffix, or case-insensitive match — a #### Scenario: slug declared somewhere in the linted corpus (join-by-convention is pinned, spec-audit GAP-1); a record joining nothing is itself the orphan advisory naming the id, never a silent no-op[[linter.scenario_reconciliation]]
ledger_comparisoninvariantdivergence is SET arithmetic over the two ledgers only — the record's distinct trimmed trace actions versus the binding row's on cell resolved to own-file Transition ids — and never a re-report of conform's own verdicts (a trace touching an undeclared transition is conform's indictment already); a slug with records but no binding row is its own advisory naming both ledgers (evidence exists, claim missing)[[linter.scenario_reconciliation]]
skip_without_recordsinvarianta lint run carrying no conform records runs no reconciliation check and reports zero reconciliation findings — absence of records is absence of evidence, never evidence of cleanliness (the checker is skipped, never fabricated)[[linter.scenario_reconciliation]]
advisory_channelinvariantevery reconciliation finding rides the warnings channel with exit 0 and never lands on the issues channel — the lint baseline gate reads issues only, so a divergent ledger can never fail a stage[[linter.scenario_reconciliation]]
finding_reportedeffectlinter.scenario_reconciliation.finding_reported(rule, record) — every reconciliation violation renders as one labeled advisory naming the rule id, the owning file (or the records ledger for orphans), and the record id[[linter.scenario_reconciliation]]

Model

States

  • unreconciled
  • reconciled
  • divergences_reported (emits: [[linter.scenario_reconciliation.finding_reported]])

Transitions

idfromtoguard
reconcileunreconciledreconciledthe lint run carries conform records ∧ every record's id exactly matches a declared scenario slug ([[linter.scenario_reconciliation.exact_join]]) ∧ every exercised transition set is a subset of its binding row's on set ([[linter.scenario_reconciliation.ledger_comparison]])
report_divergencesunreconcileddivergences_reportedthe lint run carries conform records ∧ ¬(every record's id exactly matches a declared scenario slug ∧ every exercised transition set is a subset of its binding row's on set)

Properties

idkindderives_fromgeneratorpredicate
orphan_record_firesunit[[linter.scenario_reconciliation.exact_join]]record_with_unknown_slug()rule_fired(spec, "scenario_reconciliation_orphan_record")
near_miss_never_matchesunit[[linter.scenario_reconciliation.exact_join]]prefix_suffix_and_case_near_miss_slugs()three orphan advisories; zero joins
covered_trace_cleanunit[[linter.scenario_reconciliation.exact_join]]record_matching_one_declared_slug()zero reconciliation findings
divergence_firesunit[[linter.scenario_reconciliation.ledger_comparison]]record_off_the_on_set()one divergence advisory naming scenario, binding row, and record
missing_binding_firesunit[[linter.scenario_reconciliation.ledger_comparison]]record_exercising_an_unbound_slug()one missing-binding advisory naming both ledgers
undeclared_transition_not_doubledunit[[linter.scenario_reconciliation.ledger_comparison]]record_touching_an_undeclared_transition()conform reports the verdict; the reconciliation speaks only about the on-set gap
no_records_no_findingsunit[[linter.scenario_reconciliation.skip_without_records]]lint_run_without_records()zero reconciliation findings, checker skipped
findings_warn_never_failunit[[linter.scenario_reconciliation.advisory_channel]]corpus_with_reconciliation_findings()every finding on the warnings channel; exit 0; zero issues
violation_labeledunit[[linter.scenario_reconciliation.finding_reported]]corpus_with_reconciliation_findings()every advisory names rule id, file, and record

Requirements

Requirement: Records join declared scenarios by exact identity

The linter SHALL fire scenario_reconciliation_orphan_record on every conform record whose id is equal — by exact string equality only, never a prefix, suffix, or case-insensitive match — to no #### Scenario: slug declared anywhere in the linted corpus, and SHALL pass a record whose id equals exactly one such slug.

Scenario: Orphan record fires

  • WHEN a spec file declares #### Scenario: renders folded machines and a conform record whose id is renders-folded-machines-typo
  • THEN the lint reports one scenario_reconciliation_orphan_record advisory naming the record id, on the warnings channel at exit 0

Scenario: Exact match passes

  • WHEN the file declares #### Scenario: renders folded machines and a conform record whose id is renders-folded-machines
  • THEN the lint reports zero orphan findings for that record

Scenario: Near-miss is an orphan, never a match

  • WHEN the declared slug is renders-folded-machines and conform records carry the ids renders-folded, renders-folded-machines-x, and Renders-Folded-Machines
  • THEN the lint reports three orphan advisories — the join is exact string equality, never fuzzy

Requirement: Evidence diverging from the on-set is reported

The linter SHALL fire scenario_reconciliation_divergence on every record whose exercised transitions are not a subset of its binding row’s on cell, and SHALL name the scenario, the binding row id, AND the conform record in the finding.

Scenario: Trace off the on-set fires

  • WHEN a binding row’s on cell cites [[own.capability.t1]] and a conform record for the same scenario exercises t1 and t2
  • THEN the lint reports one scenario_reconciliation_divergence advisory naming the scenario, the binding row, the record, and t2

Scenario: Covered trace passes

  • WHEN a conform record exercises only transitions its binding row’s on cell cites
  • THEN the lint reports zero divergence findings for that record

Requirement: Evidence without a claim is reported

The linter SHALL fire scenario_reconciliation_missing_binding on every declared #### Scenario: slug that a conform record exercises while the slug’s owning file carries no binding row for it, and SHALL name both ledgers — the record and the file’s ### Scenario bindings table.

Scenario: Exercised but unbound slug fires

  • WHEN a spec file declares #### Scenario: refunds are bounded with no binding row, and a conform record exercises that scenario
  • THEN the lint reports one scenario_reconciliation_missing_binding advisory attributed to the owning file, naming the record and the table

Scenario: The claims hint alone never fires it

  • WHEN a slug has no binding row AND no conform record exercises it
  • THEN only the scenario-bindings family’s unbound hint may speak; zero scenario_reconciliation_missing_binding findings

Requirement: The checker runs only when records are supplied

The linter SHALL skip the reconciliation pass entirely when the lint run carries no conform records: no records ⇒ no reconciliation findings, never fabricated.

Scenario: Flag absent stays silent

  • WHEN spk lint runs without --conform-records over a corpus whose scenario bindings cover nothing any record could exercise
  • THEN zero scenario_reconciliation_* findings are reported — the checker was skipped, not clean-by-luck

Scenario: Malformed records refuse before linting

  • WHEN spk lint --conform-records names a file that fails conform’s parse_corpus (malformed line, unknown field, duplicate id, or a path that cannot be read)
  • THEN the CLI reports a labeled refusal naming the records file and exits 2 before any spec is linted

Requirement: Reconciliation findings are advisory

The linter SHALL report every reconciliation finding on the warnings channel with exit 0, SHALL never count one as a failure, and SHALL never place one on the issues channel.

Scenario: Divergence never fails the gate

  • WHEN the corpus carries reconcilable scenarios and the records diverge from every binding’s on-set
  • THEN the lint exits 0 with the findings on the warnings channel; the issues channel carries none