Skip to content

feat: migrate engine to AgentDB — v2.0.0#12

Merged
mbocevski merged 9 commits into
mainfrom
feat/agentdb-migration
Apr 10, 2026
Merged

feat: migrate engine to AgentDB — v2.0.0#12
mbocevski merged 9 commits into
mainfrom
feat/agentdb-migration

Conversation

@mbocevski
Copy link
Copy Markdown
Contributor

Summary

Replace raw opslog Store with AgentDB Collection API. Major version bump — no backward compatibility with v1.x task data.

Engine Changes

  • defineSchema() with typed fields, autoIncrement IDs, date resolution, 20 virtual filters, computed urgency
  • Filter translator — backlog syntax → AgentDB JSON filters (324 lines → 93 lines, 71% reduction)
  • Doc storage migrated from filesystem to AgentDB blob API (works with S3)
  • Single findAll() in exportTasks — eliminated double read
  • Batched doc operations — write/delete use single update instead of 2-3
  • Queue drain flag — skip repeat disk reads after first drain
  • Redacted error logs — task descriptions no longer leaked

New Files

  • src/engine/task-schema.ts — declarative task collection schema

Removed

  • Direct @backloghq/opslog dependency (transitive via agentdb)
  • Manual validateAttrs() (replaced by schema)
  • Manual nextId() counter (replaced by autoIncrement)
  • Filesystem docs/ directory (replaced by blob API)

Tests

  • 185 tests pass (build + lint clean)
  • New: autoIncrement persistence across reopen
  • New: doc blob persistence across reopen
  • Rewrote filter tests for JSON output assertions

Review Findings Addressed

  • Architecture: annotations field documented (AgentDB allows extra fields)
  • Performance: single findAll, batched updates, queue drain flag
  • Security: redacted task description in error log
  • Testing: persistence tests for IDs and docs

Replace raw opslog Store with AgentDB Collection API:
- defineSchema() with typed validation, autoIncrement IDs, date resolution, virtual filters
- Filter compiler translates backlog syntax to agentdb JSON filters
- Doc storage migrated to blob API (works with S3)
- 183 tests pass, build and lint clean
…e recurrence id, defensive urgency, +WAITING test
@mbocevski mbocevski merged commit d8e2fc6 into main Apr 10, 2026
2 checks passed
@mbocevski mbocevski deleted the feat/agentdb-migration branch April 10, 2026 20:05
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