GCWing / GCWing/OpenBitFun

[Bug]: opencode-adapter instruction and tool source tests depend on the host git environment

クローズ 初心者向け
#2,648 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
2.3k
フォーク
231
平均マージ
2時間 49分
マージ済み PR(30日)
589

説明

## Summary

These tests build tempdir workspaces without a git boundary, so on hosts whose own environment is inside a git checkout (e.g. a user home that is a repository) find_project_root can leak the host repository into the resolution and reclassify explicit global config dirs as workspace-local, flipping test outcomes by environment.

Each test now anchors the project boundary by creating a .git directory in the workspace.

## Area

src/crates/adapters/opencode-adapter/src/instruction_source.rs (tests module) + tests/tool_source_contracts.rs. Crate: bitfun-opencode-adapter.

## Reproduction or evidence

At 32f2427697 the tests create workspace tempdirs with no .git anchor (Grep zero hits for workspace .git anchoring in both files); running the suite on a host where the home directory is a git checkout reclassifies explicit global directories as workspace-local. find_project_root production semantics are untouched.

## Environment

Any host with a surrounding git repository (CI runners where $HOME is a checkout); baseline 32f2427697. Test-only change; no production diff.

---
AI-assisted change. Testing: verified locally (`cargo check -p bitfun-opencode-adapter` exit 0; instruction_source filter 15 passed; `--test tool_source_contracts` 9 passed, 0 failed).

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

src/crates/adapters/opencode-adapter/src/instruction_source.rs と tests/tool_source_contracts.rs の tests モジュールから始め、続いて記載されている cargo チェックとフィルタリングされたテストを実行します。一時的なワークスペースがプロジェクト境界を確立することを確認し、別の Git checkout 内にあるホスト上で instruction-source と tool-source のテストが成功することを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
git, rust
領域
devtools, testing-qa
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
86/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。