dsh-env-manager-plugin 0.1.0 → 0.1.1
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/LICENSE +21 -21
- package/README.md +273 -250
- package/client.js +2581 -2581
- package/cordis.patch.yml +4 -4
- package/docs/00-project/current-state.md +32 -6
- package/docs/00-project/glossary.md +215 -215
- package/docs/00-project/project-brief.md +114 -114
- package/docs/00-project/roadmap.md +89 -89
- package/docs/01-architecture/DSH_Environment_Service_Memory_Skill_Brainstorm.md +493 -493
- package/docs/01-architecture/api-verification.md +416 -416
- package/docs/01-architecture/architecture-overview.md +222 -222
- package/docs/01-architecture/data-model.md +930 -930
- package/docs/01-architecture/decisions/ADR-0001-plugin-as-bundle.md +29 -29
- package/docs/01-architecture/decisions/ADR-0002-file-based-storage.md +25 -25
- package/docs/01-architecture/decisions/ADR-0003-skill-router-over-search.md +25 -25
- package/docs/01-architecture/decisions/ADR-0004-typescript-host-js-client.md +31 -31
- package/docs/01-architecture/decisions/ADR-0005-layered-rule-resolution.md +36 -36
- package/docs/01-architecture/decisions/ADR-0006-credentials-as-references.md +30 -30
- package/docs/01-architecture/decisions/ADR-0007-session-scoped-default-environment.md +28 -28
- package/docs/01-architecture/decisions/ADR-0008-memory-bridge-not-second-store.md +31 -31
- package/docs/01-architecture/decisions/ADR-0009-client-host-http-transport.md +87 -87
- package/docs/01-architecture/decisions/ADR-0010-environment-plane-model.md +87 -87
- package/docs/01-architecture/decisions/ADR-0011-k8s-node-execution-model.md +92 -92
- package/docs/01-architecture/design.md +666 -666
- package/docs/01-architecture/detailed-design.md +961 -961
- package/docs/01-architecture/implementation-plan.md +323 -323
- package/docs/01-architecture/module-boundaries.md +306 -306
- package/docs/01-architecture/security-model.md +227 -227
- package/docs/01-architecture/storage-contract.md +224 -224
- package/docs/01-architecture/tool-contract.md +438 -438
- package/docs/01-architecture/ui-design.md +587 -587
- package/docs/02-harness/agent-behavior.md +36 -36
- package/docs/02-harness/change-snapshot-policy.md +29 -29
- package/docs/02-harness/client-ui-integration.md +110 -110
- package/docs/02-harness/context-policy.md +43 -43
- package/docs/02-harness/harness-standard.md +91 -91
- package/docs/02-harness/task-execution-policy.md +26 -26
- package/docs/02-harness/verification-policy.md +97 -97
- package/docs/03-openspec/archive-rule.md +25 -25
- package/docs/03-openspec/bugfix-rule.md +30 -30
- package/docs/03-openspec/design-rule.md +33 -33
- package/docs/03-openspec/openspec-usage-guide.md +31 -31
- package/docs/03-openspec/proposal-rule.md +70 -70
- package/docs/03-openspec/spec-rule.md +33 -33
- package/docs/03-openspec/tasks-rule.md +31 -31
- package/docs/04-development/coding-style.md +67 -67
- package/docs/04-development/dependency-policy.md +43 -43
- package/docs/04-development/development-guide.md +85 -85
- package/docs/04-development/directory-convention.md +105 -105
- package/docs/04-development/local-run-guide.md +61 -55
- package/docs/04-development/testing-guide.md +102 -102
- package/docs/05-domain/deployment-template.md +76 -76
- package/docs/05-domain/environment-template.md +165 -165
- package/docs/05-domain/operation-binding-template.md +55 -55
- package/docs/05-domain/operation-record-template.md +55 -55
- package/docs/05-domain/prompt-template.md +90 -90
- package/docs/05-domain/rule-template.md +73 -73
- package/docs/05-domain/service-template.md +39 -39
- package/docs/06-operations/deployment-guide.md +54 -54
- package/docs/06-operations/release.md +198 -188
- package/docs/06-operations/security-policy.md +53 -53
- package/docs/06-operations/troubleshooting.md +141 -91
- package/docs/07-templates/adr-template.md +21 -21
- package/docs/07-templates/bugfix-template.md +11 -11
- package/docs/07-templates/case-template.md +15 -15
- package/docs/07-templates/design-template.md +29 -29
- package/docs/07-templates/proposal-template.md +19 -19
- package/docs/07-templates/spec-template.md +15 -15
- package/docs/07-templates/tasks-template.md +12 -12
- package/docs/99-archive/README.md +13 -13
- package/docs/README.md +142 -142
- package/icon.svg +4 -4
- package/index.js +31 -8
- package/lib/skill.js +37 -37
- package/locale/en.json +6 -6
- package/locale/zh.json +6 -6
- package/package.json +101 -99
- package/scripts/repair-profile.mjs +141 -0
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
# Environment Template
|
|
2
|
-
|
|
3
|
-
Copy into `<dataDir>/environments/<id>.yaml` and replace the example values.
|
|
4
|
-
|
|
5
|
-
```yaml
|
|
6
|
-
id: test-a
|
|
7
|
-
schemaVersion: 1
|
|
8
|
-
name: Test Environment A
|
|
9
|
-
aliases: [ta, test-a]
|
|
10
|
-
category: test # dev | test | staging | production | custom
|
|
11
|
-
description: Main test environment for aicoservice
|
|
12
|
-
|
|
13
|
-
roles:
|
|
14
|
-
- id: management
|
|
15
|
-
name: Management Plane
|
|
16
|
-
description: Admin plane and control entry points
|
|
17
|
-
- id: business
|
|
18
|
-
name: Business Plane
|
|
19
|
-
description: Business traffic and workloads
|
|
20
|
-
- id: database
|
|
21
|
-
name: Database
|
|
22
|
-
description: Database tier (primary/replica/sharding detail is Phase 2)
|
|
23
|
-
- id: extension
|
|
24
|
-
name: Expansion / other
|
|
25
|
-
description: Expansion nodes and unclassified workloads
|
|
26
|
-
|
|
27
|
-
hosts:
|
|
28
|
-
- id: host-001
|
|
29
|
-
name: test-a-node-01
|
|
30
|
-
kind: vm
|
|
31
|
-
os: ubuntu-22.04
|
|
32
|
-
platform: Linux / x86_64
|
|
33
|
-
ip: 10.0.1.10
|
|
34
|
-
sshPort: 22
|
|
35
|
-
roles: [management, business] # co-location: one host, two roles
|
|
36
|
-
access: [ssh]
|
|
37
|
-
adminUser: root
|
|
38
|
-
isActive: true
|
|
39
|
-
credentialRef: cred-test-a-root
|
|
40
|
-
accounts:
|
|
41
|
-
- id: root
|
|
42
|
-
username: root
|
|
43
|
-
purpose: system administration
|
|
44
|
-
protocol: ssh
|
|
45
|
-
port: 22
|
|
46
|
-
authType: private-key
|
|
47
|
-
credentialRef: cred-test-a-root
|
|
48
|
-
lastLoginAt: 2026-10-31T08:12:00.000Z
|
|
49
|
-
lastLoginFrom: 10.0.8.21
|
|
50
|
-
- id: console
|
|
51
|
-
username: ops
|
|
52
|
-
purpose: business web console
|
|
53
|
-
protocol: web
|
|
54
|
-
loginUrl: https://test-a.example.internal/login
|
|
55
|
-
authType: password
|
|
56
|
-
credentialRef: env-manager/test-a/console
|
|
57
|
-
- id: db-01
|
|
58
|
-
name: test-a-db-01
|
|
59
|
-
kind: physical
|
|
60
|
-
platform: Linux / x86_64
|
|
61
|
-
ip: 10.0.1.30
|
|
62
|
-
sshPort: 22
|
|
63
|
-
roles: [database]
|
|
64
|
-
access: [ssh]
|
|
65
|
-
adminUser: root
|
|
66
|
-
isActive: true
|
|
67
|
-
note: primary placeholder; topology is Phase 2
|
|
68
|
-
- id: k8s-aio-01
|
|
69
|
-
name: test-a-k8s-aio-01
|
|
70
|
-
kind: k8s-all-in-one # control plane + worker on one machine
|
|
71
|
-
platform: Linux / x86_64
|
|
72
|
-
ip: 10.0.1.20
|
|
73
|
-
sshPort: 22
|
|
74
|
-
roles: [management, business]
|
|
75
|
-
access: [ssh, kubectl, docker]
|
|
76
|
-
clusterRef: k8s-01
|
|
77
|
-
adminUser: root
|
|
78
|
-
isActive: true
|
|
79
|
-
note: kubeconfig stays behind the cluster credentialRef
|
|
80
|
-
- id: pod-host-01
|
|
81
|
-
name: test-a-pod-host-01
|
|
82
|
-
kind: pod-host # machine running Pods; operate with docker exec
|
|
83
|
-
platform: Linux / x86_64
|
|
84
|
-
ip: 10.0.1.21
|
|
85
|
-
sshPort: 22
|
|
86
|
-
roles: [business]
|
|
87
|
-
access: [ssh, docker]
|
|
88
|
-
clusterRef: k8s-01
|
|
89
|
-
adminUser: root
|
|
90
|
-
isActive: true
|
|
91
|
-
note: Pods are workloads; this record is the host, not an individual Pod
|
|
92
|
-
|
|
93
|
-
clusters:
|
|
94
|
-
- id: k8s-01
|
|
95
|
-
name: test-a-k8s
|
|
96
|
-
kind: kubernetes
|
|
97
|
-
topology: all-in-one # all-in-one | separate | external
|
|
98
|
-
apiEndpoint: https://10.0.1.20:6443
|
|
99
|
-
namespaces: [dv-sop]
|
|
100
|
-
credentialRef: cred-test-a-kubeconfig
|
|
101
|
-
|
|
102
|
-
endpoints:
|
|
103
|
-
- id: ep-ssh-01
|
|
104
|
-
kind: ssh
|
|
105
|
-
hostRef: host-001
|
|
106
|
-
port: 22
|
|
107
|
-
credentialRef: cred-test-a-root
|
|
108
|
-
- id: ep-web-01
|
|
109
|
-
kind: web
|
|
110
|
-
url: https://test-a.example.internal
|
|
111
|
-
|
|
112
|
-
loginRecords:
|
|
113
|
-
- id: login-0001
|
|
114
|
-
at: 2026-10-31T08:12:00.000Z
|
|
115
|
-
username: root
|
|
116
|
-
hostRef: host-001
|
|
117
|
-
accountId: root
|
|
118
|
-
protocol: ssh
|
|
119
|
-
sourceIp: 10.0.8.21
|
|
120
|
-
result: success # success | failure
|
|
121
|
-
note: jump-host session
|
|
122
|
-
|
|
123
|
-
createdAt: 2026-11-01T03:00:00.000Z
|
|
124
|
-
updatedAt: 2026-11-01T03:00:00.000Z
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Notes
|
|
128
|
-
|
|
129
|
-
- `id` must match the file name.
|
|
130
|
-
- One environment is one network and one configuration page. Its management, business,
|
|
131
|
-
database and expansion planes are role views over the same `hosts[]`, not separate
|
|
132
|
-
environments. The UI shows a node in every plane it serves.
|
|
133
|
-
- `roles` must contain at least one entry, and every `hosts[].roles` value must reference a
|
|
134
|
-
declared `roles[].id`. A host must declare at least one role. The standard ids are
|
|
135
|
-
`management`, `business`, `database` and `extension`; custom ids are allowed.
|
|
136
|
-
- A host that serves two planes is one entry with two roles; do not duplicate it.
|
|
137
|
-
- `hosts[].kind` is one of `vm`, `physical`, `k8s-all-in-one`, `k8s-worker` or `pod-host`;
|
|
138
|
-
missing means `vm`. `k8s-all-in-one` means the control plane and worker share a machine.
|
|
139
|
-
`pod-host` means the machine runs Pods and is operated with `docker exec`; it is still one
|
|
140
|
-
host, not one entry per Pod.
|
|
141
|
-
- `hosts[].access` records the command surfaces present on the machine: `ssh`, `kubectl`,
|
|
142
|
-
`docker`. It is metadata, not an authorization grant. The form pre-fills defaults; the
|
|
143
|
-
values in YAML are authoritative.
|
|
144
|
-
- `k8s-all-in-one` and `k8s-worker` require `clusterRef` to an existing cluster.
|
|
145
|
-
`pod-host` may omit it for a Docker-only machine outside the cluster. Any `clusterRef`
|
|
146
|
-
must resolve within this environment.
|
|
147
|
-
- `clusters[].topology` is `all-in-one`, `separate` or `external`; it is descriptive and
|
|
148
|
-
optional. Per-host `kind` is authoritative.
|
|
149
|
-
- `endpoints[].hostRef` / `clusterRef` must resolve within this environment.
|
|
150
|
-
- `credentialRef` is a reference only; never put a value here. The same rule applies to
|
|
151
|
-
every `accounts[].credentialRef`.
|
|
152
|
-
- `category: production` triggers the approval gate on management writes.
|
|
153
|
-
- `accounts[]` is capped at 50 per host; `loginRecords[]` is capped at 200 per
|
|
154
|
-
environment. Login records may reference a host and an account on that host.
|
|
155
|
-
- `accounts[].loginUrl` is the web console entry URL for a management or business login;
|
|
156
|
-
`username` is the login name. It must be an absolute `http(s)` URL. The password is never
|
|
157
|
-
stored here: the UI writes it to the DSH credential service and keeps only `credentialRef`.
|
|
158
|
-
- `loginRecords` are audit context, not a replacement for a PAM/SIEM system. Keep only
|
|
159
|
-
the fields needed by DSH; do not copy session recordings or credentials into YAML.
|
|
160
|
-
- The panel's batch import writes one node per line as
|
|
161
|
-
`IP,name,roles,port,user`; use `|` or `/` between roles. It creates generic `vm` nodes
|
|
162
|
-
with `access: [ssh]`, never accepts passwords, and leaves Kubernetes/Pod-host
|
|
163
|
-
classification to the node form or YAML.
|
|
164
|
-
- Database primary/replica/sharding topology is not modeled in Phase 1. Use the
|
|
165
|
-
`database` role plus a node note; a later schema may add topology metadata.
|
|
1
|
+
# Environment Template
|
|
2
|
+
|
|
3
|
+
Copy into `<dataDir>/environments/<id>.yaml` and replace the example values.
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
id: test-a
|
|
7
|
+
schemaVersion: 1
|
|
8
|
+
name: Test Environment A
|
|
9
|
+
aliases: [ta, test-a]
|
|
10
|
+
category: test # dev | test | staging | production | custom
|
|
11
|
+
description: Main test environment for aicoservice
|
|
12
|
+
|
|
13
|
+
roles:
|
|
14
|
+
- id: management
|
|
15
|
+
name: Management Plane
|
|
16
|
+
description: Admin plane and control entry points
|
|
17
|
+
- id: business
|
|
18
|
+
name: Business Plane
|
|
19
|
+
description: Business traffic and workloads
|
|
20
|
+
- id: database
|
|
21
|
+
name: Database
|
|
22
|
+
description: Database tier (primary/replica/sharding detail is Phase 2)
|
|
23
|
+
- id: extension
|
|
24
|
+
name: Expansion / other
|
|
25
|
+
description: Expansion nodes and unclassified workloads
|
|
26
|
+
|
|
27
|
+
hosts:
|
|
28
|
+
- id: host-001
|
|
29
|
+
name: test-a-node-01
|
|
30
|
+
kind: vm
|
|
31
|
+
os: ubuntu-22.04
|
|
32
|
+
platform: Linux / x86_64
|
|
33
|
+
ip: 10.0.1.10
|
|
34
|
+
sshPort: 22
|
|
35
|
+
roles: [management, business] # co-location: one host, two roles
|
|
36
|
+
access: [ssh]
|
|
37
|
+
adminUser: root
|
|
38
|
+
isActive: true
|
|
39
|
+
credentialRef: cred-test-a-root
|
|
40
|
+
accounts:
|
|
41
|
+
- id: root
|
|
42
|
+
username: root
|
|
43
|
+
purpose: system administration
|
|
44
|
+
protocol: ssh
|
|
45
|
+
port: 22
|
|
46
|
+
authType: private-key
|
|
47
|
+
credentialRef: cred-test-a-root
|
|
48
|
+
lastLoginAt: 2026-10-31T08:12:00.000Z
|
|
49
|
+
lastLoginFrom: 10.0.8.21
|
|
50
|
+
- id: console
|
|
51
|
+
username: ops
|
|
52
|
+
purpose: business web console
|
|
53
|
+
protocol: web
|
|
54
|
+
loginUrl: https://test-a.example.internal/login
|
|
55
|
+
authType: password
|
|
56
|
+
credentialRef: env-manager/test-a/console
|
|
57
|
+
- id: db-01
|
|
58
|
+
name: test-a-db-01
|
|
59
|
+
kind: physical
|
|
60
|
+
platform: Linux / x86_64
|
|
61
|
+
ip: 10.0.1.30
|
|
62
|
+
sshPort: 22
|
|
63
|
+
roles: [database]
|
|
64
|
+
access: [ssh]
|
|
65
|
+
adminUser: root
|
|
66
|
+
isActive: true
|
|
67
|
+
note: primary placeholder; topology is Phase 2
|
|
68
|
+
- id: k8s-aio-01
|
|
69
|
+
name: test-a-k8s-aio-01
|
|
70
|
+
kind: k8s-all-in-one # control plane + worker on one machine
|
|
71
|
+
platform: Linux / x86_64
|
|
72
|
+
ip: 10.0.1.20
|
|
73
|
+
sshPort: 22
|
|
74
|
+
roles: [management, business]
|
|
75
|
+
access: [ssh, kubectl, docker]
|
|
76
|
+
clusterRef: k8s-01
|
|
77
|
+
adminUser: root
|
|
78
|
+
isActive: true
|
|
79
|
+
note: kubeconfig stays behind the cluster credentialRef
|
|
80
|
+
- id: pod-host-01
|
|
81
|
+
name: test-a-pod-host-01
|
|
82
|
+
kind: pod-host # machine running Pods; operate with docker exec
|
|
83
|
+
platform: Linux / x86_64
|
|
84
|
+
ip: 10.0.1.21
|
|
85
|
+
sshPort: 22
|
|
86
|
+
roles: [business]
|
|
87
|
+
access: [ssh, docker]
|
|
88
|
+
clusterRef: k8s-01
|
|
89
|
+
adminUser: root
|
|
90
|
+
isActive: true
|
|
91
|
+
note: Pods are workloads; this record is the host, not an individual Pod
|
|
92
|
+
|
|
93
|
+
clusters:
|
|
94
|
+
- id: k8s-01
|
|
95
|
+
name: test-a-k8s
|
|
96
|
+
kind: kubernetes
|
|
97
|
+
topology: all-in-one # all-in-one | separate | external
|
|
98
|
+
apiEndpoint: https://10.0.1.20:6443
|
|
99
|
+
namespaces: [dv-sop]
|
|
100
|
+
credentialRef: cred-test-a-kubeconfig
|
|
101
|
+
|
|
102
|
+
endpoints:
|
|
103
|
+
- id: ep-ssh-01
|
|
104
|
+
kind: ssh
|
|
105
|
+
hostRef: host-001
|
|
106
|
+
port: 22
|
|
107
|
+
credentialRef: cred-test-a-root
|
|
108
|
+
- id: ep-web-01
|
|
109
|
+
kind: web
|
|
110
|
+
url: https://test-a.example.internal
|
|
111
|
+
|
|
112
|
+
loginRecords:
|
|
113
|
+
- id: login-0001
|
|
114
|
+
at: 2026-10-31T08:12:00.000Z
|
|
115
|
+
username: root
|
|
116
|
+
hostRef: host-001
|
|
117
|
+
accountId: root
|
|
118
|
+
protocol: ssh
|
|
119
|
+
sourceIp: 10.0.8.21
|
|
120
|
+
result: success # success | failure
|
|
121
|
+
note: jump-host session
|
|
122
|
+
|
|
123
|
+
createdAt: 2026-11-01T03:00:00.000Z
|
|
124
|
+
updatedAt: 2026-11-01T03:00:00.000Z
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Notes
|
|
128
|
+
|
|
129
|
+
- `id` must match the file name.
|
|
130
|
+
- One environment is one network and one configuration page. Its management, business,
|
|
131
|
+
database and expansion planes are role views over the same `hosts[]`, not separate
|
|
132
|
+
environments. The UI shows a node in every plane it serves.
|
|
133
|
+
- `roles` must contain at least one entry, and every `hosts[].roles` value must reference a
|
|
134
|
+
declared `roles[].id`. A host must declare at least one role. The standard ids are
|
|
135
|
+
`management`, `business`, `database` and `extension`; custom ids are allowed.
|
|
136
|
+
- A host that serves two planes is one entry with two roles; do not duplicate it.
|
|
137
|
+
- `hosts[].kind` is one of `vm`, `physical`, `k8s-all-in-one`, `k8s-worker` or `pod-host`;
|
|
138
|
+
missing means `vm`. `k8s-all-in-one` means the control plane and worker share a machine.
|
|
139
|
+
`pod-host` means the machine runs Pods and is operated with `docker exec`; it is still one
|
|
140
|
+
host, not one entry per Pod.
|
|
141
|
+
- `hosts[].access` records the command surfaces present on the machine: `ssh`, `kubectl`,
|
|
142
|
+
`docker`. It is metadata, not an authorization grant. The form pre-fills defaults; the
|
|
143
|
+
values in YAML are authoritative.
|
|
144
|
+
- `k8s-all-in-one` and `k8s-worker` require `clusterRef` to an existing cluster.
|
|
145
|
+
`pod-host` may omit it for a Docker-only machine outside the cluster. Any `clusterRef`
|
|
146
|
+
must resolve within this environment.
|
|
147
|
+
- `clusters[].topology` is `all-in-one`, `separate` or `external`; it is descriptive and
|
|
148
|
+
optional. Per-host `kind` is authoritative.
|
|
149
|
+
- `endpoints[].hostRef` / `clusterRef` must resolve within this environment.
|
|
150
|
+
- `credentialRef` is a reference only; never put a value here. The same rule applies to
|
|
151
|
+
every `accounts[].credentialRef`.
|
|
152
|
+
- `category: production` triggers the approval gate on management writes.
|
|
153
|
+
- `accounts[]` is capped at 50 per host; `loginRecords[]` is capped at 200 per
|
|
154
|
+
environment. Login records may reference a host and an account on that host.
|
|
155
|
+
- `accounts[].loginUrl` is the web console entry URL for a management or business login;
|
|
156
|
+
`username` is the login name. It must be an absolute `http(s)` URL. The password is never
|
|
157
|
+
stored here: the UI writes it to the DSH credential service and keeps only `credentialRef`.
|
|
158
|
+
- `loginRecords` are audit context, not a replacement for a PAM/SIEM system. Keep only
|
|
159
|
+
the fields needed by DSH; do not copy session recordings or credentials into YAML.
|
|
160
|
+
- The panel's batch import writes one node per line as
|
|
161
|
+
`IP,name,roles,port,user`; use `|` or `/` between roles. It creates generic `vm` nodes
|
|
162
|
+
with `access: [ssh]`, never accepts passwords, and leaves Kubernetes/Pod-host
|
|
163
|
+
classification to the node form or YAML.
|
|
164
|
+
- Database primary/replica/sharding topology is not modeled in Phase 1. Use the
|
|
165
|
+
`database` role plus a node note; a later schema may add topology metadata.
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
# Operation Binding Template
|
|
2
|
-
|
|
3
|
-
Copy into `<dataDir>/operations/<id>.yaml`.
|
|
4
|
-
|
|
5
|
-
```yaml
|
|
6
|
-
id: binding-001
|
|
7
|
-
schemaVersion: 1
|
|
8
|
-
operation: redeploy # standard id or custom id
|
|
9
|
-
match:
|
|
10
|
-
environmentId: test-a
|
|
11
|
-
serviceId: aicoservice
|
|
12
|
-
skill:
|
|
13
|
-
name: redeploy-k8s-service
|
|
14
|
-
expectedSource: null # optional SkillSummary.source constraint
|
|
15
|
-
expectedProvider: null # optional SkillSummary.provider constraint
|
|
16
|
-
parameters:
|
|
17
|
-
namespace: ${deployment.location.namespace}
|
|
18
|
-
workload: ${deployment.location.workload.name}
|
|
19
|
-
cluster: ${deployment.location.clusterRef}
|
|
20
|
-
policy:
|
|
21
|
-
requiresApproval: true
|
|
22
|
-
allowProduction: false
|
|
23
|
-
enabled: true
|
|
24
|
-
createdAt: 2026-11-01T03:00:00.000Z
|
|
25
|
-
updatedAt: 2026-11-01T03:00:00.000Z
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Match levels
|
|
29
|
-
|
|
30
|
-
| Level | Selectors present |
|
|
31
|
-
|---|---|
|
|
32
|
-
| `deployment` | `deploymentId` |
|
|
33
|
-
| `environment-service` | `environmentId` + `serviceId` |
|
|
34
|
-
| `service` | `serviceId` |
|
|
35
|
-
| `category-mode` | `serviceCategory` + `deploymentMode` |
|
|
36
|
-
| `global` | none (empty `match: {}`) |
|
|
37
|
-
|
|
38
|
-
Every declared selector must match. The highest eligible level wins. Two eligible bindings at the same level are a conflict, never a coin flip.
|
|
39
|
-
|
|
40
|
-
A `match` must be exactly one of these five shapes. For example `environmentId` alone, or `environmentId` + `deploymentMode`, is invalid (`RECORD_INVALID`).
|
|
41
|
-
|
|
42
|
-
## Standard operations
|
|
43
|
-
|
|
44
|
-
```text
|
|
45
|
-
install, deploy, redeploy, replace, restart, upgrade, rollback, uninstall,
|
|
46
|
-
collect-logs, health-check, inspect, upload, download
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Custom operations are allowed but must be bound explicitly.
|
|
50
|
-
|
|
51
|
-
## Policy
|
|
52
|
-
|
|
53
|
-
- Write operations default to `requiresApproval: true`.
|
|
54
|
-
- `allowProduction` defaults to `false`.
|
|
55
|
-
- A binding is discovery information. It does not execute anything.
|
|
1
|
+
# Operation Binding Template
|
|
2
|
+
|
|
3
|
+
Copy into `<dataDir>/operations/<id>.yaml`.
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
id: binding-001
|
|
7
|
+
schemaVersion: 1
|
|
8
|
+
operation: redeploy # standard id or custom id
|
|
9
|
+
match:
|
|
10
|
+
environmentId: test-a
|
|
11
|
+
serviceId: aicoservice
|
|
12
|
+
skill:
|
|
13
|
+
name: redeploy-k8s-service
|
|
14
|
+
expectedSource: null # optional SkillSummary.source constraint
|
|
15
|
+
expectedProvider: null # optional SkillSummary.provider constraint
|
|
16
|
+
parameters:
|
|
17
|
+
namespace: ${deployment.location.namespace}
|
|
18
|
+
workload: ${deployment.location.workload.name}
|
|
19
|
+
cluster: ${deployment.location.clusterRef}
|
|
20
|
+
policy:
|
|
21
|
+
requiresApproval: true
|
|
22
|
+
allowProduction: false
|
|
23
|
+
enabled: true
|
|
24
|
+
createdAt: 2026-11-01T03:00:00.000Z
|
|
25
|
+
updatedAt: 2026-11-01T03:00:00.000Z
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Match levels
|
|
29
|
+
|
|
30
|
+
| Level | Selectors present |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `deployment` | `deploymentId` |
|
|
33
|
+
| `environment-service` | `environmentId` + `serviceId` |
|
|
34
|
+
| `service` | `serviceId` |
|
|
35
|
+
| `category-mode` | `serviceCategory` + `deploymentMode` |
|
|
36
|
+
| `global` | none (empty `match: {}`) |
|
|
37
|
+
|
|
38
|
+
Every declared selector must match. The highest eligible level wins. Two eligible bindings at the same level are a conflict, never a coin flip.
|
|
39
|
+
|
|
40
|
+
A `match` must be exactly one of these five shapes. For example `environmentId` alone, or `environmentId` + `deploymentMode`, is invalid (`RECORD_INVALID`).
|
|
41
|
+
|
|
42
|
+
## Standard operations
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
install, deploy, redeploy, replace, restart, upgrade, rollback, uninstall,
|
|
46
|
+
collect-logs, health-check, inspect, upload, download
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Custom operations are allowed but must be bound explicitly.
|
|
50
|
+
|
|
51
|
+
## Policy
|
|
52
|
+
|
|
53
|
+
- Write operations default to `requiresApproval: true`.
|
|
54
|
+
- `allowProduction` defaults to `false`.
|
|
55
|
+
- A binding is discovery information. It does not execute anything.
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
# Operation Record Template
|
|
2
|
-
|
|
3
|
-
P1 artifact. V1 defines the type and a null bridge; it does not persist records.
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
interface OperationRecord {
|
|
7
|
-
id: string;
|
|
8
|
-
sessionId: string;
|
|
9
|
-
environmentId: string;
|
|
10
|
-
serviceId?: string;
|
|
11
|
-
deploymentId?: string;
|
|
12
|
-
operation: string;
|
|
13
|
-
skillRef?: string;
|
|
14
|
-
startedAt: string;
|
|
15
|
-
finishedAt?: string;
|
|
16
|
-
outcome: 'success' | 'failure' | 'unknown';
|
|
17
|
-
evidenceRefs: string[];
|
|
18
|
-
summary: string;
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## JSON example
|
|
23
|
-
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"id": "op-20261101-0001",
|
|
27
|
-
"sessionId": "session-abc",
|
|
28
|
-
"environmentId": "test-a",
|
|
29
|
-
"serviceId": "aicoservice",
|
|
30
|
-
"deploymentId": "deploy-001",
|
|
31
|
-
"operation": "redeploy",
|
|
32
|
-
"skillRef": "redeploy-k8s-service",
|
|
33
|
-
"startedAt": "2026-11-01T03:00:00.000Z",
|
|
34
|
-
"finishedAt": "2026-11-01T03:04:12.000Z",
|
|
35
|
-
"outcome": "success",
|
|
36
|
-
"evidenceRefs": ["evidence:test-a/deploy-001/log-20261101"],
|
|
37
|
-
"summary": "Redeploy completed; pod rollout finished with 2/2 ready"
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Rules
|
|
42
|
-
|
|
43
|
-
- `evidenceRefs` are opaque and sanitized; never embed raw logs or secrets.
|
|
44
|
-
- `summary` is redacted and bounded (default 500 characters).
|
|
45
|
-
- The record carries scope ids so memory queries stay scoped.
|
|
46
|
-
- Records are append-only from the plugin's perspective.
|
|
47
|
-
- A record is not an audit replacement for the executing tool's own logging.
|
|
48
|
-
|
|
49
|
-
## Evidence reference format
|
|
50
|
-
|
|
51
|
-
```text
|
|
52
|
-
evidence:{environmentId}/{deploymentId}/{kind}-{timestamp}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
`kind` is a short token such as `log`, `config` or `check`. The content lives outside the record.
|
|
1
|
+
# Operation Record Template
|
|
2
|
+
|
|
3
|
+
P1 artifact. V1 defines the type and a null bridge; it does not persist records.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
interface OperationRecord {
|
|
7
|
+
id: string;
|
|
8
|
+
sessionId: string;
|
|
9
|
+
environmentId: string;
|
|
10
|
+
serviceId?: string;
|
|
11
|
+
deploymentId?: string;
|
|
12
|
+
operation: string;
|
|
13
|
+
skillRef?: string;
|
|
14
|
+
startedAt: string;
|
|
15
|
+
finishedAt?: string;
|
|
16
|
+
outcome: 'success' | 'failure' | 'unknown';
|
|
17
|
+
evidenceRefs: string[];
|
|
18
|
+
summary: string;
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## JSON example
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"id": "op-20261101-0001",
|
|
27
|
+
"sessionId": "session-abc",
|
|
28
|
+
"environmentId": "test-a",
|
|
29
|
+
"serviceId": "aicoservice",
|
|
30
|
+
"deploymentId": "deploy-001",
|
|
31
|
+
"operation": "redeploy",
|
|
32
|
+
"skillRef": "redeploy-k8s-service",
|
|
33
|
+
"startedAt": "2026-11-01T03:00:00.000Z",
|
|
34
|
+
"finishedAt": "2026-11-01T03:04:12.000Z",
|
|
35
|
+
"outcome": "success",
|
|
36
|
+
"evidenceRefs": ["evidence:test-a/deploy-001/log-20261101"],
|
|
37
|
+
"summary": "Redeploy completed; pod rollout finished with 2/2 ready"
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Rules
|
|
42
|
+
|
|
43
|
+
- `evidenceRefs` are opaque and sanitized; never embed raw logs or secrets.
|
|
44
|
+
- `summary` is redacted and bounded (default 500 characters).
|
|
45
|
+
- The record carries scope ids so memory queries stay scoped.
|
|
46
|
+
- Records are append-only from the plugin's perspective.
|
|
47
|
+
- A record is not an audit replacement for the executing tool's own logging.
|
|
48
|
+
|
|
49
|
+
## Evidence reference format
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
evidence:{environmentId}/{deploymentId}/{kind}-{timestamp}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`kind` is a short token such as `log`, `config` or `check`. The content lives outside the record.
|