@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,310 @@
|
|
|
1
|
+
# Agent Mux source map for Krate integration
|
|
2
|
+
|
|
3
|
+
Research source: local `C:\Users\tmusk\IdeaProjects\babysitter` checkout on `staging`, the public Babysitter GitHub URL provided in the request, and Krate's local CI/docs surfaces. This is an implementation source map, not an ontology mapping.
|
|
4
|
+
|
|
5
|
+
## Krate CI and release paths
|
|
6
|
+
|
|
7
|
+
### GitHub Actions workflow
|
|
8
|
+
|
|
9
|
+
- `.github/workflows/publish.yml`
|
|
10
|
+
- Pull request and main/tag publish workflow.
|
|
11
|
+
- `validate` job runs `npm ci`, `npm run check`, `npm pack --json`, and uploads npm package, dist/chart/example artifacts, UI standalone artifacts, and release checksums.
|
|
12
|
+
- `publish-image` builds/pushes `ghcr.io/${{ github.repository }}/krate-controller` after validation.
|
|
13
|
+
- `publish-chart` lints/packages `charts/krate`, uploads chart artifacts, and pushes chart OCI artifacts on version tags.
|
|
14
|
+
|
|
15
|
+
Agent orchestration implications:
|
|
16
|
+
|
|
17
|
+
- Failed `validate` checks need logs from `npm run check`, package output, dist artifacts, UI standalone output, and checksum generation context.
|
|
18
|
+
- Image/chart publish jobs need release-readiness review, artifact consistency checks, and privileged write-back guardrails.
|
|
19
|
+
- PR-triggered agent repairs should never publish images or charts.
|
|
20
|
+
|
|
21
|
+
### Package scripts used by CI
|
|
22
|
+
|
|
23
|
+
- `package.json`
|
|
24
|
+
- `check`: full gate composed of build, docs validation, tests, E2E, package check, smoke, UI validation, and UI build.
|
|
25
|
+
- `validate:docs`: docs coverage check.
|
|
26
|
+
- `test`, `e2e`, `smoke`, `ui:validate`, `ui:build`, `package:check`: focused gates that can become agent task scopes.
|
|
27
|
+
|
|
28
|
+
Agent orchestration implications:
|
|
29
|
+
|
|
30
|
+
- `taskKind=diagnose` should identify which sub-gate failed.
|
|
31
|
+
- `taskKind=repair` should prefer focused reproduction before broader `npm run check`.
|
|
32
|
+
- Agent context should include the failed command, failing test or route, and generated artifacts.
|
|
33
|
+
|
|
34
|
+
## Krate docs and product requirements to preserve
|
|
35
|
+
|
|
36
|
+
- `docs/system-requirements.md`
|
|
37
|
+
- CI jobs must run under scoped Kubernetes ServiceAccounts, not PATs.
|
|
38
|
+
- Runner integration composes with ARC for MVP and leaves seams for Tekton or Buildkite Agent.
|
|
39
|
+
- Webhook delivery uses durable queueing and HMAC signing.
|
|
40
|
+
- Release candidates must prove install, repository creation, PR, CI, policy, and webhook delivery.
|
|
41
|
+
- `docs/components/runners-ci.md`
|
|
42
|
+
- Defines `RunnerPool`, `Pipeline`, and `Job` as first-class resources.
|
|
43
|
+
- Captures trust tiers, scoped identity, cache isolation, queue metrics, log streaming, rerun semantics, and failure signatures.
|
|
44
|
+
- `docs/components/hooks-events.md`
|
|
45
|
+
- Separates Git hooks, outbound webhooks, and admission webhooks.
|
|
46
|
+
- Provides durable delivery, retries, signing, replay, and policy visibility requirements.
|
|
47
|
+
- `docs/components/web-ui.md`
|
|
48
|
+
- Requires repository, PR, pipeline, runner, hook, and settings navigation.
|
|
49
|
+
- Requires Watch/SSE updates and YAML/kubectl transparency for mutations.
|
|
50
|
+
- `docs/user-stories.md`
|
|
51
|
+
- PR review and CI status, live log streaming, similar-run failure search, runner pool configuration, and inbox triage are existing product expectations.
|
|
52
|
+
|
|
53
|
+
## Babysitter / Agent Mux paths
|
|
54
|
+
|
|
55
|
+
### Workspace and packages
|
|
56
|
+
|
|
57
|
+
- `package.json`
|
|
58
|
+
- Declares `packages/agent-mux/*` workspaces.
|
|
59
|
+
- Defines build/test scripts such as `build:agent-mux`, `test:agent-mux`, and web UI scripts.
|
|
60
|
+
- `packages/agent-mux/README.md`
|
|
61
|
+
- High-level Agent Mux entrypoint.
|
|
62
|
+
- `packages/agent-mux/core/`
|
|
63
|
+
- Agent/session domain contracts.
|
|
64
|
+
- Important files:
|
|
65
|
+
- `packages/agent-mux/core/src/types.ts`
|
|
66
|
+
- `packages/agent-mux/core/src/session-manager.ts`
|
|
67
|
+
- `packages/agent-mux/core/src/workspace-service.ts` if present in this branch; otherwise follow imports from `@a5c-ai/agent-mux-core`.
|
|
68
|
+
- `packages/agent-mux/gateway/`
|
|
69
|
+
- HTTP/WebSocket gateway and server-side run/session orchestration.
|
|
70
|
+
- Important files:
|
|
71
|
+
- `packages/agent-mux/gateway/src/server.ts`
|
|
72
|
+
- `packages/agent-mux/gateway/src/runs/manager.ts`
|
|
73
|
+
- `packages/agent-mux/gateway/src/runs/types.ts`
|
|
74
|
+
- `packages/agent-mux/gateway/src/runs/session-runtime.ts`
|
|
75
|
+
- `packages/agent-mux/gateway/src/runs/event-log.ts`
|
|
76
|
+
- `packages/agent-mux/gateway/src/fanout/client-conn.ts`
|
|
77
|
+
- `packages/agent-mux/gateway/src/fanout/subscriber.ts`
|
|
78
|
+
- `packages/agent-mux/gateway/src/protocol/v1.ts`
|
|
79
|
+
- `packages/agent-mux/gateway/src/protocol/frames.ts`
|
|
80
|
+
- `packages/agent-mux/gateway/src/builtin-adapters.ts`
|
|
81
|
+
- `packages/agent-mux/gateway/src/kanban/`
|
|
82
|
+
- Project, issue, workspace, automation, and dispatch surfaces closest to Krate's git-workspace domain.
|
|
83
|
+
- Important files:
|
|
84
|
+
- `packages/agent-mux/gateway/src/kanban/routes.ts`
|
|
85
|
+
- `packages/agent-mux/gateway/src/kanban/lib/services/automation-rule-service.ts`
|
|
86
|
+
- `packages/agent-mux/gateway/src/kanban/lib/services/automation-webhook-service.ts`
|
|
87
|
+
- `packages/agent-mux/gateway/src/kanban/lib/services/dispatch-context-label-service.ts`
|
|
88
|
+
- `packages/agent-mux/gateway/src/kanban/lib/services/run-query-service.ts`
|
|
89
|
+
- `packages/agent-mux/gateway/src/kanban/lib/services/backlog-query-service.ts`
|
|
90
|
+
- `packages/agent-mux/gateway/src/kanban/lib/review-service.ts`
|
|
91
|
+
- `packages/agent-mux/gateway/src/kanban/lib/workspace-lifecycle.ts`
|
|
92
|
+
- `packages/agent-mux/webui/`
|
|
93
|
+
- Product UI examples for sessions, dispatches, projects, issues, automations, workspaces, and inboxes.
|
|
94
|
+
- Important files:
|
|
95
|
+
- `packages/agent-mux/webui/src/router.tsx`
|
|
96
|
+
- `packages/agent-mux/webui/src/pages/SessionDetailPage.tsx`
|
|
97
|
+
- `packages/agent-mux/webui/src/pages/RunPage.tsx`
|
|
98
|
+
- `packages/agent-mux/webui/src/pages/AgentsPage.tsx`
|
|
99
|
+
- `packages/agent-mux/webui/src/pages/NewRunPage.tsx`
|
|
100
|
+
- `packages/agent-mux/webui/src/pages/HookInboxPage.tsx`
|
|
101
|
+
- `packages/agent-mux/webui/src/routes/AutomationsPage.tsx`
|
|
102
|
+
- `packages/agent-mux/webui/src/routes/ProjectsPage.tsx`
|
|
103
|
+
- `packages/agent-mux/webui/src/hooks/use-event-stream.ts`
|
|
104
|
+
- `packages/agent-mux/webui/src/hooks/use-run-detail.ts`
|
|
105
|
+
- `packages/agent-mux/webui/src/hooks/use-reviews.ts`
|
|
106
|
+
- `packages/agent-mux/cli/`
|
|
107
|
+
- CLI flows for starting/listing/inspecting agent runs; useful as a non-UI fallback for Krate operations.
|
|
108
|
+
- `packages/agent-mux/adapters/`
|
|
109
|
+
- Adapter layer for concrete agent runtimes.
|
|
110
|
+
- `packages/agent-mux/observability/`
|
|
111
|
+
- Observability surfaces that can inform Krate run tracking.
|
|
112
|
+
|
|
113
|
+
## Researched Agent Mux route matrix
|
|
114
|
+
|
|
115
|
+
Current Babysitter `staging` exposes these Agent Mux Web UI routes from `packages/agent-mux/webui/src/router.tsx`. Krate should translate them into repository-centered pages instead of importing the route tree wholesale.
|
|
116
|
+
|
|
117
|
+
| Agent Mux route | Source component | Krate usage |
|
|
118
|
+
| --- | --- | --- |
|
|
119
|
+
| `/` -> `/projects` | router redirect | Krate home remains repository/org dashboard; agent summary can be a dashboard card. |
|
|
120
|
+
| `/agents` | `AgentsPage` | Global stack/adapter inventory and readiness summary. |
|
|
121
|
+
| `/sessions` | `SessionsPage` | Cross-repo session list, mostly secondary to dispatch/run pages. |
|
|
122
|
+
| `/sessions/new` | `NewRunPage` | Dispatch composer embedded in Code, Issues, PRs, and Pipelines. |
|
|
123
|
+
| `/sessions/pending/:runId` | `SessionPendingPage` | Pending handoff state for `AgentDispatchRun`. |
|
|
124
|
+
| `/dispatches/:runId` | `DispatchDetailPage` | Canonical CI-like dispatch run detail with Agent Mux chat. |
|
|
125
|
+
| `/runs/:runId` | `LegacyDispatchRouteRedirect` | Compatibility redirect only. |
|
|
126
|
+
| `/sessions/:sessionId` | `SessionDetailPage` | Chat/session tab inside dispatch/workspace pages. |
|
|
127
|
+
| `/sessions/:agent/:sessionId` | `LegacySessionRouteRedirect` | Compatibility redirect only. |
|
|
128
|
+
| `/pair-device` | `PairDevicePage` | Optional gateway auth/device-pairing administrative flow. |
|
|
129
|
+
| `/projects` | `ProjectsPage` | Repository/project issue board summary. |
|
|
130
|
+
| `/projects/:projectId/board` | `ProjectBoardPage` | Kanban board projection for work items and agent dispatch readiness. |
|
|
131
|
+
| `/projects/:projectId/list` | `ProjectListPage` | List/table projection for issues, sessions, workspaces, and runs. |
|
|
132
|
+
| `/projects/:projectId/issues/new` | `ProjectIssueCreatePage` | Issue/work-item creation with agent context labels. |
|
|
133
|
+
| `/projects/:projectId/issues/:issueId` | `ProjectIssuePage` | Issue hub with linked session/workspace/run graph. |
|
|
134
|
+
| `/projects/:projectId/workspaces/new` | `ProjectWorkspaceCreatePage` | Workspace provisioning from project/repository context. |
|
|
135
|
+
| `/projects/:projectId/issues/:issueId/workspace/new` | `IssueWorkspaceCreatePage` | Workspace provisioning from issue context. |
|
|
136
|
+
| `/issues/:issueId` | `IssueDetailPage` | Global issue deep link resolves into repository issue context. |
|
|
137
|
+
| `/dispatches` | `KanbanRunsPage` | Global dispatch queue and approval pressure. |
|
|
138
|
+
| `/runs` | `LegacyDispatchRouteRedirect` | Compatibility redirect only. |
|
|
139
|
+
| `/workspaces` | `KanbanWorkspacesPage` | Workspace inventory and attention mode. |
|
|
140
|
+
| `/workspaces/new` | `HostWorkspaceCreatePage` | Host/repository workspace provisioning. |
|
|
141
|
+
| `/inbox` | `KanbanInboxPage` | Approval, hook, review, and workspace attention inbox. |
|
|
142
|
+
| `/automations` | `AutomationsPage` | Trigger rule builder and execution history. |
|
|
143
|
+
| `/settings` | `KanbanSettingsPage` | Global policy/settings; repository settings stay under repo navigation. |
|
|
144
|
+
| `/legacy-home`, `/legacy-workspaces`, `/legacy-inbox`, `/legacy-settings` | legacy pages | Do not model as Krate product surface. |
|
|
145
|
+
|
|
146
|
+
## Researched Agent Mux gateway endpoint matrix
|
|
147
|
+
|
|
148
|
+
Current `packages/agent-mux/gateway/src/kanban/routes.ts` provides the closest server contracts to reuse or adapt.
|
|
149
|
+
|
|
150
|
+
| Endpoint/action | Agent Mux purpose | Krate equivalent |
|
|
151
|
+
| --- | --- | --- |
|
|
152
|
+
| `GET /api/backlog` | Load project, issue, workspace, session, PR, review, and board graph | Read repository work graph aggregated projection. |
|
|
153
|
+
| `POST /api/backlog` `move-issue` | Move work item across workflow states | Patch `WorkItem.status.workflowState`. |
|
|
154
|
+
| `POST /api/backlog` `link-repository` | Associate project with repository provider/repo | Link Krate repository resource to work graph. |
|
|
155
|
+
| `POST /api/backlog` `update-repository-settings` | Update branch/review/check integration settings | Patch repository agent integration settings. |
|
|
156
|
+
| `POST /api/backlog` `create-pull-request` | Create linked PR metadata | Create/link PR write-back artifact under approval. |
|
|
157
|
+
| `POST /api/backlog` `create-issue` | Create issue/work item | Create issue and initial context labels. |
|
|
158
|
+
| `POST /api/backlog` `update-project-collaboration` | Update visibility, roles, workspace provisioning policy | Patch project/repository agent collaboration policy. |
|
|
159
|
+
| `POST /api/backlog` `update-issue-detail` | Edit title, description, relations, labels, review metadata | Patch issue/work item and context-label associations. |
|
|
160
|
+
| `POST /api/backlog` `update-issue-dispatch-context-labels` | Attach context labels to dispatch prompt | Patch `WorkItem.contextLabelRefs`; snapshot into runs. |
|
|
161
|
+
| `POST /api/backlog` `create-sub-issue` / `link-child-issue` | Manage child work items | Maintain parent/child work graph edges. |
|
|
162
|
+
| `POST /api/backlog` `create-issue-workspace` / `link-issue-workspace` / `link-issue-session` | Associate issue with workspace/session | Maintain `WorkItemWorkspaceLink` and `WorkItemSessionLink`. |
|
|
163
|
+
| `GET/POST/PATCH/DELETE /api/task-tags` | Manage prompt/task tags | `AgentContextLabel` or lightweight task taxonomy. |
|
|
164
|
+
| `GET/POST/PATCH/DELETE /api/dispatch-context-labels` | Manage reusable prompt labels | `AgentContextLabel` CRD and validation status. |
|
|
165
|
+
| `GET/POST /api/reviews` | Query/apply review artifact actions | `AgentReviewArtifact` plus approval/write-back controller. |
|
|
166
|
+
| `GET/POST/PATCH/DELETE /api/automations` | Manage automation rules | `AgentTriggerRule` CRUD, lifecycle, execution summary. |
|
|
167
|
+
| `POST /api/automations/:ruleId/lifecycle` | Enable, pause, resume, disable | Patch `AgentTriggerRule.spec.lifecycleState`. |
|
|
168
|
+
| `POST /api/automations/webhooks/:ruleId` | Deliver rule-specific webhook | Durable `WebhookDelivery` then trigger evaluation. |
|
|
169
|
+
| `GET/POST /api/settings/agent-configuration` | Agent config settings | `AgentStack` and policy defaults. |
|
|
170
|
+
| `GET/POST /api/settings/mcp-servers` | MCP server settings | `AgentMcpServer` registry and health probes. |
|
|
171
|
+
| `GET/POST /api/workspaces` | Inventory and lifecycle actions | `AgentWorkspace` list and action subresource. |
|
|
172
|
+
| Workspace actions `provision`, `pin`, `unpin`, `archive`, `cleanup`, `recover`, `notes-save`, `rebase-*` | Git workspace lifecycle | Workspace controller action requests with policy admission. |
|
|
173
|
+
| `GET /api/digest` | Dashboard digest | Agent operations summary aggregated resource. |
|
|
174
|
+
| `GET /api/runs`, `GET /api/runs/:runId` | Run list/detail | `AgentDispatchRun` and attempts. |
|
|
175
|
+
| `GET /api/runs/:runId/events` | Run event timeline | Watch/SSE projection from Agent Mux event cursor. |
|
|
176
|
+
| `GET /api/runs/:runId/tasks/:effectId` | Task/effect detail | Tool/subagent/task event detail. |
|
|
177
|
+
| `POST /api/runs/:runId/tasks/:effectId/approve` | Approve pending effect | `AgentApproval` decision subresource. |
|
|
178
|
+
| `GET /api/stream` | Server-sent updates | Krate watch stream for runs, sessions, workspaces, rules, approvals. |
|
|
179
|
+
|
|
180
|
+
## Researched component source matrix
|
|
181
|
+
|
|
182
|
+
| Source file | Product lesson for Krate |
|
|
183
|
+
| --- | --- |
|
|
184
|
+
| `packages/agent-mux/webui/src/shell/CommandPalette.tsx` | Global actions must be generated from authorized route/resource actions. |
|
|
185
|
+
| `packages/agent-mux/webui/src/shell/Sidebar.tsx` | Navigation badges should count active sessions, running dispatches, and pending hooks/approvals from live store state. |
|
|
186
|
+
| `packages/agent-mux/webui/src/shell/TopBar.tsx` | Top context should distinguish session chat, dispatch handoff, workspace, automations, and connectivity. |
|
|
187
|
+
| `packages/agent-mux/webui/src/pages/KanbanPages.tsx` | Board/list/issue/workspace/dispatch pages can share one work graph but still expose route-specific focus. |
|
|
188
|
+
| `packages/agent-mux/webui/src/components/dashboard/backlog-overview.tsx` | Repository issue board is the association hub for issues, sessions, workspaces, PRs, review artifacts, and dispatch labels. |
|
|
189
|
+
| `packages/agent-mux/webui/src/components/runs/run-realtime-execution-panel.tsx` | Dispatch rows need live event buffers and session observability, not static logs only. |
|
|
190
|
+
| `packages/agent-mux/webui/src/components/sessions/session-workspace-shell.tsx` | Chat, workspace, runtime, and observability should live in a viewport-contained shell. |
|
|
191
|
+
| `packages/agent-mux/webui/src/components/sessions/session-conversation-surface.tsx` | Continuation, transcript, tags, costs, approval mode, files, and runtime hints are part of the session contract. |
|
|
192
|
+
| `packages/agent-mux/webui/src/components/sessions/session-observability-panel.tsx` | Run events should be normalized into timeline, artifacts, runtime links, editor links, and cost summaries. |
|
|
193
|
+
| `packages/agent-mux/webui/src/components/workspaces/workspace-provisioning-page.tsx` | Workspace creation must be guided by ownership source: project, issue, or host/repository. |
|
|
194
|
+
| `packages/agent-mux/webui/src/components/workspaces/workspace-detail-shell.tsx` | Workspace detail owns sessions/runs/issues/reviews/rebase state, not just filesystem path. |
|
|
195
|
+
| `packages/agent-mux/webui/src/components/workspaces/workspace-runtime-panel.tsx` | Runtime preview/dev server/terminal surfaces need explicit health and unavailable states. |
|
|
196
|
+
| `packages/agent-mux/webui/src/components/automations/automations-page.tsx` | Trigger rules need source metadata, priority, lifecycle, target options, summaries, and webhook forms. |
|
|
197
|
+
| `packages/agent-mux/webui/src/components/review/review-panel.tsx` | Review artifacts require queue state, decision, provider integration, comments, anchors, and write-back lifecycle. |
|
|
198
|
+
| `packages/agent-mux/webui/src/components/shared/execution-context-panel.tsx` | Context must be inspectable as source, command, cwd, prompt/input, environment, and artifact provenance. |
|
|
199
|
+
|
|
200
|
+
## Krate paths to extend later
|
|
201
|
+
|
|
202
|
+
### Domain model and controller
|
|
203
|
+
|
|
204
|
+
- `src/resource-model.js`
|
|
205
|
+
- Add future resource definitions for `Agent`, `AgentRun`, `AgentRunAttempt`, `AgentContextBundle`, `AgentDispatchRule`, `AgentContextLabel`, and `AgentApproval`.
|
|
206
|
+
- Existing adjacent resources include `Repository`, `PullRequest`, `Issue`, `Review`, `Pipeline`, `Job`, `RunnerPool`, `WebhookSubscription`, and `WebhookDelivery`.
|
|
207
|
+
- `src/api-controller.js`
|
|
208
|
+
- Add dispatch APIs once resources exist.
|
|
209
|
+
- `src/kubernetes-resource-gateway.js`
|
|
210
|
+
- Persist CRD-backed or aggregated resource operations.
|
|
211
|
+
- `src/kubernetes-controller.js`
|
|
212
|
+
- Add reconciliation loops from Krate resources to Agent Mux gateway calls.
|
|
213
|
+
- `src/controller-client.js` and `src/controller-ui.js`
|
|
214
|
+
- Add UI model projections for failed-check agent actions, run summaries, active sessions, trigger rules, context labels, approvals, and chat transcript state.
|
|
215
|
+
- `src/http-server.js`
|
|
216
|
+
- Add server endpoints if the local server needs direct Agent Mux proxying outside Next route handlers.
|
|
217
|
+
|
|
218
|
+
### Existing product surfaces
|
|
219
|
+
|
|
220
|
+
- `src/gitea-backend.js`
|
|
221
|
+
- Map repository events, issues, PRs, labels, mentions, and check states into Krate dispatch events.
|
|
222
|
+
- `src/hooks-events.js`
|
|
223
|
+
- Extend webhook delivery/inspection with CI and agent dispatch events plus rule evaluations.
|
|
224
|
+
- `src/runners-ci.js`
|
|
225
|
+
- Host agent execution as a runner workload type or adjacent execution queue.
|
|
226
|
+
- `src/web-ui.js`
|
|
227
|
+
- Add excellent-flow descriptions for failed-check diagnosis, repair, chat, dispatch, run tracking, and rule-driven automation.
|
|
228
|
+
|
|
229
|
+
### Next.js app surfaces
|
|
230
|
+
|
|
231
|
+
- `apps/web/app/ui-shell.jsx`
|
|
232
|
+
- Add navigation and route components for agents, dispatch rules, context labels, approvals, and chat views.
|
|
233
|
+
- `apps/web/app/orgs/[org]/repositories/[repo]/pull-requests/page.jsx`
|
|
234
|
+
- Add PR review agents, failed-check diagnosis, patch artifacts, and approval-gated write-back.
|
|
235
|
+
- `apps/web/app/orgs/[org]/repositories/[repo]/runs/page.jsx`
|
|
236
|
+
- Show agent execution runs alongside pipeline runs and expose failed-job agent actions.
|
|
237
|
+
- `apps/web/app/orgs/[org]/repositories/[repo]/code/page.jsx`
|
|
238
|
+
- Add repository-level agent entry points such as `Ask agent`, `Run task`, and file/context attachments.
|
|
239
|
+
- `apps/web/app/orgs/[org]/repositories/[repo]/issues/page.jsx`
|
|
240
|
+
- Add issue-based dispatch and label/mention rule previews.
|
|
241
|
+
- `apps/web/app/orgs/[org]/repositories/[repo]/hooks/page.jsx`
|
|
242
|
+
- Configure repository automation rules and webhook-backed dispatch.
|
|
243
|
+
- `apps/web/app/orgs/[org]/repositories/[repo]/settings/page.jsx`
|
|
244
|
+
- Configure repository-scoped agent policy, allowed agents, context labels, and runner placement.
|
|
245
|
+
- `apps/web/app/inbox/page.jsx`
|
|
246
|
+
- Add cross-repository agent dispatch inbox and human approval queue.
|
|
247
|
+
- `apps/web/app/runners-ci/page.jsx`
|
|
248
|
+
- Add agent execution hosting, queues, logs, and runner utilization.
|
|
249
|
+
- `apps/web/app/api/controller/route.js`
|
|
250
|
+
- Include agent resources in controller snapshots.
|
|
251
|
+
- `apps/web/app/api/controller/resources/route.js`
|
|
252
|
+
- Accept future agent resource creates/updates.
|
|
253
|
+
- `apps/web/app/api/watch/[[...resource]]/route.js`
|
|
254
|
+
- Stream `AgentRun`, `AgentRunAttempt`, `AgentApproval`, and dispatch event updates.
|
|
255
|
+
|
|
256
|
+
### Cluster/package surfaces
|
|
257
|
+
|
|
258
|
+
- `charts/krate/crds/`
|
|
259
|
+
- Add CRDs for low-cardinality agent configuration resources when implementation begins.
|
|
260
|
+
- `charts/krate/templates/`
|
|
261
|
+
- Add Agent Mux gateway deployment/config or references to an external gateway.
|
|
262
|
+
- `docs/components/runners-ci.md`, `docs/components/hooks-events.md`, `docs/components/web-ui.md`
|
|
263
|
+
- Later cross-link after implementation starts.
|
|
264
|
+
|
|
265
|
+
## Agent stack, tools, and trigger source map
|
|
266
|
+
|
|
267
|
+
Agent Mux has normalized adapter and configuration concepts that should inform Krate's future `AgentStack` resources.
|
|
268
|
+
|
|
269
|
+
### Adapter capabilities and run options
|
|
270
|
+
|
|
271
|
+
- `packages/agent-mux/core/src/capabilities.ts`
|
|
272
|
+
- Defines normalized adapter capabilities: resume/fork, multi-turn, streaming, native tools, MCP, parallel tool calls, approval modes, runtime hooks, thinking, structured output, skills, AGENTS.md, subagent dispatch, parallel execution, stdin injection, multimodal input, plugins, and plugin formats.
|
|
273
|
+
- `packages/agent-mux/core/src/run-options.ts`
|
|
274
|
+
- Defines launch-time options including prompts, cwd/workspace, model/provider, approval/tool options, invocation mode, MCP servers, and execution constraints.
|
|
275
|
+
- `packages/agent-mux/core/src/config-types.ts`
|
|
276
|
+
- Defines unified agent config: model, provider, temperature, max tokens, allowed/denied commands, approval mode, MCP servers, skills, agents doc, env, and native agent config.
|
|
277
|
+
|
|
278
|
+
### MCP/plugin/skill management
|
|
279
|
+
|
|
280
|
+
- `packages/agent-mux/core/src/plugin-types.ts`
|
|
281
|
+
- Defines installed plugins, plugin listings/details, install options, search/browse options, and supported agent/plugin formats.
|
|
282
|
+
- `packages/agent-mux/core/src/plugin-manager.ts`
|
|
283
|
+
- `packages/agent-mux/core/src/plugin-manager-impl.ts`
|
|
284
|
+
- Defines the manager surface for listing/installing/updating plugins by agent.
|
|
285
|
+
- `packages/agent-mux/adapters/src/mcp-plugins.ts`
|
|
286
|
+
- Shared MCP-server plugin helper for adapters that store MCP servers under `mcpServers`.
|
|
287
|
+
- `packages/agent-mux/skills/integrate-harness/SKILL.md`
|
|
288
|
+
- Adapter checklist shows required capability audit, config schema, hook/plugin wiring, MCP support, session parsing, and tests.
|
|
289
|
+
|
|
290
|
+
### Claude Code and runtime hooks
|
|
291
|
+
|
|
292
|
+
- `packages/agent-mux/adapters/src/claude-adapter.ts`
|
|
293
|
+
- Claude adapter surface for config, MCP plugin handling, spawn args, auth/session parsing, and capabilities.
|
|
294
|
+
- `packages/agent-mux/adapters/src/claude-code/runtime-hooks/`
|
|
295
|
+
- Runtime hook config and socket server for surfacing hook/tool lifecycle events into Agent Mux.
|
|
296
|
+
|
|
297
|
+
### Trigger and work management
|
|
298
|
+
|
|
299
|
+
- `packages/agent-mux/core/src/automation.ts`
|
|
300
|
+
- Automation rule model with timer/webhook triggers, target routing, task templates, lifecycle state, source metadata, and execution records.
|
|
301
|
+
- `packages/agent-mux/core/src/kanban.ts`
|
|
302
|
+
- Work-management model: projects, issues, board columns/swimlanes, dependencies, decomposition, dispatch readiness, context labels, issue-workspace links, issue-session links, repository lifecycle, CI gates, review artifacts, workspace inventory, and workspace actions.
|
|
303
|
+
- `packages/agent-mux/gateway/src/kanban/lib/services/automation-rule-service.ts`
|
|
304
|
+
- Rule lifecycle/query/create/update/delete and execution summary behavior.
|
|
305
|
+
- `packages/agent-mux/gateway/src/kanban/lib/services/automation-webhook-service.ts`
|
|
306
|
+
- Incoming webhook materialization and delivery/execution behavior.
|
|
307
|
+
- `packages/agent-mux/gateway/src/kanban/lib/services/backlog-query-service.ts`
|
|
308
|
+
- Issue creation/move/update, repository linking, dispatch context labels, workspace links, session links, child issues, and PR creation.
|
|
309
|
+
- `packages/agent-mux/gateway/src/kanban/lib/workspace-lifecycle.ts`
|
|
310
|
+
- Workspace inventory and lifecycle actions such as pin, archive, cleanup, recover, notes, and rebase actions.
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
# Agent run memory import spec
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Krate should support importing durable agent-run memory into the org company brain. This includes `MEMORY.md`, Agent Mux/Babysitter session summaries, curated `.a5c` run journals, task results, artifact manifests, retrospectives, and selected process notes. The import path turns operational run state into governed org memory without dumping entire workspaces or leaking secrets.
|
|
6
|
+
|
|
7
|
+
## Source model
|
|
8
|
+
|
|
9
|
+
| Source | Local shape | Memory target | Default import |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| org memory entrypoint | `MEMORY.md` | `babysitter/MEMORY.md` | yes, reviewed. |
|
|
12
|
+
| run metadata | `.a5c/runs/<run>/run.json` | `babysitter/runs/<run>/run.yaml` | yes, normalized. |
|
|
13
|
+
| journal events | `.a5c/runs/<run>/journal/*.json` | `babysitter/runs/<run>/journal/*.yaml` | curated/redacted. |
|
|
14
|
+
| task records | `.a5c/runs/<run>/tasks/*/{task,result,output}.json` | `babysitter/runs/<run>/tasks/*.yaml` | summaries by default. |
|
|
15
|
+
| artifacts | `.a5c/artifacts/*` or run artifact refs | `babysitter/runs/<run>/artifacts/manifest.yaml` | digest/manifest only by default. |
|
|
16
|
+
| sessions | Agent Mux/Babysitter session transcript or summary | `babysitter/sessions/<date>/<session>.md` | summary by default. |
|
|
17
|
+
| retrospectives | run review output | `babysitter/retrospectives/<run>.md` | yes when approved. |
|
|
18
|
+
|
|
19
|
+
Raw transcripts, raw logs, raw artifacts, and raw workspace files require explicit retention policy and reviewer approval.
|
|
20
|
+
|
|
21
|
+
## Import resource
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
apiVersion: krate.a5c.ai/v1alpha1
|
|
25
|
+
kind: AgentRunMemoryImport
|
|
26
|
+
metadata:
|
|
27
|
+
name: import-01kr1z
|
|
28
|
+
namespace: krate-org-a5c
|
|
29
|
+
labels:
|
|
30
|
+
krate.a5c.ai/org: a5c
|
|
31
|
+
krate.a5c.ai/repository: krate
|
|
32
|
+
spec:
|
|
33
|
+
organizationRef: a5c
|
|
34
|
+
memoryRepository: org-company-brain
|
|
35
|
+
source:
|
|
36
|
+
kind: babysitter-run
|
|
37
|
+
runId: 01KR1ZCPQVVPJAJDNBQHGPWZZY
|
|
38
|
+
sessionId: 019e-example
|
|
39
|
+
repositoryRef: krate
|
|
40
|
+
a5cRunPath: .a5c/runs/01KR1ZCPQVVPJAJDNBQHGPWZZY
|
|
41
|
+
include:
|
|
42
|
+
memoryMd: true
|
|
43
|
+
sessionSummary: true
|
|
44
|
+
journal: curated
|
|
45
|
+
taskResults: summarized
|
|
46
|
+
artifactManifests: digest-only
|
|
47
|
+
retrospectives: true
|
|
48
|
+
targetPath: babysitter/runs/01KR1ZCPQVVPJAJDNBQHGPWZZY
|
|
49
|
+
validationPolicy:
|
|
50
|
+
redactSecrets: true
|
|
51
|
+
detectPromptInjection: true
|
|
52
|
+
requireReview: true
|
|
53
|
+
requireOntologyValid: true
|
|
54
|
+
status:
|
|
55
|
+
phase: AwaitingReview
|
|
56
|
+
sourceDigest: sha256:...
|
|
57
|
+
redactionDigest: sha256:...
|
|
58
|
+
targetBranch: krate/memory-import/01kr1z
|
|
59
|
+
pullRequestRef: a5c-ai/company-brain/124
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Import lifecycle
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
run/session selected for import
|
|
66
|
+
-> resolve org and repository ownership
|
|
67
|
+
-> collect admitted .a5c files and session summary
|
|
68
|
+
-> compute source digests
|
|
69
|
+
-> redact secrets and unsafe content
|
|
70
|
+
-> normalize to YAML/Markdown memory records
|
|
71
|
+
-> validate ontology, frontmatter, paths, owners, and edges
|
|
72
|
+
-> create AgentRunMemoryImport
|
|
73
|
+
-> open review branch/PR when policy allows
|
|
74
|
+
-> merge into org company brain
|
|
75
|
+
-> rebuild indexes
|
|
76
|
+
-> link memory commit to source run/session
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Normalized run metadata
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
nodeKind: BabysitterRun
|
|
83
|
+
id: babysitter-run:01KR1ZCPQVVPJAJDNBQHGPWZZY
|
|
84
|
+
attributes:
|
|
85
|
+
organization: org:a5c
|
|
86
|
+
repository: repository:krate
|
|
87
|
+
process: krate-full-spec-convergence
|
|
88
|
+
status: completed
|
|
89
|
+
startedAt: 2026-05-10T09:00:00Z
|
|
90
|
+
completedAt: 2026-05-10T10:30:00Z
|
|
91
|
+
sourceDigest: sha256:...
|
|
92
|
+
redactionStatus: redacted
|
|
93
|
+
edges:
|
|
94
|
+
ran_for_repo:
|
|
95
|
+
- target: repository:krate
|
|
96
|
+
has_session:
|
|
97
|
+
- target: babysitter-session:019e-example
|
|
98
|
+
produced_retrospective:
|
|
99
|
+
- target: run-retrospective:01KR1ZCPQVVPJAJDNBQHGPWZZY
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Normalized journal event
|
|
103
|
+
|
|
104
|
+
```yaml
|
|
105
|
+
nodeKind: RunJournalEvent
|
|
106
|
+
id: run-journal-event:01KR1ZCPQ:000001
|
|
107
|
+
attributes:
|
|
108
|
+
sequence: 1
|
|
109
|
+
eventType: task.created
|
|
110
|
+
timestamp: 2026-05-10T09:01:00Z
|
|
111
|
+
summary: Created implementation task for docs refinement.
|
|
112
|
+
sourcePath: .a5c/runs/01KR1ZCP.../journal/000001.json
|
|
113
|
+
sourceDigest: sha256:...
|
|
114
|
+
redactionStatus: redacted
|
|
115
|
+
edges:
|
|
116
|
+
event_of_run:
|
|
117
|
+
- target: babysitter-run:01KR1ZCPQVVPJAJDNBQHGPWZZY
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Session summary format
|
|
121
|
+
|
|
122
|
+
```markdown
|
|
123
|
+
---
|
|
124
|
+
id: babysitter-session:019e-example
|
|
125
|
+
kind: BabysitterSession
|
|
126
|
+
title: Krate agent docs refinement session
|
|
127
|
+
status: approved
|
|
128
|
+
owners: [team:platform]
|
|
129
|
+
repoRefs: [repository:krate]
|
|
130
|
+
sourceRefs:
|
|
131
|
+
- babysitter-run:01KR1ZCPQVVPJAJDNBQHGPWZZY
|
|
132
|
+
updatedAt: 2026-05-10T10:30:00Z
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
# Session summary
|
|
136
|
+
|
|
137
|
+
## Goal
|
|
138
|
+
|
|
139
|
+
Summarize the user goal, constraints, and final state.
|
|
140
|
+
|
|
141
|
+
## Important decisions
|
|
142
|
+
|
|
143
|
+
- Docs-only scope.
|
|
144
|
+
- Org company brain stores curated run memory, not raw `.a5c` dumps.
|
|
145
|
+
|
|
146
|
+
## Follow-ups
|
|
147
|
+
|
|
148
|
+
- Implement org-scoped memory import controller after resource model lands.
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## `MEMORY.md` handling
|
|
152
|
+
|
|
153
|
+
`babysitter/MEMORY.md` is the org-level orchestration entrypoint. It should contain stable practices, conventions, and lessons that should apply to future runs in the org. It must not become a dumping ground for raw transcripts.
|
|
154
|
+
|
|
155
|
+
Update modes:
|
|
156
|
+
|
|
157
|
+
- human edit through memory repo PR;
|
|
158
|
+
- agent-proposed update through `AgentMemoryUpdate`;
|
|
159
|
+
- retrospective promotion from `AgentRunMemoryImport`;
|
|
160
|
+
- controller-generated index summary with explicit generated marker.
|
|
161
|
+
|
|
162
|
+
Every update requires owner review unless an org policy grants auto-merge for low-risk generated sections.
|
|
163
|
+
|
|
164
|
+
## Redaction and safety
|
|
165
|
+
|
|
166
|
+
Imports must remove or block:
|
|
167
|
+
|
|
168
|
+
- secrets, tokens, private keys, kubeconfigs, and credential-like values;
|
|
169
|
+
- raw webhook signatures and auth headers;
|
|
170
|
+
- private customer data outside allowed org policy;
|
|
171
|
+
- prompt-injection instructions that target future agents;
|
|
172
|
+
- unrestricted filesystem paths outside admitted run roots;
|
|
173
|
+
- raw artifact bytes unless explicitly allowed.
|
|
174
|
+
|
|
175
|
+
The redaction report is stored as metadata and digest, not raw secret content.
|
|
176
|
+
|
|
177
|
+
## Context use
|
|
178
|
+
|
|
179
|
+
Imported run memory can be selected by context assembly when:
|
|
180
|
+
|
|
181
|
+
- org matches;
|
|
182
|
+
- repository or deployment matches;
|
|
183
|
+
- agent stack, skill, tool, process, issue, PR, or trigger matches;
|
|
184
|
+
- run status and validation status are allowed;
|
|
185
|
+
- memory source policy includes `BabysitterRun`, `BabysitterSession`, `RunJournalEvent`, or `RunRetrospective` kinds.
|
|
186
|
+
|
|
187
|
+
Summaries and retrospectives should rank above raw journal events unless the task asks for replay/debug detail.
|
|
188
|
+
|
|
189
|
+
## Acceptance criteria
|
|
190
|
+
|
|
191
|
+
- A run import can include `MEMORY.md`, session summary, curated journal events, task summaries, and artifact manifests.
|
|
192
|
+
- Import output is org-scoped, redacted, ontology-valid, and reviewable before merge.
|
|
193
|
+
- Context assembly can select imported run memory from a pinned memory commit.
|
|
194
|
+
- UI can show source run, session, imported files, redaction status, validation status, PR, and resulting memory commit.
|
|
195
|
+
- Raw `.a5c` dumps are never imported by default.
|
|
196
|
+
|
|
197
|
+
## Import phases and conditions
|
|
198
|
+
|
|
199
|
+
`AgentRunMemoryImport.status.phase` should use stable values:
|
|
200
|
+
|
|
201
|
+
| Phase | Meaning |
|
|
202
|
+
| --- | --- |
|
|
203
|
+
| `Pending` | import request accepted but not collected. |
|
|
204
|
+
| `Collecting` | source `.a5c`, session, and artifact metadata are being read. |
|
|
205
|
+
| `Redacting` | secret and safety redaction is running. |
|
|
206
|
+
| `Normalizing` | source JSON/transcripts are becoming Markdown/YAML memory records. |
|
|
207
|
+
| `Validating` | ontology, frontmatter, path, owner, and edge validators are running. |
|
|
208
|
+
| `AwaitingReview` | import branch/PR exists and requires human review. |
|
|
209
|
+
| `Merged` | memory repo accepted the import and indexes were rebuilt. |
|
|
210
|
+
| `Rejected` | reviewer rejected the import. |
|
|
211
|
+
| `Failed` | controller could not complete import. |
|
|
212
|
+
|
|
213
|
+
Required conditions:
|
|
214
|
+
|
|
215
|
+
- `SourceResolved`;
|
|
216
|
+
- `OrgScopeVerified`;
|
|
217
|
+
- `SecretsRedacted`;
|
|
218
|
+
- `PromptInjectionScanned`;
|
|
219
|
+
- `OntologyValid`;
|
|
220
|
+
- `ReviewReady`;
|
|
221
|
+
- `MemoryMerged`;
|
|
222
|
+
- `Ready`.
|
|
223
|
+
|
|
224
|
+
Conditions must include source digest, target path, validation report digest, and blocking reason without including sensitive source content.
|
|
225
|
+
|
|
226
|
+
## Retention tiers
|
|
227
|
+
|
|
228
|
+
| Tier | Keeps | Default |
|
|
229
|
+
| --- | --- | --- |
|
|
230
|
+
| `summary-only` | `MEMORY.md`, session summary, run summary, task summaries, retrospective | default for normal runs. |
|
|
231
|
+
| `curated-journal` | summary plus selected journal events and bounded excerpts | default for incident/debug runs. |
|
|
232
|
+
| `full-journal-redacted` | all journal events after redaction, no raw artifacts | requires reviewer approval. |
|
|
233
|
+
| `artifact-manifest-only` | artifact names, kinds, sizes, digests, and storage refs | default artifact mode. |
|
|
234
|
+
| `artifact-bytes-retained` | selected raw artifacts in object storage | restricted, retention-limited, approval required. |
|
|
235
|
+
|
|
236
|
+
The selected retention tier is stored on `AgentRunMemoryImport.spec.retentionTier` and repeated in the resulting memory metadata.
|
|
237
|
+
|
|
238
|
+
## Import conflict handling
|
|
239
|
+
|
|
240
|
+
- If target path already exists for the same source digest, mark import `Ready` without opening a duplicate PR.
|
|
241
|
+
- If target path exists with a different digest, create a new branch and show a conflict in the memory update review.
|
|
242
|
+
- If the source run is still active, allow summary import only when policy permits partial imports.
|
|
243
|
+
- If redaction removes too much content to preserve meaning, block with `Ready=False` and `reason=RedactionTooBroad`.
|
|
244
|
+
- If ontology validation fails, keep the branch for review but block merge.
|
|
245
|
+
|
|
246
|
+
## UI review panel
|
|
247
|
+
|
|
248
|
+
The memory import review panel should show:
|
|
249
|
+
|
|
250
|
+
- source org, namespace, repository, run ID, session ID, process, and status;
|
|
251
|
+
- selected retention tier and included source families;
|
|
252
|
+
- source digest, redaction digest, validation report digest, and target branch;
|
|
253
|
+
- generated file tree and diff summary;
|
|
254
|
+
- secret-scan and prompt-injection scan summaries;
|
|
255
|
+
- linked Agent Dispatch Run, Agent Mux session, Babysitter run, artifacts, and retrospective;
|
|
256
|
+
- actions: approve, request changes, reject, merge, rerun validation, lower retention tier.
|