From 3124414922cd4635865f700ac2bd42a9caa6ff79 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 17 Oct 2026 07:18:15 +0000 Subject: [PATCH 01/11] Bootstrap AGENT-EXECUTION.md and the governance adoption card Why: development-governance-v2 Phase 6 adopts the shared governance kit in every formal repository; the executor needs a valid AGENT-EXECUTION.md before any implementation unit can run. Evidence: generated by dm-server governance init at Development-Manager bd3a7de57a3a9e1a4495b94c5fa5c08d71e7be8c; dm-server agent-exec validate passes. Impact: configuration and task card only; no code or CI change yet. Refs: Agent-System-Dev docs/superpowers/plans/2026-10-16-development-governance-v2-master.md --- .task/feature-governance-adoption.md | 43 ++++++++++++++++++ AGENT-EXECUTION.md | 67 ++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 .task/feature-governance-adoption.md create mode 100644 AGENT-EXECUTION.md diff --git a/.task/feature-governance-adoption.md b/.task/feature-governance-adoption.md new file mode 100644 index 0000000..d81d32a --- /dev/null +++ b/.task/feature-governance-adoption.md @@ -0,0 +1,43 @@ +# Logging-System 采纳 development-governance-v2 治理套件 任务卡 + +任务主记录:本文件随 PR 描述维护(PR 链接见下方"结果与验证")。 +状态:进行中;owner:weichen。 + +## 基线与授权 + +- 权威仓:weichen/Logging-System;root_target:main;immediate_target:main +- branch_kind:initiative;initiative_id:governance-adoption-Logging-System +- R0(initial_main_sha):da5c33eb25a88b5ad5c88999d1a119f6f5b3af24;工作区:/home/weichen/projects/Logging-System-wt-feature-governance-adoption(worktree);分支:feature/governance-adoption +- 父任务信息(仅子任务填写):无 +- accepting_requirements:false(单仓采纳 initiative,范围固定为下列十步,不接收新需求) +- 需求分流:verdict=NEW;selected_initiative=无;候选=无;理由=development-governance-v2 Phase 6 每个正式仓库独立 initiative;triage 收据=无(本仓采纳前尚无 triage 入口) +- 授权与交付终点:owner 已授权 development-governance-v2 全部实施(Agent-System-Dev 主记录 docs/superpowers/plans/2026-10-16-development-governance-v2-master.md);终点为本 PR 合入 main 且采纳状态 active。分支保护与 tag 由用户执行。 +- 实施执行:agent-per-unit(配置:AGENT-EXECUTION.md;外部 Agent 一单元一新进程/会话/工作区) + +## 目标与非目标 + +目标(Phase 6 十步):固定 Guidelines SHA(deps/development-guidelines @ 2688fd2be6a52c0bf110e7e6366b6f291ab5e4eb);增加 AGENT-EXECUTION.md;增加共享执行器薄入口(deps/development-manager @ bd3a7de57a3a9e1a4495b94c5fa5c08d71e7be8c + scripts/dm、scripts/agent-exec、scripts/task);四条路由(implementation/repair/test/review);任务卡模板与分支元数据;CI 中启用 schema 校验(.gitea/workflows/governance.yml:agent-exec validate + governance check);一次正例运行;负例(缺配置、坏收据、越界路径、未知副作用);独立 Review + CI;采纳状态 active。 + +非目标:不改业务代码与既有测试;不改分支保护(由用户执行);不发布 tag。 + +引导说明:AGENT-EXECUTION.md 由 host 以固定版本治理套件(dm-server governance init @ bd3a7de57a3a9e1a4495b94c5fa5c08d71e7be8c)生成并作为引导配置提交(执行器运行前必须存在有效配置;沿用 DM 采纳先例);其余文件由实施单元生成。 + +## Agent 实施收据 + +| 单元 ID | 预期范围 | 角色 | 候选顺序 | attempt | CLI/模型 | 终态 | transport | fallback | 源码外收据路径 | +|---|---|---|---|---|---|---|---|---|---| + +## 同步记录 + +| 节点 | sync_base_sha | tested_head_sha | checked_at | 结果 | +|---|---|---|---|---| +| 启动 | da5c33eb25a88b5ad5c88999d1a119f6f5b3af24 | da5c33eb25a88b5ad5c88999d1a119f6f5b3af24 | 2026-10-17T07:18:15Z | 一致 | + +## 结果与验证(完成后填写) + +- 结果:NOT_RUN +- 验证:见下表(命令输出由 /tmp/gov-neg/ev.sh 写入 .task/evidence/governance-adoption/,SELF 除非另注)。 +- 影响与剩余项:NOT_RUN + +| 时间(UTC) | 命令 | 被测 HEAD | exit | 来源 | 摘要/位置 | +|---|---|---|---|---|---| diff --git a/AGENT-EXECUTION.md b/AGENT-EXECUTION.md new file mode 100644 index 0000000..0ae9b4c --- /dev/null +++ b/AGENT-EXECUTION.md @@ -0,0 +1,67 @@ +# Project Agent Execution Configuration +# 项目工程 Agent 执行路由配置 + +适用范围:定义本项目中由 AI / Agent 主导的代码实施、修复、测试与审阅所调用的 Agent CLI 路由。 +解析器识别正文中唯一一个 ```agent-execution 代码块。正文外的说明文字可根据项目需要调整。 + +通用硬规则见 Development-Guidelines 的 [Agent 执行与协作契约](deps/development-guidelines/standards/agent-execution.md)。 +本配置为项目本地路由权威,声明具体的候选 profile、尝试次数上限、超时、集成入口与豁免路径; +代码块须通过 `deps/development-guidelines/templates/schemas/agent-execution.schema.json` 校验后才能登记为 active。 +`fallback_to_host` 只能为 `never`;旧值 `all-unavailable` 仅供迁移工具读取,不能通过准入。 +下例的 CLI 名称、命令与路径均为占位,按项目实际执行器替换。 + +```agent-execution +schema: agent-execution/v1 + +execution: + fresh_process_per_unit: true + permission: run-everything + fallback_to_host: never + max_parallel: 3 + timeout_seconds: 7200 + idle_timeout_seconds: 600 + summary_bytes: 16384 + raw_output_bytes: 10485760 + max_attempts_per_profile: 3 + emergency_profile: codex + +roles: + implementation: [cursor, antigravity, pi] + repair: [cursor, antigravity, pi] + test: [pi, antigravity, cursor] + review: [pi, antigravity, cursor, codex] + +profiles: + cursor: + adapter: cursor + executable: "cursor-agent-stable" + model: auto + enabled: true + + antigravity: + adapter: antigravity + executable: agy + model: auto + enabled: true + + pi: + adapter: pi + executable: pi + model: auto + enabled: true + + codex: + adapter: codex + executable: codex + model: auto + enabled: true + +integration: + exempt_paths: [".task/**", "docs/superpowers/specs/**", "docs/superpowers/plans/**"] + transport: + command: "scripts/agent-exec apply" + admission: + command: "scripts/agent-exec admit" + cleanup: + command: "scripts/agent-exec cleanup" +``` -- 2.54.0 From 3b355600aacfb7924b94ea9315c4e0c37ac2a8eb Mon Sep 17 00:00:00 2001 From: agent-exec-transport Date: Sat, 17 Oct 2026 07:21:09 +0000 Subject: [PATCH 02/11] agent-exec transport b513506a93e5d62111d5f0bb08647b29/e507140fa996 --- .gitea/workflows/governance.yml | 150 ++++++++++++++++++++++++++++++++ .gitmodules | 3 + .task/templates/task-card.md | 66 ++++++++++++++ AGENTS.md | 18 ++++ PROJECT.md | 2 + deps/development-guidelines | 2 +- deps/development-manager | 1 + policy/guidelines-adoption.md | 31 ++++--- scripts/agent-exec | 4 + scripts/dm | 55 ++++++++++++ scripts/hooks/pre-commit | 16 ++++ scripts/task | 4 + 12 files changed, 337 insertions(+), 15 deletions(-) create mode 100644 .gitea/workflows/governance.yml create mode 100644 .task/templates/task-card.md create mode 160000 deps/development-manager create mode 100755 scripts/agent-exec create mode 100755 scripts/dm create mode 100755 scripts/hooks/pre-commit create mode 100755 scripts/task diff --git a/.gitea/workflows/governance.yml b/.gitea/workflows/governance.yml new file mode 100644 index 0000000..b227db3 --- /dev/null +++ b/.gitea/workflows/governance.yml @@ -0,0 +1,150 @@ +name: governance +on: + pull_request: + push: + branches: [main] + +jobs: + governance: + runs-on: ubuntu-latest + env: + GOPROXY: https://goproxy.cn,direct + steps: + - name: Checkout + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + SUBMODULE_TOKEN: ${{ secrets.SUBMODULE_TOKEN }} + run: | + set -euo pipefail + # 只物化两个治理 gitlink(Guidelines 与 deps/development-manager),非递归; + # 其它 gitlink 不物化、不取回。凭据只以 URL 限定的 extraheader 存在于本进程树内。 + python3 - <<'PY_CHECKOUT' + import os + from pathlib import Path + import re + import subprocess + import sys + from urllib.parse import urlsplit + + # 服务端基址取运行器注入的 GITHUB_SERVER_URL(平台控制、候选 PR 不可影响)。 + SERVER = os.environ.get("GITHUB_SERVER_URL", "").rstrip("/") + parsed_server = urlsplit(SERVER) + if parsed_server.scheme not in {"http", "https"} or not parsed_server.netloc: + sys.exit("Checkout server must be the platform-injected http(s) URL") + SSH = "ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/" + # 审查过的白名单,独立于候选 .gitmodules:仅列出两个治理 gitlink。 + REPOSITORIES = { + "deps/development-guidelines": "Development-Guidelines", + "deps/development-manager": "Development-Manager", + } + TARGET = "weichen/Logging-System" + root_token = os.environ.pop("TOKEN", "") + component_token = os.environ.pop("SUBMODULE_TOKEN", "") + if not root_token or not component_token: + sys.exit("Checkout requires TOKEN and SUBMODULE_TOKEN") + if os.environ.get("GITHUB_REPOSITORY") != TARGET: + sys.exit("Checkout repository is outside the reviewed allowlist") + sha = os.environ.get("GITHUB_SHA", "") + if not re.fullmatch(r"[0-9a-fA-F]{40}", sha): + sys.exit("Checkout requires a fixed commit SHA") + + # 丢弃继承的 Git 追踪/配置/SSH 钩子;凭据只存在于单个 Git 进程树的精确 URL 头中。 + clean_env = {k: v for k, v in os.environ.items() if not k.startswith("GIT_")} + clean_env.update(GIT_CONFIG_NOSYSTEM="1", GIT_CONFIG_SYSTEM="/dev/null", + GIT_CONFIG_GLOBAL="/dev/null", GIT_TERMINAL_PROMPT="0") + config = { + "core.hooksPath": "/dev/null", "core.fsmonitor": "false", + "init.templateDir": "", "credential.helper": "", + "fetch.recurseSubmodules": "false", "submodule.recurse": "false", + "http.followRedirects": "false", "protocol.allow": "never", + "protocol." + urlsplit(SERVER).scheme + ".allow": "always", + } + + + def git(repo, *args, extra=None): + values = config | (extra or {}) + env = clean_env | {"GIT_CONFIG_COUNT": str(len(values))} + for index, (key, value) in enumerate(values.items()): + env[f"GIT_CONFIG_KEY_{index}"] = key + env[f"GIT_CONFIG_VALUE_{index}"] = value + return subprocess.run(["git", "-C", str(repo), *args], env=env, + check=True, stdout=subprocess.PIPE).stdout + + + def materialize_governance(root): + # -r 列出任意深度的 gitlink,但不进入 submodule 内部;其它 gitlink 只记录、从不取回。 + links = {} + for entry in git(root, "ls-tree", "-rz", "HEAD").split(b"\0"): + if not entry: + continue + metadata, path = entry.split(b"\t", 1) + mode, kind, commit = metadata.decode().split() + if mode == "160000": + links[path.decode()] = commit + for name in REPOSITORIES: + if name not in links: + raise ValueError("Governance gitlink is missing from the fixed commit") + raw = git(root, "config", "--no-includes", "--blob", "HEAD:.gitmodules", "--null", "--list") + entries = {} + for item in raw.split(b"\0"): + if not item: + continue + key, value = item.decode().split("\n", 1) + match = re.fullmatch(r"submodule\.(.+)\.(path|url)", key) + if not match: + continue + name, field = match.groups() + if name not in REPOSITORIES: + continue + if field in entries.setdefault(name, {}): + raise ValueError("Duplicate candidate .gitmodules setting") + entries[name][field] = value + # 先整体校验两个治理条目,再进行任何带凭据的取回。 + for name, repository in REPOSITORIES.items(): + fields = entries.get(name, {}) + if fields.get("path") != name: + raise ValueError("Governance submodule path is outside the reviewed allowlist") + trusted_url = f"{SERVER}/weichen/{repository}.git" + if fields.get("url") not in {SSH + repository + ".git", trusted_url}: + raise ValueError("Governance submodule URL is outside the reviewed allowlist") + for name, repository in REPOSITORIES.items(): + url = f"{SERVER}/weichen/{repository}.git" + # 仅持久化审查过的公开 URL,使 Git 在进程级配置消失后仍识别该 submodule。 + git(root, "config", f"submodule.{name}.url", url) + git(root, "submodule", "update", "--init", "--checkout", "--", name, + extra={f"submodule.{name}.url": url, + f"submodule.{name}.update": "checkout", + f"http.{url}.extraheader": "AUTHORIZATION: token " + component_token}) + child = root / name + if git(child, "rev-parse", "HEAD").decode().strip() != links[name]: + raise ValueError("Materialized governance gitlink does not match the fixed SHA") + + + try: + root = Path.cwd() + # 必须是干净的临时工作区;不复用既有 Git 状态。 + if (root / ".git").exists(): + raise ValueError("Checkout requires a fresh workspace") + git(root, "init", "-q") + url = f"{SERVER}/{TARGET}.git" + git(root, "remote", "add", "origin", url) + git(root, "fetch", "--depth=1", "origin", sha, + extra={f"http.{url}.extraheader": "AUTHORIZATION: token " + root_token}) + git(root, "checkout", "-q", "--detach", "FETCH_HEAD") + materialize_governance(root) + except (ValueError, OSError, subprocess.CalledProcessError) as error: + sys.exit(f"Checkout refused: {error}") + print("Checkout complete; credentials were not persisted in Git configuration") + PY_CHECKOUT + unset TOKEN SUBMODULE_TOKEN + - name: Install Go 1.27.1 + run: | + set -euo pipefail + curl -fsSL -o "$RUNNER_TEMP/go.tgz" https://mirrors.aliyun.com/golang/go1.27.1.linux-amd64.tar.gz + tar -C /usr/local -xzf "$RUNNER_TEMP/go.tgz" + ln -sfn /usr/local/go/bin/go /usr/local/bin/go + ln -sfn /usr/local/go/bin/gofmt /usr/local/bin/gofmt + - name: Validate agent execution configuration + run: scripts/agent-exec validate --repo . + - name: Governance check + run: scripts/dm governance check --repo . diff --git a/.gitmodules b/.gitmodules index ef67b32..49e221b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "deps/development-guidelines"] path = deps/development-guidelines url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Development-Guidelines.git +[submodule "deps/development-manager"] + path = deps/development-manager + url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Development-Manager.git diff --git a/.task/templates/task-card.md b/.task/templates/task-card.md new file mode 100644 index 0000000..e3a0237 --- /dev/null +++ b/.task/templates/task-card.md @@ -0,0 +1,66 @@ +# <任务标题> 任务卡 + +任务主记录:。 +状态:<进行中 / 待审核 / 已合入 / 已放弃>;owner:<填写>。 + +## 基线与授权 + +- 权威仓:<仓 URL 或逻辑 ID>;root_target:main;immediate_target:
+- branch_kind:;initiative_id:<稳定 ID,普通任务为空> +- R0(initial_main_sha):<完整 SHA>;工作区:<路径>(worktree / clone);分支: +- 父任务信息(仅子任务填写):parent_branch=<父分支>;parent_head_sha=;parent_pr=<父 PR> +- accepting_requirements:(仅 initiative 可为 true;冻结后为 false) +- 需求分流:verdict=;selected_initiative=<分支或无>;候选=<分支@HEAD 列表或无>;理由=<不适配/适配依据>;triage 收据=<源码外路径与摘要> +- 授权与交付终点:<本次允许的动作与终点;未授权事项写明> +- 实施执行:agent-per-unit(配置:AGENT-EXECUTION.md;外部 Agent 一单元一新进程/会话/工作区) + +## 目标与非目标 + +<预期结果、受影响入口/模块/契约;明确不做什么。> + +## Agent 实施收据 + +按根目录 AGENT-EXECUTION.md 路由;外部 Agent 一单元一新进程/会话/隔离工作区。实施、修复与测试必须通过登记的候选执行;未配置或候选安全耗尽停在 unavailable/blocked,禁止 host 隐式代写。 + +| 单元 ID | 预期范围 | 角色 | 候选顺序 | attempt | CLI/模型 | 终态 | transport | fallback | 源码外收据路径 | +|---|---|---|---|---|---|---|---|---|---| +| 待定义 | — | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | — | + +## 复用材料(task-start 自动检索结果摘录) + +- 相关近期提交: 命中;无则写无>。 +- 相关经验条目:<检索命中;无则写无>。 + +## 同步记录 + +| 节点 | sync_base_sha | tested_head_sha | checked_at | 结果 | +|---|---|---|---|---| +| 启动 | | | <日期时间> | <一致/已同步> | +| 验收前 | <填写> | <填写> | <填写> | <填写> | + +字段没有发生的写"无",不省略。本卡与 PR 描述同源:开 PR 时将"目标与非目标、结果与验证、影响与剩余项"复制进 PR 描述,不另写第二份。 + +## 交付调度(有多个就绪任务时) + +- 调度记录 / entry_id / 当前 attempt_id:<平台或调度服务链接及标识;未入队写无>。 +- 入队源 HEAD / owner / 依赖:<完整 SHA、身份、依赖或无>。 +- 固定候选引用:<调度尝试中的 base/head、组件与配置;未固定写无>。 +- 窗口、最终 CI、Review 与真实合入结果:<引用调度记录及原始证据,不复制全队列>。 + +定义见 [合入调度与 CI 分配](../standards/merge-queue.md)。本段在候选固定前整理;固定后先使用源码之外的记录保存运行结果,再按项目闭合流程回填。 + +## 结果与验证(完成后填写) + +- 结果:<交付了什么;未发生写无>。 +- 验证:<结论性摘要:PASS/FAIL/SKIP/NOT_RUN 逐项;逐条证据见下表,来源标注与写入规则见 [按影响选择验证与证据](../standards/verification.md)>。 +- 影响与剩余项:<影响面、遗留风险、后续任务>。 + +| 时间(UTC) | 命令 | 被测 HEAD | exit | 来源 | 摘要/位置 | +|---|---|---|---|---|---| +| <时间> | <命令;由项目 evidence 工具写入,无工具时附命令+对象 SHA+输出 digest 并标 SELF> | | | GATE/REPLAY/SELF | <摘要/位置> | + +## 回收(task-finish) + +- 合入核对:<分支已包含于目标分支的核对输出>。 +- 未跟踪/ignored 文件处置:<归档/可再生/存疑 逐项;无则写无>。 +- 回收动作:。 diff --git a/AGENTS.md b/AGENTS.md index 18cfa63..80275b2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -34,3 +34,21 @@ - **SSH key**:`~/.ssh/home_gitea`(ED25519,公钥指纹 `SHA256:GYXaOXIMeloQ1fKSfdJ/ndgPQzs/Ix7Hk62ekfkfQ20`,Gitea 侧密钥名 GMKtec); `~/.ssh/config` 已有 `git-ssh.u1680832.nyat.app` 主机条目,克隆/推送直接可用。 + +## Agent 执行与新项目准入(强制) + +AI 实施单元只能经 `scripts/agent-exec run` 按 AGENT-EXECUTION.md 执行,并经 `scripts/agent-exec apply` 集成;`scripts/agent-exec` 是共享执行器的权威入口。 + +1. 缺 Guidelines 固定版本(`deps/development-guidelines` gitlink 未就绪或 HEAD 不符)时,Agent 只能只读分析,不得实施。 +2. 缺有效 `AGENT-EXECUTION.md`(`scripts/dm governance check` 未通过)时禁止 AI 实施。 +3. 缺共享执行器(`scripts/agent-exec` 或 `deps/development-manager` 不可用)时,状态为 `blocked/unavailable`,不得改由 host 替代。 +4. 不允许 host 代写实施单元;实施、修复与测试必须经 `AGENT-EXECUTION.md` 登记的候选执行。 +5. 人类直接开发按其自身授权与项目规则进行,不受本条款约束。 +6. 分支保护与规范 tag 由用户负责设置与维护,Agent 不得代为设置。 + +入口: + +- 需求分流:`scripts/task triage discover|decide|verify` +- 任务启动:`scripts/task start …` +- PR 检查:`scripts/task pr-check …` +- Agent 执行:`scripts/agent-exec run|apply|admit|validate` diff --git a/PROJECT.md b/PROJECT.md index 779ef63..081b9ad 100644 --- a/PROJECT.md +++ b/PROJECT.md @@ -21,6 +21,7 @@ | 逻辑 ID | 路径 | 角色 | |---|---|---| | development-guidelines | `deps/development-guidelines` | development-only | +| development-manager | `deps/development-manager` | development-only(治理与 Agent 执行工具,不参与构建) | 本库 Go 依赖只有标准库。`examples/trace` 是独立模块,用相对路径引用本库与同级检出的 Error-Code-System,不把错误码库变成主模块依赖。 @@ -46,6 +47,7 @@ git clone --recurse-submodules ssh://git@git-ssh.u1680832.nyat.app:31411/weichen | 模块/接口 | 仓库根:`go vet ./... && go test -count=1 ./...` | 不含 `examples/trace`(独立模块) | | 数据/权限/恢复 | 文件滚动与采集 JSONL 由 sink/server 测试覆盖 | 无共享数据库 | | 跨库追溯示例 | 在 `examples/trace`:`go test ./...` | 需要同级目录 `../../../Error-Code-System` 或该 go.mod 的 replace 目标存在 | +| 工程 Agent 执行与治理 | 仓库根:`scripts/agent-exec validate --repo .` 与 `scripts/dm governance check --repo .`(CI 工作流 `governance` 执行同两条) | 需 `deps/development-manager` 按钉住提交检出;只校验配置与治理文件,不覆盖业务行为 | ## 环境与数据 diff --git a/deps/development-guidelines b/deps/development-guidelines index 26b562d..2688fd2 160000 --- a/deps/development-guidelines +++ b/deps/development-guidelines @@ -1 +1 @@ -Subproject commit 26b562d2e34fbc560711296a309c91c74ffc55b1 +Subproject commit 2688fd2be6a52c0bf110e7e6366b6f291ab5e4eb diff --git a/deps/development-manager b/deps/development-manager new file mode 160000 index 0000000..bd3a7de --- /dev/null +++ b/deps/development-manager @@ -0,0 +1 @@ +Subproject commit bd3a7de57a3a9e1a4495b94c5fa5c08d71e7be8c diff --git a/policy/guidelines-adoption.md b/policy/guidelines-adoption.md index 2b34ee6..9414fd6 100644 --- a/policy/guidelines-adoption.md +++ b/policy/guidelines-adoption.md @@ -1,29 +1,31 @@ # 通用规范采纳记录 -- 项目/负责人:Logging-System / 仓库所有者 weichen +- 项目/负责人:Logging-System / weichen - 状态:active - 规范位置:`deps/development-guidelines` -- 规范性文档目录:`policy/` -- 过程文档位置:`docs/records/`(项目内固定目录豁免。集成说明留在 `docs/integration.md`,因为它描述当前合同而不是某次任务。方案与验证放 `docs/records/`。任务主记录在 Gitea Issue/PR。) -- 版本权威:父仓 gitlink;可读标签:无(内容版本 `0.1.0-draft.6`,提交 `26b562d2e34fbc560711296a309c91c74ffc55b1`) -- 批准/生效依据:本仓接入提交 -- 替代范围和迁移说明:无既有根 `AGENTS.md`。 +- 规范性文档目录:`policy/`(项目规则与制度放此处) +- 过程文档位置:`.task/`(任务卡,随 PR 维护);任务主记录在 Gitea PR;`docs/records/`(项目内固定目录豁免,方案与验证记录) +- 版本权威:本仓 gitlink `deps/development-guidelines` @ `2688fd2be6a5`(完整 SHA `2688fd2be6a52c0bf110e7e6366b6f291ab5e4eb`,内容版本 `0.1.0-draft.12`);无可读发布标签;治理工具 gitlink `deps/development-manager` @ `bd3a7de57a3a`(完整 SHA `bd3a7de57a3a9e1a4495b94c5fa5c08d71e7be8c`) +- 批准/生效依据:`feature/governance-adoption PR(Logging-System)`;合入前须在 `.task/feature-governance-adoption.md` 记录正负例、Review 与 CI 结果 +- 替代范围和迁移说明:本次把 Guidelines gitlink 从 `26b562d2e34f`(`0.1.0-draft.6`)升级到 `2688fd2be6a5`,并接入共享治理套件(`scripts/dm`、`scripts/agent-exec`、`scripts/task`、`scripts/hooks/pre-commit`、`.gitea/workflows/governance.yml`)。无旧 Agent 执行器需要替代。 | 规范/工作流 | 适用条件与范围 | 采纳或不适用理由 | 执行方式/证据 | |---|---|---|---| | core/baseline.md | 日常工作 | 日志是失败定位的另一半 | manual | | workflows/delivery.md、debugging.md、handoff.md | 交付、排障与交接 | 排障会直接使用本库 | manual | -| standards/collaboration.md | 消费方固定版本 | 本仓不跟随消费方分支 | manual | -| standards/verification.md | 并发、脱敏、排空 | conformance 与 `go test` | manual | +| standards/collaboration.md | 合入前同步目标分支;消费方固定版本 | 本仓不跟随消费方分支;PR 前后同步并记录 | manual | +| standards/merge-queue.md | 多个就绪任务的最终同步、CI、Review 与合入调度 | 不适用:单人顺序合入,不存在多个并行就绪候选 | 不适用 | +| standards/verification.md | 并发、脱敏、排空、模块接口 | `go vet` 与 `go test`,见 PROJECT.md「验证命令」;CI `ci.yml` 执行 vet 与 test | manual + CI | | standards/observability.md | trace、级别、重放 | 本仓实现日志半边 | manual | | standards/configuration.md | 文件、环境变量、出口 | `config.Load` / `LOGSYS_*` | manual | | standards/security.md | 脱敏与采集 token | 写前与入库前各脱敏一次 | manual | -| standards/failure-containment.md | 队列满丢弃最新一条 | 不阻塞业务 goroutine | manual | -| standards/module-contracts.md | 不导入错误码库 | 鸭子接口是稳定边界 | manual | -| standards/documentation.md | 三层文档 | `docs/` 与 `docs/records/` 分开 | manual | +| standards/failure-containment.md | 队列满时的丢弃与阻塞策略 | 队列满丢弃最新一条,不阻塞业务 goroutine | manual | +| standards/module-contracts.md | 公开接口与依赖边界 | 不导入错误码库;鸭子接口是稳定边界 | manual | +| standards/documentation.md | 三层文档 | `docs/` 与 `docs/records/` 分开;任务过程记录按 `.task/` 与 PR | manual | | standards/multi-repo.md | 被 submodule 消费;示例模块用相对 replace | 主模块不嵌套错误码库 | manual | | standards/data-reliability.md | JSONL 采集文件 | 无事务数据库;文件是日志投影 | manual | -| standards/agent-execution.md | 不执行 Agent | 只记录调用方给出的字段 | 不适用 | +| standards/agent-execution.md | 工程 Agent 执行(实施、修复、测试、审阅) | 配置见 AGENT-EXECUTION.md;入口 `scripts/agent-exec`(validate / admit);CI `governance` 工作流运行 validate 与 governance check;本地 admit 待 host 启用 `core.hooksPath` 后生效 | enforced(CI)+ advisory(本地);证据:`governance check + 正负例(.task/feature-governance-adoption.md)` | +| standards/testability.md、workflows/design-verification.md | 功能增量的设计与可测试性 | 跨包变更按增量写明验收与测试范围 | manual | | standards/release-operations.md | 无制品流水线 | 消费方固定 gitlink | 不适用 | | workflows/automation.md | 无独立定时任务 | 异步批导出是库行为,不是运营自动化 | 不适用 | @@ -35,6 +37,7 @@ ## 本次升级或首次接入验证 -- 子模块固定 `26b562d2e34fbc560711296a309c91c74ffc55b1`。 +- 子模块固定:`deps/development-guidelines` @ `2688fd2be6a52c0bf110e7e6366b6f291ab5e4eb`;`deps/development-manager` @ `bd3a7de57a3a9e1a4495b94c5fa5c08d71e7be8c`。 - `examples/trace` 仍使用自己的 `go.mod` replace,不改为依赖 `deps/` 下的错误码副本。 -- 回退只恢复规范 gitlink 与入口文件。 +- 入口与门禁:`AGENTS.md`「Agent 执行与新项目准入(强制)」、`AGENT-EXECUTION.md`(候选 `cursor-agent-stable`)、`.gitea/workflows/governance.yml`;正负例与结果记录在 `.task/feature-governance-adoption.md`。 +- 回退:通过普通 PR 恢复上一 gitlink(`26b562d2e34f`)、`.gitmodules`,并移除治理入口(`scripts/`、`.task/templates/task-card.md`、`.gitea/workflows/governance.yml`)。`AGENT-EXECUTION.md` 作为项目执行配置保留,回退时由 PR 另行处理。 diff --git a/scripts/agent-exec b/scripts/agent-exec new file mode 100755 index 0000000..7dc09b3 --- /dev/null +++ b/scripts/agent-exec @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# 共享 Agent 执行器薄入口:转调 scripts/dm 的 agent-exec 子命令(validate / run / apply / admit / cleanup)。 +set -euo pipefail +exec "$(dirname "$0")/dm" agent-exec "$@" diff --git a/scripts/dm b/scripts/dm new file mode 100755 index 0000000..a7cdae3 --- /dev/null +++ b/scripts/dm @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +# 共享 dm-server 薄入口:读取 deps/development-manager 的 gitlink 钉住提交, +# 按该提交构建并缓存 dm-server,再 exec 其子命令(agent-exec、task、governance)。执行语义与退出码以该二进制为准。 +set -euo pipefail + +root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P) +dm="$root/deps/development-manager" + +die() { echo "dm: $*" >&2; exit 2; } + +# git 钩子会导出仓库本地变量(GIT_DIR、GIT_INDEX_FILE 等),它们会让 `git -C "$dm"` 解析到外层仓库。 +# 所有针对 DM 检出的 git 与 go 调用都在清除这些变量后执行;读取外层 gitlink 与最终 exec 仍保留继承环境。 +dm_local_env="GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_PREFIX GIT_OBJECT_DIRECTORY GIT_ALTERNATE_OBJECT_DIRECTORIES GIT_COMMON_DIR GIT_GRAFT_FILE GIT_NAMESPACE GIT_CONFIG GIT_CONFIG_PARAMETERS GIT_CONFIG_COUNT GIT_SHALLOW_FILE GIT_IMPLICIT_WORK_TREE $(git rev-parse --local-env-vars 2>/dev/null || true)" +dm_clean_env() { for v in $dm_local_env; do unset "$v"; done; } +dmgit() ( dm_clean_env; git -C "$dm" "$@" ) + +# 1. 钉住版本只来自索引中的 gitlink(mode 160000),不读取工作区文件。 +entry=$(git -C "$root" ls-files -s -- deps/development-manager 2>/dev/null || true) +[ -n "$entry" ] || die "索引中缺少 deps/development-manager 的 gitlink,无法确定钉住的 DM 版本" +read -r mode pin _stage _path <<<"$entry" +[ "$mode" = 160000 ] || die "deps/development-manager 不是 gitlink(mode=$mode)" +[[ "$pin" =~ ^[0-9a-f]{40}$ ]] || die "gitlink 提交格式无效:$pin" + +# 2. 检出必须存在且确为 DM 独立仓库(避免 git -C 误解析到外层仓库),HEAD 必须等于钉住提交。 +[ -e "$dm/.git" ] || die "deps/development-manager 未检出;请按钉住提交 $pin 检出该 gitlink" +top=$(dmgit rev-parse --show-toplevel 2>/dev/null || true) +[ -n "$top" ] && [ "$top" = "$(cd "$dm" && pwd -P)" ] \ + || die "deps/development-manager 不是独立检出;请按钉住提交 $pin 检出该 gitlink" +head=$(dmgit rev-parse HEAD 2>/dev/null || true) +[ "$head" = "$pin" ] \ + || die "deps/development-manager HEAD(${head:-未知})与钉住提交 $pin 不一致;请按钉住提交检出" + +# 3. 检出工作树必须干净(忽略嵌套 submodule 状态)。 +dirty=$(dmgit status --porcelain --ignore-submodules=all) \ + || die "无法读取 deps/development-manager 的工作树状态" +[ -z "$dirty" ] || die "deps/development-manager 存在未提交改动,拒绝运行(请先清理该检出)" + +# 4. 二进制按钉住提交缓存;缺失时在缓存目录内临时构建,完成后原子改名,避免留下半成品。 +cache="${DM_CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/development-manager/dm-server}" +bin="$cache/dm-server-$pin" +if [ ! -x "$bin" ]; then + command -v go >/dev/null 2>&1 || die "缺少 go,无法构建 dm-server($pin)" + mkdir -p "$cache" + cache=$(cd "$cache" && pwd -P) + bin="$cache/dm-server-$pin" + work=$(mktemp -d "$cache/build-$pin.XXXXXX") + if ! (dm_clean_env; cd "$dm" && GOWORK=off go build -trimpath -o "$work/dm-server" ./cmd/dm-server); then + rm -rf "$work" + die "构建 dm-server 失败($pin)" + fi + mv -f "$work/dm-server" "$bin" + rm -rf "$work" +fi + +exec "$bin" "$@" diff --git a/scripts/hooks/pre-commit b/scripts/hooks/pre-commit new file mode 100755 index 0000000..47404f4 --- /dev/null +++ b/scripts/hooks/pre-commit @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# 本地检查(pre-commit):集成分支直提拒绝 + 分支命名 + 本地完整性核对。权威准入在 PR(baseline.md:26)。 +branch=$(git rev-parse --abbrev-ref HEAD) +case "$branch" in + main|master) + echo "pre-commit: 拒绝——集成分支 ${branch} 不得直接提交,走 feature 分支 + PR(collaboration.md)" >&2 + exit 1 ;; +esac +echo "$branch" | grep -qE '^(feature|fix|hotfix|release)/[A-Za-z0-9._-]+$' || { + echo "pre-commit: 拒绝——分支名须为 feature|fix|hotfix|release/,当前:${branch}" >&2 + exit 1 +} +root=$(git rev-parse --show-toplevel) +# admit 只是本地完整性/篡改证据(SELF):同一 OS 用户可读取本地 HMAC 密钥并绕过本钩子, +# 它不是 GATE,也不是可信身份。缺失或无效的本地记录仍拒绝;交付信任来自精确 HEAD 的 CI 或独立 REPLAY。 +"$root/scripts/agent-exec" admit --repo "$root" diff --git a/scripts/task b/scripts/task new file mode 100755 index 0000000..fe7d2ca --- /dev/null +++ b/scripts/task @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# 通用任务入口:转调 scripts/dm 的 task 子命令(triage / start / pr-check)。 +set -euo pipefail +exec "$(dirname "$0")/dm" task "$@" -- 2.54.0 From f4351ea681927086fbb73d9c8ec096a9b730b090 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 17 Oct 2026 07:38:25 +0000 Subject: [PATCH 03/11] Record the adoption unit run and positive/negative evidence Why: Phase 6 requires one positive executor run and the negative cases (missing config, bad receipt, out-of-scope path, unknown side effect) before adoption becomes active. Evidence: .task/evidence/governance-adoption/ (SELF): governance check, agent-exec validate and adoption cases; this commit passed the generated pre-commit hook (admit). Impact: task card and evidence logs only. Refs: .task/feature-governance-adoption.md --- .../00-20261017T073824Z.log | 19 +++++++++++++++++++ .../01-20261017T073824Z.log | 7 +++++++ .../02-20261017T073824Z.log | 13 +++++++++++++ .task/feature-governance-adoption.md | 4 ++++ 4 files changed, 43 insertions(+) create mode 100644 .task/evidence/governance-adoption/00-20261017T073824Z.log create mode 100644 .task/evidence/governance-adoption/01-20261017T073824Z.log create mode 100644 .task/evidence/governance-adoption/02-20261017T073824Z.log diff --git a/.task/evidence/governance-adoption/00-20261017T073824Z.log b/.task/evidence/governance-adoption/00-20261017T073824Z.log new file mode 100644 index 0000000..cff66bf --- /dev/null +++ b/.task/evidence/governance-adoption/00-20261017T073824Z.log @@ -0,0 +1,19 @@ +command: scripts/dm governance check --repo . +cwd: /home/weichen/projects/Logging-System-wt-feature-governance-adoption +head: 3b355600aacfb7924b94ea9315c4e0c37ac2a8eb +exit: 0 +utc: 20261017T073824Z +--- +ok gitlink deps/development-guidelines +ok gitlink deps/development-manager +ok agent-execution +ok file AGENTS.md +ok file PROJECT.md +ok file policy/guidelines-adoption.md +ok file .task/templates/task-card.md +ok executable scripts/agent-exec +ok executable scripts/hooks/pre-commit +ok executable scripts/dm +ok executable scripts/task +ok adoption status +ok fixtures diff --git a/.task/evidence/governance-adoption/01-20261017T073824Z.log b/.task/evidence/governance-adoption/01-20261017T073824Z.log new file mode 100644 index 0000000..22a2657 --- /dev/null +++ b/.task/evidence/governance-adoption/01-20261017T073824Z.log @@ -0,0 +1,7 @@ +command: scripts/agent-exec validate --repo . +cwd: /home/weichen/projects/Logging-System-wt-feature-governance-adoption +head: 3b355600aacfb7924b94ea9315c4e0c37ac2a8eb +exit: 0 +utc: 20261017T073824Z +--- +validate: ok diff --git a/.task/evidence/governance-adoption/02-20261017T073824Z.log b/.task/evidence/governance-adoption/02-20261017T073824Z.log new file mode 100644 index 0000000..1372420 --- /dev/null +++ b/.task/evidence/governance-adoption/02-20261017T073824Z.log @@ -0,0 +1,13 @@ +command: python3 /tmp/gov-neg/adopt_cases.py . +cwd: /home/weichen/projects/Logging-System-wt-feature-governance-adoption +head: 3b355600aacfb7924b94ea9315c4e0c37ac2a8eb +exit: 0 +utc: 20261017T073824Z +--- +[object] Logging-System-wt-feature-governance-adoption HEAD=3b355600aacfb7924b94ea9315c4e0c37ac2a8eb +PASS positive-run-apply: run exit=0 terminal=success apply exit=0 head=9f119e119fe2 +PASS missing-config: run exit=2 terminal=invalid-config validate exit=2 +PASS bad-receipt: apply exit=4 head_unchanged=True msg=apply: no local integrity record: changed paths do not match the transport diff +PASS out-of-scope-path: run exit=5 terminal=scope-expansion transport=False +PASS unknown-side-effect: run exit=4 terminal=failed-unknown transport=False +[verdict] ALL PASS cases=5 diff --git a/.task/feature-governance-adoption.md b/.task/feature-governance-adoption.md index d81d32a..a0d4477 100644 --- a/.task/feature-governance-adoption.md +++ b/.task/feature-governance-adoption.md @@ -26,6 +26,7 @@ | 单元 ID | 预期范围 | 角色 | 候选顺序 | attempt | CLI/模型 | 终态 | transport | fallback | 源码外收据路径 | |---|---|---|---|---|---|---|---|---|---| +| governance-adoption-Logging-System-r1 | 13 个允许路径(治理文件 + 两个 gitlink) | 31244149 | implementation | cursor→antigravity→pi | run b513506a(dm-server pinned,attempts=1) | cursor / not-observable | success | 3b355600aacf(apply 快进) | 否 | /tmp/gov-receipt-Logging-System-r1.json | ## 同步记录 @@ -41,3 +42,6 @@ | 时间(UTC) | 命令 | 被测 HEAD | exit | 来源 | 摘要/位置 | |---|---|---|---|---|---| +| 20261017T073824Z | `scripts/dm governance check --repo .` | 3b355600aacf | 0 | SELF | ok fixtures;[输出](evidence/governance-adoption/00-20261017T073824Z.log) sha256:caf90f14cc142ed7 | +| 20261017T073824Z | `scripts/agent-exec validate --repo .` | 3b355600aacf | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/01-20261017T073824Z.log) sha256:39d7b45b3a2af043 | +| 20261017T073824Z | `python3 /tmp/gov-neg/adopt_cases.py .` | 3b355600aacf | 0 | SELF | [verdict] ALL PASS cases=5;[输出](evidence/governance-adoption/02-20261017T073824Z.log) sha256:84a4b7528fd2a932 | -- 2.54.0 From 742ffb2c7c9d2194678576519cfca70408fa4d75 Mon Sep 17 00:00:00 2001 From: agent-exec-transport Date: Sat, 17 Oct 2026 08:39:54 +0000 Subject: [PATCH 04/11] agent-exec transport d1dd6edec0f4a656022d69dd4e0b7b46/9c9282bcc23a --- PROJECT.md | 4 ++-- policy/guidelines-adoption.md | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/PROJECT.md b/PROJECT.md index 081b9ad..1787793 100644 --- a/PROJECT.md +++ b/PROJECT.md @@ -12,8 +12,8 @@ - 提交/审核/合并/发布身份与权限:仓库所有者 weichen。 - 任务唯一来源:Gitea `weichen/Logging-System` 的 Issue 与 Pull Request。 - 规范性文档目录:`policy/`。 -- 过程文档仓/目录:`docs/records/`(项目内豁免)。 -- 交接记录位置:随任务主记录;需要落盘的交接放入 `docs/records/`。 +- 过程文档仓/目录:`.task/`(任务卡与交付流程证据);`docs/records/`(其他过程记录,项目内豁免)。 +- 交接记录位置:随任务主记录;需要落盘的交接放入 `docs/records/`(其他过程记录);任务卡与证据在 `.task/`。 - 凭证查找入口及所需字段:采集 token 来自服务配置或环境,字段名为 token / `X-Log-Token`,值不入库。进程内日志还可由 `LOGSYS_CONFIG`、`LOGSYS_LEVEL`、`LOGSYS_SERVICE`、`LOGSYS_REDACT` 覆盖。 ## 依赖组合 diff --git a/policy/guidelines-adoption.md b/policy/guidelines-adoption.md index 9414fd6..33633a0 100644 --- a/policy/guidelines-adoption.md +++ b/policy/guidelines-adoption.md @@ -4,7 +4,7 @@ - 状态:active - 规范位置:`deps/development-guidelines` - 规范性文档目录:`policy/`(项目规则与制度放此处) -- 过程文档位置:`.task/`(任务卡,随 PR 维护);任务主记录在 Gitea PR;`docs/records/`(项目内固定目录豁免,方案与验证记录) +- 过程文档位置:`.task/`(任务卡与交付流程证据,随 PR 维护);`docs/records/`(其他过程记录,项目内固定目录豁免,方案与验证记录);任务主记录在 Gitea PR - 版本权威:本仓 gitlink `deps/development-guidelines` @ `2688fd2be6a5`(完整 SHA `2688fd2be6a52c0bf110e7e6366b6f291ab5e4eb`,内容版本 `0.1.0-draft.12`);无可读发布标签;治理工具 gitlink `deps/development-manager` @ `bd3a7de57a3a`(完整 SHA `bd3a7de57a3a9e1a4495b94c5fa5c08d71e7be8c`) - 批准/生效依据:`feature/governance-adoption PR(Logging-System)`;合入前须在 `.task/feature-governance-adoption.md` 记录正负例、Review 与 CI 结果 - 替代范围和迁移说明:本次把 Guidelines gitlink 从 `26b562d2e34f`(`0.1.0-draft.6`)升级到 `2688fd2be6a5`,并接入共享治理套件(`scripts/dm`、`scripts/agent-exec`、`scripts/task`、`scripts/hooks/pre-commit`、`.gitea/workflows/governance.yml`)。无旧 Agent 执行器需要替代。 @@ -24,7 +24,7 @@ | standards/documentation.md | 三层文档 | `docs/` 与 `docs/records/` 分开;任务过程记录按 `.task/` 与 PR | manual | | standards/multi-repo.md | 被 submodule 消费;示例模块用相对 replace | 主模块不嵌套错误码库 | manual | | standards/data-reliability.md | JSONL 采集文件 | 无事务数据库;文件是日志投影 | manual | -| standards/agent-execution.md | 工程 Agent 执行(实施、修复、测试、审阅) | 配置见 AGENT-EXECUTION.md;入口 `scripts/agent-exec`(validate / admit);CI `governance` 工作流运行 validate 与 governance check;本地 admit 待 host 启用 `core.hooksPath` 后生效 | enforced(CI)+ advisory(本地);证据:`governance check + 正负例(.task/feature-governance-adoption.md)` | +| standards/agent-execution.md | 工程 Agent 执行(实施、修复、测试、审阅) | 配置见 AGENT-EXECUTION.md;入口 `scripts/agent-exec`(validate / admit);CI `governance` 工作流运行 validate 与 governance check;本地 admit 待 host 启用 `core.hooksPath` 后生效 | advisory(CI;分支保护尚未设为必需检查,设为必需检查并有阻断负例后再登记 enforced)+ advisory(本地);证据:`governance check + 正负例(.task/feature-governance-adoption.md)` | | standards/testability.md、workflows/design-verification.md | 功能增量的设计与可测试性 | 跨包变更按增量写明验收与测试范围 | manual | | standards/release-operations.md | 无制品流水线 | 消费方固定 gitlink | 不适用 | | workflows/automation.md | 无独立定时任务 | 异步批导出是库行为,不是运营自动化 | 不适用 | @@ -34,6 +34,7 @@ | 原规则/章节 | 项目采用方式 | 原因与风险 | 负责人/复查条件 | |---|---|---|---| | documentation.md 过程仓默认独立仓库 | `docs/records/` 豁免 | 个人项目。风险同其他三仓 | 采集服务对外长期运行时复查 | +| documentation.md 过程仓默认独立仓库 | `.task/` 仓内任务卡与交付证据目录 | 个人项目,任务卡随 PR 维护。风险同其他三仓 | 采集服务对外长期运行时复查 | ## 本次升级或首次接入验证 -- 2.54.0 From f0b463c745cdd344db4c428a1efcd7388b825a72 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 17 Oct 2026 08:41:31 +0000 Subject: [PATCH 05/11] docs(task): record review repair run and evidence Why: independent Review blocked the adoption; the repair unit ran through the shared executor and was integrated with agent-exec apply. Evidence: .task/evidence/governance-adoption/ (SELF): governance check and agent-exec validate on the repaired head. Impact: task card and evidence logs only. Refs: .task/feature-governance-adoption.md --- .../03-20261017T084130Z.log | 19 +++++++++++++++++++ .../04-20261017T084130Z.log | 7 +++++++ .task/feature-governance-adoption.md | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 .task/evidence/governance-adoption/03-20261017T084130Z.log create mode 100644 .task/evidence/governance-adoption/04-20261017T084130Z.log diff --git a/.task/evidence/governance-adoption/03-20261017T084130Z.log b/.task/evidence/governance-adoption/03-20261017T084130Z.log new file mode 100644 index 0000000..b458ce9 --- /dev/null +++ b/.task/evidence/governance-adoption/03-20261017T084130Z.log @@ -0,0 +1,19 @@ +command: scripts/dm governance check --repo . +cwd: /home/weichen/projects/Logging-System-wt-feature-governance-adoption +head: 742ffb2c7c9d2194678576519cfca70408fa4d75 +exit: 0 +utc: 20261017T084130Z +--- +ok gitlink deps/development-guidelines +ok gitlink deps/development-manager +ok agent-execution +ok file AGENTS.md +ok file PROJECT.md +ok file policy/guidelines-adoption.md +ok file .task/templates/task-card.md +ok executable scripts/agent-exec +ok executable scripts/hooks/pre-commit +ok executable scripts/dm +ok executable scripts/task +ok adoption status +ok fixtures diff --git a/.task/evidence/governance-adoption/04-20261017T084130Z.log b/.task/evidence/governance-adoption/04-20261017T084130Z.log new file mode 100644 index 0000000..dd6f1c5 --- /dev/null +++ b/.task/evidence/governance-adoption/04-20261017T084130Z.log @@ -0,0 +1,7 @@ +command: scripts/agent-exec validate --repo . +cwd: /home/weichen/projects/Logging-System-wt-feature-governance-adoption +head: 742ffb2c7c9d2194678576519cfca70408fa4d75 +exit: 0 +utc: 20261017T084130Z +--- +validate: ok diff --git a/.task/feature-governance-adoption.md b/.task/feature-governance-adoption.md index a0d4477..eb5507b 100644 --- a/.task/feature-governance-adoption.md +++ b/.task/feature-governance-adoption.md @@ -27,6 +27,7 @@ | 单元 ID | 预期范围 | 角色 | 候选顺序 | attempt | CLI/模型 | 终态 | transport | fallback | 源码外收据路径 | |---|---|---|---|---|---|---|---|---|---| | governance-adoption-Logging-System-r1 | 13 个允许路径(治理文件 + 两个 gitlink) | 31244149 | implementation | cursor→antigravity→pi | run b513506a(dm-server pinned,attempts=1) | cursor / not-observable | success | 3b355600aacf(apply 快进) | 否 | /tmp/gov-receipt-Logging-System-r1.json | +| governance-adoption-Logging-System-repair-r1 | PROJECT.md、policy/guidelines-adoption.md | repair | cursor→antigravity→pi | run d1dd6ede(attempts=1) | cursor / not-observable | success | 742ffb2c7c9d(apply 快进) | 否 | /tmp/gov-receipt-Logging-System-repair-r1.json | ## 同步记录 @@ -45,3 +46,5 @@ | 20261017T073824Z | `scripts/dm governance check --repo .` | 3b355600aacf | 0 | SELF | ok fixtures;[输出](evidence/governance-adoption/00-20261017T073824Z.log) sha256:caf90f14cc142ed7 | | 20261017T073824Z | `scripts/agent-exec validate --repo .` | 3b355600aacf | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/01-20261017T073824Z.log) sha256:39d7b45b3a2af043 | | 20261017T073824Z | `python3 /tmp/gov-neg/adopt_cases.py .` | 3b355600aacf | 0 | SELF | [verdict] ALL PASS cases=5;[输出](evidence/governance-adoption/02-20261017T073824Z.log) sha256:84a4b7528fd2a932 | +| 20261017T084130Z | `scripts/dm governance check --repo .` | 742ffb2c7c9d | 0 | SELF | ok fixtures;[输出](evidence/governance-adoption/03-20261017T084130Z.log) sha256:c5a1a532588e5219 | +| 20261017T084130Z | `scripts/agent-exec validate --repo .` | 742ffb2c7c9d | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/04-20261017T084130Z.log) sha256:4135b4ee9fa8ff49 | -- 2.54.0 From 670622554482a161de911d1e9ba79b8307426f0b Mon Sep 17 00:00:00 2001 From: agent-exec-transport Date: Sat, 17 Oct 2026 08:43:27 +0000 Subject: [PATCH 06/11] agent-exec transport 8bc2c2e6dfb442518564682a3f3aee9b/eeb4bdaf4d3d --- .gitea/workflows/ci.yml | 26 ++++++++++++++++++++++++-- policy/guidelines-adoption.md | 2 +- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index a084d4c..6ebd9c9 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -8,7 +8,18 @@ jobs: vet-and-test: runs-on: nightly steps: - - uses: actions/checkout@v4 + - name: Checkout + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + # 自包含检出(runner 无法访问 github.com 上的 actions/checkout):固定 SHA 浅取回,凭据只以 URL 限定的 extraheader 存在于单个 git 进程。 + case "$GITHUB_SHA" in *[!0-9a-fA-F]*|"") echo "Checkout requires a fixed commit SHA" >&2; exit 1;; esac + url="${GITHUB_SERVER_URL%/}/${GITHUB_REPOSITORY}.git" + git init -q . + git -c "http.${url}.extraheader=AUTHORIZATION: token ${TOKEN}" -c credential.helper= -c core.hooksPath=/dev/null fetch -q --depth=1 "$url" "$GITHUB_SHA" + git checkout -q --detach FETCH_HEAD + unset TOKEN - run: go vet ./... && go test -count=1 ./... docker-checkout-hostgateway: runs-on: ubuntu-latest @@ -16,5 +27,16 @@ jobs: env: GITHUB_SERVER_URL: http://gitea:3000 steps: - - uses: actions/checkout@v4 + - name: Checkout + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + # 自包含检出(runner 无法访问 github.com 上的 actions/checkout):固定 SHA 浅取回,凭据只以 URL 限定的 extraheader 存在于单个 git 进程。 + case "$GITHUB_SHA" in *[!0-9a-fA-F]*|"") echo "Checkout requires a fixed commit SHA" >&2; exit 1;; esac + url="${GITHUB_SERVER_URL%/}/${GITHUB_REPOSITORY}.git" + git init -q . + git -c "http.${url}.extraheader=AUTHORIZATION: token ${TOKEN}" -c credential.helper= -c core.hooksPath=/dev/null fetch -q --depth=1 "$url" "$GITHUB_SHA" + git checkout -q --detach FETCH_HEAD + unset TOKEN - run: test -f go.mod && echo "docker-mode checkout via host-gateway OK" diff --git a/policy/guidelines-adoption.md b/policy/guidelines-adoption.md index 33633a0..40c6487 100644 --- a/policy/guidelines-adoption.md +++ b/policy/guidelines-adoption.md @@ -7,7 +7,7 @@ - 过程文档位置:`.task/`(任务卡与交付流程证据,随 PR 维护);`docs/records/`(其他过程记录,项目内固定目录豁免,方案与验证记录);任务主记录在 Gitea PR - 版本权威:本仓 gitlink `deps/development-guidelines` @ `2688fd2be6a5`(完整 SHA `2688fd2be6a52c0bf110e7e6366b6f291ab5e4eb`,内容版本 `0.1.0-draft.12`);无可读发布标签;治理工具 gitlink `deps/development-manager` @ `bd3a7de57a3a`(完整 SHA `bd3a7de57a3a9e1a4495b94c5fa5c08d71e7be8c`) - 批准/生效依据:`feature/governance-adoption PR(Logging-System)`;合入前须在 `.task/feature-governance-adoption.md` 记录正负例、Review 与 CI 结果 -- 替代范围和迁移说明:本次把 Guidelines gitlink 从 `26b562d2e34f`(`0.1.0-draft.6`)升级到 `2688fd2be6a5`,并接入共享治理套件(`scripts/dm`、`scripts/agent-exec`、`scripts/task`、`scripts/hooks/pre-commit`、`.gitea/workflows/governance.yml`)。无旧 Agent 执行器需要替代。 +- 替代范围和迁移说明:本次把 Guidelines gitlink 从 `26b562d2e34f`(`0.1.0-draft.6`)升级到 `2688fd2be6a5`,并接入共享治理套件(`scripts/dm`、`scripts/agent-exec`、`scripts/task`、`scripts/hooks/pre-commit`、`.gitea/workflows/governance.yml`)。无旧 Agent 执行器需要替代。`.gitea/workflows/ci.yml` 两个 job 原有的 `uses: actions/checkout@v4` 步骤已替换为自包含内联检出,因为 runner 无法访问 github.com;run 步骤未改变。 | 规范/工作流 | 适用条件与范围 | 采纳或不适用理由 | 执行方式/证据 | |---|---|---|---| -- 2.54.0 From 01b1404d83553340547cd3109afd338190a32c40 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 17 Oct 2026 08:46:45 +0000 Subject: [PATCH 07/11] docs(task): record review repair run and evidence Why: independent Review blocked the adoption; the repair unit ran through the shared executor and was integrated with agent-exec apply. Evidence: .task/evidence/governance-adoption/ (SELF): governance check and agent-exec validate on the repaired head. Impact: task card and evidence logs only. Refs: .task/feature-governance-adoption.md --- .../05-20261017T084644Z.log | 19 +++++++++++++++++++ .../06-20261017T084644Z.log | 7 +++++++ .task/feature-governance-adoption.md | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 .task/evidence/governance-adoption/05-20261017T084644Z.log create mode 100644 .task/evidence/governance-adoption/06-20261017T084644Z.log diff --git a/.task/evidence/governance-adoption/05-20261017T084644Z.log b/.task/evidence/governance-adoption/05-20261017T084644Z.log new file mode 100644 index 0000000..bf1a052 --- /dev/null +++ b/.task/evidence/governance-adoption/05-20261017T084644Z.log @@ -0,0 +1,19 @@ +command: scripts/dm governance check --repo . +cwd: /home/weichen/projects/Logging-System-wt-feature-governance-adoption +head: 670622554482a161de911d1e9ba79b8307426f0b +exit: 0 +utc: 20261017T084644Z +--- +ok gitlink deps/development-guidelines +ok gitlink deps/development-manager +ok agent-execution +ok file AGENTS.md +ok file PROJECT.md +ok file policy/guidelines-adoption.md +ok file .task/templates/task-card.md +ok executable scripts/agent-exec +ok executable scripts/hooks/pre-commit +ok executable scripts/dm +ok executable scripts/task +ok adoption status +ok fixtures diff --git a/.task/evidence/governance-adoption/06-20261017T084644Z.log b/.task/evidence/governance-adoption/06-20261017T084644Z.log new file mode 100644 index 0000000..8f9698b --- /dev/null +++ b/.task/evidence/governance-adoption/06-20261017T084644Z.log @@ -0,0 +1,7 @@ +command: scripts/agent-exec validate --repo . +cwd: /home/weichen/projects/Logging-System-wt-feature-governance-adoption +head: 670622554482a161de911d1e9ba79b8307426f0b +exit: 0 +utc: 20261017T084644Z +--- +validate: ok diff --git a/.task/feature-governance-adoption.md b/.task/feature-governance-adoption.md index eb5507b..41b0f85 100644 --- a/.task/feature-governance-adoption.md +++ b/.task/feature-governance-adoption.md @@ -28,6 +28,7 @@ |---|---|---|---|---|---|---|---|---|---| | governance-adoption-Logging-System-r1 | 13 个允许路径(治理文件 + 两个 gitlink) | 31244149 | implementation | cursor→antigravity→pi | run b513506a(dm-server pinned,attempts=1) | cursor / not-observable | success | 3b355600aacf(apply 快进) | 否 | /tmp/gov-receipt-Logging-System-r1.json | | governance-adoption-Logging-System-repair-r1 | PROJECT.md、policy/guidelines-adoption.md | repair | cursor→antigravity→pi | run d1dd6ede(attempts=1) | cursor / not-observable | success | 742ffb2c7c9d(apply 快进) | 否 | /tmp/gov-receipt-Logging-System-repair-r1.json | +| governance-adoption-Logging-System-repair-r2 | .gitea/workflows/ci.yml、policy/guidelines-adoption.md | repair | cursor→antigravity→pi | run 8bc2c2e6(attempts=1) | cursor / not-observable | success | 670622554482(apply 快进) | 否 | /tmp/gov-receipt-Logging-System-repair-r2.json | ## 同步记录 @@ -48,3 +49,5 @@ | 20261017T073824Z | `python3 /tmp/gov-neg/adopt_cases.py .` | 3b355600aacf | 0 | SELF | [verdict] ALL PASS cases=5;[输出](evidence/governance-adoption/02-20261017T073824Z.log) sha256:84a4b7528fd2a932 | | 20261017T084130Z | `scripts/dm governance check --repo .` | 742ffb2c7c9d | 0 | SELF | ok fixtures;[输出](evidence/governance-adoption/03-20261017T084130Z.log) sha256:c5a1a532588e5219 | | 20261017T084130Z | `scripts/agent-exec validate --repo .` | 742ffb2c7c9d | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/04-20261017T084130Z.log) sha256:4135b4ee9fa8ff49 | +| 20261017T084644Z | `scripts/dm governance check --repo .` | 670622554482 | 0 | SELF | ok fixtures;[输出](evidence/governance-adoption/05-20261017T084644Z.log) sha256:9fa960ad4417bb71 | +| 20261017T084644Z | `scripts/agent-exec validate --repo .` | 670622554482 | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/06-20261017T084644Z.log) sha256:df6671799eaa44b1 | -- 2.54.0 From 110337ee2e37bad14e98a0c655bd298390a4431f Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 17 Oct 2026 08:47:51 +0000 Subject: [PATCH 08/11] docs(task): complete the card for review (sync, CI, results) --- .task/feature-governance-adoption.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.task/feature-governance-adoption.md b/.task/feature-governance-adoption.md index 41b0f85..2c0fdfb 100644 --- a/.task/feature-governance-adoption.md +++ b/.task/feature-governance-adoption.md @@ -1,7 +1,7 @@ # Logging-System 采纳 development-governance-v2 治理套件 任务卡 -任务主记录:本文件随 PR 描述维护(PR 链接见下方"结果与验证")。 -状态:进行中;owner:weichen。 +任务主记录:[Logging-System PR #4](https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/pulls/4)(本文件随 PR 描述维护)。 +状态:待合入(独立 Review 与当前 HEAD CI 通过后合入);owner:weichen。 ## 基线与授权 @@ -35,12 +35,14 @@ | 节点 | sync_base_sha | tested_head_sha | checked_at | 结果 | |---|---|---|---|---| | 启动 | da5c33eb25a88b5ad5c88999d1a119f6f5b3af24 | da5c33eb25a88b5ad5c88999d1a119f6f5b3af24 | 2026-10-17T07:18:15Z | 一致 | +| 请求审核 | da5c33eb25a88b5ad5c88999d1a119f6f5b3af24 | 01b1404d8355 | 2026-10-17T08:47:35Z | 已含 origin/main | ## 结果与验证(完成后填写) -- 结果:NOT_RUN +- 结果:治理套件已采纳——Guidelines 与 Development-Manager gitlink 固定、AGENT-EXECUTION.md 四条路由、共享执行器薄入口、pre-commit admit、governance CI;采纳状态 active 随本 PR 合入生效。 - 验证:见下表(命令输出由 /tmp/gov-neg/ev.sh 写入 .task/evidence/governance-adoption/,SELF 除非另注)。 -- 影响与剩余项:NOT_RUN +- 复现:正负例脚本冻结副本 Agent-System-Dev `docs/superpowers/plans/evidence/governance-adopt-cases.py`(sha256 3aa1bf6ea1cd48f3f59c0a307620e4112389a93fe21a113006f54e62eb8f0d06),用法 `python3 governance-adopt-cases.py <仓库根>`;它经本仓 `scripts/agent-exec` 运行假 CLI,不访问网络。 +- 影响与剩余项:不改业务代码;本地启用钩子需由人执行 `git config core.hooksPath scripts/hooks`;将 governance 检查设为分支保护必需项属用户双钥匙事项(命令见 Agent-System-Dev 治理主记录)。 | 时间(UTC) | 命令 | 被测 HEAD | exit | 来源 | 摘要/位置 | |---|---|---|---|---|---| @@ -51,3 +53,6 @@ | 20261017T084130Z | `scripts/agent-exec validate --repo .` | 742ffb2c7c9d | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/04-20261017T084130Z.log) sha256:4135b4ee9fa8ff49 | | 20261017T084644Z | `scripts/dm governance check --repo .` | 670622554482 | 0 | SELF | ok fixtures;[输出](evidence/governance-adoption/05-20261017T084644Z.log) sha256:9fa960ad4417bb71 | | 20261017T084644Z | `scripts/agent-exec validate --repo .` | 670622554482 | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/06-20261017T084644Z.log) sha256:df6671799eaa44b1 | +| 2026-10-17T08:47:35Z | CI `ci / vet-and-test (pull_request)` | 01b1404d8355 | 0 | GATE | success;[运行](https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/actions/runs/3600/jobs/5695) | +| 2026-10-17T08:47:35Z | CI `ci / docker-checkout-hostgateway (pull_request)` | 01b1404d8355 | 0 | GATE | success;[运行](https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/actions/runs/3600/jobs/5696) | +| 2026-10-17T08:47:35Z | CI `governance / governance (pull_request)` | 01b1404d8355 | 0 | GATE | success;[运行](https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/actions/runs/3602/jobs/5698) | -- 2.54.0 From b57c1a0e0d6857432bca2bfeef63b38b5fe136b6 Mon Sep 17 00:00:00 2001 From: agent-exec-transport Date: Sat, 17 Oct 2026 08:55:54 +0000 Subject: [PATCH 09/11] agent-exec transport 1b906777fd42e2a559bb9a8c7fa10e93/696f1cfe2efd --- .gitea/workflows/ci.yml | 22 ++++++++++++++++------ policy/guidelines-adoption.md | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 6ebd9c9..3ba55bb 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -13,12 +13,17 @@ jobs: TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - # 自包含检出(runner 无法访问 github.com 上的 actions/checkout):固定 SHA 浅取回,凭据只以 URL 限定的 extraheader 存在于单个 git 进程。 + # 自包含检出(runner 无法访问 github.com 上的 actions/checkout):固定 SHA 浅取回;凭据只经 GIT_CONFIG_* 环境变量以 URL 限定的 extraheader 传给单个 git 进程(不进命令行、不持久化);强制检出并清理遗留文件,等价 actions/checkout 的 clean。 case "$GITHUB_SHA" in *[!0-9a-fA-F]*|"") echo "Checkout requires a fixed commit SHA" >&2; exit 1;; esac url="${GITHUB_SERVER_URL%/}/${GITHUB_REPOSITORY}.git" git init -q . - git -c "http.${url}.extraheader=AUTHORIZATION: token ${TOKEN}" -c credential.helper= -c core.hooksPath=/dev/null fetch -q --depth=1 "$url" "$GITHUB_SHA" - git checkout -q --detach FETCH_HEAD + GIT_CONFIG_COUNT=3 \ + GIT_CONFIG_KEY_0="http.${url}.extraheader" GIT_CONFIG_VALUE_0="AUTHORIZATION: token ${TOKEN}" \ + GIT_CONFIG_KEY_1=credential.helper GIT_CONFIG_VALUE_1= \ + GIT_CONFIG_KEY_2=core.hooksPath GIT_CONFIG_VALUE_2=/dev/null \ + git fetch -q --depth=1 "$url" "$GITHUB_SHA" + git checkout -q -f --detach FETCH_HEAD + git clean -ffdxq unset TOKEN - run: go vet ./... && go test -count=1 ./... docker-checkout-hostgateway: @@ -32,11 +37,16 @@ jobs: TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - # 自包含检出(runner 无法访问 github.com 上的 actions/checkout):固定 SHA 浅取回,凭据只以 URL 限定的 extraheader 存在于单个 git 进程。 + # 自包含检出(runner 无法访问 github.com 上的 actions/checkout):固定 SHA 浅取回;凭据只经 GIT_CONFIG_* 环境变量以 URL 限定的 extraheader 传给单个 git 进程(不进命令行、不持久化);强制检出并清理遗留文件,等价 actions/checkout 的 clean。 case "$GITHUB_SHA" in *[!0-9a-fA-F]*|"") echo "Checkout requires a fixed commit SHA" >&2; exit 1;; esac url="${GITHUB_SERVER_URL%/}/${GITHUB_REPOSITORY}.git" git init -q . - git -c "http.${url}.extraheader=AUTHORIZATION: token ${TOKEN}" -c credential.helper= -c core.hooksPath=/dev/null fetch -q --depth=1 "$url" "$GITHUB_SHA" - git checkout -q --detach FETCH_HEAD + GIT_CONFIG_COUNT=3 \ + GIT_CONFIG_KEY_0="http.${url}.extraheader" GIT_CONFIG_VALUE_0="AUTHORIZATION: token ${TOKEN}" \ + GIT_CONFIG_KEY_1=credential.helper GIT_CONFIG_VALUE_1= \ + GIT_CONFIG_KEY_2=core.hooksPath GIT_CONFIG_VALUE_2=/dev/null \ + git fetch -q --depth=1 "$url" "$GITHUB_SHA" + git checkout -q -f --detach FETCH_HEAD + git clean -ffdxq unset TOKEN - run: test -f go.mod && echo "docker-mode checkout via host-gateway OK" diff --git a/policy/guidelines-adoption.md b/policy/guidelines-adoption.md index 40c6487..28f063a 100644 --- a/policy/guidelines-adoption.md +++ b/policy/guidelines-adoption.md @@ -41,4 +41,4 @@ - 子模块固定:`deps/development-guidelines` @ `2688fd2be6a52c0bf110e7e6366b6f291ab5e4eb`;`deps/development-manager` @ `bd3a7de57a3a9e1a4495b94c5fa5c08d71e7be8c`。 - `examples/trace` 仍使用自己的 `go.mod` replace,不改为依赖 `deps/` 下的错误码副本。 - 入口与门禁:`AGENTS.md`「Agent 执行与新项目准入(强制)」、`AGENT-EXECUTION.md`(候选 `cursor-agent-stable`)、`.gitea/workflows/governance.yml`;正负例与结果记录在 `.task/feature-governance-adoption.md`。 -- 回退:通过普通 PR 恢复上一 gitlink(`26b562d2e34f`)、`.gitmodules`,并移除治理入口(`scripts/`、`.task/templates/task-card.md`、`.gitea/workflows/governance.yml`)。`AGENT-EXECUTION.md` 作为项目执行配置保留,回退时由 PR 另行处理。 +- 回退:通过普通 PR 恢复 `deps/development-guidelines` 上一 gitlink(`26b562d2e34f`)及其 `.gitmodules` 条目,移除 `deps/development-manager` gitlink 及其 `.gitmodules` 条目,并移除治理入口(`scripts/dm`、`scripts/agent-exec`、`scripts/task`、`scripts/hooks/pre-commit`、`.gitea/workflows/governance.yml`、`.task/templates/task-card.md`、`AGENT-EXECUTION.md`),还原 AGENTS.md / PROJECT.md 中追加的治理章节,并将 `.gitea/workflows/ci.yml` 两个 job 的检出步骤恢复为 `uses: actions/checkout@v4`。 -- 2.54.0 From 676a6e37dcc854673d32eebdd733e8557a1d1562 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 17 Oct 2026 08:58:46 +0000 Subject: [PATCH 10/11] docs(task): record review repair run and evidence Why: independent Review blocked the adoption; the repair unit ran through the shared executor and was integrated with agent-exec apply. Evidence: .task/evidence/governance-adoption/ (SELF): governance check and agent-exec validate on the repaired head. Impact: task card and evidence logs only. Refs: .task/feature-governance-adoption.md --- .../07-20261017T085846Z.log | 19 +++++++++++++++++++ .../08-20261017T085846Z.log | 7 +++++++ .task/feature-governance-adoption.md | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 .task/evidence/governance-adoption/07-20261017T085846Z.log create mode 100644 .task/evidence/governance-adoption/08-20261017T085846Z.log diff --git a/.task/evidence/governance-adoption/07-20261017T085846Z.log b/.task/evidence/governance-adoption/07-20261017T085846Z.log new file mode 100644 index 0000000..5ecb8f5 --- /dev/null +++ b/.task/evidence/governance-adoption/07-20261017T085846Z.log @@ -0,0 +1,19 @@ +command: scripts/dm governance check --repo . +cwd: /home/weichen/projects/Logging-System-wt-feature-governance-adoption +head: b57c1a0e0d6857432bca2bfeef63b38b5fe136b6 +exit: 0 +utc: 20261017T085846Z +--- +ok gitlink deps/development-guidelines +ok gitlink deps/development-manager +ok agent-execution +ok file AGENTS.md +ok file PROJECT.md +ok file policy/guidelines-adoption.md +ok file .task/templates/task-card.md +ok executable scripts/agent-exec +ok executable scripts/hooks/pre-commit +ok executable scripts/dm +ok executable scripts/task +ok adoption status +ok fixtures diff --git a/.task/evidence/governance-adoption/08-20261017T085846Z.log b/.task/evidence/governance-adoption/08-20261017T085846Z.log new file mode 100644 index 0000000..d9d3a44 --- /dev/null +++ b/.task/evidence/governance-adoption/08-20261017T085846Z.log @@ -0,0 +1,7 @@ +command: scripts/agent-exec validate --repo . +cwd: /home/weichen/projects/Logging-System-wt-feature-governance-adoption +head: b57c1a0e0d6857432bca2bfeef63b38b5fe136b6 +exit: 0 +utc: 20261017T085846Z +--- +validate: ok diff --git a/.task/feature-governance-adoption.md b/.task/feature-governance-adoption.md index 2c0fdfb..4a46267 100644 --- a/.task/feature-governance-adoption.md +++ b/.task/feature-governance-adoption.md @@ -29,6 +29,7 @@ | governance-adoption-Logging-System-r1 | 13 个允许路径(治理文件 + 两个 gitlink) | 31244149 | implementation | cursor→antigravity→pi | run b513506a(dm-server pinned,attempts=1) | cursor / not-observable | success | 3b355600aacf(apply 快进) | 否 | /tmp/gov-receipt-Logging-System-r1.json | | governance-adoption-Logging-System-repair-r1 | PROJECT.md、policy/guidelines-adoption.md | repair | cursor→antigravity→pi | run d1dd6ede(attempts=1) | cursor / not-observable | success | 742ffb2c7c9d(apply 快进) | 否 | /tmp/gov-receipt-Logging-System-repair-r1.json | | governance-adoption-Logging-System-repair-r2 | .gitea/workflows/ci.yml、policy/guidelines-adoption.md | repair | cursor→antigravity→pi | run 8bc2c2e6(attempts=1) | cursor / not-observable | success | 670622554482(apply 快进) | 否 | /tmp/gov-receipt-Logging-System-repair-r2.json | +| governance-adoption-Logging-System-repair-r3 | .gitea/workflows/ci.yml、policy/guidelines-adoption.md | repair | cursor→antigravity→pi | run 1b906777(attempts=1) | cursor / not-observable | success | b57c1a0e0d68(apply 快进) | 否 | /tmp/gov-receipt-Logging-System-repair-r3.json | ## 同步记录 @@ -56,3 +57,5 @@ | 2026-10-17T08:47:35Z | CI `ci / vet-and-test (pull_request)` | 01b1404d8355 | 0 | GATE | success;[运行](https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/actions/runs/3600/jobs/5695) | | 2026-10-17T08:47:35Z | CI `ci / docker-checkout-hostgateway (pull_request)` | 01b1404d8355 | 0 | GATE | success;[运行](https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/actions/runs/3600/jobs/5696) | | 2026-10-17T08:47:35Z | CI `governance / governance (pull_request)` | 01b1404d8355 | 0 | GATE | success;[运行](https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/actions/runs/3602/jobs/5698) | +| 20261017T085846Z | `scripts/dm governance check --repo .` | b57c1a0e0d68 | 0 | SELF | ok fixtures;[输出](evidence/governance-adoption/07-20261017T085846Z.log) sha256:d4952124b13adfdc | +| 20261017T085846Z | `scripts/agent-exec validate --repo .` | b57c1a0e0d68 | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/08-20261017T085846Z.log) sha256:1c11390efe49b02e | -- 2.54.0 From 917f5b6cc7a2cb7393d5f0b1edaa194e3b6bd4d7 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 17 Oct 2026 09:22:12 +0000 Subject: [PATCH 11/11] Close and archive the governance adoption card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: the adoption PR is reviewed and its candidate HEAD passed CI; the card closure is folded into the PR so no separate close PR is needed. Evidence: CI GATE on 676a6e37dcc854673d32eebdd733e8557a1d1562; independent Review REPLAY (cursor-agent-stable --mode ask 全新只读会话(fresh_session=true,session id not-observable)闭合重审 VERDICT: APPROVE(对象 676a6e3,与 HEAD 仅 .task/ 不同)). Impact: task card only (moved to .task/archive/). Refs: https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/pulls/4 --- .../feature-governance-adoption.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) rename .task/{ => archive}/feature-governance-adoption.md (77%) diff --git a/.task/feature-governance-adoption.md b/.task/archive/feature-governance-adoption.md similarity index 77% rename from .task/feature-governance-adoption.md rename to .task/archive/feature-governance-adoption.md index 4a46267..6934063 100644 --- a/.task/feature-governance-adoption.md +++ b/.task/archive/feature-governance-adoption.md @@ -1,7 +1,7 @@ # Logging-System 采纳 development-governance-v2 治理套件 任务卡 任务主记录:[Logging-System PR #4](https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/pulls/4)(本文件随 PR 描述维护)。 -状态:待合入(独立 Review 与当前 HEAD CI 通过后合入);owner:weichen。 +状态:已完成(闭合随本 PR 合入;合入以平台记录为准);owner:weichen。 ## 基线与授权 @@ -47,15 +47,17 @@ | 时间(UTC) | 命令 | 被测 HEAD | exit | 来源 | 摘要/位置 | |---|---|---|---|---|---| -| 20261017T073824Z | `scripts/dm governance check --repo .` | 3b355600aacf | 0 | SELF | ok fixtures;[输出](evidence/governance-adoption/00-20261017T073824Z.log) sha256:caf90f14cc142ed7 | -| 20261017T073824Z | `scripts/agent-exec validate --repo .` | 3b355600aacf | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/01-20261017T073824Z.log) sha256:39d7b45b3a2af043 | -| 20261017T073824Z | `python3 /tmp/gov-neg/adopt_cases.py .` | 3b355600aacf | 0 | SELF | [verdict] ALL PASS cases=5;[输出](evidence/governance-adoption/02-20261017T073824Z.log) sha256:84a4b7528fd2a932 | -| 20261017T084130Z | `scripts/dm governance check --repo .` | 742ffb2c7c9d | 0 | SELF | ok fixtures;[输出](evidence/governance-adoption/03-20261017T084130Z.log) sha256:c5a1a532588e5219 | -| 20261017T084130Z | `scripts/agent-exec validate --repo .` | 742ffb2c7c9d | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/04-20261017T084130Z.log) sha256:4135b4ee9fa8ff49 | -| 20261017T084644Z | `scripts/dm governance check --repo .` | 670622554482 | 0 | SELF | ok fixtures;[输出](evidence/governance-adoption/05-20261017T084644Z.log) sha256:9fa960ad4417bb71 | -| 20261017T084644Z | `scripts/agent-exec validate --repo .` | 670622554482 | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/06-20261017T084644Z.log) sha256:df6671799eaa44b1 | +| 20261017T073824Z | `scripts/dm governance check --repo .` | 3b355600aacf | 0 | SELF | ok fixtures;[输出](../evidence/governance-adoption/00-20261017T073824Z.log) sha256:caf90f14cc142ed7 | +| 20261017T073824Z | `scripts/agent-exec validate --repo .` | 3b355600aacf | 0 | SELF | validate: ok;[输出](../evidence/governance-adoption/01-20261017T073824Z.log) sha256:39d7b45b3a2af043 | +| 20261017T073824Z | `python3 /tmp/gov-neg/adopt_cases.py .` | 3b355600aacf | 0 | SELF | [verdict] ALL PASS cases=5;[输出](../evidence/governance-adoption/02-20261017T073824Z.log) sha256:84a4b7528fd2a932 | +| 20261017T084130Z | `scripts/dm governance check --repo .` | 742ffb2c7c9d | 0 | SELF | ok fixtures;[输出](../evidence/governance-adoption/03-20261017T084130Z.log) sha256:c5a1a532588e5219 | +| 20261017T084130Z | `scripts/agent-exec validate --repo .` | 742ffb2c7c9d | 0 | SELF | validate: ok;[输出](../evidence/governance-adoption/04-20261017T084130Z.log) sha256:4135b4ee9fa8ff49 | +| 20261017T084644Z | `scripts/dm governance check --repo .` | 670622554482 | 0 | SELF | ok fixtures;[输出](../evidence/governance-adoption/05-20261017T084644Z.log) sha256:9fa960ad4417bb71 | +| 20261017T084644Z | `scripts/agent-exec validate --repo .` | 670622554482 | 0 | SELF | validate: ok;[输出](../evidence/governance-adoption/06-20261017T084644Z.log) sha256:df6671799eaa44b1 | | 2026-10-17T08:47:35Z | CI `ci / vet-and-test (pull_request)` | 01b1404d8355 | 0 | GATE | success;[运行](https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/actions/runs/3600/jobs/5695) | | 2026-10-17T08:47:35Z | CI `ci / docker-checkout-hostgateway (pull_request)` | 01b1404d8355 | 0 | GATE | success;[运行](https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/actions/runs/3600/jobs/5696) | | 2026-10-17T08:47:35Z | CI `governance / governance (pull_request)` | 01b1404d8355 | 0 | GATE | success;[运行](https://git-home.u1680832.nyat.app:30319/weichen/Logging-System/actions/runs/3602/jobs/5698) | -| 20261017T085846Z | `scripts/dm governance check --repo .` | b57c1a0e0d68 | 0 | SELF | ok fixtures;[输出](evidence/governance-adoption/07-20261017T085846Z.log) sha256:d4952124b13adfdc | -| 20261017T085846Z | `scripts/agent-exec validate --repo .` | b57c1a0e0d68 | 0 | SELF | validate: ok;[输出](evidence/governance-adoption/08-20261017T085846Z.log) sha256:1c11390efe49b02e | +| 20261017T085846Z | `scripts/dm governance check --repo .` | b57c1a0e0d68 | 0 | SELF | ok fixtures;[输出](../evidence/governance-adoption/07-20261017T085846Z.log) sha256:d4952124b13adfdc | +| 20261017T085846Z | `scripts/agent-exec validate --repo .` | b57c1a0e0d68 | 0 | SELF | validate: ok;[输出](../evidence/governance-adoption/08-20261017T085846Z.log) sha256:1c11390efe49b02e | +| — | 候选 HEAD CI | 676a6e37dcc8 | 0 | GATE | success ci / vet-and-test (pull_request)=success(/weichen/Logging-System/actions/runs/3623/jobs/5724);ci / docker-checkout-hostgateway (pull_request)=success(/weichen/Logging-System/actions/runs/3623/jobs/5725);governance / governance (pull_request)=success(/weichen/Logging-System/actions/runs/3624/jobs/5726) | +| — | 独立 Review | 676a6e37dcc8 | 0 | REPLAY | cursor-agent-stable --mode ask 全新只读会话(fresh_session=true,session id not-observable)闭合重审 VERDICT: APPROVE(对象 676a6e3,与 HEAD 仅 .task/ 不同) | -- 2.54.0