Skip to content

fix(transcript): make prefix resolution literal and unambiguous - #129

Merged
aannoo merged 4 commits into
aannoo:mainfrom
marcelokarval:fix/transcript-literal-prefix-resolution
Sep 13, 2026
Merged

fix(transcript): make prefix resolution literal and unambiguous#129
aannoo merged 4 commits into
aannoo:mainfrom
marcelokarval:fix/transcript-literal-prefix-resolution

Conversation

@marcelokarval

Copy link
Copy Markdown
Contributor

Summary

  • treat transcript instance prefixes as literal input instead of raw SQLite LIKE patterns
  • resolve an active prefix only when exactly one transcript-bearing instance matches
  • preserve exact active-match precedence and the exact stopped-session fallback

Why

The previous fallback used LIKE '<input>%' LIMIT 1. Inputs containing _ or % therefore behaved as SQL wildcards, and ambiguous prefixes selected whichever row SQLite returned first. Either path could show a different agent's transcript.

Verification

  • RED reproduced independently for literal _, literal %, and ambiguous prefixes
  • boundary RED proved an exact stopped session was displaced by ambiguous active prefix candidates
  • focused transcript tests: 32 passed, 0 failed
  • full binary suite: 2180 passed, 0 failed, 1 ignored
  • cargo clippy --locked --bin hcom -- -D warnings
  • cargo fmt -- --check
  • independent adversarial review: PASS

Fixes #128

@marcelokarval
marcelokarval force-pushed the fix/transcript-literal-prefix-resolution branch from c7eb543 to e374bef Compare September 4, 2026 06:56
@marcelokarval
marcelokarval marked this pull request as ready for review September 4, 2026 07:01
swaynehales added a commit to swaynehales/hcom that referenced this pull request Sep 9, 2026
@aannoo

aannoo commented Sep 13, 2026

Copy link
Copy Markdown
Owner

thanks

@aannoo
aannoo merged commit 8719445 into aannoo:main Sep 13, 2026
20 checks passed
orgoj added a commit to orgoj/hcom that referenced this pull request Sep 13, 2026
- fc2276d (aannoo#123) was already in this fork as the cherry-picks bb67813 /
  ddc2383. Upstream's own version has since grown a remote path, so the
  conflict in transcript.rs is resolved entirely in upstream's favor:
  no_transcript_error now takes display_name plus an optional device and
  suggests `hcom events --remote-fetch --device <D> --participant <name>`
  for a remote agent. The fork's smoke test from 7a1a92f was asserting
  the older `--agent` wording and now asserts `--participant`.
- 8719445 (aannoo#129) makes transcript prefix resolution literal and fails
  closed on ambiguity, with exact identity authoritative.
- 9a0f3be (aannoo#127) releases the command-owned database handle before
  reset/archive so Windows can archive a live connection, and preserves
  pending delivery on non-destructive paths.

Verified: cargo fmt --check, clippy --all-targets clean, 2325 unit tests
pass, cli_smoke 67 pass (copilot/cursor/pi real-tool tests excluded on
this machine).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XckU8sHdJf22MHeGUyd7Gm
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.

Transcript prefix fallback can select the wrong instance

2 participants