Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
4d8df99
feat: add daimon memory wake traces
apresmoi Jul 9, 2026
4a7fa1c
docs: standardize agent guidance files
apresmoi Jul 9, 2026
d6b1e45
docs: audit daimon readme against source and registry
apresmoi Jul 10, 2026
043e6d1
feat: stamp turn and control causal events in daimon observability
apresmoi Jul 10, 2026
55b5384
docs: note pi turn cause_event_id is now the real moltnet event id
apresmoi Jul 11, 2026
27416b6
fix: chain turn.input.submitted to mneme causal ids not raw recall ids
apresmoi Jul 11, 2026
9f3f1bb
feat(pi): add authenticated world tools
apresmoi Jul 21, 2026
ef1eda2
fix(pi): harden world tool boundaries
apresmoi Jul 21, 2026
c3bc865
feat(pi): wire optional world tools
apresmoi Jul 21, 2026
f804cf8
fix(pi): harden world response handling
apresmoi Jul 21, 2026
e173279
feat(core): type wake delivery metadata
apresmoi Jul 21, 2026
9541a40
test: enforce wake delivery required fields
apresmoi Jul 21, 2026
e20c4a8
feat(pi): make wake acceptance idempotent
apresmoi Jul 22, 2026
fc9a032
fix(pi): bind trusted memory authority
apresmoi Jul 22, 2026
c7f8022
feat(pi): make thinking level configurable
apresmoi Jul 25, 2026
02d4a1d
perf(pi): omit unrelated tools for world-only agents
apresmoi Jul 25, 2026
6f584d6
feat(pi): bind world wakes and capture safe trajectories
apresmoi Jul 25, 2026
baa44a3
feat(pi): capture exact private training turns
apresmoi Jul 25, 2026
bcfc189
refactor(pi): bind capture to native session types
apresmoi Jul 25, 2026
96d4d86
fix(pi): avoid duplicate raw capture persistence
apresmoi Jul 25, 2026
faa2373
fix(pi): finalize private captures atomically
apresmoi Jul 25, 2026
1afcf3a
docs(pi): specify atomic raw capture publication
apresmoi Jul 25, 2026
2c3d53a
fix(pi): bind pre-enrichment delivery payloads
apresmoi Jul 25, 2026
17b74da
feat(pi): trace world binding handoff state
apresmoi Jul 25, 2026
589948a
feat(pi): attest raw training capture integrity
apresmoi Jul 26, 2026
0fac7d2
merge: align Daimon Tiny Football runtime
apresmoi Jul 28, 2026
b71c1dc
merge: align Daimon trusted memory authority
apresmoi Jul 28, 2026
36c6749
test(pi): restore memory opt-in so the wake-provenance guard can fail
apresmoi Jul 31, 2026
38532e3
merge: restore Pi wake-provenance memory guard
apresmoi Jul 31, 2026
a295b54
fix(pi): derive the memory tool contract from mneme instead of hand-r…
apresmoi Aug 3, 2026
f3111eb
merge: B326 daimon's memory has been writing nothing since July 29
apresmoi Aug 3, 2026
a0f4471
feat(mcp): mount Pi's own tool definitions on MCP behind wake-scoped …
apresmoi Aug 4, 2026
b5863f1
fix(mcp): abort an in-flight tool at the wake deadline and typecheck …
apresmoi Aug 4, 2026
51fdedf
fix(deps): declare the mneme requirement daimon actually has
apresmoi Aug 4, 2026
12024c5
merge: F3 stage 1 — mount the canonical tools over MCP behind a bound…
apresmoi Aug 4, 2026
462f3a6
fix(observability,pi): require a real run id and stop rendering absen…
apresmoi Aug 4, 2026
e04aefc
merge: F3 stage 2a — NOOPOLIS_RUN_ID mandatory, unattributed wakes re…
apresmoi Aug 4, 2026
486c344
feat(pi): drive real CLI engines through the canonical tools over MCP
apresmoi Aug 4, 2026
1ce8447
merge: F3 stage 2b — the CLI adapter mounts the canonical tools over MCP
apresmoi Aug 4, 2026
b802eb2
fix(pi): deliver the prompt and let codex actually call the mounted t…
apresmoi Aug 4, 2026
0c4289d
merge: F5 — deliver the prompt and stop codex auto-cancelling every m…
apresmoi Aug 4, 2026
9da4d26
fix(pi): render wake attribution so a supplied value cannot imitate a…
apresmoi Aug 4, 2026
b36acd1
test(core): a stale mneme dist can no longer produce a green daimon s…
apresmoi Aug 4, 2026
ec93c85
fix(pi): a failed world tool call must record why it failed
apresmoi Aug 4, 2026
0a582eb
merge: F5 — a failed world tool call retains its error
apresmoi Aug 4, 2026
4b31bbb
merge: F13 — refuse to test against a stale sibling dist
apresmoi Aug 4, 2026
1656fcf
merge: F9 — a supplied attribution cannot imitate absence or inject h…
apresmoi Aug 4, 2026
76c227d
build(runtime): build the daimon runtime image from local packages
apresmoi Aug 4, 2026
8d49a7e
merge: F5 — build the runtime image from local tarballs
apresmoi Aug 4, 2026
88ad4bf
feat(pi): claim world authority on autonomous wakes
apresmoi Aug 7, 2026
6932b16
test(pi): expect claim tool in cli sessions
apresmoi Aug 7, 2026
0f6780a
feat: keep world authority private from model tools
apresmoi Aug 7, 2026
2614de1
build(runtime): attest public world claim contract
apresmoi Aug 8, 2026
4edc6ab
docs: clarify scheduled world claims
apresmoi Aug 9, 2026
bc1f954
fix: retain teammate messages in world wakes
apresmoi Aug 13, 2026
f6d5dce
fix: verify daimon against released packages
apresmoi Aug 13, 2026
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
9 changes: 9 additions & 0 deletions .github/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# GitHub Automation Guide

