Files
ZitPlane/project/FILE-MAP.md
T

269 lines
29 KiB
Markdown

# File and module ownership map
**Baseline:** commit `40af500` with documentation phase DOCS-01 in progress. This is an **exact first-party role map** plus pointers to the complete upstream source inventory. See [SOURCE-INVENTORY.md](SOURCE-INVENTORY.md) for the individual paths of **all Git-tracked files**, including the imported upstream.
## Repository root / governance
| Path | Purpose / when to change |
| --- | --- |
| `README.md` | Entry point, project status, quick navigation; update whenever phase/status changes |
| `AGENTS.md` | Mandatory coding/AI rules, scope, docs-first updates and security boundaries |
| `.gitignore` | Prevent local secrets/build data from being staged; change only with explicit review |
| `.editorconfig` | Editor line ending/indentation defaults |
| `.env.example` | Non-secret sample keys for P02 backend helper; **never commit actual root `.env`** |
| `notes/` | Pre-change plans, decisions, chronological implementation and evidence logs |
| `project/` | Developer explanations, module/function/page map and actual source inventory |
| `docs/` | End-user how-to, setup, features, existing phase/evidence documents |
## P02 backend + deployment
| Path | What it actually owns | Phase |
| --- | --- | --- |
| `core/backend/zitadel/dev.py` | Python stdlib helper `init`, `config`, `up`, `check`, `ps`, `down`; creates ignored local secrets and invokes Compose, readiness probe | P02 |
| `core/backend/zitadel/README.md` | Dev-only infrastructure setup guidance, assumptions and warnings | P02 |
| `deployment/docker/compose.backend.dev.yaml` | Named `postgres`, `zitadel-api`, `zitadel-login` (prebuilt), `proxy`; Postgres/Bootstrap volumes, Docker network, local port, health checks | P02 |
| `deployment/README.md` | Deployment scope/hardening placeholder; no production Compose exists | P01 |
| `tests/test_backend_dev.py` | Prior three focused Python stdlib static/secret-generation checks; NOT a live Docker acceptance test | P02 |
| `tests/README.md` | Test folder introduction | P01 |
| `scripts/README.md` | Placeholder for future scripts; no standalone project scripts yet | P01 |
## P03 imported official ZITADEL Login V2
| Path | Responsibility | What to change |
| --- | --- | --- |
| `auth/ui/v2/apps/login/src/app/` | Official Next.js login route/page implementation; login, registration, challenges, IDP and recovery | Only within approved Login UI phase; auth behavior protected |
| `auth/ui/v2/apps/login/src/components/` | Official reusable form/UI components | Later visual phase with regression checks |
| `auth/ui/v2/apps/login/src/styles/` | Official Login presentation styling | Later visual phase |
| `auth/ui/v2/apps/login/public/` | Login static assets, logos, favicons | Later branding phase |
| `auth/ui/v2/apps/login/locales/` | Upstream translations | Later translation phase |
| `auth/ui/v2/apps/login/src/lib/` | Protected login backend/session helpers | Separate security-scoped approval |
| `auth/ui/v2/apps/login/src/proxy.ts` | Official Next.js request/proxy route handling | Protected routing code |
| `auth/ui/v2/apps/login/package.json` | Login scripts/dependencies, workspace linkages | Version/security phase only |
| `auth/ui/v2/apps/login/project.json` | Nx targets and dependencies | Build infrastructure phase |
| `auth/ui/v2/apps/login/Dockerfile` | Official Login UI image definition | Image-build integration phase |
| `auth/ui/v2/packages/zitadel-client/` | Upstream ZITADEL JS client | Do not edit for visual UI |
| `auth/ui/v2/packages/zitadel-proto/` | Upstream generated API type project | Generated output; not hand-edit |
| `auth/ui/v2/proto/` | Upstream protocol definitions | No UI edit |
| `auth/ui/v2/pnpm-lock.yaml` | Original upstream dependency graph; frozen-build compatibility pending CI | Dependency phase only |
| `auth/ui/v2/pnpm-workspace.yaml`, `nx.json`, `package.json` | Original workspace structure/tooling | Dependency/build phase |
| `auth/ui/v2/LICENSING.md`, `LICENSE` | Upstream licensing terms; preserve | Legal compliance |
| `auth/ui/v2/README.md` | ZitPlane import/user-maintainer guide | When upstream login source changes |
Upstream import: official ZITADEL `v4.20.4` / Git `384bb9ec96b501ad39dc232ee2061a40fe180bbd`. Imported files are intentionally byte-for-byte identical except two excluded upstream environment files. **No source edit was performed in P03.** See `docs/P03-SOURCE-IMPORT.md`.
## P04 Account Portal (first-party) — complete source file map
| Source | Purpose |
| --- | --- |
| `users/ui/package.json` | Next.js/React/Auth.js dependency versions and dev/build/start/typecheck scripts; lockfile not yet generated |
| `users/ui/tsconfig.json` | TypeScript strict configuration and `@/*` alias |
| `users/ui/next-env.d.ts` | Next.js TypeScript references |
| `users/ui/next.config.ts` | Standalone output, security-related response headers, strict React mode |
| `users/ui/.env.example` | Configuration key names only; never real secrets |
| `users/ui/.gitignore` | Ignore Next.js build output, node_modules, and env data |
| `users/ui/src/auth.ts` | Auth.js ZITADEL provider/callbacks and encrypted cookie session integration; protected security logic |
| `users/ui/src/lib/env.ts` | Validates OIDC issuer/portal origin/client credentials/secret |
| `users/ui/src/lib/identity.ts` | `requireIdentity()` and issuer-derived ZITADEL self-service link |
| `users/ui/src/types/next-auth.d.ts` | Session user ID and JWT subject/expiry type augmentation |
| `users/ui/src/app/layout.tsx` | Root page shell, metadata, global stylesheet import |
| `users/ui/src/app/page.tsx` | `/` redirects to `/account` |
| `users/ui/src/app/signin/page.tsx` | Sign-in form; server action triggers Auth.js ZITADEL OIDC redirect |
| `users/ui/src/app/(protected)/layout.tsx` | Mandatory server-side account identity gate + sidebar shell |
| `users/ui/src/app/(protected)/account/page.tsx` | Account overview cards and identity greeting |
| `users/ui/src/app/(protected)/account/profile/page.tsx` | Read-only profile fields and ZITADEL account link |
| `users/ui/src/app/(protected)/account/security/page.tsx` | Password/MFA/passkey informational rows and ZITADEL security link |
| `users/ui/src/app/api/auth/[...nextauth]/route.ts` | Auth.js handlers for sign-in/callback/session support |
| `users/ui/src/app/api/account/me/route.ts` | GET current user ID/name/email, or 401 |
| `users/ui/src/components/account-shell.tsx` | Responsive sidebar/topbar/footer/sign-out form |
| `users/ui/src/components/account-card.tsx` | Reusable overview Card and profile DataRow |
| `users/ui/src/styles/globals.css` | Design tokens, compact layout, responsive/mobile/light-dark styling |
| `users/ui/README.md` | Beginner maintainer guide, routes/config/security contract |
These paths describe **source**, not a verified running app. Do not infer API compatibility or production availability from files existing.
## P05 CI verification files
| Path | Purpose / scope |
| --- | --- |
| `.gitea/workflows/p05-ci.yml` | Manual Gitea Actions workflow with Account, Login, dependency security and disposable backend jobs |
| `.gitea/README.md`, `.gitea/MINIFEST.md`, `.gitea/workflows/README.md`, `.gitea/workflows/MINIFEST.md` | Ownership, controls and file register for new CI configuration |
| `tests/ci/source_contract.py` | CI-only lockfile/importer and first-party security guard structural assertions |
| `tests/ci/oidc_discovery.py` | CI-only disposable ZITADEL readiness, discovery and public JWKS probes (not interactive login) |
| `tests/ci/README.md`, `tests/ci/MINIFEST.md` | CI tool scope and direct-child register |
| `users/ui/package-lock.json` | P05 account npm lock v3, generated metadata-only; reconciles `users/ui/package.json` |
| `auth/ui/v2/pnpm-workspace.yaml` | P05 selected 3 imported workspace members only, no source logic changes |
| `auth/ui/v2/pnpm-lock.yaml` | P05 retained 4 matching importers (root, Login, Client, Proto), package snapshots preserved |
| `project/CI-ARCHITECTURE.md` | Runner/CI security and runtime-verification boundaries |
| `notes/P05-CI-01.md`, `docs/P05-CI-01.md` | Pre-change plan and operator-facing CI evidence |
## P05-CI-02 file ownership update
| Path | Verified narrow function |
| --- | --- |
| `users/ui/src/auth.ts` | `callbacks.session` optional JWT subject type narrowing; no change to provider, policy or PKCE/state/nonce |
| `.gitea/workflows/p05-ci.yml` | CI-only Account negative smoke, Postgres restart persistence, registry advisory JSON collection, portless Compose config and cleanup status |
| `tests/ci/compose.portless.override.yaml` | Post-run CI-only removal of inherited developer Traefik host port 8080; unverified until next CI run |
| `tests/ci/account_negative.py` | Anonymous API 401 and protected route redirect CI probe |
| `tests/ci/advisory_triage.py` | Nonmutating npm/pnpm vulnerability inventory with IDs and patch availability |
| `tests/ci/oidc_discovery.py` | Read-only disposable issuer/JWKS negative validation and live metadata smoke |
| `notes/P05-CI-02.md`, `docs/P05-CI-02.md` | Pre-change Scope Lock, actual Gitea CI results and user/operator limitations |
## Other first-party folders
`packages/README.md`: intentionally empty shared-package placeholder, not the upstream `auth/ui/v2/packages/`.
`users/ui/public/`: currently no public assets registered. `project/` and `docs/` files are indexed by their own `MINIFEST.md`.
## Exact-file maintenance workflow
For any approved update:
1. Find target in this map, then open the actual source file and verify current behavior.
2. Record before/after and Scope Lock in `notes/`.
3. Change only approved files. Update relevant function/feature and user docs in the same phase.
4. Add change record to `project/CHANGELOG.md` and sync `MINIFEST.md` / source inventory if structure changes.
5. Do not rewrite or claim knowledge of every upstream function without examining it. Imported source internals stay officially sourced until audited for an approved edit.
## P05-CI-03 backend-only CI map
| Path | Actual role / ownership |
| --- | --- |
| `.gitea/workflows/p05-backend-acceptance.yml` | New manual backend-only Gitea job; excludes redundant Account/Login suites; bounded Alpine Git/Docker prerequisite, acceptance and always cleanup |
| `tests/ci/backend_acceptance.sh` | CI project collision checks, portless effective Compose, four services, disposable PostgreSQL restart, OIDC/JWKS smoke; **CI only** |
| `tests/ci/backend_cleanup.sh` | Cleanup gated on CI-generated ownership marker; down -v for that Compose project and orphan/volume/network checks |
| `tests/ci/compose.portless.override.yaml` | Existing P05-CI-02 CI-only reset of inherited P02 Traefik host binding; read-only in this phase |
| `tests/ci/oidc_discovery.py` | Existing negative and live metadata/JWKS verification; read-only in this phase |
| `docs/P05-CI-03.md`, `notes/P05-CI-03.md` | Public-facing CI procedure and accurate implementation/run evidence |
P02 dev Compose, core backend helper, Login V2 source, Account Portal and all dependency manifests remain unmodified.
## P05-SEC-01 — Dependency security file ownership
| Path | Exact authorized behavior |
| --- | --- |
| `users/ui/package.json` and `users/ui/package-lock.json` | Account Portal direct Next.js 16.4.6 security pin and npm v3 metadata-only lock |
| `auth/ui/v2/apps/login/package.json` | Official Login V2 dependency **declaration only**: Next.js/ESLint plugin and coordinated OpenTelemetry SDK/auto instrumentation; original app/auth source untouched |
| `auth/ui/v2/pnpm-lock.yaml` | Reproducible PNPM v10.30.3 resolution with pruned unreachable snapshots from former large upstream workspace |
| `.gitea/workflows/p05-security-acceptance.yml` | Manual four-job CI: independent Account/Login frozen builds and Account/Login production advisory gates |
| `tests/ci/security_advisory_gate.py` | Rejects malformed npm/pnpm JSON or any Moderate/High/Critical audit record; never suppresses or changes packages |
| `project/DEPENDENCY-SECURITY.md` | Detailed GHSA/group/parent/versions/patch/risk and CI disposition |
| `notes/P05-SEC-01.md`, `docs/P05-SEC-01.md` | Pre-change plan, source patch provenance, actual run results and operator guidance |
**Read-only:** `auth/ui/v2/pnpm-workspace.yaml`, all `users/ui/src/**`, original Login V2 components/logic, backend/Compose and unrelated monorepo packages.
## P05-SEC-02 — focused transitive dependency file map
| Path | Exact responsibility |
| --- | --- |
| `auth/ui/v2/pnpm-workspace.yaml` | Seven exact **parent-targeted** glob/minimatch major fixes; previous workspace overrides unchanged |
| `auth/ui/v2/pnpm-lock.yaml` | Pinned PNPM v10.30.3 lock metadata, patched transitive versions, original four importers |
| `.gitea/workflows/p05-security-acceptance.yml` | Optional `login_only=true` manual dispatch, no Account rerun; Login install/build/unit and independent production strict security audit |
| `tests/ci/transitive_override_contract.py` | CI checks only seven exact parent overrides; old affected package versions absent; parents resolve patched version |
| `notes/P05-SEC-02.md`, `docs/P05-SEC-02.md` | Pre-edit parent-chain evidence, exact patch and actual run outcome |
Official Login V2 user/auth source, user Account Portal, backend Compose and production infrastructure remain unmodified.
## P05-OIDC-01 — disposable real OIDC acceptance source map
`.gitea/workflows/p05-oidc-acceptance.yml`: one manual Gitea isolated Docker job and mandatory `always()` cleanup. `tests/ci/oidc_e2e/compose.owner.override.yaml`: only ephemeral IAM_OWNER PAT bootstrap; original P02 Compose untouched. `tests/ci/oidc_e2e/run.sh`: ownership preflight, portless backend startup, private loopback routing and original-app browser harness. `tests/ci/oidc_e2e/provision.py`: official ZITADEL API client/project/verified human creation and 0600 temporary secret fixture. `tests/ci/oidc_e2e/browser.sh`: CI-only pinned Playwright/Account npm dependencies. `tests/ci/oidc_e2e/browser.cjs`: actual Chromium Auth.js/OIDC/password/callback/session and fail-closed checks. `tests/ci/oidc_e2e/cleanup.sh`: owned-only containers, volume, bootstrap/database data cleanup. New directory `README.md` and `MINIFEST.md` document all modules. Detailed boundaries: `project/OIDC-E2E-ARCHITECTURE.md`; actual test outcomes pending Gitea.
**P05-OIDC-02 updated CI functions only:** `tests/ci/oidc_e2e/run.sh` stage between four-service readiness and provisioning now explicitly validates proxy Host/HTTP status, pulls version-pinned prebuilt socat, checks its entrypoint/immutable image digest and checks the private 8080 listener plus sidecar running/exit state. `tests/ci/oidc_e2e/provision.py::wait_until_ready()` checks HTTP 200 without JSON decoding. `cleanup.sh`, browser scripts and all application/backend/auth source remain read-only.
**P05-OIDC-03:** `tests/ci/oidc_e2e/forwarder.py` new CI-only asyncio stdlib opaque TCP localhost relay. `tests/ci/oidc_e2e/run.sh` now first classifies existing socat startup stderr into fixed safe error classes and, on unhealthy socat, switches only once to immutable-digest official Python within the same run-owned container name/network namespace. `cleanup.sh` and `provision.py` untouched; `browser.cjs`, `users/ui/**`, `auth/ui/v2/**` and the original P02 Compose untouched.
**P05-OIDC-04-A01 source map update:** The *only* source change is `tests/ci/oidc_e2e/run.sh` at `670e225db477f180ff14ffa62e6654860a166f17`: its pre-forwarder direct private proxy:80 readiness block classifies safely bounded socket/HTTP error codes and limits retry to transient classes only, preserving exact Host/issuer/network/isolation. Existing pre-bind namespace socket inspector identified Traefik PID 1 TCP6:8080 in actual Gitea Run #96; the already-existing isolated Socat forwarder plus unchanged original provisioning/browser/cleanup verified full disposable real OIDC SUCCESS. See `notes/P05-OIDC-04-A01.md`.
## P05-OIDC-05 reviewed read-only integration map
- `deployment/docker/compose.backend.dev.yaml`: HTTP localhost dev backend, h2c Traefik and **prebuilt** Login V2 image; not a production manifest
- `auth/ui/v2/apps/login/{Dockerfile,package.json}`: imported build/package inputs; Run #89 build only, not Run #96 runtime
- `auth/ui/v2/apps/login/src/{proxy.ts,lib/server/service-url.ts}`: upstream rewrite/Host proxy logic, not a configured production ingress
- `users/ui/src/{auth.ts,lib/env.ts,lib/identity.ts}`: Auth.js PKCE/session, HTTPS origin validation, protected session and Console link
- `users/ui/src/{app/api/account/me/route.ts,components/account-shell.tsx}`: protected identity-only API and **local** logout
- `.gitea/workflows/p05-oidc-acceptance.yml`, `tests/ci/oidc_e2e/browser.cjs`: disposable **prebuilt** Login V2 E2E. Entire original source/CI left unchanged. `notes/P05-OIDC-05.md` lists blockers.
## P05-OIDC-06 source/file map
- `.gitea/workflows/p05-custom-login-acceptance.yml`: manual imported Login image+browser acceptance and dual owned cleanup
- `deployment/docker/compose.login-ci.override.yaml`: CI-only `zitadel-login.image` replacement, never publish a host port
- `tests/ci/login_image/{build.sh,cleanup.sh,README.md,MINIFEST.md}`: private run-labeled builder and local image packaging, owner-verified teardown and mandatory folder manifest
- `tests/ci/oidc_e2e/run.sh`: exact numeric-run-tagged opt-in Compose overlay and actual running image-ID check; no change to non-opt-in path. Run #98 halted before that check. Original Login/Auth.js/provision/browser/cleanup code unchanged.
## P05-OIDC-06-A01 — exact source/function integration map
- `auth/ui/v2/apps/login/scripts/entrypoint.sh`: unchanged original imported shell blob, Git mode `100644`; execution must be repaired **only in isolated CI temporary build context**.
- `auth/ui/v2/apps/login/Dockerfile`: untouched upstream Dockerfile, direct `ENTRYPOINT ["/app/entrypoint.sh","node","apps/login/server.js"]` and `USER nextjs`.
- `tests/ci/login_image/build.sh`: only A01 source edit; numeric stat/shebang/no-symlink and temporary copy `644→755` fix; `docker run --network none --entrypoint /bin/sh` checks built image `test -x` under its default user.
- `tests/ci/login_image/cleanup.sh`: unchanged exact-labeled image/builder/context cleanup; PASS Run #99.
- `tests/ci/oidc_e2e/run.sh`, `provision.py`, `browser.cjs`, `cleanup.sh`: unchanged A01 accepted opt-in imported custom image and original confidential OIDC browser flow; PASS Run #99.
- `deployment/docker/compose.login-ci.override.yaml`: unchanged temporary Login image replacement only, no public ports.
Source-tested SHA `7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f`; documentation closure SHA separate. See `notes/P05-OIDC-06-A01.md`.
## P05-OIDC-07 — read-only production config evidence map (no source edit)
- `deployment/docker/compose.backend.dev.yaml`: ZITADEL `EXTERNALDOMAIN=localhost`, `EXTERNALSECURE=false`, `TLS_ENABLED=false`, dev loopback `127.0.0.1:8080:80`, private API h2c and Login routing; root users and mounted Docker socket require independent production hardening. **Never promote to prod**.
- `deployment/docker/compose.login-ci.override.yaml`: temporary run-ID-scoped Login image swap, **not production**.
- `auth/ui/v2/apps/login/{Dockerfile,next.config.mjs,src/proxy.ts,src/lib/server/service-url.ts,src/lib/server/custom-headers.ts}`: non-root upstream image, compiled basePath, CSP/HSTS/server-action origins, forwarded public Host handling; `src/proxy.ts` uses wildcard CORS on proxied paths, requiring an explicit production ingress/CORS review. Read-only.
- `users/ui/src/{auth.ts,lib/env.ts,lib/identity.ts,components/account-shell.tsx}`, `users/ui/next.config.ts`, `.env.example`: production HTTPS origin validator, Auth.js PKCE/state/nonce/session expiry, trusted Host toggle, protected profile, Console link and **portal-local** logout. No actual public ingress or global logout. Read-only.
- `core/backend/zitadel/dev.py`: development `.env` generator/admin bootstrap and local container runner, not production key rotation/secrets/backup.
- `tests/ci/oidc_e2e/**`, `tests/ci/login_image/**` and manual Gitea workflows: Run #99 **disposable HTTP localhost custom Login real OIDC** only, not public HTTPS/cert/production recovery. All paths strictly read-only in this phase. Full contract `notes/P05-OIDC-07.md`.
## P05-OIDC-08 — new static-only CI contract files (non-deployable)
- `deployment/production-contract/{README.md,MINIFEST.md,compose.ci.yaml,routing-policy.json}`: proposed `auth.vib.tools` canonical HTTPS issuer, separate `account.vib.tools` RP + exact Auth.js callback, Login V2/Console/API h2c routes/strict Host forwarded-header and symbolic secret refs. Five `synthetic.invalid` images, zero replicas, internal network, no published ports/build/bind volumes. **Not an actual production Compose or ingress implementation.**
- `tests/ci/production_contract/{README.md,MINIFEST.md,validate.py}`: stdlib JSON-based strict static policy/normalized Compose checker and **25 in-memory targeted negative fixture functions** plus workflow allowlist checker. No new files beyond required folder docs.
- `.gitea/workflows/p05-production-contract-dry-run.yml`: manually triggered; only Compose `config`, Python static validation, `always()` safety proof; no service creation.
- `notes/P05-OIDC-08.md`, `docs/P05-OIDC-08.md`: exact baseline/Scope Lock, Run #101 terminal failure and separately approved next RCA. No source files in `auth/**`, `users/**`, `core/**`, existing Compose, old workflows/tests/manifests/locks or runner changed.
Run #101 source `2ca1b4493bd47209d0c7eabf7453feaeb1f5174a`: Compose parse PASS, normalized `RUNTIME_BEHAVIOR` FAIL; 25 negative fixtures NOT EXECUTED. Preserve exact historical results, no post-CI source repatch.
## P05-OIDC-08-A01 — exact source boundary and evidence
- **Only source changed:** `tests/ci/production_contract/validate.py`. Added allowlisted normalized runtime field/type-only RCA diagnostics and permitted inert null command/entrypoint and null/empty configs; original 25 negatives unchanged, four new executable-field negatives. No new source file or fixture.
- **Strictly unchanged:** `deployment/production-contract/compose.ci.yaml` and `routing-policy.json`, `.gitea/workflows/p05-production-contract-dry-run.yml`, all other existing CI/deployment files, imported `auth/**`, Account `users/**`, backend `core/**`, packages and runner.
- **New docs:** `notes/P05-OIDC-08-A01.md` pre-source Scope Lock and full [Run #102](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/102) evidence; `docs/P05-OIDC-08-A01.md` operator acceptance. This is **NOT** a working production config or proof of actual HTTPS.
- Next A02 proposal: validator-only zero-replica normalization safe-shape RCA/strict check and one separate CI run. No source patch after terminal FAIL.
## P05-OIDC-08-A02 — exact changed source and unmapped normalized metadata
- **Only source change:** `tests/ci/production_contract/validate.py`, source-tested SHA `45a2edb854acd98546e60a68482075bc5f742bd2`. New tracked-file source replicas assertions, safe allowlisted normalized `deploy` presence/type/zero diagnostics and 3 additional malformed-deploy targeted fixtures; prior 25+4 retained.
- **Strict read-only:** `deployment/production-contract/compose.ci.yaml` and `routing-policy.json`, existing `.gitea/workflows/p05-production-contract-dry-run.yml`, all other tests and Login/Auth.js/backend, lockfiles, runner and infrastructure.
- **CI Run #103 terminal:** Compose config and five original-zero fixture declarations PASS; five normalized `replicas` int zero PASS; **five unexpected extra deploy fields PRESENT**, exact name unknown; `DEPLOY_DISABLED` rejection FAIL; all 32 negative fixture cases NOT EXECUTED. Existing `notes/P05-OIDC-08-A02.md`, `docs/P05-OIDC-08-A02.md` record honest security-blocking result.
- Next source edit only with separately approved `P05-OIDC-08-A03`; no post-dispatch patch in this phase.
## P05-OIDC-08-A03 — exact changed-file map and accepted evidence boundary
- **Only application/CI source edited**: `tests/ci/production_contract/validate.py` (tested `7954938fcee4d11c0b27751c7cf7abdcc64cd243`). Added pinned synthetic fixture Git SHA check, known deployment metadata type-only diagnostics, allow-only-empty metadata gate and eight negative fixture definitions.
- **Read-only preserved**: `deployment/production-contract/{compose.ci.yaml,routing-policy.json}`, prior manual `.gitea/workflows/p05-production-contract-dry-run.yml`, all `auth/**`, `users/**`, `core/**`, other tests, package files/locks/runner/production.
- **Phase evidence and user guide**: `notes/P05-OIDC-08-A03.md`, `docs/P05-OIDC-08-A03.md` plus synchronized notes/project/docs and associated README/MINIFEST. Source five zero replicas, normalized empty resources/placement defaults VERIFIABLE; **full static contract NOT accepted** due `SERVICE_SECRET_REFS`. All 40 invalid fixtures source present but NOT EXECUTED.
- **Next proposed A04** only validator service-secret-grant safe-shape RCA under separate approval. No post-run A03 source fix.
## P05-OIDC-08-A04 — source-only normalizer acceptance and exact changed-file map
- **Single modified source:** `tests/ci/production_contract/validate.py`, source-tested SHA `daaa8b259a519ae0290ba28936ef2279b3a9172c`; new bounded symbolic service grant source/target/permissions classification, exact required set+duplicate rejection, 8 security-negative in-memory cases, one canonical mount positive case.
- **Preserved read-only:** `deployment/production-contract/compose.ci.yaml` Git blob `930c0b0fbfb518555436acd6f0b4bb3bdd421937`, `deployment/production-contract/routing-policy.json`, `.gitea/workflows/p05-production-contract-dry-run.yml`, `auth/**`, `users/**`, `core/**`, all other tests and package locks; no production/runner edits.
- **Documentation:** new `notes/P05-OIDC-08-A04.md` scope-first forensic acceptance and `docs/P05-OIDC-08-A04.md` operator guide, synchronized relevant notes/project/docs/README/MINIFEST and tracked inventory.
- **Accepted static evidence:** [Run #105](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/105) / Job #221 **SUCCESS**, all positive static OIDC/routing/host/secret/internal/no-runtime checks and **48/48 security-negative cases** PASS, manual-only check PASS, runner temporary job resource cleanup PASS. **Live production is not accepted**. Proposed next P05-OIDC-09 production release preflight is doc-only under separate approval.
## P05-OIDC-09 — production-readiness source map (docs-only audit)
- Dev-only backend + Traefik: `deployment/docker/compose.backend.dev.yaml`, local initializer `core/backend/zitadel/dev.py`; no production Go source/vendor artifact, persistent production release or DNS logic.
- Imported Login: `auth/ui/v2/apps/login/{Dockerfile,package.json,scripts/entrypoint.sh}`, locked `auth/ui/v2/{pnpm-lock.yaml,package.json}`, temporary CI `tests/ci/login_image/{build.sh,cleanup.sh}`. Dockerfile `FROM node:24-alpine` is tag-based; disposable builder `node:22-bookworm`; Run #99 corrected copied entrypoint 644→755 only in temporary image context; no signed registry artifact.
- Account: `users/ui/{package.json,package-lock.json,next.config.ts,src/auth.ts,src/lib/{env.ts,identity.ts}}`; `output:standalone`, origin HTTPS guard, provider PKCE/state/nonce, protected user identity; no tracked Account `Dockerfile` or production release workflow.
- Undeployable contract: `deployment/production-contract/{compose.ci.yaml,routing-policy.json}`, `tests/ci/production_contract/validate.py`, unchanged `.gitea/workflows/p05-production-contract-dry-run.yml`; [Run #105](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/105) static 48/48 negative cases only.
- **New documentation-only** `notes/P05-OIDC-09.md` (scope-first release blockers/phases) and `docs/P05-OIDC-09.md` (operator checklist). No other application/CI/deployment source modified.
- Exact 13 proposed narrow phase Scope Locks for OCI provenance, Account packaging, backend pin, signing, vault/recovery, backup, private runtime, HTTPS proxy, Console, live OIDC, MFA, second SaaS SSO and final release in `notes/P05-OIDC-09.md`.
## P05-OIDC-10 — exact CI-only source paths and acceptance boundary
- **NEW** `tests/ci/login_image/provenance-lock.json`: source-tree+file blob pins, upstream v4.20.4 revision claim and Node22-bookworm/Node24-alpine linux/amd64 OCI index digests.
- **NEW** `tests/ci/login_image/provenance.py`: safe git source/lock, OCI configuration labels, nonroot, secret-env key validation, 12 in-memory negatives, planned partial material SPDX/unsigned local provenance files.
- **NARROW existing** `tests/ci/login_image/build.sh`: `ZITPLANE_PROVENANCE_CI=1` opt-in for pinned builder and temporary Dockerfile `FROM @sha256` and extra labels; default Run #99 mode preserved.
- **NEW** `.gitea/workflows/p05-login-provenance.yml`: manual-only dedicated CI for pinned source/build, no registry or production, always unchanged run-owned cleanup.
- **NEW docs** `notes/P05-OIDC-10.md` pre-source Scope Lock+Run #106 ledger, `docs/P05-OIDC-10.md` operator report, relevant developer/README/MINIFEST/inventory updates. Source-tested `6ba004808ef47c8856c1a7906faaf7ee807d15a6`; no protected `auth/**`/`users/**`/`core/**`/`deployment/**` or pre-existing CI/workflow/lock edits.
- **Run #106** [terminal failure](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/106): pinned image build/12 negatives PASS; environment key guard FAIL, actual key unknown; partial SPDX/attestation not written; cleanup PASS. P05-OIDC-10-A01 must modify only provenance.py if separately approved.