Low-cost refactors: gitx split, run-dir path helpers, r.fail, llm adapters
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
The issue lists six independent refactors and the relevant files, including internal/gitx/gitx.go, engine files, LLM adapters, and seed/config files. Pick one checklist item and read its named files and prerequisites first; run the tests specified for that item before changing it. Done means that item preserves behavior, its relevant tests pass, and the full acceptance criteria remain green.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Six small refactors, each a self-contained commit or two that leaves behavior unchanged. Grouped because each is low severity; they are independent and can be picked off one at a time.
Where
internal/gitx/gitx.go:34,:314,:392,:558,:750,:906internal/engine/engine.go:313,:340,internal/engine/prove.go:412,internal/engine/verify.go:158,internal/mcp/tools.go:669,internal/cli/scan.go:169,tools/demoassets/main.go:165internal/engine/scaffold.go:78,internal/engine/run.go:311,internal/engine/live.go:212,internal/engine/debug.go:262internal/llm/openai.go:185,:199,internal/llm/ollama.go:96,:108,internal/llm/anthropic.go:113,:215internal/engine/resume.go:191,internal/mapper/mapper.go:351internal/seed/external.go:131,:136,internal/config/config.go:242,:247
Details
- gitx.go is one 1047-line file doing four jobs. Config safety (lines 34-312), subprocess runners (314-384), queries and worktree operations, and tar extraction plus index export (750-1047). The two safety-critical parts are reviewed in the same diff context as unrelated query helpers. Plan: pure file moves inside the package, one commit each (
safety.go,exec.go,export.go), then split the test file the same way. Check: build andgo test ./internal/gitx/after each move. - Run directory layout is spelled as string literals in five packages.
findings/<id>/finding.json,findings/<id>/poc/poc.json,evidence/exchanges/<id>.jsonandreports/report.<ext>are built and read by literal in engine, agent, mcp, cli and tools. Plan: add helpers ininternal/report(FindingDir,FindingFile,PoCDir,PoCManifest,ExchangeRef,ReportFile), replace literals one package per commit, keep stored strings byte-identical. Before starting: one test that the helpers return today's literal strings. - Explicit
r.failcalls duplicate the deferredr.done. Every mode defersr.done(&err), which ends the run on any non-nil error; ten return sites still wrap the error inr.fail(...)by hand while their neighbours return the bare error. Plan: drop the wrapper at the ten sites. Before starting: confirm tests assert a failed run's ledger ends with outcome failed for a model error, an unreachable target and an image that cannot be pulled. - Provider adapters each re-encode tools and tool results, and have drifted. The tool-schema loop is duplicated in the OpenAI and Ollama adapters; the rule for a tool result's text is written three times and differs (Ollama sends empty content as is, the others substitute "(no output)"); the 16000 output-token default is set twice. Plan: shared helpers in
llm.go(toolSchema,toolResultText,oaTools), one constant, and decide the Ollama empty-result behavior in its own commit. Before starting: add the Ollama empty-result request test so the change shows up as deliberate. - Two private
sameDirhelpers disagree when a path cannot be stat'ed. The mapper version returns false; the engine version falls back to comparing cleaned paths. One decides whether the map cache applies, the other whether--resumeaccepts a run. Plan: onewalk.SameDirwith the fallback as a documented choice, and a table test (same path, different spelling, missing path). - seed keeps its own copies of two Semgrep facts that config owns.
seed.isSemgrepPackcopiesconfig.IsSemgrepPack(kept equal by a test);seed.defaultSemgrepRulescopiesconfig.DefaultSemgrepConfigwith no test comparing them. Plan: add the missing equality test, or have seed import config and delete the copies (no import cycle).
Impact
Each item is a place where a change has to be made in several spots, or where two copies can drift. The stored run layout is a format that verify, report, the MCP fast path and the docs generator depend on, so a missed reader fails at run time on a stored run.
Suggested fix
See the checklist above; each item names its own steps and the tests to have first.
Acceptance criteria
- Each completed item leaves
make lintandmake testgreen with no golden changes, apart from the deliberate Ollama decision
Related: #54, #113
Getting started
- Relevant files: internal/engine/engine.go, internal/engine/resume.go, internal/engine/scaffold.go, internal/gitx/gitx.go, internal/llm/openai.go, internal/seed/external.go
- How to run tests:
make test-short(Unix) or.\make.ps1 test-short(Windows PowerShell);make lintbefore you call it done - Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md
Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: M. audit-key: tech-debt|internal/gitx/gitx.go|file-split-and-small-refactors
- Ngôn ngữ chính
- Go
- Star
- 0
- Fork
- 1
- Merge trung bình
- 8 giờ 14 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/Spackle
-
ci good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
TMHSDigital/Spackle#206 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ci severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/Spackle#205 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TMHSDigital/Spackle#199 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
TMHSDigital/Spackle#195 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue severity: medium
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
TMHSDigital/Spackle#188 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TMHSDigital/Spackle
Issue tương tự
-
deskclose human-decided leaves the legacy decision-needed label and applies no human-decidedĐang mởbug effort:s impact:med raised-by:worker risk:low to:worker
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
medici-finance/assay#8120 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
factory:subtask
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
agent-substrate/substrate#4308 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
celestiaorg/celestia-app#8877 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
sweep
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
bketelsen/truenas-mcp#112 ·
Maintainer thường phản hồi trong vòng 1 ngày