Skip to content

context_pack: epic fallback via earlier PRs; test_galaxyscope stops writing 0-LOC briefs (Part of #5521) - #6145

Merged
squid-protocol merged 1 commit into
mainfrom
churn/5521-20261023T0243Z
Oct 23, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/5521-20261023T0243Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5521 (follow-up to #5532; promoter-bot wiring is a separate repo/issue, not this PR).

What

  1. Epic fallback in context_pack.py: prior_files() lists files changed by the newest commits on origin/main whose message mentions #N; build_pack adds those that are in the DB under "Earlier PRs for this issue changed:". Epics ("Part of #N") name no code, which was the main miss in tools: context_pack.py, issue -> path:start-end pointers from the self-scan DB (Part of #5521) #5532's sample.
  2. "0 analyzed artifact(s), 0 LOC" brief: not a delta-mode bug. galaxyscope --incremental writes only *_master.db. The briefs come from tests/core_engine/test_galaxyscope.py, whose mocked execute_pipeline("fake.json") calls wrote <checkout>_galaxy_llm.md, *_galaxy_graph.sqlite, fake_output_* into the cwd (the repo root); the "(Delta Mode)" string is a copy-paste in the main pipeline's session_meta (galaxyscope.py:2024, left alone: changing it is a separate engine edit). Fix: an autouse fixture chdirs to tmp_path. Verified: before, the run left 6 stray files in the checkout; after, none.

Acceptance hit rate (24 merged churn PRs, one per issue, DB regenerated at main 934a676)

Pack names >=1 file the merged PR changed:

Checklist

Checklist: partial [c:530ba3ea] -- 17/24 (71%) hit rate shown above; the criterion asks that each of >=5 issues name the changed files, which holds for a minority (e.g. #5736, #4707, #5168) and not for all.
Checklist: done [c:fb988c5b] (0.05-0.5 s per pack, --body-file offline, only gh for the issue)
Checklist: done [c:14517a18] (tests incl. the new prior-files cases)
Checklist: done [c:3415db15] (doc fixes in #5532)
Checklist: partial [c:8c9805b3] -- promoter-bot wiring not filed (worker may not file issues); listed as a remaining slice.

Class sweep

Class: "ways a worker finds the code from an issue". Handled: path, function, class, language-stem word, earlier PRs for the same issue. Sibling gaps: none.

Remaining slices

  • promoter-bot: churn worker runs context_pack.py <issue> and puts the output in prompt.md under "Where to look" (acceptance item 5).
  • Orchestrator-side per-commit DB refresh (self_scan.py) before worker launch.
  • Optional: fix the "(Delta Mode)" engine label on full scans (galaxyscope.py:2024; check whether goldens carry it).

Gates

pr_gates --fast 7/7; test_context_pack.py + test_galaxyscope.py + test_source_reads.py 82 pass.

Lessons for agents

  • tests/core_engine/test_galaxyscope.py mocked scans write recorder output to the cwd; run it from tmp_path (now an autouse fixture) or the checkout fills with <name>_galaxy_llm.md and fake_output_*.
  • pr_gates ruff 0.17.0 is cached at ~/.cache/gitgalaxy/ruff-0.17.0/bin/ruff (the 0.16.10 path in the worker doc is a stale directory).

🤖 Generated with Claude Code

…rtifacts into the checkout (Part of #5521)

- context_pack lists files changed by earlier commits mentioning #N (epics name no code).
- test_galaxyscope.py chdirs to tmp_path: its mocked scans wrote <checkout>_galaxy_llm.md
  ("0 analyzed artifact(s), 0 LOC", engine string "(Delta Mode)") into the repo root.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 23, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 23, 2026 03:03
@squid-protocol
squid-protocol enabled auto-merge (squash) October 23, 2026 03:17
@squid-protocol
squid-protocol merged commit 9e9fa8b into main Oct 23, 2026
45 checks passed
@squid-protocol
squid-protocol deleted the churn/5521-20261023T0243Z branch October 23, 2026 03:36
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant