Skip to content

feat: Gaze OpenCode integration, release pipeline, and distribution (Spec 005) - #10

Merged
jflowers merged 10 commits into
unbound-force:mainfrom
jflowers:005-gaze-opencode-integration
Feb 24, 2026
Merged

jflowers merged 10 commits into
unbound-force:mainfrom
jflowers:005-gaze-opencode-integration

Conversation

@jflowers

Copy link
Copy Markdown
Collaborator

Summary

Implements Spec 005: Gaze OpenCode Integration & Distribution. This adds three layers of functionality:

  • Module path migration — Rename Go module from github.com/jflowers/gaze to github.com/unbound-force/gaze across all source files, imports, and documentation
  • Release pipeline — GoReleaser v2 config + GitHub Actions release workflow producing cross-platform binaries (darwin/linux x amd64/arm64) with Homebrew cask auto-publish to unbound-force/homebrew-tap
  • OpenCode integration — New gaze init subcommand (internal/scaffold/ package using embed.FS), gaze-reporter agent, and /gaze command for AI-assisted quality reporting

Changes

Area What Changed
Module path go.mod + 28 source files + testdata + docs migrated to github.com/unbound-force/gaze
Release pipeline .goreleaser.yaml (v2 schema), .github/workflows/release.yml
gaze init internal/scaffold/ package: scaffold.go, scaffold_test.go, embedded assets
CLI cmd/gaze/main.go: initParams, runInit(), newInitCmd() following testable CLI pattern
OpenCode files .opencode/agents/gaze-reporter.md, .opencode/command/gaze.md
CI hardening All actions in all 3 workflows pinned to commit SHAs
Documentation README.md (Homebrew install, gaze init, OpenCode section), AGENTS.md (architecture, CI/CD, packages)
Spec artifacts specs/005-gaze-opencode-integration/ (spec, plan, tasks, research, data-model, contracts, quickstart)

Testing

  • go test -race -count=1 -short ./... — all 11 packages pass
  • goreleaser check — config validates
  • gaze init — creates 4 files correctly with version markers
  • Review council (Adversary/Architect/Guard) — all three APPROVE after 2 iterations of fixes

Review Council Findings Addressed

  • Security: TOCTOU fix in scaffold stat check, CI actions SHA-pinned, ${TMPDIR:-/tmp} in agent files
  • Architecture: Extracted runInit(initParams) testable CLI pattern, proper singular/plural in output
  • Intent: {{.Tag}} preserves v prefix in version marker, CRAPload uses JSON threshold not hardcoded 30

Spec Artifacts

All spec artifacts are committed under specs/005-gaze-opencode-integration/:
spec.md, plan.md, tasks.md (50/50 complete), research.md, data-model.md, contracts/, quickstart.md

…e pipeline

Covers module path migration to unbound-force/gaze, GoReleaser +
Homebrew distribution, gaze init scaffolding, /gaze command, and
gaze-reporter agent across 9 user stories and 3 implementation phases.
Update go.mod, all import paths across 28 source files (83 import
lines), testdata fixtures, JSON Schema URLs, documentation, and
spec artifacts to use the canonical github.com/unbound-force/gaze
module path. This is a prerequisite for the release pipeline and
Homebrew distribution.
Add .goreleaser.yaml (v2 schema) with cross-platform builds for
darwin/linux x amd64/arm64, version injection via ldflags, and
Homebrew cask auto-publish to unbound-force/homebrew-tap.

Add .github/workflows/release.yml triggered on v* tags using
goreleaser-action@v7.

Add version/commit/date build variables and enhanced --version
output to cmd/gaze/main.go.

Include spec 005 planning artifacts: plan.md, tasks.md, research.md,
data-model.md, quickstart.md, and API contracts for gaze init.
Document the manual one-time setup steps required before the first
release: creating the unbound-force/homebrew-tap repo, generating
a PAT, and adding it as a repository secret. Verified tap repo
exists at github.com/unbound-force/homebrew-tap.
Add internal/scaffold package with embed.FS-based asset distribution.
The gaze init command creates .opencode/agents/ and .opencode/command/
directories with 4 files: gaze-reporter agent, doc-classifier agent,
/gaze command, and /classify-docs command.

Features:
- Version marker (<!-- scaffolded by gaze vX.Y.Z -->) on every file
- Skip existing files by default, --force to overwrite
- go.mod absence warning
- Drift detection test comparing embedded assets to .opencode/ source
- 8 tests covering SC-001 through SC-005, US4-AS6

Completes Phase 5 tasks T019-T032.
…itignore, and mark all tasks done

Update README.md with Homebrew install instructions, gaze init command
documentation, OpenCode integration section, and scaffold package in
architecture diagram. Update AGENTS.md with complete package listing,
release workflow in CI/CD, and cleaned Active Technologies/Recent Changes.
Add vendor/, *.out, *.prof* to .gitignore. Run go mod tidy for Go 1.24.6
compatibility. Mark T033-T050 complete in tasks.md after verification.
…tent drift

Security (Adversary):
- Pin all CI actions to commit SHAs across all three workflows
- Fix TOCTOU in scaffold stat check: surface non-ErrNotExist errors
- Use errors.Is(err, fs.ErrNotExist) for go.mod check
- Replace hardcoded /tmp with ${TMPDIR:-/tmp} in agent files
- Unexport AssetContent/AssetPaths (zero-waste: test-only helpers)
- Conditional printSummary header (initialized vs already up to date)
- Fix findProjectRoot test helper to propagate stat errors

Architecture (Architect):
- Extract runInit(initParams) following testable CLI pattern
- Add TestRunInit_CreatesFiles and TestRunInit_ForceFlag
- Fix file(s) singular/plural to match CLI contract
- Change //go:embed assets/* to //go:embed assets

Intent Alignment (Guard):
- Use {{.Tag}} instead of {{.Version}} in GoReleaser ldflags to
  preserve v prefix in version marker per spec FR-003
- Fix CRAPload threshold in gaze-reporter agent: use JSON output
  value instead of hardcoded >= 30
@jflowers
jflowers force-pushed the 005-gaze-opencode-integration branch from 02c66cb to 1c36389 Compare February 24, 2026 00:52
- Add explicit error discards (_, _ =) for fmt.Fprint* calls in
  scaffold.go (errcheck)
- Fix import grouping in report_test.go: third-party before internal
  (gofmt/goimports)
- Add blank lines around headings and lists in AGENTS.md (markdownlint)
- Add language specifier to fenced code block in README.md (markdownlint)
- Add double-space before inline comments on SHA-pinned actions in all
  three workflow files (yamllint)
actions/setup-go was pinned to a non-existent SHA; updated to
40f1582b (v5.6.0). goreleaser-action was pinned to v6.3.0 SHA
instead of v7.0.0; updated to ec59f474 (v7.0.0).
@jflowers
jflowers merged commit 41da1c3 into unbound-force:main Feb 24, 2026
3 checks passed
@jflowers
jflowers deleted the 005-gaze-opencode-integration branch March 2, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant