Orchestrata Ultimate › Tests › Reference › scripts › test_check_feature_loss
Tests reference — tests/scripts/test_check_feature_loss.py
Module of tests/scripts, split out because the directory page would be too large.
Prose pending.
tests/scripts/test_check_feature_loss.py
source · 67 tests · 2414 lines
Tests for scripts/check_feature_loss.py — the feature/requirement-loss
Covers: core.base.traces
| Kind | Name | Line | Description |
|---|---|---|---|
| function | test_not_a_git_repo_is_invalid_never_pass |
145 | Fail-closed, the deliberate opposite of check_wiring.py's SKIP=0 |
| function | test_empty_ratified_corpus_is_invalid |
159 | A repo with no specs/ at all examines 0 requirement ids — INVALID, |
| function | test_clean_repo_passes |
179 | Everything ratified is currently implemented — PASS, exit 0, zero |
| function | test_deleted_traced_symbol_orphans_its_requirement |
212 | The historical-catch proof: a symbol carrying @traces is deleted while |
| function | test_symbol_deletion_not_orphaned_when_covered_elsewhere |
263 | A requirement is NOT a loss when another surviving symbol still |
| function | test_unratified_deleted_symbol_dropped_not_failed |
292 | A deleted symbol citing a requirement id that NO current spec defines |
| function | test_never_implemented_reported_as_info_not_failure |
337 | A requirement with zero current evidence AND zero deletion history — |
| function | test_never_implemented_never_double_counts_orphaned |
372 | A requirement that IS orphaned (check 1) must appear there, never |
| function | test_many_never_implemented_ids_summarised_not_dumped |
398 | Above the inline cap, the never-implemented section prints a COUNT and |
| function | test_deleted_spec_doc_still_cited_fails |
433 | The spec/ADR document defining a requirement is deleted while a |
| function | test_deleted_spec_doc_uncited_is_not_a_loss |
484 | Ordinary spec housekeeping: the doc is gone and NOTHING cites its old |
| function | test_delete_then_restore_is_not_a_false_positive |
518 | Reproduces the documented noisy-history shape: a commit mass-deletes |
| function | test_gate_ok_comment_does_not_suppress_a_loss |
565 | The # gate-ok: waiver convention (core/gate_waivers.py, honoured by |
| function | test_many_losses_are_never_truncated |
600 | Unlike the never-implemented INFO section, every LOSS is printed in |
| function | test_traces_from_text_extracts_multiple_reqs |
638 | |
| function | test_traces_from_text_ignores_placeholder_and_syntax_error |
650 | |
| function | test_dedupe_latest_keeps_first_seen_per_path |
661 | |
| function | test_json_output_is_well_formed |
672 | |
| function | test_main_in_process_pass_and_json |
702 | |
| function | test_main_in_process_fail_and_invalid |
730 | |
| function | test_render_report_invalid_status_directly |
761 | |
| function | test_render_scan_scope_empty_list_is_a_defensive_fallback |
769 | _render_scan_scope is called with a real, non-empty scan_scope on |
| function | test_render_scan_scope_groups_multiple_roots_by_language |
779 | |
| function | test_non_python_file_deletion_under_src_is_ignored |
811 | Check 3 only ever looks at .py deletions — a deleted data file |
| function | test_non_markdown_file_deletion_under_specs_is_ignored |
836 | Check 4 only ever looks at .md deletions. |
| function | test_deleted_spec_doc_dual_defined_elsewhere_is_not_a_loss |
860 | A requirement id defined in TWO spec files (a legitimate, documented |
| function | test_non_traces_call_decorator_is_ignored |
891 | A decorator that IS a call but is not named traces (or |
| function | test_find_deletions_against_non_repo_returns_empty |
904 | git log genuinely erroring (a real, non-mocked returncode != 0, |
| function | test_symbol_qualname_builds_the_evidence_files_dotted_form |
923 | |
| function | test_record_symbol_qualname_bare_and_dotted_forms_agree |
936 | SCHEMA CORRECTION (2026-08-19): the evidence-writing agents' real |
| function | test_record_symbol_qualname_defensive_fallback_for_non_src_file |
957 | A file field that is not a src/orchestrata_ultimate/ path at |
| function | test_absent_evidence_file_behaves_exactly_as_today |
965 | No file at plans/feature-loss-invalid-citations.json — "no |
| function | test_evidenced_pair_reclassified_unevidenced_pair_still_fails |
999 | The combined proof the brief asks for: an EXACT evidenced |
| function | test_stale_evidence_record_reported_not_silently_ignored |
1091 | A record whose pair matches nothing current (the finding was |
| function | test_render_report_always_states_reclassified_count_and_path |
1141 | Property 4 of the brief: the output must always SAY how many were |
| function | test_malformed_evidence_record_makes_the_whole_gate_invalid |
1206 | Property 3 + "refuse it rather than silently honour a half-filled |
| function | test_methods_field_accepts_either_string_or_list_shape |
1238 | The positive counterpart of the parametrized rejection tests: both |
| function | test_evidence_file_unreadable_is_invalid |
1300 | A path that EXISTS but cannot be read as text — here, it is a |
| function | test_evidence_file_invalid_json_is_invalid |
1329 | |
| function | test_evidence_file_wrong_schema_version_is_invalid |
1352 | |
| function | test_evidence_records_not_a_list_is_invalid |
1372 | |
| function | test_evidence_top_level_not_an_object_is_invalid |
1396 | |
| function | test_json_output_includes_reclassification_fields |
1415 | |
| function | test_main_in_process_reclassification_json |
1459 | In-process (coverage-visible) counterpart of the subprocess JSON |
| function | test_module_does_not_import_gate_waivers |
1493 | Structural guard mirroring test_check_generated_artifacts.py's own |
| function | test_ts_only_traced_requirement_is_not_never_implemented |
1537 | A requirement with ZERO Python implementation but a real TS @traces |
| function | test_deleted_python_symbol_covered_by_surviving_ts_symbol_is_not_a_loss |
1567 | The exact shape of the REQ-021-195..198 incident: a Python symbol |
| function | test_genuine_loss_still_fails_with_unrelated_ts_tree_present |
1600 | Scanning TS/JS must never create a false NEGATIVE: an unrelated web |
| function | test_scan_scope_reports_absent_web_roots_as_not_scanned |
1631 | A repo with no opencode/ or vizint-ui/ tree at all (the common case |
| function | test_scan_scope_reports_present_web_root_as_scanned |
1669 | An opencode/ tree that DOES exist in this repo must be reported as |
| function | test_json_output_includes_scan_scope_field |
1698 | |
| function | test_real_opencode_session_status_ids_produce_no_finding_at_all |
1721 | Canary against the real live tree (not just synthetic fixtures, |
| function | test_surface_loss_flagship_reproduces_2883703a |
1833 | The acceptance fixture named in the brief, reconstructed: run the |
| function | test_surface_loss_tier1_clears_via_same_class_property |
1900 | Isolates the RENAME-HANDLING claim: a field renamed OFF a dataclass |
| function | test_surface_loss_evidence_reclassifies_a_genuine_relocation |
1957 | A field that Tier 1 CANNOT clear (relocated to a differently-named |
| function | test_surface_loss_stale_evidence_reported_not_silently_ignored |
2046 | A surface_records entry matching no current candidate (fixed, |
| function | test_absent_surface_records_key_is_not_an_error |
2106 | Today's real plans/feature-loss-invalid-citations.json has a |
| function | test_malformed_surface_evidence_record_makes_the_whole_gate_invalid |
2172 | |
| function | test_surface_records_not_a_list_is_invalid |
2203 | |
| function | test_json_output_includes_surface_loss_fields |
2229 | |
| function | test_main_in_process_surface_loss_json |
2260 | In-process (coverage-visible) counterpart of the subprocess JSON test |
| function | test_extract_public_dataclass_fields_decorator_forms_and_privacy |
2285 | Unit coverage of _extract_public_dataclass_fields / |
| function | test_extract_public_dataclass_fields_ignores_syntax_error |
2319 | |
| function | test_current_class_members_finds_fields_properties_and_methods |
2323 | Unit coverage of _current_class_members: a plain field, a |
| function | test_module_still_does_not_import_gate_waivers_with_surface_loss |
2349 | The SURFACE-LOSS mechanism, like RECLASSIFICATION before it, must |
| function | test_load_surface_reclassification_evidence_invalid_json_is_invalid |
2368 | Direct unit coverage of load_surface_reclassification_evidence's |
| function | test_render_report_surface_loss_over_cap_is_summarised_not_dumped |
2387 | Above _SURFACE_LOSS_INLINE_CAP, the SURFACE-LOSS section prints a |