Skip to content

feat(parser): migrate antigravity providers#782

Draft
mariusvniekerk wants to merge 1 commit into
provider-kiro-familyfrom
provider-antigravity-family
Draft

feat(parser): migrate antigravity providers#782
mariusvniekerk wants to merge 1 commit into
provider-kiro-familyfrom
provider-antigravity-family

Conversation

@mariusvniekerk

Copy link
Copy Markdown
Collaborator

Antigravity IDE and CLI now use concrete parser providers instead of the legacy adapter path. The IDE provider models conversation DBs with annotation and brain sidecars, while the CLI provider models DB/PB precedence, trajectory sidecars, implicit sessions, brain fan-out, history-derived project hints, composite fingerprints, force-replace parses, and retry state propagation. Review should focus on the custom source-set behavior and parity with the existing Antigravity sync classifiers.

@roborev-ci

roborev-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

roborev: Combined Review (1dbceba)

Medium-risk issue found; no Critical or High findings.

Medium

  • internal/parser/antigravity_cli_provider.go:225 - Stored conversations/<id>.pb paths are accepted before raw-ID lookup, even when the preferred <id>.db source exists or the stored .pb has been removed. That can make provider-based resync parse stale legacy .pb files or report SkipNoSession instead of using the current .db, diverging from discovery and FindAntigravityCLISourceFile, which prefer .db.

    Suggested fix: When resolving stored/fingerprint paths for conversation .pb files, canonicalize through the same .db-preferred logic used by discovery, and only return the missing legacy path if no replacement source exists.


Panel: ci_default_security | Synthesis: codex, 7s | Members: codex_default (codex/default, done, 3m55s), codex_security (codex/security, done, 2m23s) | Total: 6m25s

@mariusvniekerk

mariusvniekerk commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator Author

@roborev-ci

roborev-ci Bot commented Jun 20, 2026

Copy link
Copy Markdown

roborev: Combined Review (03d0fd3)

Summary verdict: one medium correctness issue should be fixed before merging.

Medium

  • internal/parser/antigravity_cli_provider.go:439 - .db/.db-wal/.db-shm change events always resolve to the .db source, even when that file has been removed and the legacy .pb conversation source still exists. A remove/rename event for the preferred .db can therefore produce a missing-source parse with SkipNoSession, temporarily dropping a valid session until a later full discovery finds the .pb.

    Fix: When the canonical .db is missing, fall back to conversations/<id>.pb if it exists, matching FindSource/discovery behavior; add a regression test for deleting the .db while .pb remains.


Panel: ci_default_security | Synthesis: codex, 6s | Members: codex_default (codex/default, done, 6m35s), codex_security (codex/security, done, 1m44s) | Total: 8m25s

@mariusvniekerk mariusvniekerk force-pushed the provider-antigravity-family branch from cd3a876 to f23eac4 Compare June 20, 2026 01:42
@roborev-ci

roborev-ci Bot commented Jun 20, 2026

Copy link
Copy Markdown

roborev: Review Unavailable (f23eac4)

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

@mariusvniekerk mariusvniekerk force-pushed the provider-antigravity-family branch from f23eac4 to 20558cf Compare June 21, 2026 00:41
@roborev-ci

roborev-ci Bot commented Jun 21, 2026

Copy link
Copy Markdown

roborev: Combined Review (20558cf)

Medium finding: Antigravity provider file hash semantics diverge from legacy sync.

Medium

  • internal/parser/antigravity_provider.go:113 and internal/parser/antigravity_cli_provider.go:117
    • The providers copy the composite fingerprint hash into Session.File.Hash, but the legacy sync path stores ComputeFileHash(file.Path) for Antigravity sessions. Because the composite hash includes path, mtime, and side inputs, it differs from the raw file hash even without companion files. This will make ProviderMigrationShadowCompare report every Antigravity shadow observation as a session mismatch and would change stored file_hash semantics if made authoritative.
    • Fix: keep the composite hash in SourceFingerprint for freshness, but set Session.File.Hash to the raw source-file hash to preserve legacy parity, or intentionally update both legacy and provider paths and adjust the shadow comparison/tests accordingly.

