feat(KB-503): merge kb/kb-503
- feat(KB-503): complete Step 5 other command project support - fix(KB-503): align task resolution with shared project context - fix(KB-503): preserve local task command fallback - test(KB-503): complete Step 4 task command coverage - test(KB-503): harden Step 3 CLI parser coverage - fix(KB-503): keep settings set scope explicit - fix(KB-503): allow implicit project resolution for project settings - fix(KB-503): enforce explicit settings scope rules - fix(KB-503): restore shared settings resolution behavior - fix(KB-503): align settings scope and project flag behavior - feat(KB-503): complete Step 5 — add project-aware settings, git, and backup behavior - fix(KB-503): enforce settings scope for global and project modes - fix(KB-503): preserve project-scoped settings and cwd-aware git helpers - fix(KB-503): add scoped settings behavior and git project tests - feat(KB-503): complete Step 5 — add project-aware git and backup coverage - test(KB-503): cover remaining project-aware task command paths - fix(KB-503): use shared resolution flow for all task commands - fix(KB-503): restore legacy task fallback and correct task mocks - fix(KB-503): align task resolution order and kb storage paths - fix(KB-503): restore local task store fallback without project flag - test(KB-503): cover remaining project-aware task handlers - fix(KB-503): preserve branch naming and avoid duplicate log resolution - test(KB-503): expand project-aware task command coverage - fix(KB-503): restore cwd fallback for path-based task commands - fix(KB-503): add project-aware task output and tests - fix(KB-503): harden project command output and coverage - fix(KB-503): preserve legacy task resolution without project flag - test(KB-503): add bin routing coverage for project flag parsing - feat(KB-503): complete Step 3 — CLI argument parsing updates - fix(KB-503): add defaultProjectId to GlobalSettings type and fix TypeScript errors - test(KB-503): fix resolveProject mock in task tests for runTaskLogs follow mode - docs(KB-503): add multi-project CLI documentation and changeset - test(KB-503): add project-context mock to task tests - test(KB-503): update git tests for new cwd parameter - feat(KB-503): Step 3 — CLI argument parsing updates with --project flag support - feat(KB-503): Steps 1-2 — project context utilities and project subcommands
This commit is contained in:
109
.fusion/tasks/FN-679/PROMPT.md
Normal file
109
.fusion/tasks/FN-679/PROMPT.md
Normal file
@@ -0,0 +1,109 @@
|
||||
# Task: FN-679 - Persist worktree init and recycle settings
|
||||
|
||||
**Created:** 2026-04-01
|
||||
**Size:** S
|
||||
|
||||
## Review Level: 2 (Plan and Code)
|
||||
|
||||
**Assessment:** This is a focused settings persistence regression with low-to-moderate blast radius. It touches core settings schema/plumbing and needs regression tests across core + CLI paths.
|
||||
**Score:** 5/8 — Blast radius: 2, Pattern novelty: 1, Security: 0, Reversibility: 2
|
||||
|
||||
## Mission
|
||||
|
||||
Fix the bug where `worktreeInitCommand` and `recycleWorktrees` are not reliably persisted and restored in project settings, ensuring these values survive update/read/restart flows and are correctly handled by CLI settings commands so worktree initialization and recycling behavior remains stable across runs.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- **None**
|
||||
|
||||
## Context to Read First
|
||||
|
||||
- `packages/core/src/types.ts`
|
||||
- `packages/core/src/store.ts`
|
||||
- `packages/core/src/store.test.ts`
|
||||
- `packages/cli/src/commands/settings.ts`
|
||||
- `packages/cli/src/commands/settings.test.ts`
|
||||
- `AGENTS.md` (settings + storage architecture sections)
|
||||
|
||||
## File Scope
|
||||
|
||||
- `packages/core/src/types.ts`
|
||||
- `packages/core/src/store.ts`
|
||||
- `packages/core/src/store.test.ts`
|
||||
- `packages/cli/src/commands/settings.ts`
|
||||
- `packages/cli/src/commands/settings.test.ts`
|
||||
|
||||
## Steps
|
||||
|
||||
### Step 0: Preflight
|
||||
|
||||
- [ ] Required files and paths exist
|
||||
- [ ] Dependencies satisfied
|
||||
|
||||
### Step 1: Fix core settings schema + persistence plumbing
|
||||
|
||||
- [ ] Verify both keys are correctly defined and project-scoped in core settings schema/defaults/allowlists (`ProjectSettings`, `DEFAULT_PROJECT_SETTINGS`, and project key lists used by store merge/filter paths)
|
||||
- [ ] Ensure `TaskStore.updateSettings()` and `TaskStore.getSettings()` preserve `worktreeInitCommand` and `recycleWorktrees` with no silent drops
|
||||
- [ ] Ensure values survive fresh re-initialization (new store instance reading persisted config/database state)
|
||||
- [ ] Add/adjust regression tests in `store.test.ts` covering update → read and restart persistence for both fields
|
||||
- [ ] Run targeted tests for changed files
|
||||
|
||||
**Artifacts:**
|
||||
- `packages/core/src/types.ts` (modified if needed)
|
||||
- `packages/core/src/store.ts` (modified)
|
||||
- `packages/core/src/store.test.ts` (modified)
|
||||
|
||||
### Step 2: Fix and validate CLI settings handling for both keys
|
||||
|
||||
- [ ] Ensure `settings set` accepts both keys via CLI validation/allowlist (`worktreeInitCommand`, `recycleWorktrees`)
|
||||
- [ ] Ensure value parsing is correct: `recycleWorktrees` parses boolean inputs (`true/false/yes/no/1/0`) and rejects invalid values; `worktreeInitCommand` preserves provided string value exactly
|
||||
- [ ] Add/adjust CLI tests asserting success-path update payloads and invalid-value rejection behavior for both keys
|
||||
- [ ] Run targeted tests for changed files
|
||||
|
||||
**Artifacts:**
|
||||
- `packages/cli/src/commands/settings.ts` (modified)
|
||||
- `packages/cli/src/commands/settings.test.ts` (modified)
|
||||
|
||||
### Step 3: Testing & Verification
|
||||
|
||||
> ZERO test failures allowed. Full test suite as quality gate.
|
||||
|
||||
- [ ] Run full test suite: `pnpm test`
|
||||
- [ ] Fix all failures
|
||||
- [ ] Build passes: `pnpm build`
|
||||
|
||||
### Step 4: Documentation & Delivery
|
||||
|
||||
- [ ] Confirm storage-path assumptions are consistent with this codebase (`.fusion/*` for project data in this repo) and avoid introducing `.kb/*` path assumptions in code/comments for this fix
|
||||
- [ ] Update relevant documentation
|
||||
- [ ] Out-of-scope findings created as new tasks via `task_create` tool
|
||||
|
||||
## Documentation Requirements
|
||||
|
||||
**Must Update:**
|
||||
- `AGENTS.md` — only if user-visible behavior/accepted values for `worktreeInitCommand` or `recycleWorktrees` changed
|
||||
|
||||
**Check If Affected:**
|
||||
- `README.md` — update settings examples if these keys/values are documented incorrectly or omitted in relevant sections
|
||||
|
||||
## Completion Criteria
|
||||
|
||||
- [ ] All steps complete
|
||||
- [ ] All tests passing
|
||||
- [ ] Documentation updated
|
||||
|
||||
## Git Commit Convention
|
||||
|
||||
Commits at step boundaries. All commits include the task ID:
|
||||
|
||||
- **Step completion:** `feat(FN-679): complete Step N — description`
|
||||
- **Bug fixes:** `fix(FN-679): description`
|
||||
- **Tests:** `test(FN-679): description`
|
||||
|
||||
## Do NOT
|
||||
|
||||
- Expand task scope
|
||||
- Skip tests
|
||||
- Modify files outside the File Scope without good reason
|
||||
- Implement settings behavior based on mixed storage roots; keep this task aligned with current repo conventions
|
||||
- Commit without the task ID prefix
|
||||
39
.fusion/tasks/FN-679/task.json
Normal file
39
.fusion/tasks/FN-679/task.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"id": "FN-679",
|
||||
"description": "Worktree init script and recycle worktree settings not being persisted",
|
||||
"column": "triage",
|
||||
"currentStep": 0,
|
||||
"createdAt": "2026-04-01T22:01:24.562Z",
|
||||
"updatedAt": "2026-04-01T22:06:19.516Z",
|
||||
"columnMovedAt": "2026-04-01T22:01:24.562Z",
|
||||
"dependencies": [],
|
||||
"steps": [],
|
||||
"log": [
|
||||
{
|
||||
"timestamp": "2026-04-01T22:01:24.562Z",
|
||||
"action": "Task created"
|
||||
},
|
||||
{
|
||||
"timestamp": "2026-04-01T22:05:04.827Z",
|
||||
"action": "Spec review requested"
|
||||
},
|
||||
{
|
||||
"timestamp": "2026-04-01T22:05:34.402Z",
|
||||
"action": "Spec review: REVISE",
|
||||
"outcome": "The spec has a clear mission and mostly concrete, testable outcomes, but it currently includes at least one likely incorrect file path in the migration/backward-compat docs and misses an explicit requirement to update the core settings key allowlists/type plumbing where this regression is most likely rooted. As written, implementation could “pass” step checks while still leaving one update path dropping `worktreeInitCommand`/`recycleWorktrees`. Tightening file scope and required verification poi"
|
||||
},
|
||||
{
|
||||
"timestamp": "2026-04-01T22:05:59.399Z",
|
||||
"action": "Spec review requested"
|
||||
},
|
||||
{
|
||||
"timestamp": "2026-04-01T22:06:15.556Z",
|
||||
"action": "Spec review: REVISE",
|
||||
"outcome": "The specification is strong on mission clarity and includes concrete outcomes for core and CLI behavior, but it contains a critical mismatch with the current codebase around storage path conventions and one scope inconsistency in documentation requirements. The referenced files and APIs are real (`TaskStore.updateSettings/getSettings`, CLI `VALID_SETTINGS`/`parseValue`) and the testing expectations are generally appropriate. However, as written, Step 4 would push the implementer toward a wrong s"
|
||||
},
|
||||
{
|
||||
"timestamp": "2026-04-01T22:06:19.514Z",
|
||||
"action": "Spec review not approved (verdict was REVISE) — specification not approved"
|
||||
}
|
||||
]
|
||||
}
|
||||
106
.fusion/tasks/FN-680/PROMPT.md
Normal file
106
.fusion/tasks/FN-680/PROMPT.md
Normal file
@@ -0,0 +1,106 @@
|
||||
# Task: FN-680 - Commands settings not being persisted and restored
|
||||
|
||||
**Created:** 2026-04-01
|
||||
**Size:** M
|
||||
|
||||
## Review Level: 2 (Plan and Code)
|
||||
|
||||
**Assessment:** This is a focused settings persistence bug but touches shared settings APIs and dashboard routes, so regressions could affect broader configuration behavior. The changes are reversible and low security risk.
|
||||
**Score:** 4/8 — Blast radius: 2, Pattern novelty: 1, Security: 0, Reversibility: 1
|
||||
|
||||
## Mission
|
||||
|
||||
Fix the regression where command-related project settings are not saved and reloaded correctly, ensuring users can configure command fields once and have them reliably persist across server restarts and settings reloads. This restores trust in the Settings UI and prevents runtime behavior from silently using stale/default command values.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- **None**
|
||||
|
||||
## Context to Read First
|
||||
|
||||
- `packages/core/src/types.ts` (ProjectSettings fields: `worktreeInitCommand`, `testCommand`, `buildCommand`, `scripts`, `setupScript` and `PROJECT_SETTINGS_KEYS`)
|
||||
- `packages/core/src/store.ts` (settings read/write and scope merge behavior)
|
||||
- `packages/dashboard/src/routes.ts` (`PUT /api/settings`, `GET /api/settings`, settings scope handling)
|
||||
- `packages/dashboard/src/routes.test.ts` (settings endpoint tests)
|
||||
- `packages/dashboard/src/scripts-routes.routes.test.ts` (scripts persistence behavior, for overlap/consistency)
|
||||
|
||||
## File Scope
|
||||
|
||||
- `packages/core/src/store.ts`
|
||||
- `packages/core/src/store.test.ts`
|
||||
- `packages/dashboard/src/routes.ts`
|
||||
- `packages/dashboard/src/routes.test.ts`
|
||||
- `README.md`
|
||||
|
||||
## Steps
|
||||
|
||||
### Step 0: Preflight
|
||||
|
||||
- [ ] Required files and paths exist
|
||||
- [ ] Dependencies satisfied
|
||||
|
||||
### Step 1: Reproduce and isolate command-settings persistence gap
|
||||
|
||||
- [ ] Add/adjust failing tests that demonstrate command settings (`worktreeInitCommand`, `testCommand`, `buildCommand`, and if applicable `setupScript`) are not persisted and/or restored correctly
|
||||
- [ ] Verify failure occurs through the real settings flow (`PUT /api/settings` → store persistence → `GET /api/settings`)
|
||||
- [ ] Confirm coverage includes reload/restore semantics (not only in-memory mutation)
|
||||
- [ ] Run targeted tests for changed files
|
||||
|
||||
**Artifacts:**
|
||||
- `packages/core/src/store.test.ts` (modified)
|
||||
- `packages/dashboard/src/routes.test.ts` (modified)
|
||||
|
||||
### Step 2: Implement persistence and restoration fix for command settings
|
||||
|
||||
- [ ] Update settings persistence/merge logic so command fields are written to project settings and restored from persisted config without being dropped
|
||||
- [ ] Ensure behavior is consistent with existing project-scope enforcement (global-only keys still rejected by `PUT /api/settings`)
|
||||
- [ ] Keep existing scripts routes behavior intact and compatible with fixed settings flow
|
||||
- [ ] Run targeted tests for changed files
|
||||
|
||||
**Artifacts:**
|
||||
- `packages/core/src/store.ts` (modified)
|
||||
- `packages/dashboard/src/routes.ts` (modified, only if needed)
|
||||
- `packages/core/src/store.test.ts` (modified)
|
||||
- `packages/dashboard/src/routes.test.ts` (modified)
|
||||
|
||||
### Step 3: Testing & Verification
|
||||
|
||||
> ZERO test failures allowed. Full test suite as quality gate.
|
||||
|
||||
- [ ] Run full test suite: `pnpm test`
|
||||
- [ ] Fix all failures
|
||||
- [ ] Build passes: `pnpm build`
|
||||
|
||||
### Step 4: Documentation & Delivery
|
||||
|
||||
- [ ] Update relevant documentation to explicitly list command-related project settings persistence behavior
|
||||
- [ ] Out-of-scope findings created as new tasks via `task_create` tool
|
||||
|
||||
## Documentation Requirements
|
||||
|
||||
**Must Update:**
|
||||
- `README.md` — clarify that project command settings (`worktreeInitCommand`, `testCommand`, `buildCommand`, and command scripts/setup script if applicable) are persisted in project config and restored on reload
|
||||
|
||||
**Check If Affected:**
|
||||
- `AGENTS.md` — update only if implementation changes expected settings behavior beyond a bug fix
|
||||
|
||||
## Completion Criteria
|
||||
|
||||
- [ ] All steps complete
|
||||
- [ ] All tests passing
|
||||
- [ ] Documentation updated
|
||||
|
||||
## Git Commit Convention
|
||||
|
||||
Commits at step boundaries. All commits include the task ID:
|
||||
|
||||
- **Step completion:** `feat(FN-680): complete Step N — description`
|
||||
- **Bug fixes:** `fix(FN-680): description`
|
||||
- **Tests:** `test(FN-680): description`
|
||||
|
||||
## Do NOT
|
||||
|
||||
- Expand task scope beyond command/settings persistence and restoration
|
||||
- Skip tests
|
||||
- Modify files outside the File Scope without good reason
|
||||
- Commit without the task ID prefix
|
||||
22
.fusion/tasks/FN-680/task.json
Normal file
22
.fusion/tasks/FN-680/task.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"id": "FN-680",
|
||||
"description": "Commands settings not being persisted and restored",
|
||||
"column": "triage",
|
||||
"status": "specifying",
|
||||
"currentStep": 0,
|
||||
"createdAt": "2026-04-01T22:01:55.348Z",
|
||||
"updatedAt": "2026-04-01T22:06:04.879Z",
|
||||
"columnMovedAt": "2026-04-01T22:01:55.348Z",
|
||||
"dependencies": [],
|
||||
"steps": [],
|
||||
"log": [
|
||||
{
|
||||
"timestamp": "2026-04-01T22:01:55.348Z",
|
||||
"action": "Task created"
|
||||
},
|
||||
{
|
||||
"timestamp": "2026-04-01T22:06:04.879Z",
|
||||
"action": "Spec review requested"
|
||||
}
|
||||
]
|
||||
}
|
||||
18
.fusion/tasks/FN-681/task.json
Normal file
18
.fusion/tasks/FN-681/task.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"id": "FN-681",
|
||||
"description": "Pi Claude cli models (an extension) are not showing up",
|
||||
"column": "triage",
|
||||
"status": "specifying",
|
||||
"currentStep": 0,
|
||||
"createdAt": "2026-04-01T22:02:25.701Z",
|
||||
"updatedAt": "2026-04-01T22:06:16.415Z",
|
||||
"columnMovedAt": "2026-04-01T22:02:25.701Z",
|
||||
"dependencies": [],
|
||||
"steps": [],
|
||||
"log": [
|
||||
{
|
||||
"timestamp": "2026-04-01T22:02:25.701Z",
|
||||
"action": "Task created"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user