Skip to content

fix(stovepipe): report completed project results - #928

Merged
mnoah1 merged 6 commits into
mainfrom
mnoah1/stovepipe-project-results-complete
Oct 23, 2026
Merged

mnoah1 merged 6 commits into
mainfrom
mnoah1/stovepipe-project-results-complete

Conversation

@mnoah1

@mnoah1 mnoah1 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Non-empty project result sets already persisted a project_facts_recorded completion event, but the project-status API never read that event, so projectResultsComplete remained false. This change adds the missing completion projection into the request summary and reads it during status lookup. Empty result sets previously returned early without persisting the event; they now record completion with a count of zero after successful resolution.

Intent:

  • Let callers distinguish a finished project result set from results that are still being recorded.

Changes:

  • Project the retained project_facts_recorded timestamp into RequestSummary.ProjectResultsCompletedAtMs, expose completion through both status lookups from the summary, and include its timestamp in updated_at_ms. The summary is read before facts, without an additional event lookup.
  • Record completion for successfully resolved empty result sets before publishing the terminal hook.
  • Preserve completion across lifecycle updates and concurrent projection retries; failed summary writes are repaired on redelivery using the original event timestamp.
  • Cover completion, missing markers, storage failures, pagination, index repair on retry, and the real pipeline in unit, integration, and end-to-end tests.

Test Plan

Passed locally:

./tool/bazel test \
  //stovepipe/controller:go_default_test \
  //stovepipe/controller/record:go_default_test \
  //stovepipe/core/requestlog:go_default_test \
  //stovepipe/extension/storage/mysql:go_default_test \
  --test_output=errors

./tool/bazel test \
  //test/integration/stovepipe:go_default_test \
  //test/e2e/stovepipe:go_default_test \
  --test_output=errors

./tool/bazel test \
  //web/test/e2e/stovepipe:web_test \
  //web/test/e2e/stovepipe:run_e2e_test \
  --test_output=errors

./tool/bazel test //tool/docsite:site_test --test_output=errors

make lint check-gazelle check-tidy

Unit tests cover completion projection, missing completion, empty results, storage failures, original completion timestamps, concurrent lifecycle updates, summary-before-facts ordering, and index repair on retry. Integration tests cover both status APIs and pagination. The end-to-end test verifies completion through the real pipeline for an empty result set. The real-stack Web E2E test verifies that pagination fixtures load against the current schema and the browser can read request and project results.

Revert Plan

Revert the application change; leave the additive column in place. Existing facts and request events remain compatible.

Issue Links

None — no tracking issue is associated with this fix.

Summary:
Intent:
- Let callers distinguish a finished project result set from results that are still being recorded.

Changes:
- Read the durable project_facts_recorded event before loading project facts, expose completion through both status lookups, and include its timestamp in updated_at_ms.
- Record completion for successfully resolved empty result sets before publishing the terminal hook.
- Cover completion, missing markers, storage failures, pagination, index repair on retry, and the real pipeline in unit, integration, and end-to-end tests.

Revert Plan:
Revert the application change. Existing facts and request events remain compatible; no schema migration is required.
@mnoah1
mnoah1 marked this pull request as ready for review October 23, 2026 16:17
@mnoah1
mnoah1 requested review from a team, behinddwalls and sbalabanov as code owners October 23, 2026 16:17
@mnoah1
mnoah1 enabled auto-merge October 23, 2026 17:58
@mnoah1
mnoah1 added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 6f66ecf Oct 23, 2026
21 checks passed
@mnoah1
mnoah1 deleted the mnoah1/stovepipe-project-results-complete branch October 23, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants