Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api-surface.json
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@
"FileCoordinationLog": "value bd8f02ee8c2c",
"FileCorpus": "value ac872ff9718b",
"FileResultBlobStore": "value a464e1a75d77",
"FileSpawnJournal": "value aead755d0085",
"FileSpawnJournal": "value e9bda7d80f7c",
"FinalizeContext": "type e45cea6eacef",
"FinalizerSettled": "type c525a06427fc",
"FlatWidenGate": "type 825b8b585b72",
Expand Down
9 changes: 9 additions & 0 deletions docs/agent-managed-compute/reliability.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ Cancellation and cleanup failures preserve accepted output; budget and execution

The built-in provider recovery path supports one-shot, nonsteering execution.
Retained execution does not create a steering capability the provider lacks.
Spawn-journal append validation keeps only rebuildable node, admission, and cursor indexes.
Healthy appends do not reload prior events; cold reads validate each record once.
File replacement, truncation, changed metadata, or a failed write invalidates the append index.
Recovery validates the actual retained bytes before accepting another append.
The index is not a second durable record or a cross-process ownership fence.
Observer records detach their inputs before queued I/O, so later hook mutations cannot rewrite the evidence being saved.
Completed director invocations reset the consecutive transport-failure counter even when the pursuit remains incomplete.
The explicit total-attempt, deadline, cancellation, and resource bounds still apply.

The file run lock protects one local coordinator.
It does not fence provider mutations from a partitioned coordinator on another machine.
No deployed or live multi-provider recovery proof is claimed here.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/primitive-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Primitive catalog — the never-stale anti-reinvention inventory

> **GENERATED** from `@tangle-network/agent-runtime@0.231.1` and `@tangle-network/agent-eval@0.182.0` by `scripts/gen-primitive-catalog.mjs`. Do NOT hand-edit — run `pnpm run docs:api`. This is the mechanical companion to the JUDGMENT in `canonical-api.md` (§2 decision table + §1.5 AgentProfile law): that doc says WHICH primitive to reach for and what NOT to build; this catalog proves WHAT exists. Per-symbol signatures + `file:line` live in the per-module pages under `docs/api/`.
> **GENERATED** from `@tangle-network/agent-runtime@0.232.0` and `@tangle-network/agent-eval@0.182.0` by `scripts/gen-primitive-catalog.mjs`. Do NOT hand-edit — run `pnpm run docs:api`. This is the mechanical companion to the JUDGMENT in `canonical-api.md` (§2 decision table + §1.5 AgentProfile law): that doc says WHICH primitive to reach for and what NOT to build; this catalog proves WHAT exists. Per-symbol signatures + `file:line` live in the per-module pages under `docs/api/`.

## 1. agent-runtime — own public surface

Expand Down
2 changes: 1 addition & 1 deletion docs/canonical-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Generated signatures and the complete export list live in docs/api/.
Run pnpm docs:freshness after editing this file. -->

> **Version 0.231.1.**
> **Version 0.232.0.**
> [`docs/api/primitive-catalog.md`](./api/primitive-catalog.md) lists every export and import path.
> `agent-eval` must satisfy `>=0.182.0 <0.183.0`.
> `sandbox` must satisfy `>=0.36.4 <0.41.0`.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tangle-network/agent-runtime",
"version": "0.231.1",
"version": "0.232.0",
"description": "Shared task-lifecycle skeleton for agents: a recursive loop kernel for chat turns, one-shot tasks, and multi-attempt loops, with trace capture and eval-gated self-improvement. Domain behavior lives in adapters; scoring and ship-gates in @tangle-network/agent-eval.",
"homepage": "https://github.com/tangle-network/agent-runtime#readme",
"repository": {
Expand Down
14 changes: 12 additions & 2 deletions src/durable/observer-journal.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createHash } from 'node:crypto'
import { readFile } from 'node:fs/promises'
import { resolve } from 'node:path'
import { detachedSnapshot } from '../runtime/supervise/snapshot'
import {
type RuntimeDecisionPoint,
type RuntimeHookEvent,
Expand Down Expand Up @@ -108,6 +109,15 @@ export class FileObserverJournal implements ObserverJournal {
)
}

// Other hooks receive this same input and may mutate it before queued I/O runs.
// Detach now, not after awaiting the previous append or computing the digest.
let snapshot: typeof value
try {
snapshot = detachedSnapshot(value, 'observer record')
} catch (error) {
return Promise.reject(error)
}

let result: ObserverRecord | undefined
const operation = this.tail.then(async () => {
this.assertComplete()
Expand All @@ -126,8 +136,8 @@ export class FileObserverJournal implements ObserverJournal {
observedAt: Date.now(),
...(this.previousDigest ? { previousDigest: this.previousDigest } : {}),
...(kind === 'event'
? { event: value as RuntimeHookEvent }
: { decision: value as RuntimeDecisionPoint }),
? { event: snapshot as RuntimeHookEvent }
: { decision: snapshot as RuntimeDecisionPoint }),
}
const record: ObserverRecord = Object.freeze({
...unsigned,
Expand Down
Loading
Loading