Skip to content

Commit 65eb97e

Browse files
committed
Rehydrate docs for Paper backend gap delivery wave
Update STATUS.md, IMPLEMENTATION_MASTERPLAN.md, and TESTING_GUIDE.md to reflect the 10 Paper backend gap PRs (#1031-#1040, issues #1015-#1024): ~460 new backend tests, 10 new API endpoints, 3 EF Core migrations, and two rounds of adversarial review per PR.
1 parent 357617b commit 65eb97e

3 files changed

Lines changed: 164 additions & 14 deletions

File tree

docs/IMPLEMENTATION_MASTERPLAN.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Taskdeck Implementation Masterplan
22

3-
Last Updated: 2026-04-25
3+
Last Updated: 2026-04-26
44
<br>
55
Planning Horizon: Next 8 to 12 weeks
66
Companion Active Docs:
@@ -41,6 +41,15 @@ Update this file at the end of each meaningful delivery cycle or when new work i
4141

4242
Delivered in the latest cycle:
4343

44+
Paper backend gap delivery (2026-04-26, PRs `#1031`--`#1040`, 10 issues `#1015`--`#1024`):
45+
- 10 backend endpoints delivered for the Paper UI surfaces (PAPER-08 Today dossier + PAPER-06 Review deep-dive), closing all `paper-*-backend-gap-*` issues
46+
- Today dossier: cadence aggregation (`#1015`/`#1031`), 90-day streak query (`#1016`/`#1032`), seal-day action with EF migration (`#1017`/`#1037`), line-for-tomorrow autosave (`#1018`/`#1035`)
47+
- Review deep-dive: provenance rows with FK migration (`#1019`/`#1039`), 7-category side-effect analysis (`#1020`/`#1033`), 4-component confidence breakdown (`#1021`/`#1036`), conflict detection with 7 rules (`#1022`/`#1040`), card history ledger (`#1023`/`#1034`), similar past decisions with apply rate (`#1024`/`#1038`)
48+
- ~460 new backend tests across domain, application, and API layers
49+
- Two rounds of adversarial review per PR; Gemini Code Assist and Codex connector bot findings addressed on all 10 PRs
50+
- Key review fixes: 100k entity memory risk replaced with server-side GROUP BY (`#1032`), P1 false-warning for create-card ops (`#1040`), board-scoped similar-decision query (`#1038`), UnitOfWork unique constraint handlers for DailySnapshot/TomorrowNote (`#1037`/`#1035`), CancellationToken threading, reach formula correction (`#1036`), FK enforcement for provenance (`#1039`), entity caching in conflict detector (`#1040`)
51+
- New shared infrastructure: `TodayController`, `DailySnapshot` entity + repository, `TomorrowNote` entity + repository, `CountByDateAsync` aggregate audit query, `GetTerminalByActionTypeAsync` and `GetPendingByOperationTargetAsync` proposal repository methods
52+
4453
Latest tooling addition (2026-04-25):
4554
- Codex high-autonomy workflow hardening delivered: `docs/tooling/CODEX_AUTONOMY_RUNBOOK.md` now defines issue batch orchestration, worktree workers, PR review loops, CI/comment/conflict recovery, no-silent-deferral rules, and docs rehydration.
4655
- Repo-local Codex skills added for issue batch orchestration, isolated issue workers, PR review loops, and CI/conflict recovery.

docs/STATUS.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Taskdeck Status (Source of Truth)
22

3-
Last Updated: 2026-04-25
3+
Last Updated: 2026-04-26
44

5-
Review-first AI roadmap v4 second-wave delivery (RFAI-02 through RFAI-08 foundational slices), plus flaky CI test fix, after roadmap v4 adoption and first-wave delivery.
5+
Paper backend gap delivery (10 issues, `#1015``#1024`, PRs `#1031``#1040`), after review-first AI roadmap v4 second-wave delivery.
66
<br>
77
Status Owner: Repository maintainers
88
Authoritative Scope: Current implementation, verified test execution, and active phase progress
@@ -23,6 +23,23 @@ Rebranding thesis (2026-02-23):
2323
- automation should remain review-first and provenance-visible
2424
- product value is reducing maintenance overhead, not maximizing opaque autonomy
2525

26+
Paper backend gap delivery (2026-04-26, PRs `#1031`--`#1040`, 10 issues `#1015`--`#1024`):
27+
- All 10 Paper backend gaps delivered with two rounds of adversarial review per PR; ~460 new backend tests; bot review findings (Gemini Code Assist + Codex connector) addressed on all PRs
28+
- **Today dossier backends** (4 endpoints on `TodayController`, required by PAPER-08 `#1004`):
29+
- Cadence aggregation (`#1015`/`#1031`): `GET /api/today/cadence?date=` returns 24-hour activity buckets with first/peak/last action timestamps; `CadenceBucket` and `CadenceSnapshot` value objects with cached `Empty()` singleton; queries `IAuditLogRepository`; 26 tests
30+
- Streak query (`#1016`/`#1032`): `GET /api/today/streak?days=90` returns 90-day streak with intensity buckets (quartile-based) and current/longest streak lengths; `StreakDay`/`StreakResult` value objects; server-side `GROUP BY` via `CountByDateAsync` (replaced 100k entity load after review); 61 tests
31+
- Seal day action (`#1017`/`#1037`): `POST /api/today/seal` and `GET /api/today/seal?date=` for idempotent day-sealing with `DailySnapshot` entity; EF Core migration with unique index on `(UserId, Date)`; `UnitOfWork` unique constraint handler for concurrent seals; CancellationToken threaded through all layers after review; 28 tests
32+
- Line for tomorrow (`#1018`/`#1035`): `GET /api/today/tomorrow-note?date=` and `PUT /api/today/tomorrow-note` for autosave-friendly upsert; `TomorrowNote` entity (500 char max); 204 NoContent for missing notes; concurrent upsert race-condition handling via `UnitOfWork`; 25 tests
33+
- **Review deep-dive backends** (6 endpoints on `AutomationProposalsController`, required by PAPER-06 `#1002`):
34+
- Provenance rows (`#1019`/`#1039`): `GET /api/automation/proposals/{id}/provenance` returns `ProvenanceRowDto[]` with icon/key/value/weight; 26-entry icon map; weight bucketing from `ProvenanceField` confidence; FK migration added after review; `Math.Round` for confidence display; 41 tests
35+
- Side-effect analysis (`#1020`/`#1033`): `GET /api/automation/proposals/{id}/side-effects` returns 7-category breakdown (Cards/Subtasks/Comments/Activity/Notifications/Webhooks/Calendar) with active/passive tone and risk-based reversibility window (6h default, 3h for Critical); review fixed target-type checks and webhook-without-operations logic; 66 tests
36+
- Confidence breakdown (`#1021`/`#1036`): `GET /api/automation/proposals/{id}/confidence` returns 4-component weighted breakdown (Pattern match 0.30, Reach 0.20, Reversibility 0.35, Recency 0.15) with threshold and explanatory note; review fixed reach formula, promoted weights to static field, removed unused userId; 63 tests
37+
- Conflict detection (`#1022`/`#1040`): `GET /api/automation/proposals/{id}/conflicts` returns tone-classified rows (Warn/Info/Ok) from 7 detection rules; review fixed P1 false-warning for create-card ops, added `GetPendingByOperationTargetAsync` for proper duplicate detection, entity caching, safe JSON parsing; 46 tests
38+
- Card history ledger (`#1023`/`#1034`): `GET /api/automation/proposals/{id}/history` returns per-card touch history with serial/event/age/status; bounded at 200 entries/card and 500 total; review fixed duplicate dedup, JSON property parsing, GUID single-pass, `InvariantCulture` formatting; 42 tests
39+
- Similar past decisions (`#1024`/`#1038`): `GET /api/automation/proposals/{id}/similar-past` returns 3 nearest-neighbour prior decisions with apply rate; board-scoped query (review fixed userId filter that excluded non-caller proposals); 200-proposal lookback limit; UTC week formatting; 50 tests
40+
- New EF Core migrations: `AddDailySnapshots`, `AddTomorrowNotes`, `AddProvenanceEntities`, `AddProposalProvenanceForeignKey`, `ExtendProposalOutcomesForMetrics`
41+
- New repository methods: `IAuditLogRepository.CountByDateAsync`, `IAutomationProposalRepository.GetTerminalByActionTypeAsync`, `IAutomationProposalRepository.GetPendingByOperationTargetAsync`
42+
2643
Roadmap v4 second-wave delivery (2026-04-25, PRs `#989`--`#994` + `#995`):
2744
- RFAI-02 (`#974`/`#989`): `IntentEnvelopeV1` domain spine with `SourceBlock`/`SourceSpan`, `IntentCandidate`, `EvidenceLink`, `TaskdeckProposalBatch`, `IIntentEnvelopeFactory` application interface, `IChatClient` adapter spike, handwritten `proposal-batch.v1.schema.json`; 117 tests; adversarial review fixed partial-write status transition bug, span length consistency, evidence fabrication prevention, nullable schema fields
2845
- RFAI-06 (`#978`/`#990`): `IVectorIndex` and `IEmbeddingGenerator` application interfaces, `InMemoryVectorIndex` (cosine similarity + SIMD), `InMemoryEmbeddingGenerator` (FNV-1a hash), `EmbeddingBackfillService` with batch processing and stale vector pruning, `FallbackSemanticSearchService`, `EmbeddingBackfillWorker`; 61 tests; adversarial review fixed batch API usage, stale vector cleanup, unbounded memory growth

docs/TESTING_GUIDE.md

Lines changed: 135 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,32 @@
22

33
This is the active testing guide for Taskdeck.
44

5-
Last Updated: 2026-04-25
5+
Last Updated: 2026-04-26
66
Companion Active Docs:
77
- `docs/STATUS.md`
88
- `docs/IMPLEMENTATION_MASTERPLAN.md`
99
- `docs/TESTING_GUIDE.md`
1010
- `docs/MANUAL_TEST_CHECKLIST.md`
1111
- `docs/GOLDEN_PRINCIPLES.md`
1212

13-
## Current Verified Totals (2026-04-25)
13+
## Current Verified Totals (2026-04-26)
1414

15-
- Backend: **5,060 passing** (0 failing, 2 skipped; 5,062 total) -- verified 2026-04-25 via `dotnet test backend/Taskdeck.sln -c Release -m:1` on `main`
16-
- Domain: 962 passed
17-
- Application: 2,367 passed
15+
- Backend: **~5,520 passing** (estimated; 5,060 at last recertification + ~460 new tests from Paper backend gap wave PRs `#1031``#1040`)
16+
- Domain: ~1,120 passed (962 + ~158 new domain tests)
17+
- Application: ~2,670 passed (2,367 + ~302 new application tests)
1818
- API integration: 1,621 passed (0 failed, 2 skipped; 1,623 total)
1919
- CLI contract: 82 passed
2020
- Architecture boundaries: 8 passed
2121
- Integration (Testcontainers): 20 passed
2222
- Frontend unit: **2,805 passing** across 214+ test files -- verified 2026-04-25 via `npx vitest --run --reporter=verbose` on `main`
2323
- Frontend E2E (smoke + automation/ops + capture loop + starter-pack fixtures + concurrency harness + error recovery/multi-board/edge journeys + cross-browser matrix + onboarding/review/capture/keyboard/dark-mode + validation slices C/D/E + integrated verification): default required lane passing; +20 new scenarios in PRs `#821``#826`; +61 new validation/verification scenarios in PRs `#837``#840` + `#838`
24-
- Combined automated total: **7,865+ passing** (backend 5,060 + frontend unit 2,805 + E2E)
24+
- Combined automated total: **~8,325+ passing** (backend ~5,520 + frontend unit 2,805 + E2E)
2525

2626
Verification note:
27-
- backend total of 5,060 passing (0 failing, 2 skipped; 5,062 total) recertified 2026-04-25 via `dotnet test backend/Taskdeck.sln -c Release -m:1` on `main` (PR `#987`)
28-
- frontend total of 2,805 passing across 214+ test files recertified 2026-04-25 via `npx vitest --run --reporter=verbose` on `main` (PR `#987`)
29-
- 5 previously-failing Api.Tests (3 CorsApiTests, 1 McpTelemetryMiddlewareTests, 1 SecurityHeadersApiTests) now pass
30-
- prior recertification: backend 4,979 (2026-04-23), frontend 2,607 (2026-04-23) at commit `97d4856c`
31-
- growth since last recertification: backend +81 tests, frontend +198 tests
27+
- backend total of ~5,520 is estimated pending recertification after Paper backend gap PRs merge; ~460 new tests verified individually per PR via CI
28+
- Paper backend gap wave (2026-04-26, PRs `#1031``#1040`): ~460 new tests across 10 issues; each PR CI-verified independently
29+
- prior recertification: backend 5,060 (2026-04-25), frontend 2,805 (2026-04-25) at PR `#987`
30+
- growth since last recertification: backend +~460 tests (Paper backend gaps), frontend unchanged
3231

3332
## Roadmap v4 Verification Spine (Seeded 2026-04-25)
3433

@@ -57,6 +56,131 @@ Pop-Location
5756
if ($code -ne 0) { exit $code }
5857
```
5958

59+
## Paper Backend Gap Testing (2026-04-26, PRs `#1031``#1040`)
60+
61+
The Paper backend gap wave (PRs `#1031``#1040`) added ~460 new backend tests across 10 issues. Each PR received two rounds of adversarial review; the second round found and fixed issues including a P1 false-warning bug, a 100k entity memory risk, a board-scoping error, missing FK enforcement, and CancellationToken threading gaps.
62+
63+
### Cadence Aggregation Tests (`#1015`/`#1031`)
64+
65+
`backend/tests/Taskdeck.Domain.Tests/Entities/CadenceSnapshotTests.cs`, `backend/tests/Taskdeck.Application.Tests/Services/CadenceServiceTests.cs`**26 tests** covering:
66+
- CadenceBucket hour validation (0-23), event count non-negative, equality semantics
67+
- CadenceSnapshot: 24-bucket invariant, null guard, cached `Empty()` singleton, first/peak/last action computation
68+
- CadenceService: empty day, single event, full day aggregation, peak hour ties, midnight boundary, date normalization
69+
70+
Run:
71+
```bash
72+
dotnet test backend/Taskdeck.sln -c Release --filter "FullyQualifiedName~Cadence"
73+
```
74+
75+
### Streak Query Tests (`#1016`/`#1032`)
76+
77+
`backend/tests/Taskdeck.Domain.Tests/Entities/StreakDayTests.cs`, `StreakResultTests.cs`, `backend/tests/Taskdeck.Application.Tests/Services/StreakServiceTests.cs`**61 tests** covering:
78+
- StreakDay: intensity bucket validation (0-4), DateOnly handling, sealed flag
79+
- StreakResult: current/longest streak invariant (current cannot exceed longest), empty days
80+
- StreakService: empty history, single day, continuous streak, gap in streak, gap at end, intensity quartile bucketing, day count boundaries (1, 90, 365), server-side `CountByDateAsync` aggregate query
81+
82+
Run:
83+
```bash
84+
dotnet test backend/Taskdeck.sln -c Release --filter "FullyQualifiedName~Streak"
85+
```
86+
87+
### Seal Day Tests (`#1017`/`#1037`)
88+
89+
`backend/tests/Taskdeck.Domain.Tests/Entities/DailySnapshotTests.cs`, `backend/tests/Taskdeck.Application.Tests/Services/DailySealServiceTests.cs`**28 tests** covering:
90+
- DailySnapshot: construction, seal idempotency (second seal is no-op preserving original timestamp), future date rejection, IsSealed property, empty userId rejection
91+
- DailySealService: seal new day, seal existing unsealed, seal already-sealed (idempotent), validation errors, status checks for missing/sealed/unsealed snapshots, CancellationToken propagation
92+
- UnitOfWork: DailySnapshot unique constraint violation recovery (concurrent seal race condition)
93+
94+
Run:
95+
```bash
96+
dotnet test backend/Taskdeck.sln -c Release --filter "FullyQualifiedName~Seal or FullyQualifiedName~DailySnapshot"
97+
```
98+
99+
### Tomorrow Note Tests (`#1018`/`#1035`)
100+
101+
`backend/tests/Taskdeck.Domain.Tests/Entities/TomorrowNoteTests.cs`, `backend/tests/Taskdeck.Application.Tests/Services/TomorrowNoteServiceTests.cs`**25 tests** covering:
102+
- TomorrowNote: constructor validation, text max length (500 chars), date handling, UpdateText behavior and timestamp
103+
- TomorrowNoteService: get existing/missing note, save new/update existing (upsert), empty userId rejection, null text handling, max length boundary
104+
- UnitOfWork: TomorrowNote unique constraint violation recovery (concurrent upsert race condition)
105+
106+
Run:
107+
```bash
108+
dotnet test backend/Taskdeck.sln -c Release --filter "FullyQualifiedName~TomorrowNote"
109+
```
110+
111+
### Provenance Query Tests (`#1019`/`#1039`)
112+
113+
`backend/tests/Taskdeck.Application.Tests/Services/ProvenanceQueryServiceTests.cs`**41 tests** covering:
114+
- Icon map: 26-entry case-insensitive map with fallback default icon
115+
- Weight bucketing: extractive >= 0.7 confidence → "primary", < 0.7 → "contextual", inferred → "inferred"
116+
- Human-readable value strings with quote snippet truncation, `Math.Round` for confidence display
117+
- Empty provenance (returns empty list, not error), missing proposal, authorization
118+
- FK enforcement via `AddProposalProvenanceForeignKey` migration
119+
120+
Run:
121+
```bash
122+
dotnet test backend/Taskdeck.sln -c Release --filter "FullyQualifiedName~ProvenanceQuery"
123+
```
124+
125+
### Side-Effect Analysis Tests (`#1020`/`#1033`)
126+
127+
`backend/tests/Taskdeck.Domain.Tests/Entities/SideEffectTests.cs`, `backend/tests/Taskdeck.Application.Tests/Services/SideEffectAnalyzerTests.cs`**66 tests** covering:
128+
- SideEffectRow: value object creation, tone enum, equality/hash contract
129+
- Reversibility: default 6h window (21,600,000ms), summary/description
130+
- SideEffectAnalyzer: 7-category tone classification (Cards, Subtasks, Comments, Activity, Notifications, Webhooks, Calendar), target-type-aware card mutation detection, column mutation inclusion, webhook conditional on operations existing, risk-based reversibility (Critical → 3h)
131+
132+
Run:
133+
```bash
134+
dotnet test backend/Taskdeck.sln -c Release --filter "FullyQualifiedName~SideEffect"
135+
```
136+
137+
### Confidence Breakdown Tests (`#1021`/`#1036`)
138+
139+
`backend/tests/Taskdeck.Domain.Tests/Confidence/ConfidenceComponentTests.cs`, `ConfidenceBreakdownTests.cs`, `backend/tests/Taskdeck.Application.Tests/Services/Confidence/ConfidenceBreakdownServiceTests.cs`**63 tests** covering:
140+
- ConfidenceComponent: value range [0..1], NaN/Infinity rejection, key validation
141+
- ConfidenceBreakdown: overall/threshold range, MeetsThreshold computed property, defensive component list copy
142+
- ConfidenceBreakdownService: 4-component weighted computation (Pattern match, Reach, Reversibility, Recency), reach formula `2.0 / (2.0 + log2(n))`, risk-level reversibility scoring, recency from expiry window, threshold note generation, static weight map
143+
144+
Run:
145+
```bash
146+
dotnet test backend/Taskdeck.sln -c Release --filter "FullyQualifiedName~ConfidenceBreakdown"
147+
```
148+
149+
### Conflict Detection Tests (`#1022`/`#1040`)
150+
151+
`backend/tests/Taskdeck.Domain.Tests/Entities/ConflictRowTests.cs`, `backend/tests/Taskdeck.Application.Tests/Services/ProposalConflictDetectorTests.cs`**46 tests** covering:
152+
- ConflictRow: tone enum, value object creation, equality
153+
- ProposalConflictDetector: 7 detection rules — stale data (excludes create-card ops), missing target card, WIP limit, duplicate pending proposals (all pending, not just latest), high/critical risk, outbound webhooks, active comments, multi-op on same card, positive signals (column capacity, fresh data)
154+
- Entity caching (each card/column fetched at most once), safe JSON parsing with ValueKind checks, tone-sorted output (Warn → Info → Ok)
155+
156+
Run:
157+
```bash
158+
dotnet test backend/Taskdeck.sln -c Release --filter "FullyQualifiedName~ConflictRow or FullyQualifiedName~ConflictDetector"
159+
```
160+
161+
### Card History Tests (`#1023`/`#1034`)
162+
163+
`backend/tests/Taskdeck.Domain.Tests/Entities/CardHistoryRowTests.cs`, `backend/tests/Taskdeck.Application.Tests/Services/CardHistoryServiceTests.cs`**42 tests** covering:
164+
- CardHistoryRow: serial formatting, status enum, validation, equality
165+
- CardHistoryService: single/multi-card history, serial numbering, age formatting (same day, yesterday, this week, older) with `InvariantCulture`, status classification (pending/applied/past), proposal deduplication via `HashSet<Guid>`, bounded output (200/card, 500 total), proper JSON property parsing for update events
166+
167+
Run:
168+
```bash
169+
dotnet test backend/Taskdeck.sln -c Release --filter "FullyQualifiedName~CardHistory"
170+
```
171+
172+
### Similar Past Decisions Tests (`#1024`/`#1038`)
173+
174+
`backend/tests/Taskdeck.Domain.Tests/SimilarPast/SimilarPastDecisionTests.cs`, `SimilarPastResultTests.cs`, `backend/tests/Taskdeck.Application.Tests/Services/SimilarDecisionServiceTests.cs`**50 tests** covering:
175+
- SimilarPastDecision: value object validation, title truncation (200 chars), verdict enum
176+
- SimilarPastResult: apply rate computation, division-by-zero safety, negative input rejection
177+
- SimilarDecisionService: board-scoped action-class matching (review fixed userId filter), user-scoped fallback, top-3 limiting with full-population apply rate, self-exclusion, serial/date formatting (ISO week with 2-digit year), 200-proposal lookback limit, SARGable `OrderByDescending(DecidedAt)` ordering
178+
179+
Run:
180+
```bash
181+
dotnet test backend/Taskdeck.sln -c Release --filter "FullyQualifiedName~SimilarPast or FullyQualifiedName~SimilarDecision"
182+
```
183+
60184
## Roadmap v4 Second-Wave Testing (2026-04-25, PRs `#989``#994`)
61185

62186
The RFAI-02 through RFAI-08 foundational slice wave (PRs `#989``#994`) added ~631 new backend tests across 6 PRs. Each PR received adversarial review with review-added tests fixing bot findings from Gemini and Codex connector reviews.

0 commit comments

Comments
 (0)