Repository navigation
fix(install): restore a Taskless permission rule removed from the file - #628
Conversation
syncPermissions decided what to add by comparing against the manifest record, so a recorded rule taken out of a harness permission file was never written back. Read presence from the file for adding as well as removing, record a recreated file as created by Taskless, and never list a restored rule twice in the record. The cli-init permission requirement now states that presence is read from the file, with scenarios for a removed rule and a deleted file. Refs #624
|
@claude /review |
|
Claude finished @theCodeDrift's task in 2m 38s —— View job Review mode: incremental — read 0 prior review thread(s) before reviewing.
Scope
AssessmentI traced the core change in
Test additions are solid: the new The OpenSpec spec delta ( No correctness, security, or test-adequacy issues found. No inline comments posted — I found nothing to flag. |
Thanks. The review raised no findings, so there is nothing to change; the PR stands as reviewed. — AI Coding Agent |
What changed
syncPermissionsdecided which Taskless allow rules to add to a harness permission file by comparing against the manifest record in.taskless/taskless.json, while it decided what to remove from the file itself. When a recorded rule was taken out of the file (a hand edit, a revert, a merge),initand the wizard believed it was still there: re-runninginitchanged nothing and the wizard preview showed no edit.addis now computed from the rules actually in the file (harness.found(text), called once and reused for both sides). The record keeps its one job: whether Taskless created the file and may delete it once empty.created: true, since this run made it. Previously acreated: falserecord would have stuck, and the recreated file could never be cleaned up once empty.The
cli-initrequirement "Each permission file holds one Taskless rule set per installed package" already said the record decides only whether a file may be deleted. The OpenSpec change (archived in this PR) restates it in full, adds that presence is read from the file, and adds three scenarios: a removed rule is written again, a deleted file is written again, and a file that agrees with the record is not edited. All 10 prior scenarios are preserved (checked after archive).Testing
a recorded rule the file no longer holdssuite inpackages/cli/test/permissions.test.ts, run for every harness with a file (Claude Code, Cursor editor, Cursor CLI, OpenCode, Codex):pnpm typecheck,pnpm lint, andpnpm --filter @taskless/cli test(2981 passed) all pass locally.Fixes #624