4 plans across 3 waves: - 01-01 (wave 1): package scaffold — types.go, service.go, service_test.go - 01-02 (wave 2): QueryUserProfitLoss — query_user.go + user integration tests - 01-03 (wave 2, parallel): QueryActivityProfitLoss — query_activity.go + activity tests - 01-04 (wave 3): phase verification — static checks + full test suite gate Covers all 20 Phase 1 requirements: PNL-01..08, DIM-01..04, RET-01/03, AST-01, QUA-01..05.
8.0 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-core-pnl-functions | 04 | execute | 3 |
|
true |
|
|
Purpose: Gate phase completion. Catches any drift between plans that ran in parallel (Plans 02 and 03), verifies static code properties that tests alone cannot guarantee, and confirms the full build is green.
Output: Evidence that all Phase 1 requirements are met. Creates no new files.
<execution_context>
@/.claude/get-shit-done/workflows/execute-plan.md
@/.claude/get-shit-done/templates/summary.md
</execution_context>
Check 1: Full test suite (QUA-03, QUA-04, QUA-05)
go test -v --cover ./internal/service/finance/...
Expected: All tests PASS, 0 failures.
Check 2: Full project build (QUA-01)
go build ./...
Expected: exits 0, no errors.
Check 3: No GetDbW() in finance package (QUA-02)
grep -r "GetDbW" ./internal/service/finance/
Expected: empty output (zero matches). If any match found, FAIL — locate and remove the call.
Check 4: Fan-out scan count — user (QUA-05)
grep -c "Scan(&" ./internal/service/finance/query_user.go
Expected: >= 4.
Check 5: Fan-out scan count — activity (QUA-05)
grep -c "Scan(&" ./internal/service/finance/query_activity.go
Expected: >= 4.
Check 6: Scan errors all checked (QUA-03)
grep -B1 "Scan(&" ./internal/service/finance/query_user.go | grep -c "if err :="
grep -B1 "Scan(&" ./internal/service/finance/query_activity.go | grep -c "if err :="
Expected: count matches the number of Scan calls in each file. If any Scan is not wrapped in if err :=, locate and fix.
Check 7: Finance utility functions reused (QUA-04)
grep -E "ClassifyOrderSpending|ComputeGamePassValue|ComputePrizeCostWithMultiplier|ComputeProfit" ./internal/service/finance/query_user.go | wc -l
grep -E "ClassifyOrderSpending|ComputeGamePassValue|ComputePrizeCostWithMultiplier|ComputeProfit" ./internal/service/finance/query_activity.go | wc -l
Expected: >= 3 matches in each file.
Check 8: No SQL-embedded CAST AS SIGNED (SQLite test compat)
grep "AS SIGNED" ./internal/service/finance/query_user.go ./internal/service/finance/query_activity.go | wc -l
Expected: 0. Multipliers must be applied in Go via ComputePrizeCostWithMultiplier.
Check 9: int64 monetary fields (RET-03)
grep -E "Revenue|Cost|Profit\b" ./internal/service/finance/types.go | grep "float64"
Expected: 0 matches. Only ProfitRate float64 is allowed; all Revenue/Cost/Profit fields must be int64.
Check 10: AssetType constants (AST-01)
grep -A7 "AssetTypeAll" ./internal/service/finance/types.go
Expected: shows All=0, Points=1, Coupon=2, ItemCard=3, Product=4, Fragment=5.
If any check fails:
- Identify which file has the issue from the check output
- Read the file
- Make the targeted fix (do not rewrite the whole file)
- Re-run the failing check to confirm it now passes
- Re-run
go test -v ./internal/service/finance/...to confirm tests still pass go test -v --cover ./internal/service/finance/... && go build ./... && echo "ALL PHASE 1 CHECKS PASSED" <acceptance_criteria>go test -v --cover ./internal/service/finance/...exits 0 with PASS for all testsgo build ./...exits 0grep -r "GetDbW" ./internal/service/finance/returns empty (0 matches)grep -c "Scan(&" ./internal/service/finance/query_user.goreturns >= 4grep -c "Scan(&" ./internal/service/finance/query_activity.goreturns >= 4grep -E "ClassifyOrderSpending|ComputeProfit" ./internal/service/finance/query_user.go | wc -lreturns >= 2grep -E "ClassifyOrderSpending|ComputeProfit" ./internal/service/finance/query_activity.go | wc -lreturns >= 2grep "AS SIGNED" ./internal/service/finance/query_*.go | wc -lreturns 0grep -E "Revenue|Cost|Profit\b" ./internal/service/finance/types.go | grep "float64" | wc -lreturns 0- All 10 verification checks above show PASS or expected result </acceptance_criteria> All 10 static and automated checks pass. Phase 1 is complete — QueryUserProfitLoss and QueryActivityProfitLoss are implemented, tested, and meet all 20 Phase 1 requirements.
go test -v --cover ./internal/service/finance/...— all PASS, coverage reportedgo build ./...— exits 0grep -r "GetDbW" ./internal/service/finance/— 0 matchesgrep -c "Scan(&" query_user.go— >= 4grep -c "Scan(&" query_activity.go— >= 4- All finance.* utility functions called (not reimplemented) in query_*.go
- All monetary fields in types.go are int64 (ProfitRate is the only float64)
- VALIDATION.md nyquist_compliant updated to true
<success_criteria>
- All 20 Phase 1 requirements (PNL-01 through QUA-05) verified as complete
- Full test suite green including existing profit_metrics tests
- Full project build clean
- Finance package has zero write-DB references
- Phase 1 ready for hand-off to Phase 2 </success_criteria>