Conversation
Replace ten duplicated per-file repository stubs with one behavioral stub in src/test-support. The shared stub seeds an in-memory Map via the initialProject option and accepts per-method overrides; base methods are vi.fn()-wrapped so tests can still reconfigure them with vi.mocked(repository.x).mockResolvedValue(...). No production code touched; -275 lines of test helper duplication removed.
TaskForm and TaskList hard-coded STATUS_OPTIONS, duplicating the domain's ALL_TASK_STATUSES. Both now render options from the domain constant and resolve select changes with a typed find() instead of 'as TaskStatus' casts. DependencyGraph's STATUS_COLORS is now keyed by TaskStatus (no Record<string,string> fallback) and node fill uses a typed lookup. Added tests asserting every domain status appears in the TaskForm and TaskList dropdowns.
…g entries serializeTask now copies and freezes the task dependencies array so a caller mutating their own array cannot alias into an earlier serialized output. deserializeTask no longer silently filters non-string dependency entries: an array containing one is rejected with a descriptive error, matching the deterministic-rejection stance of the schema validator. ADR-010 documents the chosen semantics. Adds tests for alias-freedom, rejection of non-string entries, and acceptance of valid string entries.
#21 review) - newlyCriticalTaskIds now computed from per-task slack transitions (baseline slack > 0 to projected slack 0) instead of projected-critical-path membership difference, matching ADR-009's documented definition and decoupling the metric from how the scheduler's criticalPath set is represented - add regression test for two parallel paths where both become zero-slack, asserting every newly-critical task is reported across both paths - benchmark failure test now exercises the harness's writeReport emission path (bad file path parameter) instead of calling writeResultsFile directly - document on ProjectRepository.save that id uniqueness is enforced by the application layer (check-then-save in createProject), not atomically by the repository - ADR-009 wording updated to the slack-transition definition; handoff/progress updated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements TASK-018 through TASK-026 — the full-branch code-review remediation backlog recorded in
docs/tasks.md. All nine tasks address review findings across domain immutability, application-layer deduplication, UI maintainability, persistence hardening, the benchmark-report contract, simulator deltas, and documentation accuracy. No behavior changes beyond the documented fixes.Changes
TASK-018 — Fix recommendation deep-freeze gap
affectedTaskIdsarrays on thetie-break-appliedandblocked-status-eligiblewarnings, honoring the ADR-008 immutability contractObject.isFrozenon the nested arrays and elementsTASK-019 — Extract shared task-to-input mapper
Task → CreateTaskInputmapper fromtask-service.ts,goal-service.ts, anddependency-service.tssrc/application/task-input.ts(including thegoalId: null → undefinedbridge)TASK-020 — Extract shared test helpers
createStubRepositoryimplementations (pluscreateInMemoryStorage) intosrc/test-support/index.tsinitialProjectand supports per-methodoverridesTASK-021 — UI status options from domain constant
TaskForm/TaskListdropdowns now render from the domain'sALL_TASK_STATUSESSTATUS_COLORSin the dependency graph is keyed byTaskStatus(no typo-masking fallback)as TaskStatuscasts replaced with a type-safefind()TASK-022 — Persistence validation and freeze hardening
dependenciesso serialized output does not alias mutable inputTASK-023 — Guard against project id collisions
ProjectService.createProjectrejects an existing id (Project already exists: {id}), covering thesample-projectseed pathTASK-024 — Benchmark report emission as a hard contract
npm run benchmarknow fails if it cannot writebenchmark/results.txt, matching the CIif-no-files-found: errorartifact contractTASK-025 — Simulator blocked-task and risk deltas
SimulationResultnow exposesblockedTaskCountper side,blockedTaskDelta, andnewlyCriticalTaskIds(slack exhausted → becomes critical) as the deterministic risk indicatorTASK-026 — Documentation cleanup
docs/task-006-review.md(superseded banner, no live references)isReachable(t, t)self-reachability note to the case study.next/entry from.gitignoreAdditional (not in the task list)
Verification
npm run verifypasses (typecheck, 304 tests, lint, format:check)npm run buildsucceedsnpm run benchmarkpasses (7 tests,benchmark/results.txtwritten)npm run test:e2epasses (2 Playwright specs)Docs
docs/tasks.md— TASK-018 through TASK-026 marked DONEdocs/decisions.md— ADR-009 (blocked-task/risk deltas), ADR-010 (dependency-entry validation)docs/handoff.md— current task and verification updateddocs/progress.md— remediation-completed entry appended