fix(quality): expand glob scope in score() + fill harness-review manifest gaps#46
Conversation
score() read each task.files entry literally (Bun.file(glob).text()), which throws ENOENT on a glob scope — and ITask.files is documented as globs. Route it through the shared readFiles walker, matching scopeCode/snapshotFiles. Add a glob-scope regression test (flip-confirmed). Also fill the harness-review manifest gaps: add greenfield + repair/snapshot subsystem contracts.
There was a problem hiding this comment.
Code Review
This pull request documents the repair/snapshot and greenfield loops in docs/harness-subsystems.md, and fixes a bug in packages/core/src/loop/quality.ts where glob patterns in task.files caused ENOENT errors during scoring. A regression test was also added to verify glob expansion. The review feedback highlights a structural issue in the documentation where the new sections break the flow of the existing ## loop / turn invariants, and suggests adding a guard clause in quality.ts to handle cases where no files are resolved by readFiles to avoid sending empty code strings to the LLM.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…ering Address PR #46 review: - score(): an empty resolved scope (glob matched nothing / all over the size cap) returned an empty code window to the judge — unpredictable scoring + a wasted LLM call. Return the floor without calling the judge (degrade, never throw — quality repair is best-effort). Flip-confirmed regression test. - docs: the new repair/snapshot + greenfield sections had been inserted between the loop/turn header and its invariants, splitting that block. Reordered so loop/turn is whole, then the two new subsystem entries follow.
What
Harness-review pass over the freshly-shipped loop-evolution surface (v0.20.x:
file-snapshot,quality,review-repair,greenfield/*, fs rollback resolvers, metrics). One latent correctness bug found and fixed, plus the review manifest brought back in sync.Fix —
qualityRepaircrashes on a glob scope (P2, latent)score()read eachtask.filesentry literally viaBun.file(join(cwd, file)).text(). ButITask.filesis documented as "Editable scope globs" — andBun.file("…/src/**/*.ts").text()throwsENOENT. So a quality repair on any glob scope died at the first judge call. The same module'ssnapshotFiles(cwd, task.files)already expands globs, andscopeCoderoutes throughreadFiles—scorewas the odd one out.Routed
scorethrough the sharedreadFileswalker (globs + dedupe + size-cap), matchingscopeCode/snapshotFiles.Manifest
docs/harness-subsystems.mdhad no contract entry forloop/greenfield,review-repair, orfile-snapshot— the whole v0.20 surface was uncontracted. Added two entries (repair+snapshot, greenfield) with invariants, risk areas, and test checklists.Tests
quality.test.tsregression: asrc/**/*.tsscope no longer throws and the judge sees both matched files. Flip-confirmed: fails with ENOENT atquality.ts:50against the old literal read.Noted, not fixed (P3)
file-snapshotcontent cap (128 KiB) + binaries: an edited oversize/binary pre-existing file can't be content-restored on revert, yet arevertedevent still fires. Bounded/unlikely for TS-source repair; documented as a manifest risk area.