Skip to content
Open
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
10 changes: 7 additions & 3 deletions HANDOFF.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ unconditional self-echo (12 dropped), hop-count TTL (cascade bounded, converged)
idempotency, 6 signed facts → `facts/coordination.yaml`. See `README.md` for the
run output and the lighter-vs-wasmCloud friction notes.

**Stubbed seams:** NATS (in-mem bus Vec) · sigil (`sig` is an FNV stub; real
`wsc sign` blocked on `pulseengine/sigil#164`) · rivet (facts as YAML) · thrum
out-of-band kill (not built).
**Durable spine is REAL:** the host runs on a NATS JetStream stream (`AGORA`) —
global ordering (stream sequence), capability-scoping structural at the subject
filter (no consumer subscribes to ungranted `secret-ops`), `Nats-Msg-Id` dedup,
durable-consumer replay (REQ-AGORA-009). Run: `nats-server -js & cd host && cargo run`.

**Remaining stubbed seams:** sigil (`sig` is an FNV stub; real `wsc sign` blocked on
`pulseengine/sigil#164`) · rivet (facts as YAML) · thrum out-of-band kill (not built).

## 5. Open questions (research could not close — agora must decide)

Expand Down
1,018 changes: 912 additions & 106 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,29 @@ bazel build //agent:agent
# Quick path (same native-p2 component, no preview1 adapter):
cd agent && cargo component build --release --target wasm32-wasip2

# Run the host (loads the p2 component, enforces the cross-talk controls):
cd host && cargo run --release # `cargo test` asserts the controls (8/12/converge/6)
# Run the host over a REAL durable spine (NATS JetStream):
nats-server -js & # the durable log (global ordering, dedup, replay)
cd host && cargo run --release # publishes to JetStream, runs the controls
# `cargo test` asserts the controls against the in-memory reference oracle.
```

## Stubbed seams (the swap-in points)
## The durable spine is real (NATS JetStream)

The host no longer fakes the bus with a `Vec` — it runs on a real **JetStream**
stream (`AGORA`, subjects `agora.>`):

- **Global ordering** — the stream sequence (the run shows 8 messages, last seq 8).
- **Capability channel-scoping is structural at the transport** — each agent gets a
durable pull consumer *filtered to the subjects of its granted channels only*, so
the ungranted `secret-ops` message sits in the log but **no consumer subscribes to
it** → it is never delivered (stronger than a runtime check).
- **Dedup + replay** — `Nats-Msg-Id` headers (idempotent publish) and durable
consumers (a late joiner replays from its position — REQ-AGORA-009).

The in-memory `run_simulation` remains as the unit-tested reference oracle.

## Stubbed seams (the remaining swap-in points)

- **NATS/JetStream** — the host's in-memory `bus` Vec stands in for the durable
log. Real JetStream gives the global sequence (ordering), durable consumers
(= the watermark/pending_gates replay), and `Nats-Msg-Id` dedup.
- **sigil** — `sig` is an FNV stub; real `wsc sign --keyless` swaps in (blocked on
`pulseengine/sigil#164`, the wasip2 parser).
- **rivet** — facts are written as YAML; real `rivet` (0.17 present) ingests them.
Expand Down
20 changes: 10 additions & 10 deletions artifacts/decisions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ artifacts:
- type: satisfies
target: REQ-AGORA-002
fields:
release: v0.1.0
baseline: v0.1.0

- id: AD-AGORA-002
type: design-decision
Expand All @@ -34,7 +34,7 @@ artifacts:
- type: satisfies
target: REQ-AGORA-001
fields:
release: v0.1.0
baseline: v0.1.0

- id: AD-AGORA-003
type: design-decision
Expand All @@ -52,7 +52,7 @@ artifacts:
- type: satisfies
target: REQ-AGORA-009
fields:
release: v0.1.0
baseline: v0.1.0

- id: AD-AGORA-004
type: design-decision
Expand All @@ -70,7 +70,7 @@ artifacts:
- type: satisfies
target: REQ-AGORA-010
fields:
release: v0.1.0
baseline: v0.1.0

- id: AD-AGORA-005
type: design-decision
Expand All @@ -87,7 +87,7 @@ artifacts:
- type: satisfies
target: REQ-AGORA-001
fields:
release: v0.1.0
baseline: v0.1.0

- id: AD-AGORA-006
type: design-decision
Expand All @@ -108,7 +108,7 @@ artifacts:
- type: satisfies
target: REQ-AGORA-006
fields:
release: v0.1.0
baseline: v0.1.0

- id: AD-AGORA-007
type: design-decision
Expand All @@ -132,7 +132,7 @@ artifacts:
- type: satisfies
target: REQ-AGORA-007
fields:
release: v0.1.0
baseline: v0.1.0

- id: AD-AGORA-008
type: design-decision
Expand All @@ -153,7 +153,7 @@ artifacts:
onto JetStream; host -> wasmtime 43 p3 async linker), adopted there in v0.3.0.
tags: [architecture, build, wasi, bazel]
fields:
release: v0.1.0
baseline: v0.1.0
links:
- type: satisfies
target: REQ-AGORA-011
Expand Down Expand Up @@ -181,7 +181,7 @@ artifacts:
domains); STPA severity drives constraint rigor.
tags: [architecture, verification, stpa-sec, eu-ai-act]
fields:
release: v0.1.0
baseline: v0.1.0
links:
- type: satisfies
target: REQ-AGORA-007
Expand All @@ -203,7 +203,7 @@ artifacts:
the structural layer the runtime cross-talk controls and the durable record build on.
tags: [architecture, protocol]
fields:
release: v0.1.0
baseline: v0.1.0
links:
- type: satisfies
target: REQ-AGORA-008
28 changes: 14 additions & 14 deletions artifacts/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ artifacts:
fields:
priority: must
category: functional
release: v0.1.0
baseline: v0.1.0

