← Назад к задаче

activity-sort-report.md

Factory Interface activity ordering

Implemented in the working tree; no service restart or production database mutation performed. Changes were made sequentially, without delegated or concurrent edits. No Coral or paused L-IT project content was changed.

Behavior

The main projects dashboard now orders descending by the latest meaningful activity across each project's tasks. Recent Tasks, task links within each roadmap, and the dashboard attention list use the same descending activity rule. Equal timestamps use descending numeric ID for deterministic ordering. Projects without tasks sort after projects with task activity, using ID among themselves; project creation/edit timestamps do not compete with task activity.

Activity is the maximum of task creation/update, approval/acceptance, every execution's creation/start/completion, explicit OWNER_DECISION events, and attachment creation. Attachment removal now stamps the task update time so removal also remains meaningful activity after the attachment row disappears. SQLite julianday normalizes timezone offsets before comparison. Null/unparseable timestamps contribute zero. Generic events, page views, telemetry polling, and project edits do not affect this calculation. Task updated_at relies on existing mutation writers; GET requests do not update it.

Existing archive/attention conditions, status filters, compact markup, roadmap grouping and dispatcher priority rules are preserved. The only template wording change labels the list as activity ordered. CSS, filter JavaScript, base navigation and the legacy /mobile menu/route are unchanged.

Files

Verification

All five new activity tests pass. Nine activity sources are checked independently: an older project initially follows a newer project, then rises first when its older task becomes newly active. Both project task lists and attention ordering are checked. Additional coverage verifies equal-instant timezone ties, empty projects, attachment deletion, archive/running-execution filters, and repeated HTML/API reads with identical database dumps before and after. All five existing console-cache tests also pass.

Final command:

.venv/bin/python -m unittest control_plane.tests.test_activity_sort control_plane.tests.test_console_cache control_plane.tests.test_owner_decisions control_plane.tests.test_executor_policy -q

Result: 35 tests, 29 passed, 4 failures and 2 errors. Full output: activity-sort-tests.log in this directory. The six failures/errors are existing compatibility issues in owner-decision/executor-policy UI tests: missing totals in a direct template fixture, obsolete compact/detail/form markup expectations, and a JavaScript document stub without getElementById.

To establish the baseline without temporarily editing application files, activity-sort-baseline.py reconstructs the previous ordering logic in memory and restores the previous template label through a Jinja loader. Running the 25 owner/executor tests against it reproduced exactly the same six failing test names (19 passed, 4 failures, 2 errors); see activity-sort-baseline-tests.log. Reproduce with:

PYTHONPATH=. .venv/bin/python data/project_materials/FACTORY-INTERFACE/review/activity-sort-baseline.py

No unrelated UI/test repairs were made. Runtime activation remains pending the normal authorized deployment/reload; this task explicitly requested no restart, so no live-process activation is claimed.

Материалы