Skip to content

snapshot: 差分の作成が失敗すると snapshot.snar だけが進み、その後の差分が失敗の前の変更を落として復元でファイルを失う → 失敗しても snar と差分の列を打つ前のまま保ち、作りかけの差分を残さない(#466) - #476

Merged
takemi-ohama merged 3 commits into
mainfrom
design/issue-466
Oct 12, 2026

Conversation

@takemi-ohama

Copy link
Copy Markdown
Contributor

#466 の要求と受け入れ条件の写し、および設計文書を追加しました(スプリント m8c)。設計は、差分の作成が失敗したときに snar と差分の列を保つ方針を扱います。追加したのは文書だけで、コードは変更していません。

利用者向けの変化

  • 無し

移行の手順

  • 無し

変更の要点

テスト

supervise.py の run のステップの結果です。

ステップ exit 結果
glossary 0 ok(宣言と用語集が揃っている)
requirements-check 2 stopped(issues/issue-466-requirements.md を読めない: [Errno 2] No such file or …)

requirements-check は要求の写しのファイルを読めずに止まっており、通っていません。このファイルはこの PR で追加しているので、実行した時点や場所と、ファイルの追加との前後関係を確かめてから、再実行が必要です。

モード: standard / 通した工程: 設計 → 要求と受け入れ条件 → ドキュメントレビュー

🤖 Generated with Claude Code

決めたこと

issues/issue-466-design.md

  • 決定 1: 控えが失敗しても世代の snar を変えないため、写した仮の snar と仮の名前の差分へ控え、成功してから改名で置く
  • 決定 2: 「snar が進み新しい差分が無い」世代を作らないため、差分を置いてから snar を進める
  • 決定 3: 控えのコマンドの形を作り直しと同じに保つため、snar の写しはホストで取る
  • 決定 4: 前の中断の残りを 1 か所で確実に消すため、差分の仮の名前を固定の incr.tar.zst.new にし、状態ファイルの仮の名前を作り直しと共有する
  • 決定 5: 戻す手がかりに見えて使われないファイルを増やさないため、差分の作成は snapshot.snar.bak を作らない
  • 決定 6: 受け入れ条件 4 の (a)〜(c) を外れないため、仮のファイルを消せないときは警告して続け、改名の失敗は SnapshotError に包む

takemi-ohama and others added 2 commits October 13, 2026 01:42
差分の作成の失敗で snapshot.snar を打つ前のまま保ち、作りかけの incr-NNN.tar.zst を
残さない要求。#473 との触る範囲の境界と、devbase-snapshot:latest での実測(R1〜R5)を含む。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
写した仮の snar と仮の名前の差分へ控え、成功してから差分 → snar の順に改名で
置く。snapshot.snar.bak は作らない。#473 と触る範囲の境界を書く。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 1 | codex | APPROVE

指定範囲に critical / major の修正指摘はありません。判断の根拠: Vision / Value 2(失敗時の控えの保全と復元の再現性を基準に確認)。

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 1 | kiro | APPROVE

設計 PR のドメインモデルの節と用語集の差分を見た。集約・不変条件・ドメインイベント・用語の表は内部で矛盾せず、manager.py の実装と一致した。用語集に足す語・意味を変える語・廃止する語は無く、設計の用語の表(世代・系列の最新の世代・世代の作り直し・復元前バックアップ、いずれも変更なし)と glossary.json の記載が一致する。critical / major の基準に当たる修正提案は無い。

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 2 | claude | REQUEST_CHANGES

決定 4 で残す incr.tar.zst.new が、確定仕様の「作り直しに成功した世代は仮の名前のファイルを持たない」と食い違う。設計の書き換え先にその条件を入れる。

Comment thread issues/issue-466-design.md

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 2 | kiro | APPROVE

設計 PR #466。要求の写しと設計(決定 1〜6・テスト設計)を実装(manager.py)と突き合わせて確認した。差分の経路の失敗保全を、既にリリース済みで実証された full の経路(#458 の _create_full / _install_rebuilt_full / _discard_rebuild_temps)と同じ形に揃える設計で、仮の名前 incr.tar.zst.new / snapshot.snar.new が INCR_ARCHIVE_GLOB・_INCR_ARCHIVE_RE・is_archive_file・_has_previous_files・last_snapshot_time のどれにも当たらないこと(定数定義と各関数の実装で確認)、改名の順(差分→snar)が受け入れ条件 4 の (a)〜(c) と整合すること、meta.yml の files キーが書き込みのみで読まれないため (b) 状態が無害であること(grep で 2 か所とも書き込みと確認)、改名対象テスト test_create_and_restore_go_through_the_helpers が実在し現在 cp ... .bak && を assert していること、を確認した。R1〜R5・V1〜V7 の実測が外部ツール(tar/zstd)の挙動の根拠として付いている。critical / major の基準(利用者経路の誤動作・秘密/データ/戻せない操作・実装者が別物を作る食い違い)に当たる修正提案は無い。

snapshot-series.md の作り直しの常に成り立つ条件(326〜327 行)とテスト観点(484 行)を
作り直しの仮の名前のファイルへ絞ることを決定 4 と #473 との境界の表に書く。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@takemi-ohama

Copy link
Copy Markdown
Contributor Author

🔧 /ndf:fix サマリ | round 2 | commit 7e8dab6

対応件数: critical=0 / major=1 / minor=0(合計 1 件)
決着: 1 件 / 見送り: 0 件 / 却下: 0 件
CI: SUCCESS

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 3 | claude | APPROVE

round 2 の指摘(決定 4 で残す incr.tar.zst.new と確定仕様の条件の食い違い)は、書き換え先の一覧と決定 4 の本文に 326〜327 行・484 行の絞り方が入り解消した。spec の他の「仮の名前のファイル」(277 行の手順 1・324/403/404 行)は作り直しの 3 本を列挙した文脈に縛られており、新たな食い違いは無い。critical / major の修正提案は無い。

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 3 | codex | APPROVE

指定コミット間の差分に critical / major の新規指摘はありません。判断の根拠: Vision / Value 2(作り直し後の仮ファイルの扱いを既存コード・確定仕様と照合)。

@takemi-ohama

Copy link
Copy Markdown
Contributor Author

🔧 /ndf:fix サマリ | commit (なし)

対応件数: critical=0 / major=0 / minor=0(合計 0 件)
決着: 0 件 / 見送り: 0 件 / 却下: 0 件
CI: NONE

@takemi-ohama
takemi-ohama marked this pull request as ready for review October 12, 2026 17:00
@takemi-ohama takemi-ohama added the design-approved ドキュメントレビューを人間が承認した label Oct 12, 2026
@takemi-ohama
takemi-ohama merged commit a1bddde into main Oct 12, 2026
10 checks passed
@takemi-ohama takemi-ohama mentioned this pull request Oct 12, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design-approved ドキュメントレビューを人間が承認した

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant