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

fix: explain why audit quality measurements are rejected

[._.]/ Adam Eivy42bf77de64ad
diff --git a/server/services/appQuality.js b/server/services/appQuality.js
index 2a1033cacf..eebdb3c587 100644
--- a/server/services/appQuality.js
+++ b/server/services/appQuality.js
@@ -9,9 +9,15 @@ export async function recordAuditQuality({ task, taskType, agentId, workspacePat
const contents = await (deps.readFile || tryReadFile)(doneSentinelPath(workspacePath, agentId));
const { summary } = parseSentinelPayload(contents);
const report = parseAuditQualityReport(summary, taskType);
- if (!report) return false;
+ if (!report) {
+ console.warn(`⚠️ Audit quality report missing or invalid for ${agentId} (${taskType})`);
+ return false;
+ }
// Immutable run measurements make completion replay idempotent.
- if (!Number.isFinite(Date.parse(assessedAt))) return false;
+ if (!Number.isFinite(Date.parse(assessedAt))) {
+ console.warn(`⚠️ Audit quality skipped for ${agentId}: no valid run start time`);
+ return false;
+ }
await (deps.ensureSchema || ensureSchema)();
await (deps.query || query)(
`INSERT INTO app_quality_measurements (app_id, category, agent_id, assessed_at, report)
diff --git a/server/services/appQuality.test.js b/server/services/appQuality.test.js
index da9480c767..0f282afb21 100644
--- a/server/services/appQuality.test.js
+++ b/server/services/appQuality.test.js
@@ -32,12 +32,17 @@ describe('scheduled audit measurement workflow', () => {
});
it('rejects malformed, cross-category, duplicate and dishonest coverage reports and failed runs without writing', async () => {
+ const warning = vi.spyOn(console, 'warn').mockImplementation(() => {});
const query = vi.fn();
const run = { task, taskType: 'better-complexity', agentId: 'agent-1', workspacePath: '/repo', success: true, assessedAt };
for (const contents of ['', sentinel(report({ score: 101 })), sentinel(report({ score: '35' })), sentinel(report({ category: 'security' })), sentinel(report({ scannedFiles: 3 })), sentinel(report({ coverage: 'unavailable' })), sentinel(report()) + sentinel(report())]) {
expect(await recordAuditQuality(run, { readFile: async () => contents, query })).toBe(false);
}
expect(await recordAuditQuality({ ...run, success: false }, { readFile: async () => sentinel(report()), query })).toBe(false);
+ expect(warning).toHaveBeenCalledWith('⚠️ Audit quality report missing or invalid for agent-1 (better-complexity)');
+ expect(await recordAuditQuality({ ...run, assessedAt: undefined }, { readFile: async () => sentinel(report()), query })).toBe(false);
+ expect(warning).toHaveBeenLastCalledWith('⚠️ Audit quality skipped for agent-1: no valid run start time');
+ warning.mockRestore();
expect(query).not.toHaveBeenCalled();
expect(parseAuditQualityReport(sentinel(report({ score: 0 })), 'better-complexity')?.score).toBe(0);
});