Skip to content

refactor: consume the flat go and react modules - #439

Merged
retr0h merged 8 commits into
mainfrom
refactor/flat-go-module
Aug 15, 2026
Merged

refactor: consume the flat go and react modules#439
retr0h merged 8 commits into
mainfrom
refactor/flat-go-module

Conversation

@retr0h

@retr0h retr0h commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Renames go::<name> call sites to go-<name> across the justfile, both
workflows, CLAUDE.md, and the docs site, and imports go/go.just instead of
loading go.mod.just.

Configuring the modules

The shared modules ship defaults — go_coverage_target := "100",
react_dir := ".". osapi differs on both, so it sets
allow-duplicate-variables and reassigns them:

set allow-duplicate-variables

react_dir := "ui"
go_coverage_target := "99.9"

import? '.just/remote/go.just'

The assignment is in scope when just parses the file, so every way of running a
recipe agrees:

just react-fmt-check                          → All matched files use Prettier code style!
just go-unit-cov-check                        → coverage 100.0% meets target 99.9%
just go_coverage_target=95 go-unit-cov-check  → coverage 100.0% meets target 95%
just test                                     → same as the above

Earlier revisions of this PR configured the modules by exporting environment
variables. That only reaches recipes invoked as child processes, so
just react-fmt-check used the module default while just test used osapi's
value — one command with two answers. See
specs#46.

Why 99.9%

osapi has nine uncovered statements, all guards that cannot execute — six
defense-in-depth validation.Struct() calls on bodies whose fields are all
omitempty, an error return commented "not coverable: gopsutil always succeeds
on a running system"
, and three of the same shape. osapi's own guidance requires
keeping them, so 99.9% is the honest figure rather than a waypoint to 100%.

Declared in .github/codecov.yml as well — change both together.

Also

  • .mise.toml declares just, which it never did. Without it mise had nothing
    to resolve and the shell fell through to Homebrew's 1.45.0 while CI installs
    1.58.0, and the two disagree on formatting a boolean setting. Declared as
    latest, matching how the workflow's setup action floats.
  • just-lint.yml records the just version, so a change in what the setup action
    installs is visible rather than inferred.

Applies converge-justfile-consumption tasks 1.2 and 2.5, and
standardize-repository-layout task 5.1.

🤖 Generated with Claude Code

Renames go::<name> call sites to go-<name> across the justfile, both
workflows, CLAUDE.md and the docs site, and imports go/go.just instead
of loading go.mod.just.

This is what makes osapi's coverage target take effect. Its
`export JUST_COVERAGE_TARGET := "99.9"` never reached the shim module
-- env() resolves against the process environment at parse time -- so
osapi ran against the default 100 and passed only because
`go tool cover -func` rounds its 99.9359% to 100.0%.

With a flat import the consumer assigns go_coverage_target directly:
`just go-unit-cov-check` now reports "meets target 99.9%".

Depends on osapi-justfiles#46.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
retr0h and others added 2 commits August 15, 2026 11:10
The go module no longer ships a default, so the consuming justfile
declares go_coverage_target. Drops set allow-duplicate-variables,
which osapi-io/specs now forbids: it suspends the duplicate check for
every variable in the file to override one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Earlier edits left the old JUST_COVERAGE_TARGET comment orphaned above
react_dir, describing a variable that no longer exists, and a second
comment for the same thing below it.

One comment each, and the coverage note now says why osapi sits below
100%: the nine uncovered statements are unreachable guards, not
missing tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #439   +/-   ##
=======================================
  Coverage   99.94%   99.94%           
=======================================
  Files         484      484           
  Lines       24935    24935           
=======================================
  Hits        24921    24921           
  Misses         14       14           

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f4e518...60282e6. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

retr0h and others added 5 commits August 15, 2026 12:28
Sets allow-duplicate-variables so the react and go module defaults can
be reassigned: react_dir to ui, go_coverage_target to 99.9.

Verified all three invocation styles agree -- run by name, reached
through another recipe, and overridden on the command line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
just 1.58 formats a boolean setting as `set allow-duplicate-variables`
and 1.45 formats it as `set allow-duplicate-variables := true`. There
is no form both accept: each rejects the other's. CI runs the newer
one, so the file matches it.

Both run it identically -- the override resolves to 99.9 under either.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Applies standardize-repository-layout task 5.1a. .mise.toml can only
declare a version that matches CI once we know what the setup action
installs, and nothing prints it today.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
just was not declared, so mise had nothing to resolve and the shell
fell through to Homebrew 1.45.0 while CI installs 1.58.0. That split
is what made this branch fail its justfile format check.

1.58.0 verified from the version step added to just-lint.

Applies standardize-repository-layout task 5.1.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nothing maintains a pin in .mise.toml and the workflow setup action
floats, so pinning here would diverge at the next release. Both
resolve to 1.58.0 today.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@retr0h retr0h changed the title refactor: consume the flat go module refactor: consume the flat go and react modules Aug 15, 2026
@retr0h
retr0h merged commit 6518525 into main Aug 15, 2026
11 checks passed
@retr0h
retr0h deleted the refactor/flat-go-module branch August 15, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant