Skip to content

refactor!: remove legacy migrations and shared/types guards - #302

Merged
Patel230 merged 2 commits into
mainfrom
chore/remove-legacy-migrations
Sep 11, 2026
Merged

Patel230 merged 2 commits into
mainfrom
chore/remove-legacy-migrations

Conversation

@Patel230

@Patel230 Patel230 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes four legacy features that outlived their purpose. Follow-up to #301 (rename back to hawk).

  • hawk credentials migrate — the subcommand, its man-page entry, config.MigrateEnvFileCredentials / gateway.MigrateEnvFileCredentials, and the "plaintext env" developer-path check that pointed at it. credentials status / remove stay.
  • One-time model/provider migration into eyriemigrateStoredModelProvider (called from LoadSettings), SetActiveSelection (its only caller), and the tests covering it.
  • Startup provider-secrets migrationMigrateProviderSecrets / MigrateEngineProviderSecrets, both call sites in cmd/root.go, logMigrateProviderSecretsError, and CatalogMaintenance.MigrateProviderSecrets. The provider.json secrets-on-disk check stays, with a manual fix hint.
  • shared/types guards — the package was already removed; drops scripts/check-shared-types-imports.sh, the contracts-guard Make target, the lefthook hook, the CI step, and the two testaudit tests. The ecosystem boundary guard now checks hawk/internal/ only.
  • Docs updated to match; CHANGELOG gets a Removed section with BREAKING entries. Historical CHANGELOG entries and docs/plans/ are untouched.

Stale settings.json model/provider

Without the migration, a model / provider left in an old ~/.hawk/settings.json would have become a host override over Eyrie's stored selection. LoadGlobalSettings now drops both on load (SaveGlobal already stripped them on save), so Eyrie's selection always wins. Settings.Model / Settings.Provider stay for runtime overrides, and --settings overrides still apply. Covered by TestLoadSettingsUsesUserConfigOnly. docs/SECURITY-DEVELOPER.md no longer says the model is stored in settings.json.

The gateway test stub is also re-run through gofumpt v0.10.0 (the first push failed the format job).

Test plan

  • gofmt -l cmd internal clean
  • go build ./... and go vet on cmd, internal/config, internal/provider, internal/testaudit (GOWORK=off, eyrie v0.6.0 from the public proxy)
  • go test ./cmd/ ./internal/config/... ./internal/provider/gateway/... ./internal/testaudit/...
  • scripts/check-ecosystem-boundaries.sh
  • grep: no references to removed symbols outside CHANGELOG history and docs/plans/
  • CI

🤖 Generated with Claude Code

Patel230 and others added 2 commits September 11, 2026 13:45
- Remove the `hawk credentials migrate` subcommand, its man page entry,
  config/gateway `MigrateEnvFileCredentials` wrappers, and the
  "plaintext env" developer-path check with its helper and test.
- Remove the one-time model/provider settings migration into Eyrie
  (`migrateStoredModelProvider`, `SetActiveSelection`) and its call in
  `LoadSettings`; keep the `Settings.Model`/`Settings.Provider` fields.
- Remove the startup `MigrateProviderSecrets` pass: both cmd/root.go call
  sites, `logMigrateProviderSecretsError` and its tests,
  `MigrateEngineProviderSecrets`, and the method on the gateway
  `CatalogMaintenance` interface, implementation, and test stub. The
  provider.json security check stays with a manual-fix hint.
- Remove the obsolete `shared/types` guards: the import-check script, the
  `contracts-guard` make target, lefthook and CI steps, and the related
  testaudit tests; drop `shared/types` from the ecosystem boundary
  pattern, its template, and the architecture docs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
With the one-time migration gone, a model/provider left in an old
~/.hawk/settings.json would act as a host override over Eyrie's stored
selection. LoadGlobalSettings now drops them (SaveGlobal already did);
--settings overrides still apply. Also gofumpt the gateway test stub.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Patel230
Patel230 merged commit ad15943 into main Sep 11, 2026
26 checks passed
@Patel230
Patel230 deleted the chore/remove-legacy-migrations branch September 11, 2026 08:44
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