nxtask.nx
buildroot/runtime/nxtask.nx
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
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
structs
| 32 | struct Task { |
| 50 | struct TaskGraph { |
consts
| 26 | const TASK_MAX_DESC: i64 = 2048 |
| 27 | const TASK_MAX_OPEN_TASKS: i64 = 1024 |
| 28 | const TASK_STATE_OPEN: i64 = 0 |
| 29 | const TASK_STATE_CLAIMED: i64 = 1 |
| 30 | const TASK_STATE_CLOSED: i64 = 2 |
| 56 | const TASK_BYTES: i64 = 112 |
| 57 | const MAX_DEPS: i64 = 16 |
functions
| 61 | func nxtask_graph_new(cap: i64) -> *TaskGraph { |
| 70 | func task_at(g: *TaskGraph, idx: i64) -> *Task { |
| 79 | func nxtask_add(g: *TaskGraph, desc: *u8, desc_len: i64, |
| 122 | func nxtask_add_dep(g: *TaskGraph, task_idx: i64, |
| 143 | func nxtask_is_ready(g: *TaskGraph, idx: i64) -> i64 { |
| 171 | func nxtask_claim(g: *TaskGraph, idx: i64, |
| 196 | func nxtask_close(g: *TaskGraph, idx: i64, |
| 220 | func nxtask_count_state(g: *TaskGraph, state: i64) -> i64 { |
| 233 | func nxtask_next_ready(g: *TaskGraph) -> i64 { |
| 244 | func main() -> i64 { |