This folder contains repository automation for Daimon.

## Rules

- Keep workflows explicit and easy to debug.
- Publish npm releases only from matching `v*` tags.
- Do not add co-author attributions, sign-off lines, or AI credit.
9 changes: 0 additions & 9 deletions .github/CLAUDE.md

This file was deleted.

1 change: 1 addition & 0 deletions .github/CLAUDE.md
9 changes: 9 additions & 0 deletions .github/workflows/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Workflow Guide

This folder contains GitHub Actions workflows for Daimon.

## Rules

- CI must typecheck, test, and build the package.
- Release must verify the tag matches `package.json` before publishing.
- Keep workflow triggers narrow and intentional.
9 changes: 0 additions & 9 deletions .github/workflows/CLAUDE.md

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/CLAUDE.md
57 changes: 24 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,48 +38,39 @@ jobs:
- name: Check out
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: package-lock.json

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Read package version
id: package
shell: bash
run: |
set -euo pipefail
version="$(node -p "require('./package.json').version")"
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Install dependencies
run: npm ci

- name: Wait for npm packages
- name: Build runtime artifact image from release-shaped packages
shell: bash
run: |
set -euo pipefail
context="$(mktemp -d)"
trap 'rm -rf "$context"' EXIT

version="${{ steps.package.outputs.version }}"
for attempt in $(seq 1 24); do
if npm view "@noopolis/daimon@${version}" version >/dev/null 2>&1 \
&& npm view "@noopolis/mneme@0.1.0" version >/dev/null 2>&1; then
exit 0
fi
echo "Waiting for npm registry propagation (${attempt}/24)."
sleep 5
done

npm view "@noopolis/daimon@${version}" version
npm view "@noopolis/mneme@0.1.0" version
daimon_tarball="$(npm pack --pack-destination "$context" --silent)"
mneme_tarball="$(npm pack @noopolis/mneme@0.1.1 --pack-destination "$context" --silent)"
mv "$context/$daimon_tarball" "$context/daimon.tgz"
mv "$context/$mneme_tarball" "$context/mneme.tgz"
cp Dockerfile.runtime "$context/Dockerfile.runtime"

- name: Build runtime artifact image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.runtime
load: true
tags: noopolis/spawnfile-runtime-daimon:ci
build-args: |
DAIMON_VERSION=${{ steps.package.outputs.version }}
MNEME_VERSION=0.1.0
PI_VERSION=0.79.10
cache-from: type=gha,scope=daimon-runtime-image
cache-to: type=gha,scope=daimon-runtime-image,mode=max
docker buildx build \
--file "$context/Dockerfile.runtime" \
--target local-runtime \
--tag noopolis/spawnfile-runtime-daimon:ci \
--build-arg PI_VERSION=0.79.10 \
--load \
"$context"

- name: Verify runtime artifact contents
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/runtime-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ concurrency:

env:
IMAGE_NAME: noopolis/spawnfile-runtime-daimon
MNEME_VERSION: 0.1.0
MNEME_VERSION: 0.1.1
PI_VERSION: 0.79.10

jobs:
Expand Down
27 changes: 27 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Daimon Package Guide

This repository contains Daimon, the Noopolis-native per-agent runtime harness.

It must stay detached from the Spawnfile compiler implementation. Spawnfile owns
teams, org graphs, Moltnet wiring, schedules, workspace compilation, and
deployment. Daimon owns only the per-agent runtime boundary.

## Structure

