Skip to content

fix(evolution): allow backlog re-queue after executed - #136

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-9903
Draft

fix(evolution): allow backlog re-queue after executed#136
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-9903

Conversation

@cursor

@cursor cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • Fixes a critical evolution governance break: after a proposal is marked executed, the same dedupe_key could never re-enter evolution_backlog because dedupe_key was globally UNIQUE while upsert only updated non-executed rows.
  • Concrete trigger: authorize capability evolution for tool/outcome X → run succeeds (executed) → authorize the same gap again → enqueue returns a phantom proposal_id → forced evolution run logs evolution_proposal_missing and returns NoScope.
  • Approach: migrate away the global UNIQUE, upsert active rows or insert when only executed history remains, and remap coordinator status updates to the persisted active proposal id.

Bug and Impact

  • Bug: Soft-dedupe schema contradicted soft-dedupe logic; executed history permanently blocked re-queue.
  • Impact: User-authorized re-evolution (and same-scope follow-up proposals) silently fails after the first execution for that key.

Root Cause

  • evolution_backlog.dedupe_key TEXT NOT NULL UNIQUE + INSERT OR IGNORE + UPDATE ... WHERE status != 'executed' → both arms no-op once an executed row exists.

Task Linkage

  • Task ID: TASK-2026-084
  • Task folder: tasks/TASK-2026-084-evolution-backlog-requeue-after-executed/

Injected Specs

  • spec/verification-integrity.md
  • spec/task-artifact-language.md
  • spec/architecture-boundaries.md
  • spec/structured-signal-first.md
  • spec/capability-gap-evolution.md
  • spec/rust-conventions.md
  • spec/testing-policy.md
  • spec/security-nonnegotiables.md (N/A)
  • spec/docs-sync.md (N/A: no user-facing docs/command/env change)

Validation Evidence

  • Commands executed:
    • cargo test -p skilllite-evolution --lib97 passed
    • cargo clippy -p skilllite-evolution --all-targets -- -D warnings → clean
    • python3 scripts/validate_tasks.py → 71 task directories passed
  • Key results:
    • enqueue_user_capability_evolution_requeues_after_executed ok
    • migrate_evolution_backlog_allows_requeue_with_legacy_unique_dedupe ok
    • coordinate_attaches_status_to_persisted_id_after_requeue ok
    • Existing soft-dedupe test still ok

Regression Scope

Docs Sync (EN/ZH)

  • Not needed

Review Checklist

  • Acceptance criteria in tasks/TASK-2026-084-evolution-backlog-requeue-after-executed/TASK.md satisfied
  • STATUS.md updated
  • REVIEW.md includes merge readiness decision
  • tasks/board.md status is up to date
Open in Web View Automation 

cursoragent and others added 2 commits August 8, 2026 11:05
Drop the global UNIQUE on evolution_backlog.dedupe_key (with migration),
upsert active rows or insert when only executed history remains, and attach
coordinator status updates to the persisted proposal id so authorized
re-evolution no longer returns a phantom id / NoScope.

Co-authored-by: EXboy <EXboys@users.noreply.github.com>
Co-authored-by: EXboy <EXboys@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant