@a5c-ai/krate 5.0.1-staging.f672fe79b
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 +29 -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 +2407 -0
- package/dist/krate-lifecycle.json +201 -0
- package/dist/krate-runtime-snapshot.json +2955 -0
- package/dist/krate-summary.json +687 -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/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/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/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 +207 -0
- package/src/agent-approval-controller.js +123 -0
- package/src/agent-context-bundles.js +242 -0
- package/src/agent-dispatch-controller.js +86 -0
- package/src/agent-mux-client.js +280 -0
- package/src/agent-permission-review.js +162 -0
- package/src/agent-stack-controller.js +296 -0
- package/src/agent-trigger-controller.js +108 -0
- package/src/api-controller.js +206 -0
- package/src/argocd-gitops.js +43 -0
- package/src/auth.js +265 -0
- package/src/component-catalog.js +41 -0
- package/src/control-plane.js +136 -0
- package/src/controller-client.js +38 -0
- package/src/controller-ui.js +538 -0
- package/src/data-plane.js +178 -0
- package/src/gitea-backend.js +95 -0
- package/src/handoff.js +98 -0
- package/src/hooks-events.js +63 -0
- package/src/http-server.js +151 -0
- package/src/identity-policy.js +86 -0
- package/src/index.js +30 -0
- package/src/kubernetes-controller.js +812 -0
- package/src/kubernetes-resource-gateway.js +48 -0
- package/src/operations.js +112 -0
- package/src/resource-model.js +203 -0
- package/src/runners-ci.js +48 -0
- package/src/runtime.js +196 -0
- package/src/web-ui.js +40 -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 +176 -0
- package/tests/agent-mux-client.test.js +204 -0
- package/tests/agent-permission-review.test.js +209 -0
- package/tests/agent-resources.test.js +212 -0
- package/tests/agent-stack-controller.test.js +221 -0
- package/tests/agent-trigger-controller.test.js +211 -0
- package/tests/deployment.test.js +395 -0
- package/tests/e2e/lifecycle.test.js +117 -0
- package/tests/krate.test.js +727 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Resource Contracts
|
|
2
|
+
|
|
3
|
+
All resources use `apiVersion: krate.a5c.ai/v1alpha1`, `kind`, `metadata`, `spec`, and `status`.
|
|
4
|
+
|
|
5
|
+
## Common metadata
|
|
6
|
+
|
|
7
|
+
- `metadata.name` is required.
|
|
8
|
+
- `metadata.namespace` defaults to `default`.
|
|
9
|
+
- `metadata.labels` and `metadata.annotations` default to empty maps.
|
|
10
|
+
- `metadata.resourceVersion` increments on every stored mutation.
|
|
11
|
+
|
|
12
|
+
## Lifecycle contract
|
|
13
|
+
|
|
14
|
+
1. Caller submits a resource mutation.
|
|
15
|
+
2. Control plane normalizes metadata and validates kind support.
|
|
16
|
+
3. RBAC checks `user`, verb, kind, and namespace.
|
|
17
|
+
4. Admission policies evaluate in audit or enforce mode.
|
|
18
|
+
5. Resource is routed to etcd or Postgres by storage class.
|
|
19
|
+
6. Audit and watch events are emitted.
|
|
20
|
+
7. Status is patched by controllers or workflow services.
|
|
21
|
+
|
|
22
|
+
## Kind-specific contracts
|
|
23
|
+
|
|
24
|
+
- `User`, `Team`, `Invite`, `IdentityMapping`, and `AuthProvider` drive sign-in, admin-managed user mapping, teams, invites, and access configuration.
|
|
25
|
+
- `RepositoryPermission` and `SSHKey` reconcile repository access and key material into the repository backend.
|
|
26
|
+
- `Repository` status includes Gitea backend integration and health.
|
|
27
|
+
- `PullRequest` includes repository, source ref, target ref, title, and phase.
|
|
28
|
+
- `Pipeline` includes repository, ref, steps, trust tier, and resume point.
|
|
29
|
+
- `Job` includes service-account scopes, step name, and isolation metadata.
|
|
30
|
+
- `RunnerPool` includes warm replicas, maximum replicas, and cache policy.
|
|
31
|
+
- `WebhookDelivery` includes request, signature, response, phase, latency, and replay metadata.
|
|
32
|
+
- `RefPolicy` and `BranchProtection` are enforced before protected writes.
|
|
33
|
+
- `View` and `Selector` are label/query definitions used by UI and workflows.
|
|
34
|
+
|
|
35
|
+
## Validation requirements
|
|
36
|
+
|
|
37
|
+
- Unsupported kinds fail fast.
|
|
38
|
+
- Missing names fail fast.
|
|
39
|
+
- Selectors match labels deterministically.
|
|
40
|
+
- Storage class is inspectable in status.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Resource Taxonomy
|
|
2
|
+
|
|
3
|
+
## CRD-backed configuration resources
|
|
4
|
+
|
|
5
|
+
These are low-cardinality desired-state contracts and are safe for etcd-backed storage.
|
|
6
|
+
|
|
7
|
+
| Kind | Owner | Purpose |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `Organization` | Identity/data plane | Workspace organization, owners, teams, and default repository policy |
|
|
10
|
+
| `User` | Identity | Human account profile, sign-in state, and linked identities |
|
|
11
|
+
| `Team` | Identity | Team membership, maintainers, and repository permission grants |
|
|
12
|
+
| `Invite` | Identity | Pending invitation, role, requested teams, and expiry |
|
|
13
|
+
| `IdentityMapping` | Identity | Mapping between sign-in subjects, Kubernetes identities, and repository accounts |
|
|
14
|
+
| `AuthProvider` | Identity | Installation sign-in provider status and delegated identity settings |
|
|
15
|
+
| `Repository` | Data plane | Repository identity, visibility, Gitea hosting integration, object/search settings |
|
|
16
|
+
| `SSHKey` | Identity/data plane | User, deploy, and automation keys reconciled into repository hosting |
|
|
17
|
+
| `RepositoryPermission` | Identity/data plane | Collaborator and team grants synced to repository hosting |
|
|
18
|
+
| `WebhookSubscription` | Hooks/events | Endpoint, event filters, signing configuration, retry policy |
|
|
19
|
+
| `RefPolicy` | Data plane/hooks | Deny refs, force-push policy, signing and linear-history policy |
|
|
20
|
+
| `BranchProtection` | Data plane/control | PR requirement and protected ref rules |
|
|
21
|
+
| `RunnerPool` | Runners/CI | Runner capacity, scale limits, cache configuration |
|
|
22
|
+
| `View` | Web UI | Saved triage view and presentation contract |
|
|
23
|
+
| `Selector` | Web UI/control | Reusable label/query selector for workflows |
|
|
24
|
+
|
|
25
|
+
## Aggregated Postgres-backed resources
|
|
26
|
+
|
|
27
|
+
These are high-cardinality runtime records and must not store primary records in etcd.
|
|
28
|
+
|
|
29
|
+
| Kind | Owner | Purpose |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `PullRequest` | Control/UI | Review unit, refs, status, checks, merge lifecycle |
|
|
32
|
+
| `Issue` | Control/UI | Work item, labels, assignment, lifecycle |
|
|
33
|
+
| `Review` | Control/UI | Approval/comment/change-request records |
|
|
34
|
+
| `Pipeline` | Runners/CI | Pipeline run state and resume point |
|
|
35
|
+
| `Job` | Runners/CI | Step execution record and service-account scope |
|
|
36
|
+
| `WebhookDelivery` | Hooks/events | Durable delivery attempt, signature, response, replay chain |
|
|
37
|
+
|
|
38
|
+
## Taxonomy invariants
|
|
39
|
+
|
|
40
|
+
- Config resources can drive reconciliation and must remain small.
|
|
41
|
+
- Aggregated resources can be listed, watched, and label-selected through the API server but store primary state outside etcd.
|
|
42
|
+
- Every kind has metadata, spec, status, storage class, owner context, and executable tests.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Runners and CI
|
|
2
|
+
|
|
3
|
+
## Runner pools
|
|
4
|
+
|
|
5
|
+
`RunnerPool` records declare warm replicas, maximum replicas, queue scaling, cache settings, and trust boundaries.
|
|
6
|
+
|
|
7
|
+
## Pipelines
|
|
8
|
+
|
|
9
|
+
`Pipeline` records represent a run for repository/ref work. They include steps, status, trust tier, and optional `resumeFrom` state for rerun/resume.
|
|
10
|
+
|
|
11
|
+
## Jobs
|
|
12
|
+
|
|
13
|
+
`Job` records represent executable steps. Each job receives a service-account profile derived from the pipeline trust tier.
|
|
14
|
+
|
|
15
|
+
## Fork isolation
|
|
16
|
+
|
|
17
|
+
- Fork PR pipelines are untrusted.
|
|
18
|
+
- Untrusted jobs have `secrets: false` and `clusterApi: false`.
|
|
19
|
+
- Trusted jobs may use configured scopes, but scopes remain explicit.
|
|
20
|
+
|
|
21
|
+
## Scaling
|
|
22
|
+
|
|
23
|
+
Queue depth maps to desired replicas within warm and max bounds. Scaling is deterministic and inspectable from pool spec/status.
|
|
24
|
+
|
|
25
|
+
## Acceptance gates
|
|
26
|
+
|
|
27
|
+
- Starting a fork pipeline produces jobs with no secrets and no cluster API access.
|
|
28
|
+
- Rerun from a named step sets `resumeFrom`.
|
|
29
|
+
- Pool replica planning respects warm and maximum replica limits.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Solution-Space Ontology
|
|
2
|
+
|
|
3
|
+
The MVP is a deterministic Kubernetes-native contract implementation of the Krate architecture. Local tests do not require a live cluster, but the modules, chart, examples, Argo CD Application surface, and Gitea backend integration model the cluster contracts described in `docs/`.
|
|
4
|
+
|
|
5
|
+
## Architectural shape
|
|
6
|
+
|
|
7
|
+
- `src/resource-model.js` defines resource kinds, storage classes, metadata normalization, selectors, and Kubernetes-list output.
|
|
8
|
+
- `src/control-plane.js` models create/update/status verbs, RBAC, admission, audit, storage boundary routing, and watches.
|
|
9
|
+
- `src/identity-policy.js` maps OIDC identities, groups, trust tiers, service accounts, admission policies, and policy rollout.
|
|
10
|
+
- `src/data-plane.js` and `src/gitea-backend.js` model repository creation, Gitea-backed Git hosting, SSH keys, collaborators/teams, branch protection, ref policy, webhooks, object metadata, and search hooks.
|
|
11
|
+
- `src/runners-ci.js` models runner pools, pipelines, jobs, queue scaling, fork isolation, and rerun/resume.
|
|
12
|
+
- `src/hooks-events.js` models webhook subscriptions, signing, durable deliveries, failure inspection, and replay.
|
|
13
|
+
- `src/web-ui.js` models excellent UI flows as resource-backed view models.
|
|
14
|
+
- `src/operations.js` and `src/argocd-gitops.js` model manifests, Argo CD GitOps Applications, observability, backup/restore, release gates, and the MVP demo.
|
|
15
|
+
|
|
16
|
+
## MVP boundaries
|
|
17
|
+
|
|
18
|
+
- In scope: Kubernetes resource contracts, Argo CD Application generation, Gitea API-shaped backend integration, deterministic control-plane behavior, workflow models, tests, docs coverage, and smokeable demo output.
|
|
19
|
+
- Out of scope for local validation: requiring a live APIService deployment, live Argo CD controller, live Gitea server, real Postgres, real etcd, real ARC runners, and real browser rendering.
|
|
20
|
+
- Required fidelity: storage classes, Gitea integration calls, Argo CD Application fields, policy decisions, eventing, and operational gates must behave like the docs even when validated through deterministic JavaScript harnesses.
|
|
21
|
+
|
|
22
|
+
## Quality strategy
|
|
23
|
+
|
|
24
|
+
The solution converges through ontology authoring, module implementation, acceptance tests, doc coverage, smoke output, and final quality review.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Storage and Data Boundaries
|
|
2
|
+
|
|
3
|
+
## etcd boundary
|
|
4
|
+
|
|
5
|
+
etcd stores CRD-backed configuration: `Repository`, `WebhookSubscription`, `RefPolicy`, `BranchProtection`, `RunnerPool`, `View`, and `Selector`. These are low-cardinality desired-state resources.
|
|
6
|
+
|
|
7
|
+
## Postgres boundary
|
|
8
|
+
|
|
9
|
+
Postgres stores aggregated records: `PullRequest`, `Issue`, `Review`, `Pipeline`, `Job`, and `WebhookDelivery`. These records can be listed and watched through Kubernetes APIs but their primary storage is not etcd.
|
|
10
|
+
|
|
11
|
+
## Gitea repository boundary
|
|
12
|
+
|
|
13
|
+
Gitea stores repositories and terminates smart-HTTP/SSH Git traffic. Repository status points to the Gitea backend integration, protected branch state, deploy keys, collaborators/teams, webhooks, and health, while Krate routing remains stateless.
|
|
14
|
+
|
|
15
|
+
## Object storage boundary
|
|
16
|
+
|
|
17
|
+
Object storage contains large immutable objects such as LFS blobs, archives, and artifacts. Repository specs reference object storage configuration without embedding large data.
|
|
18
|
+
|
|
19
|
+
## Search boundary
|
|
20
|
+
|
|
21
|
+
Search indexing hooks observe Git and resource events. Search lag must not block Git write success.
|
|
22
|
+
|
|
23
|
+
## Boundary invariant
|
|
24
|
+
|
|
25
|
+
No workflow should require copying high-cardinality logs, comments, jobs, or webhook attempts into etcd.
|
|
26
|
+
|
|
27
|
+
## Deterministic runtime snapshot boundary
|
|
28
|
+
|
|
29
|
+
The deterministic harness can export and import a KrateRuntimeSnapshot that preserves the control-plane etcd/postgres resource split, audit log, and events. This is the executable backup/restore boundary for the current package contract; production cluster backup still requires the external Postgres, object storage, Gitea repository storage, and declarative resource backup plan described in the operations docs.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Validation Matrix
|
|
2
|
+
|
|
3
|
+
| Requirement | Ontology | Implementation | Validation |
|
|
4
|
+
| --- | --- | --- | --- |
|
|
5
|
+
| CRD vs aggregated storage | `resource-taxonomy.md`, `storage-and-data-boundaries.md` | `src/resource-model.js`, `src/control-plane.js` | storage tests, `validate-doc-coverage.mjs` |
|
|
6
|
+
| RBAC and admission | `policies-and-invariants.md` | `src/identity-policy.js`, `src/control-plane.js` | RBAC/admission tests |
|
|
7
|
+
| Warm Gitea receive path | `workflows.md`, `storage-and-data-boundaries.md` | `src/data-plane.js` | Gitea backend tests |
|
|
8
|
+
| BranchProtection and RefPolicy | `resource-contracts.md`, `events-and-hooks.md` | `src/data-plane.js` | protected branch/ref tests |
|
|
9
|
+
| Fork CI isolation | `runners-and-ci.md` | `src/runners-ci.js` | runner scheduler tests |
|
|
10
|
+
| Webhook signing/replay | `events-and-hooks.md` | `src/hooks-events.js` | webhook bus tests |
|
|
11
|
+
| UI YAML transparency | `web-ui-excellent-flows.md` | `src/web-ui.js` | smoke assertions |
|
|
12
|
+
| Backup/restore/release gates | `operations-and-release.md` | `src/operations.js`, `scripts/build.mjs`, `scripts/smoke.mjs` | `npm run check` with docs and ontology coverage |
|
|
13
|
+
|
|
14
|
+
## Local validation commands
|
|
15
|
+
|
|
16
|
+
- `npm run build`
|
|
17
|
+
- `npm run validate:docs`
|
|
18
|
+
- `npm test`
|
|
19
|
+
- `npm run smoke`
|
|
20
|
+
- `npm run check`
|
|
21
|
+
|
|
22
|
+
## Green definition
|
|
23
|
+
|
|
24
|
+
The project is green only when all ontology files exist, coverage terms are found in docs and source, tests pass, smoke assertions pass, and the Babysitter run returns a successful completion proof.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Web UI Excellent Flows
|
|
2
|
+
|
|
3
|
+
The UI ontology is a set of resource-backed view models rather than a hidden application state machine.
|
|
4
|
+
|
|
5
|
+
## Required flows
|
|
6
|
+
|
|
7
|
+
- Create and inspect a repository.
|
|
8
|
+
- Open and review a pull request.
|
|
9
|
+
- Inspect failed checks and rerun/resume CI.
|
|
10
|
+
- Edit runner pool capacity and cache policy.
|
|
11
|
+
- Inspect and replay webhook deliveries.
|
|
12
|
+
- Open YAML/resource views for UI actions.
|
|
13
|
+
|
|
14
|
+
## View model invariants
|
|
15
|
+
|
|
16
|
+
- Dashboard cards summarize repositories, PRs, pipelines, runner pools, and webhook deliveries.
|
|
17
|
+
- PR review surfaces changed files, pipeline checks, comments, and YAML.
|
|
18
|
+
- Runner pool editor exposes scaling limits and resource YAML.
|
|
19
|
+
- Webhook inspector exposes request, response, phase, signature, and replay action.
|
|
20
|
+
- Every view includes enough resource identity for kubectl-style workflows.
|
|
21
|
+
|
|
22
|
+
## Traceability
|
|
23
|
+
|
|
24
|
+
`View` and `Selector` resources support saved triage and cross-repository work. UI filters should map to selector labels or query metadata.
|
|
25
|
+
|
|
26
|
+
## Current executable UI contract
|
|
27
|
+
|
|
28
|
+
- Breadcrumbs orient each organization and repository route.
|
|
29
|
+
- `ForgeFlowRail` makes the default Git forge flow explicit: create, clone, branch, open PR, merge, deploy, and notify.
|
|
30
|
+
- `RepositoryCommandBar` keeps clone, branch, watch, RBAC, PR-flow, and YAML actions visible across repository tabs.
|
|
31
|
+
- Degraded-state banners render on every route that depends on the controller model, not only on the dashboard.
|
|
32
|
+
- Architecture boundaries include the API controller, Kubernetes resource gateway, Kubernetes client, Kubernetes reconciler, and Git data plane.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Workflows
|
|
2
|
+
|
|
3
|
+
## Repository creation
|
|
4
|
+
|
|
5
|
+
1. Repository admin creates a `Repository` resource.
|
|
6
|
+
2. Control plane authorizes and stores it in etcd.
|
|
7
|
+
3. Data plane provisions a Gitea repository integration and initializes repository storage.
|
|
8
|
+
4. Status exposes Gitea backend integration and health.
|
|
9
|
+
|
|
10
|
+
## Pull request review
|
|
11
|
+
|
|
12
|
+
1. Developer creates a `PullRequest` with source/target refs and title.
|
|
13
|
+
2. Admission validates required fields and policy.
|
|
14
|
+
3. CI starts a `Pipeline` and one or more `Job` records.
|
|
15
|
+
4. UI shows checks, changed files, comments, and YAML/resource equivalent.
|
|
16
|
+
5. Branch protection requires PR flow for protected refs.
|
|
17
|
+
|
|
18
|
+
## Git receive-pack
|
|
19
|
+
|
|
20
|
+
1. Gitea backend resolves repository routing.
|
|
21
|
+
2. `RefPolicy` denies forbidden refs or unsafe writes.
|
|
22
|
+
3. `BranchProtection` blocks direct protected writes unless actor has repo-admin permission.
|
|
23
|
+
4. Write event is emitted and optional search indexing hook is queued.
|
|
24
|
+
|
|
25
|
+
## Webhook delivery and replay
|
|
26
|
+
|
|
27
|
+
1. Repository admin creates a `WebhookSubscription`.
|
|
28
|
+
2. Event dispatch signs payload and stores a `WebhookDelivery` record.
|
|
29
|
+
3. Failure status remains inspectable with request/response metadata.
|
|
30
|
+
4. Replay creates a new delivery using the current secret and links replay metadata.
|
|
31
|
+
|
|
32
|
+
## Backup and restore
|
|
33
|
+
|
|
34
|
+
1. Export CRDs and low-cardinality config.
|
|
35
|
+
2. Backup Postgres aggregated records.
|
|
36
|
+
3. Snapshot Gitea repository integration state.
|
|
37
|
+
4. Preserve object storage.
|
|
38
|
+
5. Restore API/config, Postgres, repositories, objects, then controllers.
|
|
39
|
+
6. Validate by listing resources, reading refs, opening a PR, and replaying a webhook.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# World Ontology
|
|
2
|
+
|
|
3
|
+
Krate is a Kubernetes-native forge: repositories, review, CI, policy, hooks, and operations are expressed through Kubernetes-style resources rather than a separate opaque application model.
|
|
4
|
+
|
|
5
|
+
## Domain entities
|
|
6
|
+
|
|
7
|
+
- **Kubernetes API server** is the interaction contract for discovery, verbs, watches, RBAC, admission, and status.
|
|
8
|
+
- **etcd** stores low-cardinality configuration resources such as `Repository`, `WebhookSubscription`, `RefPolicy`, `BranchProtection`, `RunnerPool`, `View`, and `Selector`.
|
|
9
|
+
- **Postgres** stores high-cardinality aggregated records such as `PullRequest`, `Issue`, `Review`, `Pipeline`, `Job`, and `WebhookDelivery`.
|
|
10
|
+
- **Gitea backend** stores repositories and keeps the write path warm for `receive-pack`.
|
|
11
|
+
- **Object storage** stores LFS objects, archives, and large immutable artifacts.
|
|
12
|
+
- **Search index** receives repository indexing hooks without blocking Git writes.
|
|
13
|
+
|
|
14
|
+
## Human actors
|
|
15
|
+
|
|
16
|
+
- **Developer** opens pull requests, comments, reviews, runs pipelines, and investigates failures.
|
|
17
|
+
- **Repository admin** creates repositories, branch protection, ref policies, webhook subscriptions, and triage views.
|
|
18
|
+
- **Platform engineer** installs Krate, manages runner pools, admission rollout, observability, backup, and release gates.
|
|
19
|
+
- **Team lead** uses views and selectors to triage cross-repository work.
|
|
20
|
+
|
|
21
|
+
## Machine actors
|
|
22
|
+
|
|
23
|
+
- **Controllers** reconcile resource state and patch status.
|
|
24
|
+
- **Runner jobs** execute pipeline steps with scoped service-account identity.
|
|
25
|
+
- **Admission policies** validate mutations in audit or enforce mode.
|
|
26
|
+
- **Webhook dispatchers** sign, deliver, retry, and replay outbound events.
|
|
27
|
+
- **Git clients** use smart HTTP/SSH routes resolved by the Gitea backend integration.
|
|
28
|
+
|
|
29
|
+
## Non-negotiable assumptions
|
|
30
|
+
|
|
31
|
+
- Kubernetes RBAC remains authoritative for user and machine actions.
|
|
32
|
+
- UI state must be explainable as resources, YAML, events, and status.
|
|
33
|
+
- High-cardinality activity must not overload etcd.
|
|
34
|
+
- Untrusted fork work must not access secrets or the cluster API.
|
|
35
|
+
- Operations must be installable, observable, backupable, restorable, and release-gated.
|
|
@@ -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.
|