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
22 changes: 10 additions & 12 deletions .takt/facets/instructions/fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,18 @@ If `refutation-report.md` is absent (post-pr-review, or refute disabled), use al
- All findings in this iteration (new / reopened) have been fixed in the correct source tree (not in any read-only zone).
- Potential occurrences of the same `family_tag` have been fixed simultaneously (no partial fixes that cause recurrence).

**Important**: After fixing, run the build and tests for the affected crate(s).
**Important**: After fixing, run the build and tests for the **affected crate(s) only** — e.g. `cargo build -p <crate>` and `cargo test -p <crate>`. You do **not** need to run the full-workspace build/test or the `#[ignore]` integration tests here; those are delegated to the deterministic gate described next.

## `--ignored` integration test gate (conditional — REQUIRED when triggered)
## Workspace-wide build / test and `--ignored` are delegated to a deterministic gate (T12)

If the fixes in this iteration did **either** of the following:
You are **not** required to run `cargo build --workspace`, `cargo test --workspace`, or the ignored integration tests (`cargo test -- --ignored --test-threads=1`) in this fix step. A deterministic Rust gate re-runs the project's quality gate — which **includes** `cargo test -- --ignored --test-threads=1` — after this workflow and blocks the push if it fails (fail-closed, ADR-043):

- modified any test file (any `.rs` file containing `#[test]` / `#[ignore]` attributes, or files under a `tests/` directory), or
- changed the behavior or signature of any `pub` / `pub(crate)` function,
- **pre-push** (`pnpm push`): the `post-takt re-gate` stage (`cli-push-runner`) re-runs the full quality gate whenever this fix step changed the working copy.
- **post-pr** (auto-push after CodeRabbit fixes): the auto-push gate (`cli-pr-monitor`) re-runs the `rust-lint-test` group, which includes `--ignored`, before re-pushing.

you MUST also run the ignored integration tests and confirm PASS **before** emitting `convergence_verdict: fully_resolved`:
Rationale: plain `cargo test` does NOT execute `#[ignore]` integration tests, so PR #224 originally made this fix step self-run the full workspace + `--ignored` suite (a fix to `create_fix_commit` had broken 2 `#[ignore]` repush tests and landed unverified). That self-run became the dominant cost of the fix step, and the gap it covered is now closed deterministically on **both** push paths. Running the heavy suite once in the deterministic gate — instead of on every fix iteration — is both faster and more trustworthy than self-report (ADR-037: mechanical backstop over self-evaluation).

cargo test -- --ignored --test-threads=1

Rationale: plain `cargo test` does NOT execute `#[ignore]` integration tests, and the automated push paths after this workflow may not re-run them before your changes reach the PR (PR #224: a fix to `create_fix_commit` broke 2 `#[ignore]` repush integration tests and landed on the PR unverified). If the trigger condition applies and the run failed — or you did not run it — emit `convergence_verdict: partial` instead.
This delegation assumes the deterministic gate is active on the path you are on. If it has been disabled (`POST_TAKT_REGATE_DISABLE=1` / `PR_MONITOR_GATE_DISABLE=1` / `enabled = false`), you are responsible for running `cargo test -- --ignored --test-threads=1` yourself before emitting `fully_resolved`.

## Pre-completion deterministic check (Bundle Z Phase 2 / #B-β)

Expand Down Expand Up @@ -113,7 +111,7 @@ This refresh is **unconditional**:
- {Build execution results}

## Test results
- {Test commands executed and results — list each command line explicitly, including `cargo test -- --ignored --test-threads=1` when the conditional gate above applies}
- {Test commands executed and results — list each command line explicitly. Affected-crate `cargo build -p` / `cargo test -p` only; the full-workspace build/test and `--ignored` suite are delegated to the deterministic re-gate (see above), so you do not run them here}

## Convergence gate

Expand All @@ -129,7 +127,7 @@ This refresh is **unconditional**:

After completing fixes, evaluate the gate above and emit one of two verdicts. The next workflow step is selected from this verdict, so it must accurately reflect the gate state.

- **fully_resolved** — `persists == 0` AND `misdirected == 0`. All findings of this iteration were either fixed or correctly skipped. No remaining work for the analyze step to re-examine. When the "`--ignored` integration test gate" trigger condition applies, a PASS of `cargo test -- --ignored --test-threads=1` is an additional precondition for this verdict.
- **fully_resolved** — `persists == 0` AND `misdirected == 0`. All findings of this iteration were either fixed or correctly skipped. No remaining work for the analyze step to re-examine. (The full-workspace build/test and `--ignored` integration tests are verified by the deterministic re-gate after this workflow, not by this verdict.)
- **partial** — `persists > 0` OR `misdirected > 0`. Some findings carried over (still need fixing in a later iteration) or were skipped due to misdirection (and need to be reported). Re-analysis is required.

Place the verdict at the **end of your report** as a single bare line in this exact form (no surrounding quotes, no trailing punctuation):
Expand All @@ -144,4 +142,4 @@ or:
convergence_verdict: partial
```

**Honesty constraint**: This verdict gates whether the analyze step runs again. Reporting `fully_resolved` while leaving findings unaddressed bypasses the safety re-check. If you are uncertain whether a finding was truly resolved (e.g., you applied a fix but did not verify the build passes), emit `partial` so the analyze step can re-evaluate. The same applies to the `--ignored` integration test gate: if its trigger condition applies and you did not run it (or it failed), emit `partial`.
**Honesty constraint**: This verdict gates whether the analyze step runs again. Reporting `fully_resolved` while leaving findings unaddressed bypasses the safety re-check. If you are uncertain whether a finding was truly resolved (e.g., you applied a fix but did not verify the affected crate builds), emit `partial` so the analyze step can re-evaluate.
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
- [ADR-055: 発火テレメトリ収集層 — ハーネス ROI 棚卸しの決定論的観測基盤](docs/adr/adr-055-firing-telemetry-collection.md) *(試験運用)*
- [ADR-056: takt builtin review policy の shadow — policy 層を anomaly 設計に整合させる](docs/adr/adr-056-review-policy-anomaly-shadow.md) *(試験運用)*
- [ADR-057: docs-only / 空 diff の決定論 routing — instruction 規約から決定論機構への昇格](docs/adr/adr-057-docs-only-deterministic-routing.md) *(試験運用)*
- [ADR-058: fix 後の決定論再ゲート (post-takt re-gate) — pre-push 経路への機械的 backstop 拡張](docs/adr/adr-058-post-takt-regate.md) *(試験運用)*

## 開発 convention / チェックリスト

Expand Down
1 change: 1 addition & 0 deletions docs/adr/adr-037-takt-fix-trust-shortcut.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ ADR-036 の Bundle Z 3 層アーキテクチャと同じ思想:
- 不確実な場合は `partial` を選ぶデフォルトを推奨
- dogfood で虚偽 fully_resolved が観測されたら順位 53 系列の post-merge-feedback follow-up (T1-1: convergence_verdict gate validator) を採用検討
- **(2026-07-03 追記) auto-push 前の決定論 gate による機械的 backstop**: PR #224 で「虚偽ではないが検証不足の `fully_resolved`」(`cargo test` のみで `#[ignore]` 統合テスト未実行) が回帰を素通しさせた実害を受け、cli-pr-monitor の auto-push 経路に決定論 gate (`src/cli-pr-monitor/src/stages/gate.rs`、push-runner-config.toml の quality_gate group を push 前に実行) を導入。誤った `fully_resolved` が emit されても、`cargo test -- --ignored` を含む gate が remote 到達前に遮断する (fail-closed、ADR-043)。fix.md 側にも `--ignored` 条件付き必須ゲートを追加済み
- **(2026-07-18 追記 / T12) honesty constraint の機械的 backstop を pre-push 経路にも拡張**: 上記 gate は post-pr (auto-push) 経路のみで、**pre-push (`pnpm push`) 経路には backstop が無かった**。`cli-push-runner` に post-takt re-gate stage を追加し (`src/cli-push-runner/src/stages/post_takt_regate.rs`、[ADR-058](adr-058-post-takt-regate.md))、takt fix が作業コピーを書き換えた場合に quality_gate を再実行して block する。両経路で「LLM の convergence_verdict 自己申告を決定論 gate で backstop する」構造が揃った。あわせて、backstop が両経路に揃ったことを前提に **fix.md の workspace 全体 build/test + `--ignored` 統合テストの自己申告義務を撤去し、影響 crate の `build -p` + `test -p` に縮小**した (自己検証を fix iteration ごとに払う冗長を解消し、重いスイートは gate で 1 度だけ払う)。上記「fix.md 側にも `--ignored` 条件付き必須ゲートを追加済み」は本追記で置換された (自己申告ではなく決定論 gate が担う)。fail 方向は gate 系 fail-closed で、ADR-021 原則 4 の repush 系 fail-safe とは逆向き (ADR-058 参照)

## 完了状態

Expand Down
Loading