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,4 +1,4 @@
|
||||
# #region normalizer [C:5] [TYPE Module] [SEMANTICS pydantic, report, task, normalize, status]
|
||||
# #region Services.Normalizer [C:5] [TYPE Module] [SEMANTICS pydantic, report, task, normalize, status]
|
||||
# @defgroup Services Module group.
|
||||
# @BRIEF Convert task manager task objects into canonical unified TaskReport entities with deterministic fallback behavior.
|
||||
# @LAYER Domain
|
||||
@@ -20,7 +20,7 @@ from ...models.report import ErrorContext, ReportStatus, TaskReport
|
||||
from .type_profiles import get_type_profile, resolve_task_type
|
||||
|
||||
|
||||
# #region status_to_report_status [TYPE Function]
|
||||
# #region Services.Normalizer.StatusToReportStatus [TYPE Function]
|
||||
# @ingroup Services
|
||||
# @BRIEF Normalize internal task status to canonical report status.
|
||||
# @PRE status may be known or unknown string/enum value.
|
||||
@@ -35,10 +35,10 @@ def status_to_report_status(status: Any) -> ReportStatus:
|
||||
if raw in {TaskStatus.PENDING.value, TaskStatus.RUNNING.value, TaskStatus.AWAITING_INPUT.value, TaskStatus.AWAITING_MAPPING.value}:
|
||||
return ReportStatus.IN_PROGRESS
|
||||
return ReportStatus.PARTIAL
|
||||
# #endregion status_to_report_status
|
||||
# #endregion Services.Normalizer.StatusToReportStatus
|
||||
|
||||
|
||||
# #region build_summary [TYPE Function]
|
||||
# #region Services.Normalizer.BuildSummary [TYPE Function]
|
||||
# @ingroup Services
|
||||
# @BRIEF Build deterministic user-facing summary from task payload and status.
|
||||
# @PRE report_status is canonical; plugin_id may be unknown.
|
||||
@@ -58,10 +58,10 @@ def build_summary(task: Task, report_status: ReportStatus) -> str:
|
||||
if report_status == ReportStatus.IN_PROGRESS:
|
||||
return "Task is in progress"
|
||||
return "Task completed with partial data"
|
||||
# #endregion build_summary
|
||||
# #endregion Services.Normalizer.BuildSummary
|
||||
|
||||
|
||||
# #region extract_error_context [TYPE Function]
|
||||
# #region Services.Normalizer.ExtractErrorContext [TYPE Function]
|
||||
# @ingroup Services
|
||||
# @BRIEF Extract normalized error context and next actions for failed/partial reports.
|
||||
# @PRE task is a valid Task object.
|
||||
@@ -100,10 +100,10 @@ def extract_error_context(task: Task, report_status: ReportStatus) -> ErrorConte
|
||||
next_actions = ["Review task diagnostics", "Retry the operation"]
|
||||
|
||||
return ErrorContext(code=code, message=message, next_actions=next_actions)
|
||||
# #endregion extract_error_context
|
||||
# #endregion Services.Normalizer.ExtractErrorContext
|
||||
|
||||
|
||||
# #region normalize_task_report [TYPE Function]
|
||||
# #region Services.Normalizer.NormalizeTaskReport [TYPE Function]
|
||||
# @ingroup Services
|
||||
# @BRIEF Convert one Task to canonical TaskReport envelope.
|
||||
# @PRE task has valid id and plugin_id fields.
|
||||
@@ -182,6 +182,6 @@ def normalize_task_report(task: Task, *, include_result: bool = True) -> TaskRep
|
||||
error_context=extract_error_context(task, report_status),
|
||||
source_ref=source_ref or None,
|
||||
)
|
||||
# #endregion normalize_task_report
|
||||
# #endregion Services.Normalizer.NormalizeTaskReport
|
||||
|
||||
# #endregion normalizer
|
||||
# #endregion Services.Normalizer
|
||||
|
||||
Reference in New Issue
Block a user