Complete TASK-019 conditional previous-session availability

This commit is contained in:
rob
2026-11-11 13:29:56 +00:00
parent 6ea3f7b008
commit be0ff2b2e4
12 changed files with 374 additions and 24 deletions
+15 -3
View File
@@ -4,7 +4,7 @@ This file holds accepted, scoped implementation work. It is not a speculative ba
## Proposed implementation sequence
Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001–003, TASK-012–018 and TASK-020 are Complete. TASK-006 is Superseded; TASK-005 and TASK-008 are Accepted. TASK-019 requires rebuilding because its original uncommitted source is missing; it is not implementation-ready. Remaining tasks are Proposed. Completed application work is integrated in local codex, including reconstructed TASK-018 compact inputs within TASK-016. Implement one task per isolated branch/worktree under `docs/WORKFLOW.md`. Preserve the authoritative programme and historical storage semantics.
Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001–003, TASK-012–018 and TASK-020 are Complete. TASK-006 is Superseded; TASK-005 and TASK-008 are Accepted. TASK-019 is Complete following Captain acceptance on 2026-11-11; its persistent reconstruction is integrated, while the original `/tmp` source remains missing. Remaining tasks are Proposed. Completed application work is integrated in local codex, including reconstructed TASK-018 compact inputs within TASK-016. Implement one task per isolated branch/worktree under `docs/WORKFLOW.md`. Preserve the authoritative programme and historical storage semantics.
### TASK-001: Application foundation and responsive shell
@@ -297,14 +297,14 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001–003, TA
### TASK-019: Hide previous-session action when no applicable data exists
- Status: Accepted / requires rebuild — prior implementation-ready candidate in `/tmp/exercise-tracker-task-019` is missing. Its branch contains no candidate commit. TASK-019 is not included in `0cf0515` or the TASK-020 completion; prior validation records below are historical evidence only.
- Status: Complete — Captain explicitly accepted TASK-019 and authorized commit/local codex merge on 2026-11-11. Source: persistent `.task-worktrees/task-019`, branch `task/019-previous-availability-rebuild`, base `6ea3f7b`. New reconstruction, not recovery of the missing `/tmp` source.
- Requested: 2026-11-08.
- Objective: Show “Use previous session” only when there is compatible previous-session data that can be applied.
- Scope: Conditional visibility in regular set/hold/hang and EMOM performance editors, including preserved detailed historical editors where the action exists. Resolve availability using the existing previous-performance compatibility rules: same exercise, period and format, compatible saved definition, earlier actual date and completed source rows. Empty, draft-only, incompatible, current-date or future records do not qualify. Preserve aggregate/minute separation and explicit user-triggered application.
- Acceptance criteria: The action is absent when no qualifying source exists, including a fresh database; visible when qualifying data exists. Keep it absent while availability is unknown or lookup fails; surface lookup failure with a retry path. Re-evaluate on date, period, exercise or saved-definition/format changes without stale results or button flashes. Checking availability writes nothing and never applies data automatically. Preserve current-entry protection, zero values, partial drafts, suggestions requiring review/Save, saved data and historical isolation. Existing populated-entry behavior is otherwise unchanged; this task does not broaden when suggestions may overwrite current work.
- Relevant areas: `src/DetailedPerformanceEditor.jsx`, `src/EmomTotalEditor.jsx`, `src/performanceStorage.js` and corresponding UI/storage tests.
- Required validation: Fresh/empty store, compatible completed source, zero-valued source, draft-only and incompatible sources, current/future exclusion, date/period/exercise changes, stale async responses, storage failure/retry, and existing-entry preservation. Run full tests, lint, build, context validation and `git diff --check`; review against confirmed integration base. Captain manual verification of hidden/visible states and keyboard access through testtask 019 is required before Complete. Captain alone runs testtask.
- Dependencies: Existing `previousPerformance` rules and ADR-019/020/021 govern compatibility and history. TASK-018 is Complete but uncommitted in its own worktree. TASK-019 starts from confirmed codex `922d1f6` with accepted TASK-018 CSS copied as a prerequisite. TASK-016 contains a copy of the TASK-019 candidate for the shared Captain test pass.
- Dependencies: Existing `previousPerformance` rules and ADR-019/020/021 govern compatibility and history. Rebuild starts from codex `6ea3f7b`, which already includes accepted TASK-016 dark theme, reconstructed TASK-018 compact inputs and TASK-020 launcher. This is an independent TASK-019 candidate, not the former combined UI snapshot.
- Non-goals: Automatically applying suggestions, changing compatibility or history semantics, overwriting current entries, new history screens, layout redesign, storage migrations or unrelated refactoring.
- TASK-018 completion evidence (2026-11-08): Captain explicitly stated “task-018 complete”, satisfying the Captain acceptance gate. Agent checks passed 143 tests, lint, build, context validation and whitespace review. No independent agent browser pass is claimed. Implementation remains uncommitted on `task/018-compact-inputs` in `/tmp/exercise-tracker-task-018`; commit and integration require separate Captain instruction.
@@ -358,3 +358,15 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001–003, TA
- Preserved the dedicated worktree's duplicate tooling and older context in a named safety stash, then fast-forwarded `task/020-testtask-repair` to codex before recording completion. This avoids reintroducing stale task state. The completion commit contains context changes only.
- Revalidated 10 stub-runner routing/runtime tests, no-launch preflight for 016/020, shell syntax, context validation and whitespace review. No runner/browser/session launched or stopped. Previous TASK-016 interaction/lint/build evidence remains unchanged.
- Audit: all task branch commits are ancestors of local codex. All completed available application/tooling work is integrated, including reconstructed TASK-018 compact-input requirements. TASK-019 is not Complete and its missing source is not merged/recovered. Prior `/tmp` registrations and safety stashes remain preserved; no push/deploy or destructive cleanup authorized.
#### TASK-019 reconstruction — 2026-11-11
- Captain requested finishing TASK-019. Rebuilt from clean codex `6ea3f7b` in `.task-worktrees/task-019` on `task/019-previous-availability-rebuild`; prior missing implementation is not recovered or reused.
- A shared cancellable/keyed read uses existing `previousPerformance` compatibility rules to show the action only when compatible earlier completed history exists. Regular reps/holds/hangs, EMOM totals and original historical-minute editors are covered. Unknown/empty/failed availability stays hidden. Saved definition and format drive compatibility; parent context must finish loading before lookup. Context keys prevent old-context button flashes and stale async responses.
- Separate failure message and lookup-only retry preserve current inputs and do not reload or write the entry. Applying suggestions remains explicit and retains the existing current-entry protection and Save/completion semantics. No storage/schema, compatibility-policy, programme, theme/layout or dependency changes.
- Fresh validation: 180/180 tests across 15 files with `npm test -- --maxWorkers=1`, lint/build, no-launch home `--check 019`, context validation (0 warnings), whitespace and diff review against `6ea3f7b` pass. Added real IndexedDB eligibility/read-only/preservation cases plus delayed-response/race/retry tests; existing suggestion tests wait for asynchronous availability. New test count supersedes historical missing-candidate evidence.
- Captain runs `./scripts/testtask.sh 019` from project home. Verify a fresh database hides the action, compatible regular/EMOM history shows it on a later date in the same period, click-only unsaved suggestions, current-entry protection, draft-only exclusion, date/period changes and keyboard access. No runner/browser/server or manual snapshot launched by the agent. Captain acceptance required before Complete. No commit/merge/push/deploy authorized for this reconstruction.
- TASK-019 completion (2026-11-11): Captain explicitly stated “task-019 complete. commit and merge”, satisfying the acceptance gate and authorizing commit/local codex integration of the validated persistent reconstruction. Existing 180/180 tests across 15 files with one worker, lint/build, source preflight and base diff review remain valid; completion changes only context. No independent agent browser review claimed. All completed available task work is integrated after this merge. Home's duplicate pre-acceptance context is saved in a safety stash rather than overwritten. No push/deploy, worktree/branch/stash removal, registration pruning or Captain-session cleanup authorized.