From 783f854b0fb2bb224cedf972b40adfc77e9c818f Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Fri, 18 Sep 2026 03:24:48 -0700 Subject: [PATCH] fix(file_state): drop the module-level forget_task wrapper The wrapper (and its __all__ entry) had no production caller: the only release path, tools/file_tools.py::clear_file_ops_cache, already goes through file_state.get_registry().forget_task(). It existed solely for the new registry test, which now calls get_registry().forget_task() directly, the same path production takes. --- tests/tools/test_file_state_registry.py | 2 +- tools/file_state.py | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/tools/test_file_state_registry.py b/tests/tools/test_file_state_registry.py index 44c42f3c8f..b316869a54 100644 --- a/tests/tools/test_file_state_registry.py +++ b/tests/tools/test_file_state_registry.py @@ -182,7 +182,7 @@ class FileStateRegistryUnitTests(unittest.TestCase): registry = file_state.get_registry() self.assertEqual(registry._last_writer[p][0], "cron:JOB:run1") - file_state.forget_task("cron:JOB:run1") + registry.forget_task("cron:JOB:run1") self.assertNotIn(p, registry._last_writer) self.assertIsNone(file_state.check_stale("cron:JOB:run2", p)) diff --git a/tools/file_state.py b/tools/file_state.py index 0c5e57f092..1dc7488dd9 100644 --- a/tools/file_state.py +++ b/tools/file_state.py @@ -249,10 +249,6 @@ def known_reads(task_id: str) -> List[str]: return _registry.known_reads(task_id) -def forget_task(task_id: str) -> None: - _registry.forget_task(task_id) - - __all__ = [ "FileStateRegistry", "get_registry", @@ -261,5 +257,4 @@ __all__ = [ "check_stale", "lock_path", "writes_since", - "known_reads", - "forget_task"] + "known_reads"]