Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

self-review: run the standardize refusal check whenever an appId is supplied

[._.]/ Adam Eivy388cf26611f2
diff --git a/client/src/pages/CreateApp.jsx b/client/src/pages/CreateApp.jsx
index 6aa2200310..89f42a3faf 100644
--- a/client/src/pages/CreateApp.jsx
+++ b/client/src/pages/CreateApp.jsx
@@ -545,7 +545,7 @@ export default function CreateApp() {
{standardizeResult && (
<Banner tone="success" size="md">
<p className="font-medium flex items-center gap-2">
- <Wrench size={14} /> PM2 Config Standardized
+ <Wrench size={14} aria-hidden="true" /> PM2 Config Standardized
</p>
{standardizeResult.backupBranch && (
<p className="text-xs text-gray-400 mt-1">
diff --git a/server/routes/standardize.js b/server/routes/standardize.js
index c333db6875..8a17cbbd3b 100644
--- a/server/routes/standardize.js
+++ b/server/routes/standardize.js
@@ -8,13 +8,14 @@ const router = Router();
/**
* Resolve the repo to standardize from `repoPath` or `appId`.
*
- * An `appId` also gets the precondition check: standardization rewrites the
- * target repo, so an app PortOS never runs under PM2 (and PortOS itself) is
- * refused here rather than relying on the button being hidden in the UI.
+ * Whenever an `appId` names a real record, it gets the precondition check —
+ * even alongside an explicit `repoPath`, so passing both can't smuggle a
+ * refused app past the gate. Standardization rewrites the target repo, so an
+ * app PortOS never runs under PM2 (and PortOS itself) is refused here rather
+ * than relying on the button being hidden in the UI. A bare `repoPath` has no
+ * app record to type-check, so it is taken at face value.
*/
async function resolveStandardizeTarget({ repoPath, appId }) {
- if (repoPath) return repoPath;
-
if (appId) {
const app = await appsService.getAppById(appId);
if (!app) {
@@ -24,9 +25,11 @@ async function resolveStandardizeTarget({ repoPath, appId }) {
if (refusal) {
throw new ServerError(refusal, { status: 400, code: 'NOT_STANDARDIZABLE' });
}
- return app.repoPath;
+ return repoPath || app.repoPath;
}
+ if (repoPath) return repoPath;
+
throw new ServerError('Either repoPath or appId is required', { status: 400, code: 'MISSING_PATH' });
}