Skip to content

Extract bounded activity fetch utilities (codex) - #2351

Merged
numnx merged 1 commit into
feature/CODUX-142-qs-code-quality-performance-audit-6from
task/feature-codux-142-qs-code-quality-performance-au-t01-codex-mr9j5mb0
Jul 6, 2026
Merged

Extract bounded activity fetch utilities (codex)#2351
numnx merged 1 commit into
feature/CODUX-142-qs-code-quality-performance-audit-6from
task/feature-codux-142-qs-code-quality-performance-au-t01-codex-mr9j5mb0

Conversation

@numnx

@numnx numnx commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Extract bounded activity fetch utilities

Automated task PR opened by Code UX for T01.

📋 Summary

Sprint: Sprint 142 · QS: Code Quality & Performance Audit · Task: T01

Audit and improve Code UX quality and performance by tightening existing hot-path contracts across live snapshots, execution projection, provider telemetry, dashboard render derivation, repository boundaries, MCP validation, guardrails, and documentation.

📝 Full Task Prompt
## Objective
Create a shared bounded activity fetch utility so session sync and dashboard activity caching use one deterministic timeout, ordering, and concurrency contract.

## Scope
- Create or edit `src/domain/sprint/session-sync/activity-fetch-utils.ts`
- Edit `src/domain/sprint/session-sync/bounded-activity-fetch.ts`
- Edit `tests/backend/domain/sprint/session-sync/bounded-activity-fetch.test.ts`
- Verify references from `src/server/activity-cache-service.ts` without changing it in this task
- Update `docs/architecture/code-quality-performance-contracts.md` session sync guidance if the helper name or contract changes

## Implementation Requirements
1. Move the generic timeout wrapper, error metadata normalization, and bounded ordered p-map behavior into `activity-fetch-utils.ts` with exported types/functions that are independent of Jules-specific activity shapes.
2. Refactor `fetchActivitiesBounded` to delegate concurrency, timeout, and order preservation to the shared helper while preserving its public signature and current logging behavior.
3. Add focused tests covering result order preservation, timeout fallback to an empty activity list, concurrency limiting, and non-positive timeout pass-through.
4. Keep the helper side-effect free except for explicit logger calls made by the existing caller path.

## Constraints
- Do not change the `fetchActivitiesBounded` export signature consumed by `src/sprint/steps/session-sync-step.ts`.
- Preserve deterministic output ordering matching the input `sessionNames` array.
- Do not introduce a new dependency; use existing TypeScript and standard runtime APIs only.
- Do not edit `src/server/activity-cache-service.ts` in this task beyond read-only verification.

## Verification
- Run `pnpm exec vitest run tests/backend/domain/sprint/session-sync/bounded-activity-fetch.test.ts`.
- Run `pnpm run lint`.
- Success means the bounded fetch tests prove the shared helper preserves ordering, timeout, and concurrency semantics without changing the public session-sync API.

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-06 18:05:02 UTC
Finished 2026-07-06 18:07:57 UTC
Duration 2m 55s

📊 Token Usage

Metric Value
Input tokens 73,205
Cached input tokens 430,720
Output tokens 5,415
Total tokens 509,340
Invocations 1
Tool calls 22
Active time 2m 26s

Included usage estimate (subscription/local login): $0.74

🌿 Branch Info

Base: feature/CODUX-142-qs-code-quality-performance-audit-6
Head: task/feature-codux-142-qs-code-quality-performance-au-t01-codex-mr9j5mb0


🤖 Generated by Code UX

@numnx
numnx merged commit 9c619b1 into feature/CODUX-142-qs-code-quality-performance-audit-6 Jul 6, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-142-qs-code-quality-performance-au-t01-codex-mr9j5mb0 branch July 6, 2026 18:10
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.

1 participant