Go to file
zerosaturation e2f1122cc8 feat(task): GORM model + repository + ProcessTaskEvent engine
Phase B (model + repository):
- TaskDefinition: +TriggerEvent string, +TargetCount int
- UserDailyTaskProgress: +Progress int
- DailyTaskRepository: ListActiveDailyTaskDefinitions signature -> (starID, eventType string)
- IncrementProgress: atomic UPDATE progress=progress+1 WHERE status='pending'
  (returns rows-affected 0 + re-read on race; caller decides completion transition)
- ResetAllDailyTasks: +progress: 0 in Updates map
- InitDailyTasksForUser: pass eventType='' (backward-compat)

Phase D (engine + ReportEvent delegation, spec §4.3):
- TaskEventResult struct (CompletedTaskKeys []string)
- DailyTaskService.ProcessTaskEvent: 5-step engine
  1. ListActiveDailyTaskDefinitions(starID, eventType) - filter by trigger_event
  2. GetOrCreateDailyProgress; skip if completed/claimed (day idempotency)
  3. IncrementProgress (atomic +1)
  4. if progress >= target_count -> status='completed'
  5. UpdateDailyProgress + accumulate CompletedTaskKeys
- ReportEvent rewired: delegates to ProcessTaskEvent, maps TaskEventResult
  to ReportEventResponse (F1: single isolation unit; MQ consumer + RPC both use engine)
- 3 callers (GetDailyTasks / ClaimDailyTask / ClaimAllDailyTasks) pass eventType=''
  for backward-compat (preserves daily_login / daily_browse_asset before Phase F)

Note: Phase B and D are bundled because the signature change in B is what enables
D's engine to filter by trigger_event. Splitting would leave the codebase
uncompilable in the interim.

spec: docs/superpowers/specs/2026-07-21-daily-task-config-driven-design.md §4
plan: docs/superpowers/plans/2026-07-21-daily-task-config-driven-impl.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 15:41:35 +08:00
.agents/skills
.tmp
backend feat(task): GORM model + repository + ProcessTaskEvent engine 2026-07-27 15:41:35 +08:00
docker feat(task): migration + backfill daily_task trigger_event 2026-07-27 15:38:46 +08:00
docs docs(starbook): add has_more design spec and implementation plan 2026-07-24 19:20:32 +08:00
frontend feat:修改铸造消耗弹窗样式 2026-07-27 13:38:23 +08:00
k8s fix(k8s): livenessProbe port to healthPort + values.yaml healthPort +1000 (follow-up P2) 2026-07-24 15:14:38 +08:00
mock
scripts
.gitignore fix(0a): replace real keys with placeholders in .env.example + harden .gitignore 2026-07-24 15:23:26 +08:00
AGENTS.md
CLAUDE.md
README.md

TopFans