Skip to content

Migrate gptme to parser provider facade#753

Draft
mariusvniekerk wants to merge 1 commit into
provider-commandcode-iflowfrom
provider-gptme
Draft

Migrate gptme to parser provider facade#753
mariusvniekerk wants to merge 1 commit into
provider-commandcode-iflowfrom
provider-gptme

Conversation

@mariusvniekerk

Copy link
Copy Markdown
Collaborator

Migrates gptme from the transitional legacy provider adapter to a concrete provider facade implementation. The provider composes JSONLSourceSet for file discovery, watch planning, changed-path classification, lookup, and fingerprinting, then filters to the legacy //conversation.jsonl layout.

Runtime sync dispatch is still unchanged. This PR proves the facade with one narrow single-session JSONL provider while keeping all other agents on legacy adapters until their own migration slices land.

@roborev-ci

roborev-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

roborev: Combined Review (1c09821)

Summary verdict: no Medium, High, or Critical findings to report.

The only reported issue was Low severity, so it is omitted per the review-combination rules.


Panel: ci_default_security | Synthesis: codex, 4s | Members: codex_default (codex/default, done, 3m36s), codex_security (codex/security, done, 2m11s) | Total: 5m51s

@mariusvniekerk mariusvniekerk force-pushed the provider-jsonl-source-set branch from 7a61f4d to 52c9e73 Compare June 19, 2026 18:45
@mariusvniekerk mariusvniekerk changed the base branch from provider-jsonl-source-set to provider-commandcode-iflow June 19, 2026 18:45
@roborev-ci

roborev-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

roborev: Combined Review (e9558b6)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 4m41s), codex_security (codex/security, done, 1m56s) | Total: 6m37s

@roborev-ci

roborev-ci Bot commented Jun 20, 2026

Copy link
Copy Markdown

roborev: Review Unavailable (ede515d)

The review agent repeatedly failed to run (likely an agent or configuration error). roborev will try again on the next commit.

Last error: agent: claude-code failed stream: stream errors: You've hit your session limit · resets 5:50am (UTC): exit status 1

@roborev-ci

roborev-ci Bot commented Jun 21, 2026

Copy link
Copy Markdown

roborev: Combined Review (27cbdac)

No Medium, High, or Critical findings were reported.

The only reported issue was Low severity and is omitted per instructions.


Panel: ci_default_security | Synthesis: codex, 4s | Members: codex_default (codex/default, done, 5m21s), codex_security (codex/security, done, 2m6s) | Total: 7m31s

@mariusvniekerk

mariusvniekerk commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator Author

This change is part of the following stack:

Change managed by git-spice.

@roborev-ci

roborev-ci Bot commented Jun 21, 2026

Copy link
Copy Markdown

roborev: Combined Review (569d8db)

No Medium, High, or Critical findings were reported.

The only reported issue was Low severity and has been omitted per the requested threshold.


Panel: ci_default_security | Synthesis: codex, 4s | Members: codex_default (codex/default, done, 5m31s), codex_security (codex/security, done, 1m49s) | Total: 7m24s

@roborev-ci

roborev-ci Bot commented Jun 21, 2026

Copy link
Copy Markdown

roborev: Combined Review (95fe1f2)

Summary verdict: one medium issue needs fixing before merge.

Medium

  • internal/parser/gptme_provider.go:234 - The source set only filters by basename before JSONLSourceSet dedupes and resolves roots, then applies the gptme <root>/<session>/conversation.jsonl shape afterward. With overlapping configured roots, a broader root can claim the same physical conversation.jsonl as an invalid nested source, causing discovery to drop the valid child-root source and FindSource to report not found.

    Fix: Enforce isGptmeConversationPath(root, path) via IncludePath inside newGptmeSourceSet so invalid root/path pairings are rejected before dedupe and lookup return.


Panel: ci_default_security | Synthesis: codex, 6s | Members: codex_default (codex/default, done, 4m57s), codex_security (codex/security, done, 1m25s) | Total: 6m28s

@roborev-ci

roborev-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown

roborev: Combined Review (d08a3b3)

Clean overall, with one Medium regression to confirm before merge.

