atlas-project-harness 0.4.0-beta.2 → 0.4.0-beta.3

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/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@
4
4
 
5
5
  ---
6
6
 
7
+ ## [v0.4.0-beta.3] - 2026-11-20
8
+
9
+ ### 🧭 只读上下文预览
10
+
11
+ * 新增 `atlas workflow context`:按文件路径打印会注入的结构规范与约定,只读、不写盘、不改任务状态;
12
+ * `--paths`(改动文件/目录,可多个)与 `--unit`(读任务卡 `paths` / `affected_domains`)二选一,都没有时 exit 2;`--json` 输出命中清单,便于脚本消费;
13
+ * 显式 `--paths` 不回落 `tour.md`,与 `dispatch` 的注入口径一致;
14
+ * 约定规范的排序改为只按**实际命中**的 glob 计具体度:通用指南列了更多目录,也不会挤掉对口的领域约定(如改前端时优先 `conventions/frontend/` 而非 `conventions/guides/`)。
15
+
16
+ ### 🧷 项目接线
17
+
18
+ * `.gitignore` 接线新增 `.atlas` 白名单块:默认 `.atlas/*` 忽略引擎镜像,`!.atlas/tasks/`、`!.atlas/spec/` 放行项目规范与任务账本;带标记幂等,用户已手写任意 `.atlas` 规则时保留其口径不覆盖。
19
+
20
+ ---
21
+
7
22
  ## [v0.4.0-beta.2] - 2026-11-20
8
23
 
9
24
  ### 🧭 执行层最小上下文注入
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Atlas — 践行 Project Harness 的全流程 AI 编程工作流
2
2
 
3
3
  <p align="left">
4
- <img src="https://img.shields.io/badge/version-0.4.0--beta.2-blue.svg" alt="Version" />
4
+ <img src="https://img.shields.io/badge/version-0.4.0--beta.3-blue.svg" alt="Version" />
5
5
  <img src="https://img.shields.io/badge/license-Apache--2.0-blue.svg" alt="License" />
6
6
  <img src="https://img.shields.io/badge/tests-passing-success.svg" alt="Tests" />
7
7
  <a href="https://sunwenzhe-git.github.io/atlas/"><img src="https://img.shields.io/badge/docs-VitePress-green.svg" alt="Docs" /></a>
@@ -122,7 +122,7 @@ NBER(美国国家经济研究局)2026 年工作论文 35275 追踪了超过
122
122
  1. **项目级(应然资产层)**:定义“这个系统是什么、长什么样、怎么算做对”。包含**结构事实**(适配器 AST / 正则逆向抽取;图谱为可选文件枚举增强)、**项目级 PRD**(业务规则单源)、**E2E 验收用例**(真实靶场可证伪用例),以及跨需求生效的**架构决策记录**(`<资产根>/adr/NNNN-<slug>.md`,默认 `product/adr/...`)。
123
123
  2. **需求级(小需求执行层)**:定义“这次改动改什么、怎么写代码”。由内置的 **`atlas workflow`** 执行层承担,Atlas 本身**不侵入业务代码实现**。
124
124
  3. **`apply` 单向衔接**:需求在进入实现前,先由 Agent 唤起 `atlas-apply <需求ID>` 技能将需求增量合并入项目级应然资产,坚决杜绝“先写代码、事后补文档”的失控循环。
125
- 4. **执行层命令**:`atlas workflow plan --unit <ID> [--paths <glob...>]`(建卡)→ `atlas workflow dispatch [--paths <file...>]`(出派工单 + 按 `paths:` 只注入命中的结构事实与约定规范)→ `atlas workflow verify --unit <ID>`(独立审查)→ `atlas workflow finish --unit <ID>`(收口);`atlas workflow status` / `atlas workflow run` 负责查账与串联。任务账本落 `.atlas/tasks/`。
125
+ 4. **执行层命令**:`atlas workflow plan --unit <ID> [--paths <glob...>]`(建卡)→ `atlas workflow dispatch [--paths <file...>]`(出派工单 + 按 `paths:` 只注入命中的结构事实与约定规范)→ `atlas workflow verify --unit <ID>`(独立审查)→ `atlas workflow finish --unit <ID>`(收口);`atlas workflow status` / `atlas workflow run` 负责查账与串联;中途范围变化时用只读的 `atlas workflow context --paths <file...>` 预览命中规范(不写盘、不改状态)。任务账本落 `.atlas/tasks/`。
126
126
 
