@a5c-ai/kradle 5.0.1-staging.3abdf9534c25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile +31 -0
- package/README.md +187 -0
- package/bin/kradle-demo.mjs +23 -0
- package/bin/kradle-server.mjs +14 -0
- package/dist/kradle-controller-ui.json +3482 -0
- package/dist/kradle-lifecycle.json +201 -0
- package/dist/kradle-runtime-snapshot.json +3125 -0
- package/dist/kradle-summary.json +724 -0
- package/docs/README.md +61 -0
- package/docs/agents/README.md +83 -0
- package/docs/agents/acceptance-test-matrix.md +193 -0
- package/docs/agents/agent-mux-adapter-contract.md +167 -0
- package/docs/agents/agent-mux-source-map.md +310 -0
- package/docs/agents/agent-run-memory-import-spec.md +256 -0
- package/docs/agents/agent-stack-management-spec.md +421 -0
- package/docs/agents/api-contract-spec.md +309 -0
- package/docs/agents/artifacts-writeback-spec.md +145 -0
- package/docs/agents/chart-packaging-spec.md +128 -0
- package/docs/agents/ci-orchestration-spec.md +140 -0
- package/docs/agents/context-assembly-spec.md +219 -0
- package/docs/agents/controller-reconciliation-spec.md +255 -0
- package/docs/agents/crd-schema-spec.md +315 -0
- package/docs/agents/decision-log-open-questions.md +169 -0
- package/docs/agents/developer-implementation-checklist.md +329 -0
- package/docs/agents/dispatching-design.md +262 -0
- package/docs/agents/gaps-agent-mux-to-kradle-crds.md +298 -0
- package/docs/agents/glossary.md +66 -0
- package/docs/agents/implementation-blueprint.md +324 -0
- package/docs/agents/implementation-rollout-slices.md +251 -0
- package/docs/agents/memory-context-integration-spec.md +194 -0
- package/docs/agents/memory-ontology-schema-spec.md +253 -0
- package/docs/agents/memory-operations-runbook.md +121 -0
- package/docs/agents/mvp-vertical-slice-spec.md +146 -0
- package/docs/agents/observability-audit-spec.md +265 -0
- package/docs/agents/operator-runbook.md +174 -0
- package/docs/agents/org-memory-api-payload-examples.md +333 -0
- package/docs/agents/org-memory-controller-sequence-spec.md +181 -0
- package/docs/agents/org-memory-e2e-fixture-plan.md +161 -0
- package/docs/agents/org-memory-ui-implementation-map.md +114 -0
- package/docs/agents/org-memory-vertical-slice-spec.md +168 -0
- package/docs/agents/org-resource-model-delta-spec.md +111 -0
- package/docs/agents/org-route-resource-model-spec.md +183 -0
- package/docs/agents/org-scoping-namespace-spec.md +114 -0
- package/docs/agents/rbac-secrets-management-spec.md +406 -0
- package/docs/agents/repository-page-integration-spec.md +255 -0
- package/docs/agents/resource-contract-examples.md +808 -0
- package/docs/agents/resource-relationship-map.md +190 -0
- package/docs/agents/security-threat-model.md +188 -0
- package/docs/agents/shared-memory-company-brain-spec.md +358 -0
- package/docs/agents/storage-migration-spec.md +168 -0
- package/docs/agents/subagent-orchestration-spec.md +152 -0
- package/docs/agents/system-overview.md +88 -0
- package/docs/agents/tools-mcp-skills-spec.md +189 -0
- package/docs/agents/traceability-matrix.md +79 -0
- package/docs/agents/ui-flow-spec.md +211 -0
- package/docs/agents/ui-ux-system-spec.md +426 -0
- package/docs/agents/workspace-lifecycle-spec.md +166 -0
- package/docs/architecture-spec.md +78 -0
- package/docs/architecture-v2.md +2759 -0
- package/docs/components/control-plane.md +78 -0
- package/docs/components/data-plane.md +69 -0
- package/docs/components/hooks-events.md +67 -0
- package/docs/components/identity-rbac-policy.md +73 -0
- package/docs/components/kubevela-oam.md +70 -0
- package/docs/components/operations-publishing.md +81 -0
- package/docs/components/runners-ci.md +66 -0
- package/docs/components/web-ui.md +94 -0
- package/docs/crd-behaviors-and-relationships.md +3926 -0
- package/docs/external/README.md +47 -0
- package/docs/external/bidirectional-sync-design.md +134 -0
- package/docs/external/cicd-interface.md +64 -0
- package/docs/external/external-backend-controllers.md +170 -0
- package/docs/external/external-backend-crds.md +234 -0
- package/docs/external/external-backend-ui-spec.md +151 -0
- package/docs/external/external-backend-ux-flows.md +115 -0
- package/docs/external/external-object-mapping.md +125 -0
- package/docs/external/git-forge-interface.md +68 -0
- package/docs/external/github-integration-design.md +151 -0
- package/docs/external/issue-tracking-interface.md +66 -0
- package/docs/external/provider-capability-manifests.md +204 -0
- package/docs/external/provider-catalog.md +139 -0
- package/docs/external/provider-rollout-testing.md +78 -0
- package/docs/external/research-results.md +48 -0
- package/docs/external/security-auth-permissions.md +81 -0
- package/docs/external/sync-state-machines.md +108 -0
- package/docs/external/unified-external-backend-model.md +107 -0
- package/docs/external/user-facing-changes.md +67 -0
- package/docs/gaps.md +161 -0
- package/docs/install.md +94 -0
- package/docs/integration-and-design-decisions.md +1530 -0
- package/docs/kradle-design.md +334 -0
- package/docs/local-minikube.md +55 -0
- package/docs/ontology/README.md +32 -0
- package/docs/ontology/bounded-contexts.md +29 -0
- package/docs/ontology/events-and-hooks.md +32 -0
- package/docs/ontology/oam-kubevela.md +32 -0
- package/docs/ontology/operations-and-release.md +25 -0
- package/docs/ontology/personas-and-actors.md +32 -0
- package/docs/ontology/policies-and-invariants.md +33 -0
- package/docs/ontology/problem-space.md +30 -0
- package/docs/ontology/resource-contracts.md +40 -0
- package/docs/ontology/resource-taxonomy.md +42 -0
- package/docs/ontology/runners-and-ci.md +29 -0
- package/docs/ontology/solution-space.md +24 -0
- package/docs/ontology/storage-and-data-boundaries.md +29 -0
- package/docs/ontology/validation-matrix.md +24 -0
- package/docs/ontology/web-ui-excellent-flows.md +32 -0
- package/docs/ontology/workflows.md +39 -0
- package/docs/ontology/world.md +35 -0
- package/docs/openapi.yaml +1291 -0
- package/docs/product-requirements.md +62 -0
- package/docs/requirements-v2.md +235 -0
- package/docs/roadmap-mvp.md +87 -0
- package/docs/sdk-api-reference.md +1108 -0
- package/docs/system-requirements.md +90 -0
- package/docs/system-spec-v2.md +1230 -0
- package/docs/tests/README.md +53 -0
- package/docs/tests/agent-qa-plan.md +63 -0
- package/docs/tests/browser-ui-tests.md +62 -0
- package/docs/tests/ci-quality-gates.md +48 -0
- package/docs/tests/coverage-model.md +64 -0
- package/docs/tests/e2e-scenario-tests.md +53 -0
- package/docs/tests/fixtures-test-data.md +63 -0
- package/docs/tests/observability-reliability-tests.md +54 -0
- package/docs/tests/product-test-matrix.md +145 -0
- package/docs/tests/qa-adoption-roadmap.md +130 -0
- package/docs/tests/qa-automation-plan.md +101 -0
- package/docs/tests/security-compliance-tests.md +57 -0
- package/docs/tests/test-framework-tools.md +88 -0
- package/docs/tests/test-suite-layout.md +121 -0
- package/docs/tests/unit-integration-tests.md +48 -0
- package/docs/todo-kyverno +714 -0
- package/docs/todos.md +4 -0
- package/docs/user-stories.md +78 -0
- package/docs/web-console-spec.md +533 -0
- package/examples/minikube-demo.yaml +190 -0
- package/examples/oam-application.yaml +23 -0
- package/examples/policy-kyverno-pr-title.yaml +18 -0
- package/package.json +66 -0
- package/scripts/build.mjs +29 -0
- package/scripts/setup-minikube.mjs +65 -0
- package/scripts/smoke.mjs +37 -0
- package/scripts/validate-doc-coverage.mjs +152 -0
- package/scripts/validate-package.mjs +95 -0
- package/scripts/validate-ui.mjs +305 -0
- package/src/agent-adapter-controller.js +169 -0
- package/src/agent-approval-controller.js +170 -0
- package/src/agent-context-bundles.js +242 -0
- package/src/agent-dispatch-controller.js +549 -0
- package/src/agent-gateway-config-controller.js +147 -0
- package/src/agent-identity-migration.js +115 -0
- package/src/agent-memory-controller.js +357 -0
- package/src/agent-memory-import.js +327 -0
- package/src/agent-memory-query.js +292 -0
- package/src/agent-memory-repository-source-controller.js +255 -0
- package/src/agent-mux-client.js +589 -0
- package/src/agent-permission-review.js +250 -0
- package/src/agent-persona-controller.js +135 -0
- package/src/agent-project-controller.js +117 -0
- package/src/agent-prompt-composition.js +55 -0
- package/src/agent-provider-config-controller.js +151 -0
- package/src/agent-secret-config-grant-controller.js +282 -0
- package/src/agent-session-transcript-controller.js +189 -0
- package/src/agent-stack-controller.js +421 -0
- package/src/agent-subagent-controller.js +160 -0
- package/src/agent-transport-binding-controller.js +121 -0
- package/src/agent-trigger-controller.js +387 -0
- package/src/agent-workspace-controller.js +702 -0
- package/src/agent-writeback-controller.js +302 -0
- package/src/api-controller.js +621 -0
- package/src/argocd-gitops.js +43 -0
- package/src/artifact-registry-controller.js +542 -0
- package/src/assistant-runtime.js +284 -0
- package/src/async-controller.js +207 -0
- package/src/audit-controller.js +191 -0
- package/src/auth.js +310 -0
- package/src/component-catalog.js +41 -0
- package/src/control-plane.js +136 -0
- package/src/controller-client.js +112 -0
- package/src/controller-ui.js +620 -0
- package/src/data-plane.js +179 -0
- package/src/event-bus.js +397 -0
- package/src/external/conflict-controller.js +225 -0
- package/src/external/github/auth.js +96 -0
- package/src/external/github/cicd.js +180 -0
- package/src/external/github/git-forge.js +240 -0
- package/src/external/github/index.js +144 -0
- package/src/external/github/issue-tracking.js +163 -0
- package/src/external/provider-adapter.js +161 -0
- package/src/external/provider-resource-factory.js +221 -0
- package/src/external/sync-controller.js +235 -0
- package/src/external/webhook-controller.js +144 -0
- package/src/external/write-controller.js +283 -0
- package/src/gitea-backend.js +131 -0
- package/src/gitea-service.js +173 -0
- package/src/handoff.js +98 -0
- package/src/health-probes.js +134 -0
- package/src/hooks-events.js +63 -0
- package/src/hooks-lifecycle.js +117 -0
- package/src/http-server.js +409 -0
- package/src/identity-policy.js +86 -0
- package/src/index.js +71 -0
- package/src/jitsi-agent-bridge.js +141 -0
- package/src/jitsi-meeting-controller.js +291 -0
- package/src/jitsi-sync-controller.js +198 -0
- package/src/kradle-inference-service-controller.js +246 -0
- package/src/kubernetes-controller-async.js +531 -0
- package/src/kubernetes-controller.js +904 -0
- package/src/kubernetes-resource-gateway.js +48 -0
- package/src/model-route-controller.js +364 -0
- package/src/notification-controller.js +178 -0
- package/src/operations.js +112 -0
- package/src/org-scoping.js +5 -0
- package/src/resource-model.js +282 -0
- package/src/runner-controller.js +272 -0
- package/src/runners-ci.js +48 -0
- package/src/runtime.js +196 -0
- package/src/snapshot-cache.js +157 -0
- package/src/virtual-model-controller.js +538 -0
- package/src/virtual-model-hook-bridge.js +200 -0
- package/src/web-ui.js +40 -0
- package/tests/agent-adapter-controller.test.js +361 -0
- package/tests/agent-approval-controller.test.js +173 -0
- package/tests/agent-context-bundles.test.js +278 -0
- package/tests/agent-dispatch-controller.test.js +679 -0
- package/tests/agent-gateway-config-controller.test.js +386 -0
- package/tests/agent-identity-migration.test.js +87 -0
- package/tests/agent-memory-controller.test.js +461 -0
- package/tests/agent-memory-import-snapshot.test.js +477 -0
- package/tests/agent-memory-query.test.js +404 -0
- package/tests/agent-memory-repository-source.test.js +514 -0
- package/tests/agent-mux-client.test.js +389 -0
- package/tests/agent-mux-integration.test.js +971 -0
- package/tests/agent-permission-review-v2.test.js +317 -0
- package/tests/agent-permission-review.test.js +209 -0
- package/tests/agent-persona-controller.test.js +127 -0
- package/tests/agent-project-controller.test.js +302 -0
- package/tests/agent-prompt-composition.test.js +76 -0
- package/tests/agent-provider-config-controller.test.js +376 -0
- package/tests/agent-resources.test.js +303 -0
- package/tests/agent-secret-config-grant.test.js +231 -0
- package/tests/agent-session-transcript-controller.test.js +499 -0
- package/tests/agent-stack-controller.test.js +283 -0
- package/tests/agent-subagent-controller.test.js +201 -0
- package/tests/agent-transport-binding-controller.test.js +294 -0
- package/tests/agent-trigger-controller.test.js +271 -0
- package/tests/agent-trigger-routes.test.js +190 -0
- package/tests/agent-trigger-sources.test.js +245 -0
- package/tests/agent-workspace-controller.test.js +181 -0
- package/tests/agent-writeback.test.js +292 -0
- package/tests/approval-persistence.test.js +171 -0
- package/tests/artifact-registry.test.js +511 -0
- package/tests/assistant-runtime.test.js +506 -0
- package/tests/async-controller.test.js +252 -0
- package/tests/audit-controller.test.js +227 -0
- package/tests/codespace-controller.test.js +318 -0
- package/tests/controller-client.test.js +133 -0
- package/tests/deployment.test.js +527 -0
- package/tests/e2e/lifecycle.test.js +120 -0
- package/tests/event-bus-integration.test.js +355 -0
- package/tests/external-github-forge.test.js +560 -0
- package/tests/external-github-issues-cicd.test.js +520 -0
- package/tests/external-integration.test.js +470 -0
- package/tests/external-persistence.test.js +415 -0
- package/tests/external-provider-adapter.test.js +365 -0
- package/tests/external-resource-model.test.js +223 -0
- package/tests/external-webhook-sync.test.js +287 -0
- package/tests/external-write-conflict.test.js +353 -0
- package/tests/gitea-service.test.js +253 -0
- package/tests/health-check-real.test.js +165 -0
- package/tests/health-probes.test.js +90 -0
- package/tests/hooks-lifecycle.test.js +364 -0
- package/tests/integration/full-flow.test.js +266 -0
- package/tests/jitsi-agent-bridge.test.js +119 -0
- package/tests/jitsi-helm-integration.test.js +77 -0
- package/tests/jitsi-meeting-controller.test.js +170 -0
- package/tests/jitsi-resource-model.test.js +73 -0
- package/tests/jitsi-sync-controller.test.js +112 -0
- package/tests/kradle-inference-service.test.js +689 -0
- package/tests/kradle.test.js +779 -0
- package/tests/memory-search-wiring.test.js +270 -0
- package/tests/model-route-controller.test.js +733 -0
- package/tests/notification-controller.test.js +196 -0
- package/tests/notification-integration.test.js +179 -0
- package/tests/org-scoping.test.js +687 -0
- package/tests/runner-controller.test.js +327 -0
- package/tests/runner-integration.test.js +231 -0
- package/tests/session-cookie-hmac.test.js +151 -0
- package/tests/snapshot-performance.test.js +315 -0
- package/tests/sse-events.test.js +107 -0
- package/tests/virtual-model-controller.test.js +877 -0
- package/tests/virtual-model-hook-bridge.test.js +384 -0
- package/tests/webhook-trigger.test.js +198 -0
- package/tests/workspace-volumes.test.js +312 -0
- package/tests/writeback-persistence.test.js +207 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# External backend integration docs
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This directory defines how Kradle should integrate with GitHub first and support other externally managed backends later. External backends can implement one, two, or all three Kradle provider interfaces:
|
|
6
|
+
|
|
7
|
+
1. issue tracking and work management sync;
|
|
8
|
+
2. CI/CD, triggers, runners, pipelines, checks, and workflow sync;
|
|
9
|
+
3. git forge sync for repositories, pull requests, refs, commits, SSH/deploy keys, collaborators, and repository policy.
|
|
10
|
+
|
|
11
|
+
The design supports bidirectional, efficient sync without forcing every backend to be a full forge.
|
|
12
|
+
|
|
13
|
+
## Documents
|
|
14
|
+
|
|
15
|
+
- [Research results](./research-results.md) summarizes GitHub API and webhook capabilities used by this design.
|
|
16
|
+
- [Pluggable backend provider catalog](./provider-catalog.md) lists GitHub, GitLab, Bitbucket, Azure DevOps, Jira, Linear, Buildkite, CircleCI, Jenkins, Gitea, Gerrit, raw Git, and custom providers by supported interface.
|
|
17
|
+
|
|
18
|
+
- [Unified external backend model](./unified-external-backend-model.md) defines provider capabilities, ownership, identifiers, sync modes, and the three interface split.
|
|
19
|
+
- [Provider capability manifests](./provider-capability-manifests.md) defines data-driven adapter manifests for operations, auth, webhooks, and tests.
|
|
20
|
+
- [External object mapping spec](./external-object-mapping.md) defines loss-aware mappings from provider objects to Kradle resources.
|
|
21
|
+
|
|
22
|
+
- [Issue tracking interface](./issue-tracking-interface.md) defines issue/comment/label/milestone/project/work-item sync.
|
|
23
|
+
- [CI/CD interface](./cicd-interface.md) defines workflow/check/pipeline/job/runner/trigger sync.
|
|
24
|
+
- [Git forge interface](./git-forge-interface.md) defines repository/PR/ref/commit/key/collaborator/policy sync.
|
|
25
|
+
- [GitHub integration design](./github-integration-design.md) maps GitHub App, REST, GraphQL, webhooks, and Actions onto the three interfaces.
|
|
26
|
+
- [Efficient bidirectional sync](./bidirectional-sync-design.md) defines webhook-first, cursor-based, idempotent reconciliation and conflict handling.
|
|
27
|
+
- [External sync state machines](./sync-state-machines.md) defines stable phases for providers, bindings, deliveries, backfill, writes, and conflicts.
|
|
28
|
+
|
|
29
|
+
- [External backend CRDs](./external-backend-crds.md) defines resources and schemas.
|
|
30
|
+
- [External backend controllers](./external-backend-controllers.md) defines reconciliation loops and side effects.
|
|
31
|
+
- [User-facing changes](./user-facing-changes.md) defines UI, settings, status, and workflow changes.
|
|
32
|
+
- [External backend UI specification](./external-backend-ui-spec.md) defines org-scoped provider setup, bindings, sync health, conflicts, write intents, webhook, and repository UI.
|
|
33
|
+
- [External backend UX flows](./external-backend-ux-flows.md) defines user-facing setup, mixed-provider, conflict, write approval, recovery, and rate-limit flows.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
- [Security, auth, and permissions](./security-auth-permissions.md) defines GitHub App auth, tokens, secrets, RBAC, and audit.
|
|
37
|
+
- [Provider rollout and testing](./provider-rollout-testing.md) defines implementation slices, validation, and QA coverage.
|
|
38
|
+
|
|
39
|
+
## Design principles
|
|
40
|
+
|
|
41
|
+
- Kradle keeps its org namespace and resource model; external backends are providers, not the source of Kradle tenancy.
|
|
42
|
+
- Providers declare which interfaces they support.
|
|
43
|
+
- Every external object stores provider ID, native ID, global node ID when available, URL, etag/cursor, and last synced generation.
|
|
44
|
+
- Webhooks are the primary freshness mechanism; polling/backfill repairs missed or truncated events.
|
|
45
|
+
- Kradle can run in mirror mode, bidirectional mode, or Kradle-owned mode per interface and resource type.
|
|
46
|
+
- Conflicts are explicit resources and UI states, not silent overwrites.
|
|
47
|
+
- Secrets and provider tokens stay in Kubernetes Secrets and are surfaced only as grant metadata.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Efficient bidirectional sync design
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
External backends need efficient two-way sync that converges quickly without overwriting user changes or exhausting provider rate limits. This document defines the common sync strategy for all provider interfaces.
|
|
6
|
+
|
|
7
|
+
## Sync layers
|
|
8
|
+
|
|
9
|
+
| Layer | Purpose |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Webhook ingest | near-real-time event capture and trigger source. |
|
|
12
|
+
| Event normalizer | convert provider payloads into canonical Kradle sync events. |
|
|
13
|
+
| Cursor backfill | recover missed events and hydrate lists. |
|
|
14
|
+
| Object reconciler | compare desired/local/provider state and write projections. |
|
|
15
|
+
| Write intent queue | apply Kradle-originated writes to provider with retries. |
|
|
16
|
+
| Conflict detector | detect local/external divergence. |
|
|
17
|
+
| Audit/event stream | explain every sync and write. |
|
|
18
|
+
|
|
19
|
+
## Sync resource model
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
kind: ExternalSyncState
|
|
23
|
+
spec:
|
|
24
|
+
organizationRef: a5c
|
|
25
|
+
providerRef: github-a5c
|
|
26
|
+
bindingRef: github-kradle
|
|
27
|
+
interface: gitForge
|
|
28
|
+
resourceKind: PullRequest
|
|
29
|
+
status:
|
|
30
|
+
highWatermark: 2026-05-11T12:00:00Z
|
|
31
|
+
cursor: opaque-provider-cursor
|
|
32
|
+
lastWebhookDeliveryId: "..."
|
|
33
|
+
lastFullBackfillAt: 2026-05-11T00:00:00Z
|
|
34
|
+
phase: Ready
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
kind: ExternalSyncConflict
|
|
39
|
+
spec:
|
|
40
|
+
organizationRef: a5c
|
|
41
|
+
providerRef: github-a5c
|
|
42
|
+
resourceRef:
|
|
43
|
+
kind: Issue
|
|
44
|
+
name: issue-42
|
|
45
|
+
fieldConflicts:
|
|
46
|
+
- field: labels
|
|
47
|
+
local: [bug, priority]
|
|
48
|
+
external: [bug]
|
|
49
|
+
resolutionPolicy: manual
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Event processing
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
provider webhook
|
|
56
|
+
-> validate signature
|
|
57
|
+
-> persist ExternalWebhookDelivery
|
|
58
|
+
-> enqueue by provider installation and repository
|
|
59
|
+
-> normalize into ExternalSyncEvent
|
|
60
|
+
-> dedupe by delivery ID + action + native object ID
|
|
61
|
+
-> apply object-specific reconcile
|
|
62
|
+
-> update Kradle projection and sync state
|
|
63
|
+
-> emit audit and watch event
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Backfill processing
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
scheduled or manual backfill
|
|
70
|
+
-> read ExternalSyncState cursor/highWatermark
|
|
71
|
+
-> list changed objects from provider
|
|
72
|
+
-> hydrate missing details
|
|
73
|
+
-> upsert Kradle projections
|
|
74
|
+
-> mark deleted/missing objects according to tombstone policy
|
|
75
|
+
-> update cursor/highWatermark
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Write processing
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
Kradle user/agent action
|
|
82
|
+
-> admission and RBAC
|
|
83
|
+
-> create ExternalWriteIntent
|
|
84
|
+
-> optional approval
|
|
85
|
+
-> provider write through connector
|
|
86
|
+
-> verify provider response
|
|
87
|
+
-> update local projection with provider IDs/version
|
|
88
|
+
-> wait for webhook or backfill confirmation
|
|
89
|
+
-> close write intent
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Efficiency rules
|
|
93
|
+
|
|
94
|
+
- Prefer webhook payloads for targeted updates.
|
|
95
|
+
- Use GraphQL/cursor pagination for bulk list hydration where supported.
|
|
96
|
+
- Use REST endpoints for provider-specific operations and logs/artifacts.
|
|
97
|
+
- Store ETag or provider resource version when available.
|
|
98
|
+
- Batch by installation/org/repository to respect rate limits.
|
|
99
|
+
- Lazy-load large logs, diffs, artifacts, and comments.
|
|
100
|
+
- Apply bounded retries with dead-letter status for repeated provider errors.
|
|
101
|
+
- Separate sync freshness from user-facing last-updated time.
|
|
102
|
+
|
|
103
|
+
## Conflict rules
|
|
104
|
+
|
|
105
|
+
Conflict when:
|
|
106
|
+
|
|
107
|
+
- local desired generation changed after last sync and provider field also changed;
|
|
108
|
+
- provider rejects a write because native version/precondition changed;
|
|
109
|
+
- provider has a value Kradle cannot represent losslessly;
|
|
110
|
+
- ownership mode says external-owned and Kradle has pending local mutation;
|
|
111
|
+
- write intent remains unconfirmed beyond timeout.
|
|
112
|
+
|
|
113
|
+
Resolution options:
|
|
114
|
+
|
|
115
|
+
- prefer external;
|
|
116
|
+
- prefer Kradle desired;
|
|
117
|
+
- manual merge;
|
|
118
|
+
- create reviewed provider-side change;
|
|
119
|
+
- ignore unsupported field with warning.
|
|
120
|
+
|
|
121
|
+
## Deletion and tombstones
|
|
122
|
+
|
|
123
|
+
- External deletions become tombstones before local deletion when audit requires retention.
|
|
124
|
+
- Kradle deletions in mirror mode should not delete provider objects.
|
|
125
|
+
- Kradle-owned resources may delete provider objects if admission and provider permissions allow it.
|
|
126
|
+
- PR/issue deletion may be unsupported in some providers; close/archive instead.
|
|
127
|
+
|
|
128
|
+
## Acceptance criteria
|
|
129
|
+
|
|
130
|
+
- Webhook replay and backfill converge to the same resource state.
|
|
131
|
+
- Duplicate webhooks are idempotent.
|
|
132
|
+
- Rate-limit responses slow sync without losing events.
|
|
133
|
+
- Conflicts are visible in UI and API.
|
|
134
|
+
- Writes are auditable from Kradle action to provider confirmation.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# CI/CD interface
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
The CI/CD interface syncs external workflow/check/pipeline state into Kradle and can trigger or control external runs when allowed. It covers workflows, workflow runs, jobs, logs, artifacts, checks, commit statuses, runner groups, and self-hosted runners.
|
|
6
|
+
|
|
7
|
+
## Provider contract
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
interface CicdProvider {
|
|
11
|
+
listPipelines(cursor): Page<ExternalPipeline>;
|
|
12
|
+
getPipeline(ref): ExternalPipeline;
|
|
13
|
+
listJobs(pipelineRef, cursor): Page<ExternalJob>;
|
|
14
|
+
getJobLog(jobRef): ExternalLogRef;
|
|
15
|
+
listArtifacts(pipelineRef, cursor): Page<ExternalArtifact>;
|
|
16
|
+
rerunPipeline(ref, options): ExternalPipeline;
|
|
17
|
+
cancelPipeline(ref): ExternalPipeline;
|
|
18
|
+
listRunners(cursor): Page<ExternalRunner>;
|
|
19
|
+
registerRunner(scope, options): RunnerRegistration;
|
|
20
|
+
createCheck(input): ExternalCheck;
|
|
21
|
+
updateCheck(ref, patch): ExternalCheck;
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Providers can implement checks/statuses without implementing runner management.
|
|
26
|
+
|
|
27
|
+
## Resource mapping
|
|
28
|
+
|
|
29
|
+
| External concept | Kradle resource/projection |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| workflow/workflow definition | `PipelineTemplate` projection or provider metadata |
|
|
32
|
+
| workflow run/pipeline | `Pipeline` |
|
|
33
|
+
| job/step | `Job` |
|
|
34
|
+
| check run/status | `CheckRun` projection or `Job.status.checks` |
|
|
35
|
+
| runner | `RunnerPool` / `Runner` projection |
|
|
36
|
+
| artifact/log | `Artifact` / object-storage reference |
|
|
37
|
+
| trigger event | `WebhookDelivery` / `ExternalSyncEvent` |
|
|
38
|
+
|
|
39
|
+
## GitHub mapping
|
|
40
|
+
|
|
41
|
+
GitHub Actions workflow runs map to `Pipeline`; workflow jobs map to `Job`; check runs and commit statuses map to check projections and PR gates. GitHub self-hosted runners map to runner inventory and runner registration flows when Kradle is allowed to manage them.
|
|
42
|
+
|
|
43
|
+
## Sync rules
|
|
44
|
+
|
|
45
|
+
- Webhooks handle `workflow_run`, `workflow_job`, `check_run`, `check_suite`, `status`, and `push` events.
|
|
46
|
+
- Backfill periodically lists workflow runs/jobs by repository and updated timestamp.
|
|
47
|
+
- Logs and artifacts are lazy-loaded and stored by digest or external URL depending on retention policy.
|
|
48
|
+
- Rerun/cancel actions require permission review and provider capability.
|
|
49
|
+
- External runner registration tokens are short-lived and never stored as plain status.
|
|
50
|
+
|
|
51
|
+
## User-facing changes
|
|
52
|
+
|
|
53
|
+
- Repository Runs page shows external pipelines next to Kradle-native runs.
|
|
54
|
+
- Run detail badges show external provider and native link.
|
|
55
|
+
- Rerun/cancel buttons are disabled unless provider and RBAC allow them.
|
|
56
|
+
- Runner pages distinguish Kradle-managed, provider-managed, and mirrored runners.
|
|
57
|
+
- Agent triggers can subscribe to external CI failure events through the same trigger rule model.
|
|
58
|
+
|
|
59
|
+
## Acceptance criteria
|
|
60
|
+
|
|
61
|
+
- A CI-only provider can sync pipelines/jobs without repo/issue ownership.
|
|
62
|
+
- GitHub workflow jobs converge through webhook and backfill.
|
|
63
|
+
- Logs/artifacts are fetched lazily and redacted according to policy.
|
|
64
|
+
- Rerun/cancel actions are audited and idempotent.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# External backend controllers
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
External backend controllers reconcile provider configuration, webhook deliveries, backfill, object projection, writes, conflicts, and status.
|
|
6
|
+
|
|
7
|
+
## Controller set
|
|
8
|
+
|
|
9
|
+
| Controller | Responsibilities |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| provider controller | validate auth, capabilities, installation access, rate limits, and status. |
|
|
12
|
+
| binding controller | validate target refs, create provider webhooks, initialize sync states. |
|
|
13
|
+
| webhook controller | validate signatures, persist deliveries, enqueue events, support replay. |
|
|
14
|
+
| sync controller | process events/backfills and update Kradle projections. |
|
|
15
|
+
| write controller | apply Kradle write intents to provider, retry, confirm, audit. |
|
|
16
|
+
| conflict controller | detect field/resource conflicts and manage resolution workflow. |
|
|
17
|
+
| runner/controller adapter | manage external CI runners when provider supports it. |
|
|
18
|
+
| garbage/tombstone controller | handle external deletions and retention. |
|
|
19
|
+
|
|
20
|
+
## Reconciliation order
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
ExternalBackendProvider
|
|
24
|
+
-> auth/capability check
|
|
25
|
+
-> ExternalBackendBinding
|
|
26
|
+
-> webhook registration and sync state initialization
|
|
27
|
+
-> webhook events and backfill
|
|
28
|
+
-> Kradle resource projections
|
|
29
|
+
-> write intents and conflicts
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Provider controller
|
|
33
|
+
|
|
34
|
+
- Resolve org namespace and Secret refs.
|
|
35
|
+
- Validate provider type and base URLs.
|
|
36
|
+
- Verify credentials without storing token values.
|
|
37
|
+
- Discover capabilities where possible.
|
|
38
|
+
- Track rate-limit status and degraded state.
|
|
39
|
+
- Emit `AuthReady`, `InstallationReady`, and interface readiness conditions.
|
|
40
|
+
|
|
41
|
+
## Binding controller
|
|
42
|
+
|
|
43
|
+
- Validate target resource belongs to same org.
|
|
44
|
+
- Validate provider supports requested interfaces.
|
|
45
|
+
- Create/update provider webhooks when Kradle owns webhook configuration.
|
|
46
|
+
- Create initial `ExternalSyncState` objects.
|
|
47
|
+
- Kick off initial backfill.
|
|
48
|
+
|
|
49
|
+
## Webhook controller
|
|
50
|
+
|
|
51
|
+
- Validate HMAC/signature before accepting payload.
|
|
52
|
+
- Persist `ExternalWebhookDelivery` with provider delivery ID.
|
|
53
|
+
- Dedupe repeated deliveries.
|
|
54
|
+
- Enqueue normalized `ExternalSyncEvent`.
|
|
55
|
+
- Return quickly and process asynchronously.
|
|
56
|
+
- Support manual replay/redelivery records.
|
|
57
|
+
|
|
58
|
+
## Sync controller
|
|
59
|
+
|
|
60
|
+
- Hydrate provider objects from webhook payload or API.
|
|
61
|
+
- Upsert Kradle resources/projections with external identity fields.
|
|
62
|
+
- Maintain high-watermarks and cursors.
|
|
63
|
+
- Respect ownership mode.
|
|
64
|
+
- Mark tombstones for external deletions.
|
|
65
|
+
- Emit watch and audit events.
|
|
66
|
+
|
|
67
|
+
## Write controller
|
|
68
|
+
|
|
69
|
+
- Reads `ExternalWriteIntent` after Kradle admission and optional approval.
|
|
70
|
+
- Applies provider write with provider-specific idempotency where available.
|
|
71
|
+
- Handles rate limits and retryable failures.
|
|
72
|
+
- Confirms via provider response, webhook, or follow-up read.
|
|
73
|
+
- Creates conflict if provider state diverged.
|
|
74
|
+
|
|
75
|
+
## Controller acceptance criteria
|
|
76
|
+
|
|
77
|
+
- Controllers are idempotent by provider, installation, interface, native object ID, and delivery/write ID.
|
|
78
|
+
- Provider outage degrades sync without corrupting Kradle state.
|
|
79
|
+
- Cross-org references fail before provider calls.
|
|
80
|
+
- Secret/token values never enter status, events, logs, or sync payloads.
|
|
81
|
+
- Webhook replay and cursor backfill converge.
|
|
82
|
+
|
|
83
|
+
## Interface adapter controllers
|
|
84
|
+
|
|
85
|
+
Each interface has a provider-neutral reconciler and provider-specific adapter methods.
|
|
86
|
+
|
|
87
|
+
### Issue sync controller
|
|
88
|
+
|
|
89
|
+
Responsibilities:
|
|
90
|
+
|
|
91
|
+
- watch issue-related webhooks;
|
|
92
|
+
- backfill issues, comments, labels, milestones, project fields;
|
|
93
|
+
- upsert `Issue` projections;
|
|
94
|
+
- link PR-backed issue numbers to `PullRequest`;
|
|
95
|
+
- process issue write intents;
|
|
96
|
+
- detect comment/label/state conflicts.
|
|
97
|
+
|
|
98
|
+
### CI/CD sync controller
|
|
99
|
+
|
|
100
|
+
Responsibilities:
|
|
101
|
+
|
|
102
|
+
- watch workflow/check/status events;
|
|
103
|
+
- backfill pipelines, jobs, checks, logs, artifacts;
|
|
104
|
+
- upsert `Pipeline` and `Job` projections;
|
|
105
|
+
- lazy-fetch logs/artifacts on demand;
|
|
106
|
+
- process rerun/cancel/check update write intents;
|
|
107
|
+
- sync runner inventory where supported.
|
|
108
|
+
|
|
109
|
+
### Git forge sync controller
|
|
110
|
+
|
|
111
|
+
Responsibilities:
|
|
112
|
+
|
|
113
|
+
- watch repository, PR, review, push, branch/tag, key, collaborator, and protection events;
|
|
114
|
+
- backfill repos, pull requests, refs, branch protection, keys, collaborators;
|
|
115
|
+
- upsert `Repository`, `PullRequest`, `Review`, `SSHKey`, `RepositoryPermission`, `BranchProtection`, and `RefPolicy` projections;
|
|
116
|
+
- process PR, merge, key, collaborator, and branch protection writes;
|
|
117
|
+
- detect force-push and stale diff/check state.
|
|
118
|
+
|
|
119
|
+
## Provider adapter lifecycle
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
load provider descriptor
|
|
123
|
+
-> validate configured interfaces
|
|
124
|
+
-> create adapter client with scoped credentials
|
|
125
|
+
-> run health/capability probe
|
|
126
|
+
-> start webhook/backfill loops
|
|
127
|
+
-> expose provider operations to sync/write controllers
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Rate-limit handling
|
|
131
|
+
|
|
132
|
+
Controllers should:
|
|
133
|
+
|
|
134
|
+
- bucket requests by provider, installation/account, org, and repository;
|
|
135
|
+
- preserve webhook deliveries even when rate limited;
|
|
136
|
+
- pause backfill before write intents when budget is low;
|
|
137
|
+
- expose `RateLimited` conditions with reset time;
|
|
138
|
+
- avoid retry storms by using exponential backoff and jitter.
|
|
139
|
+
|
|
140
|
+
## Provider plugin contract
|
|
141
|
+
|
|
142
|
+
Future provider plugins should implement:
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
interface ExternalProviderAdapter {
|
|
146
|
+
descriptor(): ProviderDescriptor;
|
|
147
|
+
health(): ProviderHealth;
|
|
148
|
+
issueTracking?: IssueTrackingProvider;
|
|
149
|
+
cicd?: CicdProvider;
|
|
150
|
+
gitForge?: GitForgeProvider;
|
|
151
|
+
normalizeWebhook(payload): NormalizedExternalEvent[];
|
|
152
|
+
verifyWebhook(request): VerificationResult;
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
The core controllers own persistence, org checks, queueing, conflicts, and audit; adapters only translate provider operations.
|
|
157
|
+
|
|
158
|
+
## Controller status surfaces
|
|
159
|
+
|
|
160
|
+
Provider and binding status should expose:
|
|
161
|
+
|
|
162
|
+
- interface readiness;
|
|
163
|
+
- last successful webhook;
|
|
164
|
+
- last failed webhook;
|
|
165
|
+
- last backfill by interface;
|
|
166
|
+
- queue depth;
|
|
167
|
+
- rate limit remaining/reset;
|
|
168
|
+
- conflicts count;
|
|
169
|
+
- pending write count;
|
|
170
|
+
- last provider error class.
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# External backend CRDs
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This document defines the resource contracts for external backend providers, bindings, sync state, write intents, conflicts, and webhook deliveries.
|
|
6
|
+
|
|
7
|
+
## Config resources
|
|
8
|
+
|
|
9
|
+
### `ExternalBackendProvider`
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
apiVersion: kradle.a5c.ai/v1alpha1
|
|
13
|
+
kind: ExternalBackendProvider
|
|
14
|
+
metadata:
|
|
15
|
+
name: github-a5c
|
|
16
|
+
namespace: kradle-org-a5c
|
|
17
|
+
spec:
|
|
18
|
+
organizationRef: a5c
|
|
19
|
+
providerType: github
|
|
20
|
+
displayName: GitHub a5c-ai
|
|
21
|
+
baseUrl: https://github.com
|
|
22
|
+
apiBaseUrl: https://api.github.com
|
|
23
|
+
authRef:
|
|
24
|
+
secretRef:
|
|
25
|
+
name: github-app-a5c
|
|
26
|
+
capabilities:
|
|
27
|
+
issueTracking: true
|
|
28
|
+
cicd: true
|
|
29
|
+
gitForge: true
|
|
30
|
+
status:
|
|
31
|
+
phase: Ready
|
|
32
|
+
conditions: []
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### `ExternalBackendBinding`
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
kind: ExternalBackendBinding
|
|
39
|
+
spec:
|
|
40
|
+
organizationRef: a5c
|
|
41
|
+
providerRef: github-a5c
|
|
42
|
+
targetRef:
|
|
43
|
+
kind: Repository
|
|
44
|
+
name: kradle
|
|
45
|
+
externalRef:
|
|
46
|
+
owner: a5c-ai
|
|
47
|
+
repository: kradle
|
|
48
|
+
installationId: 123456
|
|
49
|
+
interfaces:
|
|
50
|
+
issueTracking:
|
|
51
|
+
enabled: true
|
|
52
|
+
mode: bidirectional
|
|
53
|
+
cicd:
|
|
54
|
+
enabled: true
|
|
55
|
+
mode: external-owned
|
|
56
|
+
gitForge:
|
|
57
|
+
enabled: true
|
|
58
|
+
mode: bidirectional
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### `ExternalBackendSyncPolicy`
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
kind: ExternalBackendSyncPolicy
|
|
65
|
+
spec:
|
|
66
|
+
organizationRef: a5c
|
|
67
|
+
providerRef: github-a5c
|
|
68
|
+
webhookFirst: true
|
|
69
|
+
backfill:
|
|
70
|
+
interval: 15m
|
|
71
|
+
fullResyncInterval: 24h
|
|
72
|
+
writePolicy:
|
|
73
|
+
defaultMode: reviewed-write
|
|
74
|
+
agentWriteRequiresApproval: true
|
|
75
|
+
conflictPolicy:
|
|
76
|
+
defaultResolution: manual
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Aggregated resources
|
|
80
|
+
|
|
81
|
+
| Kind | Purpose |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `ExternalWebhookDelivery` | provider webhook delivery record and processing state. |
|
|
84
|
+
| `ExternalSyncEvent` | normalized provider event. |
|
|
85
|
+
| `ExternalSyncState` | cursor/high-watermark per provider/interface/resource scope. |
|
|
86
|
+
| `ExternalWriteIntent` | Kradle-originated write to provider. |
|
|
87
|
+
| `ExternalSyncConflict` | field/resource conflict requiring resolution. |
|
|
88
|
+
| `ExternalObjectLink` | external native ID/link attached to a Kradle resource. |
|
|
89
|
+
|
|
90
|
+
## Required labels
|
|
91
|
+
|
|
92
|
+
- `kradle.a5c.ai/org`;
|
|
93
|
+
- `kradle.a5c.ai/provider`;
|
|
94
|
+
- `kradle.a5c.ai/interface`;
|
|
95
|
+
- `kradle.a5c.ai/repository` when repository-scoped;
|
|
96
|
+
- `kradle.a5c.ai/external-owner` when provider owner/org is known.
|
|
97
|
+
|
|
98
|
+
## Status conditions
|
|
99
|
+
|
|
100
|
+
Providers and bindings should use:
|
|
101
|
+
|
|
102
|
+
- `AuthReady`;
|
|
103
|
+
- `InstallationReady`;
|
|
104
|
+
- `WebhookReady`;
|
|
105
|
+
- `IssueTrackingReady`;
|
|
106
|
+
- `CicdReady`;
|
|
107
|
+
- `GitForgeReady`;
|
|
108
|
+
- `RateLimited`;
|
|
109
|
+
- `BackfillHealthy`;
|
|
110
|
+
- `ConflictsPresent`;
|
|
111
|
+
- `Ready`.
|
|
112
|
+
|
|
113
|
+
## Storage class
|
|
114
|
+
|
|
115
|
+
- provider/binding/sync policy: CRD/etcd;
|
|
116
|
+
- deliveries/events/state/write intents/conflicts/object links: aggregated API/Postgres;
|
|
117
|
+
- large payloads/logs/artifacts: object storage by digest;
|
|
118
|
+
- provider credentials: Kubernetes Secret in org namespace.
|
|
119
|
+
|
|
120
|
+
## Detailed resource schemas
|
|
121
|
+
|
|
122
|
+
### `ExternalWebhookDelivery.spec`
|
|
123
|
+
|
|
124
|
+
```yaml
|
|
125
|
+
organizationRef: a5c
|
|
126
|
+
providerRef: github-a5c
|
|
127
|
+
bindingRef: github-kradle
|
|
128
|
+
interfaceHints: [gitForge, issueTracking]
|
|
129
|
+
deliveryId: "github-delivery-guid"
|
|
130
|
+
eventType: pull_request
|
|
131
|
+
action: opened
|
|
132
|
+
receivedAt: 2026-05-11T12:00:00Z
|
|
133
|
+
signature:
|
|
134
|
+
algorithm: sha256
|
|
135
|
+
verified: true
|
|
136
|
+
source:
|
|
137
|
+
owner: a5c-ai
|
|
138
|
+
repository: kradle
|
|
139
|
+
payloadRef:
|
|
140
|
+
storage: object
|
|
141
|
+
digest: sha256:payload
|
|
142
|
+
processing:
|
|
143
|
+
phase: Queued
|
|
144
|
+
attempts: 0
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### `ExternalSyncEvent.spec`
|
|
148
|
+
|
|
149
|
+
```yaml
|
|
150
|
+
organizationRef: a5c
|
|
151
|
+
providerRef: github-a5c
|
|
152
|
+
bindingRef: github-kradle
|
|
153
|
+
sourceDelivery: github-delivery-guid
|
|
154
|
+
interface: gitForge
|
|
155
|
+
resourceKind: PullRequest
|
|
156
|
+
nativeId: "42"
|
|
157
|
+
nodeId: PR_kwDO...
|
|
158
|
+
action: opened
|
|
159
|
+
eventTime: 2026-05-11T12:00:00Z
|
|
160
|
+
normalized:
|
|
161
|
+
repository: kradle
|
|
162
|
+
pullRequest: 42
|
|
163
|
+
headSha: abcdef1234
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### `ExternalWriteIntent.spec`
|
|
167
|
+
|
|
168
|
+
```yaml
|
|
169
|
+
organizationRef: a5c
|
|
170
|
+
providerRef: github-a5c
|
|
171
|
+
bindingRef: github-kradle
|
|
172
|
+
interface: issueTracking
|
|
173
|
+
operation: createComment
|
|
174
|
+
source:
|
|
175
|
+
kind: UserAction
|
|
176
|
+
actor: user:alice
|
|
177
|
+
target:
|
|
178
|
+
kind: Issue
|
|
179
|
+
name: issue-42
|
|
180
|
+
nativeTarget:
|
|
181
|
+
owner: a5c-ai
|
|
182
|
+
repository: kradle
|
|
183
|
+
issueNumber: 42
|
|
184
|
+
requestDigest: sha256:request
|
|
185
|
+
approvalPolicy:
|
|
186
|
+
required: false
|
|
187
|
+
idempotencyKey: a5c:issue-42:create-comment:01hx
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### `ExternalObjectLink.spec`
|
|
191
|
+
|
|
192
|
+
```yaml
|
|
193
|
+
organizationRef: a5c
|
|
194
|
+
providerRef: github-a5c
|
|
195
|
+
bindingRef: github-kradle
|
|
196
|
+
localRef:
|
|
197
|
+
apiVersion: kradle.a5c.ai/v1alpha1
|
|
198
|
+
kind: PullRequest
|
|
199
|
+
name: pr-42
|
|
200
|
+
external:
|
|
201
|
+
interface: gitForge
|
|
202
|
+
nativeId: "42"
|
|
203
|
+
nativeNumber: 42
|
|
204
|
+
nodeId: PR_kwDO...
|
|
205
|
+
url: https://github.com/a5c-ai/kradle/pull/42
|
|
206
|
+
apiUrl: https://api.github.com/repos/a5c-ai/kradle/pulls/42
|
|
207
|
+
etag: W/"..."
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Provider type registry
|
|
211
|
+
|
|
212
|
+
Provider types should be registered in a data-driven registry:
|
|
213
|
+
|
|
214
|
+
```yaml
|
|
215
|
+
providerType: github
|
|
216
|
+
interfaces: [issueTracking, cicd, gitForge]
|
|
217
|
+
hosting: [saas, ghe]
|
|
218
|
+
authModes: [github-app, oauth-user]
|
|
219
|
+
webhookSignature: hmac-sha256
|
|
220
|
+
supportsGraphql: true
|
|
221
|
+
supportsRest: true
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Custom providers can be loaded later through plugin registration, but CRDs should not need a schema change for every provider.
|
|
225
|
+
|
|
226
|
+
## Validation rules
|
|
227
|
+
|
|
228
|
+
- `providerType` must exist in registry or use `custom` with explicit adapter ref.
|
|
229
|
+
- enabled interface must be supported by provider descriptor.
|
|
230
|
+
- binding target must be in the same org.
|
|
231
|
+
- auth Secret must be in the org namespace.
|
|
232
|
+
- write mode must be compatible with provider operations.
|
|
233
|
+
- webhook endpoint must have a verification secret unless provider has a signed alternative.
|
|
234
|
+
- `ExternalWriteIntent` cannot reference raw Secret values.
|