Repository navigation
Description
Goal
Run Gaze on reading-stone in CI, with reading-stone as Gaze's TypeScript analyzer. Every PR then gets a Gaze quality report on the code it changes, analyzed by the analyzer built from that PR.
What gaze init gives us (nothing to do)
Gaze v2.5.0 gaze init is already applied here. gaze init --force changes no file:
- Agents:
.opencode/agents/divisor-gaze-testing.md,gaze-reporter.mdandgaze-test-generator.mdare present. - Commands:
/gaze,/gaze-fixand/speckit.testrevieware present. - Review council:
divisor-gaze-testingis registered in.uf/review-matrix.yamland.uf/reviewer-capabilities.yaml.
gaze init --ci does not write the CI workflow for this repository:
Warning: skipping CI scaffolding (--ci): the reusable gaze AI-report workflow analyzes ./... from the repository root and requires a Go module there.
Gaze's reusable workflow (reusable_gaze_ai_report.yml) is Go-only:
- it installs Go and takes a Go
coverprofile; - it runs
gaze report ./... --ai=opencodewith no--analyzer.
So reading-stone needs its own job until Gaze's workflow supports external analyzers.
Local proof (Gaze v2.5.0, main at c646a8d)
npm ci && npm run build
npx vitest run --coverage # writes coverage/coverage-final.json (v8 default json reporter)
chmod +x dist/main.js # tsc output has the shebang but not the exec bit
ln -s "$PWD/dist/main.js" <dir-on-PATH>/gaze-analyzer-typescript
gaze report ./src/... --analyzer gaze-analyzer-typescript --format=json- Runtime: about 17 seconds.
- Sections: CRAP, quality, classification and docs all filled in, with no errors.
Results for src/ only:
| Metric | Value |
|---|---|
| Functions | 360 |
| Avg line coverage | 94.8% |
| CRAPload (≥15) | 9 (2.5%, A-) |
| GazeCRAPload (≥15) | 165 (45.8%, F) |
| Tests mapped | 834 |
| Avg contract coverage (quality) | 45.9% |
Gotchas found
- Scope to
./src/.... With the default./..., reading-stone's discovery walks.opencode/; onlynode_modules,dist,build,coverageand.gitare pruned. That adds 645 scaffolded plugin functions, and the numbers sink: 1005 functions at 34% average coverage, CRAPload 280. --language typescriptalone fails withno go.mod found; that's gaze report: honor --language alone for external analyzer dispatch unbound-force/gaze#282. Pass--analyzerexplicitly until that's fixed.dist/main.jsisn't executable aftertsc. Gaze spawns the analyzer binary directly, so it needschmod +x. The other option is to put it on PATH withnpm linkornpm install -g ..
Proposed work
Make it an OpenSpec change, because it's a CI change: spec commit first, then the implementation.
- Add a
gazejob. Either add it toci.ymlor make a separategaze.yml; decide in the design. The job:- checks out the code, sets up Node 24, and runs
npm ciandnpm run build; - runs
npx vitest run --coverage, or reuses thetest (24)job's coverage as an artifact; - sets up Go and runs
go install github.com/unbound-force/gaze/v2/cmd/[email protected], pinned to the version; - exposes
dist/main.jsasgaze-analyzer-typescripton PATH; - runs
gaze report ./src/... --analyzer gaze-analyzer-typescript --format=markdown, writes the result to$GITHUB_STEP_SUMMARY, and uploads the JSON or HTML report as an artifact.
- checks out the code, sets up Node 24, and runs
- Start report-only, with no thresholds. Decide the gates separately; they're governance values, so a maintainer sets them. A baseline from the numbers above:
--max-craploadaround 9–10;- GazeCRAPload and contract coverage are too low to gate yet.
- Permissions:
contents: readonly. No secrets, and no AI adapter (--ai) for now. - Required check: add the job's check name to
ci_checksinrelease.ymlonly if it becomes required.
Out of scope / follow-ups
-
AI-written report (
--ai=opencode) through Gaze's reusable workflow. That needs Gaze upstream to:- make
reusable_gaze_ai_report.ymlaccept an external analyzer and non-Go coverage; - make
gaze init --ciscaffold it for non-Go repos.
It needs its own issue on unbound-force/gaze.
- make
-
Discovery excludes. Reading-stone could prune
.opencode/, or honor.gitignoreor a.gaze.yamlexclude list, so the default./...gives sensible numbers. That's a separate reading-stone change (discovery spec FR-003).
Constitution notes
- Analysis safety (V): the analyzer reads the repository's own source statically. Nothing analyzed is executed beyond the repository's existing test run.
- Testability (IV): the job dogfoods the analyzer built from the PR, so a bad analyzer change fails or skews its own report.
Activity
jflowers commentedon Nov 24, 2026
Upstream tracking for the AI-report follow-up (non-Go support in Gaze's reusable workflow and
gaze init --ci): unbound-force/gaze#375spec: add ci-gaze-report OpenSpec change (Gaze self-report in CI, zer…
ci: run Gaze on reading-stone with the PR's own analyzer build (ci-ga…
spec: add ci-gaze-report OpenSpec change (Gaze self-report in CI, zer…
ci: run Gaze on reading-stone with the PR's own analyzer build (ci-ga…
spec: add ci-gaze-report OpenSpec change (Gaze self-report in CI, #40)
ci: run Gaze on reading-stone with the PR's own analyzer build (ci-ga…