Orchestrata Ultimate › Tests › Reference › scripts › test_ast_freshness_pin

Tests reference — tests/scripts/test_ast_freshness_pin.py

Module of tests/scripts, split out because the directory page would be too large.

Prose pending.

tests/scripts/test_ast_freshness_pin.py

source · 14 tests · 225 lines

Tests for .claude/hooks/ast-freshness-pin.sh — the SessionStart block that

Kind Name Line Description
class TestTheMandateIsAlwaysStated 82 The instruction is the point; it must survive every data condition.
method TestTheMandateIsAlwaysStated.test_a_fresh_tree_states_the_rule_and_the_toolkit_entry_points 85
method TestTheMandateIsAlwaysStated.test_the_hook_never_fails_a_session 93 A context block that can abort SessionStart is worse than none.
class TestFreshness 104
method TestFreshness.test_a_snapshot_newer_than_every_source_is_fresh 105
method TestFreshness.test_one_newer_source_makes_it_stale_and_names_the_file 110
method TestFreshness.test_a_stale_snapshot_carries_the_two_step_refresh_command 118 A bare ast-sync zeroes runtime_calls; the fix must say so.
method TestFreshness.test_sources_are_counted_across_all_three_toolkit_trees 134
method TestFreshness.test_a_non_python_file_never_makes_the_snapshot_stale 144 The snapshot describes Python. A newer README is not a reason to rebuild.
method TestFreshness.test_an_absent_tree_is_not_counted_as_zero_newer_files 151 A repo with no tests/ must not make find(1) fail into a false FRESH.
class TestTheSnapshotMustExist 175
method TestTheSnapshotMustExist.test_an_absent_snapshot_is_reported_as_absent_not_as_fresh 176 Zero newer files than a file that is not there reads as FRESH.
class TestThePrologKbIsReportedSeparately 190
method TestThePrologKbIsReportedSeparately.test_a_kb_built_from_the_snapshot_says_so 191
method TestThePrologKbIsReportedSeparately.test_a_kb_older_than_the_snapshot_is_stale_even_when_the_snapshot_is_fresh 194 The composite case, and the reason the KB gets its own line.
method TestThePrologKbIsReportedSeparately.test_an_absent_kb_names_the_queries_that_cannot_answer 208
class TestTheTimestampIsActionable 216
method TestTheTimestampIsActionable.test_the_snapshot_time_is_printed_absolutely 217 The user asked for the last update date AND time, not just an age.
method TestTheTimestampIsActionable.test_the_age_is_also_relative 222 An absolute stamp needs arithmetic against a clock the reader lacks.