Medium

  • internal/parser/types.go gptme registry entry, affecting internal/ssh/resolve.go:74-79 and internal/sync/parsediff.go:206-218

    Removing DiscoverFunc/FindSourceFunc from the gptme registry entry drops gptme from registry-driven paths still gated on def.DiscoverFunc != nil.

    This means gptme transcripts are omitted from the generated SSH resolve script, so remote SSH sync silently stops transferring them. It also excludes gptme from parse-diff diagnostics, so parsediff --agent gptme now errors with “has no on-disk source to re-parse.”

    This matches the current iflow/commandcode migration state, so it may be an accepted intermediate migration step. Please confirm the provider-shape adapter for ssh/resolve.go and parsediff.go is covered by a follow-up. If remote SSH sync must keep working during the migration, route these paths through provider Discover/FindSource for provider-authoritative agents.


Panel: ci_default_security | Synthesis: codex, 8s | Members: codex_default (claude-code/default, done, 8m11s), codex_security (claude-code/security, done, 1m0s) | Total: 9m19s

The facade needs at least one real provider implementation before caller migration can prove the contract. Gptme is a narrow first target because it has a single-session JSONL source layout and an existing parser path that can be wrapped without changing runtime sync dispatch.

This keeps gptme source behavior explicit: the provider composes JSONLSourceSet for filesystem mechanics, filters to the legacy one-level conversation.jsonl layout, and returns complete current parse outcomes while the rest of the registry remains on legacy adapters.

fix(parser): preserve gptme provider source parity

The gptme provider is intended to be a no-behavior-change facade migration, so it needs to preserve the legacy source semantics before sync callers can safely move to it. Symlinked session directories, deleted source events, and persisted lookup hints are all observable through the current discovery and session lookup paths.

This keeps provider-backed gptme discovery and changed-path classification compatible with those legacy expectations while leaving runtime dispatch unchanged.

test(parser): opt gptme into provider shadow

Gptme now has a concrete facade provider on this branch, so the migration manifest should force it through the shared shadow-compare harness instead of leaving the provider implementation additive and unexercised.

Lower branch opt-ins remain inherited and later provider families stay legacy-only until their own branches introduce concrete providers.

Validation: go test -tags "fts5" ./internal/parser -run TestProviderMigrationModes -count=1; go test -tags "fts5" ./internal/parser -count=1; go vet ./...; git diff --check

test(sync): compare gptme shadow parity

GPTMe is marked shadow-compare on this branch, so add the shared source-level migration proof beside the concrete provider. The test runs ObserveProviderSource and compares normalized provider output with ParseGptmeSession while preserving the provider-computed content hash.

Validation: go fmt ./...; go test -tags "fts5" ./internal/parser ./internal/sync -count=1; go vet ./...; git diff --check; ./custom-gcl run --config .golangci.nilaway.yml ./internal/parser/... ./internal/sync/...

refactor(parser): fold gptme into provider

GPTMe should be a migrated provider on this branch, not a provider wrapper around exported legacy parser entrypoints. Keeping DiscoverGptmeSessions, FindGptmeSourceFile, ParseGptmeSession, and the engine processGptme path made the stack additive and left two public shapes to maintain.

Move GPTMe parsing behind the concrete provider, make GPTMe provider-authoritative at this branch, remove its legacy AgentDef hooks and engine dispatch, and replace shadow-baseline tests with provider API coverage plus a guard that the legacy symbols stay gone.

Validation: go test -tags "fts5" ./internal/parser ./internal/sync ./cmd/agentsview -count=1; go vet ./...; git diff --check

fix(parser): thread ctx through gptme source lookups
@roborev-ci

roborev-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown

roborev: Combined Review (b80e47c)

Summary verdict: One medium regression needs addressing; no security findings were reported.

Medium

  • internal/parser/types.go:585 - Removing gptme's DiscoverFunc / FindSourceFunc drops it from code paths that still enumerate only file-based agents with DiscoverFunc, notably parse-diff and SSH remote sync resolution. As a result, --agent gptme parse-diff and remote gptme imports may stop working.

    Fix: Keep compatibility wrappers until those paths are provider-aware, or update parse-diff and SSH resolution to include provider-authoritative file-based agents and add gptme coverage.


Panel: ci_default_security | Synthesis: codex, 7s | Members: codex_default (codex/default, done, 8m54s), codex_security (codex/security, done, 1m52s) | Total: 10m53s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant