feat(tasks): full REST surface for tasks

CRUD, lifecycle transitions, work-graph links and notes over /tasks;
share link-kind inference (TaskTargetKinds) between the REST route and
task_update tool. End-to-end route tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 19:27:19 +00:00
parent 0c6ac903b7
commit 6e044d0ab9
4 changed files with 555 additions and 17 deletions
@@ -0,0 +1,16 @@
package com.correx.core.tasks
import com.correx.core.events.types.TaskTargetKind
/**
* Infers what a work-graph link points at from its target id, for callers that don't say
* explicitly. ADR ids (`adr-12`, `ADR_0007`) and `.md` paths are documents; everything else is
* assumed to be another task. Shared by the agent tool and the REST surface so the heuristic
* stays in one place. Always prefer an explicit [TaskTargetKind] when the caller provides one.
*/
object TaskTargetKinds {
private val ADR_ID = Regex("(?i)^adr[-_ ]?\\d+$")
fun infer(targetId: String): TaskTargetKind =
if (ADR_ID.matches(targetId) || targetId.endsWith(".md")) TaskTargetKind.DOC else TaskTargetKind.TASK
}