- id: REQ-AGORA-002
type: requirement
Expand All @@ -28,7 +28,7 @@ artifacts:
fields:
priority: must
category: functional
release: v0.1.0
baseline: v0.1.0

- id: REQ-AGORA-003
type: requirement
Expand All @@ -42,7 +42,7 @@ artifacts:
fields:
priority: must
category: non-functional
release: v0.1.0
baseline: v0.1.0

- id: REQ-AGORA-004
type: requirement
Expand All @@ -56,7 +56,7 @@ artifacts:
fields:
priority: must
category: constraint
release: v0.1.0
baseline: v0.1.0

- id: REQ-AGORA-005
type: requirement
Expand All @@ -70,7 +70,7 @@ artifacts:
fields:
priority: must
category: constraint
release: v0.1.0
baseline: v0.1.0

- id: REQ-AGORA-006
type: requirement
Expand All @@ -84,7 +84,7 @@ artifacts:
fields:
priority: must
category: non-functional
release: v0.1.0
baseline: v0.1.0

- id: REQ-AGORA-007
type: requirement
Expand All @@ -98,7 +98,7 @@ artifacts:
fields:
priority: must
category: constraint
release: v0.3.0
baseline: v0.3.0

- id: REQ-AGORA-008
type: requirement
Expand All @@ -112,12 +112,12 @@ artifacts:
fields:
priority: must
category: functional
release: v0.1.0
baseline: v0.1.0

- id: REQ-AGORA-009
type: requirement
title: Global ordering and late-join replay
status: draft
status: implemented
description: >
The durable spine shall provide per-stream global ordering and durable
consumers so a late-joining agent replays from its last position — the
Expand All @@ -126,7 +126,7 @@ artifacts:
fields:
priority: must
category: functional
release: v0.3.0
baseline: v0.3.0

- id: REQ-AGORA-010
type: requirement
Expand All @@ -142,7 +142,7 @@ artifacts:
fields:
priority: must
category: functional
release: v0.2.0
baseline: v0.2.0

- id: REQ-AGORA-011
type: requirement
Expand All @@ -162,7 +162,7 @@ artifacts:
fields:
priority: must
category: non-functional
release: v0.1.0
baseline: v0.1.0

# ---- Features --------------------------------------------------------------
- id: FEAT-AGORA-SPIKE
Expand All @@ -179,7 +179,7 @@ artifacts:
tags: [spike]
fields:
phase: phase-1
release: v0.1.0
baseline: v0.1.0
links:
- type: satisfies
target: REQ-AGORA-001
Expand Down Expand Up @@ -210,7 +210,7 @@ artifacts:
tags: [build, bazel, wasi]
fields:
phase: phase-1
release: v0.1.0
baseline: v0.1.0
links:
- type: satisfies
target: REQ-AGORA-011
Expand Down
52 changes: 26 additions & 26 deletions facts/coordination.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,43 @@
artifacts:
- id: COORD-0003
type: coordination-fact
sender: synth-agent
channel: build-coord
act: inform
sig: sigil-stub:synth-agent:2cfdec1b3d4708f1
sender: "synth-agent"
channel: "build-coord"
act: "inform"
sig: "sigil-stub:synth-agent:2cfdec1b3d4708f1"
payload: "ack[synth-agent] <- ship v0.1?"
- id: COORD-0004
type: coordination-fact
sender: relay-agent
channel: build-coord
act: inform
sig: sigil-stub:relay-agent:0e611556265e0734
sender: "relay-agent"
channel: "build-coord"
act: "inform"
sig: "sigil-stub:relay-agent:0e611556265e0734"
payload: "ack[relay-agent] <- ship v0.1?"
- id: COORD-0005
type: coordination-fact
sender: synth-agent
channel: build-coord
act: inform
sig: sigil-stub:synth-agent:63e85b8eddd2c53e
payload: "ack[synth-agent] <- ack[relay-agent] <- ship v0.1?"
sender: "relay-agent"
channel: "build-coord"
act: "inform"
sig: "sigil-stub:relay-agent:b1b8c898b8121942"
payload: "ack[relay-agent] <- ack[synth-agent] <- ship v0.1?"
- id: COORD-0006
type: coordination-fact
sender: relay-agent
channel: build-coord
act: inform
sig: sigil-stub:relay-agent:b1b8c898b8121942
payload: "ack[relay-agent] <- ack[synth-agent] <- ship v0.1?"
sender: "synth-agent"
channel: "build-coord"
act: "inform"
sig: "sigil-stub:synth-agent:63e85b8eddd2c53e"
payload: "ack[synth-agent] <- ack[relay-agent] <- ship v0.1?"
- id: COORD-0007
type: coordination-fact
sender: synth-agent
channel: build-coord
act: inform
sig: sigil-stub:synth-agent:e4559d1bae626780
sender: "synth-agent"
channel: "build-coord"
act: "inform"
sig: "sigil-stub:synth-agent:e4559d1bae626780"
payload: "ack[synth-agent] <- ack[relay-agent] <- ack[synth-agent] <- ship v0.1?"
- id: COORD-0008
type: coordination-fact
sender: relay-agent
channel: build-coord
act: inform
sig: sigil-stub:relay-agent:4b9bd9a67e48f685
sender: "relay-agent"
channel: "build-coord"
act: "inform"
sig: "sigil-stub:relay-agent:4b9bd9a67e48f685"
payload: "ack[relay-agent] <- ack[synth-agent] <- ack[relay-agent] <- ship v0.1?"
Loading