3.6 KiB
3.6 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-enforce-task-links | Migrate and enforce task URL construction | done | 2 |
|
plan.md |
|
|
|
Task 02: Migrate and enforce task URL construction
Summary
Make the default lint command reject recurring URL and anchor bypasses, with zero current violations.
In scope
- Add the bounded AST rule and actual-config wiring test described in the design.
- Inventory and migrate every production task-detail builder; classify route-recognition constants separately.
- Keep existing compliant Link/router consumers; migrate raw task anchors to TaskLink.
- Update apps/web/AGENTS.md with URL and anchor ownership. No new ADR is needed: this applies existing authorities, with alternatives documented in the design.
Out of scope
Backend behavior and unrelated navigation redesign.
Acceptance
- RED: rule fixtures reject original DependencyRow, raw anchors using aliased helper calls, and hand-built URLs; valid API/Office/matcher cases pass.
- Final production lint has no task-link violations or migration baseline; real config catches a new component in an arbitrary directory.
- Migrated caller tests preserve context and selection side effects; new workbench destinations use canonical URLs.
Verification
Run from repository root. Install once with (cd apps && pnpm install --frozen-lockfile) if this worktree lacks dependencies.
(cd apps/web && pnpm exec vitest run eslint-rules/no-task-link-bypass.test.ts scripts/lib/task-link-wiring.test.ts lib/links.test.ts)
(cd apps/web && pnpm exec vitest related --run $(cat /tmp/kandev-task-link-changed-sources.txt))
(cd apps/web && pnpm run typecheck)
(cd apps/web && pnpm run lint)
git diff --check
Files likely touched
apps/web/eslint-rules/no-task-link-bypass.mjs (new)apps/web/eslint-rules/no-task-link-bypass.test.ts (new)apps/web/scripts/lib/task-link-wiring.test.ts (new)apps/web/eslint.config.mjsapps/web/AGENTS.mdFirst-party callers listed in migration-inventory.md and their tests
Dependencies
01-shared-task-links.
Risks
Preserve existing route guards, query context, and browser-native alternate-tab behavior.
Parallelism
sequential
Inputs
- Requirements
- System design
- Existing AppLink, linkToTask, local ESLint rules, and task dependency tests.
Results
Completed on 2026-09-21.
- The bounded
task-links/no-task-link-bypassrule and real-config wiring test passed, with 31 tests in the initial focused rule and link suite. - All known first-party task-detail builders and raw task anchors were migrated; the production rule scan found zero violations.
- Review follow-up now checks quoted and expression literal task URLs on custom
LinkandAppLinkelements while preserving shared-builder cases. Static evaluation uses branch-local recursion guards, so prefix aliases combined with dynamic task IDs are detected in anchors andlocation.assigncalls. - The broad related Vitest run before review follow-up passed 437 files and 4,254 tests.
- Review follow-up coverage passed 3 files and 38 rule/link tests; the combined rule, AppLink, wiring, and link suite passed 4 files and 48 tests.
pnpm run typecheck,pnpm run lint, Prettier checks, andgit diff --checkpassed.