refactor: converge duplicated subsystems and document architecture seams #206
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pms-198-converge-subsystems"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Converge the cheap-to-merge structural seams onto a single canonical implementation and record an explicit owner/decision for the seams too large to merge in one change (PMS-198).
Error type: migrate the infisical client/bootstrap/dev modules from the parallel
CoreErrorto the canonicalAppError, then deletesrc/error.rs(and itspub mod error;), removing the deadIntoResponse.Auth extractor: add a
RequireSuperAdminrole extractor (allowed roles = super_admin only) and use it for the four super-admin-only tenant routes (list/create/suspend/activate), replacing hand-rolledif user.role != SuperAdminblocks. The genuinely-mixed handlers (super-admin OR same-tenant) keep their explicit guard.build.rs: extract the duplicated git-hash/describe/build-date capture into a new
build-metadataworkspace crate; the rootbuild.rsandcrates/google-oauth-flow/build.rsnow both callbuild_metadata::emit(git_dir).Worker lifecycle: migrate the raw
tokio::spawn(run_forever(..))DispatcherWorkerandRmmSyncWorkeronto the shared SchedulerJobtrait; they are registered alongside the existing jobs at their former cadences (5s, 60s).Settings:
upsert_tenant_settingnow delegates toput_setting, the single canonicalINSERT ... ON CONFLICTfortenant_settings.RMM:
list_device_mappingsbuilds the optionalconnection_idfilter dynamically viaQueryBuilderinstead of duplicating the whole COUNT+SELECT in an if/else.CI: add
scripts/check-migration-prefixes.nuplus ajust check-migrationsrecipe and a check.yml step that fails when two migrations share a numeric prefix.Docs: add
dev-docs/architecture-seams.mdrecording the dual-auth and dual-billing ownership rules and the canonical-store decisions for the subscription-state (mokosh_auth.subscriptionscanonical, no cross-schema FK) and dual-users (mokosh_auth.userscanonical,public.usersfrozen) divergences.#PMS-198
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com