Skip to content

fix(memory): восстановить внешние ключи автономных задач#480

Merged
xlabtg merged 3 commits intoxlabtg:mainfrom
konard:issue-479-4dd78aa146be
May 9, 2026
Merged

fix(memory): восстановить внешние ключи автономных задач#480
xlabtg merged 3 commits intoxlabtg:mainfrom
konard:issue-479-4dd78aa146be

Conversation

@konard
Copy link
Copy Markdown

@konard konard commented May 9, 2026

Что сделано

  • Исправлена миграция 1.24.0: rebuild autonomous_tasks теперь выполняется с legacy_alter_table=ON и временно выключенными FK, чтобы SQLite не переписывал дочерние внешние ключи на autonomous_tasks_old.
  • Добавлена миграция 1.37.0, которая чинит уже повреждённые task_checkpoints, execution_logs и policy_state, если их FK указывают на autonomous_tasks_old.
  • Добавлены регрессионные тесты на миграцию с 1.23.0 и на ремонт уже повреждённой схемы.
  • Обновлены root overrides для basic-ftp, fast-uri и fast-xml-builder, чтобы проходил security audit.

Fixes #479

Как воспроизвести

  1. Взять базу со схемой 1.23.0, где уже есть autonomous_tasks и дочерние таблицы ATE.
  2. Прогнать старую миграцию 1.24.0, которая переименовывает autonomous_tasks в autonomous_tasks_old.
  3. Вызвать cleanOldCheckpoints: SQLite пытается проверить FK на удалённую main.autonomous_tasks_old и падает с SqliteError: no such table.

Проверка

  • npx vitest run src/memory/__tests__/schema.test.ts -t "autonomous task child foreign keys"
  • npx vitest run src/memory/__tests__/schema.test.ts src/memory/__tests__/scheduler.test.ts src/autonomous/__tests__/autonomous-tasks.test.ts
  • npm run typecheck
  • npm run lint
  • npm run format:check
  • npm test
  • npm run test:coverage
  • npm run audit:ci
  • npm run build

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: xlabtg#479
@konard konard changed the title [WIP] SQLITE_ERROR fix(memory): восстановить внешние ключи автономных задач May 9, 2026
@konard konard marked this pull request as ready for review May 9, 2026 10:10
@konard
Copy link
Copy Markdown
Author

konard commented May 9, 2026

Working session summary

Готово: PR #480 обновлён, переведён в ready for review и запушен на issue-479-4dd78aa146be.

PR: #480
Коммит: 103fb1b fix: исправить внешние ключи автономных задач

Что изменено:

  • В schema.ts исправлена миграция 1.24.0, чтобы SQLite не переписывал FK дочерних ATE-таблиц на autonomous_tasks_old.
  • Добавлена миграция 1.37.0, ремонтирующая уже повреждённые FK в task_checkpoints, execution_logs, policy_state.
  • Добавлены регрессионные тесты в schema.test.ts.
  • Обновлены root overrides, чтобы проходил Security audit.

Проверка:

  • Локально прошли typecheck, lint, format:check, npm test, test:coverage, audit:ci, build.
  • Свежие CI-запуски на SHA 103fb1b14311f0e231868e3a4c0aefae9d83d0eb завершились успешно. Старые failed runs были на placeholder-коммите 4898c1b.
  • Рабочее дерево чистое.

This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Author

konard commented May 9, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $13.364240

📊 Context and tokens usage:

  • 210.7K / 1.1M (20%) input tokens, 31.8K / 128K (25%) output tokens

Total: (210.7K + 9.8M cached) input tokens, 31.8K output tokens, $13.364240 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Repository (48631KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Author

konard commented May 9, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard deployed to pr-preview May 9, 2026 10:15 — with GitHub Actions Active
@xlabtg xlabtg merged commit 2d5f502 into xlabtg:main May 9, 2026
18 checks passed
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.

SQLITE_ERROR

2 participants