Release Notes
v0.67.0 — 2026-11-16
Added — Explicit Per-Session Skill Assignment (Plan 105 — the skill-supply seam)
Until now every knot session was spawned with pi's full skill
discovery set (~/.agents/skills/ masters + the project's
.agents/skills/) — nothing narrowed, extended, or targeted it, and a
project had no surface to supply its own behaviour skills. Knot
0.67.0 composes a per-session, explicit --skill list from three
declaration surfaces and hands it to the agent at spawn:
- Rig config
skills:— rig-global, the project-side seam: every knot session in the rig receives the declared entries. Under a shim rig (plan 100) this file is local and project-side while the workflow is served from the external rig — so project-specific behaviour skills are declared here and the served rig stays architecture-neutral. - Profile frontmatter
skills:— every knot served by that profile. - Knot frontmatter
skills:— that knot only.
Semantics — union, de-duplicated on the resolved path (rig →
profile → knot order preserved). Entries are skill file/directory
references (absolute, ~/..., file://, or relative — rig-config
entries resolve against the local rig directory, frontmatter
entries against the effective rig directory). Additive by
default: the declared set extends pi's discovery set; an empty
declaration passes neither --skill nor --no-skills — the full
discovery set, unchanged (zero migration). skills-mode: exclusive (rig config) opts into narrowing: --no-skills plus
the declared set only. Visible, never vacuous: unresolvable
entries warn ([KNOT][EVENT] type=CONFIG source=skill-assignment) and
are skipped; the resolvable remainder still loads; exclusive mode that
narrows to nothing says so. Fully dynamic: the lists and the skill
files are re-read at each new session (no service restart; edits
land on the next new session, never mid-session — the plan-103
drift-rule by analogy).
The engine names no architecture: it resolves paths and composes flags; it interprets no skill content — all vocabulary lives project-side.
v0.65.0 — 2026-11-01
Changed — Split the tie-off and event-content instructions (Plan 102)
The single overridable content section (Knot 0.60.0+, one file, one key) is split into two instruction documents with fixed injection scopes:
# Tie-Offblock — every knot, every new session, unconditional — the universal contract sentence is hard-coded (fromknot-tie-off-contract.md) and the tie-off instruction (## Tie-Off Content) is the overridable document. A leaf knot (no consumers, no self-continuation) — which previously got no tie-off instructions at all — now receives the# Tie-Offblock.# Subscriber Eventsblock — only when the knot has subscriber events — the event acknowledgement / format / rules stay hard-coded (fromknot-event-contract.md) and the event-content guide (## Event Content Guide) is the overridable document.- Two config keys —
tie-off-instruction-fileandevent-content-instruction-file(each replaces its section only; pulled fresh per new session — two pulls; per-section fallback). - Retired key — the 0.60.0–0.64.x combined
tie-off-content-instruction-fileis parsed (no more config-shape error) but not honoured, with a[KNOT][EVENT] type=CONFIGwarning per session. - Skills + docs —
knot-templatev3 (two templates + two core references + migration procedure),knotmaster routing line, and the instruction sections in the docs.
Migration: agent/user-driven, binary makes no rig changes. Split
the linked file at the ## Event Content Guide heading into
knot-tie-off-content.md / knot-event-content.md, replace the key
with the two above (shim rig: both the shim's and the external rig's
config), and — for a legacy 0.59.0-era tie-off-instruction-file
linked to a full-contract file — point it at a content-only file
(the key is honoured again; the old full-contract content now
replaces only the content section). See the knot-update skill
(Knot 0.65.0 entry).
v0.63.0 — 2026-10-24
Breaking — Unified Tie-Off Log + Direct Event Queueing (Plan 099)
A hard cutover of the rig's runtime tree (no config flag — the service owns the write format). This changes runtime artefacts, not project documents.
- Unified
tie-offs/<rig>/tie-offs.log— the service appends every tie-off section to one accumulating log (sole writer, serialised appends). Per-knottie-off-{knot-name}.mdfiles retire: no longer written or read; existing files stay in git history. Section headers are structured (event-id,source,session,original-strand) and the event-audit blocks are slimmed to id / occurred / reason / timestamp — no payload bodies; the git commit stays the fidelity source. - Direct event queueing — events parsed from a producer's tie-off queue
directly as payload-bearing
kind: "Event"entries, one per subscriber. Theevent:-URI strand/watch delivery path and the per-EventIddispatch.mdfiles retire (theFileSystemEventDispatcheradapter is deleted). Legacy queue JSON (nodelivery) loads unchanged. - Manual dispatch — the direct queue write is the sole manual mechanism and
accepts the
Eventkind;knot step --event <id>addresses entries by id (unchanged). - Commit trailers + structured trace fields — every knot commit carries a
trailer block (
session:,event:,source:,original_strand:) and the run-lifecycle service-log lines gain the same grep-able fields. The debug trace chain (service log → commit →tie-offs.log→pi --session-id) closes with no persistent payload duplication. - Startup deprecation diagnostics — the service detects retired-layout
artefacts (per-knot tie-off files, dispatch directories) and logs a
one-line
[KNOT][CONFIG]diagnostic naming them; no backfill, no read.
Migration: none required for project documents (profiles, knots, looms are
unchanged). The runtime layout changes: existing per-knot tie-off files and
dispatch directories remain on disk (git history) but the 0.63.0 binary neither
writes nor reads them; new work appends to tie-offs.log and queues directly.
Rigs linking a custom tie-off content instruction are unaffected (the contract
stays hard-coded in the binary).
v0.62.0 — 2026-10-18
Added — queue-busy dispatch observation + end-to-end acceptance (Plan 097, phases 4–5)
Two closing increments for plan 097, both strictly additive:
queue-busynote onEventsDispatched— at tie-off dispatch the service compares the per-type queue counts taken at session start against the counts at dispatch time. When the queue net-gained entries of a dispatched event type during the session, an additivequeue-busy=<event-type>:<n>note is appended to theEventsDispatchedservice-log line (after thedispatch=…entries). No growth → the line is byte-identical to the 0.60.0/0.61.0 format; legacy activity entries without the field deserialize as empty. Passive observability only: it records whether producers race the queue — nothing bounces, nothing re-asks.- End-to-end acceptance tests (
tests/queued_events_e2e.rs) — full-pipeline tests (real event dispatcher, mock runner, in-memory queue) pin the plan-097 contract: producer emits → entry queued → the re-entry prompt carries the queued entry (queue path + queue timestamp + dedup norm); a 15-entry backlog shows “15 queued (newest 10 shown)” with the 5 oldest capped out; a queue holding only other-type / other-producer entries omits the section; anoccurred: falseack counts for enforcement and dispatches nothing.
No rig configuration change; no document migration. Service log + tests only.
v0.61.0 — 2026-10-18
Changed — Queue-backed pending-event visibility for producers (Plan 097)
The producer prompt's pending-events section is now built from the persistent event queue (the authoritative pending set) instead of a per-event-file frontmatter scan:
## Queued Events(renamed from## Pending Events) — per emittable event type: the full count plus the newest capped entries (path + the queue's ownqueued_at), capped byPENDING_INDEX_CAP = 10. A backlog of N never becomes N prompt entries ("N queued (newest 10 shown)").- Metadata-only (body-blind) — no event bodies or
description/timestampparsing; the only file read is the frontmattertarget-knotkey (producer identity). The event type comes from the dispatch path. - Scoped — only entries of types this knot may emit, and only entries FROM this producer (other producers' queued events are excluded); the section is omitted entirely when the queue holds nothing relevant.
- The queue-less directory-scan fallback (contexts without a wired queue, and tests) is kept and capped identically (plan 097 phase 0 decision D2).
- Dedup norm on the rig instruction surface — the event-content
guide (the
knot-templatecontent template, the source of the hard-coded default content section) gains a Deduplication bullet: if a queued event already carries the same facts (compare frontmatter keys such as plan/phase), emit the subscriber eventoccurred: falseand say so rather than queueing a second signal. The## Queued Eventssection points at this rig wording.
No rig configuration change; no document migration. Prompt-surface only: the section heading, wording, and entry shape change when the queue is non-empty (rigs may ignore the section).
v0.60.0 — 2026-10-16
Changed — The tie-off contract is hard-coded again; one exposed content section (Plan 096)
v0.59.0 externalised the whole tie-off contract (both templates as full per-rig replacements); from 0.60.0 only the content is exposed — the contract, the event format, and the rules are hard-coded into the binary and cannot be overridden per rig:
- Hard-coded core —
## Tie-Off Contract,## Event Format(the fixedevent:/occurred:/timestamp:block), and## Rules(one structured block per subscriber event — always, even whenoccurred: false) are compiled in fromknot-tie-off.md(still the single source of truth) and are always injected — the agent always sees the canonical format, so the override/format divergence risk from 0.59.0 is eliminated by construction. - The exposed content section — the tie-off's header/narrative
content + the event-content guide (
description, body, additional custom properties) is one overridable unit, with a hard-coded default compiled in from the newknot-tie-off-content.mdtemplate. - Config key —
tie-off-instruction-fileandevent-content-instruction-fileare retired (parse-only: detected and reported with a[KNOT][EVENT] type=CONFIGwarning per new session, never honoured). The one new key:tie-off-content-instruction-file— same mechanics as before (absolute / rig-relative /~//file://;http(s)refused; pulled fresh per new session, never cached; missing link → the hard-coded default content section + atype=CONFIGwarning; the service never writes into the rig). knot-templateskill (2.0.0) — ships the content template + the shipped contract for reference, and the procedure to link the content section;knot-update(1.26.0) carries the migration entry.- Migration — remove
tie-off-instruction-file(no replacement — the contract is no longer overridable); a rig with a customevent-content-instruction-filere-links that file undertie-off-content-instruction-file.
v0.59.0 — 2026-10-16
Fixed — Event-enforcement follow-up response now lands in the tie-off
When event enforcement re-enters the session because the agent's
tie-off did not acknowledge every subscribed event, the follow-up
response is now appended to the same tie-off file as a second
section (header … (event-enforcement follow-up)) — previously it was
dispatched as events but never persisted, so the second turn was
invisible in the tie-off document (and to any knot or agent that reads
it). An empty follow-up response is recorded as a short marker section.
A follow-up that errors appends nothing — there is no response to
record (the second KnotEventsMissing log line is unchanged).
Added — knot-template skill + per-rig instruction links
The tie-off contract and the event-content guide injected into
producer knots' # Subscriber Events block now have a hard-coded
default compiled into the binary, with a per-rig override:
- The
knot-templateskill (Knot skills library) — a pi skill that explains the instruction mechanism and ships the two templates (knot-tie-off.md,knot-event-content.md). Invoking it adds a per-project override: it copies the templates intorig/knot-template/and sets the config links. The template files are the single source of truth for the hard-coded default (compiled in viainclude_str!), so the shipped default and the skill's templates can never drift. The default text also fixes the typos in the previous hard-coded text (acknolowedge,occured, …) and the stray raw-newline line in the example block. - Per-rig instruction links:
tie-off-instruction-file/event-content-instruction-filein.workspace-agent-config.yamlname a file whose entire content replaces the corresponding hard-coded default (absolute path, relative to the rig dir,~/..., orfile://URL;http(s)://is refused with a warning). A missing or unreadable file falls back to the hard-coded default, with a[KNOT][EVENT] type=CONFIGlog line. The auto-created config template documents both keys (commented out). - Pulled per session, never cached: a new
PromptInstructionSourceport (domain) +FileSystemPromptInstructionSource(adapter) re-reads the config and the linked file on every new session, so edits take effect on the next strand without a restart. - No rig writes: the service never creates instruction files in the
rig — invoking the
knot-templateskill (the agent) is the only writer. Rigs that ran a pre-rollout 0.59.0 build may have inertrig/skills/knot-*.mdfiles from the abandoned seeding design — safe to delete. - Parser hardening:
extract_emitted_event_idsnow anchors on the subscriber list (the contiguous- \EventId`` run after the marker line) instead of scanning the whole block — backticked bullets inside the event-content guide (or a custom file) can no longer leak in as event IDs. The subscriber bullet format is unchanged.
Docs: concepts — Agent Events and Enforcement (skill-backed instructions + follow-up tie-off section) and configuration — rig structure (the two new config keys).
v0.58.0 — 2026-10-02
Added — Rig Graph Event Types Panel (Plan 093, Phase 10)
- The rig-graph visualiser's second right-side panel — event types,
the communication view. Per event type: Inv (distinct trigger
filenames delivered — a fan-out event delivered to several knots is
one invocation), Knots (distinct consumer knots), Min (closed
processing sessions the type caused, attributed via each
→processingstart record'sstrand=file). Default sort: Min descending — the top row is the communication to optimise; re-sort byInv/Knotsfor the other perspectives. - Event type = the event dir name for rig event files (under a
tie-offs/tree, e.g.PlanComplete— keyed by bare name, so the same event name in several looms merges); project input files are their own type by file name. Same session rules as the Minutes column (failed sessions count; unclosed sessions excluded; sessions never span a service restart). - Demo rig (v0.58.0 extraction): 24 event types —
PlanReadytops the cost view (29 invocations × 2 knots = 693.3 min);PlanComplete(18 × 3) is the top fan-out at 429.6 min. --jsonnow emits theevent_typesfield. 44/44 tests green (new: type counts, fan-out dedup, unclosed/restart exclusion at type level); headless Chromium + Firefox verified (panel rendering, all sorts, stacking, existing interactions intact).
v0.57.1 — 2026-10-02
Fixed — Minutes Billed Across Service Restarts (Plan 093, Phase 9 bugfix)
- The strand-events legend's Minutes column paired a knot's open
→processingsession with the nextprocessing→transition — even when that was in a later service run (the append-only log spans restarts). The whole shutdown period was billed to the knot: on the demo rig,lifecycle-on-deliveryshowed 5671.8 min for 24 events (≈ 6 h/session) when the raw log shows 2–9-min sessions (now 122.2 min); the rig total corrected from 13177.9 to 3950.6 min. - Fix:
initial snapshotmarks the start of each service run; open sessions are dropped there. A busy session lives inside one run. Regression test pins the boundary behaviour.
v0.57.0 — 2026-10-02
Added — Rig Graph Strand-Events Legend: Minutes Column (Plan 093, Phase 9)
- The strand-events legend (v0.56.0) gains a Minutes column beside the event count: each knot's total busy time during the log's span, from the service log's line-leading RFC 3339 timestamps.
- A busy session is bracketed by the
[KNOT][STATE]status-change records: any→processing(idle, completed, or failed restart) starts one, the same knot's nextprocessing→transition (completed or failed) ends it. Unclosed sessions — a knot still processing at the log tail — are excluded: the figure is completed work, not a number that grows while the log grows (re-run after the session ends for a final figure). - Sortable via the new
Minheader label (desc, name tie-break), same click-to-toggle behaviour asKnot/Events; the default sort (Events desc) is unchanged. knot-visualiseskill 1.5.0 → 1.6.0.
v0.56.0 — 2026-10-02
Added — Rig Graph Strand-Events Legend (Plan 093, Phase 8)
- New
--log <path>flag onscripts/rig-graph.py: counts distinct strand events delivered per knot from the knot service log's[KNOT][NOTIFY]records (the strand-dir event history — not the knot-lifecycle[KNOT][EVENT]records). A delivery that notifiesCreatedthenModifiedcounts once (distinct(knot, strand_path)pairs);KnotModified(knot-definition changes) is excluded. - Generated visualisations gain a second legend — Strand events
(top-right): one row per receiving knot with its event count,
sortable by knot name or by count via the clickable header labels;
defaults to count-descending, so the top of the list is the
overactive knot. The panel renders only when
--logis given and the log contains strand events; without--logthe output is unchanged. - Missing
--logpath → error + non-zero exit (a silent empty legend would be misleading). knot-visualiseskill 1.4.0 → 1.5.0 (CLI contract, workflow, and interaction contract updated).
v0.55.1 — 2026-10-02
Fixed — Rig Graph: no edges or labels rendered (Plan 093 bugfix)
- The generated visualisation showed no lines and no event labels
(nodes and layout were fine). The Phase 7 pair counter used
pairCount[e._pair]++on a missing property;++onundefinedevaluates toNaN(ToNumber semantics — identical on V8 and SpiderMonkey), so every arc control point wasNaNand the browser rejected theQNaN,NaNpath data. - The counter is now built with an explicit undefined guard
(
pairCount[e._pair] = e._idx + 1). Verified in headless Chromium and Firefox: all edge paths valid, parallel pairs arc, interactions intact. - Regenerate your visualisation to pick the fix up:
python3 scripts/rig-graph.py --out <path.html> --rig <rig>. No rig-document migration.
v0.55.0 — 2026-10-02
Added — Rig Graph Arced Parallel Edges + Dotted-Only Loom Marker (Plan 093, Phase 7)
Bidirectional knot pairs (e.g. lifecycle-on-delivery ↔
plan-implementer) drew two straight edges perfectly on top of each
other — reading as one double-headed edge whose "missing" arrowhead was
actually the other edge fading on click. And the · loom label
suffix repeated what the dotted style already says.
- Parallel edges between a node pair are spread into perpendicular arcs (one lane each; lone edges stay straight). Clicks, hover, highlighting, and filtering operate on the separated edges.
- The
· loomlabel suffix is dropped — the dotted style alone marks a loom-wide subscription; only wildcard (event:*:) edges keep a· allsuffix. - Regenerate your visualisation to pick the changes up.
knot-visualiseskill bumped to 1.4.0. No rig-document migration.
v0.54.0 — 2026-10-02
Added — Rig Graph Edge Labels on Hover/Highlight + Wide-Scope Marker (Plan 093, Phase 6)
The rig graph was hard to read at scale: all 85 edge labels rendered at
once in 9 px grey, so a label could not be attributed to its edge, and
loom-wide subscriptions (event:<loom>:<Event>) drew one arrow from
every knot of the loom — reading as knot-specific sends.
- Edge labels are hidden by default and revealed on hover (wide hit zone) or while highlighted (clicking an edge, node, or loom lights the labels of the highlighted edges).
- Wide-scope subscriptions are marked: loom-level and wildcard
fan-out edges are dotted and their labels suffixed
· loom/· all— the graph can no longer be misread as "knot A sends to knot B" when it is really "knot B listens to the whole loom". - Regenerate your visualisation to pick the change up.
knot-visualiseskill bumped to 1.3.0. No rig-document migration.
v0.53.0 — 2026-10-02
Added — Rig Graph Loom Highlight Shows Feeding Nodes (Plan 093, Phase 5)
Clicking a loom's name in the rig graph legend now highlights the
loom and everything feeding into it: the loom's own knots, every
incident edge, and the source node of each edge pointing at a loom knot
(upstream one hop — knot, input, or system sources alike). Before, only
the loom's own knots stayed lit, so the loom's inputs were visible as
arrows but not as named nodes. Regenerate your visualisation to pick the
change up. knot-visualise skill bumped to 1.2.0. No rig-document
migration.
v0.52.1 — 2026-10-02
Fixed — Rig Graph Phase 4 defects (Plan 093 bugfix)
- Legend showed only the first loom row. Rows were built with
append("div").data(looms)(single element, first datum only); now built withselectAll(...).data(looms).enter().append(...)— one row per loom. - Clicking an edge did not highlight. The hit-line listener assumed a d3 v5-era index argument that D3 v7 does not pass; edge selection is now tracked by object identity.
- Regenerate your visualisation to pick the fix up:
python3 scripts/rig-graph.py --out <path.html> --rig <rig>. No rig-document migration.
v0.52.0 — 2026-10-02
Added — Rig Graph Interactive Legend and Click Highlighting (Plan 093, Phase 4)
The rig graph HTML (scripts/rig-graph.py --out …) is now explorable by
selection:
- Legend checkboxes filter by loom — unchecking hides the loom's knot nodes and every edge touching them (input/system nodes stay; the force simulation is untouched).
- Click a loom name in the legend to highlight it (its knots + incident edges stay at full opacity, everything else fades).
- Click a node to highlight it, its incident edges, and its direct neighbours; click an edge (wide invisible hit zone) to highlight the edge and its two connected nodes. Click the background to clear.
- Filtering and highlighting are independent and compose; selection modes are mutually exclusive.
- No Knot binary behaviour changes;
knot-visualiseskill bumped to 1.1.0 with the interaction contract. No rig-document migration.
v0.51.0 — 2026-10-02
Added — Rig Graph Visualiser (Plan 093)
New whole-rig topology visualiser: scripts/rig-graph.py extracts the
rig's knot graph — knots (nodes) and their event: subscriptions /
filesystem strand-dirs (edges) — and renders it into a
self-contained, offline-viewable D3 HTML file at a user-specified
--out path (D3 v7.9.0 is vendored and inlined; no network needed to
view). The new knot-visualise sub-skill packages the workflow
(knot master routes to it).
- CLI:
--out <path.html>(required) /--rig <dir>/--no-state/--json. Stdlib-only Python 3; the Knot service need not be running. - Edges resolve all five
strand-dirforms: knot-level, loom-level (event:<*-loom>:…), wildcard (event:*:…), rig-level system events (event:knot:…→ a synthetic system node), and plain filesystem paths (input nodes). Unresolved targets are flagged, not dropped. - Runtime state overlay (
status,last_event_at) fromtie-offs/<rig>/state.jsonwhen present; duplicate knot ids across looms get unique<loom>:<knot>node ids. - No Knot binary behaviour changes; no rig-document migration (no knot-update entry).
- Design knowledge:
project/design/design-rig-graph-visualiser.md.
v0.50.0 — 2026-09-21
Changed — Static Engine Token for Rig-Scoped System Events (Plan 092)
Rig-scoped system events (currently QueueIdle) now subscribe by a
static engine token instead of the rig directory's basename. The
rig-name token encoded a deployment detail — the name the rig directory
happened to be called — so a rig built from a template under another
name (or a renamed rig directory) silently lost every rig-scoped
subscription: the event was logged, no event file was dispatched, no
consumer fired, and nothing was logged about the gap. One process per
rig makes the token redundant — the process boundary and the runtime
root (tie-offs/<rig>/…) already scope every dispatch to the running
rig.
- Canonical form:
event:knot:<EventId>(e.g.event:knot:QueueIdle). The token is the Knot engine — invariant under rig-directory renames and template reuse. Wildcard (event:*:QueueIdle) is unchanged. - The rig-name form is deprecated, not broken.
event:<rig-id>:<EventId>keeps working in this release; removal is reserved for a later breaking release. Existing rigs need no migration. - Event-file provenance unchanged. The
target-knot:frontmatter of a dispatched system event still carries the actual rig id regardless of the subscription form — only matching changed. - Zero-consumer dispatch is no longer silent. A rig-scoped emit
that matches no consumer logs one service-log line:
[KNOT][SYSTEM] event=<EventId> rig=<rig> — 0 consumers matched, extended withnear-miss subscription(s): <knot> (event:<token>:<EventId>)when a knot subscribes to the same event id with a non-matching producer token — the rename-mismatch signature, named directly. Scoped to rig-scoped emits: zero consumers is the normal state for knot- and loom-scoped events. - No rig document format changes; no project document migration required (the new form is recommended for new subscriptions).
v0.49.0 — 2026-09-20
Fixed — Per-Event Enforcement (Plan 091)
Event enforcement now checks per-event completeness instead of
merely "does the tie-off contain at least one event block". The 0.48.x
shape left a silent gap: a knot whose subscribers expected several
event: sources could acknowledge some events — even only with
occurred: false blocks — and the enforcement gate saw an event block
present and passed it through. The remaining events simply were never
delivered, and the consumer knots that subscribe to them never ran. A
live rig (a prd-config-check knot narrating that it emitted
PlanRequested without emitting the block) exposed exactly this: the
tie-off carried three occurred: false acknowledgements, the
enforcement gate passed it, and the subscriber waiting on
PlanRequested sat silently.
- The missing set is computed per event. The expected set comes
from the same subscriber context injected into the prompt
(
event:sources of loom-level and knot-level subscribers, plus theTasksIncompleteself-continuation entry). Every expected event ID with no structured block in the tie-off — anoccurred: trueoroccurred: falseblock both count as present — is missing. Narrative mentions are not acknowledgements; the structured block is. - Zero blocks is the all-missing case. A tie-off with no event
blocks at all now logs
KnotEventsMissingwith the full expected set as the missing set — the old behaviour, preserved and generalised. event: Noneis a blanket acknowledgement. As before, aNoneblock satisfies the whole list ("nothing happened"); it never appears in a missing set.TasksIncompleteis never enforced. It is a conditional self-continuation signal, not a subscriber acknowledgement; when it is the only expected entry, enforcement does not run at all.- The re-ask names the missing events. The follow-up prompt now
asks the agent to emit blocks for exactly the missing event IDs
instead of the zero-block wording. Follow-up events are dispatched
normally (subject to
occurredfiltering). KnotEventsMissingcarries both sets. The variant gains amissing_eventsfield alongsideexpected_events(the old field now means the full expected set, not "what was missing"); the service log rendersexpected=…andmissing=….- One follow-up, then the gap stands. As before, one re-entry is
attempted; a follow-up that still leaves events unacknowledged
produces a second
KnotEventsMissingnaming the still-missing set. Processing completes regardless — missing events are a recorded outcome, not a failure. - No rig document format changes; no project document migration required.
v0.48.0 — 2026-09-12
Improved — Concise In-Session Retry Prompts (Plan 090)
A session-resume retry re-entering an existing pi session (--session-id) no
longer re-sends the full original prompt (profile persona + knot/strand
prompt + trigger line) plus the note. The re-entered session already holds
all of that; each of the up to 10 retries was re-sending it — pure token
overhead on every retry, and worst on exactly the attempts fired because
context ran out (post-compaction restart, water-mark handoff,
compaction-interrupt recovery), where the re-sent prompt could burn the
budget the compaction just saved and trigger a second compaction of a
context that was just shrunk.
- In-session retries are the note only. The retry prompt is exactly the
cause-specific note — the final-response request (default), the
inactivity restart note, the compaction restart note, or the water-mark
handoff note — with an empty profile prompt (the
inject_event_requestprecedent). Notes no longer accumulate across attempts: each retry is exactly its own note. - Fresh restarts are unchanged. The one retry that runs without a session ID (an inactivity stall before the session ID was captured) keeps the full composed prompt plus the note — a fresh process has no history, and the full prompt is the only copy of the task instructions.
- The
@strand-fileattachment stays on every attempt, so the agent can still re-read the original task file if a compaction summarised the original instructions away. - Bounds, budget math, events, and terminal-error classification are unchanged; no project document format changes (no rig-document migration required).
v0.47.0 — 2026-09-12
Feature — A Compaction No Longer Ends the Attempt (Plan 089, phases 8–13)
v0.46.0 recovered the overflow shape where pi's compaction died mid-turn.
The 2026-09-11 rig run showed the same family of failures coming from
proactive (threshold) compactions, and from three places Knot itself was
cutting them short. A compaction on that rig cost a lost turn, a re-prompt and
a second 30–47 s summarisation — or the whole attempt.
What changed — the run waits for the compaction, then asks for its answer:
- Settle-based teardown (pi-rpc) —
agent_endmeans the model's turn is over, not the prompt: pi still runs its post-agent compaction inside the same awaited prompt and emitsagent_settledafterwards. Knot now closes the child's stdin on the settle, falling back toagent_endonly after a short settle window with no compaction open.pi-rpcexits at stdin EOF, so the previousagent_end-immediately rule was itself killing pi mid-summarisation (fivethresholdinterruptions on the rig — Knot's own doing, not pi's). - In-session continuation — when a settled turn carries no text because a
compaction just completed, Knot sends one follow-up
prompton the live channel ("reply with your final answer now — do not start any new task") and takes the answer from the same process, logged asTurnContinued. The in-session sibling ofSessionRestarted: no new process, no re-sent strand, no second summarisation. Unanswered, the ordinary empty-response / session-resume path still applies, bounded by the existing liveness rules (no new timeout). - Interruptions for any reason — an unclosed compaction span
(
compaction_startwith nocompaction_end) is now an interruption whatever pi's reason was, so athresholddeath gets the v0.46.0 manual compact + session restart. With (1) in place Knot no longer stops the process it watches, which is what made the shape ambiguous before. - A compaction span counts as activity — pi writes nothing while it
summarises, so the span boundaries now stamp the inactivity watchdog and
the inactivity test stands down while a span is open. The total budget is
never suspended: a wedged compaction is still killed on the deadline and
reported as a
Timeout, which is what it was. Both stream runners share one span-tracking helper. - Observability —
CompactionStartedon a resumed attempt carries the session id from the first line (Knot seeds it from the--session-idit passed; the RPC stream has nosessionheader andget_statecan answer late, which is why the rig's rows printed an emptysession=); an empty response names the compaction it arrived in; and startup logs **RunAbandoned** once per queue entry restored from the previous service — a run that stopped mid-strand, re-run from scratch rather than resumed.
Operator-visible changes: threshold compactions no longer end an attempt;
TurnContinued and RunAbandoned appear in the service log and loom logs;
CompactionInterrupted can now name reason: threshold; AgentInactivity
cannot fire inside a compaction span. No document-format change — no migration
(knot-update: nothing to do when upgrading).
v0.46.0 — 2026-09-11
Feature — Interrupted Overflow Compaction: Manual-Compact + Session-Restart Recovery (Plan 089)
Plan 088 (v0.45.0) made compaction always-on and observable, but one overflow
shape was still classified as terminal even though it is resumable: the
in-process overflow compaction started but never reported completion
(compaction_start { reason: overflow } with no compaction_end, and no
terminal errorMessage). That is pi's overflow recovery dying mid-turn — a
process kill, an inactivity stall, or a stream gap — leaving the context still
over-full. Previously this fell into ContextLimitReached (terminal,
"context limit reached") and the strand failed even though the session was
still live and the context could be shrunk.
What changed — the shape is reclassified to a resumable CompactionInterrupted
and Knot recovers it with an out-of-band manual compact:
- Classification (pi-json / pi-rpc) — the overflow classifier now
distinguishes the interrupted shape (a
compaction_startwas observed and nocompaction_endcompleted the span, with no terminalerrorMessage) from the terminal shapes (recovered-then-failed, or attempted-but-could-not-fit). It yields a new resumablePortError::CompactionInterruptedthat carries the live session id and pi's reason — instead of the terminalContextLimitReached. Acompaction_endwith no matchingcompaction_startis a stray (not an interruption). - Manual compact (pi-rpc) — a new
AgentRunner::manual_compact(ctx, session_id, custom_instructions)re-opens the same session with--session <id>and sends acompactRPC (with a fixed operator note ascustomInstructions), bounded by the remaining budget. It returns aCompactionRecordon success andPortError::ManualCompactionFailedon timeout / error / abort. A manual compact is a first-class pi command that always emits acompaction_end(success or failure), so the interrupted span is closed and the context is actually reduced — the mid-turnagent_end-gated path that originally failed is bypassed entirely. - Recovery (session-resume usecase) — on a
CompactionInterrupted, the usecase runs one manual compact (bounded per failed execution), records the boundary events, and — on success — re-enters the session with a restart note ("your context was just compacted — continue from the compacted state"). If the explicit compact itself cannot reduce the context the run is terminal. A second interruption (if the re-entry overflows again) is left to the normal retry machinery. - New events (loom log + service log) —
CompactionInterrupted,ManualCompactionSucceeded(withtokens_before),ManualCompactionFailed(with the error), andSessionRestarted. The good shape in the service log:CompactionInterrupted→ManualCompactionSucceeded→SessionRestarted→ the strand continues. - Driver hold (pi-rpc) — an in-flight
compaction_startnow holds the teardown pastagent_end: the driver waits for the matchingcompaction_end(or a straycompaction_endis ignored) instead of tearing down mid-compaction, which is what cut the span short in the first place.
Operator note: the manual-compact customInstructions is a fixed operator
note (default) — it tells the compact to preserve the durable task state, open
work items, and checklist/state pointers so the next session continues without
re-deriving context. No new per-strand knob; the compaction.enabled escape
hatch is unchanged. See docs/concepts.md (Context Compaction) and
docs/troubleshooting.md (CompactionInterrupted).
v0.45.1 — 2026-09-11
Fix — Overflow Classification: "Compaction Attempted but Could Not Fit" vs. "Compaction Did Not Run"
Plan 088 (v0.45.0) added live compaction observation and always-on
compaction, but the overflow error message kept a misleading branch. When
an over-full context surfaced as a provider overflow error with an empty
final response, the message was chosen by terminal_overflow(...), which
only matches the recovered-then-failed shape (a failing overflow record
preceded by a successful one). Any other overflow failure fell through to a
hardcoded "pi auto-compaction did not run … enable compaction with
.pi/settings.json" message — even when compaction had actually run and
simply could not shrink the context.
Observed incident: a plan-author run whose single model output (~26.7k
tokens) pushed the context from ~123k straight past the 150k window in one
turn. pi's threshold compaction only runs between turns (at agent_end),
so it could not prevent the mid-turn overflow; the overflow recovery did
start (CompactionStarted reason=overflow) but its summarisation could not
reduce a near-window context below the limit. Knot's message wrongly told the
operator to "enable compaction," which was already on.
Fix — a single classifier
(PiJsonAgentRunner::classify_overflow_failure) replaces the old
terminal_overflow(...).or(...) fallthrough at both runner call sites
(pi-json and pi-rpc), distinguishing three shapes:
- Recovered, then failed (terminal) — unchanged: a failing overflow
record preceded by a successful one. Message is pi's recovery-failure
errorMessage(or a generic "cannot fit after compaction"). - Compaction attempted but could not fit — a provider overflow error
with an empty response and a compaction was attempted (a live
compaction_startwas observed, or acompaction_endrecord exists). Message: "pi attempted compaction (reason(s): …) but the context still cannot fit … Compaction is already enabled; lower the model'smaxTokens… or use a larger-context model." - Compaction never ran — a provider overflow error with an empty
response and no compaction event (compaction disabled in pi
settings). Message unchanged: "pi auto-compaction did not run … enable
compaction with
.pi/settings.json."
The distinction between 2 and 3 is observable because the live
compaction_start (and any compaction_end) are recorded in
compaction_starts / compactions even when the recovery produces no
successful compaction.
Root-cause note for operators (the rig-side fix): pi's threshold
compaction runs between turns, at a context of contextWindow − reserveTokens (default 150000 − 16384 = 133616). A single turn's output
(up to the model's maxTokens) added to a just-below-threshold context can
exceed the window — that is the incident. The invariant that prevents it is
reserveTokens ≥ maxTokens: then a max-size output from a
just-below-threshold context still lands under the window. The rig's model
had maxTokens: 32768 > reserveTokens: 16384, so the invariant was violated.
Fix: raise compaction.reserveTokens to ≥ the model's maxTokens (e.g.
32768), or lower the model's maxTokens to ≤ 16384, or use a
larger-context model.
No document or format change — profiles, knots and looms are unchanged; no migration required.
v0.45.0 — 2026-09-11
Extended — Compaction Assurance: Auto-Compaction Always On, Overflow Recovery Continues the Session (Plan 088)
Knot's context-overflow recovery (plan 079) relied on pi's built-in compact-and-continue, which pi settings alone control. Two gaps made that reliability invisible and fragile: compaction was off by default in the global pi settings (so legacy rigs ran overflow-unrecoverable, with only a startup warning), and a compaction's outcome was only visible after the fact — and only when it succeeded. v0.45.0 closes both: Knot now guarantees compaction is on for rig sessions, observes each compaction live as a span, and carries the session id across every re-entry.
- Startup self-heal (always-on compaction). At startup, before watcher
registration, Knot checks the effective pi compaction setting (project
.pi/settings.jsonover global~/.pi/agent/settings.json; pi's default is enabled). When it resolves to disabled (the global file explicitly saysfalsewith no project override — the shape of rigs initialised beforeknot-initseeded the project file), Knot merges{"compaction": {"enabled": true}}into the project file, preserving every existing key. The project file is Knot's own (knot-init seeds it; the service maintains it); the global file is the operator's and is never written. An explicit project-levelcompaction.enabled(true or false) is honoured — an explicitfalseis an operator opt-out and still raises the (now reason-annotated) plan 080 startup warning, as do an unparseable project file (never clobbered) and a write failure. - Live compaction spans. pi emits
compaction_start/compaction_endevents in the agent's JSON stream. Both runners (pi-json, pi-rpc) now observe these live (on the stream reader / driver line loop) and the session use case records the span boundaries as new loom events, each emitting a system event like the existingContextCompactedpattern:CompactionStarted— the span began:session_id,reason(pi's"threshold"/"overflow"/"manual"),attempt.ContextCompacted— the span ended successfully. Operator-facing context-pressure signal; shape unchanged (only the timing moved from after-the-invocation to live).ContextCompactionFailed— the span ended without success (pi'serrorMessage, or an aborted span):error,aborted, plus the same fields. Plan 079'serror.is_none()filter — which silently dropped failed compactions — is now a routing decision.ContextCompactedfires only on success (the success signal); the failed/aborted ends route toContextCompactionFailed.
- Continuity across re-entries. The session id is carried from the runner: when a final-response nudge (plan 078) or a session-resume retry re-enters a session, it re-enters the runner-captured session id from the invocation's stream — so a compaction observed mid-run never loses the session identity for the retry.
- RPC parity for overflow recovery. The
pi-rpcadapter now recordscompaction_endevents (reason,tokensBefore,errorMessage,willRetry,aborted) from its stream exactly aspi-jsondoes — including the terminal-overflow fail-fast (ContextLimitReached) — with mock-CLI tests covering the recovered (success) and terminal (fail-fast) streams. compaction_startsmetadata. Each runner's invocation metadata now carries the list ofcompaction_startreasons observed in the stream (the span begins are visible in the invocation record, not just the ends).
No migration required. The loom-log and service-log formats gain two
new line shapes (CompactionStarted, ContextCompactionFailed); existing
ContextCompacted lines are unchanged. No rig document or front-matter
format changed.
Service-log shapes added:
[KNOT][EVENT] CompactionStarted loom=<loom> knot=<knot> strand=<path> session=<id> reason=<reason> attempt=<n>
[KNOT][EVENT] ContextCompactionFailed loom=<loom> knot=<knot> strand=<path> session=<id> reason=<reason> error=<message> aborted=<bool> attempt=<n>
v0.44.1 — 2026-09-10
Fix — Continuation Background Accumulation Round-Trips Block Scalars (Plan 087, Phase 4)
The self-continuation chain's "accumulated, hop-labelled"
background-additional (v0.44.0 / plan 086) did not accumulate across
hops. Each continuation front-matter block-scalar collapsed to the literal
| marker, so the next hop's continuation carried an empty [hop N] label
and a bare-| ## Next Task Context — the prior hops' background and the
agent's newly-appended facts were both lost.
Root cause: the two front-matter readers are naive key: value
line-splitters with no YAML block-scalar (| / >) support.
tieoff_parser::parse_frontmatter (which parses the agent's ```markdown
tie-off into the event payload) and
strand_event_metadata::parse_yaml_frontmatter (which reads the prior
continuation file's front-matter to recover the incoming accumulation) both
recorded a key: | block scalar as the value "|" and dropped the indented
body. That broke both halves of the invariant — pass the incoming
accumulation through and append the agent's new input.
Fix (read-side only; the writer already emitted a correct block scalar):
tieoff_parser::parse_frontmatteris now block-scalar-aware (and public), operating on raw, indentation-preserving lines: onkey: |/key: >(optional+/-) it collects the following indented body, de-indents by the common leading whitespace, and joins with newlines.parse_event_blockpasses raw front-matter lines (previously it pre-trimmed every line, destroying the body's indentation).parse_yaml_frontmatterdelegates to the shared parser, so a continuation file'sbackground-additional: |round-trips.
No document or format change — the on-disk continuation front-matter is unchanged. No migration required. One behaviour note: a top-level key with a leading space is no longer parsed as a key (top-level keys are column-0; indented lines are block-scalar bodies); Knot-written files are always column-0, so this never bites in practice.
v0.44.0 — 2026-09-10
Extended — Self-Continuation for Event-Source Knots + Queue-Wait-Exempt Budget (Plan 087)
Plan 086's self-continuation — a task-loop knot resuming a bounded task
chain after its context water-mark, delivered into its own existing input —
was scoped to filesystem-strand knots. v1 left event-source knots
(strand-dir: event:<producer>:<EventId>) out: their continuation was never
written, so the batch paused with work remaining (re-entry fell back to the
explicit event chain or the overflow safety net). v0.44.0 completes the chain
for event-source knots and refines 086's budget model so a lengthy event
queued between a handoff and the continuation's dequeue no longer erodes the
continuation's budget.
- Event-source knots now self-continue. A continuation is delivered into
the knot's existing input — its event dispatch dir
(
tie-offs/<rig>/<loom>/<event-id>/) — the same dir the knot's existing watcher already watches, bound to(loom, knot). The watcher firesStrandEvent::Createdfor that knot, so the batch re-enters through the normal dispatch pipeline. No new subscription, no new queue, no secondstrand-source. Filesystem-strand behaviour is unchanged (the continuation still lands in the knot's own strand dir). - Queue-wait-exempt batch execution budget. 0.43.0 stamped an absolute
batch-deadline-epochand, at dequeue, subtracted elapsed wall-clock (remaining = deadline − now) — so a lengthy event queued between the handoff and the continuation's dequeue stole budget the knot never used. The continuation front-matter now carries the remaining execution budget in seconds (budget-secs) plus the batch's absolute origin (batch-start-epoch). Only execution decrements the budget (budget-secs = incoming − execution_secs, whereexecution_secsis the hop's wall-clock dequeue→handoff span); queue wait never does. The whole batch — all hops, including the first — shares one total execution budget ofprofile_timeout, and the budget is never reset at a handoff ("fresh context, never a fresh budget"). - Honest observability. The
TasksIncompleteloom event and the[task-loop] handoffservice-log line now record the stamped remaining budget (remaining=<B>s) and the delivery path (source=filesystem|event), and are emitted only when the hop actually happens: on the max-continuations cap or an exhausted budget the continuation is suppressed and aBatchIncompleteis recorded instead, so the log never claims a hop that did not happen. - Durable + replayable. The continuation is written to disk before the per-turn project commit, so it is captured in the project's git commit (the rig repo stays source-only) — replay the batch hop by hop by navigating the project's commits.
Compatibility: a continuation file written by a 0.43.0 (086) build
carries only batch-deadline-epoch; the 0.44.0 reader derives its budget
from the deadline at read time (a one-time read-only shim). New
continuations never write batch-deadline-epoch; the shim is removed after
one release.
v0.43.0 — 2026-09-08
New Capability — Graceful Task Handoff: Checkpointed Continuation Chains (Plan 086)
A task-loop knot that outgrows a single context window used to either
overflow (losing uncommitted work) or re-derive its scope from scratch on
every re-dispatch. Plan 086 lets such a knot work through a durable,
rig-owned checklist across a chain of bounded sessions: it hands off
gracefully when its context water-mark is crossed and a fresh session
resumes from the checklist — so a long batch completes across as many
hops as it needs, each hop starting from the on-disk state.
TasksIncompleteself-continuation — a new loom event a knot acknowledges in its own tie-off. Whenctx-wrap-up-limitis set on the alias and the agent is steered at the water-mark, it commits in-flight work, updates the checklist, and emits a fencedmarkdownblock withevent: TasksIncomplete.occurred: true(withnext-task-context— the operational resume brief — andbackground-additional— thin persistent facts) dispatches a continuation: the same knot re-run in a fresh session that resumes from the checklist.occurred: falseis the explicit “batch complete” declaration that ends the chain.- The chain obeys the original clock. A continuation never resets the
timer: its
profile_timeoutis derived from thebatch-deadline-epochstamped on its event, so the whole chain shares the first session’s budget (“fresh context, never a fresh budget”). TheMAX_CONTINUATIONScap (10) and the deadline bound the chain; hitting either records a terminalBatchIncompleteloom event (reason: "caps"orreason: "deadline") and drains the queue. - Knot stays task-blind. It neither owns nor parses the checklist — its
format, location, and authorship are the rig designer’s. The
agent-emitted
TasksIncompleteis the only task-specific seam, and its body is a pointer block to durable state (the checklist + committed files), never a re-statement of context. - The contract is delivered at the water-mark, not the base prompt. The
TasksIncompletedescription is no longer injected into every base prompt for a water-marked alias — thatSubscriber Eventsblock was ~900 tokens of the base context and shrank the working headroom that decides how much real work fits before the steer. It now rides in the self-contained wrap-up steer, which also specifies theevent:front-matter field the tie-off parser requires (the old base prompt carried it via the generic “Event Format” example). Regular subscriber events still inject at the start. - Two adapters, one seam. The water-mark steer — and hence the handoff —
is
pi-rpconly; onpi-json/claudethe existing overflow/timeout terminal handling re-dispatches the idempotent knot, which resumes from the checklist. - Fixes from rig testing. (a) the
pi-rpcadapter no longer passes the strand as a@{path}CLI arg (pi RPC mode rejects it) — the strand content is injected through the stdin prompt instead; (b) the tie-off parser recovers a fencedmarkdownblock left open at EOF, so a correctly front-matter-delimited handoff is not dropped when a model omits the closing fence.
Tests — unit tests cover continuation dispatch (deadline-derived
timeout, cap, occurred filtering), the self-contained steer contract
(HANDOFF_NOTE carries the event: field), and the unclosed-fence
recovery. Verified empirically on a pi-rpc rig: a 6-item checklist batch
completes across a water-mark-driven continuation chain, ending in an
occurred: false “batch complete” declaration. The full suite passes.
v0.42.0 — 2026-09-07
New Capability — pi-rpc Runner + Context Wrap-Up Steering (Plan 084)
A long agent run that exhausts its context window today dies mid-task,
leaving an uncommitted working tree and a session that cannot be
resumed. This release adds an opt-in pi-rpc agent runner that watches
the live context usage and steers the session to wrap up before it
runs out, so context exhaustion ends in a clean handoff.
pi-rpcadapter — a newadapter: pi-rpcvalue (thepi-jsonrunner is unchanged and remains the default). The adapter launchespi --mode rpc(JSONL command protocol over stdin/stdout), sends the initialprompt, and reads pi's stdout line-by-line. On everyturn_endit samplesget_session_stats— always capturing usage for observability (parity withpi-json) and, when actx-wrap-up-limitis set, using the sample as the steer decision point.- Context wrap-up steering — a new per-model-alias config key
ctx-wrap-up-limit(tokens) inrig/models.yml. When the sampled context tokens cross the limit, the adapter sends onesteer(the wrap-up prompt) at the next turn boundary — telling the agent to stop starting new work, commit all complete work, update its progress, note what is incomplete and where it left off, and produce its final tie-off. The steer fires once per run, regardless of whether pi's own auto-compaction is enabled (the steer is the remedy either way). A single-run warning is emitted (stderr) when the limit sits within pi's default reserve of the context window, where pi may compact before the limit is reached. ContextWrapUpSteeredevent — a one-shot loom event (loom-log) recording the steer:loom_id,knot_id,strand_path,session_id,context_tokens,limit,attempt. Rendered in the service log, serde round-tripped, and logged from the session-resume Ok path via the newWrapUpRecordinAgentInvocationMetadata.- Config resolution —
ctx-wrap-up-limitresolves throughModelRef/AgentConfig; a value of0filters toNone(disables steering), so the default is off. Direct model specs (no alias) have noctx-wrap-up-limit. - Tests — the unit tests drive the real adapter end-to-end against
a mock
pibinary (with_cli_path), covering success (response, session-id, and usage captured from theagent_endframe), steer-fires-once-when-crossed, no-steer-below-limit, and steer-despite-disabled-compaction. All 1332 tests pass.
Deferred next change: pi-json removal (the plan's final
migration, done after pi-rpc has proven itself in rig service).
v0.41.1 — 2026-09-07
Quality of Life — Event-Parse Log Flags + Root-Anchored Rig .gitignore (Plan 085)
Two small operational defects surfaced during rig runs. Both are fixed in this patch — no rig-document changes, no behavioural change to dispatch or processing.
- Event-parse line shows the
occurredflag. When Knot extracts structured agent events from a completed tie-off, the console diagnostic now renders each event with its status —event parse (knot=author): 2 event(s) found — PlanCreated=true, SpecReviewed=false— instead of a bare id list that hid which events actually fired (true, dispatched to consumers) versus acknowledgements (false, counted for enforcement, never dispatched). Stderr diagnostics only; the dispatch filter onoccurredis unchanged. - Rig exclusion is root-anchored. The
.gitignoreentry Knot appends to the parent repo is now/{basename}/(e.g./rig/) instead of the unanchoredrig/. Git matches a slash-less pattern at any depth, so the old entry silently also ignoredtie-offs/rig/— the project-versioned runtime data (tie-offs, service log, event queue,state.json). The anchored entry matches only the top-level rig directory. - Force-migration of existing entries. On the first 0.41.1+ start,
ensure_rig_repo()rewrites any pre-existing bare{basename}/line to/{basename}/in place — the marker and every other line (including user-authored entries) are preserved verbatim. An already anchored line short-circuits to a no-op, so the migration is one-time and idempotent. The tracked-by-parent guard is unchanged (untracking remains a user decision); the logged untrack command now readsgit rm -r --cached /rig/. - Tests — the three existing
ensure_rig_repoentry tests now assert the anchored form, and two new tests pin the migration: a pre-0.41.1 file (marker + barerig/+ user line) converges to the anchored form with no duplicate and a no-op second run, and an already-anchored file is left byte-identical.
v0.41.0 — 2026-09-07
Feature — Consolidated Service Log + Change-Driven State Writes (Plan 083)
Observability ran on three moving parts: the per-loom .loom-log JSONL
file, the rig-level .rig-log JSONL file, and state.json — rewritten
on a 5-second tick whether or not anything had changed (so its mtime
churned and updated_at lied about when the state last moved). Plan
083 collapses the two log files into the one log the service already
had — its stderr — and stops the no-op state.json writes.
- One line per record on stderr — every domain event (loom
lifecycle, strand processing, timeouts,
SessionResumed,QueueIdle, …) renders as a single-line[2026-09-07T15:35:57+10:00] [KNOT][EVENT] KnotCompleted loom=… knot=… strand=… tie-off=…record: one emit-time timestamp, the event's fields askey=valuepairs (only the fields that variant carries — notimestamp=field, no"null"), one physical line (no embedded newlines). Everystate.jsonwrite renders the same way:[KNOT][STATE] initial snapshot looms=N knots=N profiles=N queue=Nat startup, thenchangedeltas naming exactly what moved (loom/knot/ profile add/remove, knot/profile field changes, queue add/drain). - In-memory run activity —
.loom-logand.rig-logare gone: run events live in a per-processRunActivity(the in-memory adapters own the[EVENT]emit). The existing query use cases (GetLoomActivity,KnotStatus) keep working over the same log ports, now backed by the current run instead of a file. Nothing is cleared at startup anymore — the Plan 072 truncation mechanism is removed, and legacy log files a 0.31.0 migration may have moved are inert (never read, written, or appended to; safe to delete). - Change-driven
state.jsonwrites — the state writer diffs the freshly derived state against the last written state (ignoringupdated_at, which is the only field that ever differs between identical snapshots). Identical content and an existing file → no write, no mtime churn, no log line. A real change or a missing file (fresh rig) → write, plus the[KNOT][STATE]delta line.state.jsonkeeps its schema;updated_atnow means last actual change, and between changes the file stays byte-identical (operators can watch its mtime and know the rig is idle). - Durable records unchanged — the tie-off files remain the audit
record of completed work, and
knot-service.log(appended by theknot-startskill, which appends the service stderr) remains the durable operational record across restarts. Starting Knot foreground with plaincargo runstill works — you just watch stderr. - Tests — every retired-log assertion was converted (no vacuous
passes): binary-level
tests/consolidated_log.rspins the[EVENT]run sequence, the absence of.rig-log/.loom-log, the baseline + change-drivenstate.jsonbehaviour (idle ticks cause no write), burst-2-strandqueue+/queue-deltas, andknot stepbaseline + delta lines; in-process suites assert on the durable surfaces (state.json, tie-off sections, event-queue files) instead of the retired files; the legacy-layout migration test now proves the migrated logs survive byte-identical and inert.
Feature — System Event Subscriptions: Every Log Event Is Dispatchable (Plan 082)
A knot could only react to the events its peer agents chose to emit —
the system events Knot itself records (a run failed, timed out, went
idle, a loom stopped) were invisible to other knots. Plan 082 makes
every system event Knot writes to the loom-log / rig-log also
dispatchable to subscriber knots, through the existing event:
strand-dir URI — so you can react to knot outcomes, not just to
agent-emitted events.
- Open, not curated. Instead of a fixed 8-event allow-list, the
vocabulary is the existing
LoomEvent/RigLogEventvariant names — a new log-event variant is subscribable the day it lands. Run outcome (KnotProcessing,KnotFailed,KnotCompleted,KnotEventsMissing,TimeoutExceeded,StrandIgnored,StrandSkipped,StrandProcessed), retry/session (SessionResumed,KnotEmptyResponse,AgentInactivity,ContextCompacted), loom/knot lifecycle (LoomStarted,LoomStopped,KnotRegistered,KnotDeregistered,KnotParseWarning,DirectoryCreated), and rig lifecycle (QueueIdle).EventsDispatchedis intentionally excluded. - Two new producer-token positions. On top of the existing
knot-level (
event:<knot>:<EventId>) and loom-level (event:<loom>:<EventId>) subscriptions:- Wildcard
event:*:<EventId>— match any knot in the rig (the "react to any knot that fails" monitor:event:*:KnotFailed). - Rig-level
event:<rig-id>:<EventId>— a rig-scoped event (currentlyQueueIdle), using the rig's ID as the producer token.
- Wildcard
- Self-exclusion. A system event is never dispatched back to the
knot that produced it — a knot's own
KnotFailed/KnotCompleteddoes not re-trigger itself. This is automatic and applies to system events only (a knot may still deliberately subscribe to its own agent-emitted events). - Per-attempt fan-out. Retry events (
SessionResumed,KnotEmptyResponse,AgentInactivity,ContextCompacted) fire once per attempt, not per run — a retried run fires a per-attempt consumer multiple times. Subscribers must be idempotent under re-delivery (standard knot discipline). - Emission is best-effort and non-fatal. A failed dispatch never changes a run's outcome or blocks the pipeline (parity with agent-event dispatch); it surfaces on the console.
- Additive — no migration. Existing looms and agent-event
subscriptions are untouched. New subscribers simply set
strand-dirtoevent:<producer>:<SystemEventId>(producer = knot ID, loom ID,*, or the rig ID forQueueIdle). - Tests — domain resolvers (pure), the emitter against a mock
dispatcher + in-memory store (all scopes, producer tokens,
wildcard/rig-level, self-exclusion, singleton-vs-batch seq), and
mock-CLI harness end-to-end acceptance (
tests/system_event_subscriptions.rs): failure → wildcardKnotFailedconsumer runs, success → specific-producerKnotCompletedconsumer runs, self-exclusion, and timeout →TimeoutExceededconsumer + rig-log entry (077/081 no-failed-tie-off contract asserted alongside). The 056/058/059/070 agent-event suites are untouched and green.
v0.40.0 — 2026-09-03
Feature — Inactivity Timeout: Kill Blocked Sessions, Restart with a Blocking-Call Note (Plan 081)
Knot's only timeout before this was a total wall-clock budget — it measures total work, not stall. A session hung on an external call (deadlocked process, command waiting on stdin, stalled provider) stays alive but silent, and the rig sat until the budget ran out — potentially tens of minutes on a profile with a large timeout — before the restart it triggered carried a nudge that never told the agent why it was stopped. The inverse also bit: a healthy session doing many quick tool calls could be killed by the budget even though nothing was stuck.
- Inactivity watchdog — a rig-global
inactivity-timeout-seconds(rig/.workspace-agent-config.yaml, default 300,0disables; loaded at startup — restart Knot after editing). Detection is byte-level: any byte on the child's stdout/stderr resets the timer. A healthy long-running command keeps emitting (pi streams tool output, throttled at 100 ms), so it never trips the watchdog; a hung command or a stalled provider goes quiet and is killed at the window. The two timers are orthogonal: inactivity bounds silence, the profile's total budget bounds work. - Cause-accurate error + restart note — the kill produces
PortError::AgentInactivity(resumable; the one error that may retry without a session ID — a fresh restart is safe because knots are idempotent). The session-resume loop re-enters the same session (--session-idwhen one was captured, fresh otherwise) and appends a cause-specific note instead of the generic final-response request: "Your last call blocked for more than{N}seconds with no output, so your previous turn was stopped. If you have a long-running task, ensure it emits a progress update at least once within the{window}-second window (e.g. run it in the background and poll its output, or stream the output). Continue from where you left off and produce your final response when done.” - Blocked-call identification — under
pi-json, the accumulated stream is scanned after a kill and the lasttool_execution_startwith no matching end is named in the error and the loom-log entry (e.g.bash("npm run build")). Best-effort — the note works without it. - Loom-log observability — each stall is recorded as an
AgentInactivityloom entry: attempt, silent seconds, window, session ID (empty when none was captured), blocked call. Story on success:KnotProcessing → AgentInactivity → SessionResumed → KnotCompleted → StrandProcessed; on exhaustion:… → AgentInactivity → KnotFailed → StrandProcessed(error)with aTimeoutExceededrig-log entry and no tie-off write — the same outcome family as a total timeout (a deadline did fire, and the tie-off is agent output, which a stalled session never produced). - Default adapter for new rigs is now
pi-json— the compiled default flips frompi-stdiotopi-json, so fresh rigs get session IDs, token usage, and inactivity restart with blocked-call identification. Existing rigs are unaffected: an explicitagent-adapterin.workspace-agent-config.yamlwins over the default. Underpi-stdio, inactivity detection still works, but restarts after a stall are fresh sessions (no--session-id) and the blocked call is not named. - Total-timeout semantics unchanged — the profile
timeoutbudget, the per-attempt deadline, the retry bounds (10 retries, 10-second delay, 5-second minimum remaining), and theTimeoutExceededrig-log behaviour are all as before. When both deadlines elapse, inactivity wins — it is the more specific diagnosis.
No change to profile, knot, loom, tie-off, or event formats. The new
loom-log event variant degrades gracefully: older binaries skip an
AgentInactivity line with a warning, and 0.40.0 reads old logs
unchanged. No rig-document migration required —
inactivity-timeout-seconds is an additive config key; old files
parse with the 300 default.
v0.38.0 — 2026-08-26
Feature — Context Overflow: Compact and Continue, with Loom-Log Visibility (Plan 079)
When a knot's pi session hits the model's context limit, Knot no longer burns all 10 session-resume retries against the same over-full context — each re-entry overflowed again, and every retry clocked up against the budget. Instead, pi's own built-in compaction handles the overflow in-process (compact-and-continue), Knot makes every compaction visible, and a terminal overflow fails fast.
- Compaction enabled for rig sessions — a project-level
.pi/settings.json({"compaction": {"enabled": true}}) overrides the global setting; it applies only to rig sessions in that directory (knot spawns pi inheriting the rig project's CWD).knot-initseeds the file at rig initialisation (create-if-absent, never overwrites an existing settings file). With compaction on, pi proactively compacts before the hard limit (16k reserved by default) and, when the model rejects an over-full context, compacts and auto-retries the prompt in-process — recovery is once per user message, so every session-resume re-entry gets a fresh recovery chance. ContextCompactedloom-log entries — one entry per successful compaction observed in an invocation's JSON stream:reason("overflow"= the context limit was hit — the entries to count when narrowing prompt scope;"threshold"= proactive),tokens_before(pre-compaction size),session_id, andattempt(1 = first attempt, 2 = first retry). The entries mark context pressure so the prompt and strand scope can be narrowed; the append is best-effort — observability never fails a strand.ContextLimitReachedfail-fast — when the stream shows a terminal overflow (recovery ran —willRetry: true— and the context still does not fit —willRetry: false), the strand fails immediately withcontext limit reached: …(pi's message when present). The error is not resumable: no session-resume retries, no clock-up, aFailedtie-off with the message, and no rig-log timeout (no deadline was exceeded — the same class as plan 077). A compaction that failed without ever running (missing model/auth, transient summarisation error) is not fail-fast: the nudge loop keeps its job, and the new user message gives pi a fresh recovery attempt.- No new budget mechanism — compaction happens inside pi within
the existing per-attempt timeout and the retry loop's
MIN_REMAINING_SECSbail; the profile timeout still caps strand wall time.
No change to profile, knot, loom, tie-off, or event formats. The new
loom-log event variant degrades gracefully: older binaries skip a
ContextCompacted line with a warning, and 0.38.0 reads old logs
unchanged. No rig-document migration required.
v0.37.2 — 2026-08-26
Feature — Final-Response Request on Abrupt Turn-End (Plan 078)
When a pi session ends its turn abruptly — exit code 0 but no final
response (plan 077's scenario) — and a session ID was captured, Knot
no longer gives up: it re-enters the same session (--session-id)
and requests the tie-off, re-sending the original prompt with the
final-response request appended — “Please produce your final response,
or continue if you have not finished.” — one nudge for all session
resumes (“continue if you have not finished” covers the mid-stream
case; “produce your final response” covers the abrupt-stop case).
- Transparent recovery — a non-empty follow-up response is the
tie-off: normal
Producedpath (tie-off section,KnotCompleted, event dispatch, late removal, git commit). The strand succeeds as if the first attempt had worked. The loom-log tells the whole story with existing events:KnotProcessing→KnotEmptyResponse(1)→SessionResumed(1)→KnotCompleted(nudge worked) orKnotFailed(exhausted). - Bounded by the existing loop — up to 10 retries with 10-second
delays, and the profile's overall timeout budget still bounds timed
profiles (
MIN_REMAINING_SECS = 5sbail; the budget, not the retry cap, is the primary bound for timed profiles). - Cause-accurate exhaustion errors — when retries or the budget run
out, the terminal error reflects the last failure: exhausted empty
responses →
no final response: agent returned empty response after 11 attempts (session resume exhausted)(failed tie-off, no rig-log entry); a genuine timeout as the last failure →Timeout(TimeoutSkipped, rig-logTimeoutExceeded); budget bail-out →Timeoutas before (overall timeout budget exhausted after N attempt(s)). - No session ID → no re-entry — stdio adapter or unparseable
output: the 077 terminal failure stands after the first attempt
(
no session id — cannot request final response). - Composes with event enforcement (059) — a nudged response flows
through the normal success path, including the
KnotEventsMissingfollow-up if events were expected but still missing.
No change to event enforcement, mid-stream retry gating, adapters, or document formats. No rig-document migration required.
v0.37.1 — 2026-08-26
Fix — Empty Response Is Not a Timeout (Plan 077)
When a pi session ends its turn abruptly — exit code 0 but no final
response (e.g. agent_end carries only intermediate toolUse
messages, or the provider stopped generating) — Knot previously
reported a timeout: a spurious rig-log TimeoutExceeded event and
no tie-off record, with the work silently lost.
An empty response is now its own error
(no final response: agent returned empty response), semantically
distinct from a deadline breach:
- Failed tie-off written — the tie-off file gains a
failedsection (Processing failed: no final response: …), so the terminal state is visible in the tie-off and in state (knot status failed) instead of a skipped write. - No spurious rig-log entry —
TimeoutExceedednow strictly means "the agent session exceeded the profile timeout"; an abrupt turn-end does not touch the rig-log. - Loom-log —
KnotProcessing,KnotEmptyResponse,KnotFailed(error carriesno final response: …),StrandProcessed. - Genuine timeouts unchanged — the adapter's SIGKILL timeout and
the retry loop's overall budget exhaustion remain
TimeoutExceededrig-log events.
No retry or session re-entry yet — plan 078 builds on the new error variant to make the situation recoverable. No document or format change. No migration required.
v0.37.0 — 2026-08-25
Fix — Queue Entry Identity Self-Heal: Filename Is the Event ID (Plan 075)
The filename stem of a queued event file (tie-offs/<rig>/events/{id}.json)
is now the queue entry's identity, and the queue self-heals when a
file's JSON id drifts from its name:
- Self-heal on scan — on every scan, a file whose JSON
iddiffers from its filename stem is repaired in place (atomic temp→rename rewrite withid := stem) and one warning is logged to the service log per repaired file:[queue]repaired event file{name}: id{old}->{stem}(filename is the queue identity). The repair is idempotent — after the first scan that touches the file, name == id and no further rewrites occur.queued_at` and all other fields are preserved. - Renaming reorders the FIFO (now supported) — FIFO order is
filename sort, so renaming a queued event's file (e.g. to an earlier
{timestamp}-{rand}name) moves it within the queue. This is the supported way to front a queued event (e.g. a manual rectify); the queue repairs the internal id on the next scan. - No more silent wedges or panics — a head that vanishes between
scan and read (concurrent late-removal or
knot step) is logged with the file name ([queue] head {name}.json vanished before read (concurrent removal?)) and handled gracefully:front()returnsNone,pop()rescans once and retries instead of panicking.
This closes the 2026-08-25 borrow-my-stuff incident class: a renamed
queue file previously made the head unresolvable (front() swallowed
the read failure and returned None — the rig went idle with a
non-empty queue and no log line), a restart duplicated the event, and
late removal orphaned the renamed file. All three paths are now pinned
by unit tests and full-composition incident-reproduction tests
(tests/queue_identity.rs).
No document or format change. The queue file schema is unchanged; queues containing renamed or hand-edited event files self-heal on the first scan of the new binary. No migration required.
Fix — Consumer Persistent Wake: No Lost Queue Notifications (Plan 076)
The event-queue wake is now persistent by construction:
- Armed-at-call
notified()—StrandEventQueue::notified()registers itstokio::sync::Notifypermit at call time (armed, not lazy), and the contract is documented on the port: a signal sent after the call is guaranteed to wake an await of the returned future, even if the await has not started. - Arm-before-check consumer loops — the service loop (
next_event) andknot step's head wait create the armed wait before re-checkingfront(): a push before the arm is visible to the fresh disk scan, a push after the arm is captured by the permit. A front hit or a timeout drops the armed future (harmless); the next iteration re-arms.
The wake guarantee: a queued event always wakes the processor; the
only empty-queue state is a genuinely empty events/ directory.
Internal change, no document change. Notably, the pinned tokio
1.52.3 already stores a notify_one permit when no waiter is
registered (verified in the tokio source and by running the new tests
against the pre-fix code — all pass), so no wake was being lost in the
field on this tokio version: this release removes that latent
dependency and makes the guarantee explicit in Knot's own code,
pinned by unit tests, independent of tokio version details. No
migration required.
v0.36.0 — 2026-08-24
Feature — Thinking Level: Alias Default with Profile Override (Plan 074)
Profiles and model-registry aliases can now set a reasoning effort — a
thinking level — for the pi invocation. Two new optional
fields, both named thinking-level (values: off | minimal | low | medium | high | xhigh):
# rig/models.yml — per-alias default
models:
frontier:
provider: anthropic
model: claude-sonnet-4-20250514
thinking-level: high
# rig/profiles/analyst.md — profile override wins
---
name: analyst
model-ref: frontier
thinking-level: xhigh
---
- Resolution (effective level): a
model-refprofile resolves to its ownthinking-level, else the alias's; a direct-spec profile (provider+model) uses its own value only — the registry is not consulted. - CLI emission: the effective level is emitted as
--thinking <level>on the pi invocation (after--model, before--tools) — for every effective value, including an explicitoff, which forces off and overrides pi's settings default. Omitting the field emits no flag at all — pi's own settings default applies. Absence is notoff. - State:
tie-offs/<rig>/state.jsonprofile entries gain an optionalthinking-levelshowing the effective level; the key is omitted (nevernull) when neither sets one. - Validation is lexical only — pi clamps levels to model
capability (non-reasoning models run
off;xhighis honoured only where supported). Invalid values are rejected at file-parse time: registry → warning + empty registry (never blocks processing); profile → hard parse error (InvalidThinkingLevel).
No document migration: both fields are optional — existing
models.yml files and profile files parse unchanged, and without a
thinking-level anywhere the pi invocation is byte-identical to
before (no --thinking flag). The knot-update skill carries the
0.36.0 changelog entry with adoption steps.
Skills and Docs Updated
knot-create(v5.7.0) — profile frontmatter table + models.yml section + override example; state.json example carries the keyknot-inspect(v3.6.0, compat 0.36.0+) — profile listing shows the effectivethinking-level(absent key shown asdefault, mirroring thetimeoutconvention)knot-init(v4.3.0) — models.yml seeding note for the optional per-alias defaultknot-update(v1.12.0, compat 0.36.0+) — 0.36.0 changelog entry (field additions, effective-level resolution, off-vs-omission asymmetry; migration: none required)src/server.rs— auto-createdmodels.ymltemplate documents the new key- Design reference:
project/design/design-thinking-level.md(resolution hierarchy, CLI emission, off-vs-omission asymmetry, lexical-only validation rationale, backward compatibility)
v0.35.0 — 2026-08-23
Feature — knot step: Single-Event Stepping (Plan 073)
knot step processes exactly one queued event and exits — the
manual trigger/observation tool for watching a cycle unfold, inspecting
rig state between events, and debugging a misbehaving knot without
letting the service drain the queue back-to-back.
knot step [--rig <rig-name>] [--event <event-filename>]
--eventtargets a specific queued event (exact id,.jsonoptional; unique id prefix; or strand filename — no match lists the queue on stderr and exits 1); without it the FIFO head is processed.- Empty queue →
queue empty, exit 0. Exit 1 on unknown/ambiguous event, no rigs, multiple rigs, or processing failure. - A step runs the full service startup (migration, config seeding,
rig git init, discovery, watchers, debounce engine, state writer),
executes the single event, and shuts down with the service-identical
cascade. Events dispatched during the step are captured into
tie-offs/<rig>/events/but not executed. - Logs are not cleared in step mode — a multi-step session accumulates in the loom-logs/rig-log. (Service startups still clear them; see v0.34.0.)
- Step rig discovery is stricter than the service: zero
*-rigmatches is an error (no implicitrig/creation). - Use
knot stepwhen the service is not running — two processes sharing the disk queue can double-read the same event (safe by knot idempotency, but wasteful).
Queue Semantics — Late Removal (At-Least-Once)
The queued event file is no longer removed when the event is popped for processing — it is removed after the work is done:
- On success — as the last step before the git commit (dispatch, tie-off append, loom-log entries, and event enforcement all happen first; the commit captures everything, including the removal).
- On failure/skip — at the point of failure (consume-on-failure — no poison-pill retry loops).
The only window in which an event survives a crash is while its
processing is in flight: a restart re-queues it and the knot re-runs
(safe by knot idempotency). Previously a crash during a long agent run
lost the event silently. The service loop now peeks (front()) instead
of popping; the CLI parsing is a pure unit-tested parse_args
function. No new dependencies.
No document migration: pending events from older versions read
identically (the events/*.json schema is unchanged). The knot-update
skill carries the 0.35.0 changelog entry.
Skills and Docs Updated
knot-dispatch(v1.3.0) — new Stepping:knot stepsection (flags, event resolution, empty-queue behaviour, exit codes, what a step does, direct queue write, agent workflow); stale pop-removal and debounce-window wording correctedknot-update(v1.11.0) — 0.35.0 changelog entry (no migration required; queue files from older versions read identically)knot-manage(v1.2.0),knot-analyst(v1.4.0),knot-init(v4.2.0) glossary — queue-removal wording corrected to late removaldocs/concepts.md— new Event Queue section (at-least-once semantics,knot step)- PRD
prd-persistent-events.md— popped-removal goal revised to late removal; new Story 6 (manual stepping via the CLI) - Design reference:
project/design/design-knot-step.md(late-removal ordering contract, crash windows, the step lifecycle, rejected minimal-startup alternative)
v0.34.0 — 2026-08-23
Per-Run Logs — Loom-Logs and Rig-Log Cleared at Startup (Plan 072)
The operational logs are now per-run. On every startup — after
legacy-layout migration, before loom discovery — Knot truncates the
rig-log (tie-offs/<rig>/.rig-log) and every
tie-offs/<rig>/<loom-id>/.loom-log, including orphaned loom dirs
whose loom no longer exists in the rig. Each log always contains
exactly the events of the current run: it starts with the fresh
KnotRegistered/LoomStarted events and ends with LoomStopped at
shutdown.
Why: the logs exist for current-run observability (event-watching
knots, knot-inspect/knot-analyst). The durable audit history lives
in the git-versioned tie-off files. Previously, stale unparseable lines
re-fired a WARN: skip on every 5-second state write and every query
— forever — and the logs grew unbounded with residue nothing consumes.
| Artifact | Before | 0.34.0+ |
|---|---|---|
.rig-log, */.loom-log | accumulated across runs | truncated at every startup |
Tie-off files, state.json, events/, dispatch dirs | unchanged | unchanged |
Non-fatal: a failed clear logs a WARNING: and startup proceeds.
Only log files are touched — nothing else is deleted or modified.
No document format changes: profiles, knots, looms, and tie-offs
are unaffected. On the first run of 0.34.0, all earlier runs'
.rig-log/.loom-log content is discarded — intentional (tie-offs
retain the history).
Skills and Docs Updated
knot-update(v1.10.0) — 0.34.0 changelog entry (no migration required; first run discards earlier runs' log content)knot-inspect(v3.5.0),knot-analyst(v1.3.0) — log descriptions annotated per-run scope; analyst failure counting now "since the last startup"docs/concepts.md— Logs section rewritten for per-run semantics- Design reference:
project/design/design-startup-log-clear.md(startup sequence, ordering invariants, what the clear touches)
v0.31.0 — 2026-08-17
Breaking — Rig/Project Repository Split (Plan 068)
The rig no longer holds any runtime data. The runtime tree — tie-off
directories, loom-logs, the event queue, the rig-log, and the state
snapshot — moves from rig/ to tie-offs/<rig-basename>/ in the
project root (default rig: tie-offs/rig/).
| Path | Before | After |
|---|---|---|
| State snapshot | rig/state.json | tie-offs/<rig>/state.json |
| Tie-off files | rig/tie-offs/{loom-id}/… | tie-offs/<rig>/{loom-id}/… |
| Loom-log | rig/tie-offs/{loom-id}/.loom-log | tie-offs/<rig>/{loom-id}/.loom-log |
| Event dispatch dirs | rig/tie-offs/{loom-id}/{EventId}/ | tie-offs/<rig>/{loom-id}/{EventId}/ |
| Event queue | rig/events/ | tie-offs/<rig>/events/ |
| Rig-log | rig/.rig-log | tie-offs/<rig>/.rig-log |
Rig repository: Knot initialises rig/.git at startup (idempotent).
The rig tracks exactly its source (looms, knots, profiles, config) and
is committed manually by the user. When the project root is inside a
git repo, Knot appends a marked rig/ line to the project's
.gitignore, and the git versioner unstages rig/ before every commit
so the rig can never leak into a project commit (gitlink or tracked
leftovers).
Auto-migration: on first 0.31.0 startup, legacy runtime files are
moved automatically ([startup] migrated … notice). Idempotent;
destination-exists conflicts keep the destination and warn.
Pre-existing projects (manual step): if rig/ was already tracked
by the project git, run the one-time
git rm -r --cached rig/ + commit to untrack it. Knot logs a warning
and never runs git rm itself.
Watcher caveat: after migration, dispatch directories that already contain unprocessed event files are watched at their new path, but the file watcher does not rescan existing files — touch each unprocessed event file to re-trigger processing.
No document format changes: profiles, knots, and looms are
unaffected. knot share is unchanged — the zip now equals exactly the
rig git's tracked content.
Skills and Docs Updated
knot-init(v4.0.0) — running-check path moves totie-offs/<rig>/state.json; new Rig Repository sectionknot-glossary— new Runtime Tree term; all paths re-rootedknot-manage(v1.1.0) — two-repo review workflow; post-migration watcher caveatknot-inspect(v3.3.0),knot-analyst(v1.2.0),knot-dispatch(v1.1.0),knot-create(v5.5.0),knot-design(v1.5.0),knot-abstractions(v1.2.0) — path references, diagrams, and quick-reference commands updatedknot-update— 0.31.0 changelog entry with migration + verification instructionsdocs/configuration/rig-structure.md— new directory tree, Rig Repository and Runtime Tree section;docs/concepts.md,docs/getting-started.md,docs/troubleshooting.md,docs/workflows/*,docs/configuration/knots.md,docs/configuration/profiles.md,README.md— path references
v0.30.1 — 2026-07-24
Bugfix — Startup ordering: persisted events processed after loom discovery
After restarting Knot with events in the queue, the process-strand loop
processed them before DiscoverLooms had run, causing
loom 'X-loom' not found errors for every persisted event. Fixed by
deferring the process-strand loop until after run_startup() completes.
Feature — knot-manage skill
New skill for retrospective review of completed rig work. Examines
tie-off files, assesses output quality, traces producer→consumer
interaction chains, and reviews git commit quality. Complements
knot-analyst which focuses on live operational health.
Feature — knot-dispatch skill
New skill for triggering knots into action. Creates or touches strand files, dispatches events manually, and follows the full event pipeline from strand creation to tie-off completion.
Documentation
getting-started.md— updated skill installation to include all 8 skills with verification stepconcepts.md— new "Agent Skills" sectiondesign-guide.md— referencesknot-designskilltroubleshooting.md— new section on diagnostic skillsworkflows/— references toknot-dispatchandknot-manageREADME.md— expanded Quick Start with workflow steps
v0.30.0 — 2026-07-21
Feature — Persistent Event Queue (Disk-Backed)
Strand events are now persisted to rig/events/{id}.json on disk
instead of held in memory. Events survive process restarts (Ctrl+C,
crashes) and are restored before processing resumes.
How it works:
- Every event pushed is written atomically (temp file → rename) to
rig/events/ - On startup,
rig/events/*.jsonfiles are scanned and re-queued before the debounce engine starts - When an event is processed (popped), its file is removed from disk
- The disk is the source of truth — editing a pending event file on disk is honoured when the event is processed
- Malformed JSON files are skipped with a warning; non-
.jsonfiles are silently ignored
Architecture changes:
InspectQueue<Option<TimestampedStrandEvent>>replaced byStrandEventQueuetrait withDiskBackedEventQueueas the primary implementationPendingEventdomain model with unique IDs ({unix_timestamp_ms}-{4-hex-chars})PendingEventOrShutdownenum replacesOption<T>for the shutdown sentinel- Dedup key preserved:
(strand_path, loom_id, knot_id, kind)
Migration:
No migration needed. On first start, rig/events/ is created
automatically. Existing rigs continue working without changes.
New: Events Directory glossary term
The Knot glossary now documents the rig/events/ directory layout
and purpose.
Testing
- 8 new integration tests in
tests/persistent_queue.rscovering full persistence cycle, restart survival, malformed file handling, queue deletion, and on-disk modification - Full suite: 725 unit + 409 integration = 1,134 tests passing
v0.22.1 — 2026-07-03
Bugfix
- Fixed flaky
execute_timeout_regressiontest under--test-threads=4(ETXTBSY)
Testing
- Completed integration test migration (phases 0–11). Application tests use mock ports, adapter tests use real I/O with
tempfile, composition smoke tests verify full wiring.TEST_MUTEX, process-global env vars, andKNOT_TEST_CLI_PATHeliminated. Lib tests run in ~1.1s.
v0.22.0 — 2026-07-01
Breaking Change — Flat tie-off paths
Tie-off paths changed from rig/tie-offs/{loom-id}/{knot-name}/{strand}.output to rig/tie-offs/{loom-id}/tie-off-{knot-name}.md. The intermediate knot subdirectory is removed. Tie-offs are now one file per knot with append-mode writes.
Migration: Update any scripts or tooling that reference the old path structure.
Feature — Strand queue visibility
rig/state.json now includes a strand_queue array showing all pending strand events with file path, loom/knot IDs, event type, and queued timestamp.
Bugfix
- Fixed
spawn_blockingforProcessStrand execute()— ensures graceful shutdown on Ctrl+C
v0.21.0 — 2026-07-01
Feature — Final response filtering in Pi JSON adapter
PiJsonAgentRunner now extracts only the agent's final response text. When Pi uses tools, intermediate messages with stopReason: "toolUse" are excluded; only "stop" and "length" responses produce output. This prevents tool-use artifacts from appearing in tie-off files.
v0.20.3 — 2026-06-29
Refactor
- Extracted
usecases.rsinto isolated modules (loom/,query/,session_resume/). Pure structural refactor — zero behaviour change.
v0.20.1 — 2026-06-29
Bugfix
- Removed unused imports from process_strand test modules
v0.20.0 — 2026-06-28
Feature — Session resume on invocation failure
Automatically resume Pi sessions from where they left off after invocation failure (timeout, network error). Uses --session-id for up to 10 retries with 10-second delays between attempts. Profile timeout budget is respected — retries stop when insufficient time remains. Each retry appends "please continue" to the session.
v0.19.0 — 2026-06-27
Feature — JSON-based agent adapter
New agent_adapter enum in .workspace-agent-config.yaml replaces cli_path/cli_args. Supports pi-stdio (default, reads stdout) and pi-json (parses JSON-L for session IDs and token usage). run_startup() auto-creates the config file on first boot.
v0.18.1 — 2026-06-26
Bugfix
- Fixed
unwatch()removing all watcher entries for a path when only a single knot's entry should be removed. Broke shared strand directory scenarios where multiple knots watch the same directory.
v0.18.0 — 2026-06-24
Breaking Change — Prompt text moved to markdown body
Profile and knot files no longer embed prompt text in YAML frontmatter. The plain text after the --- separator is now the prompt content.
Frontmatter retains only structural metadata (name, provider, model, tools, timeout for profiles; name, agent-profile-ref, strand-dir, git-versioned for knots).
v0.17.0 — 2026-06-24
Feature — Strand missing file handling
Known temp files (e.g. macOS sed -i temp files) are silently skipped. Unknown missing files produce StrandSkipped events in the loom-log instead of spurious "File not found" errors.
v0.16.0 — 2026-06-22
Feature — Tie-off context extraction for deleted files
When a strand is deleted, Knot now parses the tie-off file and injects the last N per-strand entries into the agent prompt (replacing the @file reference that would fail on deleted files).
v0.15.0 — 2026-06-20
Breaking Change — Removed input-bundling from knot frontmatter
The input-bundling property was removed from knot YAML frontmatter. It had no runtime effect — only full-file ever shipped and is always the behaviour. Knot files that still contain input-bundling parse with a warning.
v0.14.0 — 2026-06-19
Feature — All text files accepted as strands
Knots now process any text file (.rs, .json, .py, .txt, etc.) — not just .md. Binary files are detected (null-byte heuristic on first 8KB) and silently skipped with StrandIgnored in the loom-log.
v0.13.0 — 2026-06-19
Breaking Change — HTTP interface removed
The Axum HTTP server was removed entirely. All state observation is now through rig/state.json, written atomically every 5 seconds. GET /health, GET /looms, GET /profiles, and all other HTTP endpoints no longer exist. Skills and tools read rig/state.json directly.
v0.12.0 — 2026-06-17
Feature — Explicit Pi session titles
Each agent session gets a unique, descriptive title derived from knot ID and strand filename (e.g. plan-architect triggered by Modified on 004-manifest-resources.md).
Core Features
Knot is a local agent orchestration system that watches directories for file changes and triggers AI agent sessions. Key capabilities:
- File-first configuration — All configuration is
.mdfiles with YAML frontmatter. Git-trackable, diff-visible. - Auto-discovery — Looms (
*-loom/directories), knots (.mdfiles in looms), and profiles (rig/profiles/*.md) are discovered automatically via file watching. - Agent profiles — Define which LLM provider, model, tools, and system prompt to use. Profiles are read fresh from disk at processing time.
- Knot processing — Goal-seeking agents that read strands (input files), inspect current state, and apply minimal changes to reach a goal. Idempotent by design.
- Tie-off output — Append-only output files at
rig/tie-offs/{loom-id}/tie-off-{knot-name}.md. - Git versioning — Automatic commits after each tie-off write
(opt-out per-knot with
git-versioned: false). - Session resume — Automatic retry of failed agent sessions (up to 10 retries, 10s delay).
- State file —
rig/state.jsonupdated every 5 seconds with looms, knots, profiles, and strand queue. - Activity logging — Per-loom activity logs and a rig-wide
operational log (
rig/.rig-log) in JSONL format. - Rig switching — Multiple rigs per project, with packaging for sharing.
- Debounced event processing — File events are debounced to avoid triggering on partial writes.
- Graceful shutdown — Cooperative cascade shutdown that drains pending events.
- Configurable timeouts — Per-profile session timeouts with
TimeoutExceededevent logging.