refactor(core): Remove unused applyPlannedTaskPermissions helper (no-changelog) - #36920
refactor(core): Remove unused applyPlannedTaskPermissions helper (no-changelog)#36920Cadiac wants to merge 1 commit into
Conversation
…changelog) The helper had no remaining call sites. Its former callers were removed when the planned-task context was reworked, and the two places that still apply plan-approved overrides spread PLANNED_TASK_PERMISSION_OVERRIDES directly. Its test file only exercised the helper, so it now asserts on the overrides constant instead, keeping coverage that build-workflow grants no destructive or open-ended permissions. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PR review overviewBased on ownership of the 4 changed files in this PR:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
No issues found across 4 files
Architecture diagram
sequenceDiagram
participant Service as InstanceAiService
participant Data as PLANNED_TASK_PERMISSION_OVERRIDES
participant Context as InstanceAiContext
participant Engine as Workflow / Execution Engine
Note over Service, Engine: Runtime Application of Task Permission Overrides
Service->>Service: Identify Planned Task Kind (e.g., 'checkpoint')
alt Task Kind has approved overrides
Service->>Data: CHANGED: Reference overrides directly by key
Data-->>Service: Returns Partial permissions (e.g. runWorkflow: 'always_allow')
Service->>Context: CHANGED: Manually spread overrides into context object
Note right of Context: The helper applyPlannedTaskPermissions is removed. Service now handles the merge via object spread.
else No overrides defined (e.g., 'delegate')
Service->>Service: Use original Context permissions
end
Service->>Engine: executeTask(context)
Engine-->>Service: Task Result
Instance AI Discovery Eval ✅Branch: Eval output |
Instance AI Workflow EvalImportant This eval does not re-run on new commits. To test your latest push, re-run it against the PR head: gh workflow run ci-instance-ai-evals.yml -f pr=36920…or use the Run workflow button and set pr = Warning 🟡 All 25 units green over 3 runs, but 1 barely passed (failed most runs) — see Failures below. Gate: pass@k = 100% (every unit passes at least once across k runs) — 96.0% pass (72/75 trials over 25 units · k=3) pass@3 100.0% · pass^3 93.3% · LangSmith experiment Failures (2)
Per-test-case results (8)
Workflow checksScored over 24 successful build(s). N/A = check did not apply to that workflow. Error = check could not be measured (e.g. judge timeout).
All workflow checks (3 failing of 35 checks)
|
Summary
applyPlannedTaskPermissionsin@n8n/instance-aihas no remaining call sites. Its former callers were removed when the planned-task context was reworked. The two places that still apply plan-approved permission overrides — the checkpoint and planned-build follow-up branches ininstance-ai.service.ts— spreadPLANNED_TASK_PERMISSION_OVERRIDESdirectly instead.This PR removes the helper, its lazy re-export from the package entrypoint, and the mocked reference in the entrypoint test.
How to test
This is a dead-code removal, so nothing should change.
Related Linear tickets, Github issues, and Community forum posts
Found while reviewing https://linear.app/n8n/issue/INS-682.
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)🤖 PR Summary generated by AI