From d56258b3263177e0bf74f446b66c4fa58480caeb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2026 02:06:26 +0000 Subject: [PATCH 01/21] chore(deps-dev): bump ruff from 0.16.6 to 0.16.7 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.16.6 to 0.16.7. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.16.6...0.16.7) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.16.7 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 606ff87fab..6744e6d35d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ deploy = [ "requests", ] dev = [ - "ruff==0.16.6", + "ruff==0.16.7", "import-linter", "pre-commit", "git-maintainer-tools", From b642e16e626f4eed3c23f3b8652e4551ffe2fd14 Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Sat, 19 Sep 2026 03:20:10 +0000 Subject: [PATCH 02/21] update(images): update Docker image versions (web-app-funkwhale) --- roles/web-app-funkwhale/meta/services.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/web-app-funkwhale/meta/services.yml b/roles/web-app-funkwhale/meta/services.yml index d102779090..92cd7265dc 100644 --- a/roles/web-app-funkwhale/meta/services.yml +++ b/roles/web-app-funkwhale/meta/services.yml @@ -11,7 +11,7 @@ funkwhale: # nocheck: default-placement-manager embedded typesense index; node-local in swarm placement: manager image: funkwhale/front - version: 2.0.10 + version: 2.0.11 min_storage: 224MB ports: internal: @@ -35,7 +35,7 @@ api: flavor: curl path: api/v1/instance/nodeinfo/2.0 image: funkwhale/api - version: 2.0.10 + version: 2.0.11 min_storage: 588MB ports: internal: From 166e53066bec176da839bc088026f8c8a34026d4 Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Sun, 20 Sep 2026 06:03:28 +0000 Subject: [PATCH 03/21] update(images): update Docker image versions (svc-ai-ollama) --- roles/svc-ai-ollama/meta/services.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/svc-ai-ollama/meta/services.yml b/roles/svc-ai-ollama/meta/services.yml index 49d885028a..751717156b 100644 --- a/roles/svc-ai-ollama/meta/services.yml +++ b/roles/svc-ai-ollama/meta/services.yml @@ -13,7 +13,7 @@ ollama: backup: no_stop_required: true image: ollama/ollama - version: 0.34.0 + version: 0.34.2 name: ollama min_storage: 3473MB cpus: "4.0" From bc9a9344e97692c0e6dcad32025ba870d157cbe1 Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Sun, 20 Sep 2026 06:03:40 +0000 Subject: [PATCH 04/21] update(images): update Docker image versions (svc-net-tor) --- roles/svc-net-tor/meta/services.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/svc-net-tor/meta/services.yml b/roles/svc-net-tor/meta/services.yml index 0f872d03b9..8ea686d6c8 100644 --- a/roles/svc-net-tor/meta/services.yml +++ b/roles/svc-net-tor/meta/services.yml @@ -20,7 +20,7 @@ tor: # nocheck: category-modes exclusive: true primary: true image: debian - version: 13.6-slim + version: 13.7-slim custom: true name: tor node: "" From e82df4bc51199e59445f3057e8d55fe39ecdade3 Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Sun, 20 Sep 2026 06:03:51 +0000 Subject: [PATCH 05/21] update(images): update Docker image versions (web-app-erpnext) --- roles/web-app-erpnext/meta/services.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/web-app-erpnext/meta/services.yml b/roles/web-app-erpnext/meta/services.yml index ae0a6e536b..fbddf587c1 100644 --- a/roles/web-app-erpnext/meta/services.yml +++ b/roles/web-app-erpnext/meta/services.yml @@ -65,7 +65,7 @@ erpnext: enabled: true shared: true image: frappe/erpnext - version: "v16.34.2" + version: "v16.35.0" name: erpnext min_storage: 1017MB ports: From 96d18cc6a970f4740f10590e62aa3879d1e6471a Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Sun, 20 Sep 2026 06:04:05 +0000 Subject: [PATCH 06/21] update(images): update Docker image versions (web-app-jitsi) --- roles/web-app-jitsi/meta/services.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/web-app-jitsi/meta/services.yml b/roles/web-app-jitsi/meta/services.yml index b105470533..21051d1b6c 100644 --- a/roles/web-app-jitsi/meta/services.yml +++ b/roles/web-app-jitsi/meta/services.yml @@ -53,7 +53,7 @@ jitsi: swarm: enabled: true image: jitsi/web - version: "stable-9646" + version: "stable-11031" min_storage: 315MB # nocheck: default-placement-manager meta/volumes.yml uses type:bind config dirs staged on the stack host; a worker-scheduled task lacks the source paths (unpinning requires migrating them to nfs-backed named volumes) placement: manager @@ -87,7 +87,7 @@ prosody: port_key: http name: jitsi-prosody image: jitsi/prosody - version: "stable-9646" + version: "stable-11031" ports: internal: xmpp: 5222 @@ -102,7 +102,7 @@ prosody: jicofo: name: jitsi-jicofo image: jitsi/jicofo - version: "stable-9646" + version: "stable-11031" cpus: "1.0" mem_reservation: 512m mem_limit: 1g @@ -112,7 +112,7 @@ jicofo: jvb: name: jitsi-jvb image: jitsi/jvb - version: "stable-9646" + version: "stable-11031" cpus: "2.0" mem_reservation: 1g mem_limit: 2g From 8b2bc317839c3c5c2e15ff6cabcb07b3eea45a7d Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Sun, 20 Sep 2026 06:04:09 +0000 Subject: [PATCH 07/21] update(images): update Docker image versions (web-app-keycloak) --- roles/web-app-keycloak/meta/services.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/web-app-keycloak/meta/services.yml b/roles/web-app-keycloak/meta/services.yml index 7366782b3a..9625e85359 100644 --- a/roles/web-app-keycloak/meta/services.yml +++ b/roles/web-app-keycloak/meta/services.yml @@ -51,7 +51,7 @@ keycloak: shared: true provides: sso image: quay.io/keycloak/keycloak - version: "26.7.3" + version: "26.7.4" name: keycloak min_storage: 468MB cpus: "2.0" From 7ab0fec2a76835bf177cc1b63ec7d1eff457c281 Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Sun, 20 Sep 2026 06:04:21 +0000 Subject: [PATCH 08/21] update(images): update Docker image versions (web-app-opentalk) --- roles/web-app-opentalk/meta/services.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/web-app-opentalk/meta/services.yml b/roles/web-app-opentalk/meta/services.yml index a5e60c7b18..4e78c82a90 100644 --- a/roles/web-app-opentalk/meta/services.yml +++ b/roles/web-app-opentalk/meta/services.yml @@ -96,7 +96,7 @@ controller: livekit: name: opentalk-livekit image: livekit/livekit-server - version: v1.13.6 + version: v1.13.7 min_storage: 238MB cpus: "2.0" mem_reservation: 512m @@ -134,7 +134,7 @@ rabbit: retries: 5 name: opentalk-rabbit image: rabbitmq - version: 4.3.5 + version: 4.3.6 min_storage: 314MB cpus: "0.5" mem_reservation: 256m From 761c4a247dcaa71b8a07632c103aa73bc6545dd3 Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Sun, 20 Sep 2026 06:04:30 +0000 Subject: [PATCH 09/21] update(images): update Docker image versions (web-app-pgadmin) --- roles/web-app-pgadmin/meta/services.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/web-app-pgadmin/meta/services.yml b/roles/web-app-pgadmin/meta/services.yml index 400e12388e..20b16398f4 100644 --- a/roles/web-app-pgadmin/meta/services.yml +++ b/roles/web-app-pgadmin/meta/services.yml @@ -11,7 +11,7 @@ pgadmin: # nocheck: default-placement-manager embedded sqlite config db; node-local in swarm placement: manager image: dpage/pgadmin4 - version: "9.17" + version: "9.18" min_storage: 378MB server_mode: false master_password_required: true From 6df80cac4a87f1516613026ec4cbfdbbf1b80a38 Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Sun, 20 Sep 2026 06:04:34 +0000 Subject: [PATCH 10/21] update(images): update Docker image versions (web-app-pihole) --- roles/web-app-pihole/meta/services.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/web-app-pihole/meta/services.yml b/roles/web-app-pihole/meta/services.yml index 2abe5f7b63..e30e2bd67c 100644 --- a/roles/web-app-pihole/meta/services.yml +++ b/roles/web-app-pihole/meta/services.yml @@ -68,7 +68,7 @@ pihole: swarm: enabled: false image: pihole/pihole - version: "2026.07.2" + version: "2026.09.0" upstream_dns: "{{ NETWORK_PUBLIC_DNS_RESOLVERS }}" cpus: "0.5" mem_reservation: "128m" From 797bfacc2dfe129831ab1372f3016b3629408359 Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Sun, 20 Sep 2026 06:04:37 +0000 Subject: [PATCH 11/21] update(images): update Docker image versions (web-app-prometheus) --- roles/web-app-prometheus/meta/services.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/web-app-prometheus/meta/services.yml b/roles/web-app-prometheus/meta/services.yml index e2745043d5..54ace45103 100644 --- a/roles/web-app-prometheus/meta/services.yml +++ b/roles/web-app-prometheus/meta/services.yml @@ -79,7 +79,7 @@ alertmanager: flavor: wget path: -/healthy image: prom/alertmanager # nocheck: volumes-path-single-spot: the repository path of an image name, not a mount target - version: v0.34.0 + version: v0.34.1 name: prometheus-alertmanager cpus: "0.25" mem_reservation: 64m From f88aea547350a9ae6dbd2591b31062f6c8255bb0 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 10:27:12 +0200 Subject: [PATCH 12/21] docs(mcp): regenerate the audit report for the baserow bump test_the_committed_report_is_freshly_generated compares the committed table against a fresh render, and baserow had moved to 2.3.4 in its services.yml while the table still read 2.3.3. The bump arrived from the image-version updater, which edits services.yml and nothing else. The report is derived from those files but is committed, so every version bump for an MCP-serving role leaves it stale until someone runs `make mcp-audit`. Co-Authored-By: Claude Opus 5 (1M context) --- docs/contributing/design/role/services/mcp/audit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/design/role/services/mcp/audit.md b/docs/contributing/design/role/services/mcp/audit.md index f9b15c0fa0..16d629ee0f 100644 --- a/docs/contributing/design/role/services/mcp/audit.md +++ b/docs/contributing/design/role/services/mcp/audit.md @@ -13,7 +13,7 @@ not the version the MCP surface was verified against. | role | version | source | transport | auth | subject | scope | tools | implementation | consumers | blocker | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `svc-db-qdrant` | v1.19.1 | [link](https://s.infinito.nexus/code) | streamable_http | bearer_token | service_account (`mcp-svc-db-qdrant`) | read-only | 2 | adapter | `web-app-flowise`, `web-app-hermes`, `web-app-openclaw`, `web-app-openwebui` | — | -| `web-app-baserow` | 2.3.3 | [link](https://baserow.io/user-docs/mcp-server) | streamable_http | bearer_token | service_account (`mcp-web-app-baserow`) | read-only | 4 | adapter | `web-app-hermes`, `web-app-openclaw`, `web-app-openwebui` | — | +| `web-app-baserow` | 2.3.4 | [link](https://baserow.io/user-docs/mcp-server) | streamable_http | bearer_token | service_account (`mcp-web-app-baserow`) | read-only | 4 | adapter | `web-app-hermes`, `web-app-openclaw`, `web-app-openwebui` | — | | `web-app-checkmk` | 2.4.0p32 | [link](https://s.infinito.nexus/code) | streamable_http | bearer_token | service_account (`mcp-web-app-checkmk`) | read-only | 3 | adapter | `web-app-hermes`, `web-app-openclaw`, `web-app-openwebui` | — | | `web-app-fider` | stable | [link](https://s.infinito.nexus/code) | streamable_http | bearer_token | service_account (`mcp-web-app-fider`) | read-only | 3 | adapter | `web-app-hermes`, `web-app-openclaw`, `web-app-openwebui` | — | | `web-app-flowise` | 24-slim | [link](https://github.com/FlowiseAI/Flowise/tree/flowise%403.1.4/packages/server/src/routes/custom-mcp-servers) | — | — | — | read-only | — | native | — | — | From 26bde378a16d2f13387b633bb5639d155bf2e6fa Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 16:31:35 +0200 Subject: [PATCH 13/21] fix(lmstudio): bind the server beyond loopback so litellm can reach it Upstream re-pushed lmstudio/llmster-preview:cpu on 2026-09-18. The old build's daemon-run.sh wrote networkInterface 0.0.0.0 into .internal/http-server-config.json before starting the server. The new one drops that block, and its lms resolves the address as --bind, then LMS_SERVER_HOST, then 127.0.0.1, reading only the port from that file. The server therefore listened on loopback alone. The image healthcheck curls localhost and every role task drives lms through container exec, so svc-ai-lmstudio stayed green, while litellm's warm-up got Connect call failed on lmstudio:1234 and failed Mattermost#2, Matrix#2, XWiki#2, Moodle#2 and Zammad#2 in fork run 35545771696. LMS_SERVER_HOST is the documented knob and restores exactly the old bind. The port stays expose-only on the container network, so nothing new is published. Co-Authored-By: Claude Opus 5 (1M context) --- roles/svc-ai-lmstudio/templates/compose.yml.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/svc-ai-lmstudio/templates/compose.yml.j2 b/roles/svc-ai-lmstudio/templates/compose.yml.j2 index 3e05c26133..ba14ab4e22 100644 --- a/roles/svc-ai-lmstudio/templates/compose.yml.j2 +++ b/roles/svc-ai-lmstudio/templates/compose.yml.j2 @@ -7,6 +7,8 @@ {{ lookup('compose_only', 'container_name', LMSTUDIO_CONTAINER) }} expose: - "{{ LMSTUDIO_PORT }}" + environment: + LMS_SERVER_HOST: "0.0.0.0" {{ lookup('container_volumes', service_name) | indent(4) }} {{ lookup('container_networks') | indent(4) }} From 5a651f05d534d83745ce3f50b1a4610839bfa56e Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 16:32:35 +0200 Subject: [PATCH 14/21] test(lmstudio): probe the server on its network address, not loopback The role test asked for /v1/models on 127.0.0.1 from inside the container, the one address that still answered while the server was bound to loopback alone. It stayed green and the failure surfaced one role later as a 500 in litellm's warm-up. Step 3 now resolves the container's first IPv4 through hostname -I and queries that address, which a loopback-only bind refuses. It reads the interfaces directly, so it needs neither the service name nor swarm's route back through the service VIP, and compose and swarm take the same path. When the models never appear, one more request tells an unreachable server apart from an unindexed store. Co-Authored-By: Claude Opus 5 (1M context) --- roles/svc-ai-lmstudio/files/test/test.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/roles/svc-ai-lmstudio/files/test/test.sh b/roles/svc-ai-lmstudio/files/test/test.sh index c981fce35d..d30ca9b919 100644 --- a/roles/svc-ai-lmstudio/files/test/test.sh +++ b/roles/svc-ai-lmstudio/files/test/test.sh @@ -30,8 +30,10 @@ json_items() { python3 -c 'import json,sys; [print(x) for x in json.loads(sys.argv[1])]' "$1" } +server_url="" + serves_model() { - in_container curl -fsS --connect-timeout 5 --max-time 30 "http://127.0.0.1:${LMSTUDIO_PORT}/v1/models" 2>/dev/null | + in_container curl -fsS --connect-timeout 5 --max-time 30 "${server_url}/v1/models" 2>/dev/null | python3 -c 'import json,sys; d=json.load(sys.stdin); print("\n".join(m.get("id","") for m in d.get("data",[])))' 2>/dev/null | grep -qxF "$1" } @@ -78,7 +80,13 @@ for i in "${!blobs[@]}"; do echo "[OK] ${blobs[$i]} present and matching" done -echo "=== 3. the daemon serves every declared model ===" +echo "=== 3. the daemon serves every declared model on its network address ===" +address="$(in_container hostname -I | tr ' ' '\n' | grep -m1 -E '^[0-9]+(\.[0-9]+){3}$')" +if [ -z "${address}" ]; then + echo "[FAIL] hostname -I reported no IPv4 address inside the container" >&2 + exit 1 +fi +server_url="http://${address}:${LMSTUDIO_PORT}" mapfile -t models < <(json_items "${LMSTUDIO_EXPECTED_MODELS}") for model in "${models[@]}"; do attempt=1 @@ -91,8 +99,13 @@ for model in "${models[@]}"; do [ "${attempt}" -le "${RETRIES}" ] && sleep "${SLEEP_SECONDS}" done if [ "${attempt}" -gt "${RETRIES}" ]; then - echo "[FAIL] ${model} is on disk but /v1/models never listed it" >&2 - echo " the daemon did not index the store it was given at startup" >&2 + if ! in_container curl -fsS --connect-timeout 5 --max-time 30 -o /dev/null "${server_url}/v1/models"; then + echo "[FAIL] ${server_url} does not answer" >&2 + echo " other containers cannot reach the server; check that LMS_SERVER_HOST binds it beyond loopback" >&2 + else + echo "[FAIL] ${model} is on disk but /v1/models never listed it" >&2 + echo " the daemon did not index the store it was given at startup" >&2 + fi failed=1 fi done From 600b4450f6bc7b46c84b498b86cc647da91ede7a Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 18:20:10 +0200 Subject: [PATCH 15/21] fix(lmstudio): wait for the daemon to finish starting before the preload The preload ran lms get as soon as the container existed. On a slow runner that reaches the daemon while its delayed init is still running, and the daemon then comes up without .internal/temp. Every later model load fails, because the chat template is written with mkdtemp into that missing folder: Failed to load model "qwen2.5-0.5b-instruct". Error: ENOENT: no such file or directory, mkdtemp '/root/.lmstudio/.internal/temp/lmstudio-chat-template-...'. litellm's warm-up then returned HTTP 400 in Moodle#2 of run 35617847242, while a local deploy on faster hardware stayed green. Reproduced on fresh llmster containers capped at 0.3 CPU: an lms get issued during startup left .internal/temp absent; the same lms get issued after /lmstudio-greeting answered left it in place. The preload now waits for that endpoint, which only answers once lms server start ran, and daemon-run.sh starts the server only after the daemon's ready file exists. Co-Authored-By: Claude Opus 5 (1M context) --- roles/svc-ai-lmstudio/tasks/utils/preload/node.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/svc-ai-lmstudio/tasks/utils/preload/node.yml b/roles/svc-ai-lmstudio/tasks/utils/preload/node.yml index b89e50e2e5..1fc150e6df 100644 --- a/roles/svc-ai-lmstudio/tasks/utils/preload/node.yml +++ b/roles/svc-ai-lmstudio/tasks/utils/preload/node.yml @@ -2,6 +2,16 @@ - name: "🔍 Resolve the container before preloading on '{{ lmstudio_node }}'" ansible.builtin.include_tasks: utils/cid.yml +- name: "⏳ Wait until the LM Studio daemon has finished starting on '{{ lmstudio_node }}'" + ansible.builtin.shell: > # nocheck: container-exec-resolver runtime-resolved CID, delegated to the hosting node + container exec {{ LMSTUDIO_LOCAL_CID | quote }} curl -fsS -o /dev/null http://127.0.0.1:{{ LMSTUDIO_PORT }}/lmstudio-greeting + register: lmstudio_daemon_ready + changed_when: false + retries: 60 + delay: 5 + until: lmstudio_daemon_ready.rc == 0 + delegate_to: "{{ lmstudio_node }}" + - name: "🗄️ Measure the space the model store offers on '{{ lmstudio_node }}'" ansible.builtin.shell: > # nocheck: container-exec-resolver runtime-resolved CID, delegated to the hosting node container exec {{ LMSTUDIO_LOCAL_CID | quote }} df -P -B1 {{ LMSTUDIO_MODELS_TARGET | quote }} From 21218e11e00586ab8a058d777db1e55a5f3352ae Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 18:46:25 +0200 Subject: [PATCH 16/21] fix(lmstudio): bound the daemon readiness probe with the curl filter The readiness wait called a bare curl, which test_curl_via_filter rejects: a peer that accepts the connection and never answers keeps curl hanging, and the task's own retries never fire. The probe now renders through the curl filter with a 10 second cap per attempt. It passes retries=0, so the task's 60 x 5 s loop stays the only retry layer instead of nesting curl's --retry inside every attempt. Co-Authored-By: Claude Opus 5 (1M context) --- roles/svc-ai-lmstudio/tasks/utils/preload/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/svc-ai-lmstudio/tasks/utils/preload/node.yml b/roles/svc-ai-lmstudio/tasks/utils/preload/node.yml index 1fc150e6df..d4a0aeb063 100644 --- a/roles/svc-ai-lmstudio/tasks/utils/preload/node.yml +++ b/roles/svc-ai-lmstudio/tasks/utils/preload/node.yml @@ -4,7 +4,7 @@ - name: "⏳ Wait until the LM Studio daemon has finished starting on '{{ lmstudio_node }}'" ansible.builtin.shell: > # nocheck: container-exec-resolver runtime-resolved CID, delegated to the hosting node - container exec {{ LMSTUDIO_LOCAL_CID | quote }} curl -fsS -o /dev/null http://127.0.0.1:{{ LMSTUDIO_PORT }}/lmstudio-greeting + container exec {{ LMSTUDIO_LOCAL_CID | quote }} {{ 10 | curl(retries=0) }} -fS -o /dev/null http://127.0.0.1:{{ LMSTUDIO_PORT }}/lmstudio-greeting register: lmstudio_daemon_ready changed_when: false retries: 60 From 5b8465260fff4134ecb5c2a3453be2c465212056 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 22:38:20 +0200 Subject: [PATCH 17/21] feat(ci): deploy only the variants a change reaches An image bump in a provider redeployed every variant of every consumer, including the variants that switch that provider off and therefore never deploy the bumped image at all. The diff-derived whitelist now narrows each affected role to the variants whose own round closure still reaches a seed, emitted as `role#0,2` selection tokens. That closure is walked on the same variant-merged services maps the matrix planner builds its rounds from, so the narrowing follows a parent's variant choice across every generation of the chain. It covers every auto-derived whitelist: the weekly update PRs, Dependabot, and any other diff-driven run. The narrowing never shrinks the matrix on partial information. A seed role keeps every variant, because its own files changed. A role reached only through a run_after edge keeps every variant too, because the round closure does not follow that edge and a role whose hits are empty is therefore unnarrowed rather than dropped. A pinned token naming a role the discovery query does not return now warns instead of aborting the run. The diff-derived whitelist legitimately names roles the lifecycle envelope filters out, and once it pins variants such a token would abort every chunk; role names are still checked against roles/ before the run starts, so a typo is caught one layer earlier. The round's variant merge moves out of the deploy inventory package into utils/roles/applications/variants.py. The CI selection has to build the same maps, and importing the deploy package for them pulls in a module that reads INFINITO_SRC_DIR at import time, which the runner host does not set. Co-Authored-By: Claude Opus 5 (1M context) --- .../development/inventory/legacy_resolver.py | 92 +-------- .../development/inventory/nested_overrides.py | 90 --------- .../deploy/development/inventory/payload.py | 4 +- cli/meta/ci/validate.py | 21 ++- .../resolution/affected/__main__.py | 92 ++++++++- docs/contributing/artefact/git/pipeline.md | 4 +- scripts/github/resolve/pr_affected_roles.sh | 4 +- scripts/meta/resolve/diff/affected_roles.sh | 6 +- .../unit/python/cli/meta/ci/test_validate.py | 5 + .../resolution/affected/test_main.py | 70 +++++++ .../utils/github/variant/test_selection.py | 5 + .../applications/test_variants_overrides.py} | 9 +- utils/github/variant/selection.py | 18 +- utils/roles/applications/variants.py | 177 ++++++++++++++++++ 14 files changed, 395 insertions(+), 202 deletions(-) delete mode 100644 cli/administration/deploy/development/inventory/nested_overrides.py rename tests/unit/python/{cli/administration/deploy/development/inventory/test_nested_overrides.py => utils/roles/applications/test_variants_overrides.py} (91%) create mode 100644 utils/roles/applications/variants.py diff --git a/cli/administration/deploy/development/inventory/legacy_resolver.py b/cli/administration/deploy/development/inventory/legacy_resolver.py index 5b70ba0698..0ea121f90c 100644 --- a/cli/administration/deploy/development/inventory/legacy_resolver.py +++ b/cli/administration/deploy/development/inventory/legacy_resolver.py @@ -6,96 +6,22 @@ to this path — the `CombinedResolver` walks `dependencies` and evaluated at deploy time against `group_names`. `run_after` is NOT followed for inclusion (it is a pure ordering hint), so a variant that disables a service does not get the provider re-added through the -ordering edge. This module owns the two helpers that path needs and -nothing else; the variant-only path lives in `.variants`. +ordering edge. This module owns the include resolution that path needs +and nothing else; the round's variant-merged services maps come from +`utils.roles.applications.variants`, which the CI selection resolves its +closure from as well. """ from __future__ import annotations -from collections.abc import Iterable, Mapping, Sequence -from pathlib import Path +from typing import TYPE_CHECKING -from utils.cache.applications import get_variants -from utils.cache.base import _deep_merge -from utils.cache.yaml import load_yaml_any -from utils.roles.mapping import ROLE_FILE_META_SERVICES +from utils.roles.applications.variants import services_overrides_for_round -from .nested_overrides import apply_topic, collect_provider_overrides +if TYPE_CHECKING: + from collections.abc import Iterable, Sequence - -def _build_services_overrides_for_round( - *, - roles_dir: str, - round_index: int, - primary_app_variants: Mapping[str, int], -) -> dict[str, dict]: - """For every role with `meta/variants.yml`, return the services map - that results from merging the round's variant payload onto the - role's on-disk `meta/services.yml`. - - Apps in `primary_app_variants` use the supplied (already clamped) - index. Other roles with their own variants clamp `round_index` to - their own variant count. Roles without variants are absent from the - result so the resolver falls through to its disk-read path. - - The merged map is what the inventory ALSO bakes into host_vars, so - feeding the same dict into `CombinedResolver(services_overrides=...)` - eliminates the topology-vs-host_vars drift that variant-blind - resolution produced. - """ - variants_per_app = get_variants(roles_dir=roles_dir) - overrides: dict[str, dict] = {} - roles_path = Path(roles_dir) - for role_name, variant_list in variants_per_app.items(): - if not variant_list: - continue - variant_count = max(1, len(variant_list)) - if role_name in primary_app_variants: - idx = primary_app_variants[role_name] - else: - idx = round_index if round_index < variant_count else 0 - if not 0 <= idx < len(variant_list): - idx = 0 - variant_payload = variant_list[idx] if variant_list else {} - if not isinstance(variant_payload, Mapping): - variant_payload = {} - variant_services = variant_payload.get("services", {}) - if not isinstance(variant_services, Mapping): - continue - services_path = roles_path / role_name / ROLE_FILE_META_SERVICES - if not services_path.exists(): - continue - try: - base_services = load_yaml_any(services_path) or {} - except Exception: # noqa: S112 best-effort iteration over role files; skip malformed input - continue - if not isinstance(base_services, Mapping): - continue - merged = _deep_merge(dict(base_services), dict(variant_services)) - if isinstance(merged, dict): - overrides[role_name] = merged - _apply_nested_service_maps(overrides, roles_dir=roles_dir) - return overrides - - -def _apply_nested_service_maps(overrides: dict[str, dict], *, roles_dir: str) -> None: - """Replace a pulled-in provider's services map with what the round demands. - - Only the ``services`` topic reaches this path: the closure walks service - edges, so the other config topics a variant may override are the inventory - bake's business. - - Args: - overrides: ``{role: services map}``, mutated in place. - roles_dir: roles directory the service registry is built from. - """ - payloads = {role: {"services": services} for role, services in overrides.items()} - for provider, topics in collect_provider_overrides( - payloads, roles_dir=roles_dir - ).items(): - if "services" not in topics: - continue - overrides[provider] = apply_topic(overrides.get(provider), topics["services"]) +_build_services_overrides_for_round = services_overrides_for_round def _resolve_round_include( diff --git a/cli/administration/deploy/development/inventory/nested_overrides.py b/cli/administration/deploy/development/inventory/nested_overrides.py deleted file mode 100644 index b17a362b13..0000000000 --- a/cli/administration/deploy/development/inventory/nested_overrides.py +++ /dev/null @@ -1,90 +0,0 @@ -"""Collect the provider config a round's variants dictate. - -The topic vocabulary and merge semantics live in -``utils.roles.applications.topics``; this module resolves which role demands -what, and refuses two roles demanding different things for one provider. - -Only a config topic counts, and only on an entry naming another role's -service. A role's own entity entry is skipped, which is what keeps the two -existing `services..users` / `services..domains` declarations from -being read as overrides. -""" - -from __future__ import annotations - -from collections.abc import Mapping -from pathlib import Path -from typing import Any - -from utils.roles.applications.services.registry import ( - build_service_registry_from_roles_dir, -) -from utils.roles.applications.topics import CONFIG_TOPICS, apply_topic, provider_of - -__all__ = ["CONFIG_TOPICS", "NestedOverrideConflictError", "apply_topic"] - - -class NestedOverrideConflictError(RuntimeError): - """Two roles in one round demand different config for one provider.""" - - -def _claims(payloads: Mapping[str, Any]) -> list[tuple[str, str, str, Any]]: - """Return the ``(role, service_key, topic, value)`` a round's payloads carry. - - Args: - payloads: ``{role: variant payload}`` for one round. - - Reading this before the service registry keeps a round whose variants - override nothing from paying for the registry at all. - """ - claims: list[tuple[str, str, str, Any]] = [] - for role_name, payload in payloads.items(): - if not isinstance(payload, Mapping): - continue - services = payload.get("services") - if not isinstance(services, Mapping): - continue - for service_key, entry in services.items(): - if not isinstance(entry, Mapping): - continue - claims.extend( - (role_name, service_key, topic, entry[topic]) - for topic in sorted(CONFIG_TOPICS & set(entry)) - ) - return claims - - -def collect_provider_overrides( - payloads: Mapping[str, Any], *, roles_dir: str -) -> dict[str, dict[str, Any]]: - """Return ``{provider: {topic: value}}`` demanded by the round's payloads. - - Args: - payloads: ``{role: variant payload}`` for one round. - roles_dir: roles directory the service registry is built from. - - Raises: - NestedOverrideConflictError: two roles demand different values for the - same topic of the same provider. - """ - claims = _claims(payloads) - if not claims: - return {} - - registry = build_service_registry_from_roles_dir(Path(roles_dir)) - demanded: dict[str, dict[str, Any]] = {} - claimed_by: dict[tuple[str, str], str] = {} - for role_name, service_key, topic, value in claims: - provider = provider_of(service_key, registry) - if not provider or provider == role_name: - continue - previous = claimed_by.get((provider, topic)) - if previous and demanded[provider][topic] != value: - raise NestedOverrideConflictError( - f"{role_name} and {previous} demand different " - f"{topic!r} for {provider!r} in the same round; a " - f"round deploys it once, so the two cannot both hold" - ) - demanded.setdefault(provider, {})[topic] = value - claimed_by[(provider, topic)] = role_name - return demanded diff --git a/cli/administration/deploy/development/inventory/payload.py b/cli/administration/deploy/development/inventory/payload.py index 6421739441..ce9b6a4561 100644 --- a/cli/administration/deploy/development/inventory/payload.py +++ b/cli/administration/deploy/development/inventory/payload.py @@ -14,8 +14,8 @@ from collections.abc import Mapping, Sequence from typing import Any from utils.cache.applications import get_variant_overrides_only - -from .nested_overrides import apply_topic, collect_provider_overrides +from utils.roles.applications.topics import apply_topic +from utils.roles.applications.variants import collect_provider_overrides def _resolve_variant_payloads( diff --git a/cli/meta/ci/validate.py b/cli/meta/ci/validate.py index 97708c884d..abc3943f76 100644 --- a/cli/meta/ci/validate.py +++ b/cli/meta/ci/validate.py @@ -15,16 +15,18 @@ here instead, and the exit code gates the run. What makes a token bad, in the order this checks it: * it does not parse, or names a mode or onion state that does not exist; -* it names a role the discovery query does not return -- a typo, a role - outside the run's lifecycle envelope, or a role that no longer exists; * it pins a variant the role does not declare (any more): the usual case is a list carried over from an older run whose variants have since been renumbered; * it pins a mode the row cannot take, an onion state the row, the mode or the run's own tor axis rules out, or a distro or filesystem the run's own pool does not hold. -A bare role name that matches nothing is reported too, but as a warning: the -diff-derived whitelist legitimately names roles the envelope filters out. +A token naming a role the discovery query does not return at all is reported +too, but as a warning, whether or not it pins axes: the diff-derived whitelist +legitimately names roles the envelope filters out, and it pins the variants a +change reaches. Role names themselves are checked against `roles/` before the +run starts (scripts/github/resolve/effective_whitelist.sh), so a typo is caught +there rather than swallowed here. """ from __future__ import annotations @@ -85,12 +87,13 @@ def problems( warnings: list[str] = [] for pin in pins: token = selection.describe(pin) + if pin.app not in discovered_apps: + warnings.append( + f"{label}: {token!r} matches no discovered row " + f"(no row in this run's mode and lifecycle envelope)" + ) + continue if not pin.pinned: - if pin.app not in discovered_apps: - warnings.append( - f"{label}: {token!r} matches no discovered row " - f"(no row in this run's mode and lifecycle envelope)" - ) continue variants = pin.variants or (None,) for variant in variants: diff --git a/cli/meta/roles/applications/resolution/affected/__main__.py b/cli/meta/roles/applications/resolution/affected/__main__.py index 7a600e0056..b834fd2eb4 100755 --- a/cli/meta/roles/applications/resolution/affected/__main__.py +++ b/cli/meta/roles/applications/resolution/affected/__main__.py @@ -10,8 +10,13 @@ Usage: python -m cli.meta.roles.applications.resolution.affected --changed-roles ROLE [ROLE ...] Output: - Whitespace-separated, sorted list of affected role names (single line), - including the seed roles themselves. + Whitespace-separated, sorted list of selection tokens (single line), + including the seed roles themselves. A role whose variants do not all + reach a seed is narrowed to the ones that do (``role#0,2``, + :mod:`utils.github.variant.selection`): a variant that switches its + provider off does not inherit the seed's change, so deploying it verifies + nothing. The narrowing is transitive over the whole chain, because each + round's closure is walked on that round's variant-merged services maps. Exit codes: 0 Success. The closure was computed and printed. @@ -38,9 +43,13 @@ from cli.meta.roles.applications.resolution.combined.role_introspection import ( has_application_id, load_run_after, ) +from utils.cache.applications import get_variants +from utils.roles.applications.variants import services_overrides_for_round +from utils.roles.display import VARIANT_SEPARATOR if TYPE_CHECKING: - from collections.abc import Iterable + from collections.abc import Iterable, Sequence + from pathlib import Path EXIT_NON_MODELLABLE_SEED = 2 @@ -122,12 +131,85 @@ def affected_roles(changed: Iterable[str]) -> list[str]: return sorted(affected) +def _round_resolvers(roles_path: Path, rounds: int) -> list[CombinedResolver]: + """One resolver per deploy round, each walking that round's + variant-merged services maps. + + The maps are built by the same helper + (:func:`utils.roles.applications.variants.services_overrides_for_round`) + the matrix planner feeds its rounds from, so the topology this reads is + the topology round ``i`` deploys -- including every pulled-in role's own + variant, which is what carries the narrowing across generations. + ``run_after`` is not followed, for the reason the planner does not follow + it either: an ordering hint would re-add a provider the variant switched + off. + """ + return [ + CombinedResolver( + services_overrides=services_overrides_for_round( + roles_dir=str(roles_path), + round_index=index, + primary_app_variants={}, + ), + follow_run_after=False, + ) + for index in range(rounds) + ] + + +def _pinned( + role: str, seeds: set[str], resolvers: Sequence[CombinedResolver], count: int +) -> str: + """*role*, narrowed to the variants whose own closure reaches a seed. + + Returns the bare role id whenever the narrowing cannot be trusted: no + variant reaching a seed means the role is affected through an edge the + round closure does not model (a ``run_after`` hint, or a resolution the + variant merge refused), and verifying none of it is worse than verifying + all of it. + """ + try: + hits = [ + index + for index in range(count) + if seeds.intersection(resolvers[index].resolve(role)) + ] + except CombinedResolutionError: + return role + if not hits or len(hits) == count: + return role + return role + VARIANT_SEPARATOR + ",".join(str(index) for index in hits) + + +def affected_selection(changed: Iterable[str]) -> list[str]: + """:func:`affected_roles` as selection tokens, variant-narrowed. + + A seed role keeps every variant: its own files changed, so each of them + has to redeploy regardless of which providers it pulls. + """ + seeds: set[str] = {r.strip() for r in changed if r and r.strip()} + affected = affected_roles(changed) + variants = get_variants(roles_dir=str(roles_dir())) + counts = {role: len(variants.get(role) or ()) for role in affected} + rounds = max(counts.values(), default=0) + if rounds < 2: + return affected + resolvers = _round_resolvers(roles_dir(), rounds) + return [ + role + if role in seeds or counts[role] < 2 + else _pinned(role, seeds, resolvers, counts[role]) + for role in affected + ] + + def main() -> None: parser = argparse.ArgumentParser( description=( "Print all roles whose transitive prerequisite closure " "(run_after + dependencies + services) contains any of the " - "given seed roles. Seed roles themselves are included." + "given seed roles, each narrowed to the variants that reach one. " + "Seed roles themselves are included, with every variant." ) ) parser.add_argument( @@ -137,7 +219,7 @@ def main() -> None: help="Seed role names (folder names under ./roles).", ) args = parser.parse_args() - print(" ".join(affected_roles(args.changed_roles))) + print(" ".join(affected_selection(args.changed_roles))) if __name__ == "__main__": diff --git a/docs/contributing/artefact/git/pipeline.md b/docs/contributing/artefact/git/pipeline.md index e5d8a4f3d2..3cb37ddba5 100644 --- a/docs/contributing/artefact/git/pipeline.md +++ b/docs/contributing/artefact/git/pipeline.md @@ -80,7 +80,9 @@ The two deploy-test workflows listed in the `Infrastructure tests` table of [wor - **No diff at all** OR **any changed path outside `roles//...`**: no whitelist is set, so the full deploy across the workflow's scope runs. - **All changed paths under `roles//...`**: the changed roles become the seed set, and the whitelist is the transitive closure of those seeds expanded upwards over `run_after`, `dependencies`, and shared services. In other words, every role whose prerequisite set as defined by [combined resolver](../../../../cli/meta/roles/applications/resolution/combined/resolver.py) contains one of the seeds is included, together with the seeds themselves. -The reverse closure is fail-safe: any seed that is not modellable in the resolver (no `application_id` and not referenced by any role's `run_after`) MUST trigger a fall-back to a full deploy, as MUST any resolver runtime error. The closure MUST NOT silently shrink the deploy matrix on partial information. +Each role in that closure is then narrowed to the variants that actually reach a seed: variant `i` of a role is kept only when round `i`'s closure — walked on the same variant-merged services maps [the matrix planner](../../../../cli/administration/deploy/development/inventory/planner.py) builds its rounds from, and therefore variant-aware at every generation of the chain — contains one of the seeds. A role whose variants do not all qualify enters the whitelist as a `role#0,2` selection token, so an image bump in a provider no longer redeploys the variants that switch that provider off. This applies to every auto-derived whitelist — the weekly update PRs, Dependabot, and any other diff-driven run — because they all resolve through this one path. + +The reverse closure is fail-safe: any seed that is not modellable in the resolver (no `application_id` and not referenced by any role's `run_after`) MUST trigger a fall-back to a full deploy, as MUST any resolver runtime error. The closure MUST NOT silently shrink the deploy matrix on partial information. The variant narrowing follows the same rule: a role reached only through a `run_after` edge (which the round closure does not follow) keeps every variant, and so does a seed role itself, whose own files changed. The PR-scope short-circuits in [scope.sh](../../../../scripts/meta/resolve/pr/scope.sh) (documentation-only, agent-only) still apply at the entry layer. They skip the orchestrator entirely and are independent of the diff-driven whitelist resolution above. diff --git a/scripts/github/resolve/pr_affected_roles.sh b/scripts/github/resolve/pr_affected_roles.sh index d485039691..9434ae1480 100755 --- a/scripts/github/resolve/pr_affected_roles.sh +++ b/scripts/github/resolve/pr_affected_roles.sh @@ -15,7 +15,9 @@ # PR_BODY PR body markdown (only read on the subset path). # # Outputs (GITHUB_OUTPUT): -# whitelist= +# whitelist= +# a token is a role id, variant-narrowed to `#0,2` where +# only some of the role's variants reach the change. set -euo pipefail diff --git a/scripts/meta/resolve/diff/affected_roles.sh b/scripts/meta/resolve/diff/affected_roles.sh index ef32acb46b..696fb528f2 100755 --- a/scripts/meta/resolve/diff/affected_roles.sh +++ b/scripts/meta/resolve/diff/affected_roles.sh @@ -21,7 +21,11 @@ # (resolver exit 2), OR # * the resolver itself errors out # (any other non-zero exit). -# [ ...] restricted deploy set (whitelist). +# [ ...] restricted deploy set (whitelist). +# A token is a role id, narrowed to the +# variants that reach a seed where not all +# of them do (`web-app-x#0,2`, see +# utils.github.variant.selection). # # Pre-conditions: # - The host Python interpreter referenced by ${PYTHON:-python3} has the diff --git a/tests/unit/python/cli/meta/ci/test_validate.py b/tests/unit/python/cli/meta/ci/test_validate.py index e849f331c7..d418efec03 100644 --- a/tests/unit/python/cli/meta/ci/test_validate.py +++ b/tests/unit/python/cli/meta/ci/test_validate.py @@ -54,6 +54,11 @@ class TestProblems(unittest.TestCase): self.assertEqual(errors, []) self.assertIn("web-app-gone", warnings[0]) + def test_a_pinned_role_the_run_never_discovers_only_warns(self) -> None: + errors, warnings = _problems("web-app-gone#0,2") + self.assertEqual(errors, []) + self.assertIn("web-app-gone", warnings[0]) + def test_a_bare_role_the_run_discovers_is_silent(self) -> None: self.assertEqual(_problems("web-app-a"), ([], [])) diff --git a/tests/unit/python/cli/meta/roles/applications/resolution/affected/test_main.py b/tests/unit/python/cli/meta/roles/applications/resolution/affected/test_main.py index 6d354161d6..40314d62bc 100644 --- a/tests/unit/python/cli/meta/roles/applications/resolution/affected/test_main.py +++ b/tests/unit/python/cli/meta/roles/applications/resolution/affected/test_main.py @@ -13,6 +13,7 @@ from utils.cache.yaml import dump_yaml from utils.roles.mapping import ( ROLE_FILE_META_MAIN, ROLE_FILE_META_SERVICES, + ROLE_FILE_META_VARIANTS, ROLE_FILE_VARS_MAIN, ) @@ -38,6 +39,22 @@ def _write_run_after(root: Path, role: str, run_after: list[str]) -> None: ) +def _write_sso_consumer(root: Path, role: str, variants: list[bool]) -> None: + """A role consuming shared `sso`, with one variant per `variants` entry + that either keeps the consumption or switches it off.""" + dump_yaml( + root / "roles" / role / ROLE_FILE_META_SERVICES, + {role: {}, "sso": {"enabled": True, "shared": True, "flavor": "oidc"}}, + ) + dump_yaml( + root / "roles" / role / ROLE_FILE_META_VARIANTS, + [ + {"services": {"sso": {"enabled": consumes, "shared": consumes}}} + for consumes in variants + ], + ) + + def _write_dependencies(root: Path, role: str, deps: list[str]) -> None: dump_yaml( root / "roles" / role / ROLE_FILE_META_MAIN, @@ -104,6 +121,59 @@ class TestAffected(unittest.TestCase): self.assertIn("web-app-keycloak", got) self.assertIn("web-app-consumer", got) + def test_only_the_variants_reaching_the_seed_are_kept(self) -> None: + with tempfile.TemporaryDirectory() as td: + root = Path(td) + _mk_app_role(root, "web-app-keycloak", "keycloak") + _mk_app_role(root, "web-app-consumer", "consumer") + _write_sso_consumer(root, "web-app-consumer", [True, False, True]) + + with patch.object(repo_paths, "PROJECT_ROOT", root): + got = affected_main.affected_selection(["web-app-keycloak"]) + self.assertIn("web-app-consumer#0,2", got) + + def test_a_role_whose_variants_all_reach_the_seed_stays_bare(self) -> None: + with tempfile.TemporaryDirectory() as td: + root = Path(td) + _mk_app_role(root, "web-app-keycloak", "keycloak") + _mk_app_role(root, "web-app-consumer", "consumer") + _write_sso_consumer(root, "web-app-consumer", [True, True]) + + with patch.object(repo_paths, "PROJECT_ROOT", root): + got = affected_main.affected_selection(["web-app-keycloak"]) + self.assertIn("web-app-consumer", got) + + def test_the_narrowing_follows_a_parents_variant_one_generation_up(self) -> None: + with tempfile.TemporaryDirectory() as td: + root = Path(td) + _mk_app_role(root, "web-app-keycloak", "keycloak") + _mk_app_role(root, "web-app-matomo", "matomo") + _mk_app_role(root, "web-app-consumer", "consumer") + _write_sso_consumer(root, "web-app-matomo", [True, False]) + dump_yaml( + root / "roles" / "web-app-consumer" / ROLE_FILE_META_SERVICES, + {"consumer": {}, "matomo": {"enabled": True, "shared": True}}, + ) + dump_yaml( + root / "roles" / "web-app-consumer" / ROLE_FILE_META_VARIANTS, + [{"services": {"matomo": {"enabled": True, "shared": True}}}] * 2, + ) + + with patch.object(repo_paths, "PROJECT_ROOT", root): + got = affected_main.affected_selection(["web-app-keycloak"]) + self.assertIn("web-app-consumer#0", got) + + def test_a_seed_keeps_every_variant_of_its_own_role(self) -> None: + with tempfile.TemporaryDirectory() as td: + root = Path(td) + _mk_app_role(root, "web-app-keycloak", "keycloak") + _mk_app_role(root, "web-app-consumer", "consumer") + _write_sso_consumer(root, "web-app-consumer", [True, False]) + + with patch.object(repo_paths, "PROJECT_ROOT", root): + got = affected_main.affected_selection(["web-app-consumer"]) + self.assertEqual(got, ["web-app-consumer"]) + def test_unknown_role_raises(self) -> None: with tempfile.TemporaryDirectory() as td: root = Path(td) diff --git a/tests/unit/python/utils/github/variant/test_selection.py b/tests/unit/python/utils/github/variant/test_selection.py index 9c990f9110..f150d7378e 100644 --- a/tests/unit/python/utils/github/variant/test_selection.py +++ b/tests/unit/python/utils/github/variant/test_selection.py @@ -199,6 +199,11 @@ class TestApply(unittest.TestCase): def test_a_bare_role_that_matches_nothing_is_tolerated(self) -> None: self.assertEqual(selection.apply(_ROWS, selection.parse_list("web-app-c")), []) + def test_a_pin_on_an_undiscovered_role_is_tolerated_like_a_bare_one(self) -> None: + self.assertEqual( + selection.apply(_ROWS, selection.parse_list("web-app-c#0,2")), [] + ) + if __name__ == "__main__": unittest.main() diff --git a/tests/unit/python/cli/administration/deploy/development/inventory/test_nested_overrides.py b/tests/unit/python/utils/roles/applications/test_variants_overrides.py similarity index 91% rename from tests/unit/python/cli/administration/deploy/development/inventory/test_nested_overrides.py rename to tests/unit/python/utils/roles/applications/test_variants_overrides.py index a473f1031d..a59edde7ba 100644 --- a/tests/unit/python/cli/administration/deploy/development/inventory/test_nested_overrides.py +++ b/tests/unit/python/utils/roles/applications/test_variants_overrides.py @@ -1,4 +1,4 @@ -"""Unit tests for `cli.administration.deploy.development.inventory.nested_overrides`. +"""Unit tests for `utils.roles.applications.variants`' provider overrides. The service registry is stubbed: what matters is which role a claim is attributed to, not how a service key resolves to its provider. @@ -9,7 +9,7 @@ from __future__ import annotations import unittest from unittest.mock import patch -from cli.administration.deploy.development.inventory.nested_overrides import ( +from utils.roles.applications.variants import ( NestedOverrideConflictError, collect_provider_overrides, ) @@ -19,10 +19,7 @@ _REGISTRY = { "gitea": {"role": "web-app-gitea"}, } -_PATCH = ( - "cli.administration.deploy.development.inventory.nested_overrides" - ".build_service_registry_from_roles_dir" -) +_PATCH = "utils.roles.applications.variants.build_service_registry_from_roles_dir" class TestCollectProviderOverrides(unittest.TestCase): diff --git a/utils/github/variant/selection.py b/utils/github/variant/selection.py index 899ab590f1..c75e88f644 100644 --- a/utils/github/variant/selection.py +++ b/utils/github/variant/selection.py @@ -270,14 +270,24 @@ def apply( plus a rotation-picked one on top. Raises: - SystemExit: a token that pins something matched no row at all. Silently - deploying nothing is how a mistyped variant index turns into a - green run that tested nothing. + SystemExit: a token pins a variant of a role the query DID return, and + no row carries that variant. Silently deploying nothing is how a + mistyped variant index turns into a green run that tested nothing. + + A token whose role the query returned nothing for is let through + instead: the diff-derived whitelist legitimately names roles the + run's mode and lifecycle envelope filters out, and since that + resolver now pins the variants a change actually reaches, such a + token would otherwise abort every chunk of the run. Role names are + checked against `roles/` before the run starts + (scripts/github/resolve/effective_whitelist.sh), so a typo is still + caught -- one layer earlier. """ if not pins: return [dict(row) for row in rows] kept: list[dict[str, Any]] = [] matched: set[int] = set() + discovered = {row["name"] for row in rows} for row in rows: hits = [ (index, pin) @@ -302,7 +312,7 @@ def apply( } ) for index, pin in enumerate(pins): - if index not in matched and pin.pinned: + if index not in matched and pin.pinned and pin.app in discovered: raise SystemExit( f"selection {describe(pin)!r} matches no discovered row; " f"check the variant index and the run's lifecycle/mode filters" diff --git a/utils/roles/applications/variants.py b/utils/roles/applications/variants.py new file mode 100644 index 0000000000..9bec87ae56 --- /dev/null +++ b/utils/roles/applications/variants.py @@ -0,0 +1,177 @@ +"""What one round's variants mean for the roles that round pulls in. + +A round picks one variant per role, and that choice decides two things no +single role's `meta/services.yml` can state on its own: which providers the +role still pulls in, and how lean those providers have to be +(:mod:`utils.roles.applications.topics`). Both are resolved here, so the +matrix planner's include set, the inventory bake and the CI selection read +one answer instead of three. + +The module is deliberately free of deploy-runtime imports: the CI selection +resolves its closure on a runner that has no inventory, no container and no +`INFINITO_SRC_DIR`. +""" + +from __future__ import annotations + +from collections.abc import Mapping +from pathlib import Path +from typing import Any + +import yaml + +from utils.cache.applications import get_variants +from utils.cache.base import _deep_merge +from utils.cache.yaml import load_yaml_any +from utils.roles.applications.services.registry import ( + build_service_registry_from_roles_dir, +) +from utils.roles.applications.topics import CONFIG_TOPICS, apply_topic, provider_of +from utils.roles.mapping import ROLE_FILE_META_SERVICES + +__all__ = [ + "NestedOverrideConflictError", + "collect_provider_overrides", + "services_overrides_for_round", +] + + +class NestedOverrideConflictError(RuntimeError): + """Two roles in one round demand different config for one provider.""" + + +def _claims(payloads: Mapping[str, Any]) -> list[tuple[str, str, str, Any]]: + """Return the ``(role, service_key, topic, value)`` a round's payloads carry. + + Args: + payloads: ``{role: variant payload}`` for one round. + + Reading this before the service registry keeps a round whose variants + override nothing from paying for the registry at all. + """ + claims: list[tuple[str, str, str, Any]] = [] + for role_name, payload in payloads.items(): + if not isinstance(payload, Mapping): + continue + services = payload.get("services") + if not isinstance(services, Mapping): + continue + for service_key, entry in services.items(): + if not isinstance(entry, Mapping): + continue + claims.extend( + (role_name, service_key, topic, entry[topic]) + for topic in sorted(CONFIG_TOPICS & set(entry)) + ) + return claims + + +def collect_provider_overrides( + payloads: Mapping[str, Any], *, roles_dir: str +) -> dict[str, dict[str, Any]]: + """Return ``{provider: {topic: value}}`` demanded by the round's payloads. + + Args: + payloads: ``{role: variant payload}`` for one round. + roles_dir: roles directory the service registry is built from. + + Raises: + NestedOverrideConflictError: two roles demand different values for the + same topic of the same provider. + """ + claims = _claims(payloads) + if not claims: + return {} + + registry = build_service_registry_from_roles_dir(Path(roles_dir)) + demanded: dict[str, dict[str, Any]] = {} + claimed_by: dict[tuple[str, str], str] = {} + for role_name, service_key, topic, value in claims: + provider = provider_of(service_key, registry) + if not provider or provider == role_name: + continue + previous = claimed_by.get((provider, topic)) + if previous and demanded[provider][topic] != value: + raise NestedOverrideConflictError( + f"{role_name} and {previous} demand different " + f"{topic!r} for {provider!r} in the same round; a " + f"round deploys it once, so the two cannot both hold" + ) + demanded.setdefault(provider, {})[topic] = value + claimed_by[(provider, topic)] = role_name + return demanded + + +def _apply_nested_service_maps(overrides: dict[str, dict], *, roles_dir: str) -> None: + """Replace a pulled-in provider's services map with what the round demands. + + Only the ``services`` topic reaches this path: the closure walks service + edges, so the other config topics a variant may override are the inventory + bake's business. + + Args: + overrides: ``{role: services map}``, mutated in place. + roles_dir: roles directory the service registry is built from. + """ + payloads = {role: {"services": services} for role, services in overrides.items()} + for provider, topics in collect_provider_overrides( + payloads, roles_dir=roles_dir + ).items(): + if "services" not in topics: + continue + overrides[provider] = apply_topic(overrides.get(provider), topics["services"]) + + +def services_overrides_for_round( + *, + roles_dir: str, + round_index: int, + primary_app_variants: Mapping[str, int], +) -> dict[str, dict]: + """For every role with `meta/variants.yml`, return the services map + that results from merging the round's variant payload onto the + role's on-disk `meta/services.yml`. + + Apps in `primary_app_variants` use the supplied (already clamped) + index. Other roles with their own variants clamp `round_index` to + their own variant count. Roles without variants are absent from the + result so the resolver falls through to its disk-read path. + + The merged map is what the inventory ALSO bakes into host_vars, so + feeding the same dict into `CombinedResolver(services_overrides=...)` + eliminates the topology-vs-host_vars drift that variant-blind + resolution produced. + """ + variants_per_app = get_variants(roles_dir=roles_dir) + overrides: dict[str, dict] = {} + roles_path = Path(roles_dir) + for role_name, variant_list in variants_per_app.items(): + if not variant_list: + continue + variant_count = max(1, len(variant_list)) + if role_name in primary_app_variants: + idx = primary_app_variants[role_name] + else: + idx = round_index if round_index < variant_count else 0 + if not 0 <= idx < len(variant_list): + idx = 0 + variant_payload = variant_list[idx] if variant_list else {} + if not isinstance(variant_payload, Mapping): + variant_payload = {} + variant_services = variant_payload.get("services", {}) + if not isinstance(variant_services, Mapping): + continue + services_path = roles_path / role_name / ROLE_FILE_META_SERVICES + if not services_path.exists(): + continue + try: + base_services = load_yaml_any(services_path) or {} + except (OSError, ValueError, yaml.YAMLError): + continue + if not isinstance(base_services, Mapping): + continue + merged = _deep_merge(dict(base_services), dict(variant_services)) + if isinstance(merged, dict): + overrides[role_name] = merged + _apply_nested_service_maps(overrides, roles_dir=roles_dir) + return overrides From f40d627a1b18438a170745dcca04fd4e0b36eb32 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 22:44:41 +0200 Subject: [PATCH 18/21] docs(agents): merge the tool-specific files into AGENTS.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CLAUDE.md and GEMINI.md existed as per-runtime extensions of AGENTS.md, and only one of them carried anything at all: GEMINI.md stated that it had no additions, while CLAUDE.md held rules that bind every runtime anyway — the permission announcement, the make-over-raw preference, the loop, chain and heredoc bans, the stream-the-log-to-/tmp rule, the CI-evidence rule, the push ban and the comment rule. A rule that binds every agent does not belong in one agent's file. AGENTS.md absorbs them and now states that no tool-specific extension file exists; agents whose runtime auto-loads a different filename reach it through their own configuration instead. The filenames were machinery as much as prose. The PR templates, the branch and pull-request scope tables, the settings and security docs that justified the loop deny by "the textual CLAUDE.md rule", six requirement documents whose push instruction linked ../../CLAUDE.md, and a test docstring citing the shell-loop ban all named them, and now name AGENTS.md. scripts/meta/resolve/pr/scope.sh deliberately keeps matching CLAUDE.md and GEMINI.md: this change deletes them, and without those patterns the change itself would not classify as agent-scope. Co-Authored-By: Claude Opus 5 (1M context) --- .github/PULL_REQUEST_TEMPLATE/agents.md | 10 +-- AGENTS.md | 62 +++++++++++++++--- CLAUDE.md | 63 ------------------- GEMINI.md | 13 ---- docs/contributing/artefact/git/branch.md | 2 +- .../contributing/artefact/git/pull-request.md | 4 +- .../tools/agents/claude/security.md | 2 +- .../tools/agents/claude/settings.md | 2 +- docs/contributing/tools/agents/common.md | 3 +- docs/requirements/014-svc-runner-ci.md | 2 +- docs/requirements/023-docker-swarm-nfs.md | 2 +- docs/requirements/023-setup-penpot.md | 2 +- docs/requirements/024-web-app-erpnext.md | 2 +- .../025-web-app-matrix-ansible-flavor.md | 2 +- docs/requirements/028-web-app-semaphore.md | 2 +- tests/performance/test_runtime_performance.py | 2 +- 16 files changed, 71 insertions(+), 104 deletions(-) delete mode 100644 CLAUDE.md delete mode 100644 GEMINI.md diff --git a/.github/PULL_REQUEST_TEMPLATE/agents.md b/.github/PULL_REQUEST_TEMPLATE/agents.md index 84541e60a9..e1b12cf000 100644 --- a/.github/PULL_REQUEST_TEMPLATE/agents.md +++ b/.github/PULL_REQUEST_TEMPLATE/agents.md @@ -5,8 +5,8 @@ Briefly describe the change to the agent instruction files and the expected effe Examples: * Add a new repository rule to `AGENTS.md` -* Fix contradictory guidance between `AGENTS.md` and `CLAUDE.md` -* Improve instruction clarity for `GEMINI.md` +* Fix contradictory guidance between `AGENTS.md` and `docs/agents/*` +* Improve instruction clarity for `AGENTS.md` --- @@ -24,8 +24,8 @@ Select the primary intent of this PR: List the touched agent instruction files. * [ ] `AGENTS.md` -* [ ] `CLAUDE.md` -* [ ] `GEMINI.md` +* [ ] `roles//AGENTS.md` +* [ ] `docs/agents/*` Additional notes: @@ -61,7 +61,7 @@ Key points: Describe how the instruction change was validated. * [ ] Conflicting or ambiguous guidance checked -* [ ] Consistency between `AGENTS.md`, `CLAUDE.md`, and `GEMINI.md` verified +* [ ] Consistency between `AGENTS.md`, `roles//AGENTS.md`, and `docs/agents/*` verified * [ ] Examples, workflows, or affected contributor paths reviewed --- diff --git a/AGENTS.md b/AGENTS.md index 5cd5e69a96..14b5e52c05 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,21 +6,17 @@ - You MUST read every file under `docs/contributing/` (full directory walk, including subdirectories) for the full contributor guidance. - You MUST read every file under `docs/agents/` (full directory walk, including subdirectories) for the agent execution flow. - This file extends CONTRIBUTING.md with agent-specific instructions; on conflict between CONTRIBUTING.md and this file, this file wins. +- This file is runtime-agnostic and binding for every agent (Claude Code, Codex, Gemini CLI, other). There are no tool-specific extension files. -## Tool-Specific Extensions 🧩 +## Permission State Announcement at Session Start 📢 -At the start of every conversation, the agent MUST load its matching extension file in addition to AGENTS.md: - -- Claude Code → [CLAUDE.md](CLAUDE.md) -- Gemini CLI → [GEMINI.md](GEMINI.md) - -Agents MUST NOT read another tool's extension file. On conflict between AGENTS.md and the agent's own tool-specific extension file, the tool-specific file wins. +At the start of every new conversation, you MUST read [.claude/settings.json](.claude/settings.json) and output a one-time summary: sandbox status with concrete `allowWrite`/`denyRead` paths, plus the counts of `permissions.allow`/`ask`/`deny`. Derive content from the live file; do not hardcode. Do not repeat unless the operator asks, and do not propose `/sandbox` when it is already active. ## Reloading Instructions 🔄 -If agent instructions change mid-conversation (AGENTS.md, the tool-specific extension file, or any file referenced from them), the agent might not reload them automatically. Trigger a reload with: +If agent instructions change mid-conversation (AGENTS.md or any file referenced from it), the agent might not reload them automatically. Trigger a reload with: -> "Re-read AGENTS.md and the tool-specific extension file (CLAUDE.md or GEMINI.md) and apply all updated instructions." +> "Re-read AGENTS.md and apply all updated instructions." ## Permission Model 🔐 @@ -41,6 +37,50 @@ Agents whose runtime does not consult `.claude/settings.json` MUST still enforce Changes to the policy MUST edit [`.claude/settings.json`](.claude/settings.json). Per-entry rationale: [settings.md](docs/contributing/tools/agents/claude/settings.md); sandbox layer: [sandbox.md](docs/contributing/tools/agents/claude/sandbox.md). +## Interaction Rules 💬 + +- A question MUST NOT modify files, code, or state. Only explicit commands MAY. +- You MUST prefer commands permitted in [.claude/settings.json](.claude/settings.json) over commands that require interactive approval when an equivalent exists. + +## Code Execution ⚙️ + +- You MUST prefer `make` targets over raw `docker`/`docker compose`/`ansible-playbook`/`python`/shell invocations whenever an equivalent target exists in the [`Makefile`](Makefile). Inspect the `Makefile` first; fall back to the raw command only when no target covers the operation. The reason is operational consistency, not permissioning. Raw commands also auto-allow under the sandbox. +- **`docker exec` is FORBIDDEN. ⛔** You MUST NEVER invoke `docker exec` (nor nested `docker exec … docker exec …` into the DiD stack) directly. Always reach the live stack through `make` targets (e.g. `make compose-exec`, or the role-specific targets the `Makefile` exposes). If no `make` target covers what you need, ask the operator instead of falling back to raw `docker exec`. +- You SHOULD run sandbox-confined commands directly on the host. The sandbox bounds what they can read, write, and reach. See [sandbox.md](docs/contributing/tools/agents/claude/sandbox.md). +- For commands that legitimately cannot run inside the sandbox (e.g. operations needing access to `~/.ssh` or `~/.gnupg`), use `make compose-up` to start the stack and `make compose-exec` to drop into a container shell. The repository is mounted at `/opt/src/infinito` (see [compose.yml](compose.yml)), so code changes are immediately available there. +- Commands listed under `permissions.ask` in [.claude/settings.json](.claude/settings.json) still pause for explicit operator confirmation regardless of sandbox state. +- **Shell loops are FORBIDDEN. ⛔** You MUST NOT use `for`, `while`, `until`, or any other shell loop construct in any Bash tool call. Reason: shell control structures fall outside the sandbox auto-allow heuristic and trigger approval prompts even when every subcommand would individually auto-allow. +- **Multi-statement chains in shell invocations are FORBIDDEN. ⛔** You MUST NOT chain independent statements inside a single Bash tool call with **any** statement separator (`;`, literal newline, `&&`, `||`, `&` background operator, or subshell/brace groups around the same). The ban covers causally-dependent chains (`cd X && cmd`) just as much as optional ones, and applies to trailing `&` used to background a command (use the Bash tool's `run_in_background: true` parameter instead). Reason: identical to the loop rule. Split the work across **separate Bash tool calls** or use a single-command equivalent (`xargs`, `grep` with multiple args, a make target). +- **File creation via shell heredoc is FORBIDDEN. ⛔** You MUST NOT use `cat > file < file < file`, `echo "…" > file` for multi-line content) to create or overwrite files. Use the **Write tool**. For editing an existing file, use **Edit**, not `sed -i`/`awk -i`. Reason: Write/Edit land structured in the transcript and diff; heredoc + redirect shapes also fall out of the auto-allow heuristic and drop into ask. +- **For searching file contents, use the Grep tool.** If shelling out is unavoidable, use a single `grep` invocation with multiple file arguments (e.g. `grep -nE 'pattern' file1 file2 file3`) or a recursive call with a path/glob (e.g. `grep -rnE 'pattern' path/`). + +## Command output logging 📜 + +- For ANY non-trivial command (test runs, deploys, long pipelines), you MUST stream the FULL output to a file under `/tmp/` via `… 2>&1 | tee /tmp/.log` and grep / inspect that file repeatedly instead of re-running the command. Reason: re-running `make test` to "find the failure I just lost" costs 2 minutes per cycle; grepping the saved log costs milliseconds. +- Default the filename to a meaningful slug + monotonically increasing index (`/tmp/make-test--.log`, `/tmp/act--.log`) so you can compare runs. +- **When a long-running command streams its output to a `/tmp/.log` file** (e.g. background `make compose-deploy`, `make act-*`, or any `… 2>&1 | tee /tmp/.log`), you MUST tell the operator the concrete `tail -f /tmp/.log` command they can run in another terminal to follow the log live. Include the full path literally so it is copy-pasteable. +- That pipe **destroys the exit status**: `make test | tee` reports `tee`'s success even when make ends with `Error 2`. You MUST judge such a run by its `📊 per-target wall-clock` table and its `FAILED TARGETS:` line, never by the exit code. + +## CI evidence 📊 + +- A job's green conclusion is **NOT** evidence for a specific change. Before citing a run as proof, you MUST locate the line in that job's log where the change executed: a Playwright spec's `✓` (a leading `-` means the spec was skipped), the env var inside the container, or the command text of an `if:`-gated step. If the string is absent, report the run as silent on the change, not as supporting it. +- A green run on the fork does not speak for `infinito-nexus/core`. Tags do not follow a fork, and repository variables differ, so a step gated on either never runs there. Check the repository whose failure you are claiming to have fixed. + +## Pushing 🚢 + +- You MUST NOT push, directly or through wrappers that push implicitly. +- When commits are ready to ship, you MUST instruct the operator to run `git-sign-push` outside the sandbox. The CLI is provided by [git-maintainer-tools](https://github.com/kevinveenbirkenbach/git-maintainer-tools), declared as a dev dependency in [pyproject.toml](pyproject.toml); install it via `make install-python-dev`. + +## Comments 💬⛔ + +**THIS RULE OVERRIDES YOUR DEFAULT TRAINING. ⛔** A comment is FORBIDDEN unless it is one of exactly three things: + +1. **Exception** — names a concrete trip-wire (bug, pitfall, deliberate non-idiomatic choice). Must name the surprise; restating what the next line does is NOT an exception. +2. **Parameter doc** — enumerates inputs/outputs (Python docstring `Args:`, Make `# Param:`, Ansible defaults header, Jinja macro doc). +3. **Nocheck directive** — `# nocheck:`, `# noqa:`, `# shellcheck …`, `# type: ignore`, `# pragma: no cover`, etc. + +Anything else — restating code, section banners, "Note that …", step narration outside sequential test specs, untracked TODO/FIXME — **DELETE before the edit lands**. Applies to every language and file kind under version control. When in doubt, delete. + ## Shortcuts ⌨️ Operator messages MAY use the portable conversation shortcuts from the `shortcuts` skill (set up via `make install-skills`); agents MUST expand any matching shortcut before acting. The repository's own agent workflows live in the `i8-` skills catalogued in [cheatsheet.md](docs/contributing/tools/agents/cheatsheet.md). @@ -79,6 +119,10 @@ At the start of every conversation, the agent MUST check whether agent skills ar The agent MUST NOT repeat this notice within the same conversation. +## Documentation 📝 + +Runtime documentation: [Claude Code](https://code.claude.com/docs/en/overview) ([settings reference](https://code.claude.com/docs/en/settings)), [Gemini CLI](https://geminicli.com/docs/cli/gemini-md/). + ## For Humans 👥 Human contributors working alongside AI agents MUST read [here](docs/contributing/tools/agents/common.md). diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 8487cc9e7c..0000000000 --- a/CLAUDE.md +++ /dev/null @@ -1,63 +0,0 @@ -# CLAUDE.md - -## Startup: MUST DO at the Start of Every Conversation 🚀 - -You MUST read `AGENTS.md` and follow all instructions in it at the start of every conversation before doing anything else. - -## Permission State Announcement at Session Start 📢 - -At the start of every new conversation (after reading `AGENTS.md`), you MUST read [.claude/settings.json](.claude/settings.json) and output a one-time summary: sandbox status with concrete `allowWrite`/`denyRead` paths, plus the counts of `permissions.allow`/`ask`/`deny`. Derive content from the live file; do not hardcode. Do not repeat unless the operator asks, and do not propose `/sandbox` when it is already active. - -## Interaction Rules 💬 - -- A question MUST NOT modify files, code, or state. Only explicit commands MAY. -- You MUST prefer commands permitted in [.claude/settings.json](.claude/settings.json) over commands that require interactive approval when an equivalent exists. - -## Code Execution ⚙️ - -- You MUST prefer `make` targets over raw `docker`/`docker compose`/`ansible-playbook`/`python`/shell invocations whenever an equivalent target exists in the [`Makefile`](Makefile). Inspect the `Makefile` first; fall back to the raw command only when no target covers the operation. The reason is operational consistency, not permissioning. Raw commands also auto-allow under the sandbox. -- **`docker exec` is FORBIDDEN. ⛔** You MUST NEVER invoke `docker exec` (nor nested `docker exec … docker exec …` into the DiD stack) directly. Always reach the live stack through `make` targets (e.g. `make compose-exec`, or the role-specific targets the `Makefile` exposes). If no `make` target covers what you need, ask the operator instead of falling back to raw `docker exec`. -- You SHOULD run sandbox-confined commands directly on the host. The sandbox bounds what they can read, write, and reach. See [sandbox.md](docs/contributing/tools/agents/claude/sandbox.md). -- For commands that legitimately cannot run inside the sandbox (e.g. operations needing access to `~/.ssh` or `~/.gnupg`), use `make compose-up` to start the stack and `make compose-exec` to drop into a container shell. The repository is mounted at `/opt/src/infinito` (see [compose.yml](compose.yml)), so code changes are immediately available there. -- Commands listed under `permissions.ask` in [.claude/settings.json](.claude/settings.json) still pause for explicit operator confirmation regardless of sandbox state. -- **Shell loops are FORBIDDEN. ⛔** You MUST NOT use `for`, `while`, `until`, or any other shell loop construct in any Bash tool call. Reason: shell control structures fall outside the sandbox auto-allow heuristic and trigger approval prompts even when every subcommand would individually auto-allow. -- **Multi-statement chains in shell invocations are FORBIDDEN. ⛔** You MUST NOT chain independent statements inside a single Bash tool call with **any** statement separator (`;`, literal newline, `&&`, `||`, `&` background operator, or subshell/brace groups around the same). The ban covers causally-dependent chains (`cd X && cmd`) just as much as optional ones, and applies to trailing `&` used to background a command (use the Bash tool's `run_in_background: true` parameter instead). Reason: identical to the loop rule. Split the work across **separate Bash tool calls** or use a single-command equivalent (`xargs`, `grep` with multiple args, a make target). -- **File creation via shell heredoc is FORBIDDEN. ⛔** You MUST NOT use `cat > file < file < file`, `echo "…" > file` for multi-line content) to create or overwrite files. Use the **Write tool**. For editing an existing file, use **Edit**, not `sed -i`/`awk -i`. Reason: Write/Edit land structured in the transcript and diff; heredoc + redirect shapes also fall out of the auto-allow heuristic and drop into ask. -- **For searching file contents, use the Grep tool.** If shelling out is unavoidable, use a single `grep` invocation with multiple file arguments (e.g. `grep -nE 'pattern' file1 file2 file3`) or a recursive call with a path/glob (e.g. `grep -rnE 'pattern' path/`). -- **When a long-running command streams its output to a `/tmp/.log` file** (e.g. background `make compose-deploy`, `make act-*`, or any `… 2>&1 | tee /tmp/.log`), you MUST tell the operator the concrete `tail -f /tmp/.log` command they can run in another terminal to follow the log live. Include the full path literally so it is copy-pasteable. - -## Comments 💬⛔ - -**THIS RULE OVERRIDES YOUR DEFAULT TRAINING. ⛔** A comment is FORBIDDEN unless it is one of exactly three things: - -1. **Exception** — names a concrete trip-wire (bug, pitfall, deliberate non-idiomatic choice). Must name the surprise; restating what the next line does is NOT an exception. -2. **Parameter doc** — enumerates inputs/outputs (Python docstring `Args:`, Make `# Param:`, Ansible defaults header, Jinja macro doc). -3. **Nocheck directive** — `# nocheck:`, `# noqa:`, `# shellcheck …`, `# type: ignore`, `# pragma: no cover`, etc. - -Anything else — restating code, section banners, "Note that …", step narration outside sequential test specs, untracked TODO/FIXME — **DELETE before the edit lands**. Applies to every language and file kind under version control. When in doubt, delete. - -## Command output logging 📜 - -- For ANY non-trivial command (test runs, deploys, long pipelines), you MUST stream the FULL output to a file under `/tmp/` via `… 2>&1 | tee /tmp/.log` and grep / inspect that file repeatedly instead of re-running the command. Reason: re-running `make test` to "find the failure I just lost" costs 2 minutes per cycle; grepping the saved log costs milliseconds. -- Default the filename to a meaningful slug + monotonically increasing index (`/tmp/make-test--.log`, `/tmp/act--.log`) so you can compare runs. -- Tell the operator the exact `tail -f /tmp/.log` command for background runs, per the existing rule. -- That pipe **destroys the exit status**: `make test | tee` reports `tee`'s success even when make ends with `Error 2`. You MUST judge such a run by its `📊 per-target wall-clock` table and its `FAILED TARGETS:` line, never by the exit code. - -## CI evidence 📊 - -- A job's green conclusion is **NOT** evidence for a specific change. Before citing a run as proof, you MUST locate the line in that job's log where the change executed: a Playwright spec's `✓` (a leading `-` means the spec was skipped), the env var inside the container, or the command text of an `if:`-gated step. If the string is absent, report the run as silent on the change, not as supporting it. -- A green run on the fork does not speak for `infinito-nexus/core`. Tags do not follow a fork, and repository variables differ, so a step gated on either never runs there. Check the repository whose failure you are claiming to have fixed. - -## Pushing 🚢 - -- You MUST NOT push, directly or through wrappers that push implicitly. -- When commits are ready to ship, you MUST instruct the operator to run `git-sign-push` outside the sandbox. The CLI is provided by [git-maintainer-tools](https://github.com/kevinveenbirkenbach/git-maintainer-tools), declared as a dev dependency in [pyproject.toml](pyproject.toml); install it via `make install-python-dev`. - -## Configuration 🛠️ - -- Project-level permissions and sandbox rules are defined in [.claude/settings.json](.claude/settings.json). -- See [code.claude.com](https://code.claude.com/docs/en/settings) for documentation on how to modify it. - -## Documentation 📝 - -See the [Claude Code documentation](https://code.claude.com/docs/en/overview) for further information. For human contributor guidance on working with agents, see [here](docs/contributing/tools/agents/common.md). diff --git a/GEMINI.md b/GEMINI.md deleted file mode 100644 index 0b42f87f5a..0000000000 --- a/GEMINI.md +++ /dev/null @@ -1,13 +0,0 @@ -# GEMINI.md - -## Purpose - -This file extends [AGENTS.md](AGENTS.md) with Gemini-specific additions. You MUST read `AGENTS.md` first as the entry point for all agent instructions. - -## Current Status - -- No Gemini-specific additions are currently defined. - -## Documentation - -See the [Gemini CLI documentation](https://geminicli.com/docs/cli/gemini-md/). For human contributor guidance on working with agents, see [here](docs/contributing/tools/agents/common.md). diff --git a/docs/contributing/artefact/git/branch.md b/docs/contributing/artefact/git/branch.md index b7933d5111..020cded368 100644 --- a/docs/contributing/artefact/git/branch.md +++ b/docs/contributing/artefact/git/branch.md @@ -6,7 +6,7 @@ The branch prefix MUST match the type of change. The [PR workflow](pull-request. | Branch prefix | Scope | Matching files | CI behavior | |---|---|---|---| -| `agent` | Changes to agent instructions or prompts | `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `docs/agents/*` | Skips [orchestrator](../../../../.github/workflows/call-orchestrator.yml), finishes green through the lightweight scope gate. | +| `agent` | Changes to agent instructions or prompts | `AGENTS.md`, `roles//AGENTS.md`, `docs/agents/*` | Skips [orchestrator](../../../../.github/workflows/call-orchestrator.yml), finishes green through the lightweight scope gate. | | `documentation` | Documentation-only changes | `**/*.md`, `**/*.rst` (outside agent paths) | Skips [orchestrator](../../../../.github/workflows/call-orchestrator.yml), finishes green through the lightweight scope gate. | | `feature` | New features or enhancements | `*` | Runs the full [orchestrator](../../../../.github/workflows/call-orchestrator.yml) pipeline. | | `fix` | Bug fixes | `*` | Runs the full [orchestrator](../../../../.github/workflows/call-orchestrator.yml) pipeline. | diff --git a/docs/contributing/artefact/git/pull-request.md b/docs/contributing/artefact/git/pull-request.md index 9b3d37233e..a848bcbf55 100644 --- a/docs/contributing/artefact/git/pull-request.md +++ b/docs/contributing/artefact/git/pull-request.md @@ -10,8 +10,8 @@ You MUST pick the template that matches your change. The table below links the a | Workstation and `desk-*` changes | [workstation.md](../../../../.github/PULL_REQUEST_TEMPLATE/workstation.md) | | Shared system changes such as `sys-*`, `svc-*`, `dev-*`, `drv-*`, `pkgmgr`, `update-*`, or `user-*` | [system.md](../../../../.github/PULL_REQUEST_TEMPLATE/system.md) | | CI/CD and workflow changes | [pipeline.md](../../../../.github/PULL_REQUEST_TEMPLATE/pipeline.md) | -| Documentation-only changes limited to `.md` or `.rst` files outside `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and `docs/agents/*` | [documentation.md](../../../../.github/PULL_REQUEST_TEMPLATE/documentation.md) | -| Agent-specific changes limited to `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, or `docs/agents/*` | [agents.md](../../../../.github/PULL_REQUEST_TEMPLATE/agents.md) | +| Documentation-only changes limited to `.md` or `.rst` files outside `AGENTS.md` and `docs/agents/*` | [documentation.md](../../../../.github/PULL_REQUEST_TEMPLATE/documentation.md) | +| Agent-specific changes limited to `AGENTS.md` or `docs/agents/*` | [agents.md](../../../../.github/PULL_REQUEST_TEMPLATE/agents.md) | ## Branch Naming 🏷️ diff --git a/docs/contributing/tools/agents/claude/security.md b/docs/contributing/tools/agents/claude/security.md index ddbe8cfa55..f099cdb17c 100644 --- a/docs/contributing/tools/agents/claude/security.md +++ b/docs/contributing/tools/agents/claude/security.md @@ -72,7 +72,7 @@ The `Bash(*)` allow lets the agent run any Makefile target without prompting. Th ## Assumption 8: Shell control-flow loops are never necessary 🔁 -[CLAUDE.md](../../../../../CLAUDE.md) forbids `for` / `while` / `until` loops in Bash invocations, and `Bash(for *)` / `Bash(while *)` / `Bash(until *)` are in `deny` to enforce the rule. Every task has a flat-form equivalent: a single `grep` with multiple file arguments, `xargs`, a recursive glob, or a dedicated tool. +[AGENTS.md](../../../../../AGENTS.md) forbids `for` / `while` / `until` loops in Bash invocations, and `Bash(for *)` / `Bash(while *)` / `Bash(until *)` are in `deny` to enforce the rule. Every task has a flat-form equivalent: a single `grep` with multiple file arguments, `xargs`, a recursive glob, or a dedicated tool. **Why this matters:** Loops can hide destructive operations (for example `for f in $(ls); do rm "$f"; done`) behind a single approval step. The deny rule converts a rule violation into a hard failure, so the agent receives concrete feedback and refactors to the flat form. diff --git a/docs/contributing/tools/agents/claude/settings.md b/docs/contributing/tools/agents/claude/settings.md index 9b3668d16b..3faedd79fb 100644 --- a/docs/contributing/tools/agents/claude/settings.md +++ b/docs/contributing/tools/agents/claude/settings.md @@ -97,7 +97,7 @@ These operations are unconditionally blocked, regardless of any `allow` entry or | Permission | Reason | |---|---| -| `for *` / `while *` / `until *` | Shell control-flow loops (`for f in ...; do ...; done`, `while read ...`, `until cond; do ...`). See Assumption 8 in [security.md](security.md) for why loops are banned at the policy layer rather than in the textual [CLAUDE.md](../../../../../CLAUDE.md) rule alone. The sandbox auto-allow heuristic does not recognise loop keywords, so this deny has no cost versus any alternative (allow would also require explicit entries; ask would deadlock). | +| `for *` / `while *` / `until *` | Shell control-flow loops (`for f in ...; do ...; done`, `while read ...`, `until cond; do ...`). See Assumption 8 in [security.md](security.md) for why loops are banned at the policy layer rather than in the textual [AGENTS.md](../../../../../AGENTS.md) rule alone. The sandbox auto-allow heuristic does not recognise loop keywords, so this deny has no cost versus any alternative (allow would also require explicit entries; ask would deadlock). | | `gh api * -X DELETE *` / `gh api * --method DELETE *` | DELETE is irreversible from the API surface: deleting a release, branch ref, deploy key, or webhook destroys data with no undo. Both `-X` and `--method` spellings are blocked so neither shorthand slips through. | | `gh api * -X PUT *` / `gh api * --method PUT *` | PUT replaces a resource wholesale. On endpoints like branch protection or rulesets, a PUT silently overwrites the entire policy with whatever payload is sent; partial JSON drops every unspecified field. PATCH (the merge variant) still goes through `ask`. | | `gh api * /actions/secrets*:*` | Touches GitHub Actions secrets: reading metadata, creating, updating, or deleting. Even GETs leak secret names; mutations rotate credentials CI depends on. Out-of-band secret management only. | diff --git a/docs/contributing/tools/agents/common.md b/docs/contributing/tools/agents/common.md index 9144b9517e..9804b77522 100644 --- a/docs/contributing/tools/agents/common.md +++ b/docs/contributing/tools/agents/common.md @@ -2,14 +2,13 @@ AI assistants are welcome, but they MUST follow the same workflow as humans. -- You MUST treat [AGENTS.md](../../../../AGENTS.md) as the entry point for all agent-specific execution instructions. Tool-specific files such as `CLAUDE.md` and `GEMINI.md` extend `AGENTS.md` and MUST NOT contradict it. +- You MUST treat [AGENTS.md](../../../../AGENTS.md) as the single, runtime-agnostic source of agent-specific execution instructions. There are no tool-specific extension files. - You MUST NOT invent commands, workflows, or files that do not exist. - You MUST NEVER expose secrets in prompts, code, screenshots, or logs. - You MUST treat AI output as a draft that must be reviewed for wrong assumptions, duplicate logic, and security mistakes. - You MUST keep explanations simple and explicit. - You MUST state assumptions clearly. -For tool-specific configuration and additional instructions, see [CLAUDE.md](../../../../CLAUDE.md) and [GEMINI.md](../../../../GEMINI.md). For a full reference of permitted Claude Code operations and their security rationale, see [claude/](claude/README.md). For further support, visit the AI forum at [s.infinito.nexus/aihub](https://s.infinito.nexus/aihub) or join the Matrix group #ai:infinito.nexus. diff --git a/docs/requirements/014-svc-runner-ci.md b/docs/requirements/014-svc-runner-ci.md index 8791fa1106..8ad7faeec0 100644 --- a/docs/requirements/014-svc-runner-ci.md +++ b/docs/requirements/014-svc-runner-ci.md @@ -44,4 +44,4 @@ The implementation of this requirement MUST be executed autonomously by the agen - [x] **Iteration loop.** The agent MUST follow the [Workflow Loop](../agents/action/iteration/workflow.md) for every change to GitHub Actions workflows the implementation touches, and the [Compose Loop](../agents/action/iteration/compose.md) for every change inside `roles/svc-runner/`. The agent MUST NOT skip the loop's debug-locally step in favour of remote CI reruns. - [x] **No `ask` prompts mid-run.** The agent MUST NOT trigger any tool call that routes through `permissions.ask` in [.claude/settings.json](../../.claude/settings.json) during implementation. Where a tool would otherwise route through `ask`, the agent MUST select an equivalent already covered by `permissions.allow`, or rephrase the operation to fit the sandbox. The single permitted exception is the final commit at the end of the run. - [x] **No interruptions.** Bug fixes, deploy failures, lint failures, `make test` failures, healthcheck flaps, and similar issues MUST be resolved at their root inside this same iteration without prompting the operator. Workarounds, ad-hoc skips, retry-until-green loops, or "track in a follow-up" deferrals MUST NOT be used. -- [x] **One commit at the end.** The agent MUST NOT create any intermediate commit. ALL changes (role, CLI, tests, documentation, and the ticked checkboxes in this document) MUST be combined into ONE commit, created only after every Acceptance Criterion above is checked off (`- [x]`) and `make test` is green. Per-step commits, checkpoint commits, and partial commits MUST NOT be created. The agent MUST NOT push; the operator runs `git-sign-push` outside the sandbox per [CLAUDE.md](../../CLAUDE.md). +- [x] **One commit at the end.** The agent MUST NOT create any intermediate commit. ALL changes (role, CLI, tests, documentation, and the ticked checkboxes in this document) MUST be combined into ONE commit, created only after every Acceptance Criterion above is checked off (`- [x]`) and `make test` is green. Per-step commits, checkpoint commits, and partial commits MUST NOT be created. The agent MUST NOT push; the operator runs `git-sign-push` outside the sandbox per [AGENTS.md](../../AGENTS.md). diff --git a/docs/requirements/023-docker-swarm-nfs.md b/docs/requirements/023-docker-swarm-nfs.md index 8403680527..3cb0989d1e 100644 --- a/docs/requirements/023-docker-swarm-nfs.md +++ b/docs/requirements/023-docker-swarm-nfs.md @@ -202,7 +202,7 @@ The implementation of this requirement MUST be executed autonomously by the agen - [ ] **Iteration loop.** The agent MUST follow the [Compose Loop](../agents/action/iteration/compose.md) for every change inside `roles/svc-swarm-node/`, `roles/svc-prx-openresty/` (swarm-mode adaptations), `roles/svc-storage-nfs-server/`, `roles/svc-storage-nfs-client/`, and `roles/web-app-mediawiki/` (pilot). The agent MUST follow the [Workflow Loop](../agents/action/iteration/workflow.md) for every change to `.github/workflows/test-deploy-swarm-nfs.yml`. The agent MUST NOT skip the loop's debug-locally step in favour of remote CI reruns. - [ ] **No `ask` prompts mid-run.** The agent MUST NOT trigger any tool call that routes through `permissions.ask` in [.claude/settings.json](../../.claude/settings.json) during implementation. Where a tool would otherwise route through `ask`, the agent MUST select an equivalent already covered by `permissions.allow`, or rephrase the operation to fit the sandbox. The single permitted exception is the final commit at the end of the run. - [ ] **No interruptions.** Bug fixes, deploy failures, lint failures, `make test` failures, healthcheck flaps, swarm-init flakes, NFS mount races, workflow reruns until green — every issue MUST be resolved at its root inside this same iteration without prompting the operator. Workarounds, ad-hoc skips, retry-until-green loops, or "track in a follow-up" deferrals MUST NOT be used. -- [ ] **One commit at the end.** The agent MUST NOT create any intermediate commit. ALL changes (the three new roles, the openresty swarm-mode adaptations, the pilot role updates, the CI workflow, schema entries, group_vars defaults, documentation, and the ticked checkboxes in this document) MUST be combined into ONE commit, created only after every Acceptance Criterion above is checked off (`- [x]`), `make test` is green, and `.github/workflows/test-deploy-swarm-nfs.yml` is green on its first scheduled run. Per-step commits, checkpoint commits, and partial commits MUST NOT be created. The agent MUST NOT push; the operator runs `git-sign-push` outside the sandbox per [CLAUDE.md](../../CLAUDE.md). +- [ ] **One commit at the end.** The agent MUST NOT create any intermediate commit. ALL changes (the three new roles, the openresty swarm-mode adaptations, the pilot role updates, the CI workflow, schema entries, group_vars defaults, documentation, and the ticked checkboxes in this document) MUST be combined into ONE commit, created only after every Acceptance Criterion above is checked off (`- [x]`), `make test` is green, and `.github/workflows/test-deploy-swarm-nfs.yml` is green on its first scheduled run. Per-step commits, checkpoint commits, and partial commits MUST NOT be created. The agent MUST NOT push; the operator runs `git-sign-push` outside the sandbox per [AGENTS.md](../../AGENTS.md). ## See Also diff --git a/docs/requirements/023-setup-penpot.md b/docs/requirements/023-setup-penpot.md index b708d6c124..cca1c9cfd5 100644 --- a/docs/requirements/023-setup-penpot.md +++ b/docs/requirements/023-setup-penpot.md @@ -90,7 +90,7 @@ The implementation of this requirement MUST be executed autonomously by the agen - [x] **Iteration loops.** The agent MUST follow the [Compose Loop](../agents/action/iteration/compose.md) for every change inside `roles/web-app-penpot/`, and the [Playwright Loop](../agents/action/iteration/playwright.md) for every change to the role's Playwright spec. The debug-locally step MUST NOT be skipped in favour of remote CI reruns. - [x] **No `ask` prompts mid-run.** The agent MUST NOT trigger any tool call that routes through `permissions.ask` in [.claude/settings.json](../../.claude/settings.json) during implementation. Where a tool would otherwise route through `ask`, the agent MUST select an equivalent covered by `permissions.allow`, or rephrase the operation to fit the sandbox. The single permitted exception is the final commit. - [x] **No interruptions.** Bug fixes, deploy failures, lint failures, `make test` failures, and healthcheck flaps MUST be resolved at their root inside this same iteration without prompting the operator. Workarounds, ad-hoc skips, retry-until-green loops, or "track in a follow-up" deferrals MUST NOT be used. -- [ ] **One commit at the end.** ALL changes (role, meta, Playwright spec, documentation, marketplace entry, and the ticked checkboxes in this document) MUST be combined into ONE commit, created only after every Acceptance Criterion above is checked off (`- [x]`) and `make test` is green. The agent MUST NOT push; the operator runs `git-sign-push` outside the sandbox per [CLAUDE.md](../../CLAUDE.md). +- [ ] **One commit at the end.** ALL changes (role, meta, Playwright spec, documentation, marketplace entry, and the ticked checkboxes in this document) MUST be combined into ONE commit, created only after every Acceptance Criterion above is checked off (`- [x]`) and `make test` is green. The agent MUST NOT push; the operator runs `git-sign-push` outside the sandbox per [AGENTS.md](../../AGENTS.md). ## See Also diff --git a/docs/requirements/024-web-app-erpnext.md b/docs/requirements/024-web-app-erpnext.md index d0adeb2676..239e87b4a5 100644 --- a/docs/requirements/024-web-app-erpnext.md +++ b/docs/requirements/024-web-app-erpnext.md @@ -301,7 +301,7 @@ The agent MUST execute this requirement **autonomously**. Open clarifications on - The agent MUST NOT create any git commit until every Acceptance Criterion in this document is checked off (`- [x]`). - A single commit (or a tight, related sequence) lands the whole role addition; no half-scaffolded intermediate commits. -- When all ACs are met, `make test` is green, and the three variants deploy cleanly, the agent instructs the operator to run `git-sign-push` outside the sandbox (per [CLAUDE.md](../../CLAUDE.md)). The agent MUST NOT push. +- When all ACs are met, `make test` is green, and the three variants deploy cleanly, the agent instructs the operator to run `git-sign-push` outside the sandbox (per [AGENTS.md](../../AGENTS.md)). The agent MUST NOT push. ## Context diff --git a/docs/requirements/025-web-app-matrix-ansible-flavor.md b/docs/requirements/025-web-app-matrix-ansible-flavor.md index 4e78f783f2..6b483b4770 100644 --- a/docs/requirements/025-web-app-matrix-ansible-flavor.md +++ b/docs/requirements/025-web-app-matrix-ansible-flavor.md @@ -230,7 +230,7 @@ The agent MUST execute this requirement **autonomously** once Proposed Decisions ## Commit Policy - Single commit (or a tight, related sequence) lands the whole ansible-flavor addition; no half-scaffolded intermediate commits. -- When all ACs are checked off, `make test` is green, and the four variants deploy cleanly, the agent instructs the operator to run `git-sign-push` outside the sandbox (per [CLAUDE.md](../../CLAUDE.md)). The agent MUST NOT push. +- When all ACs are checked off, `make test` is green, and the four variants deploy cleanly, the agent instructs the operator to run `git-sign-push` outside the sandbox (per [AGENTS.md](../../AGENTS.md)). The agent MUST NOT push. ## Context diff --git a/docs/requirements/028-web-app-semaphore.md b/docs/requirements/028-web-app-semaphore.md index 1bc579617f..fc04173124 100644 --- a/docs/requirements/028-web-app-semaphore.md +++ b/docs/requirements/028-web-app-semaphore.md @@ -209,7 +209,7 @@ Execute autonomously; open a clarification only when a decision is genuinely amb - No git commit until every Acceptance Criterion is checked off (`- [x]`). - A single commit (or a tight related sequence) lands the whole role addition. -- When all ACs are met and the variants deploy cleanly, instruct the operator to run `git-sign-push` outside the sandbox (per [CLAUDE.md](../../CLAUDE.md)). The agent MUST NOT push. +- When all ACs are met and the variants deploy cleanly, instruct the operator to run `git-sign-push` outside the sandbox (per [AGENTS.md](../../AGENTS.md)). The agent MUST NOT push. ## Context diff --git a/tests/performance/test_runtime_performance.py b/tests/performance/test_runtime_performance.py index bad5f4ac0d..5f11fcfac7 100644 --- a/tests/performance/test_runtime_performance.py +++ b/tests/performance/test_runtime_performance.py @@ -97,7 +97,7 @@ class TestRuntimeLookupPerformance(unittest.TestCase): hit the cache and stay under theirs. Using a single for-loop here is test-code-only and not production code - generating files/tasks; the CLAUDE.md shell-loop ban does not apply. + generating files/tasks; the AGENTS.md shell-loop ban does not apply. """ warm = _simulate_ansible_variables(self.shared_applications, self.shared_users) t0 = time.process_time() From 8844811966cea5b844ad7719d5010c88e00cf33c Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 22:50:23 +0200 Subject: [PATCH 19/21] docs(changelog): name the 14.0.0 version jumps and its authors The entry described what the release does but not what it moved or who wrote it, which every earlier entry states. The version list is derived from the diff between the two release tags over roles/*/meta/services.yml and meta/addons/*.yml, deduplicated per role and annotated where a sub-service differs from the role's own image, so GitLab appears once for its six images and Matrix once for Synapse and once for Element. Pins are listed apart from jumps, because a moving tag that now carries a release is not an upgrade: the tag names the same software it always did. The Debian codename bases that became numeric slim tags sit in that paragraph for the same reason, and web-app-flowise is called out as an image switch, since Flowise itself stays at 3.1.4 under a locally built node base. Contributors follow the shape of the 13.0.0 and 11.x entries and come from git shortlog over the tag range. The bot commits are not listed there; what they produced is the version list itself. Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c523b9e14..22d80c6a81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -143,6 +143,62 @@ dash. Documentation generators are gathered under *cli/build/docs*, and a new CLI edits role bonds in a matrix instead of hunting through files. +* Image and dependency version jumps (net since 13.0.0): + * *svc-ai-ollama*: 0.32.15 to 0.34.0 + * *svc-db-elasticsearch*: 9.5.2 to 9.5.3 + * *svc-db-qdrant*: v1.19.0 to v1.19.1 + * *sys-ctl-hlth-csp* (csp-checker): 2.2.1 to 3.0.4 + * *sys-lint* (shfmt): v3.13.1 to v3.14.1 + * *test-e2e-playwright*: v1.62.1-noble to v1.63.0-noble + * *web-app-bluesky* (view): 1.131.1 to 1.132.0 + * *web-app-bookwyrm*: v0.9.2 to v0.9.3 + * *web-app-confluence*: 10.2.15 to 10.2.18 + * *web-app-dashboard*: 2.0.0 to 2.1.3 + * *web-app-erpnext*: v16.32.3 to v16.34.2 + * *web-app-espocrm*: 10.0.6 to 10.0.8 + * *web-app-funkwhale*: 2.0.9 to 2.0.10 + * *web-app-gitea*: 1.27.2 to 1.27.3 + * *web-app-gitlab* (webservice, sidekiq, workhorse, gitaly, shell, rails): v19.3.0 to v19.3.2 + * *web-app-jira*: 11.3.10 to 11.3.11 + * *web-app-keycloak*: 26.7.2 to 26.7.3 + * *web-app-matrix* (Synapse): v1.159.0 to v1.160.0 + * *web-app-matrix* (Element): v1.12.26 to v1.12.28 + * *web-app-mattermost*: 11.10.1 to 11.11.0 + * *web-app-n8n*: 1.95.3 to 1.100.1 + * *web-app-nextcloud* (proxy): 1.31.3-alpine to 1.31.5-alpine + * *web-app-opentalk* (LiveKit): v1.13.5 to v1.13.6 + * *web-app-opentalk* (RabbitMQ): 4.3.4 to 4.3.5 + * *web-app-penpot* (frontend, backend, exporter): 2.17.1 to 2.17.2 + * *web-app-seaweedfs*: 4.44 to 4.46 + * *web-app-semaphore*: v2.19.8 to v2.19.14 + * *web-app-socialhome*: 2026.6.16 to 2026.9.18 + * *web-app-yourls*: 1.10.4-apache to 1.10.6-apache + * *web-app-zammad*: 6.5.0 to 7.1.2 + * *web-svc-coturn*: 4.17.2 to 4.18.0 + +* Moving tags that now carry a release, one per role: *web-app-discourse* master to + v2026.8.0, *web-app-jenkins* lts to 2.568.3-lts, *web-app-openwebui* main to 0.11.0, + *web-app-pretix* stable to 2026.7.0, *web-app-xwiki* lts-postgres-tomcat to + 17.10.13-postgres-tomcat, *web-app-pixelfed* latest to 20260917, *web-app-matrix* (upstream + playbook ref) master to a commit pin, *svc-db-memcached* alpine to 1.6.45-alpine, + *svc-db-redis* alpine to 8.10.1-alpine, *svc-prx-openresty* alpine to 1.31.1.1-alpine, + *svc-runner* (BuildKit) buildx-stable-1 to v0.33.0, *web-app-bigbluebutton* (dockerize) + latest to v0.15.1, and the nginx sidecars of *web-app-fediwall*, *web-app-littlejs*, + *web-app-taiga* and *web-svc-coturn* to 1.31.6-alpine. The Debian codename bases became numeric slim tags in + *svc-db-openldap* (12.15-slim), *svc-net-tor* (13.6-slim), *web-app-bookwyrm*, + *web-app-bridgy-fed*, *web-app-postmarks*, *web-app-roulette-wheel*, *web-svc-cdn* and + *web-svc-simpleicons*, and *web-app-flowise* is built from node 24-slim instead of pulled + (Flowise itself stays at 3.1.4). + +**Contributors** + +* [Kevin Veen-Birkenbach](https://veen.world): LLM gateway and model backends, the declared + MCP layer and its sidecar, agent employees and the kernel-isolated tier, Home Assistant, + credential declaration and rotation, firewall/tor/DNS ownership, variant-dictated provider + configuration, the fail-closed lints, CI selection and resume, swarm convergence, and + version maintenance +* [Prageeth Panicker](https://github.com/pragepani): .ansible cache directory ignored + ## [13.0.0] - 2026-08-26 * **Tor as a first-class deployment axis.** The new *svc-net-tor* role routes onion From 46b6e94a707c4116fffe7c87d0caa0f33670179b Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 23:12:35 +0200 Subject: [PATCH 20/21] Release version 14.1.0 --- CHANGELOG.md | 52 +++++++++++++++++++++++++++ packaging/arch/PKGBUILD | 2 +- packaging/debian/changelog | 54 ++++++++++++++++++++++++++++ packaging/fedora/infinito-nexus.spec | 53 ++++++++++++++++++++++++++- pyproject.toml | 2 +- 5 files changed, 160 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22d80c6a81..b0f4b5b707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,57 @@ # Changelog +## [14.1.0] - 2026-09-21 + +**[14.1.0] - 2026-09-21** + +**For Users** + +* **Local models reach the gateway again.** Upstream re-pushed the *svc-ai-lmstudio* CPU + image with a server that listens on loopback only, so the role stayed green while litellm + could not connect and the AI features of Mattermost, Matrix, xWiki, Moodle and Zammad + failed their warm-up. The server binds the container network again and stays unpublished. + The model preload now waits until the daemon has finished starting, so a slow host no + longer ends up with a daemon that fails every later model load, and the readiness probe + is capped per attempt so a silent peer cannot hang it. See + [svc-ai-lmstudio](roles/svc-ai-lmstudio/README.md). + +**For Developers** + +* **CI deploys only the variants a change reaches.** An image bump in a provider no longer + redeploys the variants of its consumers that switch that provider off. The diff-derived + whitelist, used by the weekly update PRs, Dependabot and every other diff-driven run, + narrows each affected role to the variants whose round closure still reaches a changed + role, emitted as *role#0,2* selection tokens. A changed role and a role reached only + through *run_after* keep every variant. A pinned token naming a role that discovery does + not return now warns instead of aborting the run; role names are still checked against + *roles/* before the run starts. + +* **One instruction file for every agent.** *AGENTS.md* now holds every agent rule, and + *CLAUDE.md* and *GEMINI.md* are gone. The rules they carried bind every runtime anyway, + and the PR templates, scope tables, requirement documents and docs that named the old + files now name *AGENTS.md*. + +* Image and dependency version jumps (net since 14.0.0): + * *svc-ai-ollama*: 0.34.0 to 0.34.2 + * *svc-net-tor* (Debian base): 13.6-slim to 13.7-slim + * *web-app-baserow*: 2.3.3 to 2.3.4 + * *web-app-erpnext*: v16.34.2 to v16.35.0 + * *web-app-funkwhale* (front, api): 2.0.10 to 2.0.11 + * *web-app-jitsi* (web, prosody, jicofo, jvb): stable-9646 to stable-11031 + * *web-app-keycloak*: 26.7.3 to 26.7.4 + * *web-app-opentalk* (LiveKit): v1.13.6 to v1.13.7 + * *web-app-opentalk* (RabbitMQ): 4.3.5 to 4.3.6 + * *web-app-peertube*: v8.2.4 to v8.3.0 + * *web-app-pihole*: 2026.07.2 to 2026.09.0 + * *web-app-prometheus* (Alertmanager): v0.34.0 to v0.34.1 + * Ansible collection *hetzner.hcloud*: 7.0.1 to 7.1.0 + * *ruff* (dev): 0.16.6 to 0.16.7 + +**Contributors** + +* [Kevin Veen-Birkenbach](https://veen.world): LM Studio reachability and startup, + variant-narrowed CI selection, the single agent instruction file, and version maintenance + ## [14.0.0] - 2026-09-19 **For Users** diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD index 04fdd9b70e..1ee5afb24a 100644 --- a/packaging/arch/PKGBUILD +++ b/packaging/arch/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Kevin Veen-Birkenbach pkgname=infinito-nexus -pkgver=14.0.0 +pkgver=14.1.0 pkgrel=1 pkgdesc="Meta package for Infinito.Nexus host dependencies (dev + CI)." arch=('any') diff --git a/packaging/debian/changelog b/packaging/debian/changelog index 62aa994174..c7b4ff5f77 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,57 @@ +infinito-nexus (14.1.0-1) unstable; urgency=medium + + **[14.1.0] - 2026-09-21** + + **For Users** + + * **Local models reach the gateway again.** Upstream re-pushed the *svc-ai-lmstudio* CPU + image with a server that listens on loopback only, so the role stayed green while litellm + could not connect and the AI features of Mattermost, Matrix, xWiki, Moodle and Zammad + failed their warm-up. The server binds the container network again and stays unpublished. + The model preload now waits until the daemon has finished starting, so a slow host no + longer ends up with a daemon that fails every later model load, and the readiness probe + is capped per attempt so a silent peer cannot hang it. See + [svc-ai-lmstudio](roles/svc-ai-lmstudio/README.md). + + **For Developers** + + * **CI deploys only the variants a change reaches.** An image bump in a provider no longer + redeploys the variants of its consumers that switch that provider off. The diff-derived + whitelist, used by the weekly update PRs, Dependabot and every other diff-driven run, + narrows each affected role to the variants whose round closure still reaches a changed + role, emitted as *role#0,2* selection tokens. A changed role and a role reached only + through *run_after* keep every variant. A pinned token naming a role that discovery does + not return now warns instead of aborting the run; role names are still checked against + *roles/* before the run starts. + + * **One instruction file for every agent.** *AGENTS.md* now holds every agent rule, and + *CLAUDE.md* and *GEMINI.md* are gone. The rules they carried bind every runtime anyway, + and the PR templates, scope tables, requirement documents and docs that named the old + files now name *AGENTS.md*. + + * Image and dependency version jumps (net since 14.0.0): + * *svc-ai-ollama*: 0.34.0 to 0.34.2 + * *svc-net-tor* (Debian base): 13.6-slim to 13.7-slim + * *web-app-baserow*: 2.3.3 to 2.3.4 + * *web-app-erpnext*: v16.34.2 to v16.35.0 + * *web-app-funkwhale* (front, api): 2.0.10 to 2.0.11 + * *web-app-jitsi* (web, prosody, jicofo, jvb): stable-9646 to stable-11031 + * *web-app-keycloak*: 26.7.3 to 26.7.4 + * *web-app-opentalk* (LiveKit): v1.13.6 to v1.13.7 + * *web-app-opentalk* (RabbitMQ): 4.3.5 to 4.3.6 + * *web-app-peertube*: v8.2.4 to v8.3.0 + * *web-app-pihole*: 2026.07.2 to 2026.09.0 + * *web-app-prometheus* (Alertmanager): v0.34.0 to v0.34.1 + * Ansible collection *hetzner.hcloud*: 7.0.1 to 7.1.0 + * *ruff* (dev): 0.16.6 to 0.16.7 + + **Contributors** + + * [Kevin Veen-Birkenbach](https://veen.world): LM Studio reachability and startup, + variant-narrowed CI selection, the single agent instruction file, and version maintenance + + -- Kevin Veen-Birkenbach Mon, 21 Sep 2026 23:12:35 +0200 + infinito-nexus (14.0.0-1) unstable; urgency=medium **For Users** diff --git a/packaging/fedora/infinito-nexus.spec b/packaging/fedora/infinito-nexus.spec index 675af778d9..30a470064e 100644 --- a/packaging/fedora/infinito-nexus.spec +++ b/packaging/fedora/infinito-nexus.spec @@ -1,5 +1,5 @@ Name: infinito-nexus -Version: 14.0.0 +Version: 14.1.0 Release: 1%{?dist} Summary: Meta package for Infinito.Nexus host dependencies @@ -58,6 +58,57 @@ install -d %{buildroot}%{_docdir}/%{name} %doc %{_docdir}/%{name}/DEPENDENCIES %changelog +* Mon Sep 21 2026 Kevin Veen-Birkenbach - 14.1.0-1 +- **[14.1.0] - 2026-09-21** + +- **For Users** + +- * **Local models reach the gateway again.** Upstream re-pushed the *svc-ai-lmstudio* CPU +- image with a server that listens on loopback only, so the role stayed green while litellm +- could not connect and the AI features of Mattermost, Matrix, xWiki, Moodle and Zammad +- failed their warm-up. The server binds the container network again and stays unpublished. +- The model preload now waits until the daemon has finished starting, so a slow host no +- longer ends up with a daemon that fails every later model load, and the readiness probe +- is capped per attempt so a silent peer cannot hang it. See +- [svc-ai-lmstudio](roles/svc-ai-lmstudio/README.md). + +- **For Developers** + +- * **CI deploys only the variants a change reaches.** An image bump in a provider no longer +- redeploys the variants of its consumers that switch that provider off. The diff-derived +- whitelist, used by the weekly update PRs, Dependabot and every other diff-driven run, +- narrows each affected role to the variants whose round closure still reaches a changed +- role, emitted as *role#0,2* selection tokens. A changed role and a role reached only +- through *run_after* keep every variant. A pinned token naming a role that discovery does +- not return now warns instead of aborting the run; role names are still checked against +- *roles/* before the run starts. + +- * **One instruction file for every agent.** *AGENTS.md* now holds every agent rule, and +- *CLAUDE.md* and *GEMINI.md* are gone. The rules they carried bind every runtime anyway, +- and the PR templates, scope tables, requirement documents and docs that named the old +- files now name *AGENTS.md*. + +- * Image and dependency version jumps (net since 14.0.0): +- * *svc-ai-ollama*: 0.34.0 to 0.34.2 +- * *svc-net-tor* (Debian base): 13.6-slim to 13.7-slim +- * *web-app-baserow*: 2.3.3 to 2.3.4 +- * *web-app-erpnext*: v16.34.2 to v16.35.0 +- * *web-app-funkwhale* (front, api): 2.0.10 to 2.0.11 +- * *web-app-jitsi* (web, prosody, jicofo, jvb): stable-9646 to stable-11031 +- * *web-app-keycloak*: 26.7.3 to 26.7.4 +- * *web-app-opentalk* (LiveKit): v1.13.6 to v1.13.7 +- * *web-app-opentalk* (RabbitMQ): 4.3.5 to 4.3.6 +- * *web-app-peertube*: v8.2.4 to v8.3.0 +- * *web-app-pihole*: 2026.07.2 to 2026.09.0 +- * *web-app-prometheus* (Alertmanager): v0.34.0 to v0.34.1 +- * Ansible collection *hetzner.hcloud*: 7.0.1 to 7.1.0 +- * *ruff* (dev): 0.16.6 to 0.16.7 + +- **Contributors** + +- * [Kevin Veen-Birkenbach](https://veen.world): LM Studio reachability and startup, +- variant-narrowed CI selection, the single agent instruction file, and version maintenance + * Sat Sep 19 2026 Kevin Veen-Birkenbach - 14.0.0-1 - **For Users** diff --git a/pyproject.toml b/pyproject.toml index 1e42b74498..0fce194410 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "infinito-nexus" -version = "14.0.0" +version = "14.1.0" description = "Infinito.Nexus" readme = "README.md" requires-python = ">=3.11" From 637f185dc858c0a0a30f7058dadff1d367cf9cd7 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 23:36:50 +0200 Subject: [PATCH 21/21] Fix duplicate version heading in CHANGELOG.md Removed duplicate version heading from changelog. --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0f4b5b707..8fe470014a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,6 @@ ## [14.1.0] - 2026-09-21 -**[14.1.0] - 2026-09-21** - **For Users** * **Local models reach the gateway again.** Upstream re-pushed the *svc-ai-lmstudio* CPU