8000 Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles · Issue #19 · Altinity/altinity-oauth-helper · GitHub
[go: up one dir, main page]

Skip to content
7FFF

Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19

Closed

Description

@BorisTyshkevich

Summary

Implement an environment-level ch-oauth-ldap service that lets ClickHouse 24.8 authenticate otherwise-undefined users with an OAuth/OIDC JWT and derive dynamic ClickHouse roles from token claims through ClickHouse's existing LDAP external user directory.

This is the implementation issue for ADR #16 and is consistent with ADR #17. It also aligns the helper's OAuth/role configuration vocabulary with Project Antalya's token authentication model where practical.

The helper is LDAP-only. It is not an HTTP verification service, proxy, OAuth login service, MCP-specific service, or ClickHouse provisioning service.

Target flow

Direct client / proxy / MCP
        |
        | ClickHouse username + JWT as password
        v
   ClickHouse 24.8
        |
        | LDAP simple bind
        v
   ch-oauth-ldap
        |
        | validate JWT, bind username to token identity,
        | derive token groups/roles
        |
        | LDAP role-mapping search on the SAME connection
        v
   ClickHouse local roles / grants / RBAC

MCP follows the same path as every other ClickHouse client. MCP does not call this helper directly.

Compatibility target

Baseline integration target:

  • Altinity Stable ClickHouse v24.8.11.51285.altinitystable or later 24.8 Altinity Stable.
  • This build contains ClickHouse #70332 (the push_external_roles_in_interserver_queries mechanism), so distributed-query role behavior can be exercised on 24.8. It does not contain ClickHouse #79099 ("Fix passing of external roles in interserver query", merged 2025-06-09): on 24.8 and 25.3 a pushed external role is stored in current_roles and filtered against the ephemeral user's (empty) local grants, so the remote node logs external_roles applied yet the query is denied (ClickHouse #78791). No 24.8 Altinity Stable release through 24.8.14.10547 carries #79099.

Compatibility is therefore split (verified by integration/clickhouse/run-all-builds.sh):

If 24.8 must support distributed external roles, Altinity needs to backport #79099.

ClickHouse 24.8 already provides the external-user lifecycle we need:

  • local users take precedence over LDAP users;
  • otherwise-undefined LDAP users are materialized in memory;
  • external roles are refreshed on authentication;
  • LDAP bind and role-mapping search use the same LDAP connection.

This helper is therefore a compatibility bridge for 24.8, not a replacement for ClickHouse authorization. ClickHouse remains the source of truth for roles, grants, settings profiles, row policies, quotas, and other RBAC objects.

Scope

In scope

  • New cmd/ch-oauth-ldap binary.
  • JWT/JWKS verification using the existing shared OAuth SDK rather than duplicating generic token-validation code.
  • Exact issuer validation.
  • Multiple accepted audiences.
  • Configurable username_claim and groups_claim, aligned with Antalya terminology.
  • Binding the requested ClickHouse/LDAP username to a verified token identity.
  • Email verification/domain policy already supported by the helper where configured.
  • Reserved/local username protection.
  • Token group extraction.
  • Antalya-aligned role pipeline: roles_mapping -> roles_filter -> roles_transform.
  • Minimal LDAPv3 simple Bind + Search behavior required by ClickHouse LDAP external user directories.
  • Connection-local authenticated state between Bind and Search.
  • Synthetic LDAP group entries consumed by ClickHouse role_mapping.
  • Environment-level Kubernetes Deployment + ClusterIP Service.
  • ClickHouse 24.8 configuration example/template.
  • Unit, protocol, integration, distributed-query, HA, cache-expiry, and redaction tests.
  • Refactoring the current verifier code enough to reuse helper-specific identity/token policy safely.

Explicitly out of scope

  • Shared verification HTTP API or /verify endpoint for this service.
  • MCP-to-helper API calls or MCP-specific integration.
  • Proxy implementation or changes.
  • OAuth browser/device/token acquisition flows.
  • OAuth token exchange.
  • TLS, LDAPS, or StartTLS for the MVP.
  • Public Ingress or LoadBalancer exposure.
  • SQL connections from the helper.
  • Creating ClickHouse users or roles.
  • Grant management.
  • Persistent external users.
  • Provider-specific group lookup APIs or token introspection in the MVP.
  • Cluster-specific role/group mappings in the environment-level helper.
  • Native ClickHouse client protocol implementation in the helper.
  • Revoking an already-established ClickHouse native session when its token expires. Token validation occurs during ClickHouse authentication; a new/reconnected authentication must use a currently valid token.

Configuration contract

Use Project Antalya terminology where the concepts are equivalent.

Example:

oauth:
  expected_issuer: https://example.auth0.com/

  # Required. MVP extension over Antalya's singular expected_audience.
  expected_audiences:
    - clickhouse
    - mcp

  username_claim: email
  groups_claim: roles

  verifier_leeway: 60s
  jwks_cache_lifetime: 1h
  token_cache_lifetime: 30s

identity:
  username_match: lowercase_equal
  require_email_verified: true
  allowed_email_domains: []
  denied_usernames:
    - default
    - admin
    - operator

roles:
  roles_mapping:
    idp-readers: ch_readonly
    idp-engineers: ch_engineer

  # Full-match semantics. This should normally make the mapping fail closed.
  roles_filter: '^ch_[A-Za-z0-9_]+$'

  # Optional, applied last. Sed-style syntax matching Antalya semantics.
  roles_transform: ''

ldap:
  listen: ':389'
  user_base_dn: 'ou=users,dc=altinity,dc=internal'
  group_base_dn: 'ou=groups,dc=altinity,dc=internal'
  user_rdn_attribute: uid
  role_cn_prefix: 'clickhouse_'

Exact YAML structure can follow existing repository conventions, but the external concepts and names above should remain stable unless implementation constraints require a documented change.

Audience semantics

expected_audiences is required and must contain at least one non-empty value.

A JWT is accepted when:

  • the token contains aud as a string or array according to JWT rules; and
  • at least one token audience exactly equals one configured expected_audiences entry.

No wildcard or substring matching.

If a singular expected_audience compatibility alias is added, reject configuration that specifies both singular and plural forms.

MCP gets no special audience bypass. Tokens passed by MCP must satisfy the same environment policy as tokens passed by other clients.

Issuer and token validity

  • expected_issuer is exact-match.
  • Signature must validate against configured JWKS.
  • exp is required.
  • nbf is enforced when present.
  • Clock skew uses configured verifier_leeway.
  • Do not add provider-specific /userinfo, Graph, or introspection calls in this issue.

Identity contract

A successful LDAP bind must prove that the requested username and the JWT refer to the same principal.

Required behavior:

  1. Parse the username from the configured LDAP bind DN shape.
  2. Validate the JWT.
  3. Read username_claim from verified claims.
  4. Compare the bind username to that claim using the configured match mode; default deployment policy is lowercase_equal.
  5. Apply email verification/domain policy when configured.
  6. Reject reserved usernames even when the token itself is valid.
  7. Treat (iss, sub) as the stable internal principal identity for logs/diagnostics/correlation where needed; the visible ClickHouse username can come from username_claim.

Authentication failures should not disclose whether failure was caused by signature, issuer, audience, username mismatch, reserved username, email policy, or token expiry. LDAP clients should receive invalidCredentials for authentication failures.

Never log the JWT or LDAP password value.

Group and role contract

Align with Antalya's role pipeline:

groups_claim
    -> roles_mapping
    -> roles_filter
    -> roles_transform
    -> ClickHouse role name
    -> LDAP synthetic cn representation
    -> ClickHouse LDAP role_mapping
    -> existing local ClickHouse role

groups_claim

  • Configurable claim name; default can remain compatible with existing deployment policy, but documentation should note Antalya defaults to groups and commonly uses roles for Entra App Roles.
  • MVP input type is a JSON array of strings.
  • Missing claim is not an authentication failure; it yields zero external roles.
  • Deduplicate values.
  • Malformed/non-array group claims must fail closed for role derivation and must never become arbitrary role names. Define whether this is authentication failure or zero roles and cover the choice with tests; prefer authentication failure for malformed configured claims.

roles_mapping

Match Antalya semantics:

  • explicit mapping from incoming group identifier to a candidate ClickHouse role name;
  • mapping happens first;
  • an unmapped group passes through unchanged.

roles_filter

Match Antalya semantics:

  • regex is evaluated against the value after roles_mapping;
  • use full-match semantics, not substring search;
  • groups that do not match are discarded;
  • invalid regex must prevent startup/config activation rather than falling into permissive behavior.

Deployment examples must use a restrictive filter so arbitrary IdP groups do not automatically become ClickHouse roles.

roles_transform

Match Antalya's ordering and sed-style transform semantics where practical:

  • applied after mapping and filtering;
  • optional;
  • malformed configuration fails startup/config activation.

LDAP representation

The role pipeline produces a ClickHouse role name, e.g. ch_engineer.

The LDAP server exposes it using a transport prefix, e.g.:

cn=clickhouse_ch_engineer,ou=groups,dc=altinity,dc=internal

with attribute:

cn: clickhouse_ch_engineer

ClickHouse strips the transport prefix using LDAP role_mapping:

<role_mapping>
    <base_dn>ou=groups,dc=altinity,dc=internal</base_dn>
    <scope>subtree</scope>
    <search_filter>(&(objectClass=groupOfNames)(member={bind_dn}))</search_filter>
    <attribute>cn</attribute>
    <prefix>clickhouse_</prefix>
</role_mapping>

The helper does not know whether a given cluster has created every emitted role. Clusters own their local role definitions and grants.

LDAP protocol contract

Use github.com/vjeantet/ldapserver for protocol handling unless an initial ClickHouse interoperability test finds a blocking issue. Do not implement LDAP BER manually.

MVP supports only the LDAP operations ClickHouse needs:

  • LDAPv3 simple Bind;
  • Search used by configured ClickHouse role_mapping;
  • Unbind/connection close.

Not supported:

  • anonymous role search;
  • SASL bind;
  • Add/Modify/Delete/Compare;
  • password modification;
  • generic directory browsing;
  • StartTLS;
  • LDAPS.

Unsupported operations fail closed.

Bind DN

Recommended deployment shape:

uid={user_name},ou=users,dc=altinity,dc=internal

The helper must parse DNs using an LDAP/DN parser and proper escaping rules. Do not recover usernames through unsafe string concatenation/splitting that permits DN injection.

Reject anonymous/empty bind credentials.

The LDAP simple-bind password is the JWT.

Connection-local state

This is normative because ClickHouse performs Bind and subsequent role Search on the same LDAP connection.

After a successful Bind, store only on that connection:

  • canonical visible username;
  • stable (iss, sub) identity;
  • exact bound DN;
  • token expiration;
  • mapped role snapshot.

Rules:

  • Search before successful Bind fails closed.
  • State is never shared between LDAP connections.
  • Clear previous authenticated state before processing every re-Bind attempt.
  • A failed re-Bind leaves the connection unauthenticated.
  • A successful re-Bind replaces the previous state completely.
  • Disconnect destroys the state.
  • Multiple valid searches after one successful Bind use the role snapshot established by that Bind.

Do not revalidate/reinterpret the JWT during Search.

Search behavior

Accept the narrow role lookup performed by the documented ClickHouse configuration.

For an authenticated connection:

  • require the configured group base DN;
  • require the expected scope;
  • require the expected membership query shape or equivalent safely parsed LDAP filter;
  • ensure any referenced member DN equals the current connection's bound DN;
  • return one synthetic group entry per mapped role;
  • return successful empty results for an authenticated user with zero roles.

Example entry:

dn: cn=clickhouse_ch_engineer,ou=groups,dc=altinity,dc=internal
objectClass: groupOfNames
cn: clickhouse_ch_engineer
member: uid=user@example.com,ou=users,dc=altinity,dc=internal

Do not let Search become an oracle for arbitrary usernames or token group membership.

Cache correctness

Before or as part of this implementation, fix the existing positive verification cache invariant in the shared verifier path.

Today the helper's positive cache can use now + positive_ttl without capping the entry at JWT expiration. That can temporarily treat an expired token as valid if it was cached shortly before exp.

Required invariant for every positive token-validation cache entry:

cache_expiration <= JWT.exp

Concretely:

cache_expiration = min(now + token_cache_lifetime, JWT.exp)

No cache in this helper may extend authentication validity beyond credential expiration.

Keep the cache key bound to both requested username and token so a token cached for one requested username cannot authenticate another.

Code organization

Do not duplicate generic JWT/JWKS/OIDC parsing that belongs in github.com/altinity/go-mcp-oauth-sdk.

Suggested split in this repository:

cmd/ch-oauth-ldap/
    main.go
    config.go

internal/identity/
    username binding and reserved-user policy

internal/roles/
    groups_claim extraction adapter
    roles_mapping
    roles_filter
    roles_transform

internal/ldap/
    per-connection session
    bind handler
    search handler
    LDAP entry rendering

Refactor/reuse the current ch-jwt-verify verifier/identity logic rather than maintaining two security-sensitive implementations. If a capability is generic across consumers, extend the SDK instead of copying it into altinity-oauth-helper.

Existing ch-jwt-verify behavior must not regress as a side effect of this refactor.

ClickHouse 24.8 configuration

The working configuration, copied verbatim from the integration fixture integration/clickhouse/clickhouse/common/config.d/ldap.xml (verified against 24.8 and 25.8; role_mapping sits directly under <ldap>, enable_tls=no makes the MVP's plain-LDAP scope explicit, search_limit is ClickHouse's default made explicit — see the operator guide for the measured overflow consequence):

<clickhouse>
    <ldap_servers>
        <oauth_helper>
            <host>ch-oauth-ldap</host>
            <port>389</port>
            <bind_dn>uid={user_name},ou=users,dc=altinity,dc=internal</bind_dn>
            <verification_cooldown>0</verification_cooldown>
            <enable_tls>no</enable_tls>
            <search_limit>256</search_limit>
        </oauth_helper>
    </ldap_servers>

    <user_directories>
        <ldap>
            <server>oauth_helper</server>
            <role_mapping>
                <base_dn>ou=groups,dc=altinity,dc=internal</base_dn>
                <scope>subtree</scope>
                <search_filter>(&amp;(objectClass=groupOfNames)(member={bind_dn}))</search_filter>
                <attribute>cn</attribute>
                <prefix>clickhouse_</prefix>
            </role_mapping>
        </ldap>
    </user_directories>
</clickhouse>

Validate the exact 24.8 XML structure against the target build during implementation; the committed example must be copied from a working integration test, not documentation-only assumptions.

Keep verification_cooldown=0 so each ClickHouse authentication reaches the helper and sees current token-derived roles.

Kubernetes deployment

This service is environment-level, not a ClickHouse sidecar.

Add a new Helm/deployment path; do not silently change the existing ch-jwt-verify sidecar chart's behavior.

Expected topology:

  • Deployment;
  • ClusterIP Service;
  • LDAP port 389 only;
  • no HTTP API;
  • no Ingress;
  • no LoadBalancer;
  • no TLS/LDAPS/StartTLS in MVP;
  • two stateless replicas for production by default/recommended configuration;
  • one replica allowed for dev/test;
  • tcpSocket liveness/readiness probes on the LDAP listener;
  • resource requests/limits;
  • PodDisruptionBudget for multi-replica production configuration where appropriate.

All authenticated state remains connection-local, so Kubernetes Service load balancing requires no shared session store or sticky-session configuration.

Plain LDAP is acceptable only on the trusted internal Kubernetes network described by the architecture. Documentation must make the bearer-token implication explicit: the JWT travels as the LDAP simple-bind password. The Service must therefore remain internal-only. Recommend NetworkPolicy restriction where the deployment platform supports it.

Decision (2026-08-28): this plaintext-in-cluster posture is accepted for the MVP by the named risk owner (Boris Tyshkevich, @BorisTyshkevich) recorded in the ship log and in ADR #16's amendment; the chart renders a ClusterIP-only Service plus a default-on source-restricting NetworkPolicy (reachability control, not transport confidentiality) and documents the exposure explicitly.

Logging and observability

Provide useful structured logs without credential leakage.

Allowed examples:

  • bind success/failure count;
  • normalized username on success where current project logging policy allows it;
  • stable hashed/correlated principal identifier if useful;
  • issuer/processor name;
  • number of mapped roles;
  • LDAP operation/result code;
  • validation/cache timing at debug/trace level.

Never log:

  • JWT contents;
  • Authorization headers;
  • LDAP password values;
  • full raw bind requests containing credentials.

Error messages returned to LDAP clients must not contain token contents or internal verifier errors.

Tests

Unit: verification and identity

  • Valid signature/issuer/audience succeeds.
  • Any configured audience can satisfy a string/array aud claim by exact equality.
  • No audience intersection fails.
  • Empty/missing configured audience list fails startup.
  • Invalid signature fails.
  • Wrong issuer fails.
  • Expired token fails.
  • Missing exp fails.
  • Future nbf outside configured leeway fails.
  • Bind username / username_claim mismatch fails.
  • lowercase_equal behaves as documented.
  • Required email_verified is enforced.
  • Allowed-domain policy is enforced.
  • Reserved usernames fail even with otherwise-valid tokens.
  • Cache key remains bound to requested username + token.
  • Positive cache entries never survive JWT exp.
  • JWT/password never appears in logs or returned errors. (first-party sinks proven by internal/securitytest; the SDK kid sink closed by go-mcp-oauth-sdk v0.2.1 — SDK_REDACTION_AUTHORIZATION_GATE resolved)

Unit: groups and roles

  • Configurable groups_claim reads JSON string arrays.
  • Missing group claim yields zero roles.
  • Duplicate groups deduplicate.
  • Malformed configured group claim fails closed.
  • roles_mapping is applied first.
  • Unmapped groups pass through before filtering, matching Antalya semantics.
  • roles_filter uses full-match semantics.
  • Non-matching values are dropped.
  • Invalid role-filter regex fails config activation/startup.
  • roles_transform runs after mapping/filtering.
  • Invalid transform fails config activation/startup.
  • Dangerous/unexpected IdP group values cannot become roles under the documented fail-closed deployment config.

Unit/protocol: LDAP

  • Valid simple Bind creates authenticated connection state.
  • Invalid token returns invalidCredentials.
  • Anonymous/empty bind rejected.
  • Malformed/unexpected bind DN rejected safely.
  • Search before Bind rejected.
  • Search state is isolated between connections.
  • Successful re-Bind replaces principal and roles.
  • Failed re-Bind clears previous authentication state.
  • Expected ClickHouse role search returns correct synthetic cn values.
  • Authenticated user with no roles receives successful empty search.
  • Search for another member DN is rejected.
  • Wrong base DN/scope/filter cannot expose arbitrary group membership.
  • Unsupported LDAP operations fail closed.
  • Disconnect removes connection state.
  • Malformed requests do not panic the process.

Integration: real ClickHouse

Run against v24.8.11.51285.altinitystable or a later explicitly documented 24.8 Altinity Stable build.

  • Precreate local test roles/grants; do not CREATE USER for OAuth test principal.
  • Undefined user authenticates using ClickHouse username + JWT through LDAP.
  • currentUser() is the configured visible username.
  • currentRoles() reflects mapped local ClickHouse roles.
  • Username/token mismatch is rejected.
  • Invalid/expired token is rejected.
  • Change token groups and reconnect: roles refresh on the new authentication.
  • Local reserved/admin user definition takes precedence and is not replaced by an external user.
  • Distributed query preserves the externally assigned roles on remote nodes (≥25.8, base tables only — see Compatibility target; expected-failure on 24.8, VIEW canary tracks #116840).
  • No JWT appears in ClickHouse/helper integration logs.

HA

  • Run two helper replicas behind one ClusterIP Service. (proven behind a Docker TCP load balancer; ClusterIP form not verified in the build environment — see the operator guide's runbook)
  • New ClickHouse authentications work regardless of which replica receives the LDAP connection.
  • No correctness dependency exists on shared in-memory state between replicas.
  • Kill one helper pod; new authentications recover through the remaining Service endpoint after normal Kubernetes routing convergence. (Docker equivalent proven; Kubernetes convergence delegated to the runbook)
  • Existing LDAP connections to a killed pod may fail; no transparent cross-pod session migration is required.

Implementation sequence

Phase 1: shared correctness/refactor

  • Extract/reuse security-sensitive verifier and identity code needed by both binaries.
  • Fix positive cache expiry so cached validation cannot outlive JWT exp.
  • Add multiple-audience validation.
  • Add Antalya-aligned group/role pipeline.
  • Preserve ch-jwt-verify behavior and tests.

Phase 2: LDAP server

  • Add cmd/ch-oauth-ldap.
  • Add LDAP dependency and server lifecycle.
  • Implement per-connection session state.
  • Implement simple Bind.
  • Implement restricted role Search.
  • Implement safe LDAP DN/filter/value handling.
  • Add protocol-focused unit tests.

Phase 3: ClickHouse integration

  • Add real ClickHouse 24.8 integration fixture/config.
  • Verify ephemeral user creation and currentUser().
  • Verify dynamic currentRoles().
  • Verify role refresh on reconnect.
  • Verify local-user precedence.
  • Verify distributed-role propagation.

Phase 4: deployment

  • Add environment-level Helm/deployment assets.
  • Deployment + ClusterIP port 389.
  • Two-replica production example/default and one-replica dev override.
  • TCP probes, resources, and disruption behavior.
  • No public exposure and no HTTP service.

Phase 5: docs/security verification

  • Document ClickHouse configuration copied from the working integration fixture.
  • Document Auth0/OIDC/JWKS and multiple-audience configuration.
  • Document username_claim, groups_claim, and Antalya-aligned role pipeline.
  • Document plain-LDAP/internal-network trust boundary.
  • Verify token redaction across error and debug paths.
  • Complete HA and malformed-input tests.

Definition of done

This issue is complete when a user who does not exist persistently in ClickHouse 24.8 can connect with a valid OAuth/OIDC JWT, ClickHouse authenticates that user through ch-oauth-ldap, the helper binds the requested username to the verified token identity, ClickHouse receives the token-derived dynamic role set through LDAP role mapping, local ClickHouse RBAC remains authoritative, distributed queries retain the external roles, refreshed token groups take effect on the next authentication, two helper replicas work without shared state, and neither cache behavior nor logs can extend or leak bearer credentials.

Delivery was phased (state of record: the <!-- ship-log --> comment on this issue):

Related: #16, #17

Activity

  1. BorisTyshkevich commented on Aug 27, 2026

    @BorisTyshkevich
    CollaboratorAuthor

    Ship log — #19

    Phase Status PR
    1 — shared correctness/refactor shipped #20
    2 — LDAP server shipped #21
    3 — ClickHouse integration shipped #22
    4 — deployment shipped #25
    5 — docs/security verification shipped #28, #29

    Phase 1 — handoff

    • Landed: shared internal/identity (username-claim binding, reserved-username
      policy), internal/roles (Antalya-aligned map→full-match-filter→transform pipeline),
      and internal/verification (composes the SDK's strict verifier + identity policy,
      owns the cache) packages; cmd/ch-jwt-verify refactored to a thin HTTP adapter over
      internal/verification; positive-cache expiry now min(now+token_cache_lifetime, JWT.exp); multiple-audience validation (expected_audiences, byte-exact, legacy
      singular oauth.audience still supported, mutually exclusive after YAML+env
      layering); /verify collapses every distinct validation failure into one generic
      403 "authentication failed" body (never discloses which check failed), with the
      real reason only in the debug log line — verified live end-to-end against a running
      sidecar + synthetic IdP, including a log-content check confirming the raw JWT never
      appears in any log line.
    • Decisions take 10BC8 n (not in the issue):
      • The approved plan required new APIs in the separate Altinity/go-mcp-oauth-sdk
        repo (StrictJWTPolicy/ValidateStrictJWT, IdentityPolicy/
        ValidateIdentityClaims) that didn't exist at the pinned v0.1.0. Per /ship's own
        repo-scope rule, this was not silently absorbed into this unit — it ran as its
        own preliminary unit (plan already covered by phase 1's approved plan; separate
        branch/PR/review loop in that repo) before phase 1's helper-side code could be
        written. Shipped as Altinity/go-mcp-oauth-sdk PR build(deps): bump github.com/urfave/cli/v3 from 3.8.0 to 3.10.1 #8, tagged v0.2.0 (additive-only,
        zero behavior change to any pre-existing exported function — confirmed by review and
        by that repo's full pre-existing test suite passing unchanged). altinity-oauth- helper now pins v0.2.0.
      • The SDK's ValidateStrictJWT returns several internally-distinguishable error
        variants (issuer mismatch, audience mismatch, missing/malformed exp, etc., all
        wrapping ErrInvalidToken). internal/verification/cmd/ch-jwt-verify collapse all
        of these into the single generic HTTP response per the issue's identity contract —
        this collapsing happens at the sidecar's HTTP boundary, not inside the SDK itself,
        since the SDK is generic infrastructure other consumers may want typed errors from.
    • Deviations from the spec: none identified — the plan review (ChatGPT-author +
      Fable/high, 2 passes) already reconciled the issue text with implementation reality
      before code was written.
    • Deferred acceptance criteria: this phase claims none of issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19's global
      Definition of Done directly (by design — see the approved plan's "Delivery boundary").
      It is foundational: ch-jwt-verify remains fully operational and unregressed, and
      phase 2's cmd/ch-oauth-ldap can now reuse internal/identity/internal/roles/
      internal/verification without a second security-sensitive implementation.
    • Follow-ups filed: none yet. Two out-of-scope items noted during review, not filed
      as separate issues yet (low priority, pre-existing): oauth.jwks_refresh_ahead in
      cmd/ch-jwt-verify's config was already a no-op knob before this phase (not
      introduced or fixed here); the pre-existing 401 "missing or malformed Authorization"
      path is intentionally distinct from the generic 403 non-disclosure response (documented
      in code, not a defect).
    • Plan review: approved on pass 2 of 5 (ChatGPT-author / Fable-high mode), conversation
      https://chatgpt.com/c/6a90518a-caa8-83eb-947b-f04cf8a4ecc9, session
      d64eda2f-72ec-462e-ac78-f62c926a0a5b.
    • Review outcome: certified on pass 3 of 3 (certified-pending-proofs, no findings,
      reviewed SHA 593910f matched the PR head exactly at merge time). Conversation
      (same thread as the plan review) https://chatgpt.com/c/6a90518a-caa8-83eb-947b-f04cf8a4ecc9,
      session ca4edf43-c37b-4177-9a11-286ac3de9da5. Findings across all 3 passes:
      • Accepted (3): a shallow-clone of Claims.Extra's nested map/array values
        that could let one caller's mutation poison a later cache hit for a different
        caller (fixed: recursive deep clone); the raw, unvalidated Basic-auth username
        reaching debug logs/error text before identity was established, which could carry
        an attacker-supplied credential-shaped string (fixed: identity.RedactUsername
        heuristic guard applied at every interpolation site); a present-but-null
        groups_claim being treated as absent (zero roles) instead of malformed (hard
        auth failure) — reversed the coordinator's own pass-1 rejection of this same
        finding on reconsideration, since the issue text explicitly says to "prefer
        authentication failure for malformed configured claims" when the choice is
        ambiguous, which the coordinator's original rebuttal had underweighted.
      • Rejected (1): the same present-null-groups finding, on its FIRST appearance
        in pass 1 — rejected then on the grounds that it matched a sibling function's
        behavior and the upstream SDK's own precedent; superseded by the acceptance above
        once re-raised in pass 2 with the issue-text citation.
    • Merged: 2b938f6132e6e57f3c9fec0c7536ad199d21691a on origin/main, local main
      confirmed non-diverged after merge.

    Phase 2 — handoff

    • Landed: standalone cmd/ch-oauth-ldap LDAPv3 server + new internal/ldap
      package: connection lifecycle over github.com/vjeantet/ldapserver (pinned pseudo-
      version, commit 663e6b9910fb), per-connection authenticated state via
      HandlerSource/GetHandler (no global connection map), simple Bind (JWT as the
      bind password) that calls the phase-1 internal/verification.Verifier.Verify +
      internal/roles.Pipeline.Roles exactly once each and snapshots the result on the
      connection, restricted role-mapping Search reusing that snapshot (never re-calling
      Verify/Roles), safe RFC-4514 DN parsing/comparison (go-ldap/ldap/v3, no string
      splitting), structural (AST-based, not text-based) Search-filter authorization, and
      every unsupported LDAP operation (Add/Modify/Delete/Compare/Extended/SASL/anonymous)
      failing closed. Classified High risk + Large by its own plan; implemented via the
      decompose-and-implement loop (5 sub-tasks, one concurrent wave). This phase claims
      none of issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19's global Definition of Done — it's a standalone protocol server
      phase 3 will point a real ClickHouse 24.8 instance at.
    • Decisions taken (not in the issue):
      • The vendored vjeantet/ldapserver dependency's default logger writes every
        inbound LDAP packet in hex — including the JWT carried as the simple-bind
        password. internal/ldap.New unconditionally sets ldapserver.Logger = ldapserver.DiscardingLogger before ever returning a Server, and this ordering
        is structural (the only construction site), not caller discipline.
      • Two genuine data races were found in the vendored dependency itself (an
        unsynchronized Server.Listener field racing Serve()'s write against Stop()'s
        read, and a related Server.wg/Logger window) — not forked/patched (per the
        plan's explicit preference to use the dependency as-is); instead worked around at
        the call site (close our own listener reference first, synchronize via the error
        channel, then call Stop()) and documented as an explicit "at most one
        internal/ldap.Server per process" invariant in server.go's own doc comments,
        since ldapserver.Logger is a package-level global the dependency doesn't scope
        per-instance.
      • RFC 3909's Cancel extended operation is intercepted by the vendored dependency
        before reaching this package's fail-closed Extended-operation handler; verified
        (and now tested) that the dependency's own same-connection-only, no-Bind/no-Abandon
        restriction makes this a benign carve-out, documented alongside the existing
        Abandon exception rather than silently left unhandled.
    • Deviations from the spec: none identified — the plan review (ChatGPT-author +
      Fable/high, 3 passes) already reconciled the issue text with the actual dependency's
      API surface (verified independently by the coordinator against the real vendored
      source) before code was written.
    • Deferred acceptance criteria: none of issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19's global Definition of Done —
      by design, foundational only (see Phase 1's row above for the same rationale). Real
      ClickHouse 24.8 interoperability, distributed-role propagation, and HA are phase 3/5.
    • Follow-ups filed: none as separate GitHub issues yet, but the post-cap
      architecture consultation (below) raised 5 issue-level recommendations worth
      tracking before/during later phases, none judged a phase-2 blocker:
      1. Bearer-token transport confidentiality: issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19 explicitly excludes TLS/
        LDAPS/StartTLS from the MVP (plain LDAP on a "trusted internal network"), but
        ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 expects tokens to have transport protection. This is a tension in the
        issue's own already-recorded scope decision, not a phase-2 defect — flagged
        for a human decision at whichever point the deployment topology is finalized
        (phase 4), not resolved here.
      2. The new 64 KiB message-body cap and 256-connection limit (see below) should
        become documented, deliberate capacity contracts (expected concurrency, JWT
        size ceiling, monitoring for saturation) rather than only inline code
        comments — good phase-4 deployment-doc material.
      3. Both dependency forks should have their generic fixes upstreamed to
        vjeantet/ldapserver/vjeantet/goldap (both projects had real July 2026
        activity, so this is plausible) and a repeatable re-sync procedure defined.
      4. This repo has no PR-time CI at all — a pre-existing, documented condition
        (CLAUDE.md), not something introduced or worsened by this phase.
      5. A real Altinity Stable 24.8 integration exercising user materialization,
        role refresh, local-user precedence, distributed external roles, concurrent
        load, and helper-unavailability behavior should gate calling the whole
        issue
        done — already how phase 3 is scoped, reaffirmed here.
        The consultation also suggested comparing the current environment-level
        ClusterIP topology against a per-pod sidecar alternative at phase 4 (keeps the
        bearer-token LDAP hop on loopback) — worth a deliberate phase-4 comparison, not
        a phase-2 rework.
    • Verification beyond the automated suite: live end-to-end smoke test against a
      running ch-oauth-ldap + synthetic IdP using independent, real LDAP client tooling
      (ldapwhoami/ldapsearch, not the Go test suite's client library) — confirmed a
      valid bind succeeds, wrong-username/garbage-token/anonymous-bind all converge on the
      identical invalidCredentials (49) response, an unsupported extended operation
      (WhoAmI) fails closed with the correct result code after a successful bind, a
      zero-role token produces a successful empty search, and the debug log shows only a
      generic per-category reason (never the raw token) — confirmed by a definitive
      substring search.
    • Plan review: approved on pass 3 of 5 (ChatGPT-author / Fable-high mode),
      conversation https://chatgpt.com/c/6a9098f3-a038-83eb-b5e2-852a4f1cd2bc, session
      1c250939-ebdd-479c-862c-562ded31d408.
    • Review outcome: NOT formally certified by a VERDICT: SHIP — merged on an
      explicit human ruling after a VERDICT: REVISE post-cap architecture
      consultation, whose concerns were judged issue-level (see Follow-ups above), not
      phase-2 code defects. 6 formal review passes across 2 ChatGPT sessions (the
      human explicitly extended the normal 3-pass cap to 6 for this unit), all 6
      finding and fixing real issues: a goldap BER-encoding correctness bug
      corrupting response correlation past message ID 127; a silently-dropped
      ModifyDNRequest; an unauthenticated pre-auth ~2 GiB memory-allocation DoS in
      the pinned ldapserver; a slowloris-style stall with no read/write timeout; an
      unbounded per-connection goroutine/blocked-writer bug that also blocked graceful
      shutdown; an unbounded aggregate-connection DoS gap; and a control-operation
      (Abandon/Cancel) starvation bug introduced by the previous fix. Two issues were
      coordinator-found and fixed proactively beyond what a review pass flagged: a
      related TCP-fragmentation data-corruption bug (rejected by one pass on a scope
      technicality since obsoleted by an earlier fix forking the same file) and an RFC
      4511 §4.5.1.8 non-conformance in attribute-selection projection. One flaky test
      (introduced alongside the control-op fix) was root-caused as a test-
      orchestration flaw, not a production bug, and fixed — verified with 81 combined
      -race iterations. Two local dependency forks now exist,
      third_party/goldap/ (2 patches) and third_party/ldapserver/ (5 patches),
      each with a PATCHES.md documenting upstream provenance and exact rationale,
      wired via go.mod replace directives. Conversation (same thread as the plan
      review) https://chatgpt.com/c/6a9098f3-a038-83eb-b5e2-852a4f1cd2bc, sessions
      c16ce96d-caee-48ae-894b-7a77c59b0670 (passes 1-3), dd05fae0-8a2c-4c26-bce1-9f481fd10b46
      (passes 4-6, seeded from the first), post-cap consultation session
      78da2e6a-eacb-4424-b63d-3927bda94923 (seeded from the second). A tooling issue
      was observed and reported: chatgpt-review pr twice restated stale,
      already-fixed findings with an outdated self-reported reviewed_sha,
      apparently answering from conversation memory rather than re-fetching the live
      PR diff — resolved each time by an explicit instruction to re-navigate and
      confirm the live head SHA.
    • Merged: faef331a3f73c5c6d9102ebc9d94be9541aa29cf on origin/main, local
      main confirmed non-diverged after merge, on explicit human ruling (see Review
      outcome above).

    Phase 3 — handoff

    • Landed: integration/clickhouse/ — a real-ClickHouse acceptance fixture
      (Docker Compose: synthetic IdP, the production ch-oauth-ldap binary built from the
      branch, two Altinity Stable ClickHouse nodes on deliberately separate networks so the
      remote node can only be reached via the secret-authenticated interserver protocol),
      driven by run.sh (single build, default = the issue's 24.8 baseline) and
      run-all-builds.sh (24.8 + 25.8). Scenarios A–I: infrastructure preflight (12
      points), ephemeral undefined-user auth + currentUser(), dynamic currentRoles() /
      local-RBAC authority, username/token mismatch rejection, invalid+expired JWT
      rejection, role refresh on reconnect, local-user precedence, distributed external-role
      propagation (base-table oracle + system.query_log remote-identity assertion + helper
      Bind-delta proof that the remote never re-authenticates the JWT), an expected-fail
      view-oracle canary, and a fixed-string JWT leak scan over compose logs, both nodes'
      on-disk logs, the runner transcript, and captured auth-failure bodies (with a
      self-test). Also cmd/synthetic-idp gained a repeatable role query param emitting
      a roles claim (omitted when absent), with tests. Verified live: A–I exit 0 on both
      24.8.11.51285.altinitystable and 25.8.28.10001.altinitystable.
    • Decisions taken (not in the issue):
      • The issue's compatibility premise is wrong and needs a human edit. Issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19
        says the 24.8 baseline "contains the backport" needed for distributed external
        roles. It contains ClickHouse #70332 (the push feature) but NOT #79099 ("Fix passing
        of external roles in interserver query", merged 2025-06-09): on 24.8 (and 25.3)
        setExternalRolesWithLock stores pushed roles in current_roles, which are
        filtered against the ephemeral user's empty local grants — the remote log says
        external_roles applied yet the query is ACCESS_DENIED (#78791). No 24.8 Altinity
        Stable release through 24.8.14.10547 has #79099. Verified in Altinity/ClickHouse
        source and live. Distributed external-role propagation therefore works on
        25.8+/26.3, not 24.8; the fixture encodes this as a per-build expectation
        (lib/expectations.sh: H_base_table_propagation expected_fail on 24.8/25.3,
        must_pass on 25.8/26.3), asserting the specific ACCESS_DENIED shape and dying
        loudly on an unexpected success ("BEHAVIOR CHANGED"). Recommended issue-body edit:
        state the DoD's distributed-roles clause requires ≥25.8 Altinity Stable (or a 24.8
        build with #79099 backported).
      • A second, previously unknown upstream ClickHouse bug was found and filed:
        Pushed external roles (push_external_roles_in_interserver_queries) are lost when the remote query reads through a normal VIEW ClickHouse/ClickHouse#116840 — a normal VIEW on the remote
        side loses pushed external_roles because ContextData's copy constructor omits
        that field and StorageView recalculates access after cloning. Reproduces on every
        LTS line through current 26.3 (upstream and Altinity Stable). Scenario H was
        therefore reshaped from the plan's view-based oracle to a base-table oracle
        (which is what the DoD actually requires) with remote identity asserted separately
        via system.query_log (initial_user/user), and the original view probe kept as
        scenarios/75-distributed-propagation-view.sh, an expected-fail canary that flips
        to must-pass when ClickHouse fixes #116840. Human-directed (option "reshape H to
        base table, test against both builds, research + file the view bug, keep a view
        scenario").
      • Fixture lives under integration/clickhouse/ (test-only tree), not
        examples/_platform, per the plan; it is a manual/local gate — no CI workflow
        added (the repo still has no PR-time CI, a pre-existing condition).
      • The sandbox's Docker network isolator forces a fallback code path in run.sh that
        regenerates its own compose file; it is kept service-for-service in sync with
        compose.yml and parameterized by the same PHASE3_CH_IMAGE (an earlier
        experiment silently kept running the old image because the fallback had the image
        hardcoded — fixed and documented). A normal Docker host never takes the fallback.
      • ldap.xml's role_mapping sits directly under <ldap>, not nested under
        <roles> as the issue's illustrative XML showed — the real 24.8/25.8 parser reads
        it there; the committed example is copied from the working fixture as the issue
        demands.
    • Deviations from the spec: scenario H's oracle shape (view → base table) and the
      compatibility target (24.8-only → 24.8 baseline with expected-fail + 25.8 must-pass),
      both human-approved and both forced by upstream ClickHouse defects, not by this
      repo's code. Everything else per the approved plan.
    • Definition-of-done clauses claimed: undefined-user JWT authentication via
      ch-oauth-ldap; username↔token binding; token-derived roles reaching ClickHouse via
      LDAP role mapping; local RBAC authoritative; local-user precedence; role refresh on
      next authentication; no JWT in integration logs — all proven on both builds.
      Distributed queries retain external roles — proven on 25.8, and shown to be
      impossible on 24.8 without #79099
      (documented limitation, not a fixture defect).
      Deferred to phase 5: two-replica HA; broader security/redaction pass.
    • Follow-ups filed / recommended: ClickHouse#116840 (filed). Recommended: ask
      Altinity to backport ClickHouse #79099 to 24.8 Stable if 24.8 remains a supported
      target for this feature; amend issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19's compatibility paragraph (see above).
    • Plan review: approved on pass 4 of 5 (ChatGPT-author / Fable-high mode),
      conversation https://chatgpt.com/c/6a910d15-c1a0-83eb-aa16-d926786d07ad, session
      3d792471-0cb1-48fd-b9ce-4d8f98d9a057. Ad hoc root-cause consultation (same
      conversation, issue mode, uncapped): correctly predicted both bugs and the
      decisive base-table-vs-view experiment before it was run.
    • Internal pre-PR review (High-risk + Large → mandatory): Fable/high read-only pass
      over the complete branch diff found 1 HIGH / 4 MEDIUM / ~10 LOW, all accepted and
      fixed before the PR: the HIGH was that scenario H's negative control (and the 24.8
      expected-fail arm) accepted any non-200 / any ACCESS_DENIED, so on the default 24.8
      build an origin-side denial would have let H pass while proving nothing about
      propagation — fixed by requiring the denial to originate on the remote node
      (Received from clickhouse-remote:9000) plus an origin-side positive role check
      before the distributed queries; MEDIUMs: transient-retry helper vs the exact-2-Binds
      proof, raw JWTs on grep argv in the leak scanner (→ pattern file), leak-scan
      artifacts not verified non-empty, remote grant exclusivity not asserted live.
    • Review outcome: NOT formally certified by a VERDICT: SHIP — merged on an explicit
      human ruling after 6 formal passes (human-extended cap) plus a post-cap architecture
      consultation whose REVISE concerned issue/spec-level items, not the code (details in
      the pass-by-pass record below). Totals: 11 findings accepted and fixed across passes
      1/3/4/5/6 (0 rejected in those; pass 2 was a stale-snapshot tooling artifact, 4
      rejected as already-fixed), plus 1 HIGH / 4 MEDIUM / ~10 LOW from the coordinator's
      pre-PR review and 2 additional coordinator-found gaps. Every fix re-verified with
      run-all-builds.sh (24.8 PASS, 25.8 PASS) before pushing. Pass-by-pass: Pass 1 (head
      8f3e303, session 55cd505c-ece3-4547-9942-c614259682dd, seeded from the plan
      session; comment feat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22 (comment))
      → fixed-await-push, 4 accepted / 0 rejected: P1 assertion failures interpolated raw
      HTTP bodies into the tee'd transcript (→ oauth_body_diagnostics: length/sha256/
      private artifact path only; coordinator caught 2 missed sites in scenario G and had
      them fixed); P1 leak scan snapshotted logs before firing its own probes (→ probes
      first, then collect, gate, scan); P2 probe ignored HTTP status (→ requires non-200);
      P2 compose v1/v2 naming inconsistency. Both builds re-verified PASS after the fixes.
      Pass 2 (head e577d06) → no-accepted-findings: ChatGPT restated pass 1's four
      findings verbatim with a stale self-reported reviewed_sha (8f3e303, pre-fix) — the
      same stale-snapshot tooling behavior seen on PR feat(#19): phase 2 LDAP server (cmd/ch-oauth-ldap) #21, now filed as
      chatgpt-review: pr mode returns a stale-head review after a push (restates prior findings, reports the old SHA) in long conversations altinity-sql-browser#680 (the skill's owning repo); the independent fact-check
      rejected all four as already fixed at the live head (0 accepted / 4 rejected). Pass 3
      in this session → session-cap-exhausted before reaching ChatGPT: pass 1's runner had
      needed 3 real CLI attempts, which the tool counts against the session's hard 3-call
      cap (expected tooling behavior per review-loops.md, not a failed proof). Continued
      under the human-extended 6-pass allowance in a second pr-mode session seeded from
      the first (same conversation), with an explicit live-head re-fetch instruction.
      Second session (b9338cd4-ddc2-42d3-8f48-44b0aa1faad1) pass 1 (reviewed the live
      head e577d06; comment feat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22 (comment))
      → fixed-await-push, 2 accepted / 0 rejected: scenario G parsed the response into
      shell vars and interpolated those into die() (credential-echo path around
      oauth_body_diagnostics) and only checked the first line → whole-body exact match;
      run.sh installed its EXIT trap after image validation so an early die leaked the
      private run dir → trap moved before the tee/validation. Both fixed in e2916eb, both
      builds re-verified PASS, tests/lib-tests.sh 19/19.
      Second session pass 2 (reviewed e2916eb; comment
      feat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22 (comment))
      → fixed-await-push, 3 accepted / 0 rejected: the prior fix's trap now fired before
      ENV_FILE existed (SIGINT in that window → set -u abort inside cleanup, run dir
      leaked) → ENV_FILE set before the trap + SIGINT regression test; the new cleanup test
      had a guaranteed false negative (checked after its own rm -rf) → flag recorded first;
      README staleness (TMPDIR default, 14-point preflight, 2 + retries Bind delta). Fixed in
      b043171, both builds re-verified PASS, lib-tests.sh 20/20.
      Second session pass 3 (reviewed b043171; comment
      feat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22 (comment))
      → 1 accepted / 0 rejected (a pre-trap SIGINT window: RUN_TMP_DIR/ENV_FILE created
      before trap cleanup EXIT is registered); the workflow's own fix stage returned
      fix-failed for an environmental reason, not a gate failure — the pass's read-only
      verify agent ran git checkout main in the main tree after reproducing the finding
      (the repo-footguns.md hazard), so the fix agent correctly refused to edit on the wrong
      branch. Coordinator restored the branch (nothing lost; b043171 == origin) and applied
      the finding via a bounded fix agent (0876f6b: state-safe cleanup() and
      trap cleanup EXIT now precede mktemp/ENV_FILE; SIGINT-after-mktemp regression
      test, sabotage-checked; lib-tests.sh 21/21; both builds re-verified PASS). This
      exhausts the second session's 3 passes
      (5 real passes total); the 6th and final human-authorized pass ran in a third seeded
      session (ca9a9470-a96d-430f-b7f9-477eed16debe; reviewed 0876f6b; comment
      feat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22 (comment)) →
      fixed-await-push, 1 accepted / 0 rejected: an even narrower teardown race (SIGINT
      between mktemp's mkdir and the RUN_TMP_DIR assignment) → fixed structurally in
      c70f170 by pre-computing the path and mkdir -m 700 with collision retry, so
      cleanup always knows the path; lib-tests.sh 22/22; both builds re-verified PASS.
      6 authorized passes spent without VERDICT: SHIP → mandatory post-cap architecture
      consultation (issue mode, seeded from the third session, session
      a6075b81-6319-45e5-8ab2-67abe2258f3d) at head c70f170 → VERDICT: REVISE, but
      explicitly NOT about the code: "the architecture is sound", no Go-orchestrator rewrite
      warranted, and the final teardown form is "the right structural endpoint". Its five
      concerns are issue/spec-level: (1) split issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19's compatibility promise (24.8 =
      ephemeral auth + dynamic local roles; distributed external roles need ≥25.8 or a
      #79099 backport); (2) resolve plaintext-bearer vs ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16's TLS requirement in phase 4
      (TLS on the LDAP hop, or a per-pod loopback sidecar vs the environment-level Service);
      (3) document that the fixture is single-instance per Docker daemon (fixed ch-phase3
      project/network names); (4) add PR CI for the Go gate + daemon-free lib-tests.sh
      (keep the Docker matrix manual/scheduled); (5) make the issue body reflect the phase
      decomposition and deferred DoD clauses. FULL STOP for human ruling per protocol.
      Human ruling: add the single-instance note (item 3, doc-only), then merge phase 3 as
      scoped; carry the rest forward — (1)+(5) as proposed issue-Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19 body edits handed to the
      human ($TMPDIR/issue-19-proposed-edits.md; the coordinator does not edit issue bodies),
      (2) as an explicit decision requirement in phase 4's plan context, (4) filed as ci: add required PR-time Go/race/security gates; keep Docker ClickHouse matrix separate #23
      (daemon-free PR CI: Go gate + lib-tests.sh; Docker matrix stays manual/scheduled).
      Single-instance note landed as 82aa109 (comment/doc-only, verified; lib-tests.sh
      22/22).
    • Merged: 751a120337738cffc9d1f49df0e2578b0a7e861a on origin/main (PR feat(#19): phase 3 real-ClickHouse integration fixture (24.8 + 25.8) #22, head
      82aa109; reviewed-vs-merged SHA confirmed equal), local main confirmed non-diverged
      after merge, on explicit human ruling (see Review outcome above).

    Phase 4 — note (not started)

    Phase 5 — note (in progress)

    • Plan: ChatGPT-authored, 5 Fable/high review passes (session ed0c83e8-c85c-4d78-8fd2-79e5c8c29f8b, conversation https://chatgpt.com/c/6a91c7d2-a2ec-83eb-818e-c8fe990a6811). Not formally APPROVED after pass 5, but the final verdict's own summary says "no missing architecture decision blocks the plan; the remaining items are revisions". Coordinator decision (2026-08-28, human asleep, standing authorization to proceed): applied the human's phase-4 ruling — approved the latest plan with the final round's 7 findings folded in as binding amendments (plan-19p5.md § "Coordinator-approved amendments"). Human may confirm or reverse; nothing merges without the code-review loop.
    • Risk/size: High + Large (live inspection turned this into protocol work: handleSearch ignores LDAP sizeLimit/timeLimit; no guard rejects unsupported critical controls; SDK v0.2.0 logs the raw JWT kid header on JWKS rotation). Implemented via the decompose-and-implement loop.
    • Open gate for the human — SDK_REDACTION_AUTHORIZATION_GATE: pinned go-mcp-oauth-sdk v0.2.0 logs the unverified JWT header kid on successful key rotation (oauth/jwt.go:117). Whether that violates the issue's "never log JWT contents" (strict reading) or is allowed metadata like issuer name (lenient reading) is not a recorded decision. This run will NOT touch the SDK repo. Options for the human: (a) authorize an SDK fix + release (then one follow-up helper PR: bump, re-audit, flip the manifest row, release gate green), or (b) record kid as allowed non-credential metadata (then the row flips to safe citing that decision). Until decided, phase 5's row stays merged — blocked on SDK_REDACTION_AUTHORIZATION_GATE rather than shipped, and the Phase 5 checkbox stays unticked.
    • Implementation progress 10BC8 (2026-08-28, late evening): decompose loop ran 14 sub-tasks in 5 waves; waves 1–4 (T1 controls guard, T2 Search limits, T3 sentinel/boundary redaction matrix, T4 hostile DNs/256-cap/mid-Search close, T6/T7 verifier + sidecar marker matrices, T8 AST redaction inventory + release gate, T9 fixture search_limit + scenario G', T10 chart third copy, T11 shell-lib hardening, T12a session probe, T13a strict operator YAML) merged into wip/phase5-verification. The wave-4 post-merge gate then failed correctly: T8's new redaction inventory test flagged 5 sinks added by T1/T2 with no manifest row and 2 stale rows — exactly the drift it exists to catch across concurrent sub-tasks. Reconciled in 168d1bf (each sink classified from code — fixed constants / validated identity / numeric telemetry — and marker-tested at default and trace level; coordinator re-verified). T5 (filter resource probe) merged in dca7461 — it found a real defect: the goldap fork's readFilterAnd/Or/Not recursed without a depth bound and re-wrapped the error at every level on unwind (O(N²) allocation; a depth-1000 malformed filter well inside the 64 KiB body cap measured ≈150 MB heap delta) — fixed with an explicit nesting cap of 32 (the only authorized filter needs depth 1), a goldap regression test, a third PATCHES.md entry, and staged deep/wide probes proving linear, bounded behavior with a fresh Bind/Search succeeding after every stage. T12b (Docker HA fixture) merged in 7b7bf60 after a live green run: HAProxy (haproxy:lts-alpine pinned by digest) in front of two helpers; both served Binds; an A-bound persistent session died within bound when A was killed while B's Bind count stayed unchanged (no migration); a token minted after the kill authenticated via B; recreated A was readmitted via runtime DNS and served again; leak scan clean over 9 artifacts. Two sandbox footguns fixed on the way (HAProxy stale DNS cache before the network reshape; docker compose --force-recreate uses a rename API this isolator blocks → rm -f then up), plus a real set -e bug (read <<< "$(fn)" swallows a die in the subshell). Coordinator independently re-ran run-ha.sh (green: A=UP/B=UP → kill A → B's Bind count unchanged, newly minted token authenticates via B → A recreated, readmitted and serving; leak scan clean over 9 artifacts) and run-all-builds.sh (24.8.11.51285 PASS, 25.8.28.10001 PASS, scenario G' meeting auth_fails_on_size_limit_exceeded — HTTP 403 — on both; scenarios H/H-view still reporting the two tracked upstream ClickHouse limitations as expected). One gate defect surfaced: the phase-4 chart gate's committed untouched-paths set included cmd/**/internal/**/… — right for the phase-4 PR, wrong as a standing gate (phase 5 legitimately adds cmd/ch-jwt-verify/verify_test.go); being narrowed to the sidecar surface (helm/ch-jwt-verify, sidecar workflow, Dockerfile, scripts/build-image.sh, examples). T13b merged in e5dab76: docs/ch-oauth-ldap-operator-guide.md (working ClickHouse XML incl. search_limit, OIDC/Auth0/JWKS reference, identity + role pipeline, cache invariant, measured Search-limit consequence, trust boundary, HA claim boundary + Kubernetes runbook, capacity, goldap nesting cap) with internal/securitytest/docs_contract_test.go keeping every config fence an exact excerpt of its source and enforcing required/forbidden wording; README/CLAUDE/integration-README/chart-README/PATCHES synced. The phase-4 chart gate's untouched-paths set was narrowed to the sidecar surface (7958482). Coordinator's full independent verification on e5dab76: Go gate, tagged vet, -race, goldap tests, helm gate PASS, actionlint, non-goal paths empty, SDK pin unchanged; the phase5release gate fails on exactly the one expected SDK row. Coordinator-run high-risk review of the complete diff: no P1; 5 P2 + 9 P3, all accepted — HA leak scan missed the killed replica's original log; the narrowed chart gate had dropped sidecar production Go; "three identical XML copies" overstated; integration README implied G' works on 25.3/26.3 (it fails closed); a stale manifest exemption let proof tests rot; plus inventory-fingerprint rigor, assertion pinning, and doc precision. The review also positively verified the protocol core (controls guard, Search limits fail-closed incl. RFC 4511 sizeLimit 0, goldap cap vs the authorized filter, exact-256 cap, fd-level logger suppression) and that every redaction proof is non-vacuous. All fixed in 8762c18 (22 files). Coordinator re-verified on that head: Go gate, tagged vet, -race, goldap tests, helm gate PASS with the sidecar proof shown to bite on a production-Go touch, actionlint, 56/56 shell-lib tests, non-goal paths empty, SDK pin unchanged; Docker fixtures (HA + both ClickHouse builds) re-run on the same head — results recorded in the PR body. PR feat(ch-oauth-ldap): phase 5 — LDAP hardening, redaction proof, Docker HA fixture, operator guide (#19 phase 5) #28 opened at head e4833c5; ChatGPT code-review loop: 2 passes in a fresh conversation, see the handoff.

    Phase 5 — handoff

    • Human decisions (2026-08-29 morning): SDK_REDACTION_AUTHORIZATION_GATE → resolution (a) (authorize the SDK fix + release, then one follow-up helper PR); the human also asked the coordinator to apply the proposed issue-body edits and tick the Phase 1–4 checkboxes. Done: issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19 body edited (compatibility split 24.8 vs ≥25.8 with the base-table/VIEW qualification; illustrative XML replaced by the working fixture element incl. enable_tls/search_limit; Kubernetes-deployment section records the transport decision; Definition-of-done gained the phased-delivery note; all Phase 1–4 items and every proven ## Tests item ticked — the two Kubernetes-only HA items and the SDK-dependent redaction item stay open with notes); ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 gained an ## Amendments section (MVP transport exception; distributed-query criterion qualified). Pre-edit bodies are backed up under the coordinator's $TMPDIR. SDK fix opened as Altinity/go-mcp-oauth-sdk PR build(deps): bump grafana/grafana from 11.4.0 to 13.1.0 in /examples/grafana/docker/grafana #9 (7afb092: fixed rotation message with a matched_keys count only; TestJWKSRotationDoesNotLogKid — non-parallel, trace-level capture, two markers, non-vacuous); coordinator-reviewed; ChatGPT review in a fresh conversation, 3 passes: pass 1 REVISE (2 findings on the legacy ValidateToken path — accepted: kid removed from the error text with structural detection, legacy failure log classified instead of Err(err), token-derived got audience/scope lists replaced by counts; kept numeric exp/nbf/iat by coordinator decision — fixed in 3607f8e), pass 2 REVISE (double-%w broke one-step errors.Unwrap to ErrTransient — fixed with a typed error in 996c020), pass 3 SHIP. Merged as 53b4399, tagged v0.2.1 (also carries the dependabot go-sdk 1.7.0 bump). Helper follow-up PR fix(#19): consume go-mcp-oauth-sdk v0.2.1 and close SDK_REDACTION_AUTHORIZATION_GATE #29 (841358c): go-mcp-oauth-sdk v0.2.1, auditedSDKVersion bumped, all four external-pinned rows re-audited against the v0.2.1 source (the rotation-log row flipped to safe; zero blocked_external rows), the rotation test reshaped to assert kid absence, docs/comments no longer describe the gate as open; coordinator verified go test -tags phase5release ./internal/securitytest → ok plus the full gate set. ChatGPT review running in a fresh conversation.

    • Landed (PR feat(ch-oauth-ldap): phase 5 — LDAP hardening, redaction proof, Docker HA fixture, operator guide (#19 phase 5) #28): LDAP protocol hardening — Search honors sizeLimit (emit up to N, then result 4 sizeLimitExceeded; 0 = unlimited per RFC 4511), timeLimit (result 3) and typesOnly; a first-party pre-dispatch guard rejects unknown critical controls with unavailableCriticalExtension (criticality flag only, never OID/value), intercepting Abandon/Cancel before the vendored router; an explicitly encoded criticality FALSE is malformed per the goldap fork. Remaining malformed-input matrix: hostile Bind-DN encodings (invalid UTF-8, embedded NUL, 65 525-byte DN under the 64 KiB cap), Unbind/abrupt close mid-Search, the exact 256-connection cap (257th gets EOF, freed slot re-Binds), and staged deep/wide malformed-filter resource probes — which found and fixed a real defect in the goldap fork (unbounded AND/OR/NOT recursion with per-level error re-wrapping → ≈150 MB heap for one 64 KiB message; now a nesting cap of 32, third PATCHES.md entry, regression at exactly the limit and one over). Systematic redaction proof: internal/securitytest AST inventory of every log/error/response-construction sink across cmd/ch-oauth-ldap, cmd/ch-jwt-verify, internal/* and the vendored ldapserver logger, keyed by stable fingerprints (zerolog fingerprint includes the field chain), cross-checked against testdata/redaction-sites.tsv (unmapped or stale rows fail go test), every credential-reachable row mapped to a real marker test at default AND trace level (serialized global-logger capture), SDK version/entrypoint audit that cannot pass vacuously, and a phase5release-tagged release gate. Docker HA fixture (integration/clickhouse/run-ha.sh: HAProxy lts-alpine pinned by digest in front of two helpers, rootless :389 preflight, show stat polling, ANSI-stripped delta Bind counts, persistent A-bound session probe, docker kill A → probe fails / B unchanged / new token authenticates via B → A recreated and readmitted via runtime DNS, HA leak scan incl. the killed replica's pre-kill log) plus tests/cases/ha-fallback-parity.sh. Scenario G' (<search_limit>256</search_limit> made explicit in the fixture, README and chart in lockstep; 257 mapped roles → per-build measured consequence auth_fails_on_size_limit_exceeded, HTTP 403, on 24.8 and 25.8; other lines fail closed). Operator guide docs/ch-oauth-ldap-operator-guide.md (ClickHouse XML copied from the fixture, OIDC/Auth0/JWKS, identity + Antalya-aligned role pipeline, cache invariant, measured Search-limit consequence, trust boundary with the recorded risk owner, HA claim boundary + Kubernetes runbook, capacity, nesting cap) with docs_contract_test.go keeping every marked fence an exact excerpt of an allow-listed source and enforcing required/forbidden wording; README/CLAUDE/integration-README/chart-README/PATCHES synced. Chart gate's untouched-path proof rescoped to the sidecar surface (production Go, tests excluded).

    • Decisions taken (not in the issue): the coordinator approved the plan under the human's standing authorization (see the Phase 5 note); SDK_REDACTION_AUTHORIZATION_GATE left for the human (both resolutions below); Kubernetes-only HA behavior explicitly not claimed — proven in Docker, runbook for a real cluster.

    • Deviations from the spec: none in scope; the issue's HA tests are satisfied in Docker terms with the Kubernetes convergence step documented as unverified here.

    • Definition of done: "two helper replicas work without shared state" — closed (Docker; Kubernetes convergence delegated to the runbook). "neither cache behavior nor logs can extend or leak bearer credentials" — cache half closed since phase 1; logs half closed for all first-party code, open for one externally-owned sink (the SDK kid row). Everything else was closed in phases 1–4 with the recorded ≥25.8 distributed-role qualification.

    • Open gate for the human — SDK_REDACTION_AUTHORIZATION_GATE: go-mcp-oauth-sdk v0.2.0 logs the unverified JWT header kid on successful JWKS rotation (oauth/jwt.go:117). Resolutions: (a) authorize an SDK fix + release, then one follow-up helper PR (bump go.mod, update auditedSDKVersion, re-audit every external-pinned row, flip the row to safe, reshape the rotation test to assert kid absence, phase5release gate green); (b) record kid as allowed non-credential metadata (row flips to safe citing the decision; rotation test asserts bearer/payload/signature absence only). Until one lands: row status merged — blocked on SDK_REDACTION_AUTHORIZATION_GATE, Phase 5 checkbox NOT ticked, and go test -tags phase5release ./internal/securitytest fails on exactly that one row by design.

    • Follow-ups filed: ci: add required PR-time Go/race/security gates; keep Docker ClickHouse matrix separate #23 (PR CI), ci: build-ch-jwt-verify.yml path filters omit the shared packages the sidecar compiles — published image goes stale #24 (sidecar workflow path filters), ch-jwt-verify image publication: refuse tag re-push and build from an exported HEAD tree (parity with ch-oauth-ldap, #25) #26 (sidecar image publication parity), Pushed external roles (push_external_roles_in_interserver_queries) are lost when the remote query reads through a normal VIEW ClickHouse/ClickHouse#116840, altinity-sql-browser#680, ClickHouse version compatibility: track upstream external-role fixes (#79099, #116840) and restore full 24.8 Altinity Stable support #30 (ClickHouse version compatibility tracker — restoring full 24.8 Altinity Stable support once a bugfix release backports #79099), LDAPS/TLS auth-proxy deployment mode: standalone ch-oauth-ldap on customer premises for any ClickHouse's native LDAP auth #31 (LDAPS/TLS auth-proxy deployment mode for on-premises ClickHouse — the ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 amendment's exit (a)).

    • Plan review: ChatGPT-authored, 5 Fable/high passes (session ed0c83e8-c85c-4d78-8fd2-79e5c8c29f8b); approved by the coordinator with 7 binding amendments under the human's standing authorization.

    • Review outcome: coordinator-run high-risk review (5 P2 + 9 P3, no P1, all fixed in 8762c18); ChatGPT pass 1 (e4833c5, fresh conversation https://chatgpt.com/c/6a92103d-8ed8-83ed-9293-5e1d7f19af04, session 183d9799-cbcc-44ec-8970-040cbfcaec1c): 1 P3 accepted and fixed in 64f4ba3 (docs-contract source allowlist enforced), 2 P2 rejected with reproduction. Pass 2 (64f4ba3): 1 finding, rejected on the facts (conflated two tests; no Debug/Trace log calls exist in internal/ldap production code; the vendored-logger check is a stdlib log path). No accepted findings on the final head → merged per the human's standing authorization.

    • Merged: cb46895 on origin/main (merge commit of PR feat(ch-oauth-ldap): phase 5 — LDAP hardening, redaction proof, Docker HA fixture, operator guide (#19 phase 5) #28 at head 64f4ba3, 2026-08-29). Gate closed: PR fix(#19): consume go-mcp-oauth-sdk v0.2.1 and close SDK_REDACTION_AUTHORIZATION_GATE #29 merged as 5628f6b (2026-08-29) — go-mcp-oauth-sdk v0.2.1, zero blocked_external rows, go test -tags phase5release ./internal/securitytest green; Phase 5 checkbox and the redaction test item ticked in the issue. Both push-to-main image workflows on cb46895 completed success (ch-oauth-ldap via internal/**; ch-jwt-verify via its new test file). Row stays merged — blocked on SDK_REDACTION_AUTHORIZATION_GATE and the Phase 5 checkbox stays unticked until the human resolves the gate (see above).

    Phase 4 — handoff

    • Human decision (2026-08-28, evening): after 5 real ChatGPT passes (every accepted finding fixed and coordinator-verified; the security-relevant chart surface clean since pass 1, passes 2–5 confined to the manual publish script / workflow guards) the human waived the remainder of the 6-pass budget, authorized merging feat(helm): ch-oauth-ldap deployment chart, image publication and acceptance gate (#19 phase 4) #25 as verified, and authorized proceeding to phase 5 unattended.

    • Landed: standalone Helm chart helm/ch-oauth-ldap/ (Deployment default 2 replicas +
      values-dev.yaml 1-replica override; ClusterIP Service 389→3389; rootless UID/GID 65532,
      read-only root FS, drop ALL, process listens on 3389 so no privileged bind; tcpSocket
      probes; requests 50m/64Mi, limits 500m/128Mi; rollout maxUnavailable: 0; soft pod
      anti-affinity; preStop /bin/sleep 5; config-checksum rollout annotation; PDB
      minAvailable: 1 when replicas > 1; default-on source-restricting NetworkPolicy;
      ConfigMaps for the helper YAML (exact cmd/ch-oauth-ldap/config.go shape) and the
      ClickHouse LDAP XML derived from the phase-3 working fixture with the Service DNS built
      from release namespace + clusterDomain); one central fail-closed validate helper
      (required inputs, forbidden ldap.listen, reserved chart labels/annotation, allow-all
      selector shapes); image publication path (Dockerfile.ch-oauth-ldap, manual multi-arch
      scripts/build-ch-oauth-ldap-image.sh mirroring scripts/build-image.sh, and
      .github/workflows/build-ch-oauth-ldap.yml — push-to-main only, path filters include
      internal/**/third_party/**, immutable ldap-<7-sha> tags, concurrency group,
      tag_prefix dispatch); committed gate helm/ch-oauth-ldap/test.sh + ci/lib/*.sh
      (helm lint/template permutations, negative matrix, kubeconform pinned v0.8.0 + schema
      commit 14355cdd…, embedded YAML/XML Go verifier, docs assertions, cross-compile both
      arches, old-chart smoke, untouched-path proof, packaging, self-SIGINT cleanup); docs
      synced in README.md, CLAUDE.md, helm/ch-oauth-ldap/README.md, repo-footguns.md.
      High + Large → decompose-and-implement loop (11 sub-tasks in 4 waves). Verified by the
      coordinator: gate PASS (0 failures), Go gate green, non-goal paths untouched,
      helm/ch-jwt-verify renders byte-identically to a pre-phase baseline.

    • Decisions taken (not in the issue): the recorded transport-security decision above
      (environment-level plaintext ClusterIP with named risk acceptance) and its binding
      consequences; process port 3389 + Service 389 instead of a privileged bind; NetworkPolicy
      default-ON (the issue said "recommend"; the recorded decision made it a compensating
      control) with enabled=false as the documented CNI escape hatch (A1: probe reachability
      under the policy is CNI-dependent and unverified without a cluster); image publication
      built in this phase rather than left as a prerequisite (the chart is not honestly
      deployable without an image); kubeconform tool + schema pinned for reproducible schema
      validation.

    • Deviations from the spec: none from the issue's phase-4 checklist; the plan itself
      was approved by the human WITH seven amendments (A1–A7) after the plan loop ended
      needs_human — all implemented.

    • Deferred acceptance criteria: none of the global DoD claimed; "two helper replicas
      work without shared state" is enabled here and proven in phase 5. No live-cluster
      verification was possible
      (kind blocked by the sandbox's privileged-container
      isolator): probe-vs-NetworkPolicy behavior per CNI and real HA remain unverified here.

    • Follow-ups filed: ci: build-ch-jwt-verify.yml path filters omit the shared packages the sidecar compiles — published image goes stale #24 (sidecar workflow path filters omit internal/**); ci: add required PR-time Go/race/security gates; keep Docker ClickHouse matrix separate #23 (PR CI)
      already filed in phase 3. Proposed ADR ADR: Add LDAP↔OAuth bridge for ephemeral ClickHouse users and dynamic role mapping #16 amendment + issue Implement LDAP OAuth helper for ephemeral ClickHouse users and dynamic roles #19 edits handed to the human.

    • Plan review: ChatGPT-author / Fable-high; first run BLOCKED on the transport
      decision (correctly), second run needs_human after 5 passes with substance
      verified-correct; human approved with amendments. Conversations
      https://chatgpt.com/c/6a916a93-dc34-83eb-9f83-a224773d058a (blocked run) and
      https://chatgpt.com/c/6a916da2-3294-83eb-ac2d-d572e7f27ade (session
      1d67aa60-af7a-4782-baf0-ca966fe21cbc).

    • Internal pre-PR review (High-risk + Large → mandatory): Fable/high read-only pass over
      the complete branch diff found 4 HIGH / 1 MEDIUM / ~8 LOW, all accepted and fixed before
      the PR. The HIGHs: (a) a newline in any XML-bound value (e.g. group_base_dn) escaped the
      ClickHouse ConfigMap's block scalar and rendered an arbitrary extra resource — reproduced
      as a LoadBalancer Service selecting the helper pods, defeating the "public exposure
      cannot be selected" invariant → newline guard in validate + XML emitted via a quoted
      variable; (b) unquoted scalar interpolations in the Deployment let priorityClassName
      inject hostNetwork: true (node-IP exposure of the plaintext LDAP port) → every scalar
      quoted, ints coerced, names/keys regex-validated; (c) the manual image script's
      umask 077 produced a 0700 root-owned binary that UID 65532 cannot execute (CI-built
      images unaffected) → explicit chmod 0755 + static gate assertion; (d) kubeconform/render
      failures in the positive matrix ran inside $(…) subshells so GATE RESULT: PASS was
      printed regardless — reproduced with a stub kubeconform → renders written to deterministic
      paths, failures counted in the parent. MEDIUM: a DoesNotExist-only selector passed
      validation yet matched all pods/namespaces → rejected + claims reworded. Every category
      else (exposure knobs, NetworkPolicy AND-peer semantics, YAML/XML escaping round-trips,
      rootless 3389 end to end, image path parity/immutability, docs vs constants) verified clean.

    • Review outcome: in progress — PR feat(helm): ch-oauth-ldap deployment chart, image publication and acceptance gate (#19 phase 4) #25 opened at head 972504f (2026-08-28); ChatGPT
      code-review loop running (up to 6 passes per the human's standing instruction). Pass 1
      (972504f): 2 findings fixed in c1f40c5. Pass 2 (c1f40c5): 2 MAJOR — publish script
      now builds from a git archive HEAD export; script+workflow refuse to re-push an existing
      tag; README states the real guarantee; sidecar-path parity filed as ch-jwt-verify image publication: refuse tag re-push and build from an exported HEAD tree (parity with ch-oauth-ldap, #25) #26; fixed in
      4c4d3a0. Pass 3 (4c4d3a0): 3 MAJOR + 1 MINOR fixed in 61d5a08 (per-arch republish
      guard, script self-re-exec from HEAD, digest-form image.tag, dirty-tree flag); the
      coordinator then found the self-re-exec broken in the realistic invocation and had it fixed
      in 01e8164 with a no-env gate case. Pass 4 (01e8164): 2 MAJOR fixed in a72a021
      (fail-closed tag existence checks re-checked before every registry mutation; PID-bound
      self-re-exec markers). Pass 5 on a72a021: first attempt 2026-08-28 ~16:55Z hit a ChatGPT rate limit before any review was submitted (no pass consumed, no comment); retried per the human's instruction in a brand-new ChatGPT conversation: reviewed a72a021, 1 MAJOR confirmed (the workflow's tag-existence guards were not errexit-safe under the runner's bash -e, so every first publication would have failed; the manual script was unaffected) — fixed in 23e0192 with a gate case that executes the extracted step bodies under bash -eo pipefail; pass 6 (23e0192, fresh conversation): 1 finding — the per-arch TOCTOU window between the pre-build tag check and docker/build-push-action's push — rejected as the explicitly documented, accepted limitation (no registry-side conditional create/lock; the workflow header and both READMEs already scope the guarantee to check-time refusal). No accepted findings. Six passes total, five real reviews; every accepted finding fixed and coordinator-verified; final head 23e0192.

    • Merged: 9a5ebc7 on origin/main (merge commit of PR feat(helm): ch-oauth-ldap deployment chart, image publication and acceptance gate (#19 phase 4) #25 at head 23e0192, 2026-08-28), per the human's explicit authorization; feat/19-phase4-deployment and wip/phase4-deployment deleted. Phase 5 branch feat/19-phase5-verification cut at 9a5ebc7.

    • Post-merge hotfix (2026-08-28): the first push-triggered runs of .github/workflows/build-ch-oauth-ldap.yml on main failed instantly with "workflow file issue": a bash comment inside the manifest job's run: body (added by the pass-5 fix 23e0192) contained the literal text ${{ }}, which GitHub evaluates as an (empty, invalid) expression before bash runs. The gate's plain-YAML parse cannot see this; actionlint does (:218:686 unexpected end of input … [expression]). Hotfix on its own branch/PR (fix(ci): remove literal expression text that invalidated build-ch-oauth-ldap.yml; gate workflows with actionlint #27, merged as e01c2b4): reworded comment + actionlint (pinned v1.7.7, fail-closed) added to helm/ch-oauth-ldap/test.sh with a negative case; ChatGPT review skipped for this one-line-cause hotfix under the human's standing merge authorization (Agent Chrome was occupied by the phase-5 plan loop); verified by the push-to-main run on e01c2b4 (run 33196520121: build amd64 + arm64 + manifest all green) — published ghcr.io/altinity/ch-oauth-ldap:ldap-e01c2b4 (amd64+arm64 manifest list confirmed with docker manifest inspect; the two extra unknown entries are build-push-action provenance attestations).

  2. added 14 commits that reference this issue on Aug 27, 2026
  3. 61 remaining items

  4. added a commit that references this issue on Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0