Repository navigation
refactor(source): parse the source into a typed model at the boundary - #231
Conversation
Computation used to receive a Snapshot of files, look them up by path, and parse raw text where it used them. The loader now reads the source tree, the external hook bundles, and the external skills, parses and validates every document once (each error names its file), and returns a typed `Source`. Computation takes `&Source` and returns FileOps. - add `source_model::Source`; directories that are only copied are a location and a file list - add `shell::load_source`/`load_installed`; remove `SnapshotRequest`, `Snapshot`, and `Tree` - plan the whole install from `Source` + installed configs in one pass; a provider that copies another's skills renders them again and moves them with `FileOp::relocated` instead of reading the other's output back from disk - merge the Claude settings into the installed ones while rendering, replacing the render-then-preserve step - check bundle asset conflicts against the planned files rather than a re-read staging directory - type the staged home of `generate-hook-bundle` instead of snapshotting it Generated output is byte-identical: the golden tests and nix/providers.json are unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Review summaryNo P0–P3 findings. Reviewed the move from a
I could not run |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## 概要 共有の ADR チェック(`adr-check`,markdownlint,lychee)と ast-grep を採用し,CI で実行する.ADR 本文は変更しない(agent-config ADR-0025). Refs furedea/agent-config#169 ## 変更 - 全 30 件の ADR のメタデータ行(Status,Date,Supersedes,Superseded by,Related,Amends)を YAML front matter に移した. - `docs/adr/.markdownlint.yml` を追加した.`default: true`,`MD013: false`,`MD024: false` に加え,既存本文が違反する次のルールだけを無効にした. - MD007: 5 件(ADR-0029 のリスト字下げ) - MD033: 1 件(ADR-0027 の `<name>`) - `ci.yml` に `adr-lint`(`madr-from: 31`)と `ast-grep`(v1.6.0)を追加し,`all-green` の `needs` に加えた. - ファイル名は既に `NNNN_words.md` 形式のため,リネームは不要. ## 保守的・曖昧な front matter の値 - ADR-0026: 本文に「superseded by」がない.スキーマが `superseded-by` を必須とするため,ADR-0027 の `Supersedes: ADR-0026` から `superseded-by: [ADR-0027]` を補った. - ADR-0014: `Amends: ADR-0012` に対応するキーがない.precedent に従い `related: [ADR-0012] # amends ADR-0012` とした. - ADR-0021: 本文の `## Amendment (2026-10-20)` から `amended` を作った.要約文は新しく書いた. - ADR-0028: 2 つの Amendment 節に日付がない.git 履歴(#229,#231)から 2026-11-12 を補った. ## 確認 - `adr-check docs/adr`: 通過 - markdownlint-cli2: 0 エラー - `lychee --offline docs/adr`: 0 エラー,壊れたリンクなし - actionlint: `ci.yml` はエラーなし 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: furedea <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
概要
Issue #217 の波 4
sourceです.境界(loader)で source を読んで解析・検証し,型付きのSourceにします.計算は&Sourceだけを受け取ってFileOpを返し,パスで探したり生の文字列を解析したりしません.計画: #217 (comment)
変更内容
source_model::Sourceを追加.manifest,フック設定,権限規則,除外コマンドの正規表現ポリシー,秘密パスのポリシー,スキル(metadata と描画方針),Claude 設定,Codex 設定,プロバイダ別の source 設定,外部 hook bundle を持ちます.解析の失敗はすべて境界で出て,エラーはファイルのパスを含みます.SourceDir)だけを持ち,FileOp::CopyTree/CopyFileで返します.中身は読みません.SnapshotRequest,Snapshot,Treeを削除.何をどこから読むかはshell::load_sourceだけが知ります(LoadInputsは呼び出し側が渡すプロバイダと外部入力だけ).SourceとInstalledConfigs(境界で解析済みのインストール済み設定)から 1 回で計画します(InstallPlan).段階ごとの snapshot の取り直しはありません.Sourceから描画し直し,FileOp::relocatedで出力先を移します.ディスクから読み戻しません.SourceDirの一覧から導出)と照合します.generate-hook-bundleの staging も型付き(Staged)にしました.shell::loadをload.rs/load/files.rs/load/bundle.rsに,generation/skills.rsをskills.rs/skills/rendering.rsに分割しました(1 ファイル 500 行の制限のため).挙動の変化(生成物は変わりません)
name,description,レベル 1 の見出しが必須になり,どのコマンドでも source の読み込みで検証されます(以前はlist skillsだけが見出しを要求).allowed_commands.json,プロバイダの source 設定,bundle のフックファイルの不正は,install以外のコマンドでも読み込み時に拒否されます.verifyは source 全体を読み込んでから manifest の実行時コマンドを確認します.検証
cargo test: 全通過(lib 247,統合テスト含む).complete_source_golden,neutral_generated_artifacts,nix_provider_registryを含み,生成物とnix/providers.jsonは 1 バイトも変わっていません.cargo clippy -- -D warnings(CI と同じ): 警告なし.cargo fmt --check: 差分なし.FileOp::relocated,InstallPlan::planned_files.旧Snapshotのテストは loader のテストに置き換えました.残り
Issue #217 の受け入れ条件は,この PR で波 4 まで揃います.ただし次が残るため
Refsにしています.layout.rsのhermes_config/dsh の package.json のパスと,generation/hook_bundle.rsの Codex の設定ファイルは,今もプロバイダ名で引いています(種類による分岐ではなく名前での参照).ProviderId/render::Provider/cli::Provider),ConfigLocation型,秘密パスポリシーの Codex 適用.GenerationContextがTreeを持っていたため,モジュール単位では緑のまま分けられず,1 つのコミットにまとまっています(コード 1,ドキュメント 1).Refs #217
🤖 Generated with Claude Code