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: investigate goal fidelity findings before replay

[._.]/ Adam Eivy5540e261f0e9
diff --git a/server/lib/goalFidelityFollowUp.js b/server/lib/goalFidelityFollowUp.js
index 44726432b1..98f1aa5482 100644
--- a/server/lib/goalFidelityFollowUp.js
+++ b/server/lib/goalFidelityFollowUp.js
@@ -257,17 +257,19 @@ export function buildGoalFidelityIssue({ task, review, fingerprint }) {
export function buildGoalFidelityFollowUpTask({ task, review, fingerprint, issue = null, falsePositiveBlock = null }) {
const subject = firstLine(task?.description) || 'a CoS agent task';
const objective = taskObjective(task) || subject;
- const header = `[Auto] Reconcile goal-fidelity ${review?.verdict} [${fingerprint}]: ${subject}`;
+ const header = `[Auto] Investigate goal-fidelity ${review?.verdict} [${fingerprint}]: ${subject}`;
const claim = issue?.url
- ? `## If the finding is right\nClaim ${issue.number ? `#${issue.number}` : 'the filed issue'} (${issue.url}) and ship the reconciliation through the project's normal claim flow.`
- : `## If the finding is right\nRe-read the task above against what actually shipped, then reconcile the two. Ship the change through the project's normal PR flow.`;
+ ? `## If the finding is right\nClaim ${issue.number ? `#${issue.number}` : 'the filed issue'} (${issue.url}) and implement the missing work through the project's normal PR flow.`
+ : `## If the finding is right\nImplement the missing work through the project's normal PR flow.`;
return [
header,
- `## What happened\nA goal-fidelity review of the finished run for task \`${task?.id || 'unknown'}\` returned **${review?.verdict}**: the diff does not deliver the stated objective.`,
+ `## Investigation mandate\nThis is a diagnostic follow-up, not a re-run of the original agent task. Independently verify the finding against the original acceptance criteria, the current default-branch code, the finished run's diff, and relevant tests before changing anything. Do not assume the review is correct merely because it named a gap.`,
+ `## What happened\nA goal-fidelity review of the finished run for task \`${task?.id || 'unknown'}\` returned **${review?.verdict}**: the diff was judged not to deliver the stated objective. The finding below is the reason for the investigation, not an instruction to repeat the task.`,
`## What was asked\n${objective}`,
`## Named as missing\n${bulletList(review?.missing, '_Nothing specific._')}`,
`## Named as unrequested\n${bulletList(review?.unrequested, '_Nothing specific._')}`,
falsePositiveBlock,
+ `## If the original work is already correct\nDo not manufacture a code change or re-run the original task. Report the concrete evidence that the objective was delivered and use the supplied calibration-report instructions to record what the fidelity checker misunderstood, so the checker can be fixed without weakening unrelated safeguards.`,
claim,
].filter(Boolean).join('\n\n');
}
diff --git a/server/lib/goalFidelityFollowUp.test.js b/server/lib/goalFidelityFollowUp.test.js
index b15f2ca427..f1dd63c027 100644
--- a/server/lib/goalFidelityFollowUp.test.js
+++ b/server/lib/goalFidelityFollowUp.test.js
@@ -246,7 +246,7 @@ describe('buildGoalFidelityFollowUpTask', () => {
});
expect(body).toContain('#42');
expect(body).toContain('https://example.com/issues/42');
- expect(body).toContain('claim flow');
+ expect(body).toContain('normal PR flow');
});
it('restates the finding when no issue was filed', () => {
@@ -267,7 +267,14 @@ describe('buildGoalFidelityFollowUpTask', () => {
fingerprint,
});
expect(body).toContain('## What was asked\nComplete the requested change\n\nAlso verify the shipped outcome and preserve the existing contract.');
- expect(body).toContain('Re-read the task above against what actually shipped');
+ expect(body).toContain('This is a diagnostic follow-up, not a re-run of the original agent task.');
+ });
+
+ it('makes independent verification the first action and calibrates false positives', () => {
+ const body = buildGoalFidelityFollowUpTask({ task, review: review(), fingerprint });
+ expect(body).toContain('Independently verify the finding against the original acceptance criteria');
+ expect(body).toContain('Do not manufacture a code change or re-run the original task.');
+ expect(body.indexOf('## Investigation mandate')).toBeLessThan(body.indexOf('## If the finding is right'));
});
// The fingerprint rides in the headline for the same reason the investigation