docs: commit ADR decision log + refresh CONTEXT.md for the wso2cloud work#38
docs: commit ADR decision log + refresh CONTEXT.md for the wso2cloud work#38kaje94 wants to merge 9 commits into
Conversation
…oud work Captures the architectural decisions and domain language behind the recent wso2cloud-integration + local-setup work so future contributors (and agents) have a concise, accurate reference. ADRs (docs/adr/ — committed for the first time; CONTEXT.md already linked them): - 0001 coding-agent off the workflow-plane - 0002 local sm-api stub (now marked superseded by 0004) - 0003 coding-agent dispatched via cluster-gateway-proxy - 0004 local sm-api is an in-repo stub, not the cloud binary (supersedes 0002) - 0005 reference the per-org namespaced ComponentType; provision it locally - 0006 dual-mode OC auth: forward user JWT; impersonate org on M2M calls - 0007 build git credentials via OpenChoreo, not a direct in-cluster write CONTEXT.md: corrected entries that had gone stale against shipped code (cluster-gateway-proxy now JWT-authed in cloud; Task JWT → publisher client-credentials runner auth is implemented; SM-API local is an in-repo stub; GitSecret via OC CreateGitSecret), removed dangling [[adr-…]] links to ADRs that were never written, and added load-bearing terms (service identity / X-Impersonate-Org, publisher cc runner auth, ComponentType vs ClusterComponentType, AGENT_CLUSTER_SECRET_STORE/secretstore-read, repair-secrets, project_id per-org uniqueness). .gitignore: ignore deployments-v2/ (local scratch + secrets) and SESSION.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR updates app-factory documentation to reflect architectural refinements across platform planes and operational patterns. It adds gitignore rules for local development artifacts, revises the domain glossary in CONTEXT.md to clarify project model semantics, component type distinctions, secrets delivery workflows, SM API contract, gateway proxy authentication, and identity/routing rules. Seven ADRs formalize decisions: relocating coding-agent WorkflowRuns to the data plane; implementing a local SM API stub; switching coding-agent dispatch to Kubernetes Jobs via cluster-gateway-proxy; provisioning namespaced ComponentTypes locally; establishing dual-mode OpenChoreo authentication; and documenting build Git secret delivery through OpenChoreo with per-org SecretReference refresh. No code changes or exported entities are altered. Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
CONTEXT.md (1)
25-29:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUse “Job” terminology here to match the dispatch model documented below.
This paragraph says coding-agent “WorkflowRun pods run,” but later sections describe Job-based dispatch through
cluster-gateway-proxy. Updating this wording will remove internal ambiguity.As per coding guidelines, "Provide concise, actionable feedback focused on correctness and best practices."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@CONTEXT.md` around lines 25 - 29, Replace the phrase that says coding-agent “WorkflowRun pods run” in the remote-worker NS paragraph with Job-oriented wording to match the documented dispatch model: reference the coding-agent dispatches Jobs (not WorkflowRun pods) via cluster-gateway-proxy to the wc-<orgUUID8>-<orgHash8>-remote-worker namespace. Update the sentence in CONTEXT.md under the "remote-worker NS" section to use “Jobs” (or “Job-based dispatch”) and mention cluster-gateway-proxy and coding-agent to remove ambiguity and align terminology with the rest of the doc.Source: Coding guidelines
🧹 Nitpick comments (4)
docs/adr/0005-namespaced-componenttype-local-provisioning.md (1)
46-46: ⚡ Quick winMake cross-PR dependency text self-describing.
Line 46 (“PR
#36+#37”) is terse. Consider replacing it with a short phrase describing what each PR contributes, so the ADR remains understandable without opening both PRs.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/adr/0005-namespaced-componenttype-local-provisioning.md` at line 46, Replace the terse cross-PR reference "PR `#36` + `#37`." with a self-describing phrase that summarizes each PR's contribution (e.g., "PR `#36`: add namespaced ComponentType schema; PR `#37`: implement local provisioning backend"), so readers can understand the intent without opening the PRs; update the sentence at the location containing "PR `#36` + `#37`." in the ADR text accordingly to include brief descriptions for both PRs.docs/adr/0001-coding-agent-off-workflow-plane.md (1)
42-43: ⚡ Quick winAlign workload characterization across sections.
Line 42 labels coding-agent as “CI-style ephemeral compute,” but Lines 31–33 describe it as long-running and interactive. Please use one consistent characterization to avoid ambiguity in the decision rationale and runbook guidance.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/adr/0001-coding-agent-off-workflow-plane.md` around lines 42 - 43, The document inconsistently describes "coding-agent" as both “CI-style ephemeral compute” and “long-running and interactive”; pick one consistent characterization (either ephemeral CI-style or long-running interactive) and update every occurrence to match—specifically edit the phrase in the decision rationale and the runbook sections so the label used around the existing "coding-agent" references and the sentence currently saying “CI-style ephemeral compute” (and the sentences describing it as long-running/interactive) are unified; ensure any guidance that depends on that characterization (quota/PSP review notes) is adjusted to reflect the chosen model.docs/adr/0007-build-git-secret-via-openchoreo.md (1)
34-40: ⚡ Quick winAdd a clear exit condition for the interim cloud fallback.
Please add one explicit “remove when” condition (e.g., route available + validation step) so this temporary behavior is easier to retire and audit.
As per coding guidelines, "Provide concise, actionable feedback focused on correctness and best practices. Avoid unnecessary detail or speculation."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/adr/0007-build-git-secret-via-openchoreo.md` around lines 34 - 40, Update the "Interim" paragraph to include a single explicit "Remove when" condition that states the temporary fallback should be removed once the platform-api route `/api/v1alpha1/gitsecrets` is available and server-side validation for git secret creation (including ownership checks that previously returned ErrRepoNotInOrg and ErrOrgDisconnected) succeeds; reference the tracking issue wso2-enterprise/wso2cloud#319 and the env toggle `GITHUB_REPO_VISIBILITY` so auditors can verify the condition was met before reverting to strict secret provisioning.Source: Coding guidelines
docs/adr/0004-local-sm-api-in-repo-stub.md (1)
38-40: ⚡ Quick winDocument an explicit local-only execution guard for unsigned JWT decoding.
Please add a short constraint stating this behavior is restricted to local/dev and must fail closed outside that mode. This keeps the ADR’s safety boundary unambiguous for future implementers.
Suggested doc patch
- with the root token (vs the real ESO + k8s-SA flow), and it decodes the JWT - without signature verification (single-tenant local — `ouId` only scopes the - namespace). + with the root token (vs the real ESO + k8s-SA flow), and it decodes the JWT + without signature verification (single-tenant local — `ouId` only scopes the + namespace). This mode is local/dev only and must be gated by explicit + environment checks so non-local environments reject startup if this path is enabled.As per coding guidelines, "Use neutral, high-level language and validate safety without exposing sensitive context."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/adr/0004-local-sm-api-in-repo-stub.md` around lines 38 - 40, Add a short, explicit constraint in the ADR stating that decoding JWTs without signature verification is allowed only in local/dev mode and must be guarded by a runtime/local-only flag so it fails closed in non-local environments; reference the unsigned JWT decoding behavior and the use of ouId as namespace scoping, and state that any implementation of the "root token" local flow must include an environment check (local/dev) and reject unsigned JWTs elsewhere.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CONTEXT.md`:
- Around line 116-123: Update the glossary entry to reflect the implemented
contract: change the cloud default from "secretstore-read" to
"application-secrets-read" for the ESO ClusterSecretStore used by per-run
coding-agent ExternalSecrets, state that application-secrets-read grants access
to user-app-secrets/<org>/cred-* (AppRole approle-creds-read-permission), and
note that secretstore-read is a no-op in cloud; update the
AGENT_CLUSTER_SECRET_STORE, secretstore-read, application-secrets-read and
user-app-secrets/<org>/cred-* references so they align with the implemented
behavior.
In `@docs/adr/0003-coding-agent-via-cluster-gateway-proxy.md`:
- Around line 43-47: The ADR currently contradicts itself about proxy auth (one
place says JWT-authenticated while another says "proxy is un-authed today" and
the line "No new credentials to provision."); pick the single ground-truth
contract (either JWT-authenticated or unauthenticated) and make the document
consistent by updating all mentions accordingly—specifically edit the paragraph
referencing CLUSTER_GATEWAY_PROXY_ALLOWED_CRS, the sentence "No new credentials
to provision.", and any occurrences of "un-authed" or "JWT-authed" so they state
the chosen contract and the resulting operational impact (e.g., whether M2M
clients, token-minting, or JWKS wiring are required). Ensure the final text
clearly states the auth model and its implications for credential provisioning.
- Around line 66-67: The text references a misspelled repository/path
`wso2cloud-deployement-main/dataplane/.../cluster-workflows/`; update that path
to the correct spelling
`wso2cloud-deployment-main/dataplane/.../cluster-workflows/` and ensure the note
still states the Job template moves into `app-factory` so readers can locate the
retired ClusterWorkflow correctly.
---
Outside diff comments:
In `@CONTEXT.md`:
- Around line 25-29: Replace the phrase that says coding-agent “WorkflowRun pods
run” in the remote-worker NS paragraph with Job-oriented wording to match the
documented dispatch model: reference the coding-agent dispatches Jobs (not
WorkflowRun pods) via cluster-gateway-proxy to the
wc-<orgUUID8>-<orgHash8>-remote-worker namespace. Update the sentence in
CONTEXT.md under the "remote-worker NS" section to use “Jobs” (or “Job-based
dispatch”) and mention cluster-gateway-proxy and coding-agent to remove
ambiguity and align terminology with the rest of the doc.
---
Nitpick comments:
In `@docs/adr/0001-coding-agent-off-workflow-plane.md`:
- Around line 42-43: The document inconsistently describes "coding-agent" as
both “CI-style ephemeral compute” and “long-running and interactive”; pick one
consistent characterization (either ephemeral CI-style or long-running
interactive) and update every occurrence to match—specifically edit the phrase
in the decision rationale and the runbook sections so the label used around the
existing "coding-agent" references and the sentence currently saying “CI-style
ephemeral compute” (and the sentences describing it as long-running/interactive)
are unified; ensure any guidance that depends on that characterization
(quota/PSP review notes) is adjusted to reflect the chosen model.
In `@docs/adr/0004-local-sm-api-in-repo-stub.md`:
- Around line 38-40: Add a short, explicit constraint in the ADR stating that
decoding JWTs without signature verification is allowed only in local/dev mode
and must be guarded by a runtime/local-only flag so it fails closed in non-local
environments; reference the unsigned JWT decoding behavior and the use of ouId
as namespace scoping, and state that any implementation of the "root token"
local flow must include an environment check (local/dev) and reject unsigned
JWTs elsewhere.
In `@docs/adr/0005-namespaced-componenttype-local-provisioning.md`:
- Line 46: Replace the terse cross-PR reference "PR `#36` + `#37`." with a
self-describing phrase that summarizes each PR's contribution (e.g., "PR `#36`:
add namespaced ComponentType schema; PR `#37`: implement local provisioning
backend"), so readers can understand the intent without opening the PRs; update
the sentence at the location containing "PR `#36` + `#37`." in the ADR text
accordingly to include brief descriptions for both PRs.
In `@docs/adr/0007-build-git-secret-via-openchoreo.md`:
- Around line 34-40: Update the "Interim" paragraph to include a single explicit
"Remove when" condition that states the temporary fallback should be removed
once the platform-api route `/api/v1alpha1/gitsecrets` is available and
server-side validation for git secret creation (including ownership checks that
previously returned ErrRepoNotInOrg and ErrOrgDisconnected) succeeds; reference
the tracking issue wso2-enterprise/wso2cloud#319 and the env toggle
`GITHUB_REPO_VISIBILITY` so auditors can verify the condition was met before
reverting to strict secret provisioning.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d5d12495-fae2-49b4-9ca9-45c4b6eb80e0
📒 Files selected for processing (9)
.gitignoreCONTEXT.mddocs/adr/0001-coding-agent-off-workflow-plane.mddocs/adr/0002-local-sm-api-stub.mddocs/adr/0003-coding-agent-via-cluster-gateway-proxy.mddocs/adr/0004-local-sm-api-in-repo-stub.mddocs/adr/0005-namespaced-componenttype-local-provisioning.mddocs/adr/0006-dual-mode-oc-auth-impersonation.mddocs/adr/0007-build-git-secret-via-openchoreo.md
…in-process services - Deleted the `asdlc-service/clients/gitservice/` directory and all related files. - Replaced all instances of `gitservice.Client` with direct calls to in-process services. - Collapsed `AGENT_GIT_SERVICE_URL` into `AGENT_PLATFORM_URL` and removed `GIT_SERVICE_BASE_URL`. - Updated configuration and deployment files to reflect the removal of gitservice-related settings. - Ensured all consumers are properly wired to the new service structure, maintaining existing functionality. - Conducted a thorough test plan to verify the integrity of the application post-changes.
…into docs/refresh-context-adrs
…er contiguous 0002 and 0004 were the same decision (local sm-api) at two points in time, and docs/adr/ was never committed before #38 — so no published history to preserve. Collapse them into a single self-contained ADR-0002 'Local SM-API is an in-repo stub' that states the final decision (SM-API provider in both envs + in-repo stub) with the openbao-provider and real-cloud-binary approaches as rejected alternatives. Kept number 0002 so the existing 'ADR-0002' code comments stay valid; renumbered the tail (0005-0007 → 0004-0006) for a contiguous log. All [[adr-…]] links are slug-based and still resolve. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…icit ADR-0006: lead the interim consequence with '→ app-factory cannot build private repos in cloud until #319 lands', and clarify it's a credential-delivery gap (no /gitsecrets routing), not a dockerfile-builder limitation. CONTEXT.md: add a GITHUB_REPO_VISIBILITY term (was only buried in the ADR) stating cloud=public interim, private blocked on wso2cloud#319. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…xternal-dir refs - Fold PR #24: correct the coding-agent dispatcher's ClusterSecretStoreName comment — per-org secrets read via `secretstore-read` (grants `user-app-secrets/*`), NOT `application-secrets-read` (403s). Closes #24. This also resolves the CodeRabbit "cloud SecretStore mapping" comment — the code comment now matches CONTEXT.md. - ADR-0003: reconcile the proxy-auth statements — add a #23 update note (the cloud proxy now validates platform-idp JWTs), fix the stray "JWT-authed" contradiction, frame the un-authed text as the original 2026-05-25 assumption. - Remove all references to directories outside this repo from CONTEXT.md + ADRs (wso2cloud/agent-platform/agent-manager/openchoreo sibling paths, the `wso2cloud-deployement-main/...` path, `../../wso2cloud`): name the external WSO2 projects without local paths; the in-repo client lives at asdlc-service/clients/secretmanagersvc. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Why
The recent wso2cloud-integration + local-setup PRs (#10–#37) landed a lot of hard-won architectural decisions, but the decision log (
docs/adr/) was never committed andCONTEXT.mdhad drifted out of date — actively misleading a future reader/agent. This makes the durable knowledge concise, precise, and committed. No code changes.What
ADRs (
docs/adr/— committed for the first time;CONTEXT.mdalready had[[adr-…]]links to them). Contiguous 0001–0006:X-Impersonate-Orgon M2MCreateGitSecret, not in-cluster SSACONTEXT.mdrefresh:cluster-gateway-proxy(now JWT-authed in cloud, fix(clustergatewayproxy): authenticate to the cloud proxy with the M2M token #23),Task JWT→publisher client-credentialsrunner auth is implemented (WS2.4: per-org publisher cc runner-auth (additive, behind triplet) #26/feat(dispatch): provision per-org publisher cc at dispatch (runner gateway-auth for every component) #28/fix(publisher): register per-org publisher app under the org's OU + self-heal platform profile #29),SM APIlocal = in-repo stub (fix(deployments): replace wso2cloud sm-api build dep with in-repo local stub #37),GitSecretvia OCCreateGitSecret(fix(build): provision the build git secret via OpenChoreo (unified local + cloud) #33).[[adr-…]]links to ADRs that were never written.X-Impersonate-Org, publisher cc runner auth,ComponentTypevsClusterComponentType,AGENT_CLUSTER_SECRET_STORE/secretstore-read,repair-secrets,project_idper-org uniqueness..gitignore: ignoredeployments-v2/(local scratch + secrets) andSESSION.md.Also discarded ~11 stale scratch planning docs under
docs/superpowers/plans/(superseded by these ADRs + the code).Notes
docs/adr/wasn't committed yet, so there was no published history to preserve). Kept number0002so the existingADR-0002code comments stay valid.🤖 Generated with Claude Code