Skip to content

Apply the oss-init conventions and catch stale generated code in CI - #26

Merged
lambdalisue merged 5 commits into
mainfrom
chore/oss-init
Oct 11, 2026
Merged

lambdalisue merged 5 commits into
mainfrom
chore/oss-init

Conversation

@lambdalisue

Copy link
Copy Markdown
Member

Summary

  • Skeleton: each server has a ci recipe (lint, fmt-check, test, build) and the root just ci runs them all plus just fmt-check (dprint and nixfmt across the repository). echo-http/docs/api.md, which had drifted from dprint, is formatted. The flake drops flake-utils and is nixfmt-formatted; .gitignore gains /.envrc, .gitattributes keeps LF.
  • Fix (generated code): the protoc recipes run goimports on their output, so a build no longer rewrites the committed .pb.go/.connect.go files; in CI, generated-check fails when a build changes or adds generated files.
  • Agent guide: CLAUDE.md → AGENTS.md, correcting stale facts (Go version, code generation, CI setup) and dropping the STRICT RULES section, which repeated the gate and language rules and agent-behaviour rules that belong to the agent's configuration. ADR/spec procedures and rules added.
  • CI: each build workflow has one build job (nix-develop + just <server>::ci); a new Format workflow runs just fmt-check on every change. Top-level contents: read, persist-credentials: false, PR runs cancel / main runs finish, docker actions on their latest majors (release notes read; no input changes). Image tags and push triggers unchanged; build.echo-graphql.yml no longer requests id-token.
  • Fix (lint): golangci-lint's local import prefix is the current module path (github.com/probitas-test) instead of github.com/jsr-probitas.

Why

Brings the repository in line with the oss-init conventions used across the org, and makes CI catch what it missed: repository-wide formatting, stale generated code, and formatter failures.

The main ruleset now requires build only (updated to match the single job), so this PR should merge before others opened from the old main.

Test Plan

  • CI=true nix develop -c just ci; the tree stays clean afterwards
  • generated-check fails with stale or untracked generated files; fmt-check fails when gofmt is missing
  • nix flake check --no-build --all-systems, actionlint
  • CI on this PR (build workflows, Format)

🤖 Generated with Claude Code

https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq

lambdalisue and others added 5 commits October 11, 2026 13:56
CI checked each server with its own fmt/lint/test/build steps, and nothing
checked the Markdown, JSON and YAML formatting or the Nix files, so
echo-http/docs/api.md had drifted from dprint. Each server now has a `ci`
recipe (lint, fmt-check, test, build) whose fmt-check fails when the
formatter itself fails, and the root `ci` runs them all plus `fmt-check`,
which runs dprint and nixfmt across the repository. The drifted file is
formatted.

The flake lists its systems with nixpkgs.lib.genAttrs instead of
flake-utils and is formatted with nixfmt, which the dev shell now provides.
The repository ignores its own .envrc and worktrees, and .gitattributes keeps
checkouts LF on every OS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq
protoc writes imports in one block, while the committed files are formatted
with goimports, so every build rewrote the committed .pb.go and .connect.go
files and left the tree dirty. The generate recipes now run goimports on
their output.

Nothing noticed when the committed generated code went stale, either. In CI,
each generating server's `ci` ends with `generated-check`, which fails when
the build changed or added generated files; locally a regenerated diff is
work in progress, so the check stays quiet there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq
A CLAUDE.md makes Claude Code ignore AGENTS.md, and other agents read only
AGENTS.md, so the guide lived where only one tool looked. Its content moves
to AGENTS.md with the layer table, the quality gate, the layout and the
commit convention in use.

Facts that had gone stale are corrected on the way (the Go version, how
code generation runs, the CI setup), and the STRICT RULES section is
dropped: it repeated the quality gate and the language rule already stated
above, and the agent-behaviour rules belong to the agent's own
configuration, not to this repository.

The ADR and spec procedures and the rules that make them get read land now,
so records written from here on follow them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq
The build workflows ran check, test and build as separate jobs, each
wrapping its commands in `nix develop -c`. Each now has one build job that
loads the dev shell with nicknovitski/nix-develop and runs the server's
`ci` recipe, and a new Format workflow runs `just fmt-check` on every
change, since formatting is not tied to one server.

Workflows read the repository by default and widen permissions per job
(build.echo-graphql.yml no longer requests id-token for nothing), checkouts
no longer keep credentials, pull request runs cancel superseded ones while
main and publish runs finish, and the actions are on their latest majors.
The image tags and when images are pushed stay as they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq
golangci-lint grouped imports under github.com/jsr-probitas, the
organization's former name, so the servers' own packages
(github.com/probitas-test/...) were not recognized as local.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq
Copilot AI balanced review requested due to automatic review settings October 11, 2026 05:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@lambdalisue
lambdalisue merged commit a87a64f into main Oct 11, 2026
5 checks passed
@lambdalisue
lambdalisue deleted the chore/oss-init branch October 11, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants