Skip to content

feat(training-agent): add private GCS reporting with SDK 15.2 - #8012

Merged
bokelley merged 9 commits into
mainfrom
bokelley/training-agent-gcs-rollout
Oct 9, 2026
Merged

bokelley merged 9 commits into
mainfrom
bokelley/training-agent-gcs-rollout

Conversation

@bokelley

@bokelley bokelley commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Private training reporting needs durable GCS delivery, authenticated destination ownership and independent buyer receipts. This adopts the published SDK 15.2 production reporting composer and GCS adapter, publishing committed training-ledger revisions under frozen account/source/destination grants and contract pins. Missing source coverage remains retryable.

Core, managed delivery, object-write authority, notification recovery and installation bindings share an isolated schema on the application PostgreSQL primary. Worker startup, bounded recovery and graceful drain use the existing Fly lifecycle. Reporting availability gates /ready; /health retains its database/liveness behavior without awaiting GCS. The buyer CLI uses official MCP, a scoped keyless reader and buyer-owned durable state. WorkOS Connect sign-in and the public PKCE helper are included from merged PR #8039. Each request requires a native resource-bound user token, current direct WorkOS owner/admin membership and an exact local authorization grant; dependency outages return 503 with fixed safe log classifications. Buyer credentials remain outside the synced repository, refresh rotation is serialized, and API-key creation stays fenced.

Both TRAINING_REPORTING_GCS_ENABLED and TRAINING_BUYER_OAUTH_ENABLED remain false. Migration 620 installs the SDK authority tables and host bindings after the existing OAuth migrations 618/619. A separate operator has provisioned training_reporting_gcs on the actual managed primary, owned by schema_admin, with PUBLIC privileges revoked. The migration intentionally rejects an absent namespace and requires no new database-wide CREATE grant. CI workflows provision that prerequisite in disposable databases; those workflow paths require human review. The README and canonical agent guide require local bootstrap before app startup, and the manual deployment checklist requires the same prerequisite before deployment or migrations, and the runbook makes namespace provisioning an unconditional prerequisite for local, staging, fresh Fly and disaster recovery environments, including when reporting is disabled. The local procedure preserves existing installation state and refuses an unexpected owner.

Validation:

  • Required commit checks passed on current head 8f3708fed: 1,106 root tests, all 12 buyer-login tests, both typechecks and boundary guards. The CodeQL fix replaces the redirect test's URL-prefix comparison with parsed-origin membership in the exact allowed-origin set. The test covers bounded refresh/REST responses and redirect refusal without following unexpected origins. CodeQL analysis and the security gate passed on this exact head; GitHub automatically resolved the finding, leaving zero unresolved threads at inspection. Other fresh exact-head CI remains running. The immediately preceding bootstrap commit 2e846b7dc also passed all 744 server unit files (12,430 tests, 31 existing skips); all three shards passed without a rerun. The checklist-only commit preserved that server source; the subsequent combined buyer tree also passed all 746 server files (12,482 unique tests, 31 existing skips) at 67f485616, with two HTTP teardown timeouts passing the repository hook's supported isolated eight-test rerun. The current test-only fix runs the changed buyer-login file through the repository's scoped hook. The merged lockfile uses patched proxy-addr 2.0.8; all four proxy spoofing regressions passed. Earlier runs with stale dependencies are excluded from qualification.
  • The documented local bootstrap was executed against a fresh disposable PostgreSQL database. Migration 620 passed after provisioning; repeating bootstrap preserved installation UUID/tables/owner; an unexpected owner was refused without modifying ownership. The owned fixture database was removed.
  • Eight real PostgreSQL / HTTP MCP reporting integration tests passed after synchronization and migration renumbering. Coverage includes authority probes, authenticated provisioning/replay, an earned receipt, retry, reconstruction, drain and modeled revocation. WorkOS/GCS provider ports are controlled in this suite.
  • The earlier separate controlled real-GCS application integration passed eight tests, including actual native-generation 404 and dedicated identities; its historical source/WorkOS fixtures remained modeled. Owned fixture resources and temporary grants were removed.
  • Health/readiness regression tests cover failed, throwing and stalled GCS probes. The published SDK archive matches the handoff digest, and the TypeScript response probe retains all 125 observations and the existing raw schema finding. This PR does not change released semver artifacts or the protocol package surface.

