From 8063321ff6e04d4059c1fef782b0d46ba2a0249e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 30 May 2026 11:10:25 +0000 Subject: [PATCH 1/2] fix(evolution): align skills root resolution Co-authored-by: EXboy --- crates/skilllite-commands/src/evolution.rs | 36 +++++++++- .../CONTEXT.md | 37 ++++++++++ .../PRD.md | 41 +++++++++++ .../REVIEW.md | 29 ++++++++ .../STATUS.md | 17 +++++ .../TASK.md | 70 +++++++++++++++++++ tasks/board.md | 4 +- 7 files changed, 230 insertions(+), 4 deletions(-) create mode 100644 tasks/TASK-2026-067-evolution-skills-root-alignment/CONTEXT.md create mode 100644 tasks/TASK-2026-067-evolution-skills-root-alignment/PRD.md create mode 100644 tasks/TASK-2026-067-evolution-skills-root-alignment/REVIEW.md create mode 100644 tasks/TASK-2026-067-evolution-skills-root-alignment/STATUS.md create mode 100644 tasks/TASK-2026-067-evolution-skills-root-alignment/TASK.md diff --git a/crates/skilllite-commands/src/evolution.rs b/crates/skilllite-commands/src/evolution.rs index d68dd95d..1443dbbb 100644 --- a/crates/skilllite-commands/src/evolution.rs +++ b/crates/skilllite-commands/src/evolution.rs @@ -31,7 +31,7 @@ use skilllite_core::protocol::{NewSkill, NodeResult}; use skilllite_core::skill::manifest; /// Resolve workspace for project-level skill evolution. -/// Uses SKILLLITE_WORKSPACE env or current_dir. Returns workspace/.skills. +/// Uses SKILLLITE_WORKSPACE env or current_dir. Returns the effective workspace skills root. fn resolve_skills_root(workspace: Option<&str>) -> Option { let ws: PathBuf = workspace .filter(|s| !s.is_empty()) @@ -47,7 +47,12 @@ fn resolve_skills_root(workspace: Option<&str>) -> Option { } else { std::env::current_dir().ok()?.join(ws) }; - Some(ws.join(".skills")) + let resolution = + skilllite_core::skill::discovery::resolve_skills_dir_with_legacy_fallback(&ws, "skills"); + if let Some(warning) = resolution.conflict_warning() { + eprintln!("{}", warning); + } + Some(resolution.effective_path) } #[derive(Debug)] @@ -1030,6 +1035,33 @@ mod tests { assert!(normalize_risk_filter(Some("urgent")).is_err()); } + #[test] + fn resolve_skills_root_prefers_default_skills_dir() { + let root = + std::env::temp_dir().join(format!("skilllite-evo-root-test-{}", uuid::Uuid::new_v4())); + std::fs::create_dir_all(root.join("skills")).expect("create skills dir"); + std::fs::create_dir_all(root.join(".skills")).expect("create legacy skills dir"); + + let resolved = + resolve_skills_root(Some(root.to_str().expect("temp path utf8"))).expect("resolve"); + + assert_eq!(resolved, root.join("skills")); + let _ = std::fs::remove_dir_all(&root); + } + + #[test] + fn resolve_skills_root_falls_back_to_legacy_skills_dir() { + let root = + std::env::temp_dir().join(format!("skilllite-evo-root-test-{}", uuid::Uuid::new_v4())); + std::fs::create_dir_all(root.join(".skills")).expect("create legacy skills dir"); + + let resolved = + resolve_skills_root(Some(root.to_str().expect("temp path utf8"))).expect("resolve"); + + assert_eq!(resolved, root.join(".skills")); + let _ = std::fs::remove_dir_all(&root); + } + #[test] fn query_backlog_rows_applies_filters() { let root = diff --git a/tasks/TASK-2026-067-evolution-skills-root-alignment/CONTEXT.md b/tasks/TASK-2026-067-evolution-skills-root-alignment/CONTEXT.md new file mode 100644 index 00000000..daedc437 --- /dev/null +++ b/tasks/TASK-2026-067-evolution-skills-root-alignment/CONTEXT.md @@ -0,0 +1,37 @@ +# Technical Context + +## Current State + +- Relevant crates/files: + - `crates/skilllite-commands/src/evolution.rs` + - `crates/skilllite-commands/src/evolution_desktop.rs` + - `crates/skilllite-commands/src/evolution_status.rs` + - `crates/skilllite-core/src/skill/discovery.rs` +- Current behavior: + - Desktop pending/status/confirm paths use `resolve_skills_dir_with_legacy_fallback(workspace, "skills")`. + - `evolution run` and repair helper resolution return `workspace/.skills` directly. + +## Architecture Fit + +- Layer boundaries involved: + - `skilllite-commands` should call shared `skilllite-core` discovery helpers rather than duplicating root policy. +- Interfaces to preserve: + - Existing CLI flags, JSON payloads, and legacy `.skills` fallback semantics. + +## Dependency and Compatibility + +- New dependencies: None. +- Backward compatibility notes: + - `.skills` remains the effective root when `skills/` is absent. + - Workspaces with both roots follow the established default of preferring `skills/`. + +## Design Decisions + +- Decision: Reuse `skilllite_core::skill::discovery::resolve_skills_dir_with_legacy_fallback` for evolution skill root resolution. + - Rationale: It is already the shared policy for skill command and desktop evolution read paths. + - Alternatives considered: Change desktop pending/status/confirm back to `.skills`. + - Why rejected: That would diverge from current `skilllite init` default behavior and other command helpers. + +## Open Questions + +- [x] Is a docs update required? No user-facing command or documented default changes; the fix restores the current documented `skills/` default with `.skills` compatibility. diff --git a/tasks/TASK-2026-067-evolution-skills-root-alignment/PRD.md b/tasks/TASK-2026-067-evolution-skills-root-alignment/PRD.md new file mode 100644 index 00000000..7a174028 --- /dev/null +++ b/tasks/TASK-2026-067-evolution-skills-root-alignment/PRD.md @@ -0,0 +1,41 @@ +# PRD + +## Background + +The desktop L2 JSON migration moved pending skill reads and confirmations through CLI helpers that +resolve the effective skills directory as `skills/` with fallback to `.skills`. The evolution run +command still resolves the skill generation root as `.skills` directly. This splits generated pending +skills from the UI path in current default workspaces. + +## Objective + +Ensure all evolution skill write/read paths use one effective workspace skills root. Default +workspaces should use `skills/`, while legacy `.skills`-only workspaces should continue to work. + +## Functional Requirements + +- FR-1: Resolve evolution skill roots through the shared `resolve_skills_dir_with_legacy_fallback` behavior. +- FR-2: Preserve `.skills` fallback when `skills/` is absent. +- FR-3: Keep existing CLI arguments and JSON output shapes unchanged. + +## Non-Functional Requirements + +- Security: Do not widen path access beyond the current workspace skills directory resolution. +- Performance: Root resolution should remain local filesystem checks only. +- Compatibility: Existing `.skills`-only workspaces must remain supported. + +## Constraints + +- Technical: Keep the fix localized to command-layer root selection and tests. +- Timeline: N/A for autonomous execution. + +## Success Metrics + +- Metric: Pending skills generated by evolution are visible to the existing pending/status/confirm path. +- Baseline: `evolution run` writes to `.skills` even when default `skills/` exists. +- Target: `evolution run` uses `skills/` when present and `.skills` only as legacy fallback. + +## Rollout + +- Rollout plan: Ship as a minimal Rust command-layer fix with regression tests. +- Rollback plan: Revert the command-layer resolver change if unexpected compatibility issues appear. diff --git a/tasks/TASK-2026-067-evolution-skills-root-alignment/REVIEW.md b/tasks/TASK-2026-067-evolution-skills-root-alignment/REVIEW.md new file mode 100644 index 00000000..e5fd29ef --- /dev/null +++ b/tasks/TASK-2026-067-evolution-skills-root-alignment/REVIEW.md @@ -0,0 +1,29 @@ +# Review Report + +## Scope Reviewed + +- Files/modules: +- Commits/changes: + +## Findings + +- Critical: +- Major: +- Minor: + +## Quality Gates + +- Architecture boundary checks: `pass | fail` +- Security invariants: `pass | fail` +- Required tests executed: `pass | fail` +- Docs sync (EN/ZH): `pass | fail` + +## Test Evidence + +- Commands run: +- Key outputs: + +## Decision + +- Merge readiness: `ready | not ready` +- Follow-up actions: diff --git a/tasks/TASK-2026-067-evolution-skills-root-alignment/STATUS.md b/tasks/TASK-2026-067-evolution-skills-root-alignment/STATUS.md new file mode 100644 index 00000000..688bff89 --- /dev/null +++ b/tasks/TASK-2026-067-evolution-skills-root-alignment/STATUS.md @@ -0,0 +1,17 @@ +# Status Journal + +## Timeline + +- 2026-05-30: + - Progress: Investigated recent desktop L2 evolution changes, confirmed a skills-root split between write and read paths, and implemented resolver alignment with regression tests. + - Blockers: None. + - Next step: Run required validation commands. + +## Checkpoints + +- [x] PRD drafted before implementation (or `N/A` recorded) +- [x] Context drafted before implementation (or `N/A` recorded) +- [x] Implementation complete +- [ ] Tests passed +- [ ] Review complete +- [ ] Board updated diff --git a/tasks/TASK-2026-067-evolution-skills-root-alignment/TASK.md b/tasks/TASK-2026-067-evolution-skills-root-alignment/TASK.md new file mode 100644 index 00000000..7f82c10f --- /dev/null +++ b/tasks/TASK-2026-067-evolution-skills-root-alignment/TASK.md @@ -0,0 +1,70 @@ +# TASK Card + +## Metadata + +- Task ID: `TASK-2026-067` +- Title: Align evolution skills root +- Status: `in_progress` +- Priority: `P1` +- Owner: `agent` +- Contributors: +- Created: `2026-05-30` +- Target milestone: + +## Problem + +Recent desktop evolution paths list, count, confirm, and reject pending skills through the current +default `skills/` directory with legacy fallback to `.skills/`. The `evolution run` path still writes +generated pending skills to `.skills` unconditionally, so default `skilllite init` workspaces that use +`skills/` can generate pending skills that the desktop cannot see or confirm. + +## Scope + +- In scope: + - Align `evolution run` and related evolution skill operations with the shared `skills/` default plus `.skills` legacy fallback. + - Add focused regression tests for default and legacy root resolution. + - Validate Rust formatting, linting, tests, and task artifact shape. +- Out of scope: + - Broad redesign of skill identity, duplicate skill handling, or desktop error presentation. + - Changing LLM evolution policy, backlog schema, or sandbox behavior. + +## Acceptance Criteria + +- [ ] `evolution run` resolves the same effective skills root as desktop pending/status/confirm for default workspaces. +- [ ] Existing `.skills`-only workspaces remain supported. +- [ ] Regression tests cover default `skills/` and legacy `.skills` behavior. +- [ ] Required validation commands pass or any blocker is recorded with output. + +## Risks + +- Risk: Changing the write target may affect users with both `skills/` and `.skills/`. + - Impact: New evolved skills follow `skills/`, while older pending skills in `.skills` remain in the legacy tree. + - Mitigation: Match the already-shipped shared fallback behavior: prefer `skills/` when present and fall back only when it is absent. + +## Validation Plan + +- Required tests: + - Regression tests in `crates/skilllite-commands/src/evolution.rs`. + - Workspace Rust tests required by policy. +- Commands to run: + - `cargo fmt --check` + - `cargo clippy --all-targets -- -D warnings` + - `cargo test` + - `cargo test -p skilllite` + - `python3 scripts/validate_tasks.py` +- Manual checks: + - Re-read modified files and task board after updates. + +## Regression Scope + +- Areas likely affected: + - CLI evolution skill generation, pending/confirm/reject, and repair skill root selection. + - Desktop evolution UI visibility of generated pending skills. +- Explicit non-goals: + - No change to chat skill loading, skill import, or assistant frontend components. + +## Links + +- Source TODO section: N/A +- Related PRs/issues: Recent `feat/runtime-skills-l2-json` and UTF-8 logging follow-up. +- Related docs: `spec/docs-sync.md` reviewed; no docs change needed because the fix restores documented/current default behavior. diff --git a/tasks/board.md b/tasks/board.md index 43428f7b..48b8a497 100644 --- a/tasks/board.md +++ b/tasks/board.md @@ -1,10 +1,10 @@ # Task Board -Last updated: 2026-05-29 (TASK-2026-066 utf8 evolution log truncate done) +Last updated: 2026-05-30 (TASK-2026-067 evolution skills root alignment in progress) ## In Progress -- None. +- `TASK-2026-067-evolution-skills-root-alignment` - Status: `in_progress` - Owner: `agent` ## Ready From 687487f5dca1ca84e7b6a0f3921b0e0fd171661d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 30 May 2026 11:14:50 +0000 Subject: [PATCH 2/2] docs(task): record evolution root fix validation Co-authored-by: EXboy --- .../REVIEW.md | 36 ++++++++++++++----- .../STATUS.md | 12 ++++--- .../TASK.md | 20 +++++------ tasks/board.md | 5 +-- 4 files changed, 48 insertions(+), 25 deletions(-) diff --git a/tasks/TASK-2026-067-evolution-skills-root-alignment/REVIEW.md b/tasks/TASK-2026-067-evolution-skills-root-alignment/REVIEW.md index e5fd29ef..f4f1f63b 100644 --- a/tasks/TASK-2026-067-evolution-skills-root-alignment/REVIEW.md +++ b/tasks/TASK-2026-067-evolution-skills-root-alignment/REVIEW.md @@ -3,27 +3,45 @@ ## Scope Reviewed - Files/modules: + - `crates/skilllite-commands/src/evolution.rs` + - `crates/skilllite-commands/src/evolution_desktop.rs` + - `crates/skilllite-commands/src/evolution_status.rs` + - `crates/skilllite-core/src/skill/discovery.rs` - Commits/changes: + - Recent desktop L2 JSON bridge changes around evolution pending/status/confirm. + - This fix aligns the evolution write-side root resolver with the existing read-side resolver. ## Findings -- Critical: -- Major: -- Minor: +- Critical: None remaining in the patched path. +- Major: Fixed root split where `evolution run` wrote pending skills to `.skills` while desktop pending/status/confirm read `skills/` in default workspaces. +- Minor: Other investigated desktop bridge issues were left out of scope because they did not meet the critical bug bar for this run. ## Quality Gates -- Architecture boundary checks: `pass | fail` -- Security invariants: `pass | fail` -- Required tests executed: `pass | fail` -- Docs sync (EN/ZH): `pass | fail` +- Architecture boundary checks: `pass` +- Security invariants: `pass` +- Required tests executed: `pass` +- Docs sync (EN/ZH): `pass` - no docs update required because the fix restores the current `skills/` default behavior and keeps CLI/API shape unchanged. ## Test Evidence - Commands run: + - `rustup update stable && rustup default stable` + - `cargo test -p skilllite-commands --features agent resolve_skills_root` + - `cargo fmt --check` + - `cargo clippy --all-targets -- -D warnings` + - `cargo test` + - `cargo test -p skilllite` + - `python3 scripts/validate_tasks.py` - Key outputs: + - Focused regression: `2 passed; 0 failed`. + - Clippy: `Finished dev profile`. + - Full tests: `cargo test` completed successfully; regression tests listed as `evolution::tests::resolve_skills_root_* ... ok`. + - Package tests: `cargo test -p skilllite` completed successfully. + - Task validation: `Task validation passed (67 task directories checked).` ## Decision -- Merge readiness: `ready | not ready` -- Follow-up actions: +- Merge readiness: `ready` +- Follow-up actions: Continue separate investigation for lower-confidence desktop bridge UX issues if needed; not included in this critical bug fix. diff --git a/tasks/TASK-2026-067-evolution-skills-root-alignment/STATUS.md b/tasks/TASK-2026-067-evolution-skills-root-alignment/STATUS.md index 688bff89..7c2c30f4 100644 --- a/tasks/TASK-2026-067-evolution-skills-root-alignment/STATUS.md +++ b/tasks/TASK-2026-067-evolution-skills-root-alignment/STATUS.md @@ -5,13 +5,17 @@ - 2026-05-30: - Progress: Investigated recent desktop L2 evolution changes, confirmed a skills-root split between write and read paths, and implemented resolver alignment with regression tests. - Blockers: None. - - Next step: Run required validation commands. + - Next step: Open PR and report results. +- 2026-05-30: + - Progress: Validation passed: `cargo fmt --check`, `cargo clippy --all-targets -- -D warnings`, `cargo test`, `cargo test -p skilllite`, and `python3 scripts/validate_tasks.py`. + - Blockers: None. + - Next step: Done. ## Checkpoints - [x] PRD drafted before implementation (or `N/A` recorded) - [x] Context drafted before implementation (or `N/A` recorded) - [x] Implementation complete -- [ ] Tests passed -- [ ] Review complete -- [ ] Board updated +- [x] Tests passed +- [x] Review complete +- [x] Board updated diff --git a/tasks/TASK-2026-067-evolution-skills-root-alignment/TASK.md b/tasks/TASK-2026-067-evolution-skills-root-alignment/TASK.md index 7f82c10f..cecfec19 100644 --- a/tasks/TASK-2026-067-evolution-skills-root-alignment/TASK.md +++ b/tasks/TASK-2026-067-evolution-skills-root-alignment/TASK.md @@ -4,7 +4,7 @@ - Task ID: `TASK-2026-067` - Title: Align evolution skills root -- Status: `in_progress` +- Status: `done` - Priority: `P1` - Owner: `agent` - Contributors: @@ -30,10 +30,10 @@ generated pending skills to `.skills` unconditionally, so default `skilllite ini ## Acceptance Criteria -- [ ] `evolution run` resolves the same effective skills root as desktop pending/status/confirm for default workspaces. -- [ ] Existing `.skills`-only workspaces remain supported. -- [ ] Regression tests cover default `skills/` and legacy `.skills` behavior. -- [ ] Required validation commands pass or any blocker is recorded with output. +- [x] `evolution run` resolves the same effective skills root as desktop pending/status/confirm for default workspaces. +- [x] Existing `.skills`-only workspaces remain supported. +- [x] Regression tests cover default `skills/` and legacy `.skills` behavior. +- [x] Required validation commands pass or any blocker is recorded with output. ## Risks @@ -47,11 +47,11 @@ generated pending skills to `.skills` unconditionally, so default `skilllite ini - Regression tests in `crates/skilllite-commands/src/evolution.rs`. - Workspace Rust tests required by policy. - Commands to run: - - `cargo fmt --check` - - `cargo clippy --all-targets -- -D warnings` - - `cargo test` - - `cargo test -p skilllite` - - `python3 scripts/validate_tasks.py` + - `cargo fmt --check` - passed + - `cargo clippy --all-targets -- -D warnings` - passed + - `cargo test` - passed + - `cargo test -p skilllite` - passed + - `python3 scripts/validate_tasks.py` - passed - Manual checks: - Re-read modified files and task board after updates. diff --git a/tasks/board.md b/tasks/board.md index 48b8a497..1f30f019 100644 --- a/tasks/board.md +++ b/tasks/board.md @@ -1,10 +1,10 @@ # Task Board -Last updated: 2026-05-30 (TASK-2026-067 evolution skills root alignment in progress) +Last updated: 2026-05-30 (TASK-2026-067 evolution skills root alignment done) ## In Progress -- `TASK-2026-067-evolution-skills-root-alignment` - Status: `in_progress` - Owner: `agent` +- None. ## Ready @@ -17,6 +17,7 @@ Last updated: 2026-05-30 (TASK-2026-067 evolution skills root alignment in progr ## Done +- `TASK-2026-067-evolution-skills-root-alignment` - Status: `done` - Owner: `agent` - `TASK-2026-066-utf8-evolution-log-truncate` - Status: `done` - Owner: `agent` - `TASK-2026-064-env-keys-single-source` - Status: `done` - Owner: `agent` - `TASK-2026-063-extension-tool-metadata-dispatch` - Status: `done` - Owner: `agent`