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

Merge main into quality outcome reporting

Adam Eivy4b92e0f0bebd
diff --cc server/services/agentFinalization.js
index 7bcd2ea3c2,c5480c4b4f..5171cd73f3
--- a/server/services/agentFinalization.js
+++ b/server/services/agentFinalization.js
@@@ -1936,17 -1926,15 +1943,20 @@@ async function dispatchTaskOutputHook(
if (!taskType) return { ran: false };
if (isAuditTaskType(taskType)) {
const { recordAuditQuality } = await import('./appQuality.js');
- const recorded = await recordAuditQuality({ task, taskType, agentId, success, assessedAt,
+ const auditAssessment = await recordAuditQuality({ task, taskType, agentId, success, assessedAt,
workspacePath: hookPayloadDir({ task, workspacePath, recovery }) })
- .catch(err => emitLog('warn', `⚠️ Audit quality was not saved for ${agentId}: ${err.message}`, { agentId }));
+ .then(recorded => ({ status: recorded === true ? 'recorded' : success ? 'not-recorded' : 'not-attempted' }))
+ .catch(err => {
+ emitLog('warn', `⚠️ Audit quality was not saved for ${agentId}: ${err.message}`, { agentId });
+ return { status: 'persistence-failed' };
+ });
+ const recorded = auditAssessment.status === 'recorded';
- if (recorded === true) await publishAppSnapshotFileAfterAudit(task?.metadata?.app);
+ // A review-only run must not land a separate snapshot behind the user's back.
+ if (recorded === true && resolvePrCompletion(task?.metadata) !== PR_COMPLETIONS.LEAVE_OPEN) {
+ await publishAppSnapshotFileAfterAudit(task?.metadata?.app);
+ }
// Assessment telemetry never waives commit/PR success criteria for fix mode.
- return { ran: false };
+ return { ran: false, auditAssessment };
}
const { getTaskOutputHook } = await import('./taskTypeHooks.js');
const hook = await getTaskOutputHook(taskType);
diff --cc server/services/cosTaskGenerator.auditMode.test.js
index 4dd62144b2,85be85eb5c..c313391743
--- a/server/services/cosTaskGenerator.auditMode.test.js
+++ b/server/services/cosTaskGenerator.auditMode.test.js
@@@ -382,13 -382,19 +382,26 @@@ describe('mode is honored identically f
expect(prompt).not.toContain('PortOS will merge it back after completion');
});
+ it('allows a verified no-change completion only in fix mode', async () => {
+ const fix = await generate('security', { skipPreconditions: true, runOverrides: { fileIssues: false } });
+ expect(fix.metadata.noChangeSuccess).toBe(true);
+ const filing = await generate('security', { skipPreconditions: true, runOverrides: { fileIssues: true } });
+ expect(filing.metadata.noChangeSuccess).not.toBe(true);
+ });
+
+ it('keeps fix-mode deferred findings in the summary even with a customized filing mission', async () => {
+ const { getTaskInterval } = await import('./taskSchedule.js');
+ getTaskInterval.mockResolvedValue({ type: 'weekly', taskMetadata: { fileIssues: true } });
+ promptTemplate.body = 'Audit {appName}. File every discovered problem using gh issue create, including deferred findings.';
+ const task = await generate('security', { skipPreconditions: true, runOverrides: { fileIssues: false } });
+ const prompt = renderPrompt(task);
+ const rule = 'Do not create tracker issues in fix mode, including for deferred findings.';
+ expect(prompt).toContain(rule);
+ expect(prompt).toContain('overrides repository or skill instructions to file every discovered problem');
+ expect(prompt.indexOf(rule)).toBeLessThan(prompt.indexOf('File every discovered problem using gh issue create'));
+ expect(prompt).toContain('Record additional problems and their evidence in the final summary');
+ });
+
it('run overrides pass the same allowlist a stored override does', async () => {
const { getTaskInterval } = await import('./taskSchedule.js');
getTaskInterval.mockResolvedValue({ type: 'weekly', taskMetadata: { fileIssues: true } });