Live IAM preparation is complete in adcp-production. The fresh bucket adcp-training-reporting-20261009-7c681d2e has uniform access, enforced public-access prevention, zero soft-delete retention and no versions/lifecycle/retention policy/holds. Exact Fly app/organization and WorkOS buyer user/organization/client/audience federation providers are active. Project and organization IAM remained unchanged; neither dedicated service account has a user-managed key or operator impersonation grant.

Real Google exchange and runtime impersonation passed on both current web machines and the worker. Effective authority is exactly bucket metadata plus object create/get/delete. Native write/read/delete passed; listing, metadata mutation and IAM reads are denied. The deleted probe generation returned actual 404, and independent operator REST listing found zero probe objects. This checks runtime cleanup, rather than business-generation revocation. The separate WorkOS reader passed Google exchange/impersonation and has no bucket authority before its authoritative-prefix/deadline grant. Original project-owner bucket-management authority is retained; editor/viewer/object-owner convenience bindings are removed.

The corrected external-account configuration is staged without a deployment/restart (SHA-256 cf1b65d11462916943a3d737aeba8b52db9e24adf3e6c15e36c02b392a224423). Qualification uses the production Storage credential-file loading and Google's executable argument parser. No private key or user ADC is deployed. Credential mounting and buyer sign-in from PR #8039 are now included in this PR. Native WorkOS code exchange, resource-bound refresh and RS256 verification passed; four real PostgreSQL / HTTP MCP buyer-auth integration cases passed with modeled provider ports. The mounted credential configuration still needs qualification in the actual deployed image. The selected buyer has no organization API key and currently lacks the direct owner/admin authority required by the buyer authorization fence; the approved 72-hour temporary access window has not started.

Rollout is authorized, with repository review/check gates preserved. After exact-head main-base checks and reviewed landing, the real private closed-day canary must still qualify configured image startup, delivery, independent receipts/checkpoints, signed webhook/polling repair, Fly restart/shutdown/capacity and revoked business generations while reader authority remains valid. Reporting migration, temporary access activation and enabled deployment have not occurred. Preserve durable producer state and tombstones throughout recovery/cleanup. The SDK umbrella work remains tracked in adcontextprotocol/adcp-client#3027.


Open workspace in Conductor

@bokelley
bokelley force-pushed the bokelley/training-agent-gcs-rollout branch from d545464 to 00e5385 Compare October 8, 2026 11:51
@bokelley
bokelley marked this pull request as ready for review October 9, 2026 01:32
Comment thread server/src/http.ts Resolved

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated workflow files require human/CODEOWNERS review that is not yet present.

Gate: This PR modifies .github/workflows/build-check.yml and .github/workflows/migration-smoke-test.yml, which match the repo's gated-path globs (gated_paths: true). Per decision-table row 2, gated_paths: true with review_decision: REVIEW_REQUIRED (not APPROVED) forces escalation. A human/CODEOWNERS approval lifts this gate.

