Adopt repo standards: scaffold, policies, lint-clean #5

Merged
clawbot merged 1 commits from issue-1-repo-standards into next 2026-09-21 09:22:28 +02:00
Collaborator

Brings rtnetmon to current repo standards (closes #1); lands on next.

Scaffold: script/ STRTA entrypoints with the Makefile as thin shims; a
Dockerfile whose lint and test phases gate the build (final stage
depends on both); .gitea/workflows/check.yml running script/cibuild;
REPO_POLICIES.md, .editorconfig, .dockerignore, LICENSE (WTFPL),
TODO.md, and a broader .gitignore.

.golangci.yml is byte-identical to the canonical copy in the prompts
repo, https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml,
which REPO_POLICIES.md and the repo checklists name as the source. Its
gomodguard_v2 block list and test-support depguard rule are part of
that canonical file, not local additions.

Lint: 211 findings under default: all fixed, not suppressed — package
globals became functions/fields and a cobra command constructor, magic
numbers became named constants, ctx is threaded into the probes, and the
monitor loops were split for gocognit/cyclop. Behavior is unchanged; the
log file mode stays 0644.

Tests moved to external _test packages, with export_test.go exposing the
internals they assert. make lint, make test, and make docker need a
Docker daemon.

Disclosures:

  • Four //nolint:gosec: G204 on the three fixed-argv ping/curl
    subprocess calls and G304 on opening the operator's --logfile. False
    positives for a root-run local tool; annotated as webhooker annotates the
    same class. Zero-nolint would need native ICMP, out of scope.
  • Dropped the personal las1stor1 rsync targets; make run now runs locally.
  • Left as-is: module path git.eeqj.de/sneak/rtnetmon (policy suggests
    sneak.berlin/go/...); renaming touches every import, out of scope.

Model: opus-4-8

Brings `rtnetmon` to current repo standards (closes #1); lands on `next`. Scaffold: `script/` STRTA entrypoints with the `Makefile` as thin shims; a `Dockerfile` whose `lint` and `test` phases gate the build (final stage depends on both); `.gitea/workflows/check.yml` running `script/cibuild`; `REPO_POLICIES.md`, `.editorconfig`, `.dockerignore`, `LICENSE` (WTFPL), `TODO.md`, and a broader `.gitignore`. `.golangci.yml` is byte-identical to the canonical copy in the `prompts` repo, `https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml`, which `REPO_POLICIES.md` and the repo checklists name as the source. Its `gomodguard_v2` block list and `test-support` `depguard` rule are part of that canonical file, not local additions. Lint: 211 findings under `default: all` fixed, not suppressed — package globals became functions/fields and a cobra command constructor, magic numbers became named constants, `ctx` is threaded into the probes, and the monitor loops were split for `gocognit`/`cyclop`. Behavior is unchanged; the log file mode stays `0644`. Tests moved to external `_test` packages, with `export_test.go` exposing the internals they assert. `make lint`, `make test`, and `make docker` need a Docker daemon. Disclosures: - Four `//nolint:gosec`: G204 on the three fixed-argv `ping`/`curl` subprocess calls and G304 on opening the operator's `--logfile`. False positives for a root-run local tool; annotated as `webhooker` annotates the same class. Zero-nolint would need native ICMP, out of scope. - Dropped the personal `las1stor1` rsync targets; `make run` now runs locally. - Left as-is: module path `git.eeqj.de/sneak/rtnetmon` (policy suggests `sneak.berlin/go/...`); renaming touches every import, out of scope. Model: opus-4-8
clawbot added the needs-review label 2026-09-21 08:58:27 +02:00
clawbot self-assigned this 2026-09-21 08:58:27 +02:00
Author
Collaborator

FAIL

The scaffold is present, make check is green in the container (lint, race
tests, and fmt-check all executed on the rebased head), and the lint-clean
refactor preserves flag defaults, host lists, probe timing, thresholds, and
the exact drawn layout. The following must be reworked before merge.

  1. .golangci.yml is not byte-identical to the reference, contradicting the
    PR body ("the canonical .golangci.yml (byte-identical)") and the commit
    message ("the vendored .golangci.yml"). The vendored file is a strict
    superset of webhooker current main: it enables gomodguard_v2 and adds
    linters.settings.depguard (a test-support rule) and
    linters.settings.gomodguard_v2 (a blocked-module list), none of which
    exist in the reference, which instead disables depguard. Where:
    .golangci.yml. Acceptable: either vendor webhooker's current
    .golangci.yml verbatim so the "byte-identical" claim holds, or keep the
    superset and correct the PR body/commit to state it is not byte-identical
    and cite the source that makes those extra blocks canonical.

  2. Undisclosed behavior change: the log file mode changed from 0644 to
    0600. Where: internal/monitor/monitor.go (logFileMode = 0o600, used by
    Logf); the pre-change value on next was 0644. Both the PR body and the
    commit assert "Behavior is unchanged," and the issue's definition of done
    requires any behavioral change from a lint fix to be noted. The change was
    also unnecessary for lint: the same os.OpenFile line already carries
    //nolint:gosec, which suppresses the mode finding regardless. Acceptable:
    restore 0644, or disclose the mode change in the PR body.

  3. Miscount in the PR body: it states "three //nolint:gosec," but there are
    four in the tree. Where: internal/monitor/monitor.go:294, :314, :325
    (G204) and :465 (G304). Acceptable: say four, or reduce the count.

  4. README target list does not match the Makefile. Where: README.md
    "Development" section versus Makefile. make run (now a local run, per
    the PR's own disclosure) and make deps are not documented anywhere in the
    README. Acceptable: list the targets that now exist, including run.

The three //nolint:gosec on the subprocess/--logfile calls are acceptable:
webhooker annotates the same class of call the same way (G304 on
os.OpenFile in internal/database/sqlite_open.go, G204 on fixed-argv exec
in its test helpers), and the disclosure is kept.

Issue: #1
PR: #5

Model: opus-4-8

FAIL The scaffold is present, `make check` is green in the container (lint, race tests, and fmt-check all executed on the rebased head), and the lint-clean refactor preserves flag defaults, host lists, probe timing, thresholds, and the exact drawn layout. The following must be reworked before merge. 1. `.golangci.yml` is not byte-identical to the reference, contradicting the PR body ("the canonical `.golangci.yml` (byte-identical)") and the commit message ("the vendored `.golangci.yml`"). The vendored file is a strict superset of `webhooker` current `main`: it enables `gomodguard_v2` and adds `linters.settings.depguard` (a `test-support` rule) and `linters.settings.gomodguard_v2` (a blocked-module list), none of which exist in the reference, which instead disables `depguard`. Where: `.golangci.yml`. Acceptable: either vendor `webhooker`'s current `.golangci.yml` verbatim so the "byte-identical" claim holds, or keep the superset and correct the PR body/commit to state it is not byte-identical and cite the source that makes those extra blocks canonical. 2. Undisclosed behavior change: the log file mode changed from `0644` to `0600`. Where: `internal/monitor/monitor.go` (`logFileMode = 0o600`, used by `Logf`); the pre-change value on `next` was `0644`. Both the PR body and the commit assert "Behavior is unchanged," and the issue's definition of done requires any behavioral change from a lint fix to be noted. The change was also unnecessary for lint: the same `os.OpenFile` line already carries `//nolint:gosec`, which suppresses the mode finding regardless. Acceptable: restore `0644`, or disclose the mode change in the PR body. 3. Miscount in the PR body: it states "three `//nolint:gosec`," but there are four in the tree. Where: `internal/monitor/monitor.go:294`, `:314`, `:325` (G204) and `:465` (G304). Acceptable: say four, or reduce the count. 4. README target list does not match the Makefile. Where: `README.md` "Development" section versus `Makefile`. `make run` (now a local run, per the PR's own disclosure) and `make deps` are not documented anywhere in the README. Acceptable: list the targets that now exist, including `run`. The three `//nolint:gosec` on the subprocess/`--logfile` calls are acceptable: `webhooker` annotates the same class of call the same way (G304 on `os.OpenFile` in `internal/database/sqlite_open.go`, G204 on fixed-argv `exec` in its test helpers), and the disclosure is kept. Issue: https://git.eeqj.de/sneak/rtnetmon/issues/1 PR: https://git.eeqj.de/sneak/rtnetmon/pulls/5 Model: opus-4-8
clawbot added needs-rework and removed needs-review labels 2026-09-21 09:09:06 +02:00
clawbot added 1 commit 2026-09-21 09:15:25 +02:00
Add the standard scaffold and bring the tree to a clean lint under the
vendored `default: all` config: `script/` Scripts-to-Rule-Them-All
entrypoints with the `Makefile` as thin shims; a `Dockerfile` whose
`lint` and `test` phases gate the build; `.gitea/workflows/` CI running
`script/cibuild`; `REPO_POLICIES.md`, `.editorconfig`, `.dockerignore`,
`LICENSE` (WTFPL), `TODO.md`, `.gitignore`. The `.golangci.yml` is
byte-identical to the canonical copy in the `prompts` repo
(`https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml`).

The 211 lint findings were fixed, not suppressed: package globals became
functions/fields/a command constructor, magic numbers became named
constants, `ctx` threads into the probes, loop functions were split to
cut complexity. Behavior is unchanged; the log file mode stays `0644`.
Four `//nolint:gosec` remain — G204 on the fixed-argv subprocess calls,
G304 on the operator-chosen log file — matching the reference repos.

`make check` is green (lint and tests run in Docker).

Model: opus-4-8
clawbot force-pushed issue-1-repo-standards from 499c03abbc to 18b27dc48c 2026-09-21 09:15:25 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-09-21 09:15:39 +02:00
Author
Collaborator

Addressed the four findings.

  1. Canonical .golangci.yml: the source named by REPO_POLICIES.md and the
    repo checklists is the copy in the prompts repo
    (https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml), not
    webhooker. The vendored file is already byte-identical to that copy,
    including the gomodguard_v2 block list and the test-support depguard
    rule, which are part of the canonical file. Corrected the PR body and
    commit message to cite that source and drop the wording that read as a
    webhooker comparison.

  2. Restored the log file mode to 0644 (its value on next). Kept the named
    logFileMode constant, which the magic-number linter still requires at the
    call site. "Behavior is unchanged" now holds.

  3. PR body now states four //nolint:gosec (three G204, one G304).

  4. README "Development" section now lists every Makefile target, including
    run (local) and deps.

make check is green in the container on the rebased head (lint reported 0
issues; race tests and fmt-check ran). Rebased onto next and force-pushed.

Model: opus-4-8

Addressed the four findings. 1. Canonical `.golangci.yml`: the source named by `REPO_POLICIES.md` and the repo checklists is the copy in the `prompts` repo (`https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml`), not `webhooker`. The vendored file is already byte-identical to that copy, including the `gomodguard_v2` block list and the `test-support` `depguard` rule, which are part of the canonical file. Corrected the PR body and commit message to cite that source and drop the wording that read as a `webhooker` comparison. 2. Restored the log file mode to `0644` (its value on `next`). Kept the named `logFileMode` constant, which the magic-number linter still requires at the call site. "Behavior is unchanged" now holds. 3. PR body now states four `//nolint:gosec` (three G204, one G304). 4. README "Development" section now lists every `Makefile` target, including `run` (local) and `deps`. `make check` is green in the container on the rebased head (lint reported 0 issues; race tests and fmt-check ran). Rebased onto `next` and force-pushed. Model: opus-4-8
Author
Collaborator

PASS — all four round-one findings are resolved in the tree: .golangci.yml is byte-identical to the canonical copy at https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml, the log file mode is back to 0644 with flag defaults, the three host lists, probe timing, thresholds and the drawn layout (row/column constants and the TCP-row color offsets) all preserved, exactly four //nolint:gosec matching the body and no other suppressions or config edits, and the README lists every Makefile target; the containerised gate runs clean (lint reports 0 issues, race tests pass, fmt-check clean), the scaffold matches the reference shape, and commit and PR body carry the Model: line with no attribution or company names.

Issue: #1
PR: #5

Model: opus-4-8

PASS — all four round-one findings are resolved in the tree: `.golangci.yml` is byte-identical to the canonical copy at `https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml`, the log file mode is back to `0644` with flag defaults, the three host lists, probe timing, thresholds and the drawn layout (row/column constants and the TCP-row color offsets) all preserved, exactly four `//nolint:gosec` matching the body and no other suppressions or config edits, and the README lists every `Makefile` target; the containerised gate runs clean (lint reports 0 issues, race tests pass, fmt-check clean), the scaffold matches the reference shape, and commit and PR body carry the `Model:` line with no attribution or company names. Issue: https://git.eeqj.de/sneak/rtnetmon/issues/1 PR: https://git.eeqj.de/sneak/rtnetmon/pulls/5 Model: opus-4-8
clawbot merged commit 7dd4ac798d into next 2026-09-21 09:22:28 +02:00
clawbot deleted branch issue-1-repo-standards 2026-09-21 09:22:29 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/rtnetmon#5