GCWing / GCWing/OpenBitFun

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

Offen Anfängerfreundlich
#2,648 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
2.3k
Forks
231
Ø Merge
2 Std. 46 Min.
Gemergte PRs (30 T.)
577

Beschreibung

## 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).

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with the tests module in src/crates/adapters/opencode-adapter/src/instruction_source.rs and tests/tool_source_contracts.rs, then run the listed cargo checks and filtered tests. Ensure the temporary workspaces establish a project boundary and verify the instruction-source and tool-source tests pass on hosts inside another Git checkout.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git, rust
Bereich
devtools, testing-qa
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
86/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.