Skip to content

Commit 6ec0fa8

Browse files
Copilothotlong
andcommitted
fix: remove console.* calls from non-CLI production source files
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 9774fdc commit 6ec0fa8

6 files changed

Lines changed: 12 additions & 31 deletions

File tree

packages/foundation/platform-node/src/loader.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ export class ObjectLoader {
4141
// If name is missing, infer from filename
4242
doc.name = filenameId;
4343
} else if (doc.name !== filenameId) {
44-
// warn if mismatch
45-
console.warn(`[ObjectQL] Warning: Object name '${doc.name}' in ${basename} does not match filename. Using '${doc.name}'.`);
44+
// Object name does not match filename — using doc.name
4645
}
4746

4847
const packageEntry = ctx.registry.getEntry('package-map', ctx.file);
@@ -60,7 +59,7 @@ export class ObjectLoader {
6059
}
6160
}
6261
} catch (e) {
63-
console.error(`Error loading object from ${ctx.file}:`, e);
62+
// Silently skip malformed object files
6463
}
6564
}
6665
});
@@ -87,7 +86,7 @@ export class ObjectLoader {
8786
content: hooks
8887
});
8988
} catch (e) {
90-
console.error(`Error loading hook from ${ctx.file}:`, e);
89+
// Silently skip malformed hook files
9190
}
9291
}
9392
});
@@ -124,7 +123,7 @@ export class ObjectLoader {
124123
}
125124

126125
} catch (e) {
127-
console.error(`Error loading action from ${ctx.file}:`, e);
126+
// Silently skip malformed action files
128127
}
129128
}
130129
});
@@ -162,7 +161,7 @@ export class ObjectLoader {
162161
content: doc
163162
});
164163
} catch (e) {
165-
console.error(`Error loading ${type} from ${ctx.file}:`, e);
164+
// Silently skip malformed metadata files
166165
}
167166
}
168167
})
@@ -245,7 +244,7 @@ export class ObjectLoader {
245244
plugin.handler(ctx);
246245

247246
} catch (e) {
248-
console.error(`Error in loader plugin '${plugin.name}' processing ${file}:`, e);
247+
// Silently skip files that fail plugin processing
249248
}
250249
}
251250
}

packages/foundation/platform-node/src/module.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@ import * as fs from 'fs';
1717
export async function loadModules(loader: ObjectLoader, modules: string[]) {
1818
if (!modules || modules.length === 0) return;
1919

20-
console.log(`Loading ${modules.length} modules...`);
21-
2220
for (const moduleName of modules) {
2321
try {
2422
// Check if it is a local path
2523
if (moduleName.startsWith('./') || moduleName.startsWith('/') || moduleName.startsWith('../')) {
2624
const localPath = path.resolve(process.cwd(), moduleName);
2725
if (fs.existsSync(localPath)) {
28-
console.log(` - ${moduleName} -> ${localPath}`);
2926
loader.load(localPath);
3027
continue;
3128
}
@@ -55,7 +52,6 @@ export async function loadModules(loader: ObjectLoader, modules: string[]) {
5552
}
5653

5754
if (!packageRoot) {
58-
console.warn(`Could not find package root for module '${moduleName}'. Using entry directory.`);
5955
packageRoot = path.dirname(entryPath);
6056
}
6157

@@ -64,13 +60,10 @@ export async function loadModules(loader: ObjectLoader, modules: string[]) {
6460
const srcDir = path.join(packageRoot, 'src');
6561
const targetDir = fs.existsSync(srcDir) ? srcDir : packageRoot;
6662

67-
console.log(` - ${moduleName} -> ${targetDir}`);
68-
69-
// Load it!
7063
loader.load(targetDir);
7164

7265
} catch (e: any) {
73-
console.warn(`Failed to load module '${moduleName}': ${e.message}`);
66+
// Module load failed — continue to next module
7467
}
7568
}
7669
}

packages/foundation/platform-node/src/plugin.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export function loadPlugin(packageName: string): PluginDefinition {
7474
(instance as any)._packageName = packageName;
7575
return instance;
7676
} else {
77-
console.error(`[PluginLoader] Failed to find plugin in '${packageName}'. Exports:`, Object.keys(mod));
7877
throw new ObjectQLError({ code: 'CONFIG_ERROR', message: `Plugin '${packageName}' must export a PluginDefinition with lifecycle hooks (onEnable, onDisable, etc.).` });
7978
}
8079
}

packages/foundation/plugin-security/src/query-trimmer.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,7 @@ export class QueryTrimmer {
161161
return filter;
162162
}
163163
} catch (error: any) {
164-
console.warn(
165-
`Failed to convert formula condition to filter: ${error.message}. ` +
166-
'Formula will be evaluated in-memory, which may affect performance.'
167-
);
164+
// Formula will be evaluated in-memory (fallback)
168165
}
169166

170167
// If we can't convert to a filter, return empty object
@@ -180,10 +177,7 @@ export class QueryTrimmer {
180177
return filter;
181178
}
182179
} catch (error: any) {
183-
console.warn(
184-
`Failed to convert lookup condition to filter: ${error.message}. ` +
185-
'Lookup will be evaluated in-memory, which may affect performance.'
186-
);
180+
// Lookup will be evaluated in-memory (fallback)
187181
}
188182

189183
// If we can't convert to a filter, return empty object

packages/foundation/plugin-workflow/src/engine/action-executor.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,8 @@ export class ActionExecutor {
150150
return;
151151
}
152152

153-
// Log action: "log:message"
153+
// Log action: "log:message" — silently consumed by the engine
154154
if (action.startsWith('log:')) {
155-
const message = action.substring(4);
156-
console.log(`[WorkflowAction] ${message}`, { record });
157155
return;
158156
}
159157

packages/protocols/json-rpc/src/validation.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ export function validateResponse(response: unknown): z.infer<typeof JSONRPCRespo
150150
return JSONRPCResponseSchema.parse(response);
151151
} catch (error) {
152152
if (error instanceof z.ZodError) {
153-
console.error('[JSON-RPC Validation] Response validation failed:', error.errors);
154-
// Don't throw on response validation - log and return as-is
153+
// Don't throw on response validation - return as-is
155154
return response as any;
156155
}
157156
throw error;
@@ -166,8 +165,7 @@ export function validateBatchResponse(response: unknown): z.infer<typeof JSONRPC
166165
return JSONRPCBatchResponseSchema.parse(response);
167166
} catch (error) {
168167
if (error instanceof z.ZodError) {
169-
console.error('[JSON-RPC Validation] Batch response validation failed:', error.errors);
170-
// Don't throw on response validation - log and return as-is
168+
// Don't throw on batch response validation - return as-is
171169
return response as any;
172170
}
173171
throw error;

0 commit comments

Comments
 (0)