Skip to content

refactor(server-core): remove vault module and robot sync service - #2978

Merged
tada5hi merged 1 commit into
masterfrom
robot-synchronizer
Apr 13, 2026
Merged

tada5hi merged 1 commit into
masterfrom
robot-synchronizer

Conversation

@tada5hi

@tada5hi tada5hi commented Apr 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Breaking Changes
    • Removed Vault module and integration from the application
    • Robot endpoints no longer synchronize with Vault during create, update, or delete operations
    • Removed robot integrity check endpoint (/:id/integrity)
    • Removed all Vault-related configuration options

@coderabbitai

coderabbitai Bot commented Apr 13, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR removes the Vault module and Robot synchronization service from the application, including all related configuration parsing, dependency injection wiring, and controller integration. The changes span the application builder, configuration system, service layer, and robot controller.

Changes

Cohort / File(s) Summary
Robot Controller
apps/server-core/src/adapters/http/controllers/entities/robot/module.ts
Removed robot synchronization service calls from add, edit, put, and drop endpoints. Deleted the /:id/integrity HTTP handler and handleIntegrity method that performed robot secret verification and syncing.
Vault Module Removal
apps/server-core/src/app/modules/vault/*
Completely removed vault module implementation files including module.ts (VaultModule class), index.ts (barrel exports), and constants.ts (VaultInjectionKey token).
Application Wiring
apps/server-core/src/app/builder.ts, apps/server-core/src/app/factory.ts, apps/server-core/src/app/modules/constants.ts
Removed Vault module support from ApplicationBuilder (withVault() method, default factory entry), removed .withVault() call from createApplication(), and removed ModuleName.VAULT enum entry.
Configuration System
apps/server-core/src/app/modules/config/*
Removed vault property throughout: deleted from types.ts Config type, removed from constants.ts enum, removed validation from parse.ts Zod schema, removed vault: false default from normalize.ts, and removed vault parsing from read/env.ts and read/fs.ts.
Robot Synchronization Service
apps/server-core/src/services/robot-synchronization/*
Completely removed robot synchronization service module: deleted module.ts (RobotSynchronizationService class), singleton.ts (singleton provisioning and access functions), and index.ts (barrel exports).
Module Exports
apps/server-core/src/app/modules/index.ts, apps/server-core/src/services/index.ts, apps/server-core/src/index.ts
Removed barrel re-exports of vault module and robot synchronization service from module and package entry points.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 The vault has closed, the sync has ceased,
No robots dance to harmony's feast,
The robot whispers fade away,
Simpler paths now light the day,
Onward bound with lighter load! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main changes: removal of the vault module and robot synchronization service from the server-core application.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch robot-synchronizer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/server-core/src/adapters/http/controllers/entities/robot/module.ts (1)

176-179: ⚠️ Potential issue | 🟠 Major

Treat /robots/:id/integrity removal as a breaking API change.

Deleting this handler changes the public HTTP surface, not just internal wiring. Please land the matching spec/client/release-note update with the same rollout; otherwise existing callers will only discover the change through 404s.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/server-core/src/adapters/http/controllers/entities/robot/module.ts`
around lines 176 - 179, The DELETE handler for the '/robots/:id/integrity'
endpoint was removed from the Robot module (the route method annotated for
'/:id/integrity' / the DDelete handler), which is a breaking public API change;
either restore the endpoint or, if intentionally removed, update the OpenAPI
spec/client SDK and add a release-note and coordinated rollout entry so
consumers don't hit unexpected 404s. Locate the removed route handler (the
DDelete '/:id/integrity' method in the Robot controller) and either re-add it or
modify the API spec, regenerate the client, add integration tests verifying the
change, and add a clear release-note/deprecation plan to the release process so
the change lands atomically with the code.
🧹 Nitpick comments (1)
apps/server-core/src/adapters/http/controllers/entities/robot/module.ts (1)

85-95: Plan decommission cleanup for already-synced robot credentials.

These write paths now only mutate the primary store. If older releases have already pushed robot secrets into Vault or another sync target, updates stop propagating and deletes stop cleaning those copies up after this rollout.

Also applies to: 179-230

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/server-core/src/adapters/http/controllers/entities/robot/module.ts`
around lines 85 - 95, The add/update/delete write paths (e.g., controller method
add calling this.service.save, and similar handlers around lines 179-230) only
mutate the primary store but must also remove or reconcile any previously-synced
robot credentials in external sync targets (Vault, etc.) from older releases;
modify the controller/service flow so that after save/update/delete you invoke
the existing cleanup/sync routine (or add one) to locate and purge legacy
secrets from external targets (callable from the controller after
buildActorContext and after this.service.save/this.service.delete), ensure the
cleanup is idempotent and runs async or as a background job if long-running, and
surface/log failures via processLogger or the request logger so missed remote
copies can be retried.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@apps/server-core/src/adapters/http/controllers/entities/robot/module.ts`:
- Around line 176-179: The DELETE handler for the '/robots/:id/integrity'
endpoint was removed from the Robot module (the route method annotated for
'/:id/integrity' / the DDelete handler), which is a breaking public API change;
either restore the endpoint or, if intentionally removed, update the OpenAPI
spec/client SDK and add a release-note and coordinated rollout entry so
consumers don't hit unexpected 404s. Locate the removed route handler (the
DDelete '/:id/integrity' method in the Robot controller) and either re-add it or
modify the API spec, regenerate the client, add integration tests verifying the
change, and add a clear release-note/deprecation plan to the release process so
the change lands atomically with the code.

---

Nitpick comments:
In `@apps/server-core/src/adapters/http/controllers/entities/robot/module.ts`:
- Around line 85-95: The add/update/delete write paths (e.g., controller method
add calling this.service.save, and similar handlers around lines 179-230) only
mutate the primary store but must also remove or reconcile any previously-synced
robot credentials in external sync targets (Vault, etc.) from older releases;
modify the controller/service flow so that after save/update/delete you invoke
the existing cleanup/sync routine (or add one) to locate and purge legacy
secrets from external targets (callable from the controller after
buildActorContext and after this.service.save/this.service.delete), ensure the
cleanup is idempotent and runs async or as a background job if long-running, and
surface/log failures via processLogger or the request logger so missed remote
copies can be retried.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2cb92df8-2b05-4146-8985-0dac59ad8c0d

📥 Commits

Reviewing files that changed from the base of the PR and between 0c9a717 and 9cba9d7.

📒 Files selected for processing (19)
  • apps/server-core/src/adapters/http/controllers/entities/robot/module.ts
  • apps/server-core/src/app/builder.ts
  • apps/server-core/src/app/factory.ts
  • apps/server-core/src/app/modules/config/constants.ts
  • apps/server-core/src/app/modules/config/normalize.ts
  • apps/server-core/src/app/modules/config/parse.ts
  • apps/server-core/src/app/modules/config/read/env.ts
  • apps/server-core/src/app/modules/config/read/fs.ts
  • apps/server-core/src/app/modules/config/types.ts
  • apps/server-core/src/app/modules/constants.ts
  • apps/server-core/src/app/modules/index.ts
  • apps/server-core/src/app/modules/vault/constants.ts
  • apps/server-core/src/app/modules/vault/index.ts
  • apps/server-core/src/app/modules/vault/module.ts
  • apps/server-core/src/index.ts
  • apps/server-core/src/services/index.ts
  • apps/server-core/src/services/robot-synchronization/index.ts
  • apps/server-core/src/services/robot-synchronization/module.ts
  • apps/server-core/src/services/robot-synchronization/singleton.ts
💤 Files with no reviewable changes (18)
  • apps/server-core/src/app/modules/constants.ts
  • apps/server-core/src/app/factory.ts
  • apps/server-core/src/app/modules/index.ts
  • apps/server-core/src/app/modules/config/constants.ts
  • apps/server-core/src/app/modules/vault/index.ts
  • apps/server-core/src/app/modules/vault/constants.ts
  • apps/server-core/src/app/modules/config/normalize.ts
  • apps/server-core/src/app/modules/config/types.ts
  • apps/server-core/src/app/modules/config/read/env.ts
  • apps/server-core/src/services/robot-synchronization/index.ts
  • apps/server-core/src/app/modules/config/read/fs.ts
  • apps/server-core/src/services/index.ts
  • apps/server-core/src/index.ts
  • apps/server-core/src/app/modules/config/parse.ts
  • apps/server-core/src/app/builder.ts
  • apps/server-core/src/services/robot-synchronization/singleton.ts
  • apps/server-core/src/services/robot-synchronization/module.ts
  • apps/server-core/src/app/modules/vault/module.ts

@tada5hi
tada5hi merged commit 1a41a59 into master Apr 13, 2026
8 checks passed
@tada5hi
tada5hi deleted the robot-synchronizer branch April 13, 2026 21:13
tada5hi added a commit that referenced this pull request Jun 12, 2026
… up review findings

Base the non-production dev-origin seeding on the parsed config env (falling back to process NODE_ENV) so normalizeConfig({ env: 'production' }) no longer widens the trusted-origin allowlist. Clarify the trustedOrigins doc comment (full origins, no path) and drop the dead config.vault assignment from the test factory (vault module removed in #2978).
tada5hi added a commit that referenced this pull request Jun 12, 2026
…pt scheme-less hosts (#3120)

* feat(server-core)!: rename additionalDomains to additionalOrigins & accept scheme-less hosts

An additionalOrigins entry may now be a bare host[:port] (e.g. hub.local), which expands to both its http and https origin; entries with an explicit protocol contribute exactly that origin. normalizeConfig canonicalizes the list to bare origins (expansion + dedupe), and config validation moved from a plain zod object schema to the validup + zod ConfigValidator, making parseConfig/normalizeConfig async. ConfigModule additionally accepts a lazy config factory.

BREAKING CHANGE: the config key additionalDomains and the environment variable ADDITIONAL_DOMAINS were renamed to additionalOrigins / ADDITIONAL_ORIGINS.

* feat(server-core)!: rename trusted-origin config to trustedOrigins

additionalOrigins / ADDITIONAL_ORIGINS becomes trustedOrigins / TRUSTED_ORIGINS — the list is the trusted first-party app-origin set, not generic extra origins. Also corrects the stale config doc comment claiming the list drives CORS (decoupled in #3117).

* fix(server-core): respect supplied env for dev-origin seeding & clean up review findings

Base the non-production dev-origin seeding on the parsed config env (falling back to process NODE_ENV) so normalizeConfig({ env: 'production' }) no longer widens the trusted-origin allowlist. Clarify the trustedOrigins doc comment (full origins, no path) and drop the dead config.vault assignment from the test factory (vault module removed in #2978).

* fix(server-core): harden config validation per audit findings

- expandToOrigins rejects non-http(s) protocols (a myapp:// entry previously contributed the literal origin "null" to the web client's redirect allowlist)
- parseConfig throws on non-object input instead of silently booting a default config
- ConfigValidator mounts are driven from a Record<keyof Config, ValidatorDescriptor> map, restoring compile-time exhaustiveness — an unmounted Config key now fails the build instead of being silently stripped
- normalizeConfig is the single owner of trusted-origin canonicalization; getAppOrigins merges entries verbatim instead of re-expanding
- an explicit port of 0 (OS-assigned) survives env reading and normalization (falsy checks replaced with undefined checks)
- redis/smtp are validated as string | boolean | object instead of z.any()
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