chore: migrate GRACE-Poly anchors to hierarchical dotted naming
Systematic rename of all semantic anchors (#region, [DEF], @RELATION) across 1400+ files — backend Python, frontend Svelte/TS, specs, docs: - Flat anchors become Namespace.Module.Entity - @RELATION references updated to match new anchor paths - Zero business logic changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# #region TestTranslateSchedulerExecution [C:3] [TYPE Module] [SEMANTICS test, translate, scheduler, execution, trigger-type, baseline]
|
||||
# #region Test.TranslateSchedulerExecution.TestTranslateSchedulerExecution [C:3] [TYPE Module] [SEMANTICS test, translate, scheduler, execution, trigger-type, baseline]
|
||||
# @BRIEF Verify execute_scheduled_translation contracts — trigger_type dispatch, baseline expiry fallback.
|
||||
# @RELATION BINDS_TO -> [execute_scheduled_translation]
|
||||
# @RELATION BINDS_TO -> [Plugin.Scheduler.ExecuteScheduledTranslation]
|
||||
# @TEST_EDGE: new_key_only_mode — trigger_type="new_key_only" when baseline not expired
|
||||
# @TEST_EDGE: baseline_expired_fallback — trigger_type="scheduled" when baseline > 90 days old
|
||||
# @TEST_EDGE: full_mode_default — trigger_type="scheduled" for execution_mode="full"
|
||||
@@ -55,7 +55,7 @@ def _make_mock_run(run_id="run-1", job_id="job-1"):
|
||||
|
||||
# -- Tests: trigger_type dispatch and execution modes -----------------------
|
||||
|
||||
# #region test_new_key_only_mode [C:1] [TYPE Function]
|
||||
# #region Test.TranslateSchedulerExecution.TestNewKeyOnlyMode [C:1] [TYPE Function]
|
||||
def test_new_key_only_mode():
|
||||
"""execution_mode="new_key_only" with 60-day-old prev run → trigger_type="new_key_only"."""
|
||||
from src.plugins.translate.scheduler import execute_scheduled_translation
|
||||
@@ -108,10 +108,10 @@ def test_new_key_only_mode():
|
||||
# execute_background is called (fire-and-forget) instead of execute_run via runner.run
|
||||
mock_orch_cls.execute_background.assert_called()
|
||||
mock_db.close.assert_called_once()
|
||||
# #endregion test_new_key_only_mode
|
||||
# #endregion Test.TranslateSchedulerExecution.TestNewKeyOnlyMode
|
||||
|
||||
|
||||
# #region test_baseline_expired_fallback [C:1] [TYPE Function]
|
||||
# #region Test.TranslateSchedulerExecution.TestBaselineExpiredFallback [C:1] [TYPE Function]
|
||||
def test_baseline_expired_fallback():
|
||||
"""execution_mode="new_key_only" with >90-day-old prev run → trigger_type="scheduled" baseline fallback."""
|
||||
from src.plugins.translate.scheduler import execute_scheduled_translation
|
||||
@@ -175,10 +175,10 @@ def test_baseline_expired_fallback():
|
||||
assert event_call.kwargs["payload"]["age_days"] == 95
|
||||
|
||||
mock_db.close.assert_called_once()
|
||||
# #endregion test_baseline_expired_fallback
|
||||
# #endregion Test.TranslateSchedulerExecution.TestBaselineExpiredFallback
|
||||
|
||||
|
||||
# #region test_full_mode_default [C:1] [TYPE Function]
|
||||
# #region Test.TranslateSchedulerExecution.TestFullModeDefault [C:1] [TYPE Function]
|
||||
def test_full_mode_default():
|
||||
"""execution_mode="full" → trigger_type="scheduled" regardless of baseline age."""
|
||||
from src.plugins.translate.scheduler import execute_scheduled_translation
|
||||
@@ -229,10 +229,10 @@ def test_full_mode_default():
|
||||
)
|
||||
mock_orch_cls.execute_background.assert_called()
|
||||
mock_db.close.assert_called_once()
|
||||
# #endregion test_full_mode_default
|
||||
# #endregion Test.TranslateSchedulerExecution.TestFullModeDefault
|
||||
|
||||
|
||||
# #region test_inactive_schedule_skips [C:1] [TYPE Function]
|
||||
# #region Test.TranslateSchedulerExecution.TestInactiveScheduleSkips [C:1] [TYPE Function]
|
||||
def test_inactive_schedule_skips():
|
||||
"""Inactive schedule → function returns early without executing anything."""
|
||||
from src.plugins.translate.scheduler import execute_scheduled_translation
|
||||
@@ -265,10 +265,10 @@ def test_inactive_schedule_skips():
|
||||
|
||||
mock_orch_cls.assert_not_called()
|
||||
mock_db.close.assert_called_once()
|
||||
# #endregion test_inactive_schedule_skips
|
||||
# #endregion Test.TranslateSchedulerExecution.TestInactiveScheduleSkips
|
||||
|
||||
|
||||
# #region test_schedule_not_found_skips [C:1] [TYPE Function]
|
||||
# #region Test.TranslateSchedulerExecution.TestScheduleNotFoundSkips [C:1] [TYPE Function]
|
||||
def test_schedule_not_found_skips():
|
||||
"""Schedule not found → function returns early."""
|
||||
from src.plugins.translate.scheduler import execute_scheduled_translation
|
||||
@@ -296,10 +296,10 @@ def test_schedule_not_found_skips():
|
||||
|
||||
mock_orch_cls.assert_not_called()
|
||||
mock_db.close.assert_called_once()
|
||||
# #endregion test_schedule_not_found_skips
|
||||
# #endregion Test.TranslateSchedulerExecution.TestScheduleNotFoundSkips
|
||||
|
||||
|
||||
# #region test_baseline_expired_full_mode [C:1] [TYPE Function]
|
||||
# #region Test.TranslateSchedulerExecution.TestBaselineExpiredFullMode [C:1] [TYPE Function]
|
||||
def test_baseline_expired_full_mode():
|
||||
"""execution_mode="full" with expired baseline → trigger_type stays 'scheduled'."""
|
||||
from src.plugins.translate.scheduler import execute_scheduled_translation
|
||||
@@ -356,10 +356,10 @@ def test_baseline_expired_full_mode():
|
||||
event_call = mock_event_log.log_event.call_args
|
||||
assert event_call.kwargs["payload"]["reason"] == "baseline_expired"
|
||||
mock_db.close.assert_called_once()
|
||||
# #endregion test_baseline_expired_full_mode
|
||||
# #endregion Test.TranslateSchedulerExecution.TestBaselineExpiredFullMode
|
||||
|
||||
|
||||
# #region test_execution_error_handled [C:1] [TYPE Function]
|
||||
# #region Test.TranslateSchedulerExecution.TestExecutionErrorHandled [C:1] [TYPE Function]
|
||||
def test_execution_error_handled():
|
||||
"""execute_background is called even when execute_run would raise — scheduler dispatches safely."""
|
||||
from src.plugins.translate.scheduler import execute_scheduled_translation
|
||||
@@ -413,10 +413,10 @@ def test_execution_error_handled():
|
||||
# Schedule tracking is updated at dispatch time
|
||||
assert schedule.last_run_at is not None
|
||||
mock_db.close.assert_called_once()
|
||||
# #endregion test_execution_error_handled
|
||||
# #endregion Test.TranslateSchedulerExecution.TestExecutionErrorHandled
|
||||
|
||||
|
||||
# #region test_execution_run_status_failed_path [C:1] [TYPE Function]
|
||||
# #region Test.TranslateSchedulerExecution.TestExecutionRunStatusFailedPath [C:1] [TYPE Function]
|
||||
def test_execution_run_status_failed_path():
|
||||
"""Scheduler dispatches regardless of run.status — status is handled by background task."""
|
||||
from src.plugins.translate.scheduler import execute_scheduled_translation
|
||||
@@ -463,10 +463,10 @@ def test_execution_run_status_failed_path():
|
||||
# Scheduler dispatches background task regardless of run.status
|
||||
mock_orch_cls.execute_background.assert_called()
|
||||
mock_db.close.assert_called_once()
|
||||
# #endregion test_execution_run_status_failed_path
|
||||
# #endregion Test.TranslateSchedulerExecution.TestExecutionRunStatusFailedPath
|
||||
|
||||
|
||||
# #region test_execution_notification_error [C:1] [TYPE Function]
|
||||
# #region Test.TranslateSchedulerExecution.TestExecutionNotificationError [C:1] [TYPE Function]
|
||||
def test_execution_notification_error():
|
||||
"""Scheduler dispatches safely — notification moves to background task."""
|
||||
from src.plugins.translate.scheduler import execute_scheduled_translation
|
||||
@@ -512,6 +512,6 @@ def test_execution_notification_error():
|
||||
# Schedule tracking is updated at dispatch
|
||||
assert schedule.last_run_at is not None
|
||||
mock_db.close.assert_called_once()
|
||||
# #endregion test_execution_notification_error
|
||||
# #endregion Test.TranslateSchedulerExecution.TestExecutionNotificationError
|
||||
|
||||
# #endregion TestTranslateSchedulerExecution
|
||||
# #endregion Test.TranslateSchedulerExecution.TestTranslateSchedulerExecution
|
||||
|
||||
Reference in New Issue
Block a user