127
127
  ### 2. 核心武器库:三环资产体系(Rings)
128
128
 
@@ -263,9 +263,15 @@ def _hit(path: str, glob: str) -> bool:
263
263
  return False
264
264
 
265
265
 
266
- def _specificity(spec: dict) -> int:
267
- """最长非兜底 glob 越具体,越优先。"""
268
- concrete = [len(g) for g in spec["paths"] if not _is_wildcard(g)]
266
+ def _specificity(spec: dict, scopes: list[str] | None = None) -> int:
267
+ """命中的最长非兜底 glob 越具体,越优先。
268
+
269
+ 限定只计**实际命中**的 glob:一份通用指南列了很多目录时,不得凭一条更长的
270
+ 无关 glob 挤掉真正对口的领域约定。
271
+ """
272
+ concrete = [len(_norm_glob(g)) for g in spec["paths"]
273
+ if not _is_wildcard(g)
274
+ and (scopes is None or any(_hit(p, g) for p in scopes))]
269
275
  return max(concrete, default=0)
270
276
 
271
277
 
@@ -310,7 +316,7 @@ def select_specs(root: Path, paths: list[str] | None = None,
310
316
  hits = [s for s in specs
311
317
  if not _is_wildcard_only(s)
312
318
  and any(_hit(p, g) for p in scopes for g in s["paths"])]
313
- hits.sort(key=lambda s: (-_specificity(s), s["rel"]))
319
+ hits.sort(key=lambda s: (-_specificity(s, scopes), s["rel"]))
314
320
  structure = [s for s in hits if not _is_conventions(s)]
315
321
  conventions = [s for s in hits if _is_conventions(s)]
316
322
  if structure:
package/bin/atlas.js CHANGED
@@ -26,7 +26,7 @@ Atlas — 践行 Project Harness 的全流程 AI 编程工作流治理引擎
26
26
  update 安全刷新当前项目中的 .atlas/ 工程线束与平台 Skills 至最新版本
27
27
  upgrade 自动拉取 npm 最新全局包升级全局 Atlas CLI
28
28
  check 运行项目级资产与门禁全套检查
29
- workflow 自建全流程执行层调度(plan / dispatch / verify / finish / run)
29
+ workflow 自建全流程执行层调度(plan / dispatch / context / verify / finish / status / run)
30
30
  solution 多仓方案层:init / adopt / status / check / lock / task(Phase 1 仅 federated)
31
31
  review 实例⑤实现代码独立审查一键编排(preview → CLI review → scope → convert → validate → closure)
32
32
  eval 消融对照跑分器(run:两 commit 对照出 ledger;gate:回归判定)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atlas-project-harness",
3
- "version": "0.4.0-beta.2",
3
+ "version": "0.4.0-beta.3",
4
4
  "description": "践行 Project Harness 的全流程 AI 编程工作流治理引擎",
5
5
  "bin": {
6
6
  "atlas": "bin/atlas.js"
@@ -15,12 +15,16 @@
15
15
  3. `<项目根>/.pi/`(仅 pi 宿主):把官方扩展落到 `.pi/extensions/atlas/index.ts`,
16
16
  并在 `.pi/settings.json` 的 `extensions[]` 里幂等登记一行(2026-10-15 补)。
17
17
 
18
- 4. `<项目根>/.gitignore`(仅已存在时):幂等追加一行 `.adapter-out/`(2026-10-15 补)。
19
- issue #8 后 atlas 全部中间产物统一落项目根该目录(适配器输出 / 漂移标记 /
20
- 图谱新鲜度标记),不忽略则 `git status` 常驻未跟踪噪声——**对所有接线项目成立**,
21
- 不只图谱用户。判据:文件**不存在 ⇒ 不首创**(跳过并在报告里给一行建议);
22
- 内容已含 `.adapter-out` 字样 ⇒ 幂等跳过;出现 `!.adapter-out` 负模式 ⇒ 跳过,
23
- 不与用户既有规则打架。**本触点无退役对称**:`.gitignore` 不是本项目创建的文件,
18
+ 4. `<项目根>/.gitignore`(仅已存在时):幂等追加两类默认规则(2026-10-15 补)。
19
+ `.adapter-out/`:issue #8 后 atlas 全部中间产物统一落项目根该目录(适配器输出 /
20
+ 漂移标记 / 图谱新鲜度标记),不忽略则 `git status` 常驻未跟踪噪声——**对所有接线项目成立**,
21
+ 不只图谱用户。
22
+ `.atlas` 白名单:装配包本身是 `atlas update` 会整包刷新的镜像,不入库;项目自产的
23
+ `.atlas/spec/`(规范)与 `.atlas/tasks/`(任务账本)必须入库。
24
+ 判据:文件**不存在 ⇒ 不首创**(跳过并在报告里给建议行);
25
+ 内容已含 `.adapter-out` 字样 ⇒ 幂等跳过;出现 `!.adapter-out` 负模式 ⇒ 跳过;
26
+ atlas 块已含标记 ⇒ 幂等跳过;用户已写任意 `.atlas` 规则 ⇒ 保留用户口径。
27
+ **本触点无退役对称**:`.gitignore` 不是本项目创建的文件,
24
28
  追加后永不回收(与 extractor 配置的「逐字节相等才清」不同——追加是单向动作,
25
29
  由报告行当刻告知用户)。
26
30
 
@@ -99,32 +103,65 @@ def wire_agents(target: Path) -> dict:
99
103
  # ----------------------------------------------------------------- .gitignore 兜底(2026-10-15 补,第 4 个触点)
100
104
 
101
105
  GITIGNORE_REL = ".gitignore"
102
- ADAPTER_OUT_LINE = ".adapter-out/"
106
+ ADAPTER_OUT_ENTRY = ".adapter-out/\n"
107
+ ADAPTER_OUT_KEY = ".adapter-out"
108
+
109
+ # atlas 装配包默认忽略口径:引擎镜像不入库,项目产出(规范 + 任务账本)入库。
110
+ ATLAS_IGNORE_MARKER = "# atlas:装配包不入库"
111
+ ATLAS_IGNORE_BLOCK = (
112
+ ATLAS_IGNORE_MARKER + ";规范与任务账本入库(install.py 幂等维护)\n"
113
+ ".atlas/*\n"
114
+ "!.atlas/tasks/\n"
115
+ "!.atlas/spec/\n"
116
+ )
117
+ ATLAS_RULE_RE = re.compile(r"^\s*!?\.atlas(?:/|\*|\s|$)", re.M)
103
118
 
104
119
 
105
120
  def wire_gitignore(target: Path) -> dict:
106
- """`.gitignore` 追加 `.adapter-out/`(issue #8 后所有接线项目都需要,不只图谱用户)。
121
+ """`.gitignore` 幂等追加两类默认规则:`.adapter-out/` 与 `.atlas` 白名单。
122
+
123
+ `.adapter-out/`:issue #8 后所有接线项目都需要(适配器输出 / 漂移标记),
124
+ 不忽略则 `git status` 常驻未跟踪噪声。
125
+ `.atlas` 块:装配包是整包镜像(`atlas update` 刷新),不入库;项目自产的
126
+ `.atlas/spec/`(规范)与 `.atlas/tasks/`(任务账本)必须入库。
107
127
 
108
- 三条判据(缺失即跳过并显式说明,不猜):
128
+ 判据(缺失即跳过并显式说明,不猜):
109
129
  * 文件**不存在 ⇒ 不首创**——根 `.gitignore` 是用户自有文件,本脚手不替用户从零创建,
110
130
  只在报告里给出建议行;
111
- * 内容已含 `.adapter-out` **子串** ⇒ 已忽略,幂等跳过(子串判据兼容
112
- `.adapter-out`、`.adapter-out/*` 等一切等价写法);
113
- * 出现 `!.adapter-out` 负模式 ⇒ 意见相反,跳过不与用户打架。
131
+ * `.adapter-out` 已含子串 ⇒ 幂等跳过;出现 `!.adapter-out` 负模式 ⇒ 跳过,不打架;
132
+ * atlas 块已含标记 ⇒ 幂等跳过;用户已写任意 `.atlas` 规则 ⇒ 保留用户口径,跳过该块。
114
133
  """
115
134
  path = target / GITIGNORE_REL
116
135
  if not path.is_file():
117
136
  return {"file": GITIGNORE_REL, "status": "skipped",
118
- "detail": f"无 {GITIGNORE_REL} ⇒ 不首创(建议手动加一行 {ADAPTER_OUT_LINE})"}
137
+ "detail": (f"无 {GITIGNORE_REL} ⇒ 不首创(建议手动加 "
138
+ f"`.adapter-out/`、`.atlas/*`、`!.atlas/tasks/`、`!.atlas/spec/`)")}
119
139
  text = path.read_text(encoding="utf-8")
120
- if "!" + ADAPTER_OUT_LINE.rstrip("/") in text:
121
- return {"file": GITIGNORE_REL, "status": "skipped",
122
- "detail": "存在 !.adapter-out 负模式 ⇒ 不与用户既有规则打架"}
123
- if ADAPTER_OUT_LINE.rstrip("/") in text:
124
- return {"file": GITIGNORE_REL, "status": "skipped", "detail": "已忽略 .adapter-out"}
125
- new_text = (text if text.endswith("\n") else text + "\n") + ADAPTER_OUT_LINE + "\n"
140
+ additions: list[str] = []
141
+ labels: list[str] = []
142
+ notes: list[str] = []
143
+
144
+ if "!" + ADAPTER_OUT_KEY in text:
145
+ notes.append("存在 !.adapter-out 负模式 ⇒ 不与用户既有规则打架")
146
+ elif ADAPTER_OUT_KEY in text:
147
+ notes.append("已忽略 .adapter-out")
148
+ else:
149
+ additions.append(ADAPTER_OUT_ENTRY)
150
+ labels.append(".adapter-out/")
151
+
152
+ if ATLAS_IGNORE_MARKER in text:
153
+ notes.append("已含 atlas 忽略块")
154
+ elif ATLAS_RULE_RE.search(text):
155
+ notes.append("已有 .atlas 规则 ⇒ 保留用户口径")
156
+ else:
157
+ additions.append(ATLAS_IGNORE_BLOCK)
158
+ labels.append(".atlas 白名单")
159
+
160
+ if not additions:
161
+ return {"file": GITIGNORE_REL, "status": "skipped", "detail": ";".join(notes)}
162
+ new_text = (text if text.endswith("\n") else text + "\n") + "".join(additions)
126
163
  return {"file": GITIGNORE_REL, "status": "applied",
127
- "detail": "appended .adapter-out/ (atlas 中间产物单一位点,issue #8)",
164
+ "detail": ";".join(notes + ["appended " + " + ".join(labels)]),
128
165
  "_write": (path, new_text)}
129
166
 
130
167
 
@@ -38,6 +38,7 @@ from _support.workflow_dispatch import ( # noqa: E402
38
38
  from _support.workflow_finish import ( # noqa: E402
39
39
  finish_task, check_task_review_passed, FinishError
40
40
  )
41
+ from _support.workflow_context import select_specs, render_specs # noqa: E402
41
42
 
42
43
 
43
44
  def die(msg: str, code: int = 2) -> int:
@@ -177,6 +178,40 @@ def cmd_dispatch(args: argparse.Namespace, root: Path) -> int:
177
178
  return 0
178
179
 
179
180
 
181
+ def cmd_context(args: argparse.Namespace, root: Path) -> int:
182
+ """只读查询:按文件路径打印命中的结构规范,不写盘、不改状态。"""
183
+ scope = [str(p) for p in (args.paths or []) if str(p).strip()]
184
+ domains: list[str] = []
185
+
186
+ if not scope:
187
+ if not args.unit:
188
+ return die("至少提供 --paths 或 --unit")
189
+ tasks_dir = _read_tasks_root(root)
190
+ task = next((t for t in load_tasks(tasks_dir) if t["id"] == args.unit), None)
191
+ if not task:
192
+ return die(f"未找到任务卡 {args.unit}")
193
+ if isinstance(task.get("paths"), list):
194
+ scope = [str(p) for p in task["paths"] if str(p).strip()]
195
+ raw_domains = task.get("affected_domains")
196
+ if isinstance(raw_domains, str):
197
+ raw_domains = [raw_domains]
198
+ domains = [str(d) for d in (raw_domains or []) if str(d).strip()]
199
+
200
+ specs = select_specs(root, paths=scope or None, domains=domains)
201
+
202
+ if args.json:
203
+ print(json.dumps({
204
+ "paths": scope,
205
+ "specs": [{"rel": s["rel"], "paths": s["paths"]} for s in specs],
206
+ }, ensure_ascii=False, indent=2))
207
+ return 0
208
+
209
+ print("只读预览:未写盘、未改状态;正式开工请用 `atlas workflow dispatch`。")
210
+ print()
211
+ print(render_specs(specs, scope_paths=scope, domains=domains))
212
+ return 0
213
+
214
+
180
215
  def _next_review_round(root: Path, unit: str) -> int:
181
216
  """同 (unit, round) 的 findings 不得覆盖(骨架 §4):按已有轮次自动递增。"""
182
217
  findings = (root / "product" / "reviews"
@@ -357,7 +392,12 @@ def main() -> int:
357
392
  p_disp.add_argument("--paths", nargs="+", default=None,
358
393
  help="改动路径/目录(按 paths: 索引只注入命中的规范;缺省读任务卡)")
359
394
 
360
- # verify
395
+ # context
396
+ p_ctx = sub.add_parser("context", parents=[common],
397
+ help="只读查询:按文件路径查看命中的结构规范(不写盘、不改状态)")
398
+ p_ctx.add_argument("--paths", nargs="+", default=None, help="改动文件/目录(可多个)")
399
+ p_ctx.add_argument("--unit", help="从任务卡取改动路径/受影响域(无 --paths 时生效)")
400
+
361
401
  p_ver = sub.add_parser("verify", help="对当前暂存区运行独立审查与测试并轨", parents=[common])
362
402
  p_ver.add_argument("--unit", required=True, help="被检验的任务标识")
363
403
  p_ver.add_argument("--staged", action="store_true", default=True, help="审查暂存区(默认开启)")
@@ -391,6 +431,7 @@ def main() -> int:
391
431
  dispatch_map = {
392
432
  "plan": cmd_plan,
393
433
  "dispatch": cmd_dispatch,
434
+ "context": cmd_context,
394
435
  "verify": cmd_verify,
395
436
  "finish": cmd_finish,
396
437
  "status": cmd_status,
package/shared/gates.md CHANGED
@@ -94,7 +94,7 @@
94
94
  |---|---|---|---|---|---|
95
95
  | `install.py` 自检(**〔数:自检声明=70〕 条 `c()` 声明**;含 skill 循环;2026-10-23 D143 +`_support/manual_block.py`;2026-10-26 D153 +`_support/ac_coverage.py`;2026-11-04 RFC-20261104-01 S1 +`_support/evidence_archive.py`) | 装配动作 ⇔ 包内件 | `[机器]` 它声称会落下的每个文件是否真的落下 | 包内件**该不该存在**(那是下面那道门);副本侧无 `install.sh` ⇒ 本项不适用 | **新项目开户时**(最晚 = 开户那一刻,否则开户失败) | `出厂级(本轮实测)`:修前空目录装配实测 `exit 1` + 4 条 `[FAIL]`(`3509 §112`;2026-10-05 图谱批 1 复核计数,顺带修复 `$PATCH_DIR` 未定义变量在 `set -u` 下的必炸;2026-10-12 单源批 +4:共享内核 ×3 + 回灌助手;2026-10-15 +1:`extensions/` 纳入装配 ⇒ pi 宿主扩展;2026-10-17 两枚——+`_support/pw_runner.py`(新件,issue #24)**与 +`_support/case_id.py`(存量漏登记的包内件——它一直在装配面上、却不在自检清单里,issue #24 同批顺手补上)**;2026-10-21 D129 +1:`_support/review_policy.py`(审查策略单源内核——**新件即登记**,不重演 `case_id.py` 那种「在装配面上、却不在自检清单里」的漏);同批 +1:`templates/reviews/README.md`(按域审查指引模板——`independent-review.md` §10.5 已引用它,引用面必须随包在);2026-11-03 +1:`scripts/run_python.js`(钩子平台中立启动器,RFC-20261103-04 §6)) |
96
96
  | `tests/test_install_selfcheck.py` | 装配面 ⇔ 包面 ⇔ 契约面 | `[机器]` ① 自检引用存在 ② 骨架不含已退役目录(口径 = `layout.md` 的「已退役」标记)③ skill 瘦桩的 `.atlas/` 引用可达(源包与副本两种态都跑)④ `$var` 紧邻非 ASCII 必须写 `${var}` ⑤ **环退役对称**(`rings/<r>/reference.md` ⇔ `skills/atlas-<r>/`;非环 skill 白名单 = apply / design-review / grill / release / onegate / ablate)⑥ **首建提示**(`say` 行:无退役环名残留 `原型` / `prototype` + 存量 `atlas-apply adopt` 与全新 `atlas-apply all` 两条开户入口齐备) | 契约正文的**语义**是否自洽(那是 2.6 的文档面,仍属缺口);提示的**措辞好坏**(只判「退役名 / 入口缺没缺」,判不了读起来顺不顺) | 改任一包内件 / 瘦桩 / 骨架 / 增删环时(含改 `install.sh` 的用户可见输出) | `出厂级(本轮实测)`:M1–M4(`3509 §112`)+ **M5/M6**(幽灵环 / 幽灵瘦桩,`3509 §115`)+ **M50**(2026-10-15 首建提示:a 把退役环的历史括注回填进 `say` 行 ⇒ 红 / b 抹掉 `atlas-apply adopt` 入口 ⇒ 红;两片注入前锚点断言恰好命中、还原后逐字节复绿)+ **F54/F55**(2026-10-16,issue #21/#22,`DESIGN.md` D92/D93:子进程集成各 +1 条= **M77** 摘干跑闸 ⇒ `test_f54_…` 红 / **M78** 未跟踪桶改指脏桶 ⇒ `test_f55_…` 前半红(后半为 F34 回归钉);两枚还原逐字节一致;F34 的拒路径文案逐字节保留,旧钉一并回归绿) |
97
- | `patches/project-wiring/apply-wiring.py`(项目接线:AGENTS.md 指针 / 测试配置兜底(由 extractor 提供 hook) / `.gitignore` 追加 `.adapter-out/` / pi 宿主扩展;2026-10-15 补登记——此前**不在门面**,故它往用户仓库里写入的动静无门可查) | 目标仓库的四个接线触点 ⇔ 源包片段 | `[机器]` 四件各自幂等(重跑字节不变;指针段按 `ATLAS:START/END` 整段替换);**测试配置探测只认声明**(注释不算——出厂模板的 `backend_test:` 是注释示例);误建的测试配置走退役对称清理(仅当内容**逐字节相等**于兜底内容);**`.gitignore` 触点(第 4,2026-10-15,issue #8)**:文件**存在才追加**一行 `.adapter-out/`、`.adapter-out` 子串幂等、`!.adapter-out` 负模式跳过(不与用户规则打架)、无文件不首创;**无退役对称**(`.gitignore` 不是本项目建的文件,追加单向不回收——盲区明示);pi 扩展**只插一行**进 `extensions[]` 且插入后 JSON 合法、缺数组/空数组一律跳过不猜 | 这次写入**该不该发生**(判据本身错 ⇒ 会把不该有的文件写进用户仓库,2026-10-15 存量事故即此;「写对了没有」归各触点各自的语义);指针正文的措辞;(`extensions/pi.ts` 的**运行时语义**已由执行级判据覆盖(挂假宿主跑真扩展,见末条),无 `bun` 的机器降级为形态钉) | 每次 `atlas init`(`install.py` 第 5 步)与 `atlas update` | `出厂级(2026-10-15 实测)`:`tests/test_apply_wiring.py` **〔数:用例数.test_apply_wiring.py=22〕 条** + `tests/test_project_wiring.py` **〔数:用例数.test_project_wiring.py=8〕 条**;**M51a** 探测退回 raw 文本匹配 ⇒ 模板夹具回归红 / **M51b** 摘「内容相等」护栏 ⇒ 误删用户文件的钉子红(两片还原后逐字节复绿);**M65**(2026-10-15)摘 `.gitignore` 触点 ⇒ `test_gitignore_fifth_touchpoint_appends_idempotently` 红(还原逐字节一致);`pi.ts` 侧 = **执行级**(假宿主跑真扩展:三开户态各自的提示注入 / `--fast` 闸 / 失败签名去重——新增/变化才提示、复读静默、首轮静默建基线(issue #67)/ `/atlas status` 输出;无 `bun` ⇒ 显式 skip、不是通过)+ 形态片段钉 |
97
+ | `patches/project-wiring/apply-wiring.py`(项目接线:AGENTS.md 指针 / 测试配置兜底(由 extractor 提供 hook) / `.gitignore` 追加 `.adapter-out/` 与 `.atlas` 白名单 / pi 宿主扩展;2026-10-15 补登记——此前**不在门面**,故它往用户仓库里写入的动静无门可查) | 目标仓库的四个接线触点 ⇔ 源包片段 | `[机器]` 四件各自幂等(重跑字节不变;指针段按 `ATLAS:START/END` 整段替换);**测试配置探测只认声明**(注释不算——出厂模板的 `backend_test:` 是注释示例);误建的测试配置走退役对称清理(仅当内容**逐字节相等**于兜底内容);**`.gitignore` 触点(第 4,2026-10-15,issue #8)**:文件**存在才追加**一行 `.adapter-out/`、`.adapter-out` 子串幂等、`!.adapter-out` 负模式跳过(不与用户规则打架)、无文件不首创;**2026-11-20 扩充 `.atlas` 白名单块**:`.atlas/*` + `!.atlas/tasks/` + `!.atlas/spec/`(引擎镜像不入库、规范与账本入库),带标记幂等,用户已手写任意 `.atlas` 规则 ⇒ 保留口径不覆盖;**无退役对称**(`.gitignore` 不是本项目建的文件,追加单向不回收——盲区明示);pi 扩展**只插一行**进 `extensions[]` 且插入后 JSON 合法、缺数组/空数组一律跳过不猜 | 这次写入**该不该发生**(判据本身错 ⇒ 会把不该有的文件写进用户仓库,2026-10-15 存量事故即此;「写对了没有」归各触点各自的语义);指针正文的措辞;(`extensions/pi.ts` 的**运行时语义**已由执行级判据覆盖(挂假宿主跑真扩展,见末条),无 `bun` 的机器降级为形态钉) | 每次 `atlas init`(`install.py` 第 5 步)与 `atlas update` | `出厂级(2026-10-15 实测)`:`tests/test_apply_wiring.py` **〔数:用例数.test_apply_wiring.py=23〕 条** + `tests/test_project_wiring.py` **〔数:用例数.test_project_wiring.py=8〕 条**;**M51a** 探测退回 raw 文本匹配 ⇒ 模板夹具回归红 / **M51b** 摘「内容相等」护栏 ⇒ 误删用户文件的钉子红(两片还原后逐字节复绿);**M65**(2026-10-15)摘 `.gitignore` 触点 ⇒ `test_gitignore_fifth_touchpoint_appends_idempotently` 红(还原逐字节一致);`pi.ts` 侧 = **执行级**(假宿主跑真扩展:三开户态各自的提示注入 / `--fast` 闸 / 失败签名去重——新增/变化才提示、复读静默、首轮静默建基线(issue #67)/ `/atlas status` 输出;无 `bun` ⇒ 显式 skip、不是通过)+ 形态片段钉 |
98
98
 
99
99
  ### 2.4 运行期门(生成物内的检查)
100
100