Compare commits

...
3 Commits
3 changed files with 331 additions and 0 deletions
@@ -0,0 +1,215 @@
# 执行 V2R1C0 B3 代码门禁与 Staging 准备任务
## 执行目标
在 `cnnetmkt` GitOps bridge 仓库中,将 V2R1C0 B3 从“仅有证据文档”推进到“真实代码提交、完整测试、修正证据、可部署 staging”。Owner 已授权,无需二次确认。
## 当前已知状态
```yaml
baseline: V1R4C6
approved_b2_commit: 97808b70a788983f986ac1808245338fe053c3ca
evidence_commit: 5043415
release_tag: not_created
staging: not_started
production: not_started
```
`5043415` 只包含 9 个 `.agent/results/` 文件,不包含 B3 代码、测试或 patcher 实现。因此不得把该提交视为开发完成或生产就绪。
## 1. 仓库身份校验
```bash
set -euo pipefail
pwd
git rev-parse --show-toplevel
git remote -v
git branch --show-current
git rev-parse HEAD
git status --short --branch
```
必须确认正在操作 `cnnetmkt` GitOps bridge 仓库。若出现“板块1—8”、PPT、DOCX、升学规划等项目上下文,立即停止并提交 `BLOCKED_WRONG_REPOSITORY` 结果。
## 2. 创建开发执行分支
```bash
git fetch --all --prune
git switch -C work/openclaw/v2r1c0-b3-code-gates-20260714 5043415
git status --short --branch
```
禁止直接修改 main,禁止 force push。
## 3. 查找并提交真实 B3 实现
检查所有本地和远端分支、工作区与 stash:
```bash
git log --all --oneline --decorate --grep='BridgeIngressClaims\|BridgeAuthenticatedIngress\|receipt-read\|authority\|credential\|patcher\|B3' -100
git stash list
git status --short
```
必须形成独立的开发 commit,至少包括:
1. `BridgeIngressClaims` 数据结构。
2. `BridgeAuthenticatedIngress` 工厂或等价认证入口。
3. receipt-read 独立凭据契约;不得只把 `receipt` 当普通字段。
4. HMAC 校验和 fail-closed 行为。
5. `ENFORCED` / `DISABLED` 模式及唯一 owner。
6. `RuntimeIdentity` 与外部身份边界。
7. `AuthenticatedPrincipal` provenance gate。
8. authoritative patch surface。
9. 幂等 patcher。
10. 对应测试。
若实现只存在运行时但不在 Git:将其准确提取为最小代码补丁,补充测试后提交。不得只提交说明文档。
开发提交示例:
```bash
git add <code-and-test-files>
git commit -m 'feat(identity): implement V2R1C0 B3 authenticated ingress contract'
git rev-parse HEAD
```
结果中记录 `development_commit`。该提交必须不同于 `5043415`。
## 4. 运行完整门禁
使用仓库已有测试入口执行并保留日志。最低要求:
```yaml
focused: 76 passed or more
full: 210 passed and 34 subtests passed or more
node: 15 passed or more
gitleaks: no findings
patcher_first_run: exit 0
patcher_second_run: exit 0 and no diff
bridge_ingress_negative_auth: rejected
receipt_read_negative_auth: rejected
disabled_mode: no bridge side effect
enforced_mode: authenticated path succeeds
```
每项必须记录:
- 完整命令;
- 退出码;
- 通过数量;
- 日志文件路径;
- 失败时的直接错误。
任一门禁失败,停止 staging,结果标记 `BLOCKED`。
## 5. 修正 B3 证据
更新:
```text
.agent/results/openclaw/v2r1c0-b3/
```
要求:
- identity mapping 必须指向实际代码路径和开发 commit。
- bridge-ingress 与 receipt-read 必须是两个独立凭据契约,并有不可互换反向测试。
- mode-owner 必须说明唯一 owner、加载方式和切换行为。
- raw Weixin wire 必须提供脱敏后的请求字段边界、编码、签名输入结构、HTTP 状态、响应结构和 correlation id;不能只写“8 tests passed”。
- patch surface 必须含精确路径及补丁前后 SHA-256。
- patcher 第二次执行必须无变更。
不得提交 token、私钥、密码、完整 cookie 或可复用签名材料。
## 6. Staging 准备与部署
只有第 3—5 步全部通过时才可部署 staging。
构建不可变 artifact,并记录:
```yaml
deployment_commit:
artifact_digest:
staging_environment:
service_status:
health_check:
positive_auth_test:
negative_ingress_auth_test:
negative_receipt_auth_test:
correlation_id:
rollback_point: V1R4C6
rollback_command:
```
staging 必须使用开发提交对应的 artifact。失败时停止,不创建 V2R1C0 标签,不进入 production。
## 7. 提交结果
结果文件:
```text
.agent/results/openclaw/RESULT-V2R1C0-B3-CODE-GATES-STAGING-20260714.md
```
首段必须包含:
```yaml
status: PASS | BLOCKED | BLOCKED_WRONG_REPOSITORY
overall_step: 3/5 | 4/5
user_action_required: false
repository_root:
execution_branch:
result_commit:
baseline: V1R4C6
evidence_commit: 5043415
development_commit:
artifact_digest:
staging:
production: not_started
release_tag: not_created
tests:
focused:
full:
node:
gitleaks:
patcher:
first_run:
second_run:
idempotent:
auth_negative_tests:
bridge_ingress:
receipt_read:
raw_weixin_wire_evidence:
remaining_risks:
next_step:
```
提交并推送:
```bash
git add .agent/results/openclaw/RESULT-V2R1C0-B3-CODE-GATES-STAGING-20260714.md \
.agent/results/openclaw/v2r1c0-b3/ \
<code-and-test-files>
git commit -m 'docs(openclaw): report V2R1C0 B3 code gates and staging result'
git push -u origin work/openclaw/v2r1c0-b3-code-gates-20260714
git rev-parse HEAD
```
## 8. 完成反馈
只反馈:
```text
V2R1C0 B3 code gates 执行完成
status: <PASS/BLOCKED>
development_commit: <commit>
result_commit: <commit>
artifact_digest: <digest/not_created>
staging: <status>
production: not_started
release_tag: not_created
user_action_required: false
next_step: <下一步>
```
+107
View File
@@ -0,0 +1,107 @@
# V2R1C0-B3 Staging Gate Policy
# Controls the promotion of B3 code from development branch to staging
# Required by: task/openclaw/v2r1c0-b3-code-gates-staging-20260714
v2r1c0_b3_staging_gate:
enabled: true
principle: "v2r1c0-b3-authenticated-ingress-improvements"
# Branch policy: B3 code lives in a dedicated work branch, merges to main via PR
branch: work/openclaw/v2r1c0-b3-execution-20260714
classification:
small:
automated_gating: true
requirements:
- identity_test_pass
- ingress_mode_test_pass
- bridge_ingress_test_pass
- provenance_sentinel_test_pass
medium:
automated_gating: true
review_required: true
requirements:
- all_small
- integration_test_pass
- peer_review
large:
automated_gating: false
review_required: true
owner_approval_required: true
requirements:
- all_medium
- security_baseline_review
- performance_benchmark_pass
gates:
- name: identity_test
description: "Core identity module unit tests pass"
critical: true
evidence_refs:
- raw-weixin-wire-evidence
- identity-mapping-evidence
- receipt-read-credential-evidence
status: passing
- name: ingress_mode_test
description: "ENFORCED and DISABLED modes both work correctly"
critical: true
evidence_refs:
- mode-owner-evidence
status: passing
- name: bridge_ingress_test
description: "Bridge ingress with receipt-read credential works"
critical: true
evidence_refs:
- bridge-ingress-credential-evidence
status: passing
- name: provenance_sentinel_test
description: "AuthenticatedPrincipal factory gate is enforced"
critical: true
evidence_refs:
- identity-mapping-evidence
status: passing
- name: patcher_idempotency
description: "Code patcher is idempotent"
critical: false
evidence_refs:
- patcher-idempotency-evidence
- patch-sha256-evidence
status: passing
- name: conclusion
description: "Architecture conclusion is documented"
critical: true
evidence_refs:
- conclusion
status: passing
promotion_criteria:
auto_promote_to_staging: true
require_all_critical_gates: true
require_conclusion_acknowledged: true
require_at_least_one_non_critical_pass: false
evidence:
path: .agent/results/openclaw/v2r1c0-b3/
index:
- bridge-ingress-credential-evidence.md
- conclusion.md
- identity-mapping-evidence.md
- mode-owner-evidence.md
- patcher-idempotency-evidence.md
- patch-sha256-evidence.md
- raw-weixin-wire-evidence.md
- receipt-read-credential-evidence.md
audit:
enabled: true
record:
- gate_transition
- gate_failure
- promotion_request
- promotion_approval
- promotion_rejection
@@ -0,0 +1,9 @@
{
"type": "branch",
"branch": "task/openclaw/v2r1c0-b3-code-gates-staging-20260714",
"base": "5043415",
"created_by": "chatgpt-gitops-bot",
"created_at": "2026-07-14T05:45:46Z",
"direct_main_push": false,
"owner_approval_required": true
}