Skip to content

fix(quality): expand glob scope in score() + fill harness-review manifest gaps#46

Merged
agjs merged 2 commits into
mainfrom
fix/quality-glob-scope
Jun 22, 2026
Merged

fix(quality): expand glob scope in score() + fill harness-review manifest gaps#46
agjs merged 2 commits into
mainfrom
fix/quality-glob-scope

Conversation

@agjs

@agjs agjs commented Jun 22, 2026

Copy link
Copy Markdown
Owner

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 — qualityRepair crashes on a glob scope (P2, latent)

score() read each task.files entry literally via Bun.file(join(cwd, file)).text(). But ITask.files is documented as "Editable scope globs" — and Bun.file("…/src/**/*.ts").text() throws ENOENT. So a quality repair on any glob scope died at the first judge call. The same module's snapshotFiles(cwd, task.files) already expands globs, and scopeCode routes through readFilesscore was the odd one out.

Routed score through the shared readFiles walker (globs + dedupe + size-cap), matching scopeCode/snapshotFiles.

Latent, not user-facing today: qualityRepair is exported + tested but not yet wired into the CLI (only reviewRepair is). The untested glob path is itself the gap.

Manifest

docs/harness-subsystems.md had no contract entry for loop/greenfield, review-repair, or file-snapshot — the whole v0.20 surface was uncontracted. Added two entries (repair+snapshot, greenfield) with invariants, risk areas, and test checklists.

Tests

  • New quality.test.ts regression: a src/**/*.ts scope no longer throws and the judge sees both matched files. Flip-confirmed: fails with ENOENT at quality.ts:50 against the old literal read.
  • Full gate green: 1422 pass, 0 fail.

Noted, not fixed (P3)

file-snapshot content cap (128 KiB) + binaries: an edited oversize/binary pre-existing file can't be content-restored on revert, yet a reverted event still fires. Bounded/unlikely for TS-source repair; documented as a manifest risk area.

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/harness-subsystems.md
Comment thread packages/core/src/loop/quality.ts
…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.
@agjs agjs merged commit e1eee1f into main Jun 22, 2026
8 checks passed
@agjs agjs deleted the fix/quality-glob-scope branch June 22, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant