Skip to content

fix(mount): keep websocket sync status fresh#144

Merged
khaliqgant merged 12 commits into
mainfrom
codex/alias-tree-mount-fixes
May 13, 2026
Merged

fix(mount): keep websocket sync status fresh#144
khaliqgant merged 12 commits into
mainfrom
codex/alias-tree-mount-fixes

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

  • mark successful websocket file create/update/delete applies as successful reconciles so mount status does not remain stalled while realtime events are landing
  • skip non-regular local entries during mount scans so symlinked directories are not read as files
  • add focused mountsync coverage for websocket status and symlinked directory scans

Tests

  • go test ./cmd/relayfile-mount ./internal/mountsync

Proactive Runtime Bot and others added 10 commits May 11, 2026 20:26
Carry M1 implementation progress (SDK subscribe/event.id surface stubs,
DLQ path scheme doc, change-log retention defaults) onto the chain
branch so M1's preflight allow-list picks it up without redoing the work.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Cross-repo M1 implementation. See companion PRs and docs/proactive-runtime/spec.md (in cloud).
…nd, DLQ, per-provider buildSummary, Airtable lazy fetch)

Cross-repo proactive-runtime milestone commit.
…nd, DLQ, per-provider buildSummary, Airtable lazy fetch)

Cross-repo proactive-runtime milestone commit.
Cross-repo proactive-runtime milestone commit.
…I, token rotation, Tier-3 summaries)

Cross-repo proactive-runtime milestone commit.
… dogfood

Cross-repo proactive-runtime milestone commit.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Review Change Stack

Warning

Rate limit exceeded

@khaliqgant has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 26 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 806562fa-91b5-49bd-841f-00b5acc63f13

📥 Commits

Reviewing files that changed from the base of the PR and between e20166a and ad5a27c.

📒 Files selected for processing (1)
  • packages/sdk/typescript/CHANGELOG.md
📝 Walkthrough

Walkthrough

This PR adds M2 proactive runtime contracts and TypeScript SDK support for change-stream subscriptions, retained-change lookups, event materialization/expansion, and summary adapters; it also updates Go syncer WebSocket success tracking and local file scanning, expands tests, and updates docs/config.

Changes

Proactive Runtime Change APIs

Layer / File(s) Summary
Contract Documentation & Type Definitions
docs/proactive-runtime-contract.md, packages/sdk/typescript/src/types.ts
Adds M2 proactive runtime contract (DLQ scheme, subscribe/open/getResourceAtEvent, ChangeEvent envelope and expand() levels, retention/replay semantics, buildSummary/registerSummaryBuilder) and exported TypeScript types modeling events, actors, resources, summaries, expansions, subscriptions, and connection options.
SDK Exports, README & CHANGELOG
packages/sdk/typescript/src/index.ts, packages/sdk/typescript/README.md, packages/sdk/typescript/CHANGELOG.md, packages/sdk/typescript/vitest.config.ts
Re-exports proactive types and RelayFileChangeLogOptions; updates README example to show changeLog config and documents Unreleased M2 APIs in CHANGELOG; adds Vitest config for package tests.
Client Config & Cache Types
packages/sdk/typescript/src/client.ts
Introduces RelayFileChangeLogOptions and changeLog client option; normalizes numeric retention/maxEntries defaults and adds registries and internal types for per-workspace retained caches and pending hydrations.
Stream Manager & Subscription Orchestration
packages/sdk/typescript/src/client.ts
Implements WorkspaceChangeLogCache, RelayFileChangeSubscription, and RelayFileChangeStreamManager to fan out filtered events, optionally coalesce per-path updates, hydrate cached records, and manage shared RelayFileSync lifecycle.
Materialization & Utilities
packages/sdk/typescript/src/client.ts
Adds payload decoding, summary inference, digest computation (crypto and deterministic fallback), wire normalization, and materializeChangeRecord that stores hydrated cached records used by change APIs.
Public Client Methods & Replay
packages/sdk/typescript/src/client.ts
Adds subscribe(), open(), getResourceAtEvent(), listChangesSince(), and listLastNChanges() with replay-on-start priming, cache-first lookups with backend fallback, and mapping retained records into ChangeEvent objects.
Proactive Runtime Tests & Mocks
packages/sdk/typescript/src/client.test.ts
Extensive test suite with WebSocket mocking, microtask helpers, and tests validating multiplexing/coalescing, ACL token wiring, replay priming, expansion wiring, retention behavior, digest fallback, and DLQ-path handling.

Sync State Tracking & File Scanning

Layer / File(s) Summary
WebSocket Event Application & Sync Success Tracking
internal/mountsync/syncer.go, internal/mountsync/syncer_test.go
Calls s.markSyncSuccess() after applying remote file.created/file.updated and file.deleted WebSocket payloads before persisting state so LastSuccessfulReconcileAt is set and LastError cleared; test asserts state updates and preserved event timestamp.
Local File Scanning & Symlink Filtering
internal/mountsync/syncer.go, internal/mountsync/syncer_test.go
scanLocalFiles now inspects d.Info() and skips non-regular entries (e.g., symlinked directories); adds deterministic test that skips when symlinks unsupported.

Metadata & Test Infrastructure

Layer / File(s) Summary
Trajectory Index, Test Scripts & Timeouts
.trajectories/index.json, package.json, packages/local-mount/src/mount.test.ts
Bumps .trajectories/index.json timestamp and appends completed trajectories; adds packages/file-observer to root test script; increases a Vitest test timeout to 10_000ms.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 I nibble streams and stash each change,

summaries trimmed within my range,
subscribe and replay, tidy and fleet,
a rabbit cheers this M2 heartbeat.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(mount): keep websocket sync status fresh' directly reflects the main changes: updating sync status tracking when WebSocket events arrive, ensuring mount status stays current rather than stalled.
Description check ✅ Passed The description clearly relates to the changeset, covering the three main aspects: WebSocket sync status updates, symlink handling during scans, and test coverage additions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/alias-tree-mount-fixes

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 6 additional findings in Devin Review.

Open in Devin Review

Comment thread packages/sdk/typescript/src/client.ts Outdated
Proactive Runtime Bot added 2 commits May 13, 2026 12:22
# Conflicts:
#	.trajectories/index.json
#	packages/sdk/typescript/src/client.test.ts
#	packages/sdk/typescript/src/client.ts
@khaliqgant khaliqgant merged commit 63c0f06 into main May 13, 2026
7 checks passed
@khaliqgant khaliqgant deleted the codex/alias-tree-mount-fixes branch May 13, 2026 10:37
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.

1 participant