Skip to content

feat: expose start and completion timestamps for task scan phases#1131

Open
diksha78dev wants to merge 1 commit into
utksh1:mainfrom
diksha78dev:fix/issue-802
Open

feat: expose start and completion timestamps for task scan phases#1131
diksha78dev wants to merge 1 commit into
utksh1:mainfrom
diksha78dev:fix/issue-802

Conversation

@diksha78dev

Copy link
Copy Markdown
Contributor

Description

This PR resolves #802 by persisting granular started_at and completed_at timestamps for each scan phase, and exposing them in the get_task_status payload.

Changes Include:

  • Schema: Added phase_timestamps_json to the tasks table schema.
  • Executor: Initialized the queued timestamp upon task creation.
  • Executor: Updated _broadcast_phase to use SQLite's atomic json_set to safely mark the completion of the prior phase and the start of the new phase.
  • API: Updated get_task_status to parse and include phase_timestamps in the detail payload.
  • Tests: Updated mock task rows and test_broadcast_phase_persists_to_db assertions to handle the expanded JSON timestamp persistence logic.

Related Issues

Closes #802

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Ran unit tests covering task phase broadcasts test_broadcast_phase_persists_to_db to assert that correct SQLite json_set commands are generated.
  • Ran unit tests for API integration test_scan_phase_included_in_status_response to verify that phase_timestamps dict is correctly evaluated and serialized in the task status response.

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

@utksh1 utksh1 added level:intermediate 35 pts difficulty label for moderate contributor PRs type:feature Feature work category bonus label area:backend Backend API, database, or service work labels Jun 20, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes. The current run fails formatting-hygiene. Please run the formatter and keep the phase timestamp migration/executor tests green.

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still blocked after the latest update: formatting-hygiene is failing, and some fresh backend checks are still pending. Please fix formatting and wait for the full run to settle green.

@diksha78dev diksha78dev force-pushed the fix/issue-802 branch 2 times, most recently from 9fb1ac3 to 8650f56 Compare June 20, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work level:intermediate 35 pts difficulty label for moderate contributor PRs type:feature Feature work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Persist scan phase timestamps in task detail responses

2 participants