Delete dead code and stale fixtures before tagging #70

Open
opened 2026-08-09 03:42:52 +02:00 by clawbot · 0 comments
Collaborator

Four pieces of confirmed-dead code and one stale fixture. All verified by
grep against main; none has a production consumer.

Items

  1. internal/models/ — the entire package.
    grep -rl 'internal/models' --include=*.go . matches only
    internal/models/models_test.go. Seven types, ~65 lines, zero
    production consumers, plus a 58-line test that exists solely to give a
    dead package coverage. Delete both, or state concretely why the
    package must stay.

  2. internal/cli/vaultik_snapshot_types.go. Defines
    cli.SnapshotInfo (3 fields). grep -rn 'cli\.SnapshotInfo' returns
    nothing — every real use resolves to the other SnapshotInfo in
    internal/vaultik/helpers.go:61 (6 fields). Two same-named types where
    only one is live is an active trap for the next person. Delete the file.

  3. test-config.yml (repo root). Uses source_dirs,
    min_chunk_size, max_chunk_size, blob_size — none of which exist
    on config.Config (internal/config/config.go:130-151). It would fail
    Validate() today and is referenced by no Go file. Delete it.
    (test/config.yaml and test/integration-config.yml are current —
    leave those alone.)

  4. config set silently reindents the file it promises to preserve.
    README:159-163 claims "Comments and formatting in the file are
    preserved". internal/cli/config.go:384 calls bare yaml.Marshal,
    whose default indent is 4 spaces, while defaultConfigTemplate
    (config.go:36-225) is written with 2. Comments do survive, but the
    first config set reindents the whole file. Fix with
    yaml.NewEncoder + SetIndent(2).

Deliberately excluded: remoteOnlyCell and the
LocallyTracked == false branch (internal/vaultik/snapshot.go:663-671)
are currently unreachable, but they are the correct target state and #64
makes them live. Do not delete them.

Definition of done

  1. Items 1-3 deleted; no dangling imports or references anywhere.
  2. Item 4 fixed, with a test asserting that a config set round-trip
    preserves both comments and 2-space indentation. This is the only
    behavior change in this issue.
  3. grep -rn 'internal/models\|cli\.SnapshotInfo\|test-config\.yml'
    returns nothing outside of history.
  4. Each deletion is its own commit so any of them can be reverted
    independently.
  5. If any item turns out to have a live consumer that grep missed, leave
    it, and say so on this issue rather than forcing the deletion.
  6. make check green.
Four pieces of confirmed-dead code and one stale fixture. All verified by grep against `main`; none has a production consumer. ## Items 1. **`internal/models/` — the entire package.** `grep -rl 'internal/models' --include=*.go .` matches **only** `internal/models/models_test.go`. Seven types, ~65 lines, zero production consumers, plus a 58-line test that exists solely to give a dead package coverage. Delete both, or state concretely why the package must stay. 2. **`internal/cli/vaultik_snapshot_types.go`.** Defines `cli.SnapshotInfo` (3 fields). `grep -rn 'cli\.SnapshotInfo'` returns nothing — every real use resolves to the *other* `SnapshotInfo` in `internal/vaultik/helpers.go:61` (6 fields). Two same-named types where only one is live is an active trap for the next person. Delete the file. 3. **`test-config.yml`** (repo root). Uses `source_dirs`, `min_chunk_size`, `max_chunk_size`, `blob_size` — none of which exist on `config.Config` (`internal/config/config.go:130-151`). It would fail `Validate()` today and is referenced by no Go file. Delete it. (`test/config.yaml` and `test/integration-config.yml` are current — leave those alone.) 4. **`config set` silently reindents the file it promises to preserve.** README:159-163 claims "Comments and **formatting** in the file are preserved". `internal/cli/config.go:384` calls bare `yaml.Marshal`, whose default indent is 4 spaces, while `defaultConfigTemplate` (`config.go:36-225`) is written with 2. Comments do survive, but the first `config set` reindents the whole file. Fix with `yaml.NewEncoder` + `SetIndent(2)`. Deliberately **excluded**: `remoteOnlyCell` and the `LocallyTracked == false` branch (`internal/vaultik/snapshot.go:663-671`) are currently unreachable, but they are the correct target state and #64 makes them live. Do not delete them. ## Definition of done 1. Items 1-3 deleted; no dangling imports or references anywhere. 2. Item 4 fixed, with a test asserting that a `config set` round-trip preserves both comments **and** 2-space indentation. This is the only behavior change in this issue. 3. `grep -rn 'internal/models\|cli\.SnapshotInfo\|test-config\.yml'` returns nothing outside of history. 4. Each deletion is its own commit so any of them can be reverted independently. 5. If any item turns out to have a live consumer that grep missed, leave it, and say so on this issue rather than forcing the deletion. 6. `make check` green.
clawbot added this to the 1.0.0 milestone 2026-08-09 03:42:52 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#70