@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,54 @@
|
|
|
1
|
+
# Observability and reliability tests
|
|
2
|
+
|
|
3
|
+
## Observability coverage
|
|
4
|
+
|
|
5
|
+
Required signals:
|
|
6
|
+
|
|
7
|
+
- API request latency and errors;
|
|
8
|
+
- controller reconcile counts, durations, retries, and failures;
|
|
9
|
+
- watch connection counts and reconnects;
|
|
10
|
+
- Git operation latency/errors;
|
|
11
|
+
- webhook queue depth and delivery status;
|
|
12
|
+
- runner queue/wait/runtime metrics;
|
|
13
|
+
- memory query latency and import validation status;
|
|
14
|
+
- Agent Mux session binding and event stream status;
|
|
15
|
+
- audit event counts by action/outcome.
|
|
16
|
+
|
|
17
|
+
## Reliability tests
|
|
18
|
+
|
|
19
|
+
| Failure | Expected behavior |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| Kubernetes API temporary failure | retry with backoff, status condition, no duplicate side effects. |
|
|
22
|
+
| Gitea unavailable | repository status degraded, no data loss, UI warning. |
|
|
23
|
+
| Postgres unavailable | aggregated API degraded/read-only where possible. |
|
|
24
|
+
| object storage unavailable | artifact writes fail safely with retry. |
|
|
25
|
+
| webhook receiver fails | retry and replay available. |
|
|
26
|
+
| watch disconnects | UI reconnects and resumes from list state. |
|
|
27
|
+
| memory repo unavailable | required-memory dispatch blocks, optional memory warns. |
|
|
28
|
+
| Agent Mux unavailable | dispatch shows pending/failed handoff and retry/recover action. |
|
|
29
|
+
| redaction failure | memory import blocks and no content leaks. |
|
|
30
|
+
|
|
31
|
+
## Chaos and load
|
|
32
|
+
|
|
33
|
+
Nightly/staging tests should eventually cover:
|
|
34
|
+
|
|
35
|
+
- burst webhook deliveries;
|
|
36
|
+
- many repository list queries;
|
|
37
|
+
- concurrent dispatches;
|
|
38
|
+
- runner pool exhaustion;
|
|
39
|
+
- memory grep/query bounds;
|
|
40
|
+
- large context truncation;
|
|
41
|
+
- controller restart during reconciliation;
|
|
42
|
+
- duplicate event delivery idempotency.
|
|
43
|
+
|
|
44
|
+
## Audit assertions
|
|
45
|
+
|
|
46
|
+
Every mutating or denied action should emit audit with:
|
|
47
|
+
|
|
48
|
+
- org and namespace;
|
|
49
|
+
- actor;
|
|
50
|
+
- resource ref;
|
|
51
|
+
- action and outcome;
|
|
52
|
+
- source event/run/session when applicable;
|
|
53
|
+
- digest fields for artifacts/context/memory;
|
|
54
|
+
- no secret values.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Product test matrix
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This matrix maps Krate product areas to required automated test coverage. It covers existing functionality and future agent/company-brain functionality so implementation work can add tests in the right layer instead of relying on one broad E2E path.
|
|
6
|
+
|
|
7
|
+
## Matrix legend
|
|
8
|
+
|
|
9
|
+
| Mark | Meaning |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Required | must exist before feature is considered complete. |
|
|
12
|
+
| Recommended | should exist when the feature reaches production or staging. |
|
|
13
|
+
| Nightly | acceptable in slower scheduled/live suites. |
|
|
14
|
+
| Future | planned once the underlying feature exists. |
|
|
15
|
+
|
|
16
|
+
## Product-area coverage
|
|
17
|
+
|
|
18
|
+
| Product area | Unit | Integration/API | Browser/UI | E2E/scenario | Security | Package/install |
|
|
19
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
20
|
+
| Resource model and schemas | Required | Required | Recommended | Recommended | Recommended | Required |
|
|
21
|
+
| Organization and namespace scoping | Required | Required | Required | Required | Required | Required |
|
|
22
|
+
| Repository data plane | Required | Required | Required | Required | Required | Required |
|
|
23
|
+
| Pull requests and reviews | Required | Required | Required | Required | Recommended | Recommended |
|
|
24
|
+
| Issues and inbox | Required | Required | Required | Recommended | Recommended | Recommended |
|
|
25
|
+
| Pipelines and jobs | Required | Required | Required | Required | Required | Required |
|
|
26
|
+
| Runner pools and job isolation | Required | Required | Recommended | Required | Required | Required |
|
|
27
|
+
| Webhook subscriptions and deliveries | Required | Required | Required | Required | Required | Recommended |
|
|
28
|
+
| Identity, auth, teams, invites | Required | Required | Required | Recommended | Required | Required |
|
|
29
|
+
| RBAC and policy | Required | Required | Recommended | Required | Required | Required |
|
|
30
|
+
| Secrets and config grants | Required | Required | Required | Required | Required | Recommended |
|
|
31
|
+
| Deployments and environments | Required | Required | Required | Required | Recommended | Required |
|
|
32
|
+
| Argo CD and KubeVela/OAM | Required | Required | Recommended | Nightly | Recommended | Required |
|
|
33
|
+
| Operations install/readiness | Required | Required | Required | Required | Required | Required |
|
|
34
|
+
| Web UI shell and navigation | Recommended | Recommended | Required | Required | Recommended | Recommended |
|
|
35
|
+
| Advanced YAML/resource panels | Required | Required | Required | Recommended | Required | Recommended |
|
|
36
|
+
| Agent stacks and capabilities | Future | Future | Future | Future | Future | Future |
|
|
37
|
+
| Agent dispatch and Agent Mux | Future | Future | Future | Future | Future | Future |
|
|
38
|
+
| Agent triggers | Future | Future | Future | Future | Future | Future |
|
|
39
|
+
| Agent workspaces and sessions | Future | Future | Future | Future | Future | Future |
|
|
40
|
+
| Company brain memory | Future | Future | Future | Future | Future | Future |
|
|
41
|
+
| `.a5c` run memory imports | Future | Future | Future | Future | Future | Future |
|
|
42
|
+
| Artifacts and write-back | Future | Future | Future | Future | Future | Future |
|
|
43
|
+
| Packaging and release | Required | Required | Recommended | Required | Required | Required |
|
|
44
|
+
|
|
45
|
+
## Existing command mapping
|
|
46
|
+
|
|
47
|
+
| Command | Covers | Gaps |
|
|
48
|
+
| --- | --- | --- |
|
|
49
|
+
| `npm test` | unit/integration tests in `tests/*.test.js` | not yet split by subsystem; no coverage report. |
|
|
50
|
+
| `npm run e2e` | current deterministic package/minikube E2E tests | no browser automation or live cluster path. |
|
|
51
|
+
| `npm run validate:docs` | docs/source/ontology coverage | does not validate all `docs/tests` requirements yet. |
|
|
52
|
+
| `npm run package:check` | package/chart/example coverage | not yet aware of future agent/memory CRDs. |
|
|
53
|
+
| `npm run smoke` | runtime smoke | should expand as APIs/routes grow. |
|
|
54
|
+
| `npm run ui:validate` | static UI validation | not a browser test. |
|
|
55
|
+
| `npm run ui:build` | Next production build | not behavioral UI coverage. |
|
|
56
|
+
| `npm run check` | all current gates | should remain required as new gates are added. |
|
|
57
|
+
|
|
58
|
+
## Future suite mapping
|
|
59
|
+
|
|
60
|
+
| Future suite | Product areas |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| `test:unit` | resource model, route helpers, redaction, context assembly, ref resolution, validators. |
|
|
63
|
+
| `test:integration` | API controller, controller fakes, memory import, Gitea/K8s/Agent Mux fakes. |
|
|
64
|
+
| `test:api` | org-scoped endpoints, stable errors, resource actions, watch filters. |
|
|
65
|
+
| `test:browser` | org navigation, repository flows, deployments, run detail, agent/memory flows. |
|
|
66
|
+
| `test:coverage` | coverage thresholds and untested-file reporting. |
|
|
67
|
+
| `test:security` | auth/RBAC/no-secret/cross-org/secret-grant checks. |
|
|
68
|
+
| `test:charts` | Helm render, CRD examples, kubeconform, APIService/RBAC. |
|
|
69
|
+
| `test:agents` | agent dispatch, context, memory, Agent Mux, imports, triggers. |
|
|
70
|
+
| `test:live` | real cluster/Gitea/Argo/KubeVela/NATS/ARC/Object storage. |
|
|
71
|
+
|
|
72
|
+
## Required negative coverage
|
|
73
|
+
|
|
74
|
+
Every relevant product area must include negative tests for:
|
|
75
|
+
|
|
76
|
+
- missing or mismatched `organizationRef`;
|
|
77
|
+
- wrong namespace for org;
|
|
78
|
+
- missing RBAC permission;
|
|
79
|
+
- missing Secret/ConfigMap grant;
|
|
80
|
+
- untrusted fork or untrusted runner tries privileged action;
|
|
81
|
+
- cross-org resource reference;
|
|
82
|
+
- invalid or stale Git ref;
|
|
83
|
+
- invalid webhook signature;
|
|
84
|
+
- resource deleted while a controller is reconciling;
|
|
85
|
+
- secret-like value appears in input and must not appear in output;
|
|
86
|
+
- watch reconnect after disconnect;
|
|
87
|
+
- duplicate event delivery and idempotency.
|
|
88
|
+
|
|
89
|
+
## Release readiness matrix
|
|
90
|
+
|
|
91
|
+
A release candidate is blocked if any of these are missing:
|
|
92
|
+
|
|
93
|
+
- package/chart validation;
|
|
94
|
+
- CRD/example coverage for every shipped kind;
|
|
95
|
+
- at least one install smoke path;
|
|
96
|
+
- auth/RBAC/no-secret tests;
|
|
97
|
+
- UI build and route smoke;
|
|
98
|
+
- repository/PR/CI core E2E;
|
|
99
|
+
- deployment/OAM smoke when deployment features ship;
|
|
100
|
+
- agent/company-brain vertical slice when agent features ship;
|
|
101
|
+
- documented known gaps and quarantined tests.
|
|
102
|
+
|
|
103
|
+
## External backend coverage
|
|
104
|
+
|
|
105
|
+
External provider support adds required coverage for:
|
|
106
|
+
|
|
107
|
+
| Area | Required tests |
|
|
108
|
+
| --- | --- |
|
|
109
|
+
| Provider auth | GitHub App Secret metadata, installation access, no-token leak. |
|
|
110
|
+
| Webhooks | signature validation, dedupe, replay, enqueue, malformed payload. |
|
|
111
|
+
| Issue interface | issue/comment/label sync, PR-backed issue handling, conflicts. |
|
|
112
|
+
| CI/CD interface | workflow run/job/check sync, rerun/cancel permissions, lazy logs. |
|
|
113
|
+
| Git forge interface | repo/PR/ref/key/branch protection sync and drift. |
|
|
114
|
+
| Bidirectional writes | write intent, approval, provider failure, confirmation, conflict. |
|
|
115
|
+
| Rate limits | backoff, degraded status, resume. |
|
|
116
|
+
| Cross-org | provider binding and native object references cannot cross orgs. |
|
|
117
|
+
|
|
118
|
+
## Pluggable provider contract tests
|
|
119
|
+
|
|
120
|
+
Each provider adapter should run a shared contract suite for every supported interface:
|
|
121
|
+
|
|
122
|
+
| Contract suite | Providers |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| Issue tracking contract | GitHub, GitLab, Bitbucket when enabled, Azure DevOps, Jira, Linear, Gitea, custom. |
|
|
125
|
+
| CI/CD contract | GitHub Actions, GitLab CI, Bitbucket Pipelines, Azure Pipelines, Buildkite, CircleCI, Jenkins, custom. |
|
|
126
|
+
| Git forge contract | GitHub, GitLab, Bitbucket, Azure Repos, Gitea, Gerrit, raw Git partial, custom. |
|
|
127
|
+
| Webhook contract | any provider with webhooks. |
|
|
128
|
+
| Write-intent contract | any provider with mutating operations. |
|
|
129
|
+
| Conflict contract | any bidirectional provider. |
|
|
130
|
+
|
|
131
|
+
Contract tests should use fake provider adapters first, then provider-specific fixtures and optional live tests.
|
|
132
|
+
|
|
133
|
+
## External UX flow tests
|
|
134
|
+
|
|
135
|
+
Browser and E2E tests should cover:
|
|
136
|
+
|
|
137
|
+
- connect GitHub provider;
|
|
138
|
+
- connect Jira issue-only provider;
|
|
139
|
+
- combine GitHub forge with Buildkite CI;
|
|
140
|
+
- resolve a sync conflict;
|
|
141
|
+
- approve an agent-proposed external write;
|
|
142
|
+
- replay a dead-lettered webhook;
|
|
143
|
+
- show provider rate-limit degraded state.
|
|
144
|
+
|
|
145
|
+
These flows are specified in `docs/external/external-backend-ux-flows.md`.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# QA adoption roadmap
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This roadmap sequences QA automation work so Krate can improve coverage without blocking every product change on the final-state toolchain.
|
|
6
|
+
|
|
7
|
+
## Stage 0: current baseline
|
|
8
|
+
|
|
9
|
+
Status: available now.
|
|
10
|
+
|
|
11
|
+
Required gates:
|
|
12
|
+
|
|
13
|
+
- `npm run validate:docs`;
|
|
14
|
+
- `npm test`;
|
|
15
|
+
- `npm run e2e`;
|
|
16
|
+
- `npm run package:check`;
|
|
17
|
+
- `npm run smoke`;
|
|
18
|
+
- `npm run ui:validate`;
|
|
19
|
+
- `npm run ui:build`;
|
|
20
|
+
- `npm run check` before release-like changes.
|
|
21
|
+
|
|
22
|
+
## Stage 1: suite organization
|
|
23
|
+
|
|
24
|
+
Add:
|
|
25
|
+
|
|
26
|
+
- `tests/fixtures` with org/repository/resource fixtures;
|
|
27
|
+
- test helper modules for fake Kubernetes and API controller setup;
|
|
28
|
+
- metadata comments for owner/gate/area;
|
|
29
|
+
- docs check that `docs/tests` exists and is linked.
|
|
30
|
+
|
|
31
|
+
Exit criteria:
|
|
32
|
+
|
|
33
|
+
- existing tests still pass;
|
|
34
|
+
- new fixture policy is followed;
|
|
35
|
+
- no behavior change required.
|
|
36
|
+
|
|
37
|
+
## Stage 2: browser route smoke
|
|
38
|
+
|
|
39
|
+
Add:
|
|
40
|
+
|
|
41
|
+
- Playwright dependency and config;
|
|
42
|
+
- route smoke for org dashboard, repositories, repo code/issues/runs/settings, deployments, and operations pages;
|
|
43
|
+
- screenshot/trace capture on failure;
|
|
44
|
+
- accessibility smoke on primary routes.
|
|
45
|
+
|
|
46
|
+
Exit criteria:
|
|
47
|
+
|
|
48
|
+
- browser gate runs in CI for UI changes;
|
|
49
|
+
- route failures show useful artifacts;
|
|
50
|
+
- no test relies on live external services.
|
|
51
|
+
|
|
52
|
+
## Stage 3: coverage and API suites
|
|
53
|
+
|
|
54
|
+
Add:
|
|
55
|
+
|
|
56
|
+
- coverage command and reporting;
|
|
57
|
+
- split API/controller tests;
|
|
58
|
+
- stable error-code assertions;
|
|
59
|
+
- org mismatch tests;
|
|
60
|
+
- no-secret response assertions;
|
|
61
|
+
- watch filter tests.
|
|
62
|
+
|
|
63
|
+
Exit criteria:
|
|
64
|
+
|
|
65
|
+
- coverage report generated in CI;
|
|
66
|
+
- minimum thresholds set for critical modules;
|
|
67
|
+
- cross-org denial is tested for resource APIs.
|
|
68
|
+
|
|
69
|
+
## Stage 4: security and package hardening
|
|
70
|
+
|
|
71
|
+
Add:
|
|
72
|
+
|
|
73
|
+
- dependency/secret/license checks;
|
|
74
|
+
- rendered chart schema validation;
|
|
75
|
+
- action/workflow lint;
|
|
76
|
+
- Docker build smoke;
|
|
77
|
+
- SBOM/signature plan for release.
|
|
78
|
+
|
|
79
|
+
Exit criteria:
|
|
80
|
+
|
|
81
|
+
- release gate publishes security/package artifacts;
|
|
82
|
+
- chart regressions fail before release.
|
|
83
|
+
|
|
84
|
+
## Stage 5: agent/company-brain vertical slice
|
|
85
|
+
|
|
86
|
+
Add:
|
|
87
|
+
|
|
88
|
+
- org memory fixtures;
|
|
89
|
+
- fake Agent Mux;
|
|
90
|
+
- fake memory Git repo;
|
|
91
|
+
- dispatch with memory snapshot tests;
|
|
92
|
+
- summary-only `.a5c` import tests;
|
|
93
|
+
- cross-org memory denial tests;
|
|
94
|
+
- browser journey for memory preview/import review.
|
|
95
|
+
|
|
96
|
+
Exit criteria:
|
|
97
|
+
|
|
98
|
+
- `docs/agents/org-memory-vertical-slice-spec.md` acceptance paths are automated;
|
|
99
|
+
- no raw `.a5c` secret-like content leaks;
|
|
100
|
+
- retry uses pinned memory snapshot.
|
|
101
|
+
|
|
102
|
+
## Stage 6: live/staging reliability
|
|
103
|
+
|
|
104
|
+
Add:
|
|
105
|
+
|
|
106
|
+
- live cluster smoke profiles;
|
|
107
|
+
- Gitea, NATS, Argo CD, KubeVela, ARC, object storage checks;
|
|
108
|
+
- controller restart/idempotency tests;
|
|
109
|
+
- performance smoke for API/UI;
|
|
110
|
+
- webhook burst and retry tests.
|
|
111
|
+
|
|
112
|
+
Exit criteria:
|
|
113
|
+
|
|
114
|
+
- staging gates prove install, core workflows, and rollback;
|
|
115
|
+
- failure artifacts are actionable.
|
|
116
|
+
|
|
117
|
+
## Stage 7: continuous quality intelligence
|
|
118
|
+
|
|
119
|
+
Add:
|
|
120
|
+
|
|
121
|
+
- flaky test dashboard;
|
|
122
|
+
- coverage trend dashboard;
|
|
123
|
+
- failure signature clustering;
|
|
124
|
+
- ownership routing;
|
|
125
|
+
- QA metrics in release notes;
|
|
126
|
+
- automated gap reminders when new resources/routes lack tests.
|
|
127
|
+
|
|
128
|
+
Exit criteria:
|
|
129
|
+
|
|
130
|
+
- QA reports guide prioritization instead of only blocking merges.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# QA automation plan
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
The QA plan covers:
|
|
6
|
+
|
|
7
|
+
- core resource model and CRDs;
|
|
8
|
+
- aggregated API and Postgres-backed resources;
|
|
9
|
+
- Kubernetes controller and gateway behavior;
|
|
10
|
+
- Gitea-backed repository data plane;
|
|
11
|
+
- web UI and route flows;
|
|
12
|
+
- CI/runners and pipeline/job lifecycle;
|
|
13
|
+
- hooks and webhook delivery;
|
|
14
|
+
- identity, RBAC, secrets, config, and policy;
|
|
15
|
+
- deployments and KubeVela/OAM integration;
|
|
16
|
+
- packaging, Helm chart, Docker image, install, smoke, and upgrade;
|
|
17
|
+
- future agents, Agent Mux integration, company brain memory, `.a5c` run imports, triggers, tools, skills, subagents, and orchestration.
|
|
18
|
+
|
|
19
|
+
## Test pyramid
|
|
20
|
+
|
|
21
|
+
| Layer | Goal | Examples | Required speed |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| Static checks | catch broken contracts before execution | docs coverage, package validation, schema lint, import checks | seconds. |
|
|
24
|
+
| Unit tests | verify pure functions and module contracts | resource schema, route helpers, auth helpers, redaction, ref resolution | seconds. |
|
|
25
|
+
| Integration tests | verify module boundaries with fakes | API controller, Kubernetes gateway, UI model, memory import normalizer | seconds to minutes. |
|
|
26
|
+
| Component/UI tests | verify rendered components and interactions | org switcher, repo tabs, dispatch composer, memory import panel | minutes. |
|
|
27
|
+
| Browser E2E | verify critical user journeys | create repo, run CI, dispatch agent, import memory | minutes. |
|
|
28
|
+
| Package/install tests | verify release artifact shape | Helm template, CRD coverage, minikube dry-run, Docker build | minutes. |
|
|
29
|
+
| Live cluster tests | verify real integrations | Gitea, NATS, ARC, Argo CD, KubeVela, webhooks | longer/nightly. |
|
|
30
|
+
| Chaos/reliability tests | verify failure behavior | watch reconnect, controller retry, Git outage, redaction failure | nightly/staging. |
|
|
31
|
+
|
|
32
|
+
## Definition of done
|
|
33
|
+
|
|
34
|
+
A feature is not done until:
|
|
35
|
+
|
|
36
|
+
- resource/API/schema docs are updated;
|
|
37
|
+
- unit or integration tests cover the core logic;
|
|
38
|
+
- at least one acceptance or E2E path covers the user-visible behavior;
|
|
39
|
+
- cross-org/RBAC/secret negative tests exist where relevant;
|
|
40
|
+
- docs validation and package validation pass;
|
|
41
|
+
- UI changes pass browser or component checks where relevant;
|
|
42
|
+
- release-impacting changes update chart/package tests;
|
|
43
|
+
- future agent/memory changes update the fixture plan and acceptance matrix.
|
|
44
|
+
|
|
45
|
+
## Rollout phases
|
|
46
|
+
|
|
47
|
+
### Phase 1: codify current gates
|
|
48
|
+
|
|
49
|
+
- Keep `npm run check` as the local all-up gate.
|
|
50
|
+
- Make `npm run validate:docs`, `npm test`, `npm run e2e`, `npm run package:check`, `npm run smoke`, `npm run ui:validate`, and `npm run ui:build` visible in CI docs.
|
|
51
|
+
- Add test ownership labels by subsystem.
|
|
52
|
+
|
|
53
|
+
### Phase 2: add browser automation
|
|
54
|
+
|
|
55
|
+
- Add Playwright for route-level browser tests.
|
|
56
|
+
- Cover org navigation, repository code/issues/runs/settings, deployments, and advanced plans.
|
|
57
|
+
- Add accessibility checks for primary routes.
|
|
58
|
+
|
|
59
|
+
### Phase 3: add API/controller contract tests
|
|
60
|
+
|
|
61
|
+
- Add table-driven tests for org-scoped API routes, resource apply/list/delete, watch, and errors.
|
|
62
|
+
- Add fake Kubernetes/Gitea/NATS/Agent Mux adapters.
|
|
63
|
+
- Add no-secret response tests.
|
|
64
|
+
|
|
65
|
+
### Phase 4: add agent/company-brain tests
|
|
66
|
+
|
|
67
|
+
- Add fixtures for org memory, `.a5c` run imports, historical memory refs, and Agent Mux session binding.
|
|
68
|
+
- Add cross-org denial and redaction tests.
|
|
69
|
+
- Add browser E2E for dispatch with memory and import review.
|
|
70
|
+
|
|
71
|
+
### Phase 5: staging and live integration
|
|
72
|
+
|
|
73
|
+
- Add nightly cluster tests for Gitea, Argo CD, KubeVela, ARC, NATS, webhooks, and object storage.
|
|
74
|
+
- Add upgrade/rollback tests.
|
|
75
|
+
- Add reliability and failure injection scenarios.
|
|
76
|
+
|
|
77
|
+
## Ownership model
|
|
78
|
+
|
|
79
|
+
| Area | Owner role | Required evidence |
|
|
80
|
+
| --- | --- | --- |
|
|
81
|
+
| Resource/API contracts | platform/backend | schema tests, API tests, docs coverage. |
|
|
82
|
+
| Controllers | platform/backend | reconciliation tests, idempotency tests, events/audit. |
|
|
83
|
+
| UI/UX | frontend/product | browser/component tests, accessibility, route guards. |
|
|
84
|
+
| CI/runners | platform/runtime | lifecycle E2E, isolation, ServiceAccount/RBAC tests. |
|
|
85
|
+
| Security | security/platform | auth/RBAC/secret/no-leak tests. |
|
|
86
|
+
| Packaging | release/platform | package/chart/install/smoke tests. |
|
|
87
|
+
| Agents/memory | agents/platform | dispatch, context, memory, Agent Mux, import, trigger tests. |
|
|
88
|
+
|
|
89
|
+
## Reporting
|
|
90
|
+
|
|
91
|
+
Every CI run should publish:
|
|
92
|
+
|
|
93
|
+
- command summary;
|
|
94
|
+
- pass/fail by suite;
|
|
95
|
+
- coverage by subsystem;
|
|
96
|
+
- flaky test list;
|
|
97
|
+
- failed test artifacts;
|
|
98
|
+
- browser traces/screenshots for UI failures;
|
|
99
|
+
- package/chart validation summary;
|
|
100
|
+
- security/secret-scan findings;
|
|
101
|
+
- links to run logs and relevant resources.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Security and compliance tests
|
|
2
|
+
|
|
3
|
+
## Authentication and authorization
|
|
4
|
+
|
|
5
|
+
Required tests:
|
|
6
|
+
|
|
7
|
+
- OIDC/delegated identity config parsing;
|
|
8
|
+
- unauthenticated request rejection;
|
|
9
|
+
- user/group mapping;
|
|
10
|
+
- Kubernetes SubjectAccessReview invocation;
|
|
11
|
+
- org namespace authorization;
|
|
12
|
+
- route guard denies resource with wrong org label;
|
|
13
|
+
- admin-only actions require admin/RBAC.
|
|
14
|
+
|
|
15
|
+
## RBAC and policy
|
|
16
|
+
|
|
17
|
+
Required tests:
|
|
18
|
+
|
|
19
|
+
- runner ServiceAccount scoped to repo/ref/trust tier;
|
|
20
|
+
- agent ServiceAccount cannot mount another org Secret/ConfigMap;
|
|
21
|
+
- untrusted fork has no secrets and no cluster write access;
|
|
22
|
+
- missing `AgentSecretGrant` or `AgentConfigGrant` blocks stack readiness;
|
|
23
|
+
- policy/audit mode surfaces warnings without mutating resources;
|
|
24
|
+
- cross-org refs require `OrgSharingPolicy`.
|
|
25
|
+
|
|
26
|
+
## Secret and data leakage
|
|
27
|
+
|
|
28
|
+
No secret-like values may appear in:
|
|
29
|
+
|
|
30
|
+
- API responses;
|
|
31
|
+
- UI rendered text;
|
|
32
|
+
- context bundles;
|
|
33
|
+
- prompt previews;
|
|
34
|
+
- memory imports;
|
|
35
|
+
- logs and watch events;
|
|
36
|
+
- artifacts;
|
|
37
|
+
- audit records;
|
|
38
|
+
- browser traces.
|
|
39
|
+
|
|
40
|
+
## Supply chain
|
|
41
|
+
|
|
42
|
+
Release gates should eventually include:
|
|
43
|
+
|
|
44
|
+
- dependency vulnerability scan;
|
|
45
|
+
- license policy scan;
|
|
46
|
+
- Docker image scan;
|
|
47
|
+
- SBOM generation;
|
|
48
|
+
- image/chart provenance or signatures;
|
|
49
|
+
- GitHub Actions workflow lint.
|
|
50
|
+
|
|
51
|
+
## Agent-specific security
|
|
52
|
+
|
|
53
|
+
- Memory records are untrusted prompt content.
|
|
54
|
+
- Tool calls are admitted by Krate, not Agent Mux alone.
|
|
55
|
+
- Historical memory runs cannot read current memory without refresh/approval.
|
|
56
|
+
- Agent write-back requires artifact digest and approval.
|
|
57
|
+
- `.a5c` imports are redacted and validated before entering company brain.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Test framework and tools
|
|
2
|
+
|
|
3
|
+
## Existing baseline
|
|
4
|
+
|
|
5
|
+
Krate currently uses Node.js with ESM and the built-in `node:test` runner for unit and E2E tests. The package scripts are the source of truth for current gates.
|
|
6
|
+
|
|
7
|
+
Existing tools:
|
|
8
|
+
|
|
9
|
+
| Tool | Use |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Node `node:test` | unit, integration, and current E2E tests. |
|
|
12
|
+
| `assert/strict` | assertions. |
|
|
13
|
+
| Next.js build | production UI build validation. |
|
|
14
|
+
| custom scripts | docs, package, smoke, UI, minikube dry-run validation. |
|
|
15
|
+
| Helm/minikube dry-run plans | install command validation without a live cluster. |
|
|
16
|
+
|
|
17
|
+
## Recommended additions
|
|
18
|
+
|
|
19
|
+
| Tool | Add when | Use |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| Playwright | first browser suite | browser E2E, traces, screenshots, route assertions, accessibility hooks. |
|
|
22
|
+
| Testing Library / React test utilities | component-level UI tests | component interaction tests without full browser cost. |
|
|
23
|
+
| Istanbul/c8 or Node coverage | coverage reporting | line/branch/function coverage for `src` and critical scripts. |
|
|
24
|
+
| `axe-core` or Playwright accessibility assertions | UI accessibility gate | WCAG smoke checks on primary pages. |
|
|
25
|
+
| Helm unittest or template assertions | chart complexity grows | focused Helm render checks beyond current string tests. |
|
|
26
|
+
| kubeconform/kubeval | CRD/chart validation | Kubernetes schema validation for rendered manifests. |
|
|
27
|
+
| actionlint | workflow validation | GitHub Actions YAML checks. |
|
|
28
|
+
| secret scanner | before memory imports and release | ensure fixtures/logs/artifacts do not leak secrets. |
|
|
29
|
+
| dependency/license scanner | release gate | supply-chain checks. |
|
|
30
|
+
| k6 or autocannon | performance stage | API/web smoke load tests. |
|
|
31
|
+
|
|
32
|
+
## Tool selection principles
|
|
33
|
+
|
|
34
|
+
- Prefer fast built-in Node tests for pure logic and contracts.
|
|
35
|
+
- Use browser automation only for routes and interactions that cannot be validated below the browser layer.
|
|
36
|
+
- Use deterministic fakes for Kubernetes, Gitea, Agent Mux, NATS, Argo CD, and object storage in PR gates.
|
|
37
|
+
- Use live integration only in nightly/staging or explicit release gates.
|
|
38
|
+
- Keep tests runnable on Windows and Linux.
|
|
39
|
+
- Store fixtures in repo; avoid network calls in deterministic CI unless the suite is explicitly live.
|
|
40
|
+
|
|
41
|
+
## Proposed npm scripts
|
|
42
|
+
|
|
43
|
+
Future scripts should be additive and keep current scripts stable:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"test:unit": "node --test tests/unit/**/*.test.js",
|
|
48
|
+
"test:integration": "node --test tests/integration/**/*.test.js",
|
|
49
|
+
"test:api": "node --test tests/api/**/*.test.js",
|
|
50
|
+
"test:e2e": "node --test tests/e2e/**/*.test.js",
|
|
51
|
+
"test:browser": "playwright test",
|
|
52
|
+
"test:coverage": "node --test --experimental-test-coverage tests/**/*.test.js",
|
|
53
|
+
"test:security": "node scripts/security-check.mjs",
|
|
54
|
+
"test:charts": "node scripts/validate-package.mjs",
|
|
55
|
+
"test:all": "npm run check && npm run test:browser"
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The exact script names can change during implementation, but the suite split should remain recognizable.
|
|
60
|
+
|
|
61
|
+
## Test doubles
|
|
62
|
+
|
|
63
|
+
Required fakes/mocks:
|
|
64
|
+
|
|
65
|
+
| Adapter | Fake behavior |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| Kubernetes API | list/get/apply/delete/watch resources, SubjectAccessReview, events. |
|
|
68
|
+
| Gitea/Git | repository create, refs, commits, clone URL, protected branches, webhook callbacks. |
|
|
69
|
+
| Postgres | aggregated resources and migrations, preferably in-memory or isolated test DB. |
|
|
70
|
+
| Object storage | artifact put/get by digest. |
|
|
71
|
+
| NATS/webhook queue | enqueue, deliver, retry, replay. |
|
|
72
|
+
| Agent Mux | create run/session, stream events, accept chat continuation, cancel/resume. |
|
|
73
|
+
| Memory Git repo | resolve refs, read files, grep, write branch/PR, merge, diff. |
|
|
74
|
+
| Argo CD/KubeVela | Application status, sync plan, rollout state. |
|
|
75
|
+
|
|
76
|
+
## Artifacts
|
|
77
|
+
|
|
78
|
+
Test failures should preserve:
|
|
79
|
+
|
|
80
|
+
- assertion output;
|
|
81
|
+
- API request/response body with secrets redacted;
|
|
82
|
+
- generated YAML/resource plans;
|
|
83
|
+
- browser trace and screenshot;
|
|
84
|
+
- console/network logs for browser failures;
|
|
85
|
+
- rendered Helm manifests;
|
|
86
|
+
- memory import validation report;
|
|
87
|
+
- `.a5c` fixture redaction report;
|
|
88
|
+
- coverage report.
|