5.0 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-collect-workflow-attention | Collect workflow attention | done | 1 | plan.md |
|
|
|
Task 01: Collect Workflow Attention
Summary
Collect current-head workflow evidence with the workspace GitHub client. Persist the observation through every status writer without manufacturing check failures.
In scope
- Add the workflow-run and candidate-job readers, shared classifier, and matching client doubles.
- Enrich REST status, feedback, numbered watches, and branch-discovered batches before cache publication. Keep the unwatched lifecycle sweep free of new Actions reads so active watches do not incur an additional workflow API sweep.
- Add the JSON observation column and cover scan, update, restore, migration, and workspace events.
- Preserve compact task-status projections and update their bounded attention category where necessary.
- Prove approval-only observations cannot start CI repair or automatic merging.
- Extend the mock provider/controller so browser fixtures can represent a jobless approval gate.
Out of scope
- Rendered UI and locale changes.
- New permission grants, workflow mutations, and independent polling infrastructure.
Acceptance
- A regression named
TestWorkflowAttention_JoblessForkApprovalfails before the change and passes after collection. - REST, batched sync, feedback, reload, and multi-PR storage agree on head-scoped evidence, including stale and superseded observations.
- Mixed real failures retain their counts and repair behavior. Approval-only evidence consumes no repair round and never satisfies merge readiness.
Verification
Run from the repository root. Use TDD for the new named regressions.
(cd apps/backend && go test ./internal/github -count=1)
(cd apps/backend && go test ./internal/orchestrator -run 'GitHub|Github|PRCI|PRCIAutomation' -count=1)
python3 scripts/lint-spec-files.py --all
git diff --check
The orchestrator command must discover every changed automation test. Add a specific test name if its existing name differs.
Files likely touched
apps/backend/internal/github/client.go,models.go,gh_client.go,pat_client.go- New
apps/backend/internal/github/workflow_attention.goandworkflow_attention_test.go apps/backend/internal/github/client_helpers.go,service_pr_watch_batched.go,service_pr_watch.go,service_pr_feedback_sync.go- GitHub
store*.go, matching migration tests,mock_client.go,noop_client.go,mock_controller.go apps/backend/internal/orchestrator/event_handlers_github_ci_automation.goand its test file- The existing bounded task-status projection where it derives GitHub attention
Dependencies
None.
Risks
The collector must distinguish permission failure, no runs, and no jobs. Current-head matching needs head repository identity when GitHub omits PR associations. Extra reads must stay inside existing credential scopes and context budgets.
Parallelism
sequential
Inputs
- Requirements
- Design
- Existing
newPRStatus,persistPRFeedbackState, andSyncTaskPRpaths - Existing
store_taskpr_schema_drift_test.goandstore_merge_queue_recovery_test.gopatterns
Results
Implemented and verified on 2026-09-10. The GitHub clients now collect current-head workflow runs and jobs, classify jobless fork approvals separately from ordinary checks, and persist the bounded observation through REST, feedback, batched, watch, restore, and mock-provider paths. The unwatched lifecycle sweep preserves same-head stored evidence and clears it on a new head without issuing new Actions reads. Approval-only evidence does not count as a failed check or satisfy CI automation readiness.
Validation passed:
go test ./internal/github -count=1: 1,741 tests passed.go test ./internal/orchestrator -run 'GitHub|Github|PRCI|PRCIAutomation' -count=1: 51 tests passed.python3 scripts/lint-spec-files.py --all.git diff --check.
PR-fixup validation also passed go test -race ./internal/github -count=1 (1,741 tests) and make -C apps/backend lint with zero issues. The unwatched lifecycle and mock workflow mutation regressions are covered by the added tests.
The exact-head review remediation also covers the actual REST pull_requests[].head.repo shape, including
matching and mismatching repository identities and a newer associated success superseding an older unassociated
approval. The final focused workflow-attention tests and backend lint passed after this change.