- `src/core/` defines per-agent harness contracts.
- `src/pi/` implements the contract using Pi's SDK.
- `src/observability/` records local agent/org activity traces.
- `src/examples/` contains runnable local examples and E2E checks.

## Rules

- Keep runtime credentials out of git. Generated runtime state belongs under
`.runtime/`, which is ignored.
- Keep teams/orgs out of this package. A caller may start many harnessed agents,
but the harness API should only know about one agent at a time.
- Keep the public contract independent of Pi-specific types.
- Memory behavior belongs in the sibling `@noopolis/mneme` package. Daimon may
adapt Mneme into Pi custom tools, but must not reimplement Mneme storage,
policy, recall, or MCP.
- Pi-specific logic belongs under `src/pi/`.
- Examples should be runnable with `npm run e2e:pi-agent`.
27 changes: 0 additions & 27 deletions CLAUDE.md

This file was deleted.

1 change: 1 addition & 0 deletions CLAUDE.md
60 changes: 57 additions & 3 deletions Dockerfile.runtime
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ARG RUNTIME_ROOT=/opt/spawnfile/runtime-installs/daimon

FROM ${NODE_IMAGE} AS build

ARG DAIMON_VERSION=0.1.1
ARG MNEME_VERSION=0.1.0
ARG DAIMON_VERSION=0.1.2
ARG MNEME_VERSION=0.1.1
ARG PI_VERSION=0.79.10
ARG RUNTIME_ROOT

Expand All @@ -31,8 +31,62 @@ RUN mkdir -p "${RUNTIME_ROOT}" \
-name "*.mdx" \
\) -delete

FROM scratch AS runtime
FROM scratch AS registry-runtime

ARG RUNTIME_ROOT

COPY --from=build ${RUNTIME_ROOT} ${RUNTIME_ROOT}

# The local target keeps the default registry target unchanged while replacing
# only Daimon and Mneme with tarballs supplied in its minimal build context.
FROM ${NODE_IMAGE} AS local-build

ARG RUNTIME_ROOT
ARG PI_VERSION=0.79.10

COPY daimon.tgz mneme.tgz /tmp/local-packages/

RUN mkdir -p "${RUNTIME_ROOT}" \
&& cd "${RUNTIME_ROOT}" \
&& npm install --omit=dev --no-fund --no-audit \
/tmp/local-packages/daimon.tgz \
/tmp/local-packages/mneme.tgz \
"@earendil-works/pi-coding-agent@${PI_VERSION}" \
"@earendil-works/pi-ai@${PI_VERSION}" \
&& npm cache clean --force \
&& find node_modules -type d \( \
-name docs -o \
-name examples -o \
-name test -o \
-name tests -o \
-name __tests__ \
\) -prune -exec rm -rf {} + \
&& find node_modules -type f \( \
-name "*.map" -o \
-name "*.md" -o \
-name "*.mdx" \
\) -delete

FROM scratch AS local-runtime

ARG RUNTIME_ROOT

COPY --from=local-build ${RUNTIME_ROOT} ${RUNTIME_ROOT}

# scratch has no shell or Node executable, so the verifier is a temporary
# Node image containing exactly the local-runtime filesystem.
FROM ${NODE_IMAGE} AS local-verify

ARG RUNTIME_ROOT

COPY --from=local-runtime ${RUNTIME_ROOT} ${RUNTIME_ROOT}
COPY verifyRuntimeImage.mjs /usr/local/lib/daimon/verifyRuntimeImage.mjs

CMD ["node", "--no-warnings", "/usr/local/lib/daimon/verifyRuntimeImage.mjs"]

# Keep registry mode as the Dockerfile's default target.
FROM scratch AS runtime

ARG RUNTIME_ROOT

COPY --from=registry-runtime ${RUNTIME_ROOT} ${RUNTIME_ROOT}
2 changes: 1 addition & 1 deletion ENGINE-SYSTEM.md
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ has relevant context, but the representative asks that agent through Moltnet.

### Phase 1: Refactor Pi Behind Engine Interface

- Add `src/engine/CLAUDE.md`.
- Add `src/engine/AGENTS.md` with a `CLAUDE.md` compatibility symlink.
- Add `src/engine/types.ts`.
- Move Pi-specific turn execution behind `PiEngine`.
- Keep current public `PiHarnessAdapter` behavior passing.
Expand Down
64 changes: 54 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,28 @@ Daimon is the Noopolis-native per-agent runtime harness.
It defines a small per-agent contract and currently implements that contract on
top of Pi. A Daimon runs one harnessed agent inside a caller-prepared workspace.

Spawnfile should own orgs, nested teams, schedules, Moltnet wiring, workspace
resource compilation, and the app that starts many harnessed agents. This package
should not know what an org is.
Spawnfile compiles and deploys orgs, nested teams, member-owned schedules,
Moltnet wiring, and workspace resources. Daimon executes one agent runtime: it
accepts a wake selected by that runtime's organization policy and runs one
turn. It does not know the org graph, schedule other agents, or let Simfile or
a world service trigger cognition.

For a world-capable `kind: every` wake, the harness starts without a decision
token and privately calls `world_claim` before exposing any other world tool.
The claim binds authority to the schedule wake's run/request/wake identity; the
opaque token stays inside the harness. Subsequent observe/affordance/action
calls carry it without placing it in the model prompt or tool schema. Optional
world recommendations are ordinary observation fields discovered after the
independent wake and claim—they are never Daimon wake inputs.

## Install

```bash
npm install @noopolis/daimon
```

The latest published version is 0.1.1; this README describes the source tree (0.1.2).

For Pi agents with memory enabled, install Mneme too:

```bash
Expand All @@ -37,10 +49,31 @@ Pi-specific exports live under the Pi subpath:
import { PiHarnessAdapter } from "@noopolis/daimon/pi";
```

By default, the in-process Mneme runtime uses the same path as each agent's
`runtimeHomePath`. If you need agents to keep separate Pi/runtime directories but
share one memory bank, pass an explicit `memory.runtimeHomePath` in
`PiHarnessOptions`.

```ts
const adapter = new PiHarnessAdapter({
authPath: "/tmp/daimon-auth.json",
memory: {
runtimeHomePath: "/shared/memory/bank"
}
});
```

Pi agents receive Mneme tools in awake mode for normal work. Dream wakes use a
fresh one-off Pi session under `sessions/dream/<wake-id>-<random>` and inject
the Mneme dream guidance instead. Daimon does not automatically record every
turn as memory; agents write memories only by calling Mneme tools such as
`memory_register`, `memory_summarize`, and `memory_forget`.

## Tests

The package has a non-live test suite for auth seeding and Pi model config
generation:
The package has a non-live test suite covering auth seeding, Pi model config
generation, the harness contract, memory tool wiring, wake and turn traces, and
the org observer:

```bash
npm test
Expand Down Expand Up @@ -68,6 +101,10 @@ upstream-documented dummy `ollama` value.
The Pi E2E uses the local Codex CLI subscription auth file to seed an ignored Pi
`auth.json` under `.runtime/`.

These are live runs: they spend real tokens and require local engine auth
(`~/.codex/auth.json` for Pi/Codex; mixed-engine and triad additionally need
authenticated `grok` and `agy` CLIs on PATH). They are not part of `npm test`.

```bash
npm install
npm run e2e:pi-agent
Expand Down Expand Up @@ -107,8 +144,9 @@ archetype gets consulted.
## Design Notes

- `MEMORY-SYSTEM.md` describes the implemented scoped memory runtime.
- `ENGINE-SYSTEM.md` describes the next engine abstraction plan: Pi, Ollama,
API providers, and CLI-backed engines such as `agy`, `grok`, and `gemini`.
- `ENGINE-SYSTEM.md` describes the engine abstraction plan: Pi, local/API
model providers, and CLI-backed engines such as `codex`, `claude`, `grok`,
and `agy`.
- Mneme is a sibling package, `@noopolis/mneme`, published separately and used
by Daimon in-process for Pi agents. Other runtimes can use Mneme through its
MCP server. The agent-facing tools stay named `memory_search`,
Expand All @@ -117,16 +155,22 @@ archetype gets consulted.

## Runtime Artifact Image

Daimon can build a local copy-only runtime artifact image for Spawnfile:
Daimon defines a local copy-only runtime artifact image build for Spawnfile:

```bash
npm run image:runtime:local
```

Status: this build currently fails against the public npm registry. The
Dockerfile pins `@noopolis/daimon@0.1.2` and `@noopolis/mneme@0.1.1`, and
neither is published yet (registry has daimon 0.1.1 and mneme 0.1.0). Works
only after those versions publish or against a registry that has them. Treat
as pending publish.

This creates:

```text
noopolis/spawnfile-runtime-daimon:0.1.1-local
noopolis/spawnfile-runtime-daimon:0.1.2-local
```

The image is not a full organization image and is not intended to be run
Expand All @@ -139,7 +183,7 @@ directly. It contains only:
Spawnfile can copy that path into generated organization images:

```bash
SPAWNFILE_DAIMON_RUNTIME_IMAGE=noopolis/spawnfile-runtime-daimon:0.1.1-local \
SPAWNFILE_DAIMON_RUNTIME_IMAGE=noopolis/spawnfile-runtime-daimon:0.1.2-local \
spawnfile build ./agentic-org
```

Expand Down
Loading
Loading