@a5c-ai/krate 5.0.1-staging.00fa5317c
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 +183 -0
- package/bin/krate-demo.mjs +23 -0
- package/bin/krate-server.mjs +14 -0
- package/dist/krate-controller-ui.json +3205 -0
- package/dist/krate-lifecycle.json +201 -0
- package/dist/krate-runtime-snapshot.json +3125 -0
- package/dist/krate-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-krate-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/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/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/krate-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 +1275 -0
- package/docs/product-requirements.md +62 -0
- package/docs/roadmap-mvp.md +87 -0
- package/docs/system-requirements.md +90 -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/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 +63 -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 +93 -0
- package/scripts/validate-ui.mjs +278 -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 +209 -0
- package/src/agent-gateway-config-controller.js +147 -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 +280 -0
- package/src/agent-permission-review.js +250 -0
- package/src/agent-project-controller.js +117 -0
- package/src/agent-provider-config-controller.js +150 -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 +347 -0
- package/src/agent-subagent-controller.js +160 -0
- package/src/agent-transport-binding-controller.js +121 -0
- package/src/agent-trigger-controller.js +381 -0
- package/src/agent-workspace-controller.js +702 -0
- package/src/agent-writeback-controller.js +302 -0
- package/src/api-controller.js +541 -0
- package/src/argocd-gitops.js +43 -0
- package/src/async-controller.js +207 -0
- package/src/audit-controller.js +191 -0
- package/src/auth.js +307 -0
- package/src/component-catalog.js +41 -0
- package/src/control-plane.js +136 -0
- package/src/controller-client.js +72 -0
- package/src/controller-ui.js +617 -0
- package/src/data-plane.js +179 -0
- package/src/event-bus.js +61 -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 +161 -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/hooks-events.js +63 -0
- package/src/http-server.js +377 -0
- package/src/identity-policy.js +86 -0
- package/src/index.js +57 -0
- package/src/kubernetes-controller-async.js +511 -0
- package/src/kubernetes-controller.js +878 -0
- package/src/kubernetes-resource-gateway.js +48 -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 +221 -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/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 +315 -0
- package/tests/agent-gateway-config-controller.test.js +386 -0
- package/tests/agent-memory-controller.test.js +308 -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 +204 -0
- package/tests/agent-permission-review-v2.test.js +317 -0
- package/tests/agent-permission-review.test.js +209 -0
- package/tests/agent-project-controller.test.js +302 -0
- package/tests/agent-provider-config-controller.test.js +376 -0
- package/tests/agent-resources.test.js +228 -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 +221 -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 +211 -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/async-controller.test.js +252 -0
- package/tests/audit-controller.test.js +227 -0
- package/tests/codespace-controller.test.js +318 -0
- package/tests/deployment.test.js +407 -0
- package/tests/e2e/lifecycle.test.js +117 -0
- package/tests/event-bus-integration.test.js +190 -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 +340 -0
- package/tests/external-provider-adapter.test.js +365 -0
- package/tests/external-resource-model.test.js +215 -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/integration/full-flow.test.js +266 -0
- package/tests/krate.test.js +756 -0
- package/tests/memory-search-wiring.test.js +270 -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 +247 -0
- package/tests/sse-events.test.js +107 -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,62 @@
|
|
|
1
|
+
# Product Requirements
|
|
2
|
+
|
|
3
|
+
## Product summary
|
|
4
|
+
|
|
5
|
+
Krate is a Kubernetes-native forge for platform engineering teams. It extends the Kubernetes API with repository, pull request, issue, pipeline, runner, hook, and policy resources so Git workflows compose directly with RBAC, admission webhooks, Argo, Crossplane, ARC, Kyverno, and Gatekeeper.
|
|
6
|
+
|
|
7
|
+
## Problem
|
|
8
|
+
|
|
9
|
+
Existing Kubernetes-hosted forges are usually monoliths packaged in Helm. They still bring a separate identity model, permission model, webhook system, CI security surface, and integration layer. The naive Kubernetes-native design also fails if every issue/comment is stored in etcd, every repository gets its own PVC, or push traffic is cold-started.
|
|
10
|
+
|
|
11
|
+
## Goals
|
|
12
|
+
|
|
13
|
+
- Provide a forge where repos, PRs, CI, hooks, and policy share one Kubernetes identity and RBAC model.
|
|
14
|
+
- Make forge resources queryable and automatable with `kubectl`.
|
|
15
|
+
- Support admission-webhook policy for PRs, issues, and CI without custom integration glue.
|
|
16
|
+
- Keep high-cardinality social data out of etcd while preserving Kubernetes API semantics.
|
|
17
|
+
- Make GitOps transparency a first-class UX pattern for every mutation.
|
|
18
|
+
- Ship an MVP that proves policy, Git push, PR review, and CI identity end to end.
|
|
19
|
+
|
|
20
|
+
## Non-goals for MVP
|
|
21
|
+
|
|
22
|
+
- Scaled Gitea-backed production data plane beyond the single-backend MVP.
|
|
23
|
+
- Full native runner abstraction if ARC integration is sufficient for the first demo.
|
|
24
|
+
- Built-in code search beyond design-ready interfaces.
|
|
25
|
+
- Multi-cluster federation.
|
|
26
|
+
- Replacing Kyverno or Gatekeeper with a bespoke policy language.
|
|
27
|
+
|
|
28
|
+
## Personas
|
|
29
|
+
|
|
30
|
+
### Developer
|
|
31
|
+
|
|
32
|
+
Developers review PRs, browse code, debug failing runs, and need fast keyboard-first workflows. They should not need to understand cluster internals to use the forge, but should always be able to reveal the underlying resource and command.
|
|
33
|
+
|
|
34
|
+
### Platform engineer
|
|
35
|
+
|
|
36
|
+
Platform engineers own runner pools, policy, identity, storage, hooks, tenancy, install, upgrade, and cost. They need auditability, safe rollout modes, and GitOps-managed configuration.
|
|
37
|
+
|
|
38
|
+
### Repo admin
|
|
39
|
+
|
|
40
|
+
Repo admins configure repository settings, branch protection, webhooks, runner permissions, and policy overrides. They use the same IA as developers with additional settings access.
|
|
41
|
+
|
|
42
|
+
## Product principles
|
|
43
|
+
|
|
44
|
+
- Kubernetes is the backend. Krate should not recreate permission, policy, audit, and identity systems already present in Kubernetes.
|
|
45
|
+
- CRDs are contracts, not a database. High-cardinality records must live behind the aggregated API server.
|
|
46
|
+
- Push paths must stay warm. Reads can scale elastically; writes cannot impose cold-start latency on `git push`.
|
|
47
|
+
- UI state can be declarative. Saved views and selectors should be resources that teams can commit, share, and apply.
|
|
48
|
+
- Policy rollout must be observable. Audit mode and violation preview are required for PR policy authoring.
|
|
49
|
+
|
|
50
|
+
## Success metrics
|
|
51
|
+
|
|
52
|
+
- Time from `helm install krate` to first repository push is under 15 minutes in a documented environment.
|
|
53
|
+
- A Kyverno policy can block or audit PR creation without custom Krate code.
|
|
54
|
+
- A developer can open, review, and merge a PR with CI status from the UI.
|
|
55
|
+
- A platform engineer can configure a runner pool and export/save its YAML.
|
|
56
|
+
- Webhook failures are inspectable and replayable from both UI and `kubectl`.
|
|
57
|
+
|
|
58
|
+
## Organization-scoped tenancy
|
|
59
|
+
|
|
60
|
+
Krate is organization-first. Every repository, deployment, runner pool, agent stack, trigger, company brain memory repository, session, workspace, secret grant, and config grant belongs to an org. Each org maps to its own Kubernetes namespace so Kubernetes RBAC, ServiceAccounts, Secrets, ConfigMaps, admission, and audit remain the isolation boundary.
|
|
61
|
+
|
|
62
|
+
The UI should feel like GitHub organization navigation: select an org, then browse repositories, deployments, agents, memory, settings, runners, and audit for that org. Cross-org sharing is explicit policy, not an accidental reference.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# MVP Roadmap
|
|
2
|
+
|
|
3
|
+
## MVP promise
|
|
4
|
+
|
|
5
|
+
A user can install Krate, create a repository resource, push Git content, create/review a PR, run CI through ARC with Workload Identity, and apply a Kyverno policy that blocks a PR while the same policy appears in the UI.
|
|
6
|
+
|
|
7
|
+
## Six-week plan
|
|
8
|
+
|
|
9
|
+
### Weeks 1-2: Aggregated API server
|
|
10
|
+
|
|
11
|
+
Deliverables:
|
|
12
|
+
|
|
13
|
+
- `Repository` and `PullRequest` resources with Kubernetes discovery.
|
|
14
|
+
- Postgres-backed storage for aggregated resources.
|
|
15
|
+
- Working `kubectl get/create` flows.
|
|
16
|
+
- Initial RBAC and admission compatibility.
|
|
17
|
+
|
|
18
|
+
Exit criteria:
|
|
19
|
+
|
|
20
|
+
- PR creation and listing work through `kubectl`.
|
|
21
|
+
- PR data is not stored as large etcd objects.
|
|
22
|
+
|
|
23
|
+
### Week 3: Gitea-backed data plane
|
|
24
|
+
|
|
25
|
+
Deliverables:
|
|
26
|
+
|
|
27
|
+
- Gitea-backed smart-HTTP and SSH pathing.
|
|
28
|
+
- Single Gitea backend with persistent repository storage.
|
|
29
|
+
- `git-upload-pack` and `git-receive-pack` support.
|
|
30
|
+
- Repository operator creates Gitea repository integration plans.
|
|
31
|
+
|
|
32
|
+
Exit criteria:
|
|
33
|
+
|
|
34
|
+
- `kubectl create -f repo.yaml` followed by `git push` works.
|
|
35
|
+
|
|
36
|
+
### Week 4: Next.js skeleton
|
|
37
|
+
|
|
38
|
+
Deliverables:
|
|
39
|
+
|
|
40
|
+
- OIDC login skeleton.
|
|
41
|
+
- Repo list and file view.
|
|
42
|
+
- PR list.
|
|
43
|
+
- Watch API to SSE route.
|
|
44
|
+
- GitOps-transparent mutation panel pattern.
|
|
45
|
+
|
|
46
|
+
Exit criteria:
|
|
47
|
+
|
|
48
|
+
- Repo and PR pages update from watch streams.
|
|
49
|
+
|
|
50
|
+
### Week 5: PR creation and review
|
|
51
|
+
|
|
52
|
+
Deliverables:
|
|
53
|
+
|
|
54
|
+
- PR creation flow.
|
|
55
|
+
- Inline diff view.
|
|
56
|
+
- Comment threads.
|
|
57
|
+
- Pipeline status in PR rail.
|
|
58
|
+
|
|
59
|
+
Exit criteria:
|
|
60
|
+
|
|
61
|
+
- Developer can create and review a PR in the UI.
|
|
62
|
+
|
|
63
|
+
### Week 6: CI identity and demo
|
|
64
|
+
|
|
65
|
+
Deliverables:
|
|
66
|
+
|
|
67
|
+
- ARC-backed workflow execution.
|
|
68
|
+
- Workload Identity for CI jobs.
|
|
69
|
+
- Demo Kyverno PR policy.
|
|
70
|
+
- Outbound webhook and delivery log.
|
|
71
|
+
- Helm chart packaging.
|
|
72
|
+
|
|
73
|
+
Exit criteria:
|
|
74
|
+
|
|
75
|
+
- Public demo path: `helm install krate`; create repo; push; create PR; run CI; policy blocks a PR; UI shows policy and delivery state.
|
|
76
|
+
|
|
77
|
+
## Post-MVP roadmap
|
|
78
|
+
|
|
79
|
+
- v0.2: Live run view refinements, `RefPolicy` with WASM hooks, scaled Gitea data plane, and richer saved `View`/`Selector` templates.
|
|
80
|
+
- v0.3: Zoekt code search, multi-cluster federation, richer insights and cost attribution.
|
|
81
|
+
|
|
82
|
+
## Open decisions
|
|
83
|
+
|
|
84
|
+
- Commit to aggregated API server over pure CRDs for high-cardinality resources.
|
|
85
|
+
- Choose ARC-only MVP or executor-pluggable runner abstraction from day one.
|
|
86
|
+
- Decide whether to bundle Kyverno or support BYO only.
|
|
87
|
+
- Decide final product name before public README and chart publication.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# System Requirements
|
|
2
|
+
|
|
3
|
+
## Functional requirements
|
|
4
|
+
|
|
5
|
+
- Krate must expose forge resources through Kubernetes-style APIs.
|
|
6
|
+
- Low-cardinality declarative configuration must use CRDs: `Repository`, `WebhookSubscription`, `RefPolicy`, `BranchProtection`, `RunnerPool`, `View`, and `Selector`.
|
|
7
|
+
- High-cardinality social and execution data must be served by an aggregated API server backed by Postgres: `PullRequest`, `Issue`, `Review`, `Pipeline`, `Job`, and delivery records.
|
|
8
|
+
- Git traffic and Git hosting integrations must be backed by a Kubernetes-hosted Gitea backend server for smart-HTTP/SSH, repositories, SSH keys, collaborators/teams, protected branches, and webhooks.
|
|
9
|
+
- CI jobs must run under scoped Kubernetes ServiceAccounts, not PATs.
|
|
10
|
+
- UI mutations must share code paths with generated YAML/kubectl actions.
|
|
11
|
+
|
|
12
|
+
## Integration requirements
|
|
13
|
+
|
|
14
|
+
- Kubernetes API aggregation must register Krate aggregated resources with normal discovery, watch, list, get, create, update, patch, and delete semantics where applicable.
|
|
15
|
+
- Admission webhooks must be able to validate and mutate PRs, issues, pipelines, and jobs.
|
|
16
|
+
- Kyverno and OPA Gatekeeper policies must work on Krate resources without a Krate-specific policy adapter.
|
|
17
|
+
- Repository operator must reconcile `Repository` resources into Gitea repository hosting, access configuration, integration plans, and status.
|
|
18
|
+
- PR operator must support preview-environment integration through ArgoCD ApplicationSet.
|
|
19
|
+
- Runner integration must compose with ARC for MVP and leave an abstraction seam for Tekton or Buildkite Agent.
|
|
20
|
+
- Webhook delivery must integrate with durable queueing, preferably NATS JetStream, and HMAC signing.
|
|
21
|
+
|
|
22
|
+
## Publish and install requirements
|
|
23
|
+
|
|
24
|
+
- Krate must ship as a public Helm chart.
|
|
25
|
+
- The chart must install CRDs, APIService registration, aggregated API server, controllers, Gitea backend, Argo CD Application surface, UI, service accounts, RBAC, and default policies.
|
|
26
|
+
- Install documentation must describe required and optional dependencies: Kubernetes version, Argo CD, Gitea, Postgres, RWX storage, object storage, NATS, ARC, Kyverno/Gatekeeper, OIDC provider, and ingress.
|
|
27
|
+
- The chart must support BYO Postgres, BYO object storage, BYO RWX class, and BYO Kyverno/Gatekeeper.
|
|
28
|
+
- Install must support a minimal demo mode and a production-shaped mode.
|
|
29
|
+
|
|
30
|
+
## Upgrade requirements
|
|
31
|
+
|
|
32
|
+
- CRD schema upgrades must be backward compatible inside a supported minor version.
|
|
33
|
+
- Aggregated API storage migrations must be versioned, idempotent, and observable.
|
|
34
|
+
- Controllers must tolerate partially upgraded components during Helm rollout.
|
|
35
|
+
- Gitea backend versions must be rollable without corrupting repositories or interrupting in-flight receive-pack writes.
|
|
36
|
+
- Release notes must list API changes, migration steps, and rollback constraints.
|
|
37
|
+
|
|
38
|
+
## CI/CD requirements
|
|
39
|
+
|
|
40
|
+
- The repository must publish chart artifacts and container images together with traceable versions.
|
|
41
|
+
- CI must run schema validation, controller tests, API conformance checks, security scans, Helm template validation, and a smoke install.
|
|
42
|
+
- Release candidates must prove the MVP path: install, create repository, push, create PR, run CI, apply policy, observe webhook delivery.
|
|
43
|
+
|
|
44
|
+
## Security requirements
|
|
45
|
+
|
|
46
|
+
- Krate must not use personal access tokens as a core credential mechanism.
|
|
47
|
+
- Human login must use OIDC and Kubernetes user/group mapping.
|
|
48
|
+
- UI server-side calls must carry the user’s Kubernetes identity or a strictly scoped delegated token.
|
|
49
|
+
- Runner jobs must use projected ServiceAccount tokens scoped to repo, ref, and pipeline identity.
|
|
50
|
+
- Fork PRs must be forced into untrusted pools with no secrets and no cluster API access.
|
|
51
|
+
- Server-side custom Git hooks must run in a WASM sandbox, not arbitrary shell.
|
|
52
|
+
- Outbound webhooks must be signed and secret rotation must be supported.
|
|
53
|
+
|
|
54
|
+
## Observability requirements
|
|
55
|
+
|
|
56
|
+
- Expose metrics for API latency, Postgres latency, Git operation latency, Gitea capacity, queue depth, webhook delivery status, runner wait time, runner cost, and policy violations.
|
|
57
|
+
- Emit Kubernetes events for reconciliation failures and user-visible operational issues.
|
|
58
|
+
- Preserve auditability through Kubernetes resources and copyable kubectl-equivalent activity entries.
|
|
59
|
+
- Provide dashboards for runner pools, hook health, Gitea/storage health, and API health.
|
|
60
|
+
|
|
61
|
+
## Backup and restore requirements
|
|
62
|
+
|
|
63
|
+
- Backup Postgres, repository RWX storage, object storage, and declarative resources.
|
|
64
|
+
- Document consistent restore ordering: API/config, Postgres, repositories, objects, controllers.
|
|
65
|
+
- Validate restore by listing resources, reading repository refs, opening PRs, and replaying a representative webhook delivery.
|
|
66
|
+
|
|
67
|
+
## Release readiness gates
|
|
68
|
+
|
|
69
|
+
- All required docs in this directory exist and link from `docs/README.md`.
|
|
70
|
+
- Helm install smoke test passes in a documented cluster profile.
|
|
71
|
+
- MVP demo path is reproducible from a clean namespace.
|
|
72
|
+
- Security model is documented with explicit threat boundaries.
|
|
73
|
+
- Known open decisions are tracked in the roadmap.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## KubeVela and OAM requirements
|
|
77
|
+
|
|
78
|
+
- The deployment must optionally install KubeVela as a GitOps-managed dependency through Argo CD.
|
|
79
|
+
- Krate must assimilate OAM Application, Component, Trait, Policy, Workflow Step, and Scope concepts into its ontology and UI.
|
|
80
|
+
- The UI must wrap KubeVela capabilities as repository and pull-request delivery flows while preserving raw Kubernetes/OAM YAML.
|
|
81
|
+
- KubeVela owns OAM reconciliation status; Krate only projects and summarizes it.
|
|
82
|
+
|
|
83
|
+
## Organization and namespace requirements
|
|
84
|
+
|
|
85
|
+
- Krate must model `Organization` as the top-level product scope for repositories, deployments, agents, runners, memory, sessions, secrets, config, and audit.
|
|
86
|
+
- Each organization must own or bind to exactly one Kubernetes namespace by default.
|
|
87
|
+
- Namespaced product resources must carry org and namespace labels and reject cross-org references unless an explicit sharing policy exists.
|
|
88
|
+
- Controllers must run cluster-wide if needed but reconcile side effects through the owning org namespace.
|
|
89
|
+
- UI routes and API routes must support org-addressed access such as `/orgs/[org]/repositories/[repo]` and `/api/orgs/[org]/...`.
|
|
90
|
+
- Backup, restore, retention, and audit must support org-level export and recovery.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# QA automation and test strategy
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This directory defines Krate's QA automation plan, framework, and tooling for existing and future functionality. It covers unit tests, integration tests, API/controller tests, browser and UI tests, E2E tests, package/chart tests, security checks, accessibility, performance, coverage, fixtures, and CI gates.
|
|
6
|
+
|
|
7
|
+
The plan is product-wide: current forge features, Kubernetes-native resource APIs, org-scoped UI, Gitea/Git hosting, CI/runners, hooks, deployments, KubeVela/OAM, and future agent/company-brain functionality all share one quality model.
|
|
8
|
+
|
|
9
|
+
## Current test anchors
|
|
10
|
+
|
|
11
|
+
Krate already has these executable gates:
|
|
12
|
+
|
|
13
|
+
| Command | Current purpose |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `npm test` | Node test runner over `tests/*.test.js`. |
|
|
16
|
+
| `npm run e2e` | Node test runner over `tests/e2e/*.test.js`. |
|
|
17
|
+
| `npm run validate:docs` | docs/ontology/source coverage validation. |
|
|
18
|
+
| `npm run package:check` | package/chart/example coverage validation. |
|
|
19
|
+
| `npm run ui:validate` | static UI validation. |
|
|
20
|
+
| `npm run ui:build` | Next.js production build. |
|
|
21
|
+
| `npm run smoke` | runtime smoke validation. |
|
|
22
|
+
| `npm run check` | full local quality gate chaining build, docs, tests, e2e, package, smoke, UI validation, and UI build. |
|
|
23
|
+
|
|
24
|
+
## Documents
|
|
25
|
+
|
|
26
|
+
- [QA automation plan](./qa-automation-plan.md) defines the lifecycle, test pyramid, responsibilities, rollout order, and done criteria.
|
|
27
|
+
- [Test framework and tools](./test-framework-tools.md) defines the recommended tools and how they map to Krate layers.
|
|
28
|
+
- [Coverage model](./coverage-model.md) defines coverage dimensions, thresholds, traceability, and reporting.
|
|
29
|
+
- [Unit and integration tests](./unit-integration-tests.md) defines module, controller, API, resource-model, and persistence tests.
|
|
30
|
+
- [E2E and scenario tests](./e2e-scenario-tests.md) defines end-to-end flows for forge, org, runners, hooks, deployments, and agents.
|
|
31
|
+
- [Browser and UI tests](./browser-ui-tests.md) defines browser automation, component tests, accessibility, visual, and UX assertions.
|
|
32
|
+
- [CI quality gates](./ci-quality-gates.md) defines PR, merge, release, nightly, and staging gates.
|
|
33
|
+
- [Fixtures and test data](./fixtures-test-data.md) defines deterministic org/repo/memory/.a5c fixtures and data policy.
|
|
34
|
+
- [Security and compliance tests](./security-compliance-tests.md) defines auth, RBAC, secret, supply-chain, and audit checks.
|
|
35
|
+
- [Observability and reliability tests](./observability-reliability-tests.md) defines metrics, events, logs, watches, retries, and failure injection.
|
|
36
|
+
- [Agent QA plan](./agent-qa-plan.md) defines tests for agent dispatch, Agent Mux sessions, company brain memory, triggers, tools, subagents, and run imports.
|
|
37
|
+
|
|
38
|
+
## Quality principles
|
|
39
|
+
|
|
40
|
+
- Every feature has tests at the lowest useful layer plus at least one user-facing acceptance path.
|
|
41
|
+
- Every controller side effect has idempotency, retry, and audit tests.
|
|
42
|
+
- Every org-scoped path has cross-org negative tests.
|
|
43
|
+
- Every UI action has a server-enforced permission test behind it.
|
|
44
|
+
- Every secret/config/tool/memory path has no-leak tests.
|
|
45
|
+
- Every future feature ships with fixtures before broad E2E expansion.
|
|
46
|
+
- Browser tests focus on critical workflows and route semantics, not brittle snapshots.
|
|
47
|
+
- Package/chart checks are release blockers, not optional validation.
|
|
48
|
+
|
|
49
|
+
## Additional planning docs
|
|
50
|
+
|
|
51
|
+
- [Product test matrix](./product-test-matrix.md) maps every major product area to unit, integration/API, browser/UI, E2E, security, and package coverage.
|
|
52
|
+
- [Test suite layout and naming](./test-suite-layout.md) defines future test directories, naming, metadata, fixtures, and migration rules.
|
|
53
|
+
- [QA adoption roadmap](./qa-adoption-roadmap.md) sequences the move from current gates to browser, coverage, security, agent, and live reliability gates.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Agent QA plan
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
Agent QA covers future agent orchestration functionality:
|
|
6
|
+
|
|
7
|
+
- agent stacks, tools, MCP servers, skills, subagents;
|
|
8
|
+
- triggers from CI, webhooks, issues, PRs, labels, mentions, schedules, and manual UI;
|
|
9
|
+
- Agent Mux run/session/chat integration;
|
|
10
|
+
- dispatches displayed as CI-like runs;
|
|
11
|
+
- context assembly, labels, memory, redaction, and snapshots;
|
|
12
|
+
- company brain memory and `.a5c` run imports;
|
|
13
|
+
- approvals, artifacts, write-back, and audit;
|
|
14
|
+
- org-scoped RBAC, secrets, config, service accounts, and runner placement.
|
|
15
|
+
|
|
16
|
+
## Required suites
|
|
17
|
+
|
|
18
|
+
| Suite | Tests |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Stack schema | stack/tool/MCP/skill/subagent resource validation and readiness conditions. |
|
|
21
|
+
| Permission review | RBAC, secret/config grants, memory grants, missing capability explanations. |
|
|
22
|
+
| Context assembly | prompt layers, source provenance, labels, redaction, digest snapshots. |
|
|
23
|
+
| Dispatch lifecycle | create run/attempt, Agent Mux handoff, event stream, cancel/resume/retry. |
|
|
24
|
+
| Trigger rules | dry-run, dedupe, coalesce, branch/source filters, trusted/untrusted refs. |
|
|
25
|
+
| Agent Mux adapter | launch payload, capability discovery, session binding, transcript events. |
|
|
26
|
+
| Memory | query, historical refs, tool access, snapshot reuse, stale warnings. |
|
|
27
|
+
| Run import | `MEMORY.md`, sessions, `.a5c` journals/tasks/artifacts, redaction, PR review. |
|
|
28
|
+
| Write-back | patch/comment/check/review artifacts, approval, idempotency, rollback. |
|
|
29
|
+
| UI | dispatch composer, run detail/chat, memory dashboard, imports, approvals. |
|
|
30
|
+
|
|
31
|
+
## Critical negative tests
|
|
32
|
+
|
|
33
|
+
- stack references tool without required Secret grant;
|
|
34
|
+
- skill requires ConfigMap not granted;
|
|
35
|
+
- agent on fork tries to access trusted secrets;
|
|
36
|
+
- trigger label tries to grant permission;
|
|
37
|
+
- context label tries to hide instructions from preview;
|
|
38
|
+
- Agent Mux session ID belongs to another org/run;
|
|
39
|
+
- memory tool reads outside pinned snapshot;
|
|
40
|
+
- `.a5c` import contains secret-like content;
|
|
41
|
+
- write-back tries to mutate unapproved target;
|
|
42
|
+
- subagent requests parent-only capability.
|
|
43
|
+
|
|
44
|
+
## Browser journeys
|
|
45
|
+
|
|
46
|
+
- manual dispatch from Code page with memory preview;
|
|
47
|
+
- failed CI repair from Runs page;
|
|
48
|
+
- issue mention dispatch with linked workspace/session;
|
|
49
|
+
- run detail chat/session with event timeline;
|
|
50
|
+
- memory import review and approval;
|
|
51
|
+
- permission wizard fixes missing secret/config/memory grant;
|
|
52
|
+
- trigger rule dry-run preview.
|
|
53
|
+
|
|
54
|
+
## Done criteria
|
|
55
|
+
|
|
56
|
+
Agent functionality is not production-ready until:
|
|
57
|
+
|
|
58
|
+
- unit/integration/API tests cover resource and controller logic;
|
|
59
|
+
- browser tests cover the primary user journeys;
|
|
60
|
+
- cross-org and no-secret negative tests pass;
|
|
61
|
+
- Agent Mux fake/session tests pass;
|
|
62
|
+
- memory snapshot and import fixtures pass;
|
|
63
|
+
- audit/events can explain every dispatch and write-back.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Browser and UI tests
|
|
2
|
+
|
|
3
|
+
## Browser framework
|
|
4
|
+
|
|
5
|
+
Use Playwright for browser E2E once added. Browser tests should focus on route behavior, accessibility, and critical workflows rather than brittle visual snapshots.
|
|
6
|
+
|
|
7
|
+
## Route smoke coverage
|
|
8
|
+
|
|
9
|
+
Required route smoke tests:
|
|
10
|
+
|
|
11
|
+
- `/orgs`;
|
|
12
|
+
- `/orgs/[org]`;
|
|
13
|
+
- `/orgs/[org]/repositories`;
|
|
14
|
+
- `/orgs/[org]/repositories/[repo]/code`;
|
|
15
|
+
- `/issues`, `/pull-requests`, `/runs`, `/hooks`, `/settings` under repo routes;
|
|
16
|
+
- `/orgs/[org]/deployments`;
|
|
17
|
+
- `/orgs/[org]/runs`;
|
|
18
|
+
- future `/orgs/[org]/agents/*` and `/orgs/[org]/agents/memory/*`.
|
|
19
|
+
|
|
20
|
+
Every route smoke asserts:
|
|
21
|
+
|
|
22
|
+
- org switcher visible;
|
|
23
|
+
- breadcrumbs include org;
|
|
24
|
+
- main heading exists;
|
|
25
|
+
- no server error;
|
|
26
|
+
- advanced YAML/resource panels are reachable where expected;
|
|
27
|
+
- unauthorized or missing resources show safe empty states.
|
|
28
|
+
|
|
29
|
+
## Critical UI journeys
|
|
30
|
+
|
|
31
|
+
| Journey | Assertions |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| Org switch | route changes org, data changes, no cross-org leakage. |
|
|
34
|
+
| Repository navigation | tabs preserve org/repo and active page. |
|
|
35
|
+
| Create/apply resource | YAML/plan preview, server validation, status update. |
|
|
36
|
+
| Run debugging | run list, event stream, details, rerun affordance. |
|
|
37
|
+
| Agent dispatch | composer, memory preview, permission review, created run link. |
|
|
38
|
+
| Memory import review | generated diff, redaction status, validation status, approve/reject. |
|
|
39
|
+
|
|
40
|
+
## Accessibility checks
|
|
41
|
+
|
|
42
|
+
Run automated checks on primary routes for:
|
|
43
|
+
|
|
44
|
+
- headings and landmarks;
|
|
45
|
+
- form labels;
|
|
46
|
+
- button/link names;
|
|
47
|
+
- keyboard navigation;
|
|
48
|
+
- focus management in dialogs/panels;
|
|
49
|
+
- color contrast for status indicators;
|
|
50
|
+
- reduced-motion behavior where relevant.
|
|
51
|
+
|
|
52
|
+
## Visual regression
|
|
53
|
+
|
|
54
|
+
Use visual checks sparingly for stable layout contracts:
|
|
55
|
+
|
|
56
|
+
- app shell/sidebar/topbar;
|
|
57
|
+
- repository code layout;
|
|
58
|
+
- run detail layout;
|
|
59
|
+
- memory import review panel;
|
|
60
|
+
- empty/loading/error states.
|
|
61
|
+
|
|
62
|
+
Prefer semantic assertions for changing data-heavy pages.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# CI quality gates
|
|
2
|
+
|
|
3
|
+
## Gate levels
|
|
4
|
+
|
|
5
|
+
| Gate | Trigger | Required checks |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| PR fast gate | pull request | install, static/docs/package checks, unit/integration tests, UI validation. |
|
|
8
|
+
| PR browser gate | pull request when UI changes | browser route smoke, critical UI journeys impacted by change. |
|
|
9
|
+
| Merge gate | main/staging merge | full `npm run check`, package/chart validation, UI build. |
|
|
10
|
+
| Nightly gate | schedule | live-ish integration, browser full suite, security scans, performance smoke. |
|
|
11
|
+
| Release gate | tag/release | Docker build, Helm package, smoke install, upgrade/rollback plan, SBOM/signing if enabled. |
|
|
12
|
+
| Staging gate | deployment | real cluster smoke, webhooks, runners, Gitea, Argo/KubeVela, Agent Mux if enabled. |
|
|
13
|
+
|
|
14
|
+
## Current required local gate
|
|
15
|
+
|
|
16
|
+
`npm run check` remains the all-up local gate:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
build -> validate:docs -> test -> e2e -> package:check -> smoke -> ui:validate -> ui:build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Future gate additions
|
|
23
|
+
|
|
24
|
+
- `test:browser` for Playwright route and journey tests.
|
|
25
|
+
- `test:coverage` for coverage reporting.
|
|
26
|
+
- `test:security` for dependency, secret, and auth/RBAC checks.
|
|
27
|
+
- `test:charts` for rendered chart validation.
|
|
28
|
+
- `test:agents` for agent/company-brain vertical slice.
|
|
29
|
+
|
|
30
|
+
## CI artifact policy
|
|
31
|
+
|
|
32
|
+
CI should retain:
|
|
33
|
+
|
|
34
|
+
- test logs;
|
|
35
|
+
- browser traces/screenshots/videos on failure;
|
|
36
|
+
- coverage reports;
|
|
37
|
+
- rendered manifests;
|
|
38
|
+
- package validation report;
|
|
39
|
+
- memory import redaction/validation fixtures;
|
|
40
|
+
- smoke output;
|
|
41
|
+
- SBOM/signature artifacts when release gates run.
|
|
42
|
+
|
|
43
|
+
## Flake policy
|
|
44
|
+
|
|
45
|
+
- A flaky test is a failing test until triaged.
|
|
46
|
+
- Retries may be used only to collect evidence, not to hide failures.
|
|
47
|
+
- Quarantined tests need owner, expiry, issue link, and reduced gate impact.
|
|
48
|
+
- CI should track test duration and failure signatures.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Coverage model
|
|
2
|
+
|
|
3
|
+
## Coverage dimensions
|
|
4
|
+
|
|
5
|
+
Krate coverage is multi-dimensional. Line coverage is useful but not sufficient.
|
|
6
|
+
|
|
7
|
+
| Dimension | Required coverage |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Code coverage | statements, branches, functions, and critical path modules. |
|
|
10
|
+
| Resource coverage | every CRD/config kind and aggregated kind has schema and example tests. |
|
|
11
|
+
| Route coverage | every org/repo/agent/deployment route has render and authorization tests. |
|
|
12
|
+
| API coverage | every typed endpoint has success, validation failure, auth failure, and cross-org negative tests. |
|
|
13
|
+
| Controller coverage | reconcile create/update/delete, idempotency, retry, drift, finalizer, and status conditions. |
|
|
14
|
+
| UI coverage | primary journeys, disabled states, advanced YAML panels, accessibility, route guards. |
|
|
15
|
+
| Security coverage | auth, RBAC, Secret/ConfigMap grants, no-leak responses, audit records. |
|
|
16
|
+
| Release coverage | package files, chart templates, CRDs, examples, smoke install, Docker image. |
|
|
17
|
+
| Agent coverage | dispatch, context, memory, tools, triggers, sessions, imports, approvals, write-back. |
|
|
18
|
+
|
|
19
|
+
## Initial thresholds
|
|
20
|
+
|
|
21
|
+
| Layer | Target |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| Pure `src` modules | 85% line, 75% branch once coverage tooling lands. |
|
|
24
|
+
| Controller/API critical paths | 90% path coverage by table-driven tests. |
|
|
25
|
+
| UI route smoke | 100% of primary org/repo/deployment/agent routes render. |
|
|
26
|
+
| Resource kinds | 100% listed in resource model, docs, package examples, and tests. |
|
|
27
|
+
| Security negative paths | 100% for cross-org, no-secret, untrusted fork, and missing grant cases. |
|
|
28
|
+
|
|
29
|
+
Thresholds should ratchet upward; do not block early docs-only work on coverage tooling that does not exist yet.
|
|
30
|
+
|
|
31
|
+
## Traceability
|
|
32
|
+
|
|
33
|
+
Every feature should map:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
requirement -> resource/API/UI/controller -> test file -> CI gate -> artifact/report
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The existing `docs/agents/traceability-matrix.md` is the model for agent features. Product-wide coverage should extend the same pattern into `docs/tests`.
|
|
40
|
+
|
|
41
|
+
## Coverage reports
|
|
42
|
+
|
|
43
|
+
Reports should include:
|
|
44
|
+
|
|
45
|
+
- per-command status;
|
|
46
|
+
- code coverage when available;
|
|
47
|
+
- resource kind coverage;
|
|
48
|
+
- route/API coverage;
|
|
49
|
+
- browser scenario coverage;
|
|
50
|
+
- security negative coverage;
|
|
51
|
+
- flaky tests and retries;
|
|
52
|
+
- untested new files/resources.
|
|
53
|
+
|
|
54
|
+
## Coverage exclusions
|
|
55
|
+
|
|
56
|
+
Allowed exclusions:
|
|
57
|
+
|
|
58
|
+
- generated files;
|
|
59
|
+
- static docs;
|
|
60
|
+
- vendored assets;
|
|
61
|
+
- intentionally unreachable defensive branches when documented;
|
|
62
|
+
- live-only integrations covered by staging/nightly gates.
|
|
63
|
+
|
|
64
|
+
Exclusions must be explicit and reviewed.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# E2E and scenario tests
|
|
2
|
+
|
|
3
|
+
## Existing E2E baseline
|
|
4
|
+
|
|
5
|
+
Current E2E tests validate chart package surface and minikube dry-run command plans. This remains the first E2E layer because it is deterministic and does not require a live cluster.
|
|
6
|
+
|
|
7
|
+
## Core forge scenarios
|
|
8
|
+
|
|
9
|
+
| Scenario | Steps | Assertions |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| Create repository | org dashboard -> repositories -> create | repository resource exists, clone instructions render, namespace/org labels exist. |
|
|
12
|
+
| Pull request lifecycle | create PR -> review -> CI status -> merge | PR status, review state, pipeline/job link, policy gates. |
|
|
13
|
+
| CI run lifecycle | trigger pipeline -> jobs run -> logs/events -> rerun | pipeline/job statuses, runner pool, ServiceAccount, artifacts. |
|
|
14
|
+
| Webhook delivery | configure hook -> send test delivery -> replay failed delivery | signed payload, retry policy, delivery records. |
|
|
15
|
+
| Deployment promotion | repo change -> deployment page -> promote/rollback | OAM/Argo status, environment scoping, audit. |
|
|
16
|
+
| Org isolation | duplicate repo slug across orgs | no silent legacy route selection, cross-org API denial. |
|
|
17
|
+
|
|
18
|
+
## Agent and memory scenarios
|
|
19
|
+
|
|
20
|
+
| Scenario | Steps | Assertions |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| Manual agent dispatch | repo code -> dispatch agent -> run detail | dispatch run, attempt, Agent Mux session, context bundle. |
|
|
23
|
+
| Dispatch with memory | select memory source -> preview -> dispatch | memory snapshot commit, selected records, digests, redaction. |
|
|
24
|
+
| Historical memory | choose `refAt` -> dispatch -> retry | retry stays pinned, stale warning shown. |
|
|
25
|
+
| Import run memory | run detail -> import `.a5c` summary -> approve | redacted import, validation report, memory PR/commit. |
|
|
26
|
+
| Triggered repair | failed CI -> trigger rule -> dispatch | dedupe, permission review, run row beside pipeline. |
|
|
27
|
+
| Write-back approval | agent proposes patch/comment -> approve | artifact digest, approval audit, PR/comment update. |
|
|
28
|
+
|
|
29
|
+
## Live cluster scenarios
|
|
30
|
+
|
|
31
|
+
Nightly/staging suites should eventually run against a real cluster with:
|
|
32
|
+
|
|
33
|
+
- Kubernetes API aggregation;
|
|
34
|
+
- Gitea smart HTTP/SSH;
|
|
35
|
+
- Postgres;
|
|
36
|
+
- object storage;
|
|
37
|
+
- NATS/webhook queue;
|
|
38
|
+
- Argo CD/KubeVela;
|
|
39
|
+
- ARC or runner abstraction;
|
|
40
|
+
- Agent Mux gateway/runtime when enabled.
|
|
41
|
+
|
|
42
|
+
## E2E artifacts
|
|
43
|
+
|
|
44
|
+
E2E tests should collect:
|
|
45
|
+
|
|
46
|
+
- generated resources;
|
|
47
|
+
- API responses;
|
|
48
|
+
- event/watch logs;
|
|
49
|
+
- screenshots/traces for browser flows;
|
|
50
|
+
- Helm manifests;
|
|
51
|
+
- controller logs;
|
|
52
|
+
- redaction/validation reports;
|
|
53
|
+
- audit event excerpts.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Fixtures and test data
|
|
2
|
+
|
|
3
|
+
## Principles
|
|
4
|
+
|
|
5
|
+
- Fixtures are deterministic and committed to the repo.
|
|
6
|
+
- Fixtures must never contain real secrets, tokens, private keys, customer data, or personal data beyond synthetic examples.
|
|
7
|
+
- Secret-like synthetic values should be clearly marked and used only to test redaction.
|
|
8
|
+
- Every fixture has an owner and purpose.
|
|
9
|
+
- Fixtures should be small enough to understand in a test failure.
|
|
10
|
+
|
|
11
|
+
## Core fixtures
|
|
12
|
+
|
|
13
|
+
| Fixture | Purpose |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| default org | simple org and namespace for current tests. |
|
|
16
|
+
| duplicate org repos | route ambiguity and cross-org denial. |
|
|
17
|
+
| repository with PR/issue/pipeline | core forge E2E path. |
|
|
18
|
+
| webhook delivery set | success, retry, replay, signature mismatch. |
|
|
19
|
+
| runner pool/job set | trusted/untrusted runner policy. |
|
|
20
|
+
| deployment/OAM set | environment, promotion, rollback. |
|
|
21
|
+
| company brain memory repo | graph/Markdown/frontmatter/search fixtures. |
|
|
22
|
+
| `.a5c` run fixture | Babysitter run import and redaction. |
|
|
23
|
+
| Agent Mux session fixture | session binding, transcript summary, events. |
|
|
24
|
+
|
|
25
|
+
## Directory proposal
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
tests/fixtures/
|
|
29
|
+
orgs/
|
|
30
|
+
repositories/
|
|
31
|
+
resources/
|
|
32
|
+
webhooks/
|
|
33
|
+
runners/
|
|
34
|
+
deployments/
|
|
35
|
+
agents/
|
|
36
|
+
memory/
|
|
37
|
+
company-brain/
|
|
38
|
+
a5c-runs/
|
|
39
|
+
sessions/
|
|
40
|
+
browser/
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Redaction fixture requirements
|
|
44
|
+
|
|
45
|
+
Redaction fixtures should include synthetic values that look like:
|
|
46
|
+
|
|
47
|
+
- API keys;
|
|
48
|
+
- bearer tokens;
|
|
49
|
+
- private key headers;
|
|
50
|
+
- kubeconfig snippets;
|
|
51
|
+
- webhook signatures;
|
|
52
|
+
- high-entropy strings.
|
|
53
|
+
|
|
54
|
+
Tests assert these values do not appear in prompt previews, context bundles, memory imports, transcripts, artifacts, API responses, UI, or audit records.
|
|
55
|
+
|
|
56
|
+
## Fixture review checklist
|
|
57
|
+
|
|
58
|
+
- No real credentials.
|
|
59
|
+
- No real customer data.
|
|
60
|
+
- Org labels and namespace fields included.
|
|
61
|
+
- Expected status conditions documented.
|
|
62
|
+
- Stable timestamps and IDs.
|
|
63
|
+
- Cross-platform paths where possible.
|