[Performance] Batch workflow instance revision evidence and bound history projections #3

Closed
opened 2026-09-08 01:06:34 +02:00 by zemion · 1 comment
Owner

Next bounded improvement: list_instances loads steps/events then instance_response performs revision lookup per instance. Evidence: backend/instance_service.py around lines 99–102 and 863; workflow router around line 696. Prefetch revision evidence with unchanged tenant/owner filters and an SQL-count regression for 40 instances. Separately define summary/detail and history pagination contracts; do not silently truncate histories. Work-item totals also stream all authorized rows for exact counts (work_items.py around lines 112–145); profile before changing total semantics.

Source review and coordinated status: GovOPlaN/govoplan-core#296 .

Next bounded improvement: list_instances loads steps/events then instance_response performs revision lookup per instance. Evidence: backend/instance_service.py around lines 99–102 and 863; workflow router around line 696. Prefetch revision evidence with unchanged tenant/owner filters and an SQL-count regression for 40 instances. Separately define summary/detail and history pagination contracts; do not silently truncate histories. Work-item totals also stream all authorized rows for exact counts (work_items.py around lines 112–145); profile before changing total semantics. Source review and coordinated status: https://git.add-ideas.de/GovOPlaN/govoplan-core/issues/296 .
Author
Owner

Implemented and published in govoplan-workflow-engine a2fc5639db04.

Pinned revisions are batched: a cold 40-distinct-revision full-history list uses five SQL reads, preserving complete legacy steps/events and tenant filtering. A 40-row ordinary summary list uses one query and omits graph/history/runtime payloads. Additive summary and sequence-bounded step/event APIs have explicit pagination, count and continuation semantics, with current tenant/definition authorization on each request. Legacy history is never silently truncated.

Exact authorized inbox totals are preserved. Local 40/400/4,000-candidate fixtures use one query and approximately 0.011/0.057/0.492 seconds; the remaining streaming/counting cost is documented, not presented as a production SLO.

Query-count, current-authorization and HTTP boundary regressions, full focused checks, EN/DE documentation and exact headless endpoint declarations passed. Release/development migration checks for index migration 9e6b3f8a2c7d also passed on isolated PostgreSQL. Normal backed-up upgrades and index-build planning remain necessary.

Closing the bounded source/performance follow-up; this is not a live migration claim.

Full implementation, verification and remaining adoption gates. Source main was pushed and read back at its exact commit; existing remote tag inventories were verified unchanged. This is source publication, not a new package/image release or deployment.

Implemented and published in [govoplan-workflow-engine a2fc5639db04](https://git.add-ideas.de/GovOPlaN/govoplan-workflow-engine/commit/a2fc5639db04ac4452a73e3b445239d3dd92f538). Pinned revisions are batched: a cold 40-distinct-revision full-history list uses five SQL reads, preserving complete legacy steps/events and tenant filtering. A 40-row ordinary summary list uses one query and omits graph/history/runtime payloads. Additive summary and sequence-bounded step/event APIs have explicit pagination, count and continuation semantics, with current tenant/definition authorization on each request. Legacy history is never silently truncated. Exact authorized inbox totals are preserved. Local 40/400/4,000-candidate fixtures use one query and approximately 0.011/0.057/0.492 seconds; the remaining streaming/counting cost is documented, not presented as a production SLO. Query-count, current-authorization and HTTP boundary regressions, full focused checks, EN/DE documentation and exact headless endpoint declarations passed. Release/development migration checks for index migration 9e6b3f8a2c7d also passed on isolated PostgreSQL. Normal backed-up upgrades and index-build planning remain necessary. Closing the bounded source/performance follow-up; this is not a live migration claim. [Full implementation, verification and remaining adoption gates](https://git.add-ideas.de/GovOPlaN/govoplan/src/commit/58d320d9b34a618aab6ce0b9e48daf943961af66/docs/security/SECURITY_FOLLOWUP_2026-09-08.md). Source main was pushed and read back at its exact commit; existing remote tag inventories were verified unchanged. This is source publication, not a new package/image release or deployment. <!-- govoplan-security-followup-20260908-source58d320d -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-workflow-engine#3