Skip to content

Audit cleanup: config doctor, snake_case tags, MCP fixes, tests - #6

Merged
htcarr3 merged 3 commits into
mainfrom
improvements-021426
Feb 14, 2026
Merged

Audit cleanup: config doctor, snake_case tags, MCP fixes, tests#6
htcarr3 merged 3 commits into
mainfrom
improvements-021426

Conversation

@htcarr3

@htcarr3 htcarr3 commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

What

Codebase audit against documented rules and best practices, with all findings fixed.

Why

Several patterns had drifted from the conventions documented in .claude/rules/. This brings the codebase back into alignment and adds missing test coverage.

How

Config improvements

  • Rename config validateconfig doctor with --fix flag for auto-correcting legacy camelCase config keys (validate kept as hidden alias)
  • Add config open command to open the config directory in the file manager
  • Change JSON struct tags to snake_case with backwards-compatible unmarshaling via custom UnmarshalJSON
  • Add HasLegacyKeys(), LegacyKeyReplacement(), MigrateKeys() to config package

MCP server fixes

  • Remove CWD fallback from mcpResolveRepo — MCP tools should always use the global registry, not detect from CWD
  • Fix workspace_stop if_running dead code (was checking wrong variable)
  • Add missing ReadOnlyHint annotations on mutating tools

Style & consistency

  • Fix error message style in TUI ("failed to archive""archiving")
  • Update rules docs to clarify intentional ~/.config/fr8/ choice over os.UserConfigDir()

Tests & docs

  • Add flock package tests (lock/unlock, exclusivity, re-lock)
  • Add config open / configDir() test
  • Add MIT license file and link from README
  • Update README, CLAUDE.md, skill templates, and rules for all changes

Test plan

  • go test -race -count=1 ./... — all 18 packages pass
  • go build ./... and go vet ./... clean

…tests

- Rename `config validate` to `config doctor` with `--fix` flag for
  auto-correcting legacy camelCase config keys (validate kept as hidden alias)
- Add `config open` command to open config directory in file manager
- Change JSON struct tags to snake_case with backwards-compatible
  unmarshaling via custom UnmarshalJSON
- Add HasLegacyKeys(), LegacyKeyReplacement(), MigrateKeys() to config pkg
- Remove CWD fallback from mcpResolveRepo (MCP tools use registry only)
- Fix workspace_stop if_running dead code
- Add missing ReadOnlyHint annotations to MCP tools
- Fix error message style in TUI ("failed to archive" → "archiving")
- Add flock package tests (lock/unlock, exclusivity, re-lock)
- Add MIT license file and link from README
- Update rules, docs, and skill templates for all changes
- Wrap defer Close/Unlock in closures to satisfy errcheck
- Convert if-else chain to switch in config doctor
- Remove unused contains and initTestRepo test helpers
Runs build, vet, test, lint, and tidy checks locally to approximate
the GitHub Actions CI pipeline before pushing.
@htcarr3
htcarr3 merged commit 7484e92 into main Feb 14, 2026
6 checks passed
@htcarr3
htcarr3 deleted the improvements-021426 branch February 14, 2026 17:48
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.

1 participant