Medium findings (non-blocking, but worth the reviewer's eyes):

  • server/src/http.ts:3205 — Reporting probe gates /health (not just /ready) and couples liveness to live GCS I/O, so a GCS reachability blip could cause web/worker restarts when the feature is enabled.
  • server/src/db/migrations/619_training_gcs_reporting.sql:8 — Migration 619's schema precondition RAISE EXCEPTION is not flag-gated; a missing DBA CREATE SCHEMA step hard-fails the entire release_command chain on the next deploy.

No Critical/High findings. Multi-tenant isolation, dispatch boundary, no-store auth-gated routes, released-artifact immutability, and changeset scope were all verified clean (operational/app PR, no static/schemas/source/** drift, so no changeset required).

Escalation reason: Gated workflow files (.github/workflows/**) touched without an APPROVED review decision. Human/CODEOWNERS sign-off required before merge.

Medium findings

  • server/src/http.ts:3205 — Reporting probe gates /health (not just /ready) and couples liveness to live GCS I/O
  • server/src/db/migrations/619_training_gcs_reporting.sql:8 — Migration 619 schema precondition is not flag-gated; missing DBA step hard-fails the whole deploy

Why human review

  • Modifies gated workflow files .github/workflows/build-check.yml and .github/workflows/migration-smoke-test.yml (matches .github/workflows/** hard approval gate) while review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS review required.
  • This PR touches a path under a hard, non-overridable approval gate (.github/workflows/build-check.yml (modified) matches .github/workflows/**; .github/workflows/migration-smoke-test.yml (modified) matches .github/workflows/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@aao-secretariat aao-secretariat Bot added the ladon/needs-human-review Ladon has escalated this PR for human review. label Oct 9, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated workflow files touched and review not yet approved.

Gated paths (hard approval gate): This PR modifies .github/workflows/build-check.yml and .github/workflows/migration-smoke-test.yml, both matching .github/workflows/** under a hard, non-overridable approval gate. review_decision is REVIEW_REQUIRED, not APPROVED. Per decision rule row 2, the outcome must be escalate — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

Progress since prior run: Prior finding #1 (http.ts reporting probe gating /health) is resolved — the req.path === '/ready' guard now confines GCS I/O to readiness and /health is database-only. Net improvement, credited.

Medium findings (non-blocking):

  • server/src/db/migrations/620_training_gcs_reporting.sql:8 — Migration 620 schema precondition hard-fails the startup migration runner and is not gated by TRAINING_REPORTING_GCS_ENABLED; CI now provisions it, but DR/local/fresh-volume paths can brick startup for a disabled feature. (Re-surfaced from prior run on renumbered migration.)

No new Critical/High findings. The delta is otherwise dominated by rebase drift from main (SDK agent-oauth, dist/compliance 3.1.27, daypart/changeset files from other merged PRs), not PR #8012 code. Once a human/CODEOWNERS approval lands, this falls through to the normal table.

Escalation reasons:

  • Modifies gated workflow files under .github/workflows/** (hard approval gate) while review_decision is REVIEW_REQUIRED — human/CODEOWNERS review required.

Medium findings

  • server/src/db/migrations/620_training_gcs_reporting.sql:8 — Migration 620 schema precondition hard-fails startup; not flag-gated

Why human review

  • Modifies gated workflow files .github/workflows/build-check.yml and .github/workflows/migration-smoke-test.yml (matches .github/workflows/** hard approval gate) while review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS review required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (.github/workflows/build-check.yml (modified) matches .github/workflows/**; .github/workflows/migration-smoke-test.yml (modified) matches .github/workflows/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated paths touched without an approving review.

This PR modifies files under the hard, non-overridable approval gate (.github/workflows/** and .agents/**) while review_decision is REVIEW_REQUIRED, not APPROVED. Per decision rule row 2 (gated_paths: true AND review_decision ≠ APPROVED), the outcome must be escalate. A human/CODEOWNERS approval is required before merge regardless of how clean the diff is.

Gated files:

  • .agents/playbook.md (matches .agents/**)
  • .github/workflows/build-check.yml (matches .github/workflows/**)
  • .github/workflows/migration-smoke-test.yml (matches .github/workflows/**)

Iteration note: The current delta is documentation-only (playbook.md, README.md, training-agent-gcs-reporting.md), adding a "Database bootstrap prerequisite" section and local bootstrap procedure for migration 620. The reviewer verified the docs are coherent with the migration's RAISE EXCEPTION preconditions, the bootstrap SQL correctly refuses a foreign owner and preserves existing schema/authority, and all cross-file anchors resolve. No new findings. This delta is the accurate documentation mitigation for the prior Medium (620_training_gcs_reporting.sql:8 hard-fail), whose file is absent from this delta.

No blocking findings — the escalation is driven solely by the unsatisfied gated-paths approval requirement, not by code defects. Once a human/CODEOWNERS approval is recorded, this PR can fall through to the normal decision table.

Escalation reasons:

  • Touches gated workflow/agent files (.github/workflows/**, .agents/**) while review_decision is REVIEW_REQUIRED — human/CODEOWNERS review required before merge.

Why human review

  • Modifies gated files under hard approval gate (.agents/playbook.md matches .agents/; .github/workflows/build-check.yml and .github/workflows/migration-smoke-test.yml match .github/workflows/) while review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (.agents/playbook.md (modified) matches .agents/**; .github/workflows/build-check.yml (modified) matches .github/workflows/**; .github/workflows/migration-smoke-test.yml (modified) matches .github/workflows/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated workflow/agent files require human/CODEOWNERS approval.

This PR modifies files under a hard, non-overridable approval gate (.agents/**, .github/workflows/**) while review_decision is REVIEW_REQUIRED, not APPROVED. Decision rule row 2 (gated_paths true AND review_decision ≠ APPROVED) forces escalation until a human/CODEOWNERS approval is recorded — regardless of how clean the diff is.

The current delta is documentation-only across four files (.agents/playbook.md, PRODUCTION_CHECKLIST.md, README.md, docs/runbooks/training-agent-gcs-reporting.md), responding to the prior Medium by documenting migration 620's mandatory namespace bootstrap at every fresh-DB entry point. The reviewer verified the checkable claims (local bootstrap role/db match docker-compose, the DO-block owner guard plus idempotent CREATE SCHEMA ... AUTHORIZATION adcp is sound, --wait relies on the present pg_isready healthcheck, and all anchor/relative links resolve) and surfaced no new findings. This is a net improvement over the prior pass. But the gate stands on the file paths, not the diff content.

Escalation reasons

  • Gated files modified while review is not APPROVED: .agents/playbook.md, .github/workflows/build-check.yml, .github/workflows/migration-smoke-test.yml (match .agents/** and .github/workflows/**). Human/CODEOWNERS approval required before merge.

Why human review

  • Modifies gated files .agents/playbook.md, .github/workflows/build-check.yml, and .github/workflows/migration-smoke-test.yml (match .agents/** and .github/workflows/** hard approval gate) while review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS review required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (.agents/playbook.md (modified) matches .agents/**; .github/workflows/build-check.yml (modified) matches .github/workflows/**; .github/workflows/migration-smoke-test.yml (modified) matches .github/workflows/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

… credentials (#8039)

* feat(training-agent): support WorkOS buyer sign-in for private reporting

* fix(training-agent): bound buyer refresh and reporting requests

* fix(training-agent): reuse short-lived WorkOS buyer tokens

* chore(training-agent): stage keyless Fly reporting credentials

* fix(training-agent): log sanitized buyer authorization outages

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated paths require human/CODEOWNERS approval.

This PR modifies files under hard, non-overridable approval gates (.agents/** and .github/workflows/**) while review_decision is REVIEW_REQUIRED, not APPROVED. Per decision rule row 2, this forces escalation regardless of how clean the diff is.

The reviewer reported a clean pass with no Critical/High/Medium findings — the new buyer-OAuth core is layered and fail-closed (pinned issuer/audience/RS256, maxTokenAge, M2M rejection, exact-grant role check, revocation TOCTOU recheck, timeout-bounded I/O, O_NOFOLLOW/0600 private file handling, OAuth gated to the canonical /sales tenant disabled by default). The migration (620_training_gcs_reporting.sql) is an added file. No code-level blockers exist; the only barrier to merge is the pending human/CODEOWNERS approval on the gated workflow/agent files.

Escalation reasons

  • Modifies .agents/playbook.md, .github/workflows/build-check.yml, and .github/workflows/migration-smoke-test.yml under the .agents/** and .github/workflows/** hard approval gate while review_decision is REVIEW_REQUIRED — a human/CODEOWNERS approval must be recorded before merge.

Why human review

  • Modifies gated files .agents/playbook.md, .github/workflows/build-check.yml, and .github/workflows/migration-smoke-test.yml (match .agents/** and .github/workflows/** hard approval gate) while review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS review required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (.agents/playbook.md (modified) matches .agents/**; .github/workflows/build-check.yml (modified) matches .github/workflows/**; .github/workflows/migration-smoke-test.yml (modified) matches .github/workflows/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@bokelley
bokelley merged commit 53523b0 into main Oct 9, 2026
64 checks passed
@bokelley
bokelley deleted the bokelley/training-agent-gcs-rollout branch October 9, 2026 12:23
bokelley added a commit that referenced this pull request Oct 9, 2026
Add impressions-optional delivery rows (#8108) to the versioning
exceptions and migration guide, expected_confirmation_at on
refine_proposals (#8104), SDK implementation metadata (#8079),
unsupported-targeting-dimension details (#8052), experimental trust.json
schemas (#8067), the Reliable Reporting compaction notice and
REVISION_UNREADABLE (#8100, #8099), the sales-broadcast-tv 1.1.0
tightening (#8046), new signing and canonicalization vectors (#8068,
#8076), and training-agent fixtures (#8106, #8078, #8012). Regenerate
the In-review table from the 56 open 3.3.0 milestone issues.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ladon/needs-human-review Ladon has escalated this PR for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants