Skip to content

fix(gaze-test-generator): replace advisory compile check with concrete pre-write gate - #206

Open
jflowers wants to merge 1 commit into
unbound-force:mainfrom
jflowers:opsx/fix-test-generator-compile-gate
Open

fix(gaze-test-generator): replace advisory compile check with concrete pre-write gate#206
jflowers wants to merge 1 commit into
unbound-force:mainfrom
jflowers:opsx/fix-test-generator-compile-gate

Conversation

@jflowers

@jflowers jflowers commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

The gaze-test-generator agent's compile verification was advisory
prose only ("ALWAYS verify generated code compiles before reporting
success"). Under context compression or fast-path reasoning, this
check could be skipped, allowing the agent to write non-compiling
test files to disk.

This PR replaces the advisory text with a concrete 3-step pre-write
compile gate protocol using MUST NOT halt language. The agent now
runs go build ./path/to/package/... before any Write or Edit tool
call and halts if compilation fails.

This is a port of the fix from unbound-force/unbound-force#404,
which was incorrectly applied in the unbound-force repo instead of
the gaze repo where the scaffold canonical copy lives.

Fixes: #204

How to Verify

  1. Verify old advisory text is gone:

    grep "ALWAYS verify generated code compiles" \
      internal/scaffold/assets/agents/gaze-test-generator.md
    

    Should return no results.

  2. Verify new protocol is present:

    grep "MUST NOT" internal/scaffold/assets/agents/gaze-test-generator.md
    

    Should return the halt condition.

  3. Verify both copies are identical:

    diff internal/scaffold/assets/agents/gaze-test-generator.md \
         .opencode/agents/gaze-test-generator.md
    
  4. Build and tests pass:

    go build ./...
    go test -race -count=1 -short ./...
    

Key Files Changed

  • .opencode/agents/gaze-test-generator.md — active runtime copy
  • internal/scaffold/assets/agents/gaze-test-generator.md — scaffold canonical copy
  • openspec/changes/fix-test-generator-compile-gate/ — OpenSpec change artifacts

@jflowers jflowers moved this to In Review 👀 in Unbound Force Planning Aug 2, 2026
@jflowers jflowers self-assigned this Aug 2, 2026
@jflowers
jflowers requested a review from yvonnedevlinrh August 2, 2026 17:29

@yvonnedevlinrh yvonnedevlinrh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean behavioural change that tightens a soft advisory into a concrete enforceable gate. Both agent prompt copies are byte-identical. Complete OpenSpec artifacts demonstrate planning rigour. All CI checks pass. No security, accuracy, or constitution concerns.

…e pre-write gate

- Replace "ALWAYS verify generated code compiles" advisory prose with
  a numbered 3-step protocol using MUST NOT halt language
- Agent now runs `go build` before any Write or Edit tool call and
  halts if compilation fails (FR-001)
- Update Output Format section to reference pre-write gate for
  individual file verification vs batch integrity check (FR-003)
- Sync active runtime copy to match scaffold canonical copy
- Add OpenSpec change artifacts (proposal, design, specs, tasks)

Fixes: unbound-force#204
@yvonnedevlinrh
yvonnedevlinrh force-pushed the opsx/fix-test-generator-compile-gate branch from d3e8675 to ac6d400 Compare August 4, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review 👀

Development

Successfully merging this pull request may close these issues.

fix(gaze-test-generator): compile verification before write is advisory prose only

2 participants