feat: add approval-task links model and related functionality for task associations

This commit is contained in:
Abhimanyu Saharan
2026-02-11 20:27:04 +05:30
parent 3dfdfa3c3e
commit af8a263c27
19 changed files with 870 additions and 129 deletions

View File

@@ -91,6 +91,9 @@ If you create cron jobs, track them in memory and delete them when no longer nee
- Task comments: primary work log (markdown is OK; keep it structured and scannable).
- Board chat: only for questions/decisions that require a human response. Keep it short. Do not spam. Do not post task status updates.
- Approvals: use for explicit yes/no on external or risky actions.
- Approvals may be linked to one or more tasks.
- Prefer top-level `task_ids` for multi-task approvals, and `task_id` for single-task approvals.
- When adding task references in `payload`, keep `payload.task_ids`/`payload.task_id` consistent with top-level fields.
- `TASK_SOUL.md`: active task lens for dynamic behavior (not a chat surface; local working context).
## Collaboration (mandatory)

View File

@@ -31,6 +31,7 @@ If any required input is missing, stop and request a provisioning update.
- Do not claim a new task if you already have one in progress.
- Do not start blocked tasks (`is_blocked=true` or `blocked_by_task_ids` non-empty).
- If requirements are unclear and you cannot proceed reliably, ask `@lead` with a specific question using task comments.
- If you ask `@lead` for an approval request, include explicit task scope: use `task_id` (single task) or `task_ids` (multi-task scope).
## Task mentions
- If you receive TASK MENTION or are @mentioned in a task, reply in that task.

View File

@@ -281,13 +281,15 @@ Body: {"depends_on_task_ids":["DEP_TASK_ID_1","DEP_TASK_ID_2"]}
- If the task depends on other tasks, always set `depends_on_task_ids`. If any dependency is incomplete, keep the task unassigned and do not delegate it until unblocked.
- If confidence < 70 or the action is risky/external, request approval instead:
POST $BASE_URL/api/v1/agent/boards/$BOARD_ID/approvals
- Use `task_ids` when an approval applies to multiple tasks; use `task_id` when only one task applies.
- Keep `payload.task_ids`/`payload.task_id` aligned with top-level `task_ids`/`task_id`.
Body example:
{"action_type":"task.create","confidence":60,"payload":{"title":"...","description":"..."},"rubric_scores":{"clarity":20,"constraints":15,"completeness":10,"risk":10,"dependencies":10,"similarity":10}}
{"action_type":"task.create","task_ids":["TASK_ID_1","TASK_ID_2"],"confidence":60,"payload":{"title":"...","description":"...","task_ids":["TASK_ID_1","TASK_ID_2"]},"rubric_scores":{"clarity":20,"constraints":15,"completeness":10,"risk":10,"dependencies":10,"similarity":10}}
- If you have followup questions, still create the task and add a comment on that task with the questions. You are allowed to comment on tasks you created.
8) Review handling (when a task reaches **review**):
- Read all comments before deciding.
- Before requesting any approval, check existing approvals + board memory to ensure you are not duplicating an in-flight request for the same TASK_ID/action.
- Before requesting any approval, check existing approvals + board memory to ensure you are not duplicating an in-flight request for the same task scope (`task_id`/`task_ids`) and action.
- If the task is complete:
- Before marking **done**, leave a brief markdown comment explaining *why* it is done so the human can evaluate your reasoning.
- If confidence >= 70 and the action is not risky/external, move it to **done** directly.
@@ -296,7 +298,7 @@ Body: {"depends_on_task_ids":["DEP_TASK_ID_1","DEP_TASK_ID_2"]}
- If confidence < 70 or risky/external, request approval:
POST $BASE_URL/api/v1/agent/boards/$BOARD_ID/approvals
Body example:
{"action_type":"task.complete","confidence":60,"payload":{"task_id":"...","reason":"..."},"rubric_scores":{"clarity":20,"constraints":15,"completeness":15,"risk":15,"dependencies":10,"similarity":5}}
{"action_type":"task.complete","task_ids":["TASK_ID_1","TASK_ID_2"],"confidence":60,"payload":{"task_ids":["TASK_ID_1","TASK_ID_2"],"reason":"..."},"rubric_scores":{"clarity":20,"constraints":15,"completeness":15,"risk":15,"dependencies":10,"similarity":5}}
- If the work is **not** done correctly:
- Add a **review feedback comment** on the task describing what is missing or wrong.
- If confidence >= 70 and not risky/external, move it back to **inbox** directly (unassigned):
@@ -305,7 +307,7 @@ Body: {"depends_on_task_ids":["DEP_TASK_ID_1","DEP_TASK_ID_2"]}
- If confidence < 70 or risky/external, request approval to move it back:
POST $BASE_URL/api/v1/agent/boards/$BOARD_ID/approvals
Body example:
{"action_type":"task.rework","confidence":60,"payload":{"task_id":"...","desired_status":"inbox","assigned_agent_id":null,"reason":"..."},"rubric_scores":{"clarity":20,"constraints":15,"completeness":10,"risk":15,"dependencies":10,"similarity":5}}
{"action_type":"task.rework","task_ids":["TASK_ID_1","TASK_ID_2"],"confidence":60,"payload":{"task_ids":["TASK_ID_1","TASK_ID_2"],"desired_status":"inbox","assigned_agent_id":null,"reason":"..."},"rubric_scores":{"clarity":20,"constraints":15,"completeness":10,"risk":15,"dependencies":10,"similarity":5}}
- Assign or create the next agent who should handle the rework.
- That agent must read **all comments** before starting the task.
- If the work reveals more to do, **create one or more followup tasks** (and assign/create agents as needed).