Repository navigation
Description
Motivation
PR #300 shipped the provider-agnostic reusable workflow (reusable_gaze_ai_report.yml), but adopting it still requires copy-pasting the consumer example from docs/guides/ci-integration.md. The biggest footgun is version pinning: the uses: reference must point at a release tag that actually contains the workflow (first ships in v2.3.0) — older tags fail to resolve at run time. A deterministic installer that knows its own version eliminates this class of failure.
Design decisions (from planning discussion)
- Self-contained starter — the generated workflow owns its test + upload job (checkout → setup-go →
go test -race -count=1 -short -coverprofile=coverage.out ./...→ upload-artifact). No YAML surgery on the consumer's existing workflows. Accepts one extra test run vs. integrating with an existing job; artifact-reuse dedup stays a docs/agent refinement. gaze init --ciflag — extends the existing scaffold rather than adding a new verb. Additive: plaingaze initbehavior is unchanged;--ciadditionally emits.github/workflows/gaze-ai-report.yml.- Report-only by default — no threshold inputs emitted; the workflow exits 0 until a human adds thresholds. Constitution-safe: no tool picks governance gates. Green to commit before the secret exists (the fork-safe skip already validates the artifact handoff).
Scope
gaze init --ci
- Flag
--ciongaze init; Go-module-at-root repos only (matches the reusable workflow's own limitation) — warn whengo.modis absent. - Generated workflow:
on: push(main) + pull_request; caller-owned concurrency group (the CI-012 pattern fromdocs/guides/ci-integration.md)testjob with SHA-pinned actions (same pins the reusable workflow uses); setup-go version read from the consumer'sgo.moddirectivegaze-ai-reportjob:needs: test,permissions: contents: read,uses: unbound-force/gaze/.github/workflows/reusable_gaze_ai_report.yml@<version>,with: coverage-artifact: coverage-out, commented-out threshold inputs (TODO),secrets: opencode-config: ${{ secrets.OPENCODE_CONFIG_CONTENT }}- Provenance header comment
- Version pinning:
- resolved from the build-time version, validated as
>= v2.3.0(first tag containing the workflow) devbuilds fail closed: "install gaze from a release tag or pass--gaze-version"--gaze-versionoverride flag, same validation
- resolved from the build-time version, validated as
- Idempotency: skip-if-present — users edit thresholds in this file, so it must never be clobbered (not added to
isToolOwned); rerun with an existing file reports "skipped (exists)" - Placement:
internal/scaffold/assets/ci/gaze-ai-report.ymltemplate with__GAZE_VERSION__/__GO_VERSION__placeholders; theci/subtree is excluded fromassetPaths()andTestEmbeddedAssetsMatchSource(no.opencode/mirror exists for it) - Console next-steps output (new CI section in
printSummary):gh secret set OPENCODE_CONFIG_CONTENTone-liner,jq -cminify tip, second-secret masking pattern pointer- paste-able threshold-guidance prompt: read the generated workflow, run
gaze report ./... --format=json, propose permissive initial thresholds from the summary metrics, human approves final values, uncomment the threshold inputs
Phase 2 (separate follow-up change): /gaze thresholds
Threshold ratcheting is repeated over a project's life ("start permissive, tighten over time"), so a scaffolded slash command (10th manifest file, commands/gaze-thresholds.md, skip-if-present) earns its place for the recurring ratchet loop; the console prompt covers one-time adoption. Decoupled to keep this change scoped to init.
Implementation surface
internal/scaffold/scaffold.go:Options.CI,Options.GazeVersion, version resolution,ci/subtree handling, template substitution, summary sectioninternal/scaffold/assets/ci/gaze-ai-report.yml(new)cmd/gaze/main.go: init command flag wiring- Tests: version-resolution matrix, golden-file + YAML-parse validation of generated output, skip-if-present rerun, plain-init-untouched, mirror-test exclusion
- Docs:
README.md,docs/reference/cli/init.md,docs/guides/ci-integration.md(install section),AGENTS.mdembedded-asset-list note; yamllint check on the new YAML asset
Spec-level details to settle during propose
- Workflow file name (
gaze-ai-report.ymlvsgaze-report.yml) - Whether a
--ci-onlyvariant (skip.opencode/scaffolding) is worth it upload-artifactaction SHA pin
Process
- OpenSpec change (targeted feature)
- Website docs issue in
unbound-force/website(new user-facing flag) before merge - CI parity from
.github/workflows/test.yml+ mega-linter - Review council (
/uf.review-council) APPROVE before PR
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
feat(unbound-force#306): scaffold reusable AI-report caller workflow …
docs(unbound-force#306): complete website documentation gate (website…
chore(unbound-force#306): capture post-review handoff artifacts befor…
chore(unbound-force#306): fix gitleaksignore SHAs and markdownlint ex…
docs(#306): add openspec change init-ci-scaffold for gaze init --ci
chore(#306): store dewey learnings from spec review dispatch
docs(#306): complete website documentation gate (website#352)
chore(#306): capture post-review handoff artifacts before PR
chore(#306): fix gitleaksignore SHAs and markdownlint exclusions for CI
feat(unbound-force#306): scaffold reusable AI-report caller workflow …