DEV-000069 continuation: allow resolved attention continued outcomes #65

Merged
m merged 1 commits from codex/dev-000069-response-outcome-fix into main 2026-08-17 17:49:52 +00:00
2 changed files with 49 additions and 0 deletions
@@ -0,0 +1,22 @@
BEGIN;
SET ROLE continuity_role;
ALTER TABLE continuity.attention_items
DROP CONSTRAINT IF EXISTS attention_items_response_projection_check;
ALTER TABLE continuity.attention_items
ADD CONSTRAINT attention_items_response_projection_check
CHECK (
state <> 'RESOLVED'
OR (
response_id <> ''
AND response_utterance_id <> ''
AND response_operation IN ('ACKNOWLEDGE','COMPLETE','SNOOZE','CANCEL','DISMISS','CONTINUE','REJECT')
AND response_outcome IN ('USER_REPORTED_COMPLETE','SNOOZED','CANCELLED','DISMISSED','CLARIFICATION_NEEDED','CONTINUED','REJECTED','NOOP')
AND responded_at_unix_millis > 0
)
);
RESET ROLE;
COMMIT;
@@ -0,0 +1,27 @@
package delegatedcontinuity
import (
"os"
"path/filepath"
"strings"
"testing"
)
func TestAttentionResponseProjectionAllowsDelegationContinuationOutcomes(t *testing.T) {
path := filepath.Join("..", "..", "database", "migrations", "026_continuity_attention_response_outcomes.sql")
content, err := os.ReadFile(path)
if err != nil {
t.Fatalf("read migration: %v", err)
}
sql := string(content)
for _, want := range []string{
"attention_items_response_projection_check",
"'CONTINUED'",
"'REJECTED'",
"'CLARIFICATION_NEEDED'",
} {
if !strings.Contains(sql, want) {
t.Fatalf("migration %s must contain %s", path, want)
}
}
}