Skip to content

docsgpt-bot 0.2: unknown turn counts for upgraded conversations - #5

Merged
dartpain merged 1 commit into
arc53:mainfrom
arc53-machine:turns-unknown
Oct 1, 2026
Merged

dartpain merged 1 commit into
arc53:mainfrom
arc53-machine:turns-unknown

Conversation

@arc53-machine

Copy link
Copy Markdown
Collaborator

Groundwork for moving the Telegram bot onto these crates.

The problem: Telegram v2 SQLite files hold conversations whose earlier answers were never counted. When 0.1 adds the turns column it defaults to 0, so after the upgrade the next 👍 would be recorded on answer 0 of a conversation that already has several answers.

The change:

  • When the column is added to an existing table, existing rows are marked unknown (-1).
  • Storage::record_turn returns Option<u32> and Conversation::turns is Option<u32>. Both are None until the chat moves to a new conversation (/new, or the server starts one).
  • run_turn then records no position and no message ref, so those answers offer no feedback rather than wrong feedback.
  • Databases created by 0.1 already have the column and are unaffected.

Breaking API change, so both crates go to 0.2.0 in lockstep (docsgpt is unchanged). The Slack bot doesn't call record_turn; it moves to 0.2 with a one-line bump.

Tests:

  • An upgraded file returns None until a new conversation, then counts from 0, and stays counted after reopening.
  • A new run_turn test: a turn in an upgraded conversation continues it, has no position and records no message ref; after /new it counts from 0.
  • The contract suite, clippy, docs, the MSRV 1.88 check and cargo publish --dry-run all pass.

After merging I'll push v0.2.0 (I'll confirm first); the Release workflow publishes through Trusted Publishing.

Telegram v2 SQLite files hold conversations whose answers were never
counted. Adding the turns column defaulted them to 0, so the next 👍
would be recorded against the wrong answer. Mark them unknown (-1);
record_turn returns None for them until the chat moves to a new
conversation, and run_turn records no position or message ref.

Breaking: record_turn returns Option<u32>; Conversation::turns is
Option<u32>. Both crates go to 0.2.0.
@dartpain
dartpain merged commit 5805a86 into arc53:main Oct 1, 2026
2 checks passed
@arc53-machine arc53-machine mentioned this pull request Oct 1, 2026
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.

2 participants