Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,15 @@ Consequences:
## Verification

- Rust changes require focused `cargo test` coverage plus the relevant integration-contract checks.
- Run `code-intel lint hardcoded-paths` before pushing (issue #275: the Rust
implementation replaced `legacy/tools/check-hardcoded-paths.ps1`). It scans tracked
`.ps1`/`.psm1`/`.md`/`.yml` for machine-specific paths, and it strips
- Run `code-intel lint hardcoded-paths` before pushing (issue #275). It scans tracked
`.md`/`.yml` and other text files for machine-specific paths, and it strips
`$env:VAR` references before matching. So naming one of the scanned Windows
user-directory variables bare — in **prose or a comment**, not just in code —
fails the scan, while the `$env:`-prefixed form passes. Always write the
`$env:` form, including in comments and documentation.
On a host that cannot build the checkout (DR-0013 / #403) and whose installed
release predates the command (0.7.1 lacks it), do not substitute the retired
PowerShell script: CI runs the same scan on every PR in all three
release predates the command (0.7.1 lacks it), do not substitute a hand-rolled
scan: CI runs the same scan on every PR in all three
`cross-platform-smoke` lanes ("Hardcoded path scan"). The first release that
ships the command is the prerelease `v0.7.2-beta.6`; installing it is not
compiling, but per the Skill's install rules it needs the owner's explicit
Expand All @@ -76,12 +75,11 @@ Consequences:
assertion. Re-sync those pins **once, after every other edit**, by literal
string replacement — never by reserializing the JSON. Several of those files
are historical attestations whose formatting and unrelated digests must not
move, and a pin can chain: editing `legacy/run-code-intel.ps1` to update a digest it
quotes changes `legacy/run-code-intel.ps1`'s own pinned digest too.
move, and a pin can chain: editing a pinned file to update a digest it
quotes changes that file's own pinned digest too.
- MoonBit experiments require `moon test` and parity fixtures against the current artifact contract before promotion.
- New documentation and command examples must lead with the compiled `code-intel` CLI. Do not
document PowerShell as an operational prerequisite; mention it only when identifying a retained
compatibility fixture or migration boundary.
document PowerShell as a prerequisite or an entry point; it is gone from the product (DR-0018).

## While writing code

Expand Down
2 changes: 1 addition & 1 deletion CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ _Avoid_: Project commitment, approved roadmap, generated backlog as fact
_Avoid_: LLM plan, draft roadmap, inferred priority

**Scanner**: The authoritative producer of a new artifact run for a target repository. The scanner gathers current evidence and writes the reports that other components read.
_Avoid_: PowerShell runner, Rust scanner, artifact reader
_Avoid_: Rust scanner, artifact reader

**Resume CLI**: A command-line reader for existing artifact runs. It does not produce fresh repository evidence and does not replace the scanner.
_Avoid_: Rust scanner, new pipeline, replacement scanner
Expand Down
39 changes: 5 additions & 34 deletions docs/INVENTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ log) if a fresh inventory is needed. Columns: `path` (current location), `class`
Verification method: every `one-shot` disposition below was confirmed against a primary source
(status.json, orchestration schema, or checked implementation) before moving, not from filename
pattern alone — see TASK_REPORT.md for the cases where the obvious pattern match was wrong
(7 of 8 `compatibility-retire-*` docs turned out to still be blocked/live, not completed).
(7 of 8 `compatibility-retire-*` docs turned out to still be blocked/live, not completed; those docs and `docs/ps1-exit/` were later deleted with the PowerShell removal, DR-0018).

## ADRs — permanent records (untouched per spec)

Expand Down Expand Up @@ -58,38 +58,12 @@ pattern alone — see TASK_REPORT.md for the cases where the obvious pattern mat
| docs/archive/plans/understanding-quadrant-complexity-idea.md | one-shot | archived | Refactor done: staged a01/a03 helper tests exist |
| docs/archive/plans/v0.3.0-release-bootstrap-and-layout-idea.md | one-shot | archived | v0.3.0 shipped; repo now v0.7.0-beta.2 |

## Moved this sweep: one-shot compatibility retirement (executed)

| path | class | disposition | reason |
| --- | --- | --- | --- |
| docs/compatibility-retire-doctor-wrapper-branch.md | living-contract | kept (restored) | E09 packet reconciliation pins this path as evidence; packets freeze paths even after retired=true |

## Kept: implemented plan retained as a living contract (do not archive)

| path | class | disposition | reason |
| --- | --- | --- | --- |
| docs/plans/adr-0010-execution-plan.md | living-contract | kept | Status "implemented; superseded as an execution plan"; retained because 3 live files cite it |

## Kept: compatibility retirement tickets still blocked (7 of 8 — verified via status.json, not archived)

| path | class | disposition | reason |
| --- | --- | --- | --- |
| docs/compatibility-retire-codenexus-direct-branch.md | living-contract | kept | E04 status.json: decision=blocked, not retired |
| docs/compatibility-retire-hospital-branch.md | living-contract | kept | E08 status.json: decision=blocked, not retired |
| docs/compatibility-retire-index-branch.md | living-contract | kept | E10 status.json: decision=blocked, not retired |
| docs/compatibility-retire-native-code-branch.md | living-contract | kept | E07 status.json: decision=blocked, not retired |
| docs/compatibility-retire-provider-preflight-branch.md | living-contract | kept | E03 status.json: decision=blocked, not retired |
| docs/compatibility-retire-publication-branch.md | living-contract | kept | E05 status.json: decision=blocked, not retired |
| docs/compatibility-retire-recommender-branch.md | living-contract | kept | E02 status.json: decision=blocked, not retired |

## Kept: PS1-exit migration docs (all directly cited by live Rust source)

| path | class | disposition | reason |
| --- | --- | --- | --- |
| docs/ps1-exit/contract-inventory.md | living-contract | kept | Companion doc to live parity-observe.yml harness |
| docs/ps1-exit/t2-dot-source-parity-map.md | living-contract | kept | Cited by crates/.../hospital_score.rs source |
| docs/ps1-exit/t2-launcher-classification.md | living-contract | kept | Cited by crates/.../execution_policy/inputs.rs source |

## Kept: living-contract docs (referenced by code/tests/other current docs)

| path | class | disposition | reason |
Expand All @@ -111,8 +85,6 @@ pattern alone — see TASK_REPORT.md for the cases where the obvious pattern mat
| docs/code-intel-architecture.md | living-contract | kept | Referenced by reference-capability-map.md |
| docs/codenexus-provider-adapter.md | living-contract | kept | Referenced by providers.rs |
| docs/committed-run-index.md | living-contract | kept | Referenced by reference-capability-map.md |
| docs/compatibility-retirement-gate.md | living-contract | kept | Live src + test module (compatibility_retirement_gate) |
| docs/compatibility-retirement-ticket-template.md | living-contract | kept | Live test module (compatibility_retirement_ticket_template) |
| docs/dag-coordinator.md | living-contract | kept | Live src + test module (dag_coordinator) |
| docs/decision-gap-detector.md | living-contract | kept | Backtick paths verified live (rules json, fixture) |
| docs/decision-request-response-port.md | living-contract | kept | Referenced by decision_port.rs |
Expand All @@ -133,17 +105,16 @@ pattern alone — see TASK_REPORT.md for the cases where the obvious pattern mat
| docs/internalization-advisory-candidates.md | living-contract | kept | Referenced by final-commitment-reconciliation.md |
| docs/internalization-r09-r26-records.md | living-contract | kept | Referenced by final-commitment-reconciliation.md |
| docs/internalization-record-engine.md | living-contract | kept | Documents live internalization_record.rs module |
| docs/inventory-rg-capability-contract.md | living-contract | kept | References live legacy/run-code-intel.ps1 |
| docs/inventory-rg-capability-contract.md | living-contract | kept | Referenced by its Rust test |
| docs/language-adapter-acceptance-standard.md | living-contract | kept | Backtick paths verified live (policy json, doc) |
| docs/method-catalog.md | living-contract | kept | Live src + test module (method_catalog, #[path]-included) |
| docs/method-selection.md | living-contract | kept | References live method-selection-rules.v1.json |
| docs/model-channel-routing.md | living-contract | kept | Documents live model_channels.rs routing |
| docs/model-executable-handle.md | living-contract | kept | References 3 live legacy scripts |
| docs/native-code-evidence.md | living-contract | kept | Live src + test module (native_code_evidence) |
| docs/openspec-detector.md | living-contract | kept | Referenced by internalization_record.rs test fixtures |
| docs/pon-multilanguage-code-evidence.md | living-contract | kept | Referenced by pon-multilanguage.json |
| docs/ponytail-gain-ledger.md | living-contract | kept | Active tracked cleanup ledger; cross-confirms this sweep |
| docs/ponytail-governance-gate.md | living-contract | kept | Referenced by test-ponytail-gate-contract.ps1 |
| docs/ponytail-governance-gate.md | living-contract | kept | Referenced by ponytail gate docs |
| docs/ponytail-impact-scoreboard.md | living-contract | kept | Linked from README.md |
| docs/project-management-support.md | living-contract | kept | Linked from README.md |
| docs/project-orientation-benchmark.md | living-contract | kept | Live src + test module (project_orientation_benchmark) |
Expand All @@ -166,8 +137,8 @@ pattern alone — see TASK_REPORT.md for the cases where the obvious pattern mat

## Totals

- Files inventoried: 123
- living-contract (kept): 104 (14 ADR + 1 open plan + 7 blocked retirements + 3 ps1-exit + 79 other)
- Files inventoried: 100
- living-contract (kept): 81 (14 ADR + 1 open plan + 66 other)
- one-shot archived this sweep: 17 (16 plans + 1 compatibility-retire)
- one-shot already archived (prior sweep): 2
- stale: 0 (no doc found describing wholly nonexistent paths/symbols; a handful of docs have one
Expand Down
2 changes: 2 additions & 0 deletions docs/adr/0001-rust-cli-reads-artifacts.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> Superseded in part by DR-0018: PowerShell was removed; the steps below now run through the Rust `code-intel` CLI.

# Rust CLI reads artifacts before replacing the scanner

Accepted. The Rust `code-intel` CLI starts as an artifact consumer for existing scanner output instead of replacing the PowerShell scanner. This keeps the current evidence-producing workflow stable while giving humans and Agents a typed, testable way to resume from `report.json`, `hospital-report.json`, and related artifact files; a future scanner rewrite must preserve the artifact data contract rather than silently changing the handoff surface.
2 changes: 2 additions & 0 deletions docs/adr/0009-atomic-capability-execution-model.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> Superseded in part by DR-0018: PowerShell was removed; the steps below now run through the Rust `code-intel` CLI.

# ADR 0009: Adopt an Atomic Capability Execution Model

- Status: accepted
Expand Down
2 changes: 2 additions & 0 deletions docs/adr/0011-primary-cli-and-recovery-launcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ status: accepted
date: 2026-07-25
---

> Superseded in part by DR-0018: PowerShell was removed; the steps below now run through the Rust `code-intel` CLI.

# Make code-intel the primary entry and PowerShell the recovery launcher

The compiled `code-intel` command is the only Primary Operator Entry and the
Expand Down
12 changes: 6 additions & 6 deletions docs/agents/overnight-run-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| `DEADLINE` | `{{DEADLINE}}` ← 投放时填绝对时间戳 |
| `TEST_CMD` | `cargo test -p code-intel --locked -j 4 -- --test-threads=4` |
| `LINT_CMD` | `cargo fmt -p code-intel -- --check && cargo check --locked` |
| `LOC_CMD` | `pwsh -NoProfile -Command "(Get-ChildItem crates -Recurse -Filter *.rs \| Where-Object { $_.FullName -notmatch '\\tests\\' } \| Get-Content \| Where-Object { $_ -notmatch '^\s*(//\|$)' }).Count"` |
| `LOC_CMD` | `rg --files -g 'crates/**/*.rs' -g '!**/tests/**' \| xargs cat \| rg -v '^\s*(//\|$)' \| wc -l` (经 `rtk proxy` 前缀直跑) |
| `BENCH_CMD` | `cargo build -p code-intel --release --locked` 然后 `target/release/code-intel.exe benchmark orientation --out <每次全新目录,放 %TEMP%> --repetitions 3` |
| `PERF_METRICS` | `report.json` 里 typical p95(orientation 与 fixture-materialization 分列)+ 每 fixture 重放 digest 全等 |
| `PERF_TOLERANCE` | 相对基线 p95 劣化 ≤ 10%,且绝对契约 typical p95 ≤ 60s 不破 |
Expand Down Expand Up @@ -52,9 +52,9 @@

按顺序执行,结果写入 `.night/BASELINE.md`:

1. TEST_CMD 连续跑 **2 遍**,**经 PowerShell 通道执行**(§8.1;若只有 Bash 通道则加 `rtk proxy` 前缀——裸跑第二遍可能吃 RTK 缓存重放,两遍恒等,FLAKY 集为假空)。两遍结果不一致的测试进入 **FLAKY 集**,逐条记录。此后所有"全绿"的定义都是:**(全部测试 − FLAKY 集)全绿**。FLAKY 集今晚只在此刻确定,不再增补。同时记录通过测试总数(近期基线量级 ~3400+)。
1. TEST_CMD 连续跑 **2 遍**,**加 `rtk proxy` 前缀执行**(§8.1——裸跑第二遍可能吃 RTK 缓存重放,两遍恒等,FLAKY 集为假空)。两遍结果不一致的测试进入 **FLAKY 集**,逐条记录。此后所有"全绿"的定义都是:**(全部测试 − FLAKY 集)全绿**。FLAKY 集今晚只在此刻确定,不再增补。同时记录通过测试总数(近期基线量级 ~3400+)。
2. 跑 BENCH_CMD:先 `cargo build -p code-intel --release --locked`,然后 `target/release/code-intel.exe benchmark orientation --out %TEMP%\night-bench-baseline --repetitions 3`(输出目录必须事先不存在;reps 3 与 CI 口径一致,该基准内部已含 cold/warm × 9 个语料格,reps 调高整轮时间会失控)。把 `report.json` 的 typical p95(orientation / fixture-materialization 分列)与 determinism 结论抄进 `BASELINE.md`。此后"性能无回归"的定义:p95 劣化 ≤ 10% 且绝对 p95 ≤ 60s 且 determinism digest 全等。
3. 跑 LOC_CMD(表格里的 pwsh 命令)记录源码行数。口径:`crates/` 下全部 `.rs`,排除 `tests/` 目录,排除空行与 `//` 注释行;**inline `mod tests` 计入此口径**,因此删 inline 测试刷不动净减少——"测试数不减"(第 1 步的总数)是配对绊线。参考值(2026-08-06):53,675。
3. 跑 LOC_CMD(表格里的命令)记录源码行数。口径:`crates/` 下全部 `.rs`,排除 `tests/` 目录,排除空行与 `//` 注释行;**inline `mod tests` 计入此口径**,因此删 inline 测试刷不动净减少——"测试数不减"(第 1 步的总数)是配对绊线。参考值(2026-08-06):53,675。
4. 建 `.night/REPORT.md` 骨架(§7 结构,各节留空)。报告从此刻起**增量书写**。
5. 在报告顶部用**三句话**复述今晚要做什么。说不清就回去重读,不要动手。
6. commit 上述全部至 `night` 分支。**此后对 `BASELINE.md` 的任何改动即违规**——早上报告须附 `git log --oneline -- .night/BASELINE.md`,只允许出现这一次提交。
Expand All @@ -72,7 +72,7 @@
| #106 | bug(gate): `sentrux check` 与权威 self-scan 口径漂移,最小门禁给假绿灯 | 复现 = 找一个权威 self-scan 红、`sentrux check` 绿的输入;修判据别修表象 |
| #178 | bug(test): 并行测试进程共享 target/tool-path 且无归属 | 与已修的 #175/#177 同因;修法先例:资源命名带进程归属 |
| #186 | test helpers 继承宿主环境,env 变量漏进被测分支 | 修法:枚举全部 env 分支输入,子进程 env 用显式 allowlist(仓里已有同类修复先例) |
| #176 | gate: 门禁清单漏掉 PowerShell 合同测试,cargo test + repin 全绿仍被 CI 打回 | 与 #184 同病:写入方/校验方各持清单必然盲区;修法方向:单一清单模块 + 从磁盘发现 |
| #176 | gate: 门禁清单漏掉部分合同测试,cargo test + repin 全绿仍被 CI 打回 | 与 #184 同病:写入方/校验方各持清单必然盲区;修法方向:单一清单模块 + 从磁盘发现 |

**先 triage 后修复。** 每条固定 20 分钟只做一件事:写出复现脚本,标把握度(高/中/低)。全部过完后按把握度从高到低修。

Expand Down Expand Up @@ -185,7 +185,7 @@ State: <分支名 + 停在哪>

## 8. 本仓陷阱(与正文同级效力)

1. **RTK 命令重写与缓存重放。** 本机 Bash 工具挂了 RTK hook:命令会被透明重写(`grep`→`rg`、`find`→`fd`,语义不同会直接炸),且**重复执行同一命令可能重放旧缓存结果**——修好的红灯会"复活",没修的绿灯会假绿。规避通道按优先级:(a) **所有判定命令(基线、退出条件、验证)一律经 PowerShell 执行**——RTK hook 只挂在 Bash 工具上,pwsh 通道机制上不过 rtk,重写与缓存双免;(b) 只有 Bash 通道可用时,加 `rtk proxy ` 前缀直跑;(c) `find`/`grep` 管道无论哪个通道都改用 pwsh 等价物(LOC_CMD 已是)。hook 已配 10s 超时(fail-open),rtk 自身卡死不会吊死工具调用,但超时后命令是**未经重写**原样执行的——对判定命令无影响(它们本来就该原样跑)。
1. **RTK 命令重写与缓存重放。** 本机 Bash 工具挂了 RTK hook:命令会被透明重写(`grep`→`rg`、`find`→`fd`,语义不同会直接炸),且**重复执行同一命令可能重放旧缓存结果**——修好的红灯会"复活",没修的绿灯会假绿。规避办法:**所有判定命令(基线、退出条件、验证)一律加 `rtk proxy ` 前缀直跑**,重写与缓存双免;`find`/`grep` 管道改用 `rg` 等价写法(LOC_CMD 已是)。hook 已配 10s 超时(fail-open),rtk 自身卡死不会吊死工具调用,但超时后命令是**未经重写**原样执行的——对判定命令无影响(它们本来就该原样跑)。
2. **内存红线。** 本机 commit charge 长期贴顶;cargo 默认并行在 LLVM 阶段会 OOM,子进程撞 error 1455 **静默死(空 stderr)**。`-j 4` 与 `--test-threads=4` 是硬参数不许调高。症状识别:测试数骤降、进程无输出消失 → 按环境故障写 blocker,不是当测试失败去修。
3. **禁 push、禁 PR,全夜。** 本仓 PR 绿灯即自动合并。夜里一切只落在本地 `night` 分支,早上人 review 后才谈 PR。
4. **主 checkout 占用检查。** 开跑第一步 `git status` + `git branch --show-current`:若工作树不净或停在别的 agent 的分支(如 `codex/*`),写 blocker 终止,不许 stash 别人的东西。若不得不在 worktree 里跑:每个测试子进程显式设 `CODE_INTEL_HOME` 指向该 worktree(默认会读主 checkout 的 manifest),且 repowise 在 worktree 里不可用是预期,自扫已带 `--doctor-require-repowise false`。
Expand All @@ -203,4 +203,4 @@ State: <分支名 + 停在哪>
2. 腾出主 checkout `D:\projects\code-intel-pipeline`:切回 main、工作树净、无别的 agent 会话占用(2026-08-06 时它停在 `codex/architecture-convergence`)。
3. 暂时把 `.git/hooks/post-commit` 挪出(`post-commit.night-bak`),早上恢复。理由:它每次 commit 起后台 `repowise update`,整夜几十个 commit 会与 cargo 编译抢内存——本机 commit charge 贴顶,这是 #123 静默死子进程的同款根因。
4. 关掉其他并行 agent 会话与大内存进程,确认磁盘余量(`target/` + release 构建 + bench 输出,预留 ≥ 20GB)。
5. RTK 不用拆:hook 已配 10s 超时(fail-open),且判定命令按 §8.1 走 PowerShell 通道,机制上不经过 rtk。
5. RTK 不用拆:hook 已配 10s 超时(fail-open),且判定命令按 §8.1 加 `rtk proxy` 前缀,机制上不吃缓存重放。
2 changes: 2 additions & 0 deletions docs/architecture/reference-capability-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Status: canonical audit baseline (2026-07-13)

> PowerShell was removed from the product (DR-0018). This table is the 2026-07-13 baseline: the `legacy/*.ps1` paths and line numbers it cites no longer exist on `main`; read them at commit `f59be54`, the last commit before their deletion. The equivalent behavior now lives in the compiled Rust `code-intel` CLI or has been deleted.

This map classifies the active integrations and design references named by the restored commitment checkpoints. It is an inventory, not an adoption approval, implementation claim, or health claim. Repository code and accepted/proposed ADRs are the primary evidence; the checkpoints are audit inputs that establish coverage expectations only.

## Classification rules
Expand Down
Loading
Loading