Repository navigation
fix(tasks): approving a proposed task keeps it isolated (0.11.0) - #91
Open
stackbilt-admin wants to merge 2 commits into
Open
stackbilt-admin wants to merge 2 commits into
stackbilt-admin wants to merge 2 commits into
Conversation
Approval rewrote authority to 'operator', so the local task runner ran approved work -- often from untrusted issue bodies -- in the operator's own checkout with no branch or PR. Approval now records approved_at and approved_by (migration 0002) and keeps 'proposed'; the queue, sandbox dispatch and sandbox claim run approved proposed tasks, and the runner keeps isolating every non-operator task. Awaiting-approval listings (briefing, digest, task summary, dashboard, contract invariant) exclude approved tasks. Shared SQL in schema-enums. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gressions Review of #91: - do_sandbox tasks need an acceptance block unless operator-queued; approved proposed tasks keep their authority and would otherwise run unchecked. - An approved proposed task on an outside repo is refused with a note to requeue it with operator authority, and the changelog says so. - The sandbox claim moves to factory/claim.ts and the digest's task queries to digestTasks(), so both are tested on the real schema; new tests fail when the claim, briefing, digest, dashboard or admission filters revert. - setup applies migrations/*.sql, skipping ones already applied. - Dashboard marks approved tasks; aegis_list_cc_tasks returns the approval fields; reject is tested on approved tasks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Approving a
proposedtask (RESTPOST /api/cc-tasks/:id/approve, MCPaegis_approve_cc_task/aegis_batch_approve) rewroteauthoritytooperator.scripts/taskrunner.shgives only non-operator tasks a worktree and PR, so approved work, often generated from untrusted issue bodies, ran in the operator's own checkout. Nothing on the row showed it had started asproposed.Change
authority = 'proposed'and setsapproved_at = datetime('now')andapproved_by(rest/mcp). A task can be approved once (approved_at IS NULLguard).web/migrations/0002_cc_tasks_approval.sqladds the two columns;schema.sqlhas them for fresh installs.schema-enums.ts:TASK_RUNNABLE_SQL(authority != 'proposed' OR approved_at IS NOT NULL) andTASK_AWAITING_APPROVAL_SQL./api/cc-tasks/next, sandbox dispatch (factory/dispatch.ts) and the sandbox claim (factory/executor-do.ts).approvedAt/approvedBy, and invariantproposed_task_needs_approvalpasses once approved.operatorand can't be restored.Tests
web/tests/cc-task-approval.test.ts(node:sqlite, the realschema.sqlDDL and the migration): REST/MCP/batch approve, double-approve refused,/next, dispatch, summary, the SQL constants and the invariant.cc-tasks.test.ts,mcp.test.tsandfactory/dispatch.test.ts.pnpm typecheckclean;vitest runfor those five files pluspr-ready.test.ts: 164 passed.Daemon follow-up (separate PR in Stackbilt-dev/aegis): the daemon's own MCP approve handlers (
web/src/mcp/handlers/cc-tasks.ts) need the same change, and aegis-web needs the D1 migration.🤖 Generated with Claude Code