feat: add cortex-code transcript provider#20
Conversation
There was a problem hiding this comment.
1 issue found across 18 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/providers/cortex-code/transcripts.ts">
<violation number="1" location="src/providers/cortex-code/transcripts.ts:237">
P2: Hardcoded source string diverges from the canonical CORTEX_CODE_SOURCE_KIND, risking identifier drift and downstream mismatches.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Add a new provider that discovers and parses Snowflake Cortex Code conversation transcripts from ~/.snowflake/cortex/conversations/*.json. - Scopes discovery to workspace via working_directory matching - Detects running/idle/completed status from last_updated recency - Extracts connection name, message count, tool call count, session type - Caches file headers by mtime to skip unchanged files - Registers as default provider alongside cursor, claude-code, codex, opencode - 41 new tests across schemas, discovery, transcripts, and provider integration .... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code) Co-Authored-By: Cortex Code <noreply@snowflake.com>
12add4c to
c645adf
Compare
vtemian
left a comment
There was a problem hiding this comment.
Thanks for this contribution, James! The provider is architecturally sound: it follows the discover -> read -> normalize pipeline correctly, uses factory functions, accumulates warnings non-fatally, and mirrors the existing claude-code provider patterns well. The test suite is solid (41 tests, real filesystem, proper cleanup). Clearly you studied the codebase before writing this.
A few things need fixing before we can merge:
-
Module-level mutable state —
headerCacheindiscovery.tsis a module-levelMapsingleton. This leaks across provider instances and test runs. The claude-code provider keeps its cache in closed-over state inside the factory function. Please moveheaderCacheinto the factory's closure or pass it through options. -
Unused export
isToolResultError— exported fromschemas.tsand re-exported throughindex.ts, but never called anywhere. YAGNI: please remove it. -
Magic strings —
"Chat for session:"intranscripts.tsand"cortex-code://sessions"inprovider.tsshould be named constants (per project rules, no magic strings). -
Unused parameter
_fileUpdatedAt— inrecalculateStatusintranscripts.ts. If it's not needed, remove it from the signature rather than underscore-prefixing. -
Version bump — the PR bumps
package.jsonto 0.2.0. Please revert this: version bumps are the maintainer's call.
None of these require structural changes, just a cleanup pass. Looking forward to v2!
Summary
cortexCodetranscript provider that discovers and parses Snowflake Cortex Code conversation transcripts from~/.snowflake/cortex/conversations/*.jsonworking_directorymatching, detects running/idle/completed status fromlast_updatedrecency and active tool callsTest plan
npm run checkpasses (biome + typecheck + 262 tests across 36 files)providers/cortex-codeentry pointChecklist
npm run checkpasses.... Generated with Cortex Code
Summary by cubic
Adds a new
cortexCodetranscript provider that discovers and parses Snowflake Cortex Code session JSONs and normalizes them into agent snapshots. It’s included in the default provider set for observers.New Features
~/.snowflake/cortex/conversations/*.json, scoped byworking_directory.last_updatedrecency and active tool calls.@agentprobe/core/providers/cortex-code; registered as a default provider; 41 tests added.Migration
createObserver()now includescortexCode()by default.cortexCodefrom@agentprobe/core/providers/cortex-codeand pass options likecortexHomePath,maxFiles, or disablewatch.Written for commit c645adf. Summary will update on new commits.