Panel: ci_default_security | Synthesis: codex, 7s | Members: codex_default (codex/default, done, 5m16s), codex_security (codex/security, done, 51s) | Total: 6m14s

@roborev-ci

roborev-ci Bot commented Jun 21, 2026

Copy link
Copy Markdown

roborev: Combined Review (175c894)

Summary verdict: Two medium issues remain; no high or critical findings were reported.

Medium

  • internal/parser/types.go:556: history.jsonl is classified in classifyAntigravityCLIHistoryPath, but Antigravity CLI only watches conversations, implicit, and brain, so live history-only updates at the agent root will not trigger SyncPaths in normal watcher mode.
    Fix: Add a shallow watch root for the Antigravity CLI root, or otherwise include history.jsonl in the watcher setup, and cover it with a watch-root test.

  • internal/parser/antigravity_provider.go:113 and internal/parser/antigravity_cli_provider.go:117: The new providers stamp sess.File.Hash with the composite fingerprint, while the legacy shadow path still stamps File.Hash from ComputeFileHash(file.Path) on only the primary file. Since shadow comparison deep-compares the full session, Antigravity shadow mode will report hash mismatches for otherwise equivalent parses.
    Fix: Align the legacy and provider hash values during shadow mode, or normalize/ignore this known hash difference in the shadow comparison.


Panel: ci_default_security | Synthesis: codex, 8s | Members: codex_default (codex/default, done, 6m32s), codex_security (codex/security, done, 2m3s) | Total: 8m43s

@mariusvniekerk mariusvniekerk force-pushed the provider-antigravity-family branch from 175c894 to 581c996 Compare June 21, 2026 01:47
@roborev-ci

roborev-ci Bot commented Jun 21, 2026

Copy link
Copy Markdown

roborev: Combined Review (581c996)

Medium issue found: Antigravity CLI history.jsonl changes are classified for sync but missed by live watch mode.

Medium

  • Location: internal/parser/types.go:556
  • Problem: history.jsonl is classified in sync, but the live watcher still only watches conversations, implicit, and brain for Antigravity CLI. Since collectWatchRoots uses WatchSubdirs and does not consume provider WatchPlan, normal --watch mode will not receive root-level history.jsonl changes. Project/prompt refreshes therefore only happen on manual or periodic sync.
  • Fix: Add a shallow watch for the Antigravity CLI root, for example via ShallowWatchRootsFunc, and add a collectWatchRoots test that covers history.jsonl.

Panel: ci_default_security | Synthesis: codex, 8s | Members: codex_default (codex/default, done, 7m8s), codex_security (codex/security, done, 32s) | Total: 7m48s

@mariusvniekerk mariusvniekerk force-pushed the provider-antigravity-family branch from 581c996 to 01ca28a Compare June 23, 2026 23:56
@roborev-ci

roborev-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown

roborev: Combined Review (01ca28a)

Summary verdict: Changes need follow-up before merge due to two medium correctness issues.

Medium

  • Location: internal/parser/types.go:508
    Problem: Antigravity CLI now classifies history.jsonl changes in the provider, but the real file watcher still uses AgentDef.WatchSubdirs, which only watches conversations, implicit, and brain. The provider WatchPlan root for history.jsonl is not wired into collectWatchRoots, so normal watch mode will not call SyncPaths for history-only project/message updates.
    Fix: Wire provider WatchPlan into watcher setup, or add an effective shallow watch root for the Antigravity CLI root so history.jsonl changes are observed.

  • Location: internal/parser/antigravity_cli_provider.go:464
    Problem: sourcesForHistoryChange relies on an in-memory previous history snapshot, but the sync engine creates a fresh provider for each changed-path classification. Since newAntigravityCLIHistoryState seeds the snapshot from the already-updated file, removals/retags like A+B -> B return only current IDs and miss the removed session, leaving stale project/history-derived messages until a full sync.
    Fix: Treat history changes without durable prior state as broad invalidations, or use stored source hints/engine-persistent provider state so removed IDs are also reprocessed.


Panel: ci_default_security | Synthesis: codex, 9s | Members: codex_default (codex/default, done, 4m52s), codex_security (codex/security, done, 1m44s) | Total: 6m45s

@mariusvniekerk mariusvniekerk force-pushed the provider-antigravity-family branch from 01ca28a to 033752a Compare June 25, 2026 05:48
@roborev-ci

roborev-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown

roborev: Combined Review (033752a)

Summary verdict: one medium issue needs attention; no high or critical findings were reported.

Medium

  • cmd/agentsview/main.go:889
    Provider watch roots are registered with the watch root itself as dirs, so when a provider subdirectory cannot be watched or does not exist, unwatchedDirs gets /agent/root/subdir. Polling then calls SyncRootsSince scoped to that subdir, but provider discovery filters configured roots with scope.includes(root), so the actual agent root /agent/root is excluded and the poll never discovers anything under it.

    Suggested fix: Preserve the owning configured agent root in watchRoot.dirs / unwatchedDirs for provider watch roots, for example by mapping each WatchRoot.Path back to the configured root that contains it and calling addRoot(ownerRoot, watchPath, ...).


Panel: ci_default_security | Synthesis: codex, 7s | Members: codex_default (codex/default, done, 7m12s), codex_security (codex/security, done, 3m6s) | Total: 10m25s

Move Antigravity IDE and CLI source discovery, lookup, and parse
ownership onto concrete antigravityProvider and antigravityCLIProvider
types, deleting the package-level legacy free functions and their legacy
sync dispatch. Both agents become provider-authoritative.

Sidecar and freshness semantics are preserved through the providers'
SourcesForChangedPath fan-out and composite fingerprints rather than
engine-level classifiers: the IDE provider maps annotations and brain
artifacts back to the conversation DB, and the CLI provider maps history,
brain, trajectory, and db/pb-precedence sidecars to every affected source.

Drop the obsolete engine-level TestClassifyOnePath_AntigravityCLI, which
exercised the removed classifyOnePath antigravity arm. The antigravity
provider unit tests cover the per-path sidecar-to-source mappings and the
engine integration tests cover the engine-to-provider routing, so the
test asserted removed behavior without adding coverage.

fix(parser): preserve antigravity history invalidation

Antigravity CLI history changes are watched and classified through fresh provider instances, so provider-local history snapshots cannot reliably detect rows that were removed or retagged. Treat history.jsonl writes conservatively and fan out to all current CLI sources, which preserves stale-metadata cleanup at the cost of a broader reparse on history-only updates.

The file watcher now consumes provider watch plans for agents that only had plain WatchSubdirs wiring, so provider-owned roots such as Antigravity CLI's history.jsonl parent are observed by the real watcher setup while bespoke legacy watch-root functions keep their existing behavior.

Validation: go test -tags fts5 ./internal/parser -count=1; go test -tags fts5 ./internal/sync -run 'Test.*AntigravityCLI|TestProcessAntigravity|TestSyncPathsAntigravity' -count=1; go test -tags fts5 ./cmd/agentsview -run TestCollectWatchRoots -count=1; go vet ./...; git diff --check
@mariusvniekerk mariusvniekerk force-pushed the provider-antigravity-family branch from 033752a to ad22cf2 Compare June 25, 2026 17:29
@roborev-ci

roborev-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown

roborev: Combined Review (ad22cf2)

Summary verdict: One medium-severity sync reliability issue needs attention; no security regression was found.

Medium

  • internal/parser/antigravity_cli.go:880
    Antigravity CLI fingerprinting now returns a fatal error when history.jsonl cannot be scanned, including a single line over the 4 MiB scanner limit. Existing history readers treat these failures as best-effort, so this can make every Antigravity CLI source fail sync instead of syncing without history-derived project data.
    Fix: Make history fingerprinting tolerant by avoiding bufio.Scanner’s token limit, or by falling back to a coarse whole-file/history stat fingerprint on scan/open errors instead of returning an error.

Panel: ci_default_security | Synthesis: codex, 8s | Members: codex_default (codex/default, done, 6m57s), codex_security (codex/security, done, 3m16s) | Total: 10m21s

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