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:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user