@ouro.bot/cli 0.1.0-alpha.1653 → 0.1.0-alpha.1655
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.json +22 -1
- package/deploy/unraid/Dockerfile +2 -2
- package/deploy/unraid/README.txt +39 -37
- package/deploy/unraid/install.sh +12 -5
- package/deploy/unraid/sanctuary-acceptance-contract.json +12 -12
- package/deploy/unraid/sanctuary-deployment-target.mjs +2 -1
- package/deploy/unraid/sanctuary-replay-gate.mjs +2 -2
- package/deploy/unraid/sanctuary-unit16-host-broker.mjs +25 -15
- package/deploy/unraid/sanctuary-unit16-run.sh +16 -11
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +3 -3
- package/dist/a2a/operator-trust.js +1 -1
- package/dist/heart/daemon/sanctuary-acceptance-adapter.js +55 -52
- package/dist/heart/daemon/sanctuary-acceptance-marker.js +9 -0
- package/dist/heart/daemon/sanctuary-acceptance-scenarios.js +9 -8
- package/dist/senses/sanctuary-health-acceptance-probe.js +10 -9
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "Each pull request writes its own change note under changes/; the release job on main gives each landed change its version and adds the notes here (scripts/release-version.cjs). On main this file stops at the last version set by hand; the published package has every release. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.1655",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Update the Ouro UI files to Ouro UI v1.3.596."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1654",
|
|
12
|
+
"changes": [
|
|
13
|
+
"The Butler image now runs the Butler as `butler` instead of `sanctuary`. Its ENTRYPOINT and healthcheck say `--package-managed-agent butler`, and inside the container its bundle is `/home/ouro/AgentBundles/butler.ouro`, its operator trust `/etc/ouro/trust/butler` and its health habit's crontab `/home/ouro/.ouro-cli/scheduler/butler.crontab`. Nothing moves on the host: the bundle stays in `/mnt/user/appdata/ouro-butler/agent/sanctuary.ouro`, the trust folder in `/mnt/user/appdata/ouro-butler/trust/sanctuary`, and the machine id stays `sanctuary`. The upgrade mounts the same host folders under the new name and tells the bundle migration `--butler-name butler`. A rollback to an older image mounts them under `sanctuary` again.",
|
|
14
|
+
"The DockerMan template's bundle and trust Targets name `butler`; their Defaults are still the host's `sanctuary` folders, and the upgrade still moves the Targets to whichever name the image runs.",
|
|
15
|
+
"A fresh install reads the Butler's name from the image it pulled, seeds the bundle under that name and keeps the machine id `sanctuary`.",
|
|
16
|
+
"The Unit 16 acceptance tools follow the name: the launcher reads it from the image, the host broker and target audit accept either name's mounts and control socket, and the in-container adapter, scenarios and health probe use the bundle that is on disk.",
|
|
17
|
+
"The runbook and the GitHub backup guide name the `butler` container paths, and say to put `sanctuary` in their place on an older image."
|
|
18
|
+
]
|
|
19
|
+
},
|
|
4
20
|
{
|
|
5
21
|
"version": "0.1.0-alpha.1653",
|
|
6
22
|
"changes": [
|
|
7
|
-
"Update the Ouro UI files to Ouro UI v1.3.594.",
|
|
8
23
|
"Update the Ouro UI files to Ouro UI v1.3.595."
|
|
9
24
|
]
|
|
10
25
|
},
|
|
26
|
+
{
|
|
27
|
+
"version": "0.1.0-alpha.1652",
|
|
28
|
+
"changes": [
|
|
29
|
+
"Update the Ouro UI files to Ouro UI v1.3.594."
|
|
30
|
+
]
|
|
31
|
+
},
|
|
11
32
|
{
|
|
12
33
|
"version": "0.1.0-alpha.1651",
|
|
13
34
|
"changes": [
|
package/deploy/unraid/Dockerfile
CHANGED
|
@@ -81,5 +81,5 @@ RUN BW_VERIFY_ROOT="$(mktemp -d)" \
|
|
|
81
81
|
&& rm -rf -- "$BW_VERIFY_ROOT" \
|
|
82
82
|
&& trap - 0 \
|
|
83
83
|
&& test ! -e "/home/ouro/.config/Bitwarden CLI"
|
|
84
|
-
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 CMD ["node","/opt/ouro/dist/heart/daemon/container-healthcheck.js","--agent","
|
|
85
|
-
ENTRYPOINT ["node","/opt/ouro/dist/heart/daemon/daemon-entry.js","--package-managed-agent","
|
|
84
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 CMD ["node","/opt/ouro/dist/heart/daemon/container-healthcheck.js","--agent","butler","--package-managed-agent","butler"]
|
|
85
|
+
ENTRYPOINT ["node","/opt/ouro/dist/heart/daemon/daemon-entry.js","--package-managed-agent","butler"]
|
package/deploy/unraid/README.txt
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
Ouro Butler operator runbook
|
|
2
2
|
|
|
3
|
-
The production container is ouro-butler. It runs as UID/GID 10001, publishes no ports, uses host networking only so its loopback-only Unraid GraphQL client can reach 127.0.0.1, mounts the runtime and sanctuary.ouro bundle read-write, plus the privileged event spool read-only, and uses restart policy unless-stopped. The canonical-gateway image appends /run/ouro-authority -> /run/ouro-authority, readonly, rprivate, and the operator trust mount (/mnt/user/appdata/ouro-butler/trust/sanctuary -> /etc/ouro/trust/
|
|
3
|
+
The production container is ouro-butler. It runs as UID/GID 10001, publishes no ports, uses host networking only so its loopback-only Unraid GraphQL client can reach 127.0.0.1, mounts the runtime and sanctuary.ouro bundle read-write, plus the privileged event spool read-only, and uses restart policy unless-stopped. The canonical-gateway image appends /run/ouro-authority -> /run/ouro-authority, readonly, rprivate, and the operator trust mount (/mnt/user/appdata/ouro-butler/trust/sanctuary -> /etc/ouro/trust/butler, readonly, rprivate), a root-owned directory outside the bundle that holds the grants the Butler honours. The pinned alpha.816 predecessor has only the first three mounts. Root token, issuer, package and authority state are never mounted into the resident. The psyche folder has no mount of its own: it is part of the writable bundle and belongs to the install. Releases up to alpha.978 also mounted <bundle>/psyche read-only over the bundle, so every audit still accepts that six-mount shape, and rolling an upgrade back to such a release recreates it with that mount.
|
|
4
|
+
|
|
5
|
+
The Butler's name. From the rename (M2) on, the image runs the Butler as butler: its ENTRYPOINT ends --package-managed-agent butler, and inside the container the bundle is /home/ouro/AgentBundles/butler.ouro, operator trust is /etc/ouro/trust/butler and the scheduler's crontab is /home/ouro/.ouro-cli/scheduler/butler.crontab. The host folders keep their names, /mnt/user/appdata/ouro-butler/agent/sanctuary.ouro and /mnt/user/appdata/ouro-butler/trust/sanctuary, and the machine id stays sanctuary. An older image (and a rollback to one) runs the Butler as sanctuary and mounts the same host folders under that name. The upgrade, the replay gate, the sync cutover and the Unit 16 launcher read the name from the image's ENTRYPOINT, so they need nothing from you; when you type a command from this runbook against such an image, put sanctuary where it says butler.
|
|
4
6
|
|
|
5
7
|
Root authority lifecycle
|
|
6
8
|
|
|
7
9
|
The existing DockerMan transaction owns authority-install, authority-activate, authority-retire and authority-restore. A complete exact-image package, including dist and production dependencies, must remain at its package-relative paths; extracting only the old five deployment assets cannot execute this lifecycle. The reviewed root-only inputs are /mnt/user/appdata/ouro-authority/incoming-package, package-manifest.json, request.json and incoming-token. They are not a new resident credential policy. The human rotates the existing bot token directly into root custody; the root owner proves the previous token returns 401 and the fresh token belongs to the same numeric bot before continuing.
|
|
8
10
|
|
|
9
|
-
Psyche mount retired: alpha.978 and earlier mounted the bundle psyche folder read-only over the bundle (six mounts). The upgrade audits still accept that shape, so the running alpha.978 resident passes them; the upgrade then recreates the resident with five mounts (no separate psyche mount) and removes the psyche Config (Target /home/ouro/AgentBundles/
|
|
11
|
+
Psyche mount retired: alpha.978 and earlier mounted the bundle psyche folder read-only over the bundle (six mounts). The upgrade audits still accept that shape, so the running alpha.978 resident passes them; the upgrade then recreates the resident with five mounts (no separate psyche mount) and removes the psyche Config (Target /home/ouro/AgentBundles/butler.ouro/psyche) from the installed DockerMan template /boot/config/plugins/dockerMan/templates-user/my-ouro-butler.xml, so a DockerMan Apply cannot add the read-only mount back. Rolling an upgrade back to alpha.978 or earlier recreates the predecessor with the read-only psyche mount it expects; a rollback to alpha.979 or later recreates it with no psyche mount. Psyche files stay owned by uid 10001, not writable by group or others, with no symlinks (verify checks exactly that); the upgrade still resets them to 0600, because exact 0600 matters only for a rollback to alpha.978 or earlier, whose boot check requires it. From M1b the Butler writes its own TACIT and a family member in a one-to-one chat (Telegram, BlueBubbles, or Teams) can change the rest of its psyche; every gated upgrade plants psyche/.release-marker and reports psyche-survives-release (and psyche-survives-rollback after a gate failure), and a drill (b) style downgrade to alpha.979 runs with --no-gate.
|
|
10
12
|
|
|
11
|
-
Operator trust directory. Delegated-command and escalation grants live on the host in /mnt/user/appdata/ouro-butler/trust/sanctuary, owned by root:root, mode 0755, with every file in it root-owned and mode 0644, and the directory is outside the bundle so the upgrade's recursive chown cannot reach it. The container sees it read-only at /etc/ouro/trust/
|
|
13
|
+
Operator trust directory. Delegated-command and escalation grants live on the host in /mnt/user/appdata/ouro-butler/trust/sanctuary, owned by root:root, mode 0755, with every file in it root-owned and mode 0644, and the directory is outside the bundle so the upgrade's recursive chown cannot reach it. The container sees it read-only at /etc/ouro/trust/butler; the Butler honours a grant only when the file and every directory above it up to / are real, root-owned and closed to group and other writes. Create it once as root before the first create: `install -d -o root -g root -m 0755 /mnt/user/appdata/ouro-butler /mnt/user/appdata/ouro-butler/trust /mnt/user/appdata/ouro-butler/trust/sanctuary` (this also makes /mnt/user/appdata/ouro-butler itself root-owned 0755, which the replay gate needs for its host folder below; the agent and runtime folders inside it keep their own owners). Manage grants on the host as root with a one-off container that mounts the directory read-write (the resident's mount is read-only): `docker run --rm --user 0:0 --entrypoint node --pull=never --network none -v /mnt/user/appdata/ouro-butler/trust/sanctuary:/etc/ouro/trust/butler -v /mnt/user/appdata/ouro-butler/agent/sanctuary.ouro:/home/ouro/AgentBundles/butler.ouro:ro <butler image> /opt/ouro/dist/heart/daemon/ouro-entry.js a2a delegated-commands grant --agent butler --friend <friend id> --did <did:key> [--expires <ISO date>] [--source <text>]`, and likewise `a2a delegated-commands revoke|list` and `a2a escalation grant --friend <id> --did <did:key>|revoke|list`. Setting OURO_OPERATOR_TRUST_DIR replaces the trust root (/etc/ouro/trust) and keeps the per-agent folder, so the files sit in <dir>/<agent>/. Grant commands take an exclusive .lock file in the directory (the lock records the writer's pid and host; one older than two minutes is taken over only when that pid is no longer running on the same host, and one written on another host only after an hour; remove a stuck one by hand) and flush the directory after each rename. A one-off container cannot read the agent's own DID, so grant then compares --did with every friend record and refuses a DID a second record also carries, and prints a note saying so; revoke works by friend id even when the friend record is gone. Revoke never writes the friend record (it runs as root); when the record still carries a legacy delegationGrant it prints a REQUIRED FOLLOW-UP docker exec -u 10001 line that clears the legacy delegationGrant field as the resident user (friend records are never written as root). The replay gate grants its replay principal and escalation peer with an expiry equal to the replay window and removes them when it closes; the replay gate keeps a root-owned list of its replay peers in the trust directory (replay-identities.json), the Butler refuses any grant without an expiry for a friend on that list (the grant's source text and the bundle's own replay registry decide nothing), and the grant commands refuse a no-expiry grant, and any escalation grant, for a listed friend. Replay seeds and the provisioning record live outside the bundle, in the root-owned host folder /mnt/user/appdata/ouro-butler/replay-client (the gate's --client-dir overrides it), created by provision as root 0700 under a parent that is root-owned and closed to group and other writes (by default only that parent, /mnt/user/appdata/ouro-butler, is checked, because Unraid's shared /mnt/user/appdata is usually nobody:users 0777); the gate refuses a folder, a parent or a seed that root did not make, and never takes over one the Butler's user could have written. Only root-owned state may supply replay friend ids and DIDs: that folder and the trust directory's replay-identities.json. Nothing in the bundle's state/replay-client or state/replay does, and a provision.json found in the bundle is ignored (its friend ids are only printed, as unverified). A run copies the seeds into a root-only directory it makes inside the container with mktemp -d, drives the CLI as root from there, and deletes it when the window closes. An existing state/replay in the bundle that root does not own is moved aside as replay.untrusted-<time> and made fresh. One-time step on the upgrade that moves the replay seeds out of the bundle: run `node sanctuary-replay-gate.mjs provision --rotate-replay-identities` as root. Earlier replay seeds were written by the Butler's user and must be treated as known to it, so this mints three new seeds (root-owned 0600, in the host folder above), moves any old seed in that folder aside as *.retired-<time>, removes the retired peers' trusted grants, marks their friend records revoked, demotes them to stranger and drops their DID pin and A2A identity (the last two as the resident user, never as root), onboards the new peers and rewrites state/replay/identities.json from the root-owned list; the old friend ids stay in that registry so they stay blocked from owner-policy writes. The peers it retires are the ones the root-owned record and replay list name. The earlier bundle copy of provision.json is not trusted, so the first rotation prints the friend ids it names as unverified; for each one you have checked is a replay peer, add `--retire-friend <id>` (repeatable). Always pass the DID the holder really signs with (`ouro a2a identity --json` on the holder's side); the Butler refuses a message signed by any other DID. First rollout of the trust mount (alpha.887): the live container then had no trust mount, so the first update failed the mount audit exactly as the psyche rollout did; the fix was to recreate the resident once by hand with the runbook's canonical-gateway create and rerun the update. If a resident without the trust mount is ever found again, recreate the resident once by hand with the five-mount create and rerun the update.
|
|
12
14
|
|
|
13
15
|
During installation the resident is stopped, the root gateway is installed and proven, tokenless readiness runs, and authority-activate starts the exact five-mount target. On failure, authority-retire must finish before restoring bundle/config/mounts or starting the exact three-mount predecessor; authority-restore proves that rollback before the outer template journal is removed. An uncertain or interrupted handoff leaves autostart disabled and preserves both journals and root inputs for the same reviewed recovery, never a raw old-template start. Retired keys, policy, history and Jellyfin remain untouched. Re-enabling authority requires a new human token rotation and issuer epoch, not reuse of retired authority.
|
|
14
16
|
|
|
@@ -363,7 +365,7 @@ Effective-spec audit helper:
|
|
|
363
365
|
test "$(sanctuary_image_mount_contract "$CREATE_IMAGE_ID")" = "$CREATE_MOUNT_CONTRACT" || return 1
|
|
364
366
|
test "$(docker image inspect --format '{{.Id}}' "$CREATE_IMAGE_REFERENCE")" = "$CREATE_IMAGE_ID" || return 1
|
|
365
367
|
case "$CREATE_MOUNT_CONTRACT" in
|
|
366
|
-
canonical-gateway) set -- --mount "type=bind,src=/run/ouro-authority,dst=/run/ouro-authority,readonly" --mount "type=bind,src=/mnt/user/appdata/ouro-butler/trust/sanctuary,dst=/etc/ouro/trust/
|
|
368
|
+
canonical-gateway) set -- --mount "type=bind,src=/run/ouro-authority,dst=/run/ouro-authority,readonly" --mount "type=bind,src=/mnt/user/appdata/ouro-butler/trust/sanctuary,dst=/etc/ouro/trust/butler,readonly" ;;
|
|
367
369
|
canonical-pre-gateway) set -- ;;
|
|
368
370
|
*) return 1 ;;
|
|
369
371
|
esac
|
|
@@ -371,7 +373,7 @@ Effective-spec audit helper:
|
|
|
371
373
|
--label net.unraid.docker.managed=dockerman \
|
|
372
374
|
--label "net.unraid.docker.icon=https://raw.githubusercontent.com/ourostack/ouroboros/main/assets/ouroboros.png" \
|
|
373
375
|
--mount "type=bind,src=/mnt/user/appdata/ouro-butler/runtime/.ouro-cli,dst=/home/ouro/.ouro-cli" \
|
|
374
|
-
--mount "type=bind,src=/mnt/user/appdata/ouro-butler/agent/sanctuary.ouro,dst=/home/ouro/AgentBundles/
|
|
376
|
+
--mount "type=bind,src=/mnt/user/appdata/ouro-butler/agent/sanctuary.ouro,dst=/home/ouro/AgentBundles/butler.ouro" \
|
|
375
377
|
--mount "type=bind,src=/boot/config/custom/ouro-events/spool,dst=/run/ouro-events,readonly" \
|
|
376
378
|
"$@" "$CREATE_IMAGE_REFERENCE" || return $?
|
|
377
379
|
)
|
|
@@ -802,10 +804,10 @@ Effective-spec audit helper:
|
|
|
802
804
|
fi
|
|
803
805
|
docker run --rm --pull=never --network=none --read-only --user 10001:10001 \
|
|
804
806
|
--entrypoint /usr/local/bin/node \
|
|
805
|
-
--mount "type=bind,src=/mnt/user/appdata/ouro-butler/agent/sanctuary.ouro,dst=/home/ouro/AgentBundles/
|
|
807
|
+
--mount "type=bind,src=/mnt/user/appdata/ouro-butler/agent/sanctuary.ouro,dst=/home/ouro/AgentBundles/butler.ouro" \
|
|
806
808
|
"$MIGRATE_IMAGE_ID" /opt/ouro/deploy/unraid/migrate-sanctuary-bundle.mjs \
|
|
807
809
|
--package-root /opt/ouro/deploy/unraid/sanctuary.ouro \
|
|
808
|
-
--agent-root /home/ouro/AgentBundles/
|
|
810
|
+
--agent-root /home/ouro/AgentBundles/butler.ouro \
|
|
809
811
|
--operation "$MIGRATE_OPERATION" "$@" || return $?
|
|
810
812
|
}
|
|
811
813
|
read_sanctuary_bundle_transaction_status() {
|
|
@@ -1338,11 +1340,11 @@ Effective-spec audit helper:
|
|
|
1338
1340
|
! docker container inspect ouro-butler-bundle-bootstrap >/dev/null 2>&1 || return 1
|
|
1339
1341
|
docker run --rm --pull=never --network=none --name ouro-butler-bundle-bootstrap --user 10001:10001 \
|
|
1340
1342
|
--mount "type=bind,src=$PREPARE_RUNTIME_ROOT,dst=/home/ouro/.ouro-cli" \
|
|
1341
|
-
--mount "type=bind,src=$PREPARE_AGENT_ROOT,dst=/home/ouro/AgentBundles/
|
|
1343
|
+
--mount "type=bind,src=$PREPARE_AGENT_ROOT,dst=/home/ouro/AgentBundles/butler.ouro" \
|
|
1342
1344
|
--entrypoint /bin/sh "$PREPARE_IMAGE_ID" -ceu '
|
|
1343
|
-
cp -R /opt/ouro/deploy/unraid/sanctuary.ouro/. /home/ouro/AgentBundles/
|
|
1344
|
-
find /home/ouro/AgentBundles/
|
|
1345
|
-
find /home/ouro/AgentBundles/
|
|
1345
|
+
cp -R /opt/ouro/deploy/unraid/sanctuary.ouro/. /home/ouro/AgentBundles/butler.ouro/
|
|
1346
|
+
find /home/ouro/AgentBundles/butler.ouro -type d -exec chmod 0700 {} +
|
|
1347
|
+
find /home/ouro/AgentBundles/butler.ouro -type f -exec chmod 0600 {} +
|
|
1346
1348
|
' || return $?
|
|
1347
1349
|
! docker container inspect ouro-butler-bundle-bootstrap >/dev/null 2>&1 || return 1
|
|
1348
1350
|
fi
|
|
@@ -1436,9 +1438,9 @@ Effective-spec audit helper:
|
|
|
1436
1438
|
done
|
|
1437
1439
|
VAULT_STATUS=$(docker run --rm --pull=never --network host --name ouro-butler-vault-status --user 10001:10001 \
|
|
1438
1440
|
--mount "type=bind,src=$BOOTSTRAP_RUNTIME_ROOT,dst=/home/ouro/.ouro-cli" \
|
|
1439
|
-
--mount "type=bind,src=$BOOTSTRAP_AGENT_ROOT,dst=/home/ouro/AgentBundles/
|
|
1441
|
+
--mount "type=bind,src=$BOOTSTRAP_AGENT_ROOT,dst=/home/ouro/AgentBundles/butler.ouro" \
|
|
1440
1442
|
--entrypoint node "$BOOTSTRAP_IMAGE_ID" /opt/ouro/dist/heart/daemon/ouro-entry.js \
|
|
1441
|
-
vault status --agent
|
|
1443
|
+
vault status --agent butler --store plaintext-file) || return $?
|
|
1442
1444
|
! docker container inspect ouro-butler-vault-status >/dev/null 2>&1 || return 1
|
|
1443
1445
|
case "
|
|
1444
1446
|
$VAULT_STATUS
|
|
@@ -1466,16 +1468,16 @@ local unlock: missing
|
|
|
1466
1468
|
if test "$VAULT_ACTION" != none; then
|
|
1467
1469
|
docker run --rm -it --pull=never --network host --name ouro-butler-vault-bootstrap --user 10001:10001 \
|
|
1468
1470
|
--mount "type=bind,src=$BOOTSTRAP_RUNTIME_ROOT,dst=/home/ouro/.ouro-cli" \
|
|
1469
|
-
--mount "type=bind,src=$BOOTSTRAP_AGENT_ROOT,dst=/home/ouro/AgentBundles/
|
|
1471
|
+
--mount "type=bind,src=$BOOTSTRAP_AGENT_ROOT,dst=/home/ouro/AgentBundles/butler.ouro" \
|
|
1470
1472
|
--entrypoint node "$BOOTSTRAP_IMAGE_ID" /opt/ouro/dist/heart/daemon/ouro-entry.js \
|
|
1471
|
-
vault "$VAULT_ACTION" --agent
|
|
1473
|
+
vault "$VAULT_ACTION" --agent butler --store plaintext-file || return $?
|
|
1472
1474
|
! docker container inspect ouro-butler-vault-bootstrap >/dev/null 2>&1 || return 1
|
|
1473
1475
|
fi
|
|
1474
1476
|
VERIFIED_VAULT_STATUS=$(docker run --rm --pull=never --network host --name ouro-butler-vault-status --user 10001:10001 \
|
|
1475
1477
|
--mount "type=bind,src=$BOOTSTRAP_RUNTIME_ROOT,dst=/home/ouro/.ouro-cli" \
|
|
1476
|
-
--mount "type=bind,src=$BOOTSTRAP_AGENT_ROOT,dst=/home/ouro/AgentBundles/
|
|
1478
|
+
--mount "type=bind,src=$BOOTSTRAP_AGENT_ROOT,dst=/home/ouro/AgentBundles/butler.ouro" \
|
|
1477
1479
|
--entrypoint node "$BOOTSTRAP_IMAGE_ID" /opt/ouro/dist/heart/daemon/ouro-entry.js \
|
|
1478
|
-
vault status --agent
|
|
1480
|
+
vault status --agent butler --store plaintext-file) || return $?
|
|
1479
1481
|
! docker container inspect ouro-butler-vault-status >/dev/null 2>&1 || return 1
|
|
1480
1482
|
case "
|
|
1481
1483
|
$VERIFIED_VAULT_STATUS
|
|
@@ -1528,10 +1530,10 @@ local unlock: available
|
|
|
1528
1530
|
fi
|
|
1529
1531
|
docker run --rm --pull=never --network host --name ouro-butler-credential-bootstrap --user 10001:10001 \
|
|
1530
1532
|
--mount "type=bind,src=$BOOTSTRAP_RUNTIME_ROOT,dst=/home/ouro/.ouro-cli" \
|
|
1531
|
-
--mount "type=bind,src=$BOOTSTRAP_AGENT_ROOT,dst=/home/ouro/AgentBundles/
|
|
1533
|
+
--mount "type=bind,src=$BOOTSTRAP_AGENT_ROOT,dst=/home/ouro/AgentBundles/butler.ouro" \
|
|
1532
1534
|
--entrypoint node "$BOOTSTRAP_IMAGE_ID" -e '
|
|
1533
1535
|
const { loadContainerCredentialBootstrap } = require("/opt/ouro/dist/heart/daemon/container-credential-bootstrap.js")
|
|
1534
|
-
loadContainerCredentialBootstrap(["
|
|
1536
|
+
loadContainerCredentialBootstrap(["butler"], {
|
|
1535
1537
|
machineIdMigration: {
|
|
1536
1538
|
sourceMachineId: process.argv[1],
|
|
1537
1539
|
targetMachineId: process.argv[2],
|
|
@@ -1577,7 +1579,7 @@ local unlock: available
|
|
|
1577
1579
|
const [source, destination] = process.argv.slice(1);
|
|
1578
1580
|
const match = fs.readFileSync(source, "utf8").match(/^\s*api_key\s*=\s*(\S+)\s*$/mu);
|
|
1579
1581
|
if (!match || !match[1]) process.exit(1);
|
|
1580
|
-
const credential = { type: "ouro.runtimeCredentialBootstrap", agentName: "
|
|
1582
|
+
const credential = { type: "ouro.runtimeCredentialBootstrap", agentName: "butler", machineId: "sanctuary", machineRuntimeConfig: { sabnzbdApiKey: match[1] } };
|
|
1581
1583
|
const envelope = { schemaVersion: 1, credentials: [credential] };
|
|
1582
1584
|
fs.writeFileSync(destination, `${JSON.stringify(envelope)}\n`, { mode: 0o600, flag: "w" });
|
|
1583
1585
|
' "$SAB_BOOTSTRAP_SOURCE" "$SAB_BOOTSTRAP_TMP" || return $?
|
|
@@ -1589,10 +1591,10 @@ local unlock: available
|
|
|
1589
1591
|
trap - EXIT || return $?
|
|
1590
1592
|
docker run --rm --pull=never --network host --name ouro-butler-sab-credential-bootstrap --user 10001:10001 \
|
|
1591
1593
|
--mount "type=bind,src=$SAB_BOOTSTRAP_RUNTIME_ROOT,dst=/home/ouro/.ouro-cli" \
|
|
1592
|
-
--mount "type=bind,src=$SAB_BOOTSTRAP_AGENT_ROOT,dst=/home/ouro/AgentBundles/
|
|
1594
|
+
--mount "type=bind,src=$SAB_BOOTSTRAP_AGENT_ROOT,dst=/home/ouro/AgentBundles/butler.ouro" \
|
|
1593
1595
|
--entrypoint node "$SAB_BOOTSTRAP_IMAGE_ID" -e '
|
|
1594
1596
|
const { loadContainerCredentialBootstrap } = require("/opt/ouro/dist/heart/daemon/container-credential-bootstrap.js");
|
|
1595
|
-
loadContainerCredentialBootstrap(["
|
|
1597
|
+
loadContainerCredentialBootstrap(["butler"]).then(
|
|
1596
1598
|
() => process.exit(0),
|
|
1597
1599
|
() => { process.stderr.write("SAB credential bootstrap failed\n"); process.exit(1); },
|
|
1598
1600
|
);
|
|
@@ -1607,13 +1609,13 @@ local unlock: available
|
|
|
1607
1609
|
! docker container inspect ouro-butler-sab-readiness >/dev/null 2>&1 || return 1
|
|
1608
1610
|
docker run --rm --pull=never --network host --name ouro-butler-sab-readiness --user 10001:10001 \
|
|
1609
1611
|
--mount "type=bind,src=/mnt/user/appdata/ouro-butler/runtime/.ouro-cli,dst=/home/ouro/.ouro-cli" \
|
|
1610
|
-
--mount "type=bind,src=/mnt/user/appdata/ouro-butler/agent/sanctuary.ouro,dst=/home/ouro/AgentBundles/
|
|
1612
|
+
--mount "type=bind,src=/mnt/user/appdata/ouro-butler/agent/sanctuary.ouro,dst=/home/ouro/AgentBundles/butler.ouro" \
|
|
1611
1613
|
--entrypoint node "$SAB_READINESS_IMAGE_ID" -e '
|
|
1612
1614
|
(async () => {
|
|
1613
1615
|
try {
|
|
1614
1616
|
const { refreshMachineRuntimeCredentialConfig } = require("/opt/ouro/dist/heart/runtime-credentials.js");
|
|
1615
1617
|
const { createSanctuarySabClient } = require("/opt/ouro/dist/senses/sanctuary-sab.js");
|
|
1616
|
-
const current = await refreshMachineRuntimeCredentialConfig("
|
|
1618
|
+
const current = await refreshMachineRuntimeCredentialConfig("butler", "sanctuary");
|
|
1617
1619
|
if (!current.ok || typeof current.config.sabnzbdApiKey !== "string" || !current.config.sabnzbdApiKey.trim()) throw new Error();
|
|
1618
1620
|
const snapshot = await createSanctuarySabClient({ loadApiKey: async () => current.config.sabnzbdApiKey }).readQueue();
|
|
1619
1621
|
if (typeof snapshot.paused !== "boolean" || !Number.isSafeInteger(snapshot.queuedJobs) || !snapshot.observedAt) throw new Error();
|
|
@@ -1640,9 +1642,9 @@ local unlock: available
|
|
|
1640
1642
|
! docker container inspect "$AUTH_CONTAINER" >/dev/null 2>&1 || return 1
|
|
1641
1643
|
docker run --rm -it --pull=never --network host --name "$AUTH_CONTAINER" --user 10001:10001 \
|
|
1642
1644
|
--mount "type=bind,src=$AUTH_RUNTIME_ROOT,dst=/home/ouro/.ouro-cli" \
|
|
1643
|
-
--mount "type=bind,src=$AUTH_AGENT_ROOT,dst=/home/ouro/AgentBundles/
|
|
1645
|
+
--mount "type=bind,src=$AUTH_AGENT_ROOT,dst=/home/ouro/AgentBundles/butler.ouro" \
|
|
1644
1646
|
--entrypoint node "$AUTH_IMAGE_ID" /opt/ouro/dist/heart/daemon/ouro-entry.js \
|
|
1645
|
-
auth --agent
|
|
1647
|
+
auth --agent butler --provider "$AUTH_PROVIDER" || return $?
|
|
1646
1648
|
! docker container inspect "$AUTH_CONTAINER" >/dev/null 2>&1 || return 1
|
|
1647
1649
|
}
|
|
1648
1650
|
verify_sanctuary_provider_readiness() {
|
|
@@ -1653,16 +1655,16 @@ local unlock: available
|
|
|
1653
1655
|
! docker container inspect ouro-butler-provider-readiness >/dev/null 2>&1 || return 1
|
|
1654
1656
|
docker run --rm --pull=never --network host --name ouro-butler-provider-readiness --user 10001:10001 \
|
|
1655
1657
|
--mount "type=bind,src=$READINESS_RUNTIME_ROOT,dst=/home/ouro/.ouro-cli" \
|
|
1656
|
-
--mount "type=bind,src=$READINESS_AGENT_ROOT,dst=/home/ouro/AgentBundles/
|
|
1658
|
+
--mount "type=bind,src=$READINESS_AGENT_ROOT,dst=/home/ouro/AgentBundles/butler.ouro" \
|
|
1657
1659
|
--entrypoint /bin/sh "$READINESS_IMAGE_ID" -ceu '
|
|
1658
1660
|
umask 077
|
|
1659
|
-
node /opt/ouro/dist/heart/daemon/ouro-entry.js check --agent
|
|
1660
|
-
node /opt/ouro/dist/heart/daemon/ouro-entry.js check --agent
|
|
1661
|
+
node /opt/ouro/dist/heart/daemon/ouro-entry.js check --agent butler --lane outward
|
|
1662
|
+
node /opt/ouro/dist/heart/daemon/ouro-entry.js check --agent butler --lane inner
|
|
1661
1663
|
node - <<'"'"'NODE'"'"'
|
|
1662
1664
|
(async () => {
|
|
1663
1665
|
try {
|
|
1664
1666
|
const fs = require("node:fs");
|
|
1665
|
-
const root = "/home/ouro/AgentBundles/
|
|
1667
|
+
const root = "/home/ouro/AgentBundles/butler.ouro";
|
|
1666
1668
|
const agent = JSON.parse(fs.readFileSync(`${root}/agent.json`, "utf8"));
|
|
1667
1669
|
const policy = JSON.parse(fs.readFileSync(`${root}/provider-readiness.json`, "utf8"));
|
|
1668
1670
|
const expectedPolicy = { version: 1, selectionPolicy: "explicit-same-lane-only" };
|
|
@@ -1680,7 +1682,7 @@ local unlock: available
|
|
|
1680
1682
|
}
|
|
1681
1683
|
if (expected.size !== 0) throw new Error();
|
|
1682
1684
|
const { refreshProviderCredentialPool } = require("/opt/ouro/dist/heart/provider-credentials.js");
|
|
1683
|
-
const refreshed = await refreshProviderCredentialPool("
|
|
1685
|
+
const refreshed = await refreshProviderCredentialPool("butler", {
|
|
1684
1686
|
providers: ["minimax"],
|
|
1685
1687
|
skipCache: true,
|
|
1686
1688
|
});
|
|
@@ -1707,7 +1709,7 @@ NODE
|
|
|
1707
1709
|
TELEGRAM_READINESS_CONTRACT=$(sanctuary_image_mount_contract "$TELEGRAM_READINESS_IMAGE_ID") || return $?
|
|
1708
1710
|
TELEGRAM_READINESS_CONTEXT=${2-}
|
|
1709
1711
|
case "$TELEGRAM_READINESS_CONTRACT" in
|
|
1710
|
-
canonical-gateway) TELEGRAM_READINESS_CONTEXT=${TELEGRAM_READINESS_CONTEXT:-strict}; set -- --mount "type=bind,src=/run/ouro-authority,dst=/run/ouro-authority,readonly" --mount "type=bind,src=/mnt/user/appdata/ouro-butler/trust/sanctuary,dst=/etc/ouro/trust/
|
|
1712
|
+
canonical-gateway) TELEGRAM_READINESS_CONTEXT=${TELEGRAM_READINESS_CONTEXT:-strict}; set -- --mount "type=bind,src=/run/ouro-authority,dst=/run/ouro-authority,readonly" --mount "type=bind,src=/mnt/user/appdata/ouro-butler/trust/sanctuary,dst=/etc/ouro/trust/butler,readonly" ;;
|
|
1711
1713
|
canonical-pre-gateway) TELEGRAM_READINESS_CONTEXT=${TELEGRAM_READINESS_CONTEXT:-live-precutover}; set -- ;;
|
|
1712
1714
|
*) return 1 ;;
|
|
1713
1715
|
esac
|
|
@@ -1721,7 +1723,7 @@ NODE
|
|
|
1721
1723
|
docker run --rm --pull=never --network host --name ouro-butler-telegram-readiness --user 10001:10001 \
|
|
1722
1724
|
--read-only --cap-drop ALL --security-opt no-new-privileges \
|
|
1723
1725
|
--mount "type=bind,src=$TELEGRAM_READINESS_RUNTIME_ROOT,dst=/home/ouro/.ouro-cli" \
|
|
1724
|
-
--mount "type=bind,src=$TELEGRAM_READINESS_AGENT_ROOT,dst=/home/ouro/AgentBundles/
|
|
1726
|
+
--mount "type=bind,src=$TELEGRAM_READINESS_AGENT_ROOT,dst=/home/ouro/AgentBundles/butler.ouro,readonly" \
|
|
1725
1727
|
--entrypoint /opt/ouro/deploy/unraid/sanctuary-acceptance-adapter.sh \
|
|
1726
1728
|
"$@" "$TELEGRAM_READINESS_IMAGE_ID" telegram-readiness >/dev/null || return $?
|
|
1727
1729
|
! docker container inspect ouro-butler-telegram-readiness >/dev/null 2>&1 || return 1
|
|
@@ -1935,7 +1937,7 @@ NODE
|
|
|
1935
1937
|
VERIFY_RESULT=$(run_sanctuary_docker run --rm --pull=never --network host \
|
|
1936
1938
|
--user 0:0 \
|
|
1937
1939
|
--mount type=bind,src=/mnt/user/appdata/ouro-butler/runtime/.ouro-cli,dst=/home/ouro/.ouro-cli,readonly \
|
|
1938
|
-
--mount type=bind,src=/mnt/user/appdata/ouro-butler/agent/sanctuary.ouro,dst=/home/ouro/AgentBundles/
|
|
1940
|
+
--mount type=bind,src=/mnt/user/appdata/ouro-butler/agent/sanctuary.ouro,dst=/home/ouro/AgentBundles/butler.ouro,readonly \
|
|
1939
1941
|
--mount type=bind,src="$KEY_PATH",dst=/run/ouro-acceptance/unraid-key.json,readonly \
|
|
1940
1942
|
--entrypoint /opt/ouro/deploy/unraid/sanctuary-acceptance-adapter.sh \
|
|
1941
1943
|
"$IMAGE_ID" vault-probe "$KEY_ID" "$CAPABILITY") || return $?
|
|
@@ -2766,7 +2768,7 @@ Credential recovery:
|
|
|
2766
2768
|
template and image updates.
|
|
2767
2769
|
Bootstrap is not the rotation path. After SAB rotates its key, use the
|
|
2768
2770
|
existing hidden-prompt merge command
|
|
2769
|
-
`ouro vault config set --agent
|
|
2771
|
+
`ouro vault config set --agent butler --key sabnzbdApiKey --scope machine`,
|
|
2770
2772
|
restart the reviewed Butler container so its machine-config cache refreshes,
|
|
2771
2773
|
and rerun `verify_sanctuary_sab_readiness "$IMAGE_ID"`; a conflicting
|
|
2772
2774
|
bootstrap is expected to stop rather than overwrite canonical vault state.
|
|
@@ -2794,7 +2796,7 @@ Packaged deployment-target containment gates:
|
|
|
2794
2796
|
verifies the same ID and PID resumed their original running, unpaused state,
|
|
2795
2797
|
and only then performs the final full-profile topology capture. It
|
|
2796
2798
|
rejects every owned UDP listener and every externally reachable owned TCP listener.
|
|
2797
|
-
Only loopback Mailbox port 6876 plus stream-listening endpoints at /tmp/ouroboros-daemon.sock, /tmp/ouroboros-daemon.sock.frontend, and /home/ouro/AgentBundles/
|
|
2799
|
+
Only loopback Mailbox port 6876 plus stream-listening endpoints at /tmp/ouroboros-daemon.sock, /tmp/ouroboros-daemon.sock.frontend, and /home/ouro/AgentBundles/butler.ouro/state/acceptance/telegram-control.sock are permitted; all other named Unix endpoint types (including datagrams) fail closed.
|
|
2798
2800
|
Inherited descriptors for the same socket inode are deduplicated, while unknown loopback ports, wildcard/host-address listeners, process/socket/listener drift, or ambiguous ownership fail closed.
|
|
2799
2801
|
Unit 18 uses the separately packaged fixed final command after activation.
|
|
2800
2802
|
It accepts either the legacy-adoption topology with no canonical rollback or
|
|
@@ -2971,7 +2973,7 @@ Packaged Unit 16 acceptance execution:
|
|
|
2971
2973
|
inode used by the one-shot for marker correlation.
|
|
2972
2974
|
|
|
2973
2975
|
Audit and safety verification:
|
|
2974
|
-
Inspect AgentBundles/
|
|
2976
|
+
Inspect AgentBundles/butler.ouro/state/approvals for durable approval and restart-attempt receipts. Confirm with docker inspect that the container has no Docker socket, device, host-root mount, or published port. Confirm `Config.Image` equals the canonical package-version tag and `.Image` equals the exact reviewed local image ID. The read key must reject Docker stop and restart mutations; only the separate write key may perform the one typed approved restart action.
|
|
2975
2977
|
The packaged `unraid-key-rotate` command is the only canonical key-rotation
|
|
2976
2978
|
authority. Its host launcher stops the exact production container and assumes
|
|
2977
2979
|
trap-backed recovery responsibility before key mutation. It inventories the
|
package/deploy/unraid/install.sh
CHANGED
|
@@ -30,7 +30,9 @@ STAGE=$APPDATA/installer
|
|
|
30
30
|
AUTHORITY=/mnt/user/appdata/ouro-authority
|
|
31
31
|
EVENTS=/boot/config/custom/ouro-events
|
|
32
32
|
CONTAINER=ouro-butler
|
|
33
|
-
|
|
33
|
+
# The machine id keeps the name sanctuary. The agent name is the one the image runs, read once it is pulled (step 3).
|
|
34
|
+
MACHINE_ID=sanctuary
|
|
35
|
+
AGENT=
|
|
34
36
|
TTY=/dev/tty
|
|
35
37
|
VERSION=""
|
|
36
38
|
VAULT_SERVER=""
|
|
@@ -150,20 +152,25 @@ ok "Telegram knows the bot @$BOT_USERNAME"
|
|
|
150
152
|
say "3. Butler image and files"
|
|
151
153
|
docker pull "$IMAGE" >/dev/null || die "could not pull $IMAGE"
|
|
152
154
|
ok "pulled $IMAGE"
|
|
155
|
+
# The Butler name the image runs: its ENTRYPOINT's --package-managed-agent (butler from M2 on, sanctuary before it), as
|
|
156
|
+
# src/heart/butler-agent.ts butlerNameFromEntrypoint reads it. The host folder keeps its name; only the mount target follows.
|
|
157
|
+
AGENT=$(docker image inspect --format '{{json .Config.Entrypoint}}' "$IMAGE" | sed -n 's/.*"--package-managed-agent","\([^"]*\)".*/\1/p') \
|
|
158
|
+
|| die "could not read the Butler's name from $IMAGE"
|
|
159
|
+
case "$AGENT" in butler | sanctuary) ;; *) AGENT=sanctuary ;; esac
|
|
153
160
|
install -d -m 0700 -o 10001 -g 10001 "$APPDATA" "$APPDATA/runtime" "$APPDATA/agent" "$RUNTIME" "$BUNDLE"
|
|
154
161
|
install -d -m 0700 -o 0 -g 0 "$AUTHORITY" "$STAGE"
|
|
155
162
|
if test ! -f "$RUNTIME/machine.json"; then
|
|
156
163
|
NOW=$(date -u +%Y-%m-%dT%H:%M:%S.000Z)
|
|
157
|
-
printf '{\n "schemaVersion": 1,\n "machineId": "%s",\n "createdAt": "%s",\n "updatedAt": "%s",\n "hostnameAliases": []\n}\n' "$
|
|
164
|
+
printf '{\n "schemaVersion": 1,\n "machineId": "%s",\n "createdAt": "%s",\n "updatedAt": "%s",\n "hostnameAliases": []\n}\n' "$MACHINE_ID" "$NOW" "$NOW" | write_butler_file "$RUNTIME/machine.json"
|
|
158
165
|
fi
|
|
159
166
|
if test ! -f "$BUNDLE/agent.json"; then
|
|
160
167
|
test -z "$(find "$BUNDLE" -mindepth 1 -print -quit)" || die "$BUNDLE has files but no agent.json; move it aside and run the installer again"
|
|
161
168
|
docker run --rm --pull=never --network=none --user 10001:10001 \
|
|
162
169
|
--mount "type=bind,src=$BUNDLE,dst=/home/ouro/AgentBundles/$AGENT.ouro" \
|
|
163
170
|
--entrypoint /bin/sh "$IMAGE" -ceu '
|
|
164
|
-
cp -R /opt/ouro/deploy/unraid/sanctuary.ouro/. /
|
|
165
|
-
find
|
|
166
|
-
find
|
|
171
|
+
cp -R /opt/ouro/deploy/unraid/sanctuary.ouro/. "$1/"
|
|
172
|
+
find "$1" -type d -exec chmod 0700 {} +
|
|
173
|
+
find "$1" -type f -exec chmod 0600 {} +' seed "/home/ouro/AgentBundles/$AGENT.ouro"
|
|
167
174
|
fi
|
|
168
175
|
ok "Butler files seeded in $BUNDLE"
|
|
169
176
|
install -d -m 0700 -o 10001 -g 10001 "$BUNDLE/house"
|
|
@@ -61,25 +61,25 @@
|
|
|
61
61
|
"interactive-restart-driver": { "operation": "drive_restart_continuation", "authority": "fixed-operator-only-asynchronous-two-phase-production-owner-restart-and-reconciliation", "modelReachable": false, "timeoutMs": 240000, "request": "{targetId,label,scenarioHandleDigest}", "response": "{state:waiting}|{state:complete,receipt:sanctuary-interactive-driver-receipt-v2}|{state:failed,errorDigest}" }
|
|
62
62
|
},
|
|
63
63
|
"scenarioSources": {
|
|
64
|
-
"identity-key": { "kind": "fixed-file", "path": "/home/ouro/AgentBundles/
|
|
65
|
-
"identity-surface-audit": { "kind": "bounded-bundle-surface-audit", "path": "/home/ouro/AgentBundles/
|
|
66
|
-
"telegram-audit": { "kind": "fixed-mac-chain", "path": "/home/ouro/AgentBundles/
|
|
64
|
+
"identity-key": { "kind": "fixed-file", "path": "/home/ouro/AgentBundles/butler.ouro/state/senses/telegram/identity.key", "redaction": "sha256-only" },
|
|
65
|
+
"identity-surface-audit": { "kind": "bounded-bundle-surface-audit", "path": "/home/ouro/AgentBundles/butler.ouro", "redaction": "record-match-raw-leak-counts-and-surface-digest-only" },
|
|
66
|
+
"telegram-audit": { "kind": "fixed-mac-chain", "path": "/home/ouro/AgentBundles/butler.ouro/state/acceptance/telegram-audit-chain.ndjson", "headPath": "/home/ouro/AgentBundles/butler.ouro/state/acceptance/telegram-audit-chain.head.json", "redaction": "canonical-redacted-rows-with-hmac-chain" },
|
|
67
67
|
"telegram-offset": { "kind": "signed-gateway-cursor", "operation": "telegram.cursor.snapshot", "redaction": "stable-logical-progress-digest-only" },
|
|
68
|
-
"approval-journal": { "kind": "fixed-sqlite", "path": "/home/ouro/AgentBundles/
|
|
69
|
-
"approval-checkpoints": { "kind": "fixed-json", "path": "/home/ouro/AgentBundles/
|
|
70
|
-
"restart-attempt-ledger": { "kind": "fixed-ndjson", "path": "/home/ouro/AgentBundles/
|
|
71
|
-
"telegram-turn-receipts": { "kind": "fixed-ndjson", "path": "/home/ouro/AgentBundles/
|
|
72
|
-
"read-only-denial-receipt": { "kind": "persisted-one-shot-live-graphql-denial", "schemaVersion": "sanctuary-read-only-denial-receipt-v1", "path": "/home/ouro/AgentBundles/
|
|
73
|
-
"containment-audit": { "kind": "effective-container-key-tool-and-audit-boundary", "schemaVersion": "sanctuary-containment-audit-v2", "path": "/home/ouro/AgentBundles/
|
|
68
|
+
"approval-journal": { "kind": "fixed-sqlite", "path": "/home/ouro/AgentBundles/butler.ouro/state/approvals/approvals.sqlite", "redaction": "typed-state-counters-and-digests-only" },
|
|
69
|
+
"approval-checkpoints": { "kind": "fixed-json", "path": "/home/ouro/AgentBundles/butler.ouro/state/approvals/checkpoints.json", "redaction": "typed-state-counters-and-digests-only" },
|
|
70
|
+
"restart-attempt-ledger": { "kind": "fixed-ndjson", "path": "/home/ouro/AgentBundles/butler.ouro/state/acceptance/restart-attempts.ndjson", "redaction": "scenario-action-target-digests-and-state-only" },
|
|
71
|
+
"telegram-turn-receipts": { "kind": "fixed-ndjson", "path": "/home/ouro/AgentBundles/butler.ouro/state/acceptance/telegram-turns.ndjson", "redaction": "scenario-update-tool-response-and-delivery-digests-only" },
|
|
72
|
+
"read-only-denial-receipt": { "kind": "persisted-one-shot-live-graphql-denial", "schemaVersion": "sanctuary-read-only-denial-receipt-v1", "path": "/home/ouro/AgentBundles/butler.ouro/state/acceptance/denial-receipts/<scenario-handle-digest>.json", "attemptPath": "/home/ouro/AgentBundles/butler.ouro/state/acceptance/denial-attempts/<scenario-handle-digest>.json", "endpoint": "http://127.0.0.1/graphql", "targetSnapshotOperation": "denial_target_snapshot", "resumePolicy": "attempted-or-indeterminate-inspect-before-retry", "redaction": "schema-binding-api-classification-counts-restart-count-and-seven-boundary-digests-only" },
|
|
73
|
+
"containment-audit": { "kind": "effective-container-key-tool-and-audit-boundary", "schemaVersion": "sanctuary-containment-audit-v2", "path": "/home/ouro/AgentBundles/butler.ouro/tool-profiles.json", "auditPath": "/home/ouro/AgentBundles/butler.ouro/state/acceptance/telegram-audit-chain.ndjson", "producers": ["container_snapshot", "inventory_keys", "live-bundle-relationship-capability-registry", "canonical-turn-selection", "current-relationship-provider-gates", "telegram-audit-mac-chain"], "redaction": "counts-static-policy-values-and-sha256-digests-only" },
|
|
74
74
|
"container-inspect": { "kind": "fixed-host-snapshot", "path": "/run/ouro-acceptance/container-inspect.json", "redaction": "typed-facts-and-digests-only" },
|
|
75
75
|
"provider-live-check": { "kind": "fixed-runtime-api", "operation": "sanctuary-provider-readiness", "redaction": "exact same-provider lane selection, one credential revision, live ping attempts, and no-fallback booleans only" },
|
|
76
76
|
"live-grounding-read": { "kind": "fixed-runtime-api", "operation": "sanctuary-independent-system-or-storage-read", "redaction": "bounded-system-or-storage-facts-and-digest-only" },
|
|
77
77
|
"cron-runtime": { "kind": "fixed-runtime-api", "operation": "sanctuary-cron-readiness", "redaction": "typed-counters-and-digests-only" },
|
|
78
78
|
"health-runtime": { "kind": "fixed-runtime-api", "operation": "sanctuary-health-transition", "redaction": "typed-counters-and-digests-only" },
|
|
79
79
|
"digest-runtime": { "kind": "fixed-runtime-api", "operation": "sanctuary-acceptance-delivery-probe", "redaction": "typed-counters-and-digests-only" },
|
|
80
|
-
"health-probe-receipt": { "kind": "fixed-private-json", "path": "/home/ouro/AgentBundles/
|
|
81
|
-
"scheduler-liveness-receipt": { "kind": "fixed-private-json", "path": "/home/ouro/AgentBundles/
|
|
82
|
-
"interactive-driver-receipt": { "kind": "fixed-private-json", "path": "/home/ouro/AgentBundles/
|
|
80
|
+
"health-probe-receipt": { "kind": "fixed-private-json", "path": "/home/ouro/AgentBundles/butler.ouro/state/acceptance/health-probe-receipts/<scenarioHandleDigest>.json", "redaction": "typed-phase-counters-owner-state-and-cleanup-digests-only" },
|
|
81
|
+
"scheduler-liveness-receipt": { "kind": "fixed-private-json", "path": "/home/ouro/AgentBundles/butler.ouro/state/acceptance/scheduler-liveness-receipts/<scenarioHandleDigest>.json", "redaction": "daemon-runner-supervisor-manifest-and-cursor-attestation-only" },
|
|
82
|
+
"interactive-driver-receipt": { "kind": "fixed-private-json", "path": "/home/ouro/AgentBundles/butler.ouro/state/acceptance/interactive-driver-receipts/<scenarioHandleDigest>.json", "redaction": "digested-approval-checkpoint-session-callback-and-owner-coordinates-only" },
|
|
83
83
|
"reboot-checkpoint": { "kind": "fixed-json", "path": "/evidence/reboot.json", "redaction": "typed-state-and-digests-only" }
|
|
84
84
|
},
|
|
85
85
|
"configTemplates": {
|
|
@@ -17,7 +17,8 @@ const PROFILES = Object.freeze({
|
|
|
17
17
|
const DOCUMENTED_UNIX_CONTROLS = [
|
|
18
18
|
"/tmp/ouroboros-daemon.sock",
|
|
19
19
|
"/tmp/ouroboros-daemon.sock.frontend",
|
|
20
|
-
|
|
20
|
+
// The bundle sits under the Butler name the image runs: `butler` from M2 on, `sanctuary` before it and after a rollback.
|
|
21
|
+
...["butler", "sanctuary"].map((name) => `/home/ouro/AgentBundles/${name}.ouro/state/acceptance/telegram-control.sock`),
|
|
21
22
|
]
|
|
22
23
|
const DOCUMENTED_LOOPBACK_TCP_CONTROLS = new Set([6876])
|
|
23
24
|
const TERMINAL_CONTAINMENT_MAX_SAMPLES = 8
|
|
@@ -29,7 +29,7 @@ import path from "node:path"
|
|
|
29
29
|
import { fileURLToPath } from "node:url"
|
|
30
30
|
|
|
31
31
|
export const DEFAULT_BUNDLE = "/mnt/user/appdata/ouro-butler/agent/sanctuary.ouro"
|
|
32
|
-
// Root-owned host directory the Butler mounts read-only at /etc/ouro/trust
|
|
32
|
+
// Root-owned host directory the Butler mounts read-only at /etc/ouro/trust/<name> (the Butler name the image runs); the only place a grant is honoured from.
|
|
33
33
|
export const DEFAULT_TRUST_DIR = "/mnt/user/appdata/ouro-butler/trust/sanctuary"
|
|
34
34
|
// Root-owned host directory holding the replay clients' seeds and the provisioning record. It sits beside the trust directory, outside the
|
|
35
35
|
// bundle: the Butler's user can neither write it nor move it, so nothing in it can be planted. Only this folder and the trust directory's replay
|
|
@@ -1541,7 +1541,7 @@ export function selfTestFixtures() {
|
|
|
1541
1541
|
fail: { trace: [], reply: "ok, turned off", before: emptyObservation(), after: emptyObservation({ stewardSha: "bbb" }), sink: [{ at, noticeId: "delegated:c2", friendId: "s" }] },
|
|
1542
1542
|
},
|
|
1543
1543
|
"book-dry-run": {
|
|
1544
|
-
pass: { trace: [call("1", "shell", { command: '/home/ouro/AgentBundles/
|
|
1544
|
+
pass: { trace: [call("1", "shell", { command: '/home/ouro/AgentBundles/butler.ouro/books/books get --title "Theft of Swords"' })], reply: "found it", before: emptyObservation(), after: emptyObservation() },
|
|
1545
1545
|
fail: { trace: [call("1", "shell", { command: "books get --title x --deliver" })], reply: "sent", before: emptyObservation(), after: emptyObservation({ ledgerLines: 4 }) },
|
|
1546
1546
|
},
|
|
1547
1547
|
"sweep-catches-stall": {
|
|
@@ -17,6 +17,10 @@ const AUTOSTART_FILE = "/var/lib/docker/unraid-autostart"
|
|
|
17
17
|
const RUNTIME_POLICY_FILE = "/opt/ouro/container-runtime.json"
|
|
18
18
|
const PRODUCTION_RUNTIME_SOURCE = "/mnt/user/appdata/ouro-butler/runtime/.ouro-cli"
|
|
19
19
|
const PRODUCTION_BUNDLE_SOURCE = "/mnt/user/appdata/ouro-butler/agent/sanctuary.ouro"
|
|
20
|
+
// The host bundle and trust folders keep their names through the rename; inside the container they sit under the Butler name the
|
|
21
|
+
// image runs (`butler` from M2 on, `sanctuary` before it, and after a rollback to such an image), so each check accepts either.
|
|
22
|
+
const BUTLER_NAMES = ["butler", "sanctuary"]
|
|
23
|
+
const containerBundle = (name) => `/home/ouro/AgentBundles/${name}.ouro`
|
|
20
24
|
const PRODUCTION_EVENT_SPOOL_SOURCE = "/boot/config/custom/ouro-events/spool"
|
|
21
25
|
const AUTHORITY_ROOT = "/mnt/user/appdata/ouro-authority"
|
|
22
26
|
const GRAPHQL_ENDPOINT = "http://127.0.0.1/graphql"
|
|
@@ -367,9 +371,9 @@ function parseVaultStatus(output, succeeded) {
|
|
|
367
371
|
return { vaultUnlocked: unlocked, manualAuthRequired: !unlocked }
|
|
368
372
|
}
|
|
369
373
|
|
|
370
|
-
function vaultStatus(running, healthy) {
|
|
374
|
+
function vaultStatus(running, healthy, butler) {
|
|
371
375
|
if (!running || !healthy) return { vaultUnlocked: false, manualAuthRequired: true }
|
|
372
|
-
const result = spawnSync(DOCKER, ["exec", activeContainerId, "node", "/opt/ouro/dist/heart/daemon/ouro-entry.js", "vault", "status", "--agent",
|
|
376
|
+
const result = spawnSync(DOCKER, ["exec", activeContainerId, "node", "/opt/ouro/dist/heart/daemon/ouro-entry.js", "vault", "status", "--agent", butler, "--store", "plaintext-file"], {
|
|
373
377
|
cwd: "/", encoding: "utf8", timeout: 30_000, maxBuffer: 1024 * 1024,
|
|
374
378
|
env: { PATH: "/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin" }, stdio: ["ignore", "pipe", "ignore"],
|
|
375
379
|
})
|
|
@@ -500,17 +504,19 @@ async function containerSnapshot(expectedImage) {
|
|
|
500
504
|
const mount = object(raw, "container mount")
|
|
501
505
|
return { destination: mount.Destination, source: mount.Source, mode: mount.Mode, propagation: mount.Propagation, rw: mount.RW, type: mount.Type }
|
|
502
506
|
}).sort((left, right) => String(left.destination).localeCompare(String(right.destination))) : []
|
|
503
|
-
const expectedMounts = [
|
|
507
|
+
const expectedMounts = (name) => [
|
|
504
508
|
{ destination: "/home/ouro/.ouro-cli", source: PRODUCTION_RUNTIME_SOURCE, propagation: "rprivate", rw: true, type: "bind" },
|
|
505
|
-
{ destination:
|
|
509
|
+
{ destination: containerBundle(name), source: PRODUCTION_BUNDLE_SOURCE, propagation: "rprivate", rw: true, type: "bind" },
|
|
506
510
|
{ destination: "/run/ouro-events", source: PRODUCTION_EVENT_SPOOL_SOURCE, propagation: "rprivate", rw: false, type: "bind" },
|
|
507
511
|
{ destination: "/run/ouro-authority", source: "/run/ouro-authority", propagation: "rprivate", rw: false, type: "bind" },
|
|
508
|
-
{ destination:
|
|
512
|
+
{ destination: `/etc/ouro/trust/${name}`, source: "/mnt/user/appdata/ouro-butler/trust/sanctuary", propagation: "rprivate", rw: false, type: "bind" },
|
|
509
513
|
]
|
|
510
514
|
// alpha.978 and earlier (and a rollback to one) also mount the psyche folder read-only over the bundle; accept either set.
|
|
511
|
-
const psycheMount = { destination:
|
|
515
|
+
const psycheMount = (name) => ({ destination: `${containerBundle(name)}/psyche`, source: `${PRODUCTION_BUNDLE_SOURCE}/psyche`, propagation: "rprivate", rw: false, type: "bind" })
|
|
512
516
|
const mountsMatch = (expectedSet) => mounts.length === expectedSet.length && expectedSet.every((expected) => mounts.some((mount) => mount.destination === expected.destination && mount.source === expected.source && mount.propagation === expected.propagation && mount.rw === expected.rw && mount.type === expected.type))
|
|
513
|
-
|
|
517
|
+
// The Butler the container runs is the one name its whole mount set is under; the vault status below asks for that agent.
|
|
518
|
+
const mountedButler = BUTLER_NAMES.find((name) => mountsMatch(expectedMounts(name)) || mountsMatch([...expectedMounts(name), psycheMount(name)]))
|
|
519
|
+
const mountsExact = mountedButler !== undefined
|
|
514
520
|
const securityExact = value.privileged === false && (value.capAdd === null || (Array.isArray(value.capAdd) && value.capAdd.length === 0))
|
|
515
521
|
&& (value.capDrop === null || (Array.isArray(value.capDrop) && value.capDrop.length === 0))
|
|
516
522
|
&& (value.securityOpt === null || (Array.isArray(value.securityOpt) && value.securityOpt.length === 0))
|
|
@@ -530,7 +536,7 @@ async function containerSnapshot(expectedImage) {
|
|
|
530
536
|
const liveProcessUser = processAfter.user
|
|
531
537
|
const processBindingDigest = productionProcessBindingDigest({ ...rebound, ...processAfter })
|
|
532
538
|
const healthy = value.health === "healthy"
|
|
533
|
-
const vault = vaultStatus(running, healthy)
|
|
539
|
+
const vault = vaultStatus(running, healthy, mountedButler ?? "sanctuary")
|
|
534
540
|
const milestones = recoveryMilestones(running, healthy)
|
|
535
541
|
return {
|
|
536
542
|
schemaVersion: 1,
|
|
@@ -946,8 +952,9 @@ function healthProbeOperationBudgets() {
|
|
|
946
952
|
}
|
|
947
953
|
|
|
948
954
|
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u
|
|
949
|
-
|
|
950
|
-
const
|
|
955
|
+
// The health habit's scheduler names, under the Butler name the receipt's job runs as (src/heart/butler-agent.ts butlerContainerPaths).
|
|
956
|
+
const schedulerCommand = (name) => `/usr/local/bin/node /opt/ouro/dist/heart/daemon/ouro-entry.js poke ${name} --habit sanctuary-health --trigger cron`
|
|
957
|
+
const schedulerCrontab = (name) => `/home/ouro/.ouro-cli/scheduler/${name}.crontab`
|
|
951
958
|
|
|
952
959
|
function canonicalIso(value) {
|
|
953
960
|
if (typeof value !== "string") return false
|
|
@@ -975,10 +982,13 @@ function requireExactSchedulerReceipt(scheduler, request, identityKey, phases) {
|
|
|
975
982
|
if (manifest.length !== 1) throw new Error("scheduler manifest is invalid")
|
|
976
983
|
const job = object(manifest[0], "scheduler manifest job")
|
|
977
984
|
exactKeys(job, ["agent", "command", "id", "lastRun", "schedule", "taskId", "taskPath"], "scheduler manifest job")
|
|
985
|
+
const butler = BUTLER_NAMES.includes(job.agent) ? job.agent : "sanctuary"
|
|
986
|
+
const SCHEDULER_COMMAND = schedulerCommand(butler)
|
|
987
|
+
const SCHEDULER_CRONTAB = schedulerCrontab(butler)
|
|
978
988
|
const unsignedScheduler = Object.fromEntries(Object.entries(scheduler).filter(([key]) => key !== "receiptMac"))
|
|
979
989
|
const expectedReceiptMac = createHmac("sha256", identityKey).update(`sanctuary-scheduler-liveness-receipt-v2\0${JSON.stringify(unsignedScheduler)}`).digest("hex")
|
|
980
990
|
const proofCommand = {
|
|
981
|
-
kind: "habit.scheduler-fire", agent:
|
|
991
|
+
kind: "habit.scheduler-fire", agent: butler, habitName: "sanctuary-health", trigger: "cron",
|
|
982
992
|
slot: origin.slot, occurrenceId: origin.occurrenceId, schedulerRunId: origin.schedulerRunId,
|
|
983
993
|
invocationPid: origin.invocationPid, parentPid: origin.parentPid, parentStartTime: origin.parentStartTime,
|
|
984
994
|
invocationStartTime: origin.invocationStartTime, scenarioHandleDigest: origin.scenarioHandleDigest,
|
|
@@ -995,10 +1005,10 @@ function requireExactSchedulerReceipt(scheduler, request, identityKey, phases) {
|
|
|
995
1005
|
|| supervisor.schemaVersion !== "supercronic-supervisor-snapshot-v1" || supervisor.daemonPid !== 1 || supervisor.childCount !== 1
|
|
996
1006
|
|| !Number.isSafeInteger(supervisor.childPid) || supervisor.childPid <= 1 || supervisor.healthy !== true
|
|
997
1007
|
|| supervisor.binaryPath !== "/usr/local/bin/supercronic" || supervisor.crontabPath !== SCHEDULER_CRONTAB
|
|
998
|
-
|| JSON.stringify(supervisor.args) !== JSON.stringify(["-split-logs", "-inotify", SCHEDULER_CRONTAB]) || supervisor.namespace !==
|
|
999
|
-
|| job.id !==
|
|
1000
|
-
|| (job.lastRun !== null && !canonicalIso(job.lastRun)) || job.command !== SCHEDULER_COMMAND || job.taskPath !==
|
|
1001
|
-
|| typeof supervisor.renderedCrontab !== "string" || !supervisor.renderedCrontab.includes(`# ouro:habit:sanctuary
|
|
1008
|
+
|| JSON.stringify(supervisor.args) !== JSON.stringify(["-split-logs", "-inotify", SCHEDULER_CRONTAB]) || supervisor.namespace !== `habit:${butler}`
|
|
1009
|
+
|| job.id !== `${butler}:sanctuary-health` || job.agent !== butler || job.taskId !== "sanctuary-health" || job.schedule !== "*/15 * * * *"
|
|
1010
|
+
|| (job.lastRun !== null && !canonicalIso(job.lastRun)) || job.command !== SCHEDULER_COMMAND || job.taskPath !== `${containerBundle(butler)}/habits/sanctuary-health.md`
|
|
1011
|
+
|| typeof supervisor.renderedCrontab !== "string" || !supervisor.renderedCrontab.includes(`# ouro:habit:${butler}:${butler}:sanctuary-health\n*/15 * * * * ${SCHEDULER_COMMAND}\n`)
|
|
1002
1012
|
|| typeof origin.slot !== "string" || !canonicalIso(origin.slot) || scheduler.occurrenceId !== `cron:${origin.slot}` || origin.occurrenceId !== scheduler.occurrenceId
|
|
1003
1013
|
|| !UUID.test(origin.schedulerRunId) || origin.scenarioHandleDigest !== request.scenarioHandleDigest
|
|
1004
1014
|
|| !Number.isSafeInteger(origin.invocationPid) || origin.invocationPid <= 1 || !Number.isSafeInteger(origin.parentPid) || origin.parentPid !== supervisor.childPid
|