diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml index 2850a19e..f4c7f018 100644 --- a/.github/workflows/security-scan.yml +++ b/.github/workflows/security-scan.yml @@ -64,7 +64,7 @@ jobs: tag=$(awk -F'[:"[:space:]]+' '/^appVersion:/{print $2}' charts/zelkor-platform/Chart.yaml) echo "tag=${tag}" >> "$GITHUB_OUTPUT" - name: Trivy scan - uses: aquasecurity/trivy-action@0.28.0 + uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 with: image-ref: ghcr.io/devopssquaddev/${{ matrix.image }}:${{ steps.tag.outputs.tag }} severity: CRITICAL diff --git a/README.md b/README.md index a4e7f07f..6d565fc9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Zelkor Platform [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE) -[![Chart](https://img.shields.io/badge/chart-2.4.4-informational)](charts/zelkor-platform/Chart.yaml) +[![Chart](https://img.shields.io/badge/chart-2.4.5-informational)](charts/zelkor-platform/Chart.yaml) You get **the self-hosted agent runtime** on your Kubernetes cluster: bring the agent you already wrote — it can't break out, reach unauthorized data or networks, its prompts are verified, budget controlled, and it is under observation; tenants stay isolated. @@ -17,7 +17,7 @@ cd zelkor-platform OPENAI_API_KEY=sk-... ./install.sh ``` -`./install.sh` creates a local kind cluster, installs Zelkor Community Edition (chart `2.4.4`), and prints URLs when it finishes. Full prerequisites, other providers, and the first verification call: [Local Quickstart](docs/quickstart.md). +`./install.sh` creates a local kind cluster, installs Zelkor Community Edition (chart `2.4.5`), and prints URLs when it finishes. Full prerequisites, other providers, and the first verification call: [Local Quickstart](docs/quickstart.md). ## What you set diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index be166b2b..7b765a9c 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -7,7 +7,7 @@ updated whenever component pins change (see `internal/plan/component_compatibility_matrix.md` for the authoritative pin inventory; the CE-8a image scan SBOM is the exhaustive transitive list). -**As of CE `2.4.4`** (2026-11-11). +**As of CE `2.4.5`** (2026-11-11). ## Distribution paths @@ -85,3 +85,4 @@ inventory; the CE-8a image scan SBOM is the exhaustive transitive list). | Date | Change | | :--- | :--- | | 2026-11-11 | Initial `THIRD_PARTY_NOTICES` for CE `2.4.4`: Agent Router v1.2.1, Envoy Gateway v1.10.0 (Gateway API 1.6.2), Langfuse 4.76.0; OpenCode LICENSE vendored (CE-18d). | +| 2026-11-16 | CE `2.4.5`: no third-party changes (first-party audit-log fix only). | diff --git a/charts/zelkor-agent/Chart.yaml b/charts/zelkor-agent/Chart.yaml index 03fc8c48..6a3d33cd 100644 --- a/charts/zelkor-agent/Chart.yaml +++ b/charts/zelkor-agent/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: zelkor-agent description: ClusterIP worker for one or more graphs in one image. Self-registers via sharedRoute HTTPRoute when host + gateway are set. CLI workers use zelkor-aegra-deep. type: application -version: 2.4.4 -appVersion: "2.4.4" +version: 2.4.5 +appVersion: "2.4.5" diff --git a/charts/zelkor-agent/values.yaml b/charts/zelkor-agent/values.yaml index 1a01c56e..bdadbf33 100644 --- a/charts/zelkor-agent/values.yaml +++ b/charts/zelkor-agent/values.yaml @@ -40,7 +40,7 @@ redis: image: repository: ghcr.io/devopssquaddev/zelkor-aegra - tag: "2.4.4" + tag: "2.4.5" digest: "" pullPolicy: "" @@ -54,7 +54,7 @@ runtime: aegra sidecar: image: repository: ghcr.io/devopssquaddev/zelkor-sidecar - tag: "2.4.4" + tag: "2.4.5" digest: "" pullPolicy: "" # CE-15a-2 perimeter: run the sidecar stateless (in-memory store, no Postgres, no migrate diff --git a/charts/zelkor-gateway-policies/Chart.yaml b/charts/zelkor-gateway-policies/Chart.yaml index c6cab4e3..2940eb90 100644 --- a/charts/zelkor-gateway-policies/Chart.yaml +++ b/charts/zelkor-gateway-policies/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: zelkor-gateway-policies description: Envoy Gateway pod ingress policies (K11 control 1) type: application -version: 2.4.4 -appVersion: "2.4.4" +version: 2.4.5 +appVersion: "2.4.5" diff --git a/charts/zelkor-platform/Chart.yaml b/charts/zelkor-platform/Chart.yaml index 527db27b..94f2a5d6 100644 --- a/charts/zelkor-platform/Chart.yaml +++ b/charts/zelkor-platform/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: zelkor-platform description: Unified Helm chart for the Zelkor Platform Base Tier type: application -version: 2.4.4 -appVersion: "2.4.4" +version: 2.4.5 +appVersion: "2.4.5" diff --git a/charts/zelkor-platform/values.yaml b/charts/zelkor-platform/values.yaml index dfd8482c..e2528155 100644 --- a/charts/zelkor-platform/values.yaml +++ b/charts/zelkor-platform/values.yaml @@ -22,7 +22,7 @@ perimeter: # V2 intent API: platform.*, workspace.*, workload.* (compiled to internal templates at render). # Substrate keys (postgresql, gateway, databases, security.sandbox, …) stay at the root. # -# First-party images published as ghcr.io/devopssquaddev/zelkor-*:2.4.4 (Chart.yaml appVersion). Kind inherits these tags; IMAGE_TAG=dev is opt-in. +# First-party images published as ghcr.io/devopssquaddev/zelkor-*:2.4.5 (Chart.yaml appVersion). Kind inherits these tags; IMAGE_TAG=dev is opt-in. global: tier: oss @@ -112,7 +112,7 @@ platform: sampling: 0.1 image: repository: ghcr.io/devopssquaddev/zelkor-langfuse-seed - tag: 2.4.4 + tag: 2.4.5 digest: '' extraProjects: [] nextauthUrl: '' @@ -237,7 +237,7 @@ workspace: replicaCount: 1 image: repository: ghcr.io/devopssquaddev/zelkor-guardrails - tag: 2.4.4 + tag: 2.4.5 digest: '' configsDir: "/etc/nemoguardrails/configs" defaultConfigId: content_safety @@ -300,7 +300,7 @@ workspace: callsPerMinute: 60 image: repository: ghcr.io/devopssquaddev/zelkor-mcp - tag: 2.4.4 + tag: 2.4.5 digest: '' postgresMCP: enabled: true @@ -425,7 +425,7 @@ workspace: strictIsolation: false workerImage: repository: ghcr.io/devopssquaddev/zelkor-sandbox-worker - tag: 2.4.4 + tag: 2.4.5 digest: '' resources: requests: @@ -557,12 +557,12 @@ workload: enabled: false image: repository: ghcr.io/devopssquaddev/zelkor-aegra - tag: 2.4.4 + tag: 2.4.5 digest: '' cli: image: repository: ghcr.io/devopssquaddev/zelkor-aegra-cli - tag: 2.4.4 + tag: 2.4.5 digest: '' resources: requests: diff --git a/docs/agent-deploy.md b/docs/agent-deploy.md index 2c1f9b43..d7708420 100644 --- a/docs/agent-deploy.md +++ b/docs/agent-deploy.md @@ -71,7 +71,7 @@ sharedRoute: image: repository: my-registry/my-agent - tag: "2.4.4" + tag: "2.4.5" platform: # The name of the platform Helm release (e.g., zelkor-platform). diff --git a/docs/quickstart.md b/docs/quickstart.md index 13931fdf..690b6e5a 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -61,7 +61,7 @@ What `./install.sh` does (you do not run these by hand): 1. Checks Docker, kind, helm, and kubectl 2. Creates kind cluster `zelkor` with host port `8088` 3. Installs the gVisor runtime on the kind node for sandboxed code -4. Deploys Envoy Gateway, Envoy AI Gateway, and the Zelkor platform Helm chart (`appVersion` / image tag `2.4.4`) +4. Deploys Envoy Gateway, Envoy AI Gateway, and the Zelkor platform Helm chart (`appVersion` / image tag `2.4.5`) 5. Deploys the optional FinServe example agents by default 6. Prints service URLs and a ready curl when everything is healthy diff --git a/examples/armored-agents/gpt-researcher/Dockerfile b/examples/armored-agents/gpt-researcher/Dockerfile index 9ac5173b..96ee64b1 100644 --- a/examples/armored-agents/gpt-researcher/Dockerfile +++ b/examples/armored-agents/gpt-researcher/Dockerfile @@ -1,4 +1,4 @@ -ARG ZELKOR_AEGRA_DEEP_IMAGE=ghcr.io/devopssquaddev/zelkor-aegra-deep:2.4.4 +ARG ZELKOR_AEGRA_DEEP_IMAGE=ghcr.io/devopssquaddev/zelkor-aegra-deep:2.4.5 FROM ${ZELKOR_AEGRA_DEEP_IMAGE} LABEL org.opencontainers.image.source="https://github.com/devopssquaddev/zelkor-platform" diff --git a/examples/armored-agents/gpt-researcher/values.yaml b/examples/armored-agents/gpt-researcher/values.yaml index c065edde..0a719e55 100644 --- a/examples/armored-agents/gpt-researcher/values.yaml +++ b/examples/armored-agents/gpt-researcher/values.yaml @@ -4,7 +4,7 @@ aegraConfig: "" image: repository: ghcr.io/devopssquaddev/zelkor-armored-gpt-researcher - tag: "2.4.4" + tag: "2.4.5" digest: "" platform: diff --git a/examples/finserve/chart/Chart.lock b/examples/finserve/chart/Chart.lock index ce1aab25..f776eba0 100644 --- a/examples/finserve/chart/Chart.lock +++ b/examples/finserve/chart/Chart.lock @@ -1,12 +1,12 @@ dependencies: - name: zelkor-agent repository: file://../../../charts/zelkor-agent - version: 2.4.4 + version: 2.4.5 - name: zelkor-agent repository: file://../../../charts/zelkor-agent - version: 2.4.4 + version: 2.4.5 - name: zelkor-agent repository: file://../../../charts/zelkor-agent - version: 2.4.4 -digest: sha256:44ae4918d8faf475b80d31c6373625e36a9004935b8e36247095daea86114572 -generated: "2026-11-11T09:44:38.264478Z" + version: 2.4.5 +digest: sha256:0fbfeb42f1efaf4632e73a5f2b9337ca8b6533a39236828c8cccd2317eed28af +generated: "2026-11-16T09:10:29.512654+01:00" diff --git a/examples/finserve/chart/Chart.yaml b/examples/finserve/chart/Chart.yaml index 85e52919..83916b11 100644 --- a/examples/finserve/chart/Chart.yaml +++ b/examples/finserve/chart/Chart.yaml @@ -2,18 +2,18 @@ apiVersion: v2 name: finserve description: Standalone Helm chart for the FinServe AI Wealth Management Demo type: application -version: 2.4.4 -appVersion: "2.4.4" +version: 2.4.5 +appVersion: "2.4.5" dependencies: - name: zelkor-agent - version: "2.4.4" + version: "2.4.5" repository: "file://../../../charts/zelkor-agent" alias: desk - name: zelkor-agent - version: "2.4.4" + version: "2.4.5" repository: "file://../../../charts/zelkor-agent" alias: quant - name: zelkor-agent - version: "2.4.4" + version: "2.4.5" repository: "file://../../../charts/zelkor-agent" alias: coder diff --git a/examples/finserve/chart/charts/zelkor-agent-2.4.4.tgz b/examples/finserve/chart/charts/zelkor-agent-2.4.4.tgz deleted file mode 100644 index 70e838f2..00000000 Binary files a/examples/finserve/chart/charts/zelkor-agent-2.4.4.tgz and /dev/null differ diff --git a/examples/finserve/chart/charts/zelkor-agent-2.4.5.tgz b/examples/finserve/chart/charts/zelkor-agent-2.4.5.tgz new file mode 100644 index 00000000..6d08f870 Binary files /dev/null and b/examples/finserve/chart/charts/zelkor-agent-2.4.5.tgz differ diff --git a/examples/finserve/chart/values.yaml b/examples/finserve/chart/values.yaml index 4fcedc65..147721f9 100644 --- a/examples/finserve/chart/values.yaml +++ b/examples/finserve/chart/values.yaml @@ -30,7 +30,7 @@ desk: <<: *agentsHost image: repository: ghcr.io/devopssquaddev/zelkor-example-finserve - tag: "2.4.4" + tag: "2.4.5" digest: "" platform: <<: *platformRelease @@ -51,7 +51,7 @@ quant: <<: *agentsHost image: repository: ghcr.io/devopssquaddev/zelkor-example-finserve - tag: "2.4.4" + tag: "2.4.5" digest: "" platform: <<: *platformRelease @@ -68,7 +68,7 @@ coder: <<: *agentsHost image: repository: ghcr.io/devopssquaddev/zelkor-example-finserve-coder - tag: "2.4.4" + tag: "2.4.5" digest: "" platform: <<: *platformRelease @@ -105,7 +105,7 @@ extraMcp: port: 8080 image: repository: ghcr.io/devopssquaddev/zelkor-mcp - tag: "2.4.4" + tag: "2.4.5" digest: "" dbInit: diff --git a/examples/legal-redline/README.md b/examples/legal-redline/README.md index 50396e40..46c821eb 100644 --- a/examples/legal-redline/README.md +++ b/examples/legal-redline/README.md @@ -36,7 +36,7 @@ flowchart LR Build the image, then install the chart against your platform release. ```bash -IMAGES=zelkor-example-legal-redline IMAGE_TAG=2.4.4 ./scripts/build-images.sh --push +IMAGES=zelkor-example-legal-redline IMAGE_TAG=2.4.5 ./scripts/build-images.sh --push helm dependency update examples/legal-redline/chart helm upgrade --install legal-redline examples/legal-redline/chart \ --namespace \ diff --git a/examples/legal-redline/chart/Chart.lock b/examples/legal-redline/chart/Chart.lock index 8e170c99..73c0b49b 100644 --- a/examples/legal-redline/chart/Chart.lock +++ b/examples/legal-redline/chart/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: zelkor-agent repository: file://../../../charts/zelkor-agent - version: 2.4.4 -digest: sha256:bfc1ccfc7f1d74c5948660acf612ad521cf44eb98297b51b18413c129030de59 -generated: "2026-11-11T09:44:46.472664Z" + version: 2.4.5 +digest: sha256:59ac0260b64f48049e19f74b3a46433d9da30cd4383680882618fc7723002ca9 +generated: "2026-11-16T09:10:40.079489+01:00" diff --git a/examples/legal-redline/chart/Chart.yaml b/examples/legal-redline/chart/Chart.yaml index 20d192ec..3823c4a2 100644 --- a/examples/legal-redline/chart/Chart.yaml +++ b/examples/legal-redline/chart/Chart.yaml @@ -2,10 +2,10 @@ apiVersion: v2 name: legal-redline description: Standalone Helm chart for the legal-redline clause review example type: application -version: 2.4.4 -appVersion: "2.4.4" +version: 2.4.5 +appVersion: "2.4.5" dependencies: - name: zelkor-agent - version: "2.4.4" + version: "2.4.5" repository: "file://../../../charts/zelkor-agent" alias: legalRedline diff --git a/examples/legal-redline/chart/charts/zelkor-agent-2.4.4.tgz b/examples/legal-redline/chart/charts/zelkor-agent-2.4.4.tgz deleted file mode 100644 index ffb0d543..00000000 Binary files a/examples/legal-redline/chart/charts/zelkor-agent-2.4.4.tgz and /dev/null differ diff --git a/examples/legal-redline/chart/charts/zelkor-agent-2.4.5.tgz b/examples/legal-redline/chart/charts/zelkor-agent-2.4.5.tgz new file mode 100644 index 00000000..f90128ad Binary files /dev/null and b/examples/legal-redline/chart/charts/zelkor-agent-2.4.5.tgz differ diff --git a/examples/legal-redline/chart/values.yaml b/examples/legal-redline/chart/values.yaml index f2765798..b95d074d 100644 --- a/examples/legal-redline/chart/values.yaml +++ b/examples/legal-redline/chart/values.yaml @@ -27,7 +27,7 @@ legalRedline: <<: *agentsHost image: repository: ghcr.io/devopssquaddev/zelkor-example-legal-redline - tag: "2.4.4" + tag: "2.4.5" digest: "" platform: <<: *platformRelease diff --git a/images/aegra-deep/Dockerfile b/images/aegra-deep/Dockerfile index 94eeb2de..01c2cedd 100644 --- a/images/aegra-deep/Dockerfile +++ b/images/aegra-deep/Dockerfile @@ -1,4 +1,4 @@ -ARG ZELKOR_AEGRA_IMAGE=ghcr.io/devopssquaddev/zelkor-aegra:2.4.4 +ARG ZELKOR_AEGRA_IMAGE=ghcr.io/devopssquaddev/zelkor-aegra:2.4.5 FROM ${ZELKOR_AEGRA_IMAGE} LABEL org.opencontainers.image.source="https://github.com/devopssquaddev/zelkor-platform" diff --git a/images/common/zelkor_logging.py b/images/common/zelkor_logging.py index 8404f083..778d18e4 100644 --- a/images/common/zelkor_logging.py +++ b/images/common/zelkor_logging.py @@ -61,7 +61,8 @@ def format(self, record: logging.LogRecord) -> str: val = getattr(record, key, None) if val is None or val == "": continue - if key in ("elapsed_s", "since_send_s", "sse_drops", "id", "pending_id") and val == 0: + if key in ("elapsed_s", "since_send_s", "sse_drops", "id", "pending_id", + "request_bytes", "response_bytes") and val == 0: payload[key] = val continue if val or val is False: diff --git a/images/example-finserve-coder/Dockerfile b/images/example-finserve-coder/Dockerfile index 96d91feb..e7d536d4 100644 --- a/images/example-finserve-coder/Dockerfile +++ b/images/example-finserve-coder/Dockerfile @@ -1,4 +1,4 @@ -ARG ZELKOR_AEGRA_DEEP_IMAGE=ghcr.io/devopssquaddev/zelkor-aegra-deep:2.4.4 +ARG ZELKOR_AEGRA_DEEP_IMAGE=ghcr.io/devopssquaddev/zelkor-aegra-deep:2.4.5 FROM ${ZELKOR_AEGRA_DEEP_IMAGE} LABEL org.opencontainers.image.source="https://github.com/devopssquaddev/zelkor-platform" diff --git a/images/example-finserve/Dockerfile b/images/example-finserve/Dockerfile index c71c74fd..4b048b7d 100644 --- a/images/example-finserve/Dockerfile +++ b/images/example-finserve/Dockerfile @@ -1,4 +1,4 @@ -ARG ZELKOR_AEGRA_IMAGE=ghcr.io/devopssquaddev/zelkor-aegra:2.4.4 +ARG ZELKOR_AEGRA_IMAGE=ghcr.io/devopssquaddev/zelkor-aegra:2.4.5 FROM ${ZELKOR_AEGRA_IMAGE} LABEL org.opencontainers.image.source="https://github.com/devopssquaddev/zelkor-platform" diff --git a/images/example-legal-redline/Dockerfile b/images/example-legal-redline/Dockerfile index 4130bd83..bece726b 100644 --- a/images/example-legal-redline/Dockerfile +++ b/images/example-legal-redline/Dockerfile @@ -1,4 +1,4 @@ -ARG ZELKOR_AEGRA_IMAGE=ghcr.io/devopssquaddev/zelkor-aegra:2.4.4 +ARG ZELKOR_AEGRA_IMAGE=ghcr.io/devopssquaddev/zelkor-aegra:2.4.5 FROM ${ZELKOR_AEGRA_IMAGE} LABEL org.opencontainers.image.source="https://github.com/devopssquaddev/zelkor-platform" diff --git a/profiles/values-production.yaml b/profiles/values-production.yaml index b80b97b2..1be13db6 100644 --- a/profiles/values-production.yaml +++ b/profiles/values-production.yaml @@ -85,8 +85,8 @@ platform: evaluators: seedCode: true image: - tag: 2.4.4 - digest: sha256:6afdeb57c4bc5bb3fb7c2f5cee35688a368e2bd7fdc6dd69407eefa5688ed3b4 + tag: 2.4.5 + digest: sha256:3583f96988afa49fa36da27682a2579c5ee2a497be53b63096a3a4283270d1ac mTLS: enabled: false workspace: @@ -95,22 +95,22 @@ workspace: policies: nemo: image: - tag: 2.4.4 - digest: sha256:bb1db488b75d71491ee3eb4a8e301503a7efc7c71ff22e56916d47c9160e16ca + tag: 2.4.5 + digest: sha256:539ea05391e165112623f65f23e0589bdd603af4338d4d528f4d30160ec066ce tools: image: - tag: 2.4.4 - digest: sha256:2219ef3f61819923e06edc266dadbd7da41ffeccf71e21614aae3d2be88d1028 + tag: 2.4.5 + digest: sha256:8f409382a1827f7570f18d638444c7fa0b65666b0101e283177c13914085dc31 sandboxMCP: workerImage: - tag: 2.4.4 - digest: sha256:5e14d29cd9d5af484ee0a48ef5520106298171606311d4297079f6b30caea722 + tag: 2.4.5 + digest: sha256:f855d88059bf5f2d237271f714dbe8394b58d5f85024962849d8a2c3c3bfcf84 workload: agents: image: - tag: 2.4.4 - digest: sha256:ae4f417aab79efde0523038c3f006ec9108ef55dcf877255058f203aa2a379c9 + tag: 2.4.5 + digest: sha256:bd81f1dc6d604e5dc7efc1a5ead3f97d73f93c13842a412ba6b9f91517642e94 cli: image: - tag: 2.4.4 - digest: sha256:ab8e332a552c168bf36f3fba55849a3057592d04e3bf9898a3f40aee53188826 + tag: 2.4.5 + digest: sha256:5320dba2eeb3e93e1b1cd8c47dffa4028f48466db825cb119967daf4774299a2 diff --git a/tests/test_helm_agent_runtime.py b/tests/test_helm_agent_runtime.py index 364be9af..55433e9b 100644 --- a/tests/test_helm_agent_runtime.py +++ b/tests/test_helm_agent_runtime.py @@ -49,7 +49,7 @@ def test_sidecar_layout(runtime): assert [c["name"] for c in spec["containers"]] == ["sidecar", "agent"] sidecar, agent = _c(spec, "sidecar"), _c(spec, "agent") - assert sidecar["image"].startswith("ghcr.io/devopssquaddev/zelkor-sidecar:2.4.4") + assert sidecar["image"].startswith("ghcr.io/devopssquaddev/zelkor-sidecar:2.4.5") assert sidecar["ports"] == [{"containerPort": 8000, "name": "http"}] assert sidecar["readinessProbe"]["httpGet"]["port"] == 8000 s_env = _env(sidecar) diff --git a/tests/test_mcp_tool_policy_live.py b/tests/test_mcp_tool_policy_live.py index f7773909..f12104fe 100644 --- a/tests/test_mcp_tool_policy_live.py +++ b/tests/test_mcp_tool_policy_live.py @@ -99,8 +99,10 @@ def test_s73_audit_record_has_metadata_and_no_arguments(): pass time.sleep(2) release = os.environ.get("ZELKOR_RELEASE", "zelkor-platform") - backend, short = AUDIT_TOOL.split("__", 1) # {backend}__{tool} -> the backend's Deployment logs - cmd = kubectl_cmd("logs", f"deploy/{release}-mcp-{backend}", "--since=2m") + backend, short = AUDIT_TOOL.split("__", 1) # {backend}__{tool} -> the backend's pod logs + # Every replica: with HA the call may land on any pod (`logs deploy/...` reads only one). + selector = f"app.kubernetes.io/component=mcp-{backend},app.kubernetes.io/instance={release}" + cmd = kubectl_cmd("logs", "-l", selector, "--since=2m", "--tail=-1", "--max-log-requests=20") try: proc = subprocess.run(cmd, capture_output=True, text=True, timeout=60, check=False) except FileNotFoundError: @@ -117,7 +119,8 @@ def test_s73_audit_record_has_metadata_and_no_arguments(): if rec.get("event") == "tools_call" and rec.get("tool") == short: records.append(rec) assert records, f"no tools_call audit record for {short}" - rec = records[-1] - for key in ("tenant_id", "status", "elapsed_s", "request_bytes", "response_bytes"): - assert key in rec, rec - assert rec["status"] in {"ok", "error", "denied", "rate_limited"} + # Every record in the window (ok and denied alike) carries the audit metadata. + for rec in records: + for key in ("tenant_id", "status", "elapsed_s", "request_bytes", "response_bytes"): + assert key in rec, rec + assert rec["status"] in {"ok", "error", "denied", "rate_limited"} diff --git a/tests/test_platform_logging.py b/tests/test_platform_logging.py index ac6a0b34..257cc245 100644 --- a/tests/test_platform_logging.py +++ b/tests/test_platform_logging.py @@ -73,6 +73,26 @@ def test_json_formatter_required_keys_and_optional_event(): assert "Authorization" not in json.dumps(payload) +def test_json_formatter_keeps_zero_byte_counts_on_denied_audit_record(): + """A denied tools/call has response_bytes=0; the audit record (S-73) must still carry it.""" + record = logging.LogRecord( + name="zelkor-mcp", + level=logging.WARNING, + pathname="", + lineno=0, + msg="MCP permission denied: tools/call query (policy)", + args=(), + exc_info=None, + ) + for key, value in {"event": "tools_call", "tool": "query", "tenant_id": "tenant-a", + "status": "denied", "deny_reason": "policy", "elapsed_s": 0.001, + "request_bytes": 0, "response_bytes": 0}.items(): + setattr(record, key, value) + payload = json.loads(JsonFormatter().format(record)) + assert payload["request_bytes"] == 0 + assert payload["response_bytes"] == 0 + + def test_configure_honors_error_level(monkeypatch, capsys): monkeypatch.setenv("ZELKOR_LOG_LEVEL", "ERROR") monkeypatch.setenv("ZELKOR_LOG_FORMAT", "json")