code wiki / (root) / nxtask.nx

nxtask.nx

buildroot/runtime/nxtask.nx

10773 B320 linesdepth 3pulls 3 transitivereach 3 importersview sourcekind tooltopic nxtask
docsdependenciesstructsconstsfunctions

about

nxtask.nx -- sovereign agent task graph (beads-equivalent). Persistent, structured-memory task tracker for the Mormon local AI agent (docs/LAYER_1_3_SOVEREIGNTY_AUDIT.md). Tracks work across sessions; survives agent restarts. Design inherited from beads (gastownhall/beads) where it fit sovereignty discipline. Divergences: - NO external SQL engine (Dolt is 100 MB + MySQL-compat). Instead: content-addressable flat files, one JSON blob per task. Ride on fs.nx. Zero runtime deps. - NO Dolt cell-level merge. Instead: append-only event log per task id; merge via event-timestamp ordering. v0.1.0 adds cross-agent merge; v0.0.1 single-agent only. - Same JSON API as beads where possible -- Mormon can switch backends seamlessly later. v0.0.1 scope: add, list, claim, close, show, ready. No hierarchy, no deps yet -- foundations first, semantics layer in v0.1.0.

dependencies 1 imports · 3 importers

syscalls.nx nxtask.nx nxtask_main.nx nxtask_store.nx prop_nxtask_store_test.nx

imports: syscalls.nx

imported by: nxtask_main.nxnxtask_store.nxprop_nxtask_store_test.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nxtask_graph_new nxtask_add task_at nxtask_count_state task_at ↻ nxtask_next_ready nxtask_is_ready task_at ↻ nxtask_claim task_at ↻ task_at ↻ nxtask_close task_at ↻ nxtask_add_dep task_at ↻ nxtask_is_ready ↻

structs

32struct Task {
50struct TaskGraph {

consts

26const TASK_MAX_DESC: i64 = 2048
27const TASK_MAX_OPEN_TASKS: i64 = 1024
28const TASK_STATE_OPEN: i64 = 0
29const TASK_STATE_CLAIMED: i64 = 1
30const TASK_STATE_CLOSED: i64 = 2
56const TASK_BYTES: i64 = 112
57const MAX_DEPS: i64 = 16

functions

61func nxtask_graph_new(cap: i64) -> *TaskGraph {
70func task_at(g: *TaskGraph, idx: i64) -> *Task {
79func nxtask_add(g: *TaskGraph, desc: *u8, desc_len: i64,
122func nxtask_add_dep(g: *TaskGraph, task_idx: i64,
143func nxtask_is_ready(g: *TaskGraph, idx: i64) -> i64 {
called by 2: nxtask_next_readymain calls 1: task_at
171func nxtask_claim(g: *TaskGraph, idx: i64,
196func nxtask_close(g: *TaskGraph, idx: i64,
220func nxtask_count_state(g: *TaskGraph, state: i64) -> i64 {
called by 1: main calls 1: task_at
233func nxtask_next_ready(g: *TaskGraph) -> i64 {
called by 2: mainmain calls 1: nxtask_is_ready
244func main() -> i64 {