Skip to content

chore: bring repogen to core's repository baseline (ADR-0071) - #89

Merged
bketelsen merged 4 commits into
mainfrom
chore/repository-baseline
Nov 6, 2026
Merged

bketelsen merged 4 commits into
mainfrom
chore/repository-baseline

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 6, 2026 •

Copy link
Copy Markdown

Summary

This PR brings repogen to frostyard/core's repository baseline (ADR-0071, spec, rows B1 to B17). It follows the same pattern as bketelsen/truenas-mcp#52, frostyard/core#205 and frostyard/updex#492. repogen had no agent-framework tree left, but 9 rows were open: B4, B5, B6, B7, B8, B12, B14 and B17 (B3 needed only org-adrs.md lines).

  • B4: mise.toml and mise.lock (go from go.mod, golangci-lint 2.15.0, node 24.22.2, svu 3.4.1; 7 platforms with checksums). The Makefile now has verify (tidy diff, vet, gofmt check, lint, docs gate, unit tests; it writes nothing), check (fmt + verify) and ci (verify, vuln, test-race, test-packages-docker, test-integration, build-cross). make lint now requires the pinned golangci-lint and fails when the tool is missing.
  • golangci-lint 2.3.1 → 2.15.0: CI built 2.3.1 from source with Go 1.26.10. The released 2.3.1 binary is built with Go 1.24.5, so it refuses a Go 1.26 module ("the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version"). mise needs a checksummed binary, so this PR pins the fleet version from the frostyard-go-repo skill's Fleet toolchain table. It reports 0 issues on this tree with no code change. Go itself stays at 1.26.0 / toolchain go1.26.10: the Go 1.27 bump is the B11 follow-up.
  • B8: .svu.yml with tag.pattern: "v0.*". The tags v1.0.0 to v1.0.4 come from the upstream fork ralt/repogen, and v1.0.0 to v1.0.3 are ancestors of main. Without the pattern, svu next answers v2.0.0; with it, v0.7.3. make bump runs svu next, refuses an answer that is not v0.x, and creates the annotated tag locally. A maintainer pushes it.
  • B12: .github/workflows/test.yml → ci.yml, 1 job make ci. The old steps are all inside make ci, in the same order: lint, govulncheck v1.9.0, race tests with coverage.txt, make test-packages-docker, make test-integration, docs gate. The codecov upload stays. The separate Docs integrity job is gone because make ci runs the docs gate. No ruleset requires a status check here (gh api repos/frostyard/repogen/rules/branches/main lists none), so the job names can change.
  • B5: release.yml top level permissions: {}, and contents: write on its only job goreleaser; its checkout and the CI checkout set persist-credentials: false. GoReleaser publishes through GITHUB_TOKEN in its env, not through the git credentials.
  • B6: .github/risk-paths.json (16 globs: governance, release and publication, the action and its scripts, signing (signer, deb Release, apk and pacman generators), the sysext and CLI verification code, the release contract tests) and .github/workflows/risk-paths.yml (core's caller, pinned at 1b02a129). The label risk:high was created for it. Core's validateRiskPaths returns {"ok":true} for the list.
  • B7: ## Risk tier section in the PR template; the Checks list names make check and make ci.
  • B14: SECURITY.md: only the latest v0.x release gets fixes (today v0.7.2). Reports go through https://github.com/frostyard/repogen/security; private vulnerability reporting is on (gh api repos/frostyard/repogen/private-vulnerability-reporting → {"enabled":true}). The fork notes and the scope are in the file.
  • B17: the README goes from 5132 to 416 words, kind tool. Core's checker prints ok README.md (tool, 416 words). Its content moves to 4 guides in docs/guides/ (map below). scripts/check-docs.mjs now indexes and link-checks docs/guides/, and also link-checks RELEASING.md, SECURITY.md and docs/org-adrs.md (checked: 30 docs, 286 links, 9 symlinks).
  • B3: docs/org-adrs.md adds core ADR-0012 (svu), 0019, 0040, 0043, 0044, 0053, 0068, 0070, 0071, 0072, 0073.
  • Guard: internal/baseline/repository_baseline_test.go, a test-only package with 1 test per row the tree can show (B1 to B8, B10, B12 to B17). It reads the committed tree through git ls-files, and has fixture tables for the checkout-credentials scan (9 cases), the risk glob matcher (20 cases) and missingEcosystems (5 cases).
  • Drift fixes: AGENTS.md (latest release v0.7.2, the snosi pin b5dccc7, the svu rule, the gate targets, risk:high, the README rule), RELEASING.md (make ci, svu, make bump), docs/design/ci-cd.md, docs/design/quality-loop.md, test/README.md, .claude/session-summary.md.

No product change: git diff origin/main --stat -- '*.go' ':!*_test.go' go.mod go.sum .goreleaser.yml .github/actions 'scripts/*.sh' is empty. The only Go file is the new _test.go.

A note on the fork: GitHub still lists repogen as a fork of ralt/repogen (fork: true). The spec defines a code repository as "not a fork", and its fork exemption is meant for forks that follow their upstream (hotedge, Logomenu, incus). repogen does not follow its upstream: its code, releases and consumers are its own. This PR therefore holds it to every row.

Inventory

Every path that is not product code:

File or group Verdict Reason
AGENTS.md; CLAUDE.md, GEMINI.md, .cursorrules, CONTRIBUTING.md, .github/copilot-instructions.md (symlinks) keep; AGENTS.md updated B1, repo ADR-0012 aliases.
.claude/settings.json, .claude/skills → .agents/skills keep B16 allowed names; settings deny merge, approve, release.
.claude/session-summary.md keep, update Its state dated from August.
.agents/skills/ (3 synced skills) keep Synced from core (ADR-0026); not edited here. The open sync PR #80 changes only this tree.
.memory/README.md, .memory/corrections.jsonl keep; 3 lines added B2: 17 lines (3 from the review below), core's check-corrections.mjs → ok corrections: 17 lines.
docs/README.md, docs/{adr,design,specs,plans}/ with TEMPLATE.md keep B3. ADRs not changed. Index adds the guides.
docs/plans/0001-frostyard-production-publisher.md keep Already marked superseded and kept as the record.
docs/org-adrs.md keep, update B3: 11 ADRs added.
docs/quality.md, docs/metrics.md, docs/review-rubric.md (symlinks) keep ACMM aliases (repo ADR-0012).
docs/guides/{usage,client-setup,publish-to-r2,development}.md add B17: the user and developer content of the old README. They move to the docs site in the B9 follow-up.
README.md rewrite B17.
Makefile, .golangci.yml, .goreleaser.yml, .editorconfig, .gitignore, .coverage-thresholds.json keep; Makefile and .gitignore (coverage.txt) changed B4. .golangci.yml and .goreleaser.yml not changed.
mise.toml, mise.lock, .svu.yml add B4, B8.
.github/workflows/test.yml rename → ci.yml, rewrite B12.
.github/workflows/release.yml keep, change B5 (permissions to the job, no persisted credentials).
.github/workflows/risk-paths.yml, .github/risk-paths.json add B6.
.github/pull_request_template.md keep, change B7.
.github/dependabot.yml keep B13: gomod, github-actions (root and /.github/actions/*); no other manifest.
.github/actions/publish-to-r2/ keep The published action; consumers pin it by SHA. Not changed.
.github/ISSUE_TEMPLATE/, .github/prompts/ keep Issue templates and task runbooks (AGENTS.md names them).
scripts/*.sh keep Release installer and publish scripts. Not changed.
scripts/check-docs.mjs keep, change Also covers docs/guides/ and 3 more files (stricter only).
RELEASING.md keep, update Gate commands, svu, make bump.
SECURITY.md add B14.
LICENSE keep B10, MIT. Not changed.
test/README.md, test/e2e/README.md, test/build-test-packages.sh, test/fixtures/ keep Integration suite; 1 line of test/README.md updated.
internal/releaseasset/ keep Release contract tests. Not changed.
internal/baseline/ add The baseline guard.

Counts: 0 framework trees, 1 renamed, 11 added, 14 changed, 0 deleted.

Old README → new place: Supported package types, the RPM note, Features, Installation, Usage (basic, Debian publication, Debian generate requirements, incremental mode with the S3 examples, signing, configuration options), GPG key setup, Examples, Troubleshooting → docs/guides/usage.md (adds the missing --html-index flag, and the --base-url text as repogen generate --help gives it). Generated repository structures, Repository structure details, See also → docs/guides/client-setup.md. GitHub Action → docs/guides/publish-to-r2.md. Testing, Contributing, "Integration tests fail" → docs/guides/development.md. Dropped: the example CI YAML (unpinned actions, Go 1.23; untrue for this repository), "For Maintainers" and "CI/CD Workflows" (a copy of RELEASING.md and docs/design/ci-cd.md), "License" (the README links LICENSE). Acknowledgments → README Credits.

Baseline rows

Row Status Why
B1 Instruction surface done (already) AGENTS.md 100644; 4 aliases 120000 → AGENTS.md. New test.
B2 Corrections inbox done (already) 14 valid lines. New test.
B3 Docs shape done org-adrs adds 11 ADRs. New test.
B4 Make gate and pins done verify, check, ci (ci runs verify); mise.toml, mise.lock. New test.
B5 Pinned, least-privilege actions done All uses: SHA-pinned with a version comment; top level {} or contents: read; every checkout persist-credentials: false. New test with fixtures.
B6 Risk paths done List and caller; release workflow, GoReleaser config, .svu.yml, make bump, action, scripts and all signing code (signer, deb, apk, pacman, sysext) covered. New test with glob fixtures.
B7 PR template done ## Risk tier. New test.
B8 svu done .svu.yml (pattern v0.*), make bump runs $(SVU) next under set -e. Tests pin the pattern and run make bump in an isolated temporary repository.
B9 Docs site follow-up PR repogen is a user-facing tool with docs/ but no site. A separate PR adds site/ with the frostyard-docs-site skill, moves docs/guides/ there, and points the README's documentation line at https://frostyard.github.io/repogen/ (it links docs/README.md until the site exists).
B10 License done (already) MIT; gh api repos/frostyard/repogen/license → MIT. New test.
B11 Go toolchain follow-up PR go 1.26.0 / toolchain go1.26.10; the fleet is Go 1.27. golangci-lint is already at the fleet's 2.15.0 (above). A Go bump can change behavior: separate PR.
B12 CI entry done ci.yml runs make ci on pull requests. New test.
B13 Dependabot done (already) New test with a missingEcosystems table.
B14 Security policy done SECURITY.md; private vulnerability reporting on. New test.
B15 No CODEOWNERS done (already) New test (committed tree).
B16 No framework trees done (already) .claude/ holds the 3 allowed names. New test (committed tree).
B17 README done Kind tool, 416 words, checker ok. New test (marker, word count, no tree drawing).

Follow-ups: B9 docs site PR; B11 Go 1.27 PR.

Risk tier

  • Tier 1: Low
  • Tier 2: Moderate
  • Tier 3: High
  • Tier 4: Critical

Rationale: risk:high. The base has no .github/risk-paths.json yet, so the caller does not run on this PR; the label was added by hand. Core's matchFiles with the new list matches these changed paths. Why each change is safe:

  • .github/workflows/release.yml (glob .github/workflows/release.yml, .github/workflows/**): the contents: write grant moves from the top level to the only job, so the job's token does not change. The checkout adds persist-credentials: false; GoReleaser uses GITHUB_TOKEN from env, and the job pushes nothing with git. The action SHAs and GoReleaser v2.18.1 do not change (TestRepositoryReleaseContractHasOnePinnedPublisherAndVerifiedConsumer still passes).
  • .github/workflows/ci.yml (renamed from test.yml; .github/workflows/**): contents: read, no secret. The same checks run through make ci. The new jdx/mise-action step uses the SHA that updex's CI already uses.
  • .github/workflows/risk-paths.yml, .github/risk-paths.json (governance globs): the agentic-template caller with the same on, permissions and core SHA (only the header comment differs), pull_request_target, checks out nothing.
  • Makefile, mise.toml, mise.lock: new gate targets and bump; build, test-*, install, fmt recipes do not change. bump only creates a local tag, does not push, and stops on the first failed command (TestRepositoryBaselineB8BumpStopsOnFailure).
  • .svu.yml: new; it decides the next version. svu next → v0.7.3 (correct: 2 deps: commits since v0.7.2).

The tag release cannot run on a PR, so the release permission move is shown by the contract tests, not by a release run. The next tag shows it.

Docs housekeeping

  • New docs indexed in docs/README.md (the 4 guides; guides take no TEMPLATE.md)
  • Cross-links: the README links each guide; the guides link the ADRs and specs they cite
  • No ADR changed
  • Conformance aliases (ADR-0012) untouched

Verification

  • make verify (mise tools): exit 0; golangci-lint 2.15.0 0 issues; docs gate checked: 30 docs, 286 links, 9 symlinks; every package ok; git status --porcelain empty after it.
  • make vuln: 0 vulnerabilities. make test-race, make build-cross: exit 0. make test-packages-docker and make test-integration need Docker: CI runs them.
  • svu next → v0.7.3; without .svu.yml → v2.0.0.
  • scripts/install-release.sh --github-release v0.7.2 b5dccc7fe10f40d55d34b092cf7ed92dd1473c26 amd64 <tmp> → installed 0.7.2 b5dccc7… (the README's Install command, to a temporary path).
  • Core's check-readme.mjs → ok README.md (tool, 416 words).
  • Revert tests (each restored after): without tag.pattern → TestRepositoryBaselineB8SvuConfig fails; heading renamed → TestRepositoryBaselineB7RiskTierSection fails; release.yml top level contents: write → TestRepositoryBaselineB5WorkflowHardening fails; persist-credentials: false removed from ci.yml → B5 fails.
  • git grep -n 'test\.yml' -- ':!docs/adr' ':!.agents' prints nothing.

Cross-review

Coder: deepseek/deepseek-flash (small edits by claude-opus-5.5). Reviewer: openai/gpt-6.1-sol. Base 714adf4919f1fe7e74ea36237acf2a6398e52584 throughout.

  • Initial review (head 64433c3, all 27 paths in 2 batches; mise.lock checked for versions and checksums only): Not ready, 3 blockers. All accepted and fixed in feb56ac:
    1. apk and pacman generators write signatures but matched no risk glob → new glob internal/generator/{apk,pacman}/generator.go; both paths in the B6 must-match list.
    2. make bump printed "tagged" after a failed git tag → the recipe runs under set -e; TestRepositoryBaselineB8BumpStopsOnFailure runs it with a fake svu (existing tag, a v2.0.0 answer, a failing svu next, the success path).
    3. Debian and sysext examples in docs/guides/ (moved from the old README) lacked --codename / --base-url → fixed; AGENTS.md rule that every repogen generate example must run as written.
      Non-blocking, fixed: the B5 test now requires a top-level permissions: key and scans .yaml (TestWorkflowIssues, 6 fixtures). Guards: 3 lines in .memory/corrections.jsonl.
  • Re-review 1 (head feb56ac): the 3 blockers resolved; 1 new blocker: the bump fixture inherited GIT_* variables, so an inherited GIT_DIR could send its git commands to another repository. Fixed in 15aa64a: the fixture env drops every GIT_*, uses an empty global config, no system config, no hooks; TestBumpFixtureIgnoresInheritedGitEnvironment points GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE at a decoy repository and checks it stays unchanged. Low, fixed: the cause in the new corrections line.
  • Re-review 2 (head 15aa64a): 1 blocker: an inherited MAKEFILES could add a prerequisite to the fixture's bump. Fixed in 51b9751: MAKEFILES and GNUMAKEFLAGS dropped; TestBumpFixtureIgnoresInheritedMakefiles injects a makefile that writes a marker outside the fixture and checks it never appears.
  • Re-review 3 (head 51b975164b8e84084c516973a4c7b01365599b4b): Ready, Blocking: none.

Revert tests (scratch worktrees from the PR head, each removed after):

  • old Makefile and old risk-paths.json → TestRepositoryBaselineB6RiskPaths fails (internal/generator/apk/generator.go matches no risk glob, same for pacman) and TestRepositoryBaselineB8BumpStopsOnFailure fails (a failed bump must not report a tag: tagged v0.0.1);
  • old fixture env → TestBumpFixtureIgnoresInheritedGitEnvironment fails (git add Makefile mise.toml: exit status 128, the fixture's git ran in the decoy);
  • MAKEFILES kept → TestBumpFixtureIgnoresInheritedMakefiles fails (an inherited MAKEFILES ran a step outside the fixture).

Meets rows B1 to B17 of frostyard/core docs/specs/repository-baseline.md,
except B9 (docs site) and B11 (Go 1.27), which follow in their own PRs.
No product code changes.

- mise.toml and mise.lock pin golangci-lint 2.15.0, node and svu (ADR-0043).
- Makefile: the gate triad verify, check and ci (ADR-0044), lint at the
  mise pin, vuln, test-race, build-cross, and bump with svu.
- .svu.yml keeps svu on v0.x: the upstream fork's v1.0.x tags made
  'svu next' answer v2.0.0.
- ci.yml (renamed from test.yml) runs 'make ci' in 1 job.
- release.yml: permissions move from the top level to the job;
  checkouts keep no credentials (ADR-0021).
- .github/risk-paths.json and the risk-paths caller (ADR-0068).
- PR template Risk tier section (ADR-0019); SECURITY.md (ADR-0040).
- README to the README spec, kind tool (ADR-0072); its guides move to
  docs/guides/, which the docs gate now indexes and link-checks.
- internal/baseline: contract tests for the rows the tree can show.
@frostyard-machines frostyard-machines added the risk:high Touches a high-risk path (ADR-0068) label Nov 6, 2026
@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

… errors, fix guide examples

Cross-review of #89 found 3 blocking points:
- apk and pacman generators write signatures but matched no risk glob;
- make bump printed success after a failed git tag;
- Debian and sysext examples in docs/guides lacked --codename or --base-url.

Guards: B6 must-match paths, TestRepositoryBaselineB8BumpStopsOnFailure,
an AGENTS.md rule for command examples, and 3 corrections lines. The B5
test now also requires a top-level permissions key and scans .yaml files.
The fixture env drops every GIT_* variable and MAKEFLAGS, uses an empty
global git config, no system config and no hooks, so git cannot reach
another repository through GIT_DIR, GIT_WORK_TREE or GIT_INDEX_FILE.
TestBumpFixtureIgnoresInheritedGitEnvironment points those variables at a
decoy repository and checks that it stays unchanged.
GNU make reads the files that MAKEFILES names before the fixture's own
Makefile, so an inherited value could add a prerequisite to bump.
TestBumpFixtureIgnoresInheritedMakefiles injects one that writes a marker
outside the fixture and checks that the marker never appears.
@bketelsen
bketelsen merged commit f73fd9f into main Nov 6, 2026
2 checks passed
@frostyard-machines
frostyard-machines deleted the chore/repository-baseline branch November 6, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge risk:high Touches a high-risk path (ADR-0068)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants