3.5 KiB
3.5 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-restore-sync-context | Restore GitHub PR sync context | done | 1 | plan.md | ../../specs/pr-outcome-attribution/spec.md |
Task 01: Restore GitHub PR Sync Context
Intent
Restore the missing task and pull-request context in the final sync helper. Preserve the existing persistence, reconciliation, and publication order.
Acceptance
apps/backend/internal/githubcompiles without undefined identifiers.SyncTaskPRpersists the task PR before comparison-target reconciliation.- The comparison observer receives the same task ID and PR identity as the sync.
- Existing stale-writer event behavior remains unchanged.
Red Test First
Add TestSyncTaskPR_PersistsBeforeComparisonTargetReconciliation in
service_comparison_target_sync_test.go. The current package must fail to
compile because the helper does not receive taskID or status.PR.
Implementation
- Extend
persistAndPublishTaskPRSyncwithtaskID stringandpr *PR. - Pass
taskIDandstatus.PRfromSyncTaskPR. - Pass
tp.TaskIDandstatus.PRfrom unwatched lifecycle reconciliation. - Use those parameters for
reconcileComparisonTargetFromSync. - Update direct helper calls in existing tests.
- Do not change storage, reconciliation, or event behavior.
Files Likely Touched
apps/backend/internal/github/service_pr_watch.goapps/backend/internal/github/service_pr_unwatched.goapps/backend/internal/github/service_comparison_target_sync_test.goapps/backend/internal/github/service_pr_outcome_sync_test.godocs/plans/github-pr-sync-context-regression/plan.mddocs/plans/github-pr-sync-context-regression/task-01-restore-sync-context.md
Dependencies
None.
Parallelism
sequential. The source and tests share one helper contract.
Inputs
docs/specs/pr-outcome-attribution/spec.md, sectionSync writerdocs/specs/platform/workspace-git-status.md, sectionRepository-qualified comparison targetsdocs/decisions/2026-08-19-repository-qualified-comparison-targets.md
Verification
Run these commands from the repository root:
cd apps/backend && \
GOCACHE=/tmp/kandev-go-build-cache go test ./internal/github -run 'TestSyncTaskPR_PersistsBeforeComparisonTargetReconciliation|TestPersistAndPublishTaskPRSync_PublishesReReadValueNotStaleInMemoryOne' && \
GOCACHE=/tmp/kandev-go-build-cache make build
Then run this command from the repository root:
git diff --check
Output Contract
Report the changed files, exact command results, blockers, and remaining risks.
Update this task and plan.md in the same conversation.
Results
- RED:
GOCACHE=/tmp/kandev-go-build-cache go test ./internal/github -run TestSyncTaskPR_PersistsBeforeComparisonTargetReconciliationfailed with the expected undefinedtaskIDandstatuscompiler errors. - GREEN:
GOCACHE=/tmp/kandev-go-build-cache go test ./internal/github -run TestSyncTaskPR_PersistsBeforeComparisonTargetReconciliationpassed. - Targeted regression command passed:
GOCACHE=/tmp/kandev-go-build-cache go test ./internal/github -run "TestSyncTaskPR_PersistsBeforeComparisonTargetReconciliation|TestPersistAndPublishTaskPRSync_PublishesReReadValueNotStaleInMemoryOne". - Backend build passed:
GOCACHE=/tmp/kandev-go-build-cache make build. gofmt -wcompleted for all changed Go files.git diff --checkpassed.- Build output was written to ignored files under
apps/backend/bin. - No temporary source files or E2E assets were created.