@namewta/speculo 0.8.9 → 0.8.10
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/dist/src/structured.js +186 -0
- package/dist/src/structured.js.map +1 -1
- package/package.json +1 -1
- package/template/commands/archive-and-consolidate.md +9 -0
- package/template/commands/status.md +3 -3
- package/template/workflows/ops/A-archive-and-learn/A-archive-and-learn.md +64 -0
- package/template/workflows/ops/A-archive-and-learn/promotion-plan-template.md +41 -0
- package/template/workflows/ops/A-archive-and-learn/retrospective-template.md +53 -0
- package/template/workflows/ops/E-execute-and-stabilize/E-execute-and-stabilize.md +75 -0
- package/template/workflows/ops/E-execute-and-stabilize/attempt-summary-template.md +44 -0
- package/template/workflows/ops/E-execute-and-stabilize/diagnosis-template.md +24 -0
- package/template/workflows/ops/E-execute-and-stabilize/handoff-template.md +32 -0
- package/template/workflows/ops/E-execute-and-stabilize/rollback-template.md +26 -0
- package/template/workflows/ops/E-execute-and-stabilize/verification-state-template.json +30 -0
- package/template/workflows/ops/E-execute-and-stabilize/verification-template.md +55 -0
- package/template/workflows/ops/I-intake-and-assess/I-intake-and-assess.md +66 -0
- package/template/workflows/ops/I-intake-and-assess/change-status-template.json +26 -0
- package/template/workflows/ops/I-intake-and-assess/collector-catalog.md +28 -0
- package/template/workflows/ops/I-intake-and-assess/deployment-dossier-template.md +62 -0
- package/template/workflows/ops/I-intake-and-assess/global-change-status-template.json +26 -0
- package/template/workflows/ops/I-intake-and-assess/project-detection.md +38 -0
- package/template/workflows/ops/I-intake-and-assess/request-template.md +44 -0
- package/template/workflows/ops/I-intake-and-assess/system-report-template.md +34 -0
- package/template/workflows/ops/I-intake-and-assess/target-profile-template.json +24 -0
- package/template/workflows/ops/INDEX.md +30 -0
- package/template/workflows/ops/P-plan-and-approve/P-plan-and-approve.md +65 -0
- package/template/workflows/ops/P-plan-and-approve/plan-review-template.md +78 -0
- package/template/workflows/ops/README.md +120 -0
- package/template/workflows/ops/_state/archive/.gitkeep +1 -0
- package/template/workflows/ops/_state/changes/.gitkeep +1 -0
- package/template/workflows/ops/_state/status.json +6 -0
- package/template/workflows/ops/common/rules/artifact-contract.md +37 -0
- package/template/workflows/ops/common/rules/closure-and-learning.md +25 -0
- package/template/workflows/ops/common/rules/evidence-and-redaction.md +22 -0
- package/template/workflows/ops/common/rules/execution-loop.md +27 -0
- package/template/workflows/ops/common/rules/path-and-scope-contract.md +21 -0
- package/template/workflows/ops/common/rules/plan-and-approval.md +25 -0
- package/template/workflows/ops/common/rules/project-and-change-scope.md +20 -0
- package/template/workflows/ops/common/rules/target-profile-and-release-gates.md +44 -0
- package/template/workflows/ops/common/schemas/approval.schema.json +28 -0
- package/template/workflows/ops/common/schemas/attempt.schema.json +42 -0
- package/template/workflows/ops/common/schemas/change-status.schema.json +43 -0
- package/template/workflows/ops/common/schemas/deployment-model.schema.json +26 -0
- package/template/workflows/ops/common/schemas/implementation-plan.schema.json +221 -0
- package/template/workflows/ops/common/schemas/inventory-snapshot.schema.json +31 -0
- package/template/workflows/ops/common/schemas/journal-event.schema.json +22 -0
- package/template/workflows/ops/common/schemas/project.schema.json +19 -0
- package/template/workflows/ops/common/schemas/promotion-approval.schema.json +20 -0
- package/template/workflows/ops/common/schemas/promotion-manifest.schema.json +22 -0
- package/template/workflows/ops/common/schemas/status.schema.json +30 -0
- package/template/workflows/ops/common/schemas/target-profile.schema.json +32 -0
- package/template/workflows/ops/common/schemas/verification-state.schema.json +30 -0
- package/template/workflows/ops/common/tools/close-change.mjs +177 -0
- package/template/workflows/ops/common/tools/validate-ops.mjs +992 -0
- package/template/workflows/ops/runtime-contract.json +14 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Ops Attempt Summary
|
|
2
|
+
|
|
3
|
+
| Field | Value |
|
|
4
|
+
| --- | --- |
|
|
5
|
+
| Scope / project | {scope} / {project_id} |
|
|
6
|
+
| Change / attempt | {change} / {attempt_id} |
|
|
7
|
+
| Kind | deploy / remediation / rollback / verification-only |
|
|
8
|
+
| Triggered by | {triggered_by} |
|
|
9
|
+
| Plan / digest | {plan_path} / {plan_digest} |
|
|
10
|
+
| Approval | {approval_path} |
|
|
11
|
+
| Target profile / digest | {target_profile_path} / {target_profile_digest} |
|
|
12
|
+
| Verification state | {verification_state_path} |
|
|
13
|
+
| Handoff | {handoff_path} |
|
|
14
|
+
| Started / ended | {started_at} / pending |
|
|
15
|
+
| Result | running |
|
|
16
|
+
|
|
17
|
+
## Preflight
|
|
18
|
+
|
|
19
|
+
记录 profile/plan/approval 摘要、控制面 identity 重采集、protected targets、deployment root、数据保护和恢复资产;不得回显 secret。
|
|
20
|
+
|
|
21
|
+
## Gate Results
|
|
22
|
+
|
|
23
|
+
| Sequence | Gate | Status | Required verification | Evidence |
|
|
24
|
+
| --- | --- | --- | --- | --- |
|
|
25
|
+
|
|
26
|
+
## Batch and Operation Results
|
|
27
|
+
|
|
28
|
+
## Actual Mutations
|
|
29
|
+
|
|
30
|
+
所有事实事件逐行写入 append-only `journal.jsonl`,每行使用 journal-event v1;本摘要不替代 typed journal。
|
|
31
|
+
|
|
32
|
+
## Diagnostics Performed
|
|
33
|
+
|
|
34
|
+
## Failed and Not-run Operations
|
|
35
|
+
|
|
36
|
+
## Redactions
|
|
37
|
+
|
|
38
|
+
## Deviations and Residual Risk
|
|
39
|
+
|
|
40
|
+
## Data Protection and Recovery Assets
|
|
41
|
+
|
|
42
|
+
## Verification or Next Route
|
|
43
|
+
|
|
44
|
+
terminal attempt 引用 `verification-state.json`;成功、回滚或 completed abandoned 还必须引用无密钥 `HANDOFF.md`。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Attempt Diagnosis
|
|
2
|
+
|
|
3
|
+
## Failure Signature
|
|
4
|
+
|
|
5
|
+
提供稳定、脱敏、可检索的错误特征,不复制 secret 或无界原始日志。
|
|
6
|
+
|
|
7
|
+
## Target State and Evidence
|
|
8
|
+
|
|
9
|
+
## Hypotheses
|
|
10
|
+
|
|
11
|
+
| Hypothesis | Evidence for | Evidence against | Verdict |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
|
|
14
|
+
## Confirmed or Suspected Root Cause
|
|
15
|
+
|
|
16
|
+
明确 confidence 和仍缺失的证据。
|
|
17
|
+
|
|
18
|
+
## Actions Already Tried
|
|
19
|
+
|
|
20
|
+
## Proposed Remediation or Rollback
|
|
21
|
+
|
|
22
|
+
## Plan Delta Required
|
|
23
|
+
|
|
24
|
+
列出新增或改变的 mutation、command、write set、privilege、external target、验证和恢复;无变化时明确 `none`。
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Ops Deployment Handoff
|
|
2
|
+
|
|
3
|
+
| Field | Value |
|
|
4
|
+
| --- | --- |
|
|
5
|
+
| Scope / project | {scope} / {project_id} |
|
|
6
|
+
| Change / attempt | {change} / {attempt_id} |
|
|
7
|
+
| Mode / environment | {operation_mode} / {environment_class} |
|
|
8
|
+
| Plan / approval | {plan_path} / {approval_path} |
|
|
9
|
+
| Verification state | {verification_state_path} |
|
|
10
|
+
| Verdict | passed / failed / blocked |
|
|
11
|
+
|
|
12
|
+
## Target and Control-plane Identity
|
|
13
|
+
|
|
14
|
+
只列非敏感 identity assertion、匹配结果与 evidence locator。
|
|
15
|
+
|
|
16
|
+
## Source and Immutable Artifacts
|
|
17
|
+
|
|
18
|
+
## Gate Results
|
|
19
|
+
|
|
20
|
+
## Services and Runtime Convergence
|
|
21
|
+
|
|
22
|
+
## Semantic Probes and Stability Windows
|
|
23
|
+
|
|
24
|
+
## Data Protection
|
|
25
|
+
|
|
26
|
+
## Recovery and Previous Release
|
|
27
|
+
|
|
28
|
+
## Retained Candidates and Rollback Assets
|
|
29
|
+
|
|
30
|
+
## Remaining Risks and Operator Follow-up
|
|
31
|
+
|
|
32
|
+
不得包含密码、token、私钥、cookie、完整连接串或 secret 值。凭据仅记录 provider/受控 locator、版本和 presence 状态。
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Attempt Rollback
|
|
2
|
+
|
|
3
|
+
| Field | Value |
|
|
4
|
+
| --- | --- |
|
|
5
|
+
| Change / attempt | {change} / {attempt_id} |
|
|
6
|
+
| Failed attempt | {triggered_by} |
|
|
7
|
+
| Plan / approval | {plan_path} / {approval_path} |
|
|
8
|
+
| Restore checkpoint | {checkpoint} |
|
|
9
|
+
| Started / ended | {started_at} / pending |
|
|
10
|
+
|
|
11
|
+
## Trigger and Authorization
|
|
12
|
+
|
|
13
|
+
## Pre-rollback Target State
|
|
14
|
+
|
|
15
|
+
## Restore Operations
|
|
16
|
+
|
|
17
|
+
| Operation | Expected restore | Actual | Result | Evidence |
|
|
18
|
+
| --- | --- | --- | --- | --- |
|
|
19
|
+
|
|
20
|
+
## Data and Traffic Effects
|
|
21
|
+
|
|
22
|
+
## Post-rollback Target State
|
|
23
|
+
|
|
24
|
+
## Failed or Manual Recovery Items
|
|
25
|
+
|
|
26
|
+
## Residual Risks and Verification
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"artifact": "ops-verification-state",
|
|
4
|
+
"scope": "project",
|
|
5
|
+
"project_id": "{project_id}",
|
|
6
|
+
"change": "{change}",
|
|
7
|
+
"attempt_id": "{attempt_id}",
|
|
8
|
+
"captured_at": "{captured_at}",
|
|
9
|
+
"target_profile_path": "deployment/target-profile.json",
|
|
10
|
+
"target_profile_digest": "{target_profile_digest}",
|
|
11
|
+
"identity_results": [],
|
|
12
|
+
"gates": [],
|
|
13
|
+
"artifacts": [],
|
|
14
|
+
"services": [],
|
|
15
|
+
"probes": [],
|
|
16
|
+
"convergence": [],
|
|
17
|
+
"data_protection": [],
|
|
18
|
+
"recovery": {
|
|
19
|
+
"strategy": "not-applicable",
|
|
20
|
+
"previous_release_ref": null,
|
|
21
|
+
"rollback_operation_refs": [],
|
|
22
|
+
"material_refs": [],
|
|
23
|
+
"compatibility_verified": false,
|
|
24
|
+
"data_restore_authorized": null,
|
|
25
|
+
"evidence": []
|
|
26
|
+
},
|
|
27
|
+
"retained_artifacts": [],
|
|
28
|
+
"risks": [],
|
|
29
|
+
"verdict": "blocked"
|
|
30
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Attempt Verification
|
|
2
|
+
|
|
3
|
+
| Field | Value |
|
|
4
|
+
| --- | --- |
|
|
5
|
+
| Change / attempt | {change} / {attempt_id} |
|
|
6
|
+
| Target | {target} |
|
|
7
|
+
| Target profile / digest | {target_profile_path} / {target_profile_digest} |
|
|
8
|
+
| Verification state | {verification_state_path} |
|
|
9
|
+
| Started / ended | {started_at} / pending |
|
|
10
|
+
| Outcome | pending |
|
|
11
|
+
|
|
12
|
+
## Target Re-read
|
|
13
|
+
|
|
14
|
+
## Identity Assertion Results
|
|
15
|
+
|
|
16
|
+
| Assertion | Comparison | Expected | Actual | Matched | Evidence |
|
|
17
|
+
| --- | --- | --- | --- | --- | --- |
|
|
18
|
+
|
|
19
|
+
## Gate Results
|
|
20
|
+
|
|
21
|
+
| Sequence | Gate | Status | Evidence |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
|
|
24
|
+
## Verification Matrix
|
|
25
|
+
|
|
26
|
+
| Check | Required | Method/environment | Expected | Actual | Result | Evidence |
|
|
27
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
28
|
+
|
|
29
|
+
## Immutable Artifacts and Target-side Digests
|
|
30
|
+
|
|
31
|
+
## Health, Ports and Dependencies
|
|
32
|
+
|
|
33
|
+
## Smoke and Business Signals
|
|
34
|
+
|
|
35
|
+
每个 probe 使用自身允许的 HTTP 状态、业务码与认证要求;记录瞬时失败和连续成功数。
|
|
36
|
+
|
|
37
|
+
## Restart and Persistence
|
|
38
|
+
|
|
39
|
+
## Resource and Stability Window
|
|
40
|
+
|
|
41
|
+
## Multi-instance Convergence
|
|
42
|
+
|
|
43
|
+
## Data and Migration
|
|
44
|
+
|
|
45
|
+
记录每个 protection id 的 backup/waiver/not-required/failed、evidence digest、readability 和 restore 验证。production 不允许 waiver;local waiver 必须与 plan 的精确授权一致。
|
|
46
|
+
|
|
47
|
+
## Recovery, Previous Release and Retained Assets
|
|
48
|
+
|
|
49
|
+
## Logs, Monitoring and Alerts
|
|
50
|
+
|
|
51
|
+
## Deviations and Residual Risks
|
|
52
|
+
|
|
53
|
+
## Completion Decision
|
|
54
|
+
|
|
55
|
+
本文件是 `verification-state.json` v1 的无密钥 Markdown 投影。结构化 state 缺失、摘要不匹配、required Gate/verification 未通过或 HANDOFF 含 secret 时不得 completed。
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: ops/intake-and-assess
|
|
3
|
+
type: workflow-entry
|
|
4
|
+
workflow: ops
|
|
5
|
+
name: 摄入并评估运维目标
|
|
6
|
+
description: 初始化 Ops,识别全局或项目 scope,创建或恢复 change,并用系统盘点、项目分析和目标身份形成可规划部署档案。
|
|
7
|
+
keywords: [摄入, change, 项目识别, 系统盘点, 部署分析, target profile]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 摄入并评估运维目标
|
|
11
|
+
|
|
12
|
+
> 激活本 Work 后,先读取 `<Path>{roots.workflows}/ops/README.md</Path>`,再执行本入口。
|
|
13
|
+
|
|
14
|
+
I 是初始化、scope/project/change 选择、部署模型和 target profile 的唯一 owner。它回答“当前工作属于哪里、目标现在是什么、项目需要怎样部署、现场身份与授权边界是什么、是否已经可以规划”,不构建、安装、启动服务或修改目标。
|
|
15
|
+
|
|
16
|
+
## 流程
|
|
17
|
+
|
|
18
|
+
### 1. 初始化与确定 Scope
|
|
19
|
+
|
|
20
|
+
读取 `<Path>{roots.workflows}/ops/common/rules/project-and-change-scope.md</Path>`。缺少状态时以 schema v2 seed 原子创建 `status.json`,并创建不存在的全局 `changes/`、`archive/`、`context/`、`adr/`、`runbooks/` 和 `projects/`;已有内容只验证,不覆盖或猜测迁移。
|
|
21
|
+
|
|
22
|
+
系统基线、Docker/宿主机通用配置或跨项目文档使用 `scope=global`。指定项目的部署、修复、扩容、升级和回滚使用 `scope=project`。项目 scope 必须解析或创建 `<Path>{roots.state}/ops/projects/{project_id}/project.json</Path>`,对照 `<Path>{roots.workflows}/ops/common/schemas/project.schema.json</Path>` 验证稳定 id、显示名、aliases 和无凭据 identity。
|
|
23
|
+
|
|
24
|
+
### 2. 创建或恢复 Change
|
|
25
|
+
|
|
26
|
+
在 scope 根选择用户指定 change、唯一 active change 或新 change;多个候选一次性消歧。新 change 使用 `YYYY-MM-DD-<topic>[-NN]`:project scope 从 `<Path>{roots.workflows}/ops/I-intake-and-assess/change-status-template.json</Path>` 创建 `.status.json`,global scope 从 `<Path>{roots.workflows}/ops/I-intake-and-assess/global-change-status-template.json</Path>` 创建;随后用 `<Path>{roots.workflows}/ops/I-intake-and-assess/request-template.md</Path>` 初始化 request、LOG、CONTEXT 和 ADR。
|
|
27
|
+
|
|
28
|
+
先原子写 change,再将 `{scope, project_id, change}` 加入全局 active。归档历史只读;继续历史时创建 follow-up,并记录 `derived_from` 的完整 scope locator。项目 change 根必须是 `<Path>{roots.state}/ops/projects/{project_id}/changes/{change}/</Path>`,不得使用全局 flat change 目录。
|
|
29
|
+
|
|
30
|
+
### 3. 盘点目标系统
|
|
31
|
+
|
|
32
|
+
读取 `<Path>{roots.workflows}/ops/common/rules/path-and-scope-contract.md</Path>` 和 `<Path>{roots.workflows}/ops/common/rules/evidence-and-redaction.md</Path>`,按 `<Path>{roots.workflows}/ops/I-intake-and-assess/collector-catalog.md</Path>` 运行适用 L0/L1 collectors。L2 只针对用户一次批准的根列表。
|
|
33
|
+
|
|
34
|
+
把不可覆盖快照写入 change `inventory/snapshots/{snapshot-id}.json`,并从 `<Path>{roots.workflows}/ops/I-intake-and-assess/system-report-template.md</Path>` 更新 `inventory/system-report.md`。瞬时 Docker/进程/端口状态只留在 change;稳定系统事实在 A 阶段才可提升为全局 context。
|
|
35
|
+
|
|
36
|
+
### 4. 分析项目部署与目标身份
|
|
37
|
+
|
|
38
|
+
global inventory-only 请求跳过 deployment model,但仍为 verification-only 目标生成非 mutation target profile;global 配置变更则以 `project=null` 建立系统配置 deployment model。project scope 读取真实项目指令和 `<Path>{roots.workflows}/ops/I-intake-and-assess/project-detection.md</Path>`,穷尽实际 manifest、lockfile、容器、CI/CD、配置、服务、集群、数据、健康和恢复线索;结构化格式使用 parser。
|
|
39
|
+
|
|
40
|
+
读取 `<Path>{roots.workflows}/ops/common/rules/target-profile-and-release-gates.md</Path>`,从 `<Path>{roots.workflows}/ops/I-intake-and-assess/target-profile-template.json</Path>` 生成 `deployment/target-profile.json` v1,并按 `<Path>{roots.workflows}/ops/common/schemas/target-profile.schema.json</Path>` 验证。profile 选择 `audit | takeover | fresh | release | upgrade | rollback`,记录 environment class、唯一 deployment root、existing state、不可拆分 identity assertions、owned/protected/unknown targets、差异分类和 secret provider/locator 元数据。
|
|
41
|
+
|
|
42
|
+
只要存在持久目录、控制面资源、数据、路由或服务,就使用 takeover;现场为 present 或 unknown 时不得选择 fresh。fresh 只在目标为空、归属明确且 protected/unknown targets 为空时 Ready。mutation 模式必须有整体 identity confirmation;ownership-conflict、unknown difference、未确认身份或不明 deployment root 都使 profile blocked。
|
|
43
|
+
|
|
44
|
+
会联网、执行项目代码、写 cache 或下载依赖的动态 probe 只登记,不在 I 执行。写入 `deployment/deployment-model.json`、`deployment/target-profile.json` 和 `deployment/deployment-dossier.md`,分别对照 schema 与 `<Path>{roots.workflows}/ops/I-intake-and-assess/deployment-dossier-template.md</Path>`。配置和 secret requirement 只记录 key、scope、provider/受控 source ref、version/presence,不保存值。
|
|
45
|
+
|
|
46
|
+
### 5. 验证与路由
|
|
47
|
+
|
|
48
|
+
运行 validator 并重读工件。全局 inventory-only 在快照完整且 audit profile 有效时将 phase 设为 assessment,路由 `<Path>{roots.workflows}/ops/E-execute-and-stabilize/E-execute-and-stabilize.md</Path>` 的 verification-only 分支。项目部署或全局 mutation 只有 deployment model 与 target profile 都 Ready 才进入 `<Path>{roots.workflows}/ops/P-plan-and-approve/P-plan-and-approve.md</Path>`;blocking unknown 保持 blocked,并一次列出 owner 和所需决定。
|
|
49
|
+
|
|
50
|
+
## 完成标准
|
|
51
|
+
|
|
52
|
+
- scope/project/change tuple 唯一且与实际目录、全局索引一致;
|
|
53
|
+
- 项目身份不会因目录同名误合并,也不包含凭据;
|
|
54
|
+
- target profile v1 固定 operation mode、environment、deployment root、控制面身份、ownership 与差异分类;
|
|
55
|
+
- present/unknown 现场没有被误判为 fresh,mutation profile 已显式确认整体身份;
|
|
56
|
+
- 适用 collector 全部得到 observed/partial/unavailable/denied/failed 结论;
|
|
57
|
+
- 项目评估穷尽实际部署入口且未把推断伪装为观测;
|
|
58
|
+
- 未发生构建、安装、目标写入或外部 mutation;
|
|
59
|
+
- validator 通过并返回唯一下一路由。
|
|
60
|
+
|
|
61
|
+
## 子文件引用
|
|
62
|
+
|
|
63
|
+
- 状态与请求模板:`<Path>{roots.workflows}/ops/I-intake-and-assess/change-status-template.json</Path>`、`<Path>{roots.workflows}/ops/I-intake-and-assess/global-change-status-template.json</Path>`、`<Path>{roots.workflows}/ops/I-intake-and-assess/request-template.md</Path>`
|
|
64
|
+
- 盘点分支:`<Path>{roots.workflows}/ops/I-intake-and-assess/collector-catalog.md</Path>`、`<Path>{roots.workflows}/ops/I-intake-and-assess/system-report-template.md</Path>`
|
|
65
|
+
- 项目分支:`<Path>{roots.workflows}/ops/I-intake-and-assess/project-detection.md</Path>`、`<Path>{roots.workflows}/ops/I-intake-and-assess/deployment-dossier-template.md</Path>`
|
|
66
|
+
- Target profile:`<Path>{roots.workflows}/ops/I-intake-and-assess/target-profile-template.json</Path>`、`<Path>{roots.workflows}/ops/common/schemas/target-profile.schema.json</Path>`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 2,
|
|
3
|
+
"artifact": "ops-change-status",
|
|
4
|
+
"scope": "project",
|
|
5
|
+
"project_id": "{project_id}",
|
|
6
|
+
"change": "{change}",
|
|
7
|
+
"change_status": "active",
|
|
8
|
+
"phase": "intake",
|
|
9
|
+
"current_work": null,
|
|
10
|
+
"works_run": [],
|
|
11
|
+
"created_at": "{created_at}",
|
|
12
|
+
"updated_at": "{updated_at}",
|
|
13
|
+
"completed_at": null,
|
|
14
|
+
"archived_at": null,
|
|
15
|
+
"archive_path": null,
|
|
16
|
+
"source_revision": null,
|
|
17
|
+
"target_fingerprint": null,
|
|
18
|
+
"plan_path": null,
|
|
19
|
+
"plan_digest": null,
|
|
20
|
+
"approval_path": null,
|
|
21
|
+
"approval_status": "not_requested",
|
|
22
|
+
"approved_batches": [],
|
|
23
|
+
"latest_attempt_id": null,
|
|
24
|
+
"outcome": "pending",
|
|
25
|
+
"blockers": []
|
|
26
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# 系统盘点 Collector 目录
|
|
2
|
+
|
|
3
|
+
只选择当前目标适用且已存在的工具。以下命令族是发现候选,不是强制执行清单;运行前检查帮助、版本、权限和输出敏感性。
|
|
4
|
+
|
|
5
|
+
## L0
|
|
6
|
+
|
|
7
|
+
| Category | Unix/Linux candidates | macOS candidates | Required result |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| Host | `uname`, `/etc/os-release`, `hostname`, `uptime` | `uname`, `sw_vers`, `hostname`, `uptime` | OS、架构、稳定目标标识、时间 |
|
|
10
|
+
| Capacity | `nproc`, `free`, `df`, `df -i`, `mount`, `lsblk` | `sysctl`, `vm_stat`, `df`, `mount`, `diskutil` | CPU、内存、挂载点、容量和 inode |
|
|
11
|
+
| Runtimes | 查询已安装 Java/Go/Node/Python/Docker/包管理器版本 | 同左 | executable、版本、来源;不安装 |
|
|
12
|
+
|
|
13
|
+
## L1
|
|
14
|
+
|
|
15
|
+
| Category | Candidates | Required result |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| Services | `systemctl list-units/show`;macOS `launchctl` | 名称、状态、unit/plist、ExecStart、WorkingDirectory |
|
|
18
|
+
| Processes | `ps`、受限 `/proc/<pid>`、`lsof` 或 osquery | PID 仅作瞬时证据;关联 executable、cwd、user |
|
|
19
|
+
| Network | `ss`、`lsof -i`、`netstat` | listener、address、port、process;不扫描外部网络 |
|
|
20
|
+
| Docker | `docker info/ps/compose ls/system df` 和必要 inspect | context、daemon、container/image/volume/network、compose 与 bind path |
|
|
21
|
+
| Kubernetes | current-context 和 scoped `get` | context、namespace、workload、service、ingress;不切换 context |
|
|
22
|
+
| Project locations | 从 service cwd、compose labels、bind mounts 和明确 roots 反查 | 只报告证据支持的路径 |
|
|
23
|
+
|
|
24
|
+
Docker inspect、Compose config、进程环境和 Kubernetes Secret 可能泄露敏感值。默认不读取进程完整环境或 Secret data,保存前按 evidence-and-redaction 处理。
|
|
25
|
+
|
|
26
|
+
## L2
|
|
27
|
+
|
|
28
|
+
只对批准根执行受限深度的容量、权限、文件类型、最大文件或 inode 热点分析。记录根、排除项、超时和实际边界;不得跟随符号链接越界或读取文件正文来判断占用。
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Deployment Dossier
|
|
2
|
+
|
|
3
|
+
| Field | Value |
|
|
4
|
+
| --- | --- |
|
|
5
|
+
| Project / change | {project_id} / {change} |
|
|
6
|
+
| Source root | {source_root} |
|
|
7
|
+
| Source revision | {source_revision} |
|
|
8
|
+
| Target snapshot | {snapshot_path} |
|
|
9
|
+
| Target profile / digest | deployment/target-profile.json / {target_profile_digest} |
|
|
10
|
+
| Operation mode | audit / takeover / fresh / release / upgrade / rollback |
|
|
11
|
+
| Environment class | local / shared-nonprod / production |
|
|
12
|
+
| Existing state | absent / present / unknown |
|
|
13
|
+
| Identity confirmed | true / false |
|
|
14
|
+
| Deployment root | {deployment_root} |
|
|
15
|
+
| Existing project SOP | {runbook_paths} |
|
|
16
|
+
| Readiness | blocked / ready |
|
|
17
|
+
|
|
18
|
+
## Requested Outcome and Constraints
|
|
19
|
+
|
|
20
|
+
## Component and Runtime Map
|
|
21
|
+
|
|
22
|
+
## Build, Artifact, Start and Restart
|
|
23
|
+
|
|
24
|
+
## Middleware and External Dependencies
|
|
25
|
+
|
|
26
|
+
## Configuration Matrix
|
|
27
|
+
|
|
28
|
+
仅记录 key、scope、required、secret 和 source reference。
|
|
29
|
+
|
|
30
|
+
## Ports, Exposure and Health
|
|
31
|
+
|
|
32
|
+
## Data, Volumes, Migration and Backup
|
|
33
|
+
|
|
34
|
+
## Deployment Options and Tradeoffs
|
|
35
|
+
|
|
36
|
+
## Selected Method and Target Fit
|
|
37
|
+
|
|
38
|
+
## Target and Control-plane Identity
|
|
39
|
+
|
|
40
|
+
逐项列出 provider、key、comparison、非敏感 expected 与 evidence。Compose project、有序 files、env file、services、labels/image identity 和 bind host 不得折叠成单一目录名判断。
|
|
41
|
+
|
|
42
|
+
## Ownership and Difference Classification
|
|
43
|
+
|
|
44
|
+
列出 owned/protected/unknown targets;每项差异只能是 expected、safe-reconcile、requires-backup、ownership-conflict 或 unknown。
|
|
45
|
+
|
|
46
|
+
## Immutable Artifacts, Staging and Activation
|
|
47
|
+
|
|
48
|
+
## Required Gates and Stability Expectations
|
|
49
|
+
|
|
50
|
+
## Security and Required Privileges
|
|
51
|
+
|
|
52
|
+
## Secret Requirements
|
|
53
|
+
|
|
54
|
+
只记录 key、provider/受控 source reference、version 和 presence requirement,不保存值。
|
|
55
|
+
|
|
56
|
+
## Prior SOP, Known Failures and Applicable ADRs
|
|
57
|
+
|
|
58
|
+
## Unknowns and Dynamic Probes
|
|
59
|
+
|
|
60
|
+
## Planning Preconditions
|
|
61
|
+
|
|
62
|
+
## Evidence Sources
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 2,
|
|
3
|
+
"artifact": "ops-change-status",
|
|
4
|
+
"scope": "global",
|
|
5
|
+
"project_id": null,
|
|
6
|
+
"change": "{change}",
|
|
7
|
+
"change_status": "active",
|
|
8
|
+
"phase": "intake",
|
|
9
|
+
"current_work": null,
|
|
10
|
+
"works_run": [],
|
|
11
|
+
"created_at": "{created_at}",
|
|
12
|
+
"updated_at": "{updated_at}",
|
|
13
|
+
"completed_at": null,
|
|
14
|
+
"archived_at": null,
|
|
15
|
+
"archive_path": null,
|
|
16
|
+
"source_revision": null,
|
|
17
|
+
"target_fingerprint": null,
|
|
18
|
+
"plan_path": null,
|
|
19
|
+
"plan_digest": null,
|
|
20
|
+
"approval_path": null,
|
|
21
|
+
"approval_status": "not_requested",
|
|
22
|
+
"approved_batches": [],
|
|
23
|
+
"latest_attempt_id": null,
|
|
24
|
+
"outcome": "pending",
|
|
25
|
+
"blockers": []
|
|
26
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# 项目部署探测
|
|
2
|
+
|
|
3
|
+
按实际存在内容选择,不按语言预设结论。
|
|
4
|
+
|
|
5
|
+
## 身份与边界
|
|
6
|
+
|
|
7
|
+
- 读取项目 Agent 指令、仓库根、worktree/dirty 状态、子模块和多仓库关系;
|
|
8
|
+
- VCS remote 必须移除 userinfo、token 和 query 后才能作为 identity;
|
|
9
|
+
- monorepo 使用仓库 identity 加组件相对路径,不能把两个组件误作同一部署单元;
|
|
10
|
+
- 目录名只能作为 project id 候选,不能单独证明项目身份。
|
|
11
|
+
|
|
12
|
+
## 通用入口
|
|
13
|
+
|
|
14
|
+
- README、部署/运维文档、Makefile、Taskfile、脚本和 CI/CD;
|
|
15
|
+
- Dockerfile、Compose、`.dockerignore`、entrypoint 和 healthcheck;
|
|
16
|
+
- Kubernetes、Kustomize、Helm、Terraform、Ansible、systemd/launchd;
|
|
17
|
+
- 配置 schema、`.env.example`、示例 YAML/TOML/JSON、secret provider 引用;
|
|
18
|
+
- migration、seed、backup/restore、volume 和数据保留说明。
|
|
19
|
+
|
|
20
|
+
## Runtime 线索
|
|
21
|
+
|
|
22
|
+
| Ecosystem | Static sources | Questions to resolve |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| Java/JVM | `pom.xml`、Gradle、wrapper、toolchains、application config | JDK、artifact、profile、JVM flags、中间件、migration |
|
|
25
|
+
| Go | `go.mod`、workspace、build tags、main、embed | Go version、CGO、OS/arch、binary flags |
|
|
26
|
+
| Node | `package.json`、lockfile、workspace、runtime version | package manager、build/start、Node、process manager |
|
|
27
|
+
| Python | `pyproject.toml`、lockfiles、WSGI/ASGI | interpreter、environment、workers、native dependencies |
|
|
28
|
+
| Container | Dockerfile stages、Compose、healthcheck、mounts | args、runtime env、ports、volumes、networks、platform |
|
|
29
|
+
|
|
30
|
+
XML、JSON、YAML 和 TOML 使用可用结构化 parser。读取配置时只提取 key 和结构;示例值不自动视为生产值,真实值不复制到 change。
|
|
31
|
+
|
|
32
|
+
## 证据等级
|
|
33
|
+
|
|
34
|
+
- manifest 明确声明:declared;
|
|
35
|
+
- lockfile/runtime file 固定:declared with stronger pin;
|
|
36
|
+
- 文档无配置支持:unverified;
|
|
37
|
+
- 目标命令验证:observed;
|
|
38
|
+
- 模型推断:inferred,写依据与置信度。
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Ops Request
|
|
2
|
+
|
|
3
|
+
| Field | Value | Source |
|
|
4
|
+
| --- | --- | --- |
|
|
5
|
+
| Scope | global / project | user and discovery |
|
|
6
|
+
| Project id | none / `{project_id}` | project registry |
|
|
7
|
+
| Change | `{change}` | assigned |
|
|
8
|
+
| Topic | unresolved | user request |
|
|
9
|
+
| Requested outcome | unresolved | user |
|
|
10
|
+
| Source project | none / unresolved | user/project discovery |
|
|
11
|
+
| Target environment | unresolved | user |
|
|
12
|
+
| Target systems | unresolved | user/current context |
|
|
13
|
+
| Environment class | local / shared-nonprod / production / unresolved | user |
|
|
14
|
+
| Deployment root | unresolved | user/plan |
|
|
15
|
+
| Maintenance window | unresolved | user |
|
|
16
|
+
| Derived from | none | status/archive |
|
|
17
|
+
|
|
18
|
+
## In Scope
|
|
19
|
+
|
|
20
|
+
- unresolved
|
|
21
|
+
|
|
22
|
+
## Out of Scope
|
|
23
|
+
|
|
24
|
+
- unresolved
|
|
25
|
+
|
|
26
|
+
## User Constraints
|
|
27
|
+
|
|
28
|
+
- unresolved
|
|
29
|
+
|
|
30
|
+
## Success, Stop and Recovery
|
|
31
|
+
|
|
32
|
+
- Success: unresolved
|
|
33
|
+
- Failure/stop conditions: unresolved
|
|
34
|
+
- Recovery expectation: unresolved
|
|
35
|
+
|
|
36
|
+
## Known Inputs
|
|
37
|
+
|
|
38
|
+
- Source revision: unresolved
|
|
39
|
+
- Existing inventory snapshot: none
|
|
40
|
+
- Existing project SOP: none
|
|
41
|
+
|
|
42
|
+
## Open Decisions
|
|
43
|
+
|
|
44
|
+
- unresolved
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# System Survey
|
|
2
|
+
|
|
3
|
+
| Field | Value |
|
|
4
|
+
| --- | --- |
|
|
5
|
+
| Scope / project | {scope} / {project_id} |
|
|
6
|
+
| Change | {change} |
|
|
7
|
+
| Snapshot | {snapshot_path} |
|
|
8
|
+
| Captured at | {captured_at} |
|
|
9
|
+
| Target fingerprint | {target_fingerprint} |
|
|
10
|
+
| Levels | {levels} |
|
|
11
|
+
|
|
12
|
+
## Target and Host
|
|
13
|
+
|
|
14
|
+
## Capacity and Paths
|
|
15
|
+
|
|
16
|
+
## Runtimes and Development Tools
|
|
17
|
+
|
|
18
|
+
## Services, Processes and Working Directories
|
|
19
|
+
|
|
20
|
+
## Ports and Network Bindings
|
|
21
|
+
|
|
22
|
+
## Docker and Compose
|
|
23
|
+
|
|
24
|
+
## Kubernetes or Other Control Planes
|
|
25
|
+
|
|
26
|
+
## Project Locations
|
|
27
|
+
|
|
28
|
+
## Observation Gaps
|
|
29
|
+
|
|
30
|
+
## Redactions and Sensitivity
|
|
31
|
+
|
|
32
|
+
## Freshness
|
|
33
|
+
|
|
34
|
+
说明规划或执行前必须重采集的事实,以及本快照不能证明的内容。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"artifact": "ops-target-profile",
|
|
4
|
+
"scope": "project",
|
|
5
|
+
"project_id": "{project_id}",
|
|
6
|
+
"change": "{change}",
|
|
7
|
+
"created_at": "{created_at}",
|
|
8
|
+
"operation_mode": "takeover",
|
|
9
|
+
"environment_class": "shared-nonprod",
|
|
10
|
+
"deployment_root": "{absolute_deployment_root}",
|
|
11
|
+
"existing_state": "present",
|
|
12
|
+
"identity_confirmed": false,
|
|
13
|
+
"identity_confirmation_evidence": null,
|
|
14
|
+
"identity_assertions": [],
|
|
15
|
+
"ownership": {
|
|
16
|
+
"owned_targets": [],
|
|
17
|
+
"protected_targets": [],
|
|
18
|
+
"unknown_targets": []
|
|
19
|
+
},
|
|
20
|
+
"differences": [],
|
|
21
|
+
"secret_requirements": [],
|
|
22
|
+
"readiness": "blocked",
|
|
23
|
+
"blockers": ["target identity has not been confirmed"]
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: ops
|
|
3
|
+
type: workflow
|
|
4
|
+
workflow: ops
|
|
5
|
+
name: Ops Workflow
|
|
6
|
+
description: 以项目或全局 change 约束部署评估、批量批准、迭代执行、验证复盘和长期运维知识沉淀。
|
|
7
|
+
keywords: [ops, 运维, 部署, 项目归档, 实施计划, 复盘, SOP]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Ops Index
|
|
11
|
+
|
|
12
|
+
本索引用于发现 Ops,并让未激活状态机的会话按需读取已经验证的全局或项目运维知识。瞬时系统状态、失败现场和执行日志只存在于归档 change,不作为永久真相。
|
|
13
|
+
|
|
14
|
+
## 永久知识
|
|
15
|
+
|
|
16
|
+
只读取当前请求需要且实际存在的索引或知识文件;路径不存在时静默跳过。被动读取不得初始化 Ops、读取 active change、执行系统探测或修改状态:
|
|
17
|
+
|
|
18
|
+
- 全局上下文:`<Path>{roots.state}/ops/context/</Path>`
|
|
19
|
+
- 全局运维决策:`<Path>{roots.state}/ops/adr/</Path>`
|
|
20
|
+
- 全局 runbook:`<Path>{roots.state}/ops/runbooks/</Path>`
|
|
21
|
+
- 项目身份:`<Path>{roots.state}/ops/projects/{project_id}/project.json</Path>`
|
|
22
|
+
- 项目上下文:`<Path>{roots.state}/ops/projects/{project_id}/context/</Path>`
|
|
23
|
+
- 项目运维决策:`<Path>{roots.state}/ops/projects/{project_id}/adr/</Path>`
|
|
24
|
+
- 项目 SOP 与排障说明:`<Path>{roots.state}/ops/projects/{project_id}/runbooks/</Path>`
|
|
25
|
+
|
|
26
|
+
永久知识只保存仍然有效、具有 change 证据且标明最后验证时间的结论。PID、容器 ID、即时占用、一次性错误输出和当前进程状态必须回到对应归档 change 核对。
|
|
27
|
+
|
|
28
|
+
## Work 激活
|
|
29
|
+
|
|
30
|
+
用户明确激活 Ops 或其中某个 Work 后,读取 `<Path>{roots.workflows}/ops/README.md</Path>`,取得 scope/project/change 选择、状态、工件所有权、批准、迭代执行、复盘提升和归档合同。仅发现本索引或读取永久知识不加载该合同。
|