# P05-OIDC-08-A01 — Normalized Compose Runtime-Field RCA & Synthetic Contract Acceptance **Date:** 2026-11-23 (Asia/Dhaka) **Approved baseline:** `f3528841f444d1bc119bc067db2e044269141555`; Gitea `main` matched before changes. **Prior tested source:** `2ca1b4493bd47209d0c7eabf7453feaeb1f5174a` **Prior CI:** [Run #101](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/101), Job #217 `completed/failure`; `docker compose config --quiet` PASS, strict normalized Compose service validator `ZITPLANE_P08_FAIL_CLOSED_RUNTIME_BEHAVIOR` FAIL, all original 25 negative fixtures NOT EXECUTED, manual workflow/no-resource-action check PASS and runner job cleanup observed. Previously accepted imported custom Login V2 [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) remains SUCCESS. ## PRE-SOURCE-CHANGE Scope Lock — USER APPROVED **MUST commit this note before modifying code.** **SOURCE WRITE EXACT:** - `tests/ci/production_contract/validate.py` **ONLY**. **DOCUMENTATION WRITE:** - `notes/**` - relevant `project/**` - relevant `docs/**` - associated README/MINIFEST entries only if necessary. **STRICT READ-ONLY:** `auth/**`, `users/**`, `core/**`, **all** `deployment/**` (including unchanged synthetic `production-contract/**` and dev Compose), **all** existing Gitea workflows, `tests/**` except the one validator source and necessary existing associated README/MINIFEST, package manifests/lockfiles, runner configuration, VPS, DNS, Coolify, Cloudflare, SSL, production secrets/infrastructure and unrelated files. Preserve untracked `AI_INSTRUCTIONS.md`. No local app builds/tests or local Compose execution, Docker `up`/`run`/`build`/`pull`, real DNS/network endpoints or users, new secrets, image registry, production deploy, tags/releases. ## Evidence-first RCA and exact design **Verified from original source** (read-only): `validate_compose()` rejects any normalized service dictionary containing one or more of `build`, `command`, `entrypoint`, `configs`; then a second exact-key allowlist rejects all unknown service keys. Thus it is certain the Run #101 failure arose from at least one of these four fields being present in the `docker compose config --format json` output **for a service**, but the actual offending field and value/type were **NOT logged in Run #101**. Gitea fixture Compose source contains no explicit `build`/`command`/`entrypoint`/`configs` directives and all image refs are `synthetic.invalid`, replicas zero. This is **suggestive of an inert normalization default**, not proof of its precise field; the one approved new CI run must capture safe field-name/type/null-or-empty evidence. Only in `validate.py`: 1. Inspect **only allowlisted field NAMES** `build`, `command`, `entrypoint`, `configs` and a sanitized TYPE/CATEGORY (`NULL`, `EMPTY_LIST`, `EMPTY_STRING`, `LIST`, `DICT`, `STRING`, `NUMBER`, `OTHER`), never raw values, arbitrary keys, environment, credentials, original JSON, URL, tokens or secret references. Print fixed safe diagnostics before applying the field-specific fail-closed gate, keyed to known five service IDs. Unknown field names are not echoed. 2. Support **only non-executable** Compose-normalized optional `command: null`, `entrypoint: null`, `configs: null` or `configs: []` **if real new CI evidence demonstrates those defaults**. Do not accept any `build` field (even null) without separate evidence/approval. Reject all non-null command/entrypoint, and any nonempty configs, build context, unknown runtime keys, actual image deployment, ports, network escape, Docker socket, privileged mode, nonzero replicas. Enforce the remaining original exact service allowlist after excluding only verified inert fields. 3. Preserve exact original **25 independent negative fixtures** and their classification/markers. Add **four** focused separate negative fixtures: nonempty `command`, nonempty `entrypoint`, `build` and nonempty `configs` rejected with `RUNTIME_BEHAVIOR`; require exact class, no false positive. Print distinct original-25 and additional-4 summary PASS markers only if all executed. 4. Ensure any other unexpected normalized field still fails closed; do not relax policy schema, OIDC issuer/callback/PKCE, Login/Console/API h2c, trust-boundary Host/forwarded headers, secrets, zero replicas, private networks, no published ports or workflow safety. 5. Perform one focused source/diff/security audit before dispatch; commit and push exact tested source to Gitea `main`. 6. Exactly **ONE** new separately approved manual `p05-production-contract-dry-run.yml` Gitea run; verify `docker compose config` structural parse, sanitized field evidence, positive and original 25/additional 4 negative gates, `always()` workflow safety, terminal status and runner-owned task cleanup (not a claim to inspect production). **No rerun** if blocked. Note result as PASS/FAIL/NOT EXECUTED. 7. Documentation-only closure: `notes/project/docs` + associated README/MINIFEST, one cumulative exact scope/inventory security audit, remote `main` SHA verification. Distinguish **source tested SHA** from docs-final SHA. No production HTTPS DNS/SSL, real certificates, real secrets/backups, Login/Console/MFA/SSO acceptance in this scope. ## Terminal one-run forensic RCA and acceptance ledger — 2026-11-23 **Approved baseline:** `f3528841f444d1bc119bc067db2e044269141555`; **scope-first commit:** `b235a39078a80464aaf01ee9fa1aca1f1f3e5c15`. **Exact edited application/CI source:** `tests/ci/production_contract/validate.py` **ONLY**. Tested source SHA `07c91ea5bcb2037e3c7b76261e1eb106b49d223f`. No existing workflow/Compose/fixture/policy/Auth.js/Login/dependency/runner edit. The one source change introduced only allowlisted-field/type diagnostics; permits **null command/entrypoint** or null/empty configs as inert, rejects ANY build and any non-null command/entrypoint/nonempty configs; preserves all 25 prior negatives and adds 4 dedicated runtime-command/build/config negative fixtures. One focused source/security diff audit passed before dispatch. **Exactly ONE new manual Gitea run:** [Run #102](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/102), Job #218, `completed/failure`, tested `07c91ea5bcb2037e3c7b76261e1eb106b49d223f`, started 2026-11-23T12:56:43Z, terminal 12:57:04Z. Steps #0 toolchain **SUCCESS**, #1 checkout **SUCCESS**, #2 Compose/static validator **FAILURE**, #3 `always()` manual-only/no Docker resource action safety check **SUCCESS**. No extra run, rerun or post-dispatch source edit. | Gate | Exact result and grounded evidence | | --- | --- | | Toolchain and immutable checkout | **PASS** steps #0 and #1 | | `docker compose config --quiet` (synthetic only, no runtime) | **PASS**, `ZITPLANE_P08_COMPOSE_STATIC_CONFIG_PASS` | | Original Run #101 `RUNTIME_BEHAVIOR` **root cause** | **VERIFIED** via normalized output: `command: null` and `entrypoint: null` for **all five** named synthetic services; no `build`/`configs` diagnostic markers in this run | | Safe key/type diagnostics without values | **PASS**; ten allowlisted fixed `ZITPLANE_P08_NORMALIZED_RUNTIME_FIELD_*_COMMAND_NULL` / `*_ENTRYPOINT_NULL` markers, five services | | Runtime default compatibility reaches subsequent gate | **PASS — narrow observation:** prior `RUNTIME_BEHAVIOR` abort was **not** repeated; execution proceeded to next gate. Does NOT establish all runtime-negative assertions PASS | | Next normalized service zero-replica guard | **FAIL**, `ZITPLANE_P08_FAIL_CLOSED_DEPLOY_DISABLED` | | Exact normalized `deploy` / `replicas` field, existence, safe type and zero value | **UNKNOWN**, not included in diagnostics; do **not** assert e.g. missing replica or string `"0"` without evidence | | Canonical HTTPS issuer/callback, Login/Console/API h2c, Host/forwarded and secret refs positive PASS markers | **NOT EXECUTED / NOT REACHED** — normalizer rejected before aggregate success markers; earlier ordering checks may have evaluated but not independently reported successful gate | | Original 25 in-memory malformed security fixtures | **NOT EXECUTED** — `negative_cases()` never entered | | New four nonempty command/entrypoint/build/config negatives | **NOT EXECUTED** — `negative_cases()` never entered | | Manual workflow no Docker lifecycle commands configured | **PASS**, `ZITPLANE_P08_MANUAL_ONLY_NO_RESOURCE_ACTIONS_CONFIGURED_PASS` (both validator start and always step) | | Runner job cleanup | **PASS in Gitea log**: runner deleted its temporary task container, two task volumes and network; **not** a production-resource inspection | | Real DNS/TLS, issuer, Login/Console/Auth.js, secrets, backup/restore, release, MFA/SSO | **NOT EXECUTED / OUT OF SCOPE**, no production deployment | ### Confirmed actual root cause vs new blocker The old P05-OIDC-08 **`RUNTIME_BEHAVIOR`** error was due to Compose output automatically including **`command: null` and `entrypoint: null` on each of five services**, despite the source synthetic YAML containing no explicit command/entrypoint. Run #102 diagnostic markers directly prove field names and null categories. The narrow compatibility gate accepted these inert defaults and proceeded to the next fail-closed rule. This conclusively **resolves the old field-identification RCA**, not the complete static contract acceptance. **New blocker:** `DEPLOY_DISABLED` in `validate_compose()`, whose current code checks each normalized service's `deploy` mapping contains an exact int `replicas == 0` and no other keys. This failure occurred **after** runtime-field acceptance, but its precise reason (e.g. service, normalized presence, type or extra metadata) is **NOT logged**, so it remains **UNKNOWN**. The static fixture YAML declares `deploy: {replicas: 0}` for all five services; do NOT infer how Docker Compose JSON represented it or relax replica safety prematurely. **Phase outcome:** Source fix implemented, exact Run #101 blocker identified and its null-field compatibility passed in Run #102; **overall synthetic CI security acceptance FAILED**, all 29 negative fixtures **NOT EXECUTED**, no deployability or production acceptance. Previously accepted [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) source-built Login V2 **real disposable OIDC PASS** remains unchanged. P05-OIDC-07 production readiness **BLOCKED** remains unchanged. ### Proposed next separately approved exact Scope Lock — P05-OIDC-08-A02 **Title:** Docker Compose Normalized Zero-Replica RCA & Full Synthetic Contract Acceptance. **Baseline:** final Gitea documentation-closure SHA from A01 (verify at closure); previously tested source `07c91ea5bcb2037e3c7b76261e1eb106b49d223f`, terminal failure Run #102 / Job #218. **Write first:** new `notes/P05-OIDC-08-A02.md` with pre-source Scope Lock, commit before implementation. **SOURCE WRITE ONLY:** `tests/ci/production_contract/validate.py` — no changes to any other source. **Documentation WRITE:** `notes/**`, relevant `project/**`, `docs/**`, and necessary existing associated README/MINIFEST only. **STRICT READ-ONLY:** `auth/**`, `users/**`, `core/**`, `deployment/**` including synthetic Compose/JSON and dev Compose, existing `.gitea/workflows/**`, `tests/**` other than validator, package manifests/lockfiles, runner configuration, production DNS/VPS/Coolify/Cloudflare/SSL/secrets, unrelated files and untracked `AI_INSTRUCTIONS.md`. **Evidence-first RCA:** add allowlisted, *value-free* field name/existence/type classification in validator for **only** synthetic service `deploy`, `replicas` and any unexpected **field name from a fixed safe allowlist**, without printing raw JSON, arbitrary keys/values, commands, secret refs, hostnames or real credentials. Check raw checked-in synthetic fixture **read-only** to independently prove every intended `replicas: 0` source declaration if normalization drops zero; do not trust missing normalized replicas unless both exact fixture provenance and strict non-deployability are proven. If Compose outputs an inert normalized representation, support only that evidence-proven representation. Fail closed on **nonzero replicas**, real deployable images, build, nonempty command/entrypoint/configs, public ports, Docker socket, privileged service and unknown metadata. Do **NOT** weaken existing 25+4 negative cases. **CI acceptance:** one focused source/security/diff audit, source commit/push, **exactly one newly authorized manual run** of unchanged `p05-production-contract-dry-run.yml`; verify safe deploy field diagnostics, static Compose parse, issuer/callback, Login/Console/API h2c routing, trusted Host/forwarding, no secrets/ports, all **original 25** and **new four** runtime negative cases, plus focused **nonzero replica** negative (only if needed) and manual workflow-safety PASS. No repeat CI on failure, no Docker application lifecycle, DNS/TLS/real production, image build/publish, secrets/users or release. Exact PASS/FAIL/NOT EXECUTED, runner cleanup, docs synchronization and final remote Gitea SHA. **No automatic execution of next phase:** A02 requires fresh explicit user approval.