Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
4fd20c3
test(id): isolate e2e specs per file with fresh ephemeral server (#229)
Oct 26, 2026
b37a231
fix(id/web): re-nest nested-mark runs on save instead of fragmenting …
Oct 26, 2026
95f69f6
wip(id): footnote_definition block children (#1031, task 1210)
Oct 27, 2026
d95dbe0
correction(task 1210): test outcome UNVERIFIED — disregard the failur…
Oct 27, 2026
0501923
fix(id): footnote_definition save arm compiles + legacy test asserts …
Oct 27, 2026
78199eb
WIP queue task 1216: carry tight on task_list (#1036) — claim lost to…
Oct 27, 2026
3e70152
test(id): #1036 loose task list — assert no-fusion every save + fixpo…
Oct 27, 2026
2968cf7
test(id): #1036 code-block-in-task-item — assert survival as a code b…
Oct 27, 2026
676d9de
test(design-code-proxy): regression test for streaming Content-Length…
Oct 27, 2026
4ed30f9
docs(id): roadmap — Phase 12 + path to Phase 12 first; every item iss…
Oct 27, 2026
e793b32
Merge pull request #1074 from developing-today/queue/1228-688-streami…
dezren39 Oct 27, 2026
6b69567
docs(planning): seed basement cluster roadmap, first status record, h…
Oct 27, 2026
1247000
fix(id-web): validate block/inline placement before conversion (#1043)
Oct 27, 2026
2aa5c81
style: treefmt (prettier/biome) for roadmap + grist seed
Oct 27, 2026
be94710
style: treefmt (prettier) formatting for the cluster seed docs
Oct 27, 2026
f6594ee
style(id-web): rustfmt placement_of match arms (#1043)
Oct 27, 2026
a9ed1dd
feat(opencode): add luna-haiku-100k pool capped below the 100k contex…
Oct 27, 2026
ac92d8e
Merge pull request #1079 from developing-today/docs/id-roadmap-phase1…
dezren39 Oct 27, 2026
c1a205b
Merge pull request #1082 from developing-today/docs/basement-cluster-…
dezren39 Oct 27, 2026
da65611
Merge pull request #1107 from developing-today/pool-100k
dezren39 Oct 27, 2026
914043d
docs(basement-cluster): link filed epic issues in roadmap
Oct 27, 2026
596096a
Merge pull request #1040 from developing-today/queue/1210-1031-footno…
dezren39 Oct 27, 2026
922508c
Merge pull request #1109 from developing-today/docs/basement-cluster-…
dezren39 Oct 27, 2026
5a92096
style(id): rustfmt task_list tight inference (#1036)
Oct 27, 2026
f7299e8
feat(opencode): pool balance pass 3 — re-pin Luna/Haiku rungs on TTFT…
Oct 27, 2026
5709db9
Merge pull request #1133 from developing-today/pool-balance-pass3
dezren39 Oct 27, 2026
dd1d307
feat(aggregator): /program hub + per-project pages for all projects (…
Oct 27, 2026
4c18a77
Merge pull request #1142 from developing-today/pm/program-multi-project
dezren39 Oct 27, 2026
cdf990f
Merge remote-tracking branch 'origin/main' into queue/1173-968-nested…
Oct 27, 2026
a2e7bfc
Merge pull request #1089 from developing-today/queue/1232-1043-placem…
dezren39 Oct 27, 2026
ce1acfb
fix(id-web): preserve HTML blocks on save via code_block provenance a…
dezren39 Oct 27, 2026
9c842e6
feat(opencode): add Reflection Beam (commandcode, probe-verified) to …
Oct 27, 2026
2275e9d
ci: retrigger checks for rustfmt fix (#1036)
Oct 27, 2026
bc9b67f
Merge pull request #1194 from developing-today/pool-beam-scout
dezren39 Oct 27, 2026
aaaaab8
fix(virtualisation): ensure the systemd credentials host key exists f…
Oct 27, 2026
f0c4444
Merge remote-tracking branch 'origin/main' into queue/1216-1036-task-…
Oct 27, 2026
d5000f9
fix(commandcode-proxy): supervisor owns the proxy; drop the unit's In…
Oct 27, 2026
295b7f8
docs(roadmap): add queue fleet + OpenChamber dispatch epics to repo-a…
Oct 27, 2026
ca2ac10
Merge pull request #1237 from developing-today/docs/roadmap-fleet-epics
dezren39 Oct 27, 2026
20e1a23
Merge pull request #1026 from developing-today/queue/1173-968-nested-…
dezren39 Oct 27, 2026
259363f
feat(nixos): decrypt OpenClaw tokens via sops-nix from the bws mirror
dezren39 Oct 27, 2026
a7e5aae
fix(aggregator): accept the orchestrator's object provenance — the #1…
Oct 27, 2026
341863f
Merge pull request #1231 from developing-today/fix/libvirtd-creds-hos…
dezren39 Oct 27, 2026
340bb04
Merge pull request #1232 from developing-today/fix/commandcode-proxy-…
dezren39 Oct 27, 2026
379c87c
feat(opencode): Sol #low joins workhorse (cross-rung review)
Oct 27, 2026
f67dad1
feat(pm-aggregator): AA cost explorer page (fleet-feed backed)
Oct 27, 2026
464d490
Merge pull request #1247 from developing-today/pool-sol-low
dezren39 Oct 27, 2026
9e58413
Merge pull request #987 from developing-today/queue/1109-229-per-spec…
dezren39 Oct 27, 2026
608f632
style(aggregator): treefmt (biome 2.3.2) formatting for #1110 files
Oct 27, 2026
2f06933
Merge pull request #1244 from developing-today/pm/orchestration-prove…
dezren39 Oct 27, 2026
39a2b0a
feat(nixos): prefer IPv4 in getaddrinfo on amd (workaround for #1280)
dezren39 Oct 27, 2026
90138a0
Merge pull request #1286 from developing-today/feat/ipv4-preference
dezren39 Oct 27, 2026
0443d6c
Merge pull request #1041 from developing-today/queue/1216-1036-task-l…
dezren39 Oct 27, 2026
27a241c
chore: merge main into feat/openclaw-sops
dezren39 Oct 27, 2026
a8f2056
feat(opencode): set up GPT-6.1 Terra — catalog entries, terra-plan, w…
Oct 27, 2026
90f7ea0
Merge pull request #1296 from developing-today/pool-terra-setup
dezren39 Oct 27, 2026
91707b6
wip: provider catalog completion (carried over from interrupted run; …
Oct 27, 2026
e869967
merge main into provider-catalog-sync
Oct 27, 2026
a9411c5
style(pm-aggregator): treefmt (biome 2.3.2) formatting for the AA exp…
Oct 27, 2026
7a9cbda
feat(meta-exporter): laptop-side Meta quota exporter, 15-min file exp…
Oct 27, 2026
9d8e7d1
Merge remote-tracking branch 'origin/main' into pm/aa-explorer
Oct 27, 2026
3592b0a
feat(opencode): complete chatgpt catalog from the codex proxy list (g…
Oct 27, 2026
ee2202e
Merge pull request #1250 from developing-today/pm/aa-explorer
dezren39 Oct 27, 2026
2887353
fix(aggregator): program route 404 + researched project-page slices
Oct 27, 2026
4abd78f
Merge remote-tracking branch 'origin/main' into pm/program-editorial-…
Oct 27, 2026
2e2781d
Merge pull request #1304 from developing-today/provider-catalog-sync
dezren39 Oct 27, 2026
cbfc188
Merge remote-tracking branch 'origin/main' into pm/program-editorial-…
Oct 27, 2026
e246a33
Merge pull request #1305 from developing-today/pm/program-editorial-f…
dezren39 Oct 27, 2026
9cce44b
style(repo): treefmt formatting for meta-exporter files (code#1301)
dezren39 Oct 27, 2026
dd4ee06
Merge pull request #1303 from developing-today/feat/meta-quota-export…
dezren39 Oct 27, 2026
c40b6c5
fix(opencode): remove shadowed duplicate cline-pass provider block (#…
Oct 27, 2026
b3c8b6e
feat(opencode): Terra workhorse weight 1 to 2 (AA per-rung TTFT lande…
Oct 27, 2026
ff5a86a
Merge pull request #1311 from developing-today/fix/cline-pass-duplica…
dezren39 Oct 27, 2026
0a6d1be
Merge pull request #1312 from developing-today/pool-terra-weight
dezren39 Oct 27, 2026
aefa99f
fix(home): enroll claude-code-proxy (18749) in the proxy supervisor m…
Oct 27, 2026
b37c024
Merge pull request #1313 from developing-today/fix/claude-code-proxy-…
dezren39 Oct 27, 2026
b976f14
fix(amd): re-encrypt muse password hash so the host key can decrypt it
dezren39 Oct 27, 2026
6847080
Merge pull request #1314 from developing-today/fix/sops-muse-password…
dezren39 Oct 27, 2026
292e73f
chore: merge main into feat/openclaw-sops
dezren39 Oct 27, 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
1,048 changes: 968 additions & 80 deletions .opencode/opencode.jsonc

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ A row here records intent. It does not settle a product question and it is not a

## Projects

| Project | Roadmap | Current focus |
| ---------------------------------------------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `id`, the peer-to-peer CLI and worlds platform | [id](planning/roadmaps/id.md) | Phase 11 foundations: a CI signal that can be trusted, visible costs, one rule for what a client may see |
| `mcpx`, the MCP gateway and Code Mode runner | [mcpx](planning/roadmaps/mcpx.md) | The only copy of the code; how downstream flakes consume it, and darwin takeover tests |
| The NixOS flake and infra manifests | [nixos-and-infra](planning/roadmaps/nixos-and-infra.md) | Inputs kept current by a daily job. No open work items of its own |
| Repo-wide CI and automation | [repo-and-ci](planning/roadmaps/repo-and-ci.md) | One Jules workflow, the Go build cache, and stale PR triage |
| Project | Roadmap | Current focus |
| ---------------------------------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `id`, the peer-to-peer CLI and worlds platform | [id](planning/roadmaps/id.md) | Phase 11 foundations: a CI signal that can be trusted, visible costs, one rule for what a client may see |
| `mcpx`, the MCP gateway and Code Mode runner | [mcpx](planning/roadmaps/mcpx.md) | The only copy of the code; how downstream flakes consume it, and darwin takeover tests |
| The NixOS flake and infra manifests | [nixos-and-infra](planning/roadmaps/nixos-and-infra.md) | Inputs kept current by a daily job. No open work items of its own |
| Repo-wide CI and automation | [repo-and-ci](planning/roadmaps/repo-and-ci.md) | One Jules workflow, the Go build cache, stale PR triage — and the queue fleet program: lanes for every queue, OpenChamber session dispatch (#1233, #1234) |
| The basement home cluster (Talos, Cozystack) | [basement-cluster](planning/roadmaps/basement-cluster.md) | Nothing built yet; research and planning done, hardware inventory and power come first |

## Now, across the repo

Expand Down
41 changes: 37 additions & 4 deletions bin/design-code-proxy.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// 'quota-status' -> HTTP 429 status
// 'ok-length' -> a successful chat completion with an explicit
// Content-Length on the compact JSON body (#684)
// 'ok-length-stream' -> the SSE stream, with a Content-Length set to
// the backend's own (pre-model-rewrite) byte count,
// which is stale the moment the proxy rewrites the
// model in each chunk (#688)
// 'ok' (default) -> a successful chat completion naming the backend
//
// A quota error reported in a 200 JSON body used to hang the client
Expand Down Expand Up @@ -56,14 +60,20 @@ const startStub = (name) => new Promise((resolve) => {
res.writeHead(200, { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(compact) });
res.end(compact);
} else if (bodyText.includes('"stream":true')) {
res.writeHead(200, { 'Content-Type': 'text/event-stream' });
const chunk = {
id: 'chatcmpl-stub', object: 'chat.completion.chunk', created: 0, model: 'stub-model',
choices: [{ index: 0, delta: { content: `hello from ${name}` }, finish_reason: null }]
};
res.write(`data: ${JSON.stringify(chunk)}\n\n`);
res.write('data: [DONE]\n\n');
res.end();
const payload = `data: ${JSON.stringify(chunk)}\n\ndata: [DONE]\n\n`;
const headers = { 'Content-Type': 'text/event-stream' };
if (stub.mode === 'ok-length-stream') {
// #688: the length of the backend's own body. The proxy's
// per-chunk model rewrite makes the body it sends longer, so
// forwarding this length would truncate the stream.
headers['Content-Length'] = Buffer.byteLength(payload);
}
res.writeHead(200, headers);
res.end(payload);
} else {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
Expand Down Expand Up @@ -193,6 +203,29 @@ test('backend Content-Length does not truncate the re-serialized success body (#
assert.equal(fallback.calls, 0);
});

test('backend Content-Length does not truncate the model-rewritten SSE stream (#688)', async (t) => {
const { port, primary, fallback, stop } = await startProxy();
t.after(stop);
primary.mode = 'ok-length-stream';
const res = await post(port, { stream: true });
assert.equal(res.status, 200);
const sse = await res.text();
// The proxy rewrites the model in every chunk, so the stream it sends
// is longer than the backend body the stub's Content-Length describes.
// Forwarding that stale length truncates the tail — [DONE] is lost.
assert.match(sse, /hello from primary/);
assert.match(sse, /design-code-flash/);
assert.ok(sse.trimEnd().endsWith('data: [DONE]'), `stream truncated: ${JSON.stringify(sse)}`);
// The forwarded head must describe the stream actually sent: either no
// Content-Length (chunked) or exactly the received byte count.
const advertised = res.headers.get('content-length');
if (advertised !== null) {
assert.equal(Number(advertised), Buffer.byteLength(sse));
}
assert.equal(primary.calls, 1);
assert.equal(fallback.calls, 0);
});

test('streaming success is unchanged', async (t) => {
const { port, stop } = await startProxy();
t.after(stop);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Basement cluster status, 2026-10-26

- Status: status record
- Date: 2026-10-27T03-14-08Z
- Roadmap item: [Basement cluster roadmap](../../planning/roadmaps/basement-cluster.md)
- Issues: epics being filed

## State

Nothing has been built yet under the current program. The basement machines have no OS installed, by design: the whole fleet must be rebuildable from declarative config, so no node is installed until the TALM bootstrap flow is proven. The earlier v1.9-era Talos test cluster was only a test and has been torn down (confirmed by Drew, 2026-10-26).

What exists is research and planning:

- A component research brief (2026-10-03): TALM is `cozystack/talm`, Talos v1.14, Cozystack v1.6, managed Postgres is CloudNativePG, RustFS 1.0. The stack fits as TALM → Talos configs → Cozystack → CNPG Postgres + RustFS.
- An idea register (2026-10-20) capturing the full program: hardware facts, the storage sketch, hard rules (no HashiCorp, everything bootstrappable from config), the egress strategy, and the cloud program around the cluster.

The cloud extension is blocked at Oracle: the OCI always-free tenancy has been stuck in provisioning since 2026-10-21 (ticket CPCOE-29381; the recorded cloud account name is restricted and no valid replacement has been assigned). The next support check-back is 2026-10-27.

## Next steps

1. Hardware inventory: gather stats for all ~12 machines and pick the first 3–5 cluster nodes.
2. Firmware, BIOS and BMC audit: confirm versions and every setting are identical across the core machines.
3. Basement power and space: dedicated 20A circuits and rack layout, so the first nodes can run.
2 changes: 2 additions & 0 deletions doc/talos-addresses.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> **Historical reference only — torn down.** This file described a v1.9-era Talos test cluster that has been torn down (confirmed by Drew, 2026-10-26). Nothing in it is running. The current program is in [`planning/roadmaps/basement-cluster.md`](../planning/roadmaps/basement-cluster.md).

- vip
- https://10.10.0.42:6443
- https://vip.01b.us:6443
Expand Down
40 changes: 35 additions & 5 deletions home/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,31 @@ in
"~/.local/state/proxy-supervisor/muse-proxy.build-stamp"
];
}
# Enrolled 2026-10-27. The let block reserved claudeCodeProxyPort
# and the session variables already export CLAUDE_CODE_PROXY_PORT
# (opencode.jsonc dials it), but the proxy was never added to this
# list, so nothing supervised port 18749 and it sat dark until
# started by hand -- the same drift class as the hand-added pair
# transcribed above. Entry mirrors codex-proxy (the other node
# CLI bridge): host + PATH env, entrypoint + proxy-port.mjs as
# the artifact hash.
{
name = "claude-code-proxy";
canonicalPort = claudeCodeProxyPort;
portEnv = "CLAUDE_CODE_PROXY_PORT";
command = [
"/run/current-system/sw/bin/node"
"~/code/bin/claude-code-proxy.mjs"
];
env = {
CLAUDE_CODE_PROXY_HOST = "127.0.0.1";
PATH = "/run/current-system/sw/bin:$HOME/.local/bin:/usr/bin:/bin";
};
Comment on lines +812 to +815

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable the sandbox egress proxy for the laptop Claude bridge

On the laptop, this new supervisor entry leaves CLAUDE_CODE_PROXY_EGRESS unset, so bin/claude-code-proxy.mjs:45 defaults to the sandbox-only http://hatch-egress-proxy:3128. Its childEnv() then overwrites the Claude CLI's HTTP(S) proxy variables with that address, preventing real turns from reaching Anthropic even though the bridge's health endpoint succeeds. Set CLAUDE_CODE_PROXY_EGRESS = "" here, as the laptop Muse and CommandCode launch wrappers already do for their corresponding overrides.

Useful? React with 👍 / 👎.

hashFiles = [
"~/code/bin/claude-code-proxy.mjs"
"~/code/bin/proxy-port.mjs"
];
}
];
};

Expand All @@ -803,10 +828,14 @@ in
# transient fps-commandcode-proxy unit) so laptop/sandbox env handling
# and the MAX_TURNS pins live in exactly one place:
# bin/commandcode-proxy-start.sh.
# NOT YET DEPLOYED: host builds for another change are in flight — run a
# NixOS/home-manager rebuild + switch to activate, then
# systemctl --user status commandcode-proxy
# Until then the supervisor-owned transient unit serves the port.
#
# This unit originally landed (169d594e) WITH an Install.WantedBy and a
# "not yet deployed" note, breaking the fleet pattern below: the first
# home-manager activation that included it (2026-10-26, the T3 switch)
# started it against the supervisor's already-running transient unit,
# and it crash-looped on the taken port (44 restarts in an evening).
# The supervisor has served this port continuously since 2026-10-24;
# the unit is the manual fallback, like every other proxy here.
systemd.user.services.commandcode-proxy = {
Unit = {
Description = "Command Code CLI Local Proxy Bridge for OpenCode";
Expand All @@ -824,7 +853,8 @@ in
"COMMANDCODE_PROXY_AGENCY_MAX_TURNS=8"
];
};
Install.WantedBy = [ "default.target" ];
# No Install.WantedBy: the proxy-supervisor (above) owns the proxy
# processes. These per-proxy units remain for manual one-off starts.
};

systemd.user.services.sync-models = {
Expand Down
2 changes: 2 additions & 0 deletions infra/talos/01b.us/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> **Historical reference only — torn down.** This folder described a v1.9-era Talos test cluster (01b.us) that has been torn down (confirmed by Drew, 2026-10-26). Nothing in it is running. The current program is in [`planning/roadmaps/basement-cluster.md`](../../../planning/roadmaps/basement-cluster.md).

- https://hub.docker.com/r/ronivay/xen-orchestra

- uses https://factory.talos.dev/?arch=amd64&cmdline-set=true&extensions=-&extensions=siderolabs%2Fdrbd&extensions=siderolabs%2Ftailscale&extensions=siderolabs%2Fxen-guest-agent&platform=metal&target=metal&version=1.9.0
Expand Down
23 changes: 23 additions & 0 deletions nixos/hosts/amd-ipv4-preference.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
_:
{
# Temporary workaround for the home IPv6 uplink stalling on payload
# transfers (developing-today/code#1280): prefer IPv4 in getaddrinfo
# result sorting until the home IPv6 path is repaired. Remove with
# the issue.
networking.getaddrinfo = {
label = {
"::1/128" = 0;
"::/0" = 1;
"2002::/16" = 2;
"::/96" = 3;
"::ffff:0:0/96" = 4;
};
precedence = {
"::1/128" = 50;
"::/0" = 40;
"2002::/16" = 30;
"::/96" = 20;
"::ffff:0:0/96" = 100;
};
};
}
22 changes: 22 additions & 0 deletions nixos/hosts/amd-openclaw-secrets.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ lib, ... }:
let
userSecret = key: {
inherit key;
sopsFile = lib.from-root "secrets/sops/common/bws.yaml";
owner = "user";
mode = "0400";
};
in
{
# OpenClaw gateway + channel tokens. Bitwarden Secrets Manager is the
# source of truth; lib/bws-to-sops.sh mirrors every bws secret into
# secrets/sops/common/bws.yaml (age-encrypted to this host). sops-nix
# decrypts these at system activation to /run/secrets/openclaw/*,
# where the openclaw-gateway user service reads them through the
# wrapper's file-based environment (see home/openclaw).
sops.secrets = {
"openclaw/gateway-token" = userSecret "openclaw.gateway-token";
"openclaw/slack-bot-token" = userSecret "openclaw.slack-bot-token";
"openclaw/slack-app-token" = userSecret "openclaw.slack-app-token";
Comment on lines +18 to +20

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wire the gateway to the newly provisioned secrets

On an amd deployment, these declarations create /run/secrets/openclaw/*, but home/openclaw/default.nix:80 still points OPENCLAW_GATEWAY_TOKEN at /home/user/.secrets/openclaw/gateway-token and supplies neither Slack token. Repository-wide searches found no consumer or compatibility link for the new paths. Consequently, updating the mirrored gateway token does not update the gateway's authentication, and provisioning the Slack tokens does not activate the channel. Wire the gateway environment and channel configuration to these files so the sops-backed credentials are actually used.

Useful? React with 👍 / 👎.

};
}
2 changes: 2 additions & 0 deletions nixos/hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ in
# KRdp remote desktop for this laptop (user service + package);
# see the file for the one-time on-machine credential setup.
./amd-krdp.nix
./amd-ipv4-preference.nix
./amd-openclaw-secrets.nix
];
};
# amd-server = host {
Expand Down
51 changes: 48 additions & 3 deletions nixos/virtualisation/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{ pkgs, ... }:

{
virtualisation = {
libvirtd.enable = true;
Expand All @@ -19,11 +21,54 @@
# networks = {
# "1" = {
# # name = "vnet"; # Optional: custom interface name
# addressPrefix = "192.168.100"; # Creates 192.168.100.0/24 network
# # addressPrefix = "192.168.100"; # Creates 192.168.100.0/24 network
# # localAddress = "192.168.100.10"; # Optional: specific guest IP
# # hostAddress = "192.168.100.1"; # Optional: specific host IP
# vlan = 1;
# # hostAddress = "192.168.100.1"; # Optional: specific host IP
# # vlan = 1;
# };
# };
};

# libvirtd >= 12 seals its secrets-encryption key with systemd
# credentials: the package's own 10-secret.conf drop-in loads
# /var/lib/libvirt/secrets/secrets-encryption-key as a
# LoadCredentialEncrypted, which systemd can only decrypt with the
# host credential key (/var/lib/systemd/credential.secret).
#
# Nothing on NixOS creates that host key eagerly, and if it is absent
# libvirtd fails at the CREDENTIALS step ("Failed to determine local
# credential key") -- which also makes `nixos-rebuild switch` exit 4
# even when the rest of the activation succeeded. Worse, the libvirt
# key blob is encrypted under whatever host key existed when
# virt-secret-init-encryption first ran; if that host key is lost,
# the blob is undecryptable forever.
#
# Observed live on amd 2026-10-26: the blob dated 2026-10-20 could
# not be decrypted because the host key had vanished. Recovery (safe
# only while no libvirt secrets are defined -- check
# /var/lib/libvirt/secrets for *.xml first, and expect to lose any
# secret encrypted under the old master key):
# sudo systemd-creds setup
# sudo mv /var/lib/libvirt/secrets/secrets-encryption-key{,.undecryptable}
# sudo systemctl start virt-secret-init-encryption.service
# sudo systemctl start libvirtd.service
#
# This oneshot keeps the host key in existence from the first
# activation onward, so the libvirt blob is always created under a
# persistent key. `systemd-creds setup` is idempotent; the condition
# makes it a no-op once the key exists.
systemd.services.creds-host-key-setup = {
description = "Ensure the systemd credentials host key exists (libvirtd secrets decryption depends on it)";
wantedBy = [ "multi-user.target" ];
before = [
"virt-secret-init-encryption.service"
"libvirtd.service"
];
unitConfig.ConditionPathExists = "!/var/lib/systemd/credential.secret";
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.systemd}/bin/systemd-creds setup";
};
};
}
8 changes: 8 additions & 0 deletions pkgs/id/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ import { defineConfig, devices } from "@playwright/test";
// Each browser project gets its own ephemeral server on a different port
// to avoid shared state issues (e.g., files created in chromium tests
// appearing in firefox tests).
//
// NOTE (#229): that isolates browsers, not spec files — every spec in a
// project shares that project's server (and its in-memory store) for the
// whole invocation. Runners therefore invoke Playwright once per spec
// file so each file gets a fresh ephemeral server: see the test-e2e
// check in ../flake.nix and the test-e2e* recipes in ../justfile. A
// single full-suite invocation (e.g. `bunx playwright test` with no file
// argument) does NOT have per-spec isolation.
const CHROMIUM_PORT = Number(process.env.TEST_PORT) || 4173;
const FIREFOX_PORT = CHROMIUM_PORT + 1;

Expand Down
21 changes: 19 additions & 2 deletions pkgs/id/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,28 @@
# causing it to hang on launch in the nix sandbox.
unset LD_LIBRARY_PATH

# Run Playwright E2E tests
# Run Playwright E2E tests — one invocation per spec file (#229).
# playwright.config.ts starts ONE ephemeral server per browser
# project for the whole invocation, so a single full-suite run
# lets every spec observe the files/state earlier specs created
# on that shared server (the Firefox shared-state failure
# cluster: e.g. basic.spec's "empty state" test ran after
# autosave.spec had already created files). A fresh invocation
# per spec file gives each file a fresh ephemeral server.
# All files run even if one fails, so one run reports every
# failing file; the check fails if any file failed.
# TODO: Switch to `bunx playwright test` once Bun's ESM loader supports
# Playwright's .esm.preflight virtual imports for TypeScript config loading.
# Tracking: https://github.com/oven-sh/bun/pull/28610
(cd e2e && node node_modules/@playwright/test/cli.js test)
(
cd e2e
e2e_status=0
for spec in tests/*.spec.ts; do
echo "=== test-e2e isolated per-spec run: $spec ==="
node node_modules/@playwright/test/cli.js test "$spec" || e2e_status=1
done
exit $e2e_status
)
'';
installPhase = ''
mkdir -p $out
Expand Down
12 changes: 9 additions & 3 deletions pkgs/id/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -305,20 +305,26 @@ alias nix-check := test-nix
# E2E Tests (Playwright - requires built web variant + network)
# =============================================================================

# E2E recipes run one Playwright invocation per spec file (#229): each
# invocation gets a fresh ephemeral server from playwright.config.ts, so
# specs cannot observe state created by other spec files. Note: if you
# already have an id server running on the test ports, Playwright reuses
# it (reuseExistingServer) and isolation does not apply — stop it first.

# [bun] Run Playwright E2E tests (both chromium and firefox)
[group('e2e')]
test-e2e: build
cd e2e && bun install --frozen-lockfile && bunx playwright test
cd e2e && bun install --frozen-lockfile && for spec in tests/*.spec.ts; do bunx playwright test "$spec" || exit 1; done

# [bun] Run Playwright E2E tests (chromium only)
[group('e2e')]
test-e2e-chromium: build
cd e2e && bun install --frozen-lockfile && bunx playwright test --project=chromium
cd e2e && bun install --frozen-lockfile && for spec in tests/*.spec.ts; do bunx playwright test --project=chromium "$spec" || exit 1; done

# [bun] Run Playwright E2E tests (firefox only)
[group('e2e')]
test-e2e-firefox: build
cd e2e && bun install --frozen-lockfile && bunx playwright test --project=firefox
cd e2e && bun install --frozen-lockfile && for spec in tests/*.spec.ts; do bunx playwright test --project=firefox "$spec" || exit 1; done

# [bun] Show Playwright test report
[group('e2e')]
Expand Down
Loading
Loading