Repository navigation
feat: ccreel のセッションを載せる拡張を、例として同梱する - #24
Merged
Merged
Conversation
## 変更内容 - `examples/plugins/sessions.py` を追加。ccreel の `list --json` / `show --json` から Claude Code のセッションを読み、一覧(`sessions/index.html`)と本文のページを足す拡張の例 - 利用側の実装から `CODEVIEW_LOCAL` による無効化を外し、docstring に写し方と ccreel が要ることを足した - 設定の誤りは本体が最初に呼ぶ `css()` の口で検証し、生成を始める前に `error:` で止める - `tests/test_example_sessions.py` を追加。偽の `ccreel` と、Issue を返す小さな取り込み元をテストの中に置き、`site` フィクスチャで生成器を別プロセスで呼ぶ - README.md / README.en.md の特長リストに拡張の1行を足し、Extensions 節に例の小節(使い方と設定例)を足した - docs/guarantees.md に節 5 を足し、「About」の対象に例の拡張を足した。context/structure.md の木に2ファイルを足した ## 保証 - list の呼び出しと一覧、本文を show から書く → tests/test_example_sessions.py: test_list_and_session_pages, test_passes_config_dir_and_period, test_merges_config_dirs - 応答の Markdown は生の HTML を出さずに描く / resume の行 → test_reply_markdown_is_safe, test_list_and_session_pages - Issue(先頭の 0 を無視)とリポへのリンク、無ければリンクにしない → test_links_to_issue_and_repo, test_unlinked_when_issue_or_repo_is_missing - show に失敗したセッションのページ → test_unreadable_session_still_gets_a_page - ccreel が無い・list の失敗は警告して続ける → test_build_survives_one_failing_config_dir, test_build_survives_missing_ccreel - トップの入口と件数、題は出さない → test_top_menu_links_sessions_without_titles - 設定の誤り → test_rejects_bad_options - 指紋は every_hours の枠で動く → test_fingerprint_moves_only_across_windows - ページの使い回し・更新・Issue の状態・一覧から消えた分 → test_second_build_reuses_unchanged_pages, test_updated_session_is_rebuilt, test_issue_link_follows_issue_state, test_expired_sessions_leave_the_cache - href / src は相対パスで実在する → test_links_are_relative_and_resolve - 維持する保証(台帳 §1 の拡張なしの出力・読み込めない拡張・相対リンク)は本体に触れないので既存テストのまま通る ## 静的確認結果 - `nix develop -c pytest -q`: 71 passed - 本体(`codeview/`)への変更なし - git diff --name-only --cached: README.en.md README.md context/structure.md docs/guarantees.md examples/plugins/sessions.py tests/test_example_sessions.py
## 変更内容 確認者の指摘を直した。`fingerprint()` のテストが、モジュールを直接読んで `_cache` を書き換えていたため、`site.fingerprint()` で別プロセスから呼ぶ形に替えた。セッションを2本にし、古い方が動いても最新を超えなければ変わらず、超えれば最新として拾うことを確かめる。`every_hours` を変えた枠も確かめる。 ## 保証 - fingerprint は最新の更新時刻を every_hours の枠に丸める → tests/test_example_sessions.py: test_fingerprint_moves_only_across_windows, test_fingerprint_follows_every_hours ## 静的確認結果 - `nix develop -c pytest -q`: 全件通過
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
変更内容
examples/plugins/sessions.pyを追加した。ccreel のlist --json/show --jsonから Claude Code のセッションを読み、一覧(sessions/index.html)と本文のページを足す拡張の例である。本体のパッケージには入れず、利用者がcodeview.tomlの隣へコピーして使うCODEVIEW_LOCALによる無効化を外し、docstring に使い方と ccreel が要ることを足したcss()の口で検証する。生成を始める前にerror:で止めるためtests/test_example_sessions.pyを追加した。偽のccreelと、Issue を返す小さな取り込み元をテストの中に置き、siteフィクスチャで生成器を別プロセスで呼ぶcodeview/)は変えていない保証
維持する保証(台帳 §1)は本体に触れないため、既存のテストがそのまま通る。
静的確認結果
nix develop -c pytest -q: 72 passed確認者の判定
nix develop -c pytest -qが通る(72 passed)siteから生成器を別プロセスで呼び、偽の ccreel を使うerror:を出し非0docs/guarantees.mdの更新