Skip to content

Redact mount WebSocket credentials and add two-machine collaboration proof - #377

Merged
kjgbot merged 3 commits into
mainfrom
codex/real-two-machine-collab-20260726
Jul 26, 2026
Merged

Redact mount WebSocket credentials and add two-machine collaboration proof#377
kjgbot merged 3 commits into
mainfrom
codex/real-two-machine-collab-20260726

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jul 26, 2026

Copy link
Copy Markdown
Member

What changed

  • redact token, access_token, and api_key query values from mount-sync logs and returned WebSocket dial errors
  • add regression coverage for both internal logging and external CLI callers
  • add a durable evidence report, raw round-trip samples, exact agent prompts, convergence hashes, and a reusable collaboration fixture
  • add a unique-run ping/ack latency probe measured with the initiator's monotonic clock

Why

A real concurrent relayfile exercise between sf-mac-mini and
finn-mac-mini proved interdependent agent work, same-type overlap,
mount-restart recovery, offline outbox replay after a real Tailscale transport
partition, and byte-identical convergence. During the partition, the failed Go
WebSocket dial error included the full authenticated URL and exposed the
workspace bearer token in mount logs.

The first logger-only repair passed unit tests but failed a live replay because
relayfile-mount logs the returned maintenance error outside Syncer. The
final fix redacts both the fully formatted Syncer log line and
webSocketDialError.Error, while retaining the original wrapped error for
classification.

User impact

Mount connection failures no longer place WebSocket credentials in logs. The
evidence directory provides reproducible, machine-readable proof of the
two-physical-machine collaboration run.

Real-hardware result

  • Agent Relay fleet backend on finn plus independent frontend Codex on sf
  • concurrent edits to the same shared Go type retained all fields
  • two 20-write storms converged through a finn mount restart
  • a backend write made while its dedicated Tailscale SSH transport was down
    survived in the outbox and replayed after reconnect
  • 11 project files had identical manifests on both machines; no conflict
    artifacts
  • 12 ping/ack round trips from each initiator, measured entirely with that
    machine's monotonic clock: median 315.526 ms from sf and 373.230 ms from finn
  • final live security replay: 0 raw-token occurrences, 3 [REDACTED] markers,
    identical deployed binary hashes

Full report:
docs/evidence/real-time-collaboration-2026-07-26/README.md

Review fixes

  • replaced invalid cross-host wall-clock subtraction with monotonic ping/ack
    round trips and reran all 24 samples on a fresh real two-machine mount
  • reject reused probe prefixes, out-of-range sequences, and duplicate sequence
    acknowledgments
  • compute even-sized medians from both central values
  • corrected field ownership and removed an absolute developer path from
    trajectory metadata

Validation

  • go test -race ./...
  • go test ./... after review fixes
  • go vet ./...
  • scripts/check-contract-surface.sh
  • go test ./... inside testdata/realtime-collaboration
  • latency helper smoke test plus stale-prefix rejection test
  • JSON parse, CSV-statistic, whitespace, private-path, and credential-pattern
    checks for evidence artifacts
  • three live partition replays for the repair, with the final replay passing
    the secret-count assertion

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kjgbot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fd739624-30dd-47ac-be85-7af5327c02dc

📥 Commits

Reviewing files that changed from the base of the PR and between 1f6461f and 63270a3.

⛔ Files ignored due to path filters (3)
  • docs/evidence/real-time-collaboration-2026-07-26/finn-initiated-round-trip.csv is excluded by !**/*.csv
  • docs/evidence/real-time-collaboration-2026-07-26/mount-chaos-events.log is excluded by !**/*.log
  • docs/evidence/real-time-collaboration-2026-07-26/sf-initiated-round-trip.csv is excluded by !**/*.csv
📒 Files selected for processing (7)
  • .trajectories/completed/2026-07/traj_snj7hxsnw561.json
  • .trajectories/completed/2026-07/traj_snj7hxsnw561.md
  • .trajectories/completed/2026-07/traj_vm1r083knbl8.json
  • .trajectories/completed/2026-07/traj_vm1r083knbl8.md
  • docs/evidence/real-time-collaboration-2026-07-26/README.md
  • docs/evidence/real-time-collaboration-2026-07-26/results.json
  • scripts/measure-mount-latency.rb
📝 Walkthrough

Walkthrough

Adds a reusable realtime-collaboration fixture, WebSocket credential redaction, mount-latency measurement tooling, agent runbooks, and detailed collaboration evidence and trajectory records.

Changes

Realtime collaboration validation

Layer / File(s) Summary
Collaboration fixture service
testdata/realtime-collaboration/...
Adds a Go status model, JSON backend endpoint, HTML renderer, demo server, module metadata, documentation, and tests.
WebSocket credential redaction
internal/mountsync/syncer.go, internal/mountsync/syncer_test.go
Redacts sensitive query values from mount logs and dial errors, with tests covering supported keys and non-sensitive text.
Latency measurement and run evidence
scripts/measure-mount-latency.rb, docs/evidence/..., .trajectories/completed/...
Adds probe-based latency measurement and records collaboration topology, outcomes, hashes, timings, limitations, and trajectory provenance.
Agent execution prompts
docs/evidence/real-time-collaboration-2026-07-26/*-prompt.txt
Defines backend, frontend, restart, and partition procedures, including constrained edits, validation, commits, and result reporting.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Poem

I’m a rabbit hopping through the relay,
Probes send timestamps along the way.
Tokens hide beneath redacted code,
Two machines share the collaboration load.
Hashes agree, and tests say “hooray!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% 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 clearly summarizes the main changes: WebSocket credential redaction plus a two-machine collaboration proof.
Description check ✅ Passed The description is directly related and accurately describes the redaction work, tests, and collaboration evidence.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/real-two-machine-collab-20260726

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown

Relayfile Eval Review

Run: .relayfile/evals/runs/2026-07-26T19-28-19-563Z-HEAD-provider
Mode: provider
Git SHA: 4169906

Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0

Human Review Cases

No reviewable human-review cases captured Relayfile output.

@khaliqgant
khaliqgant marked this pull request as ready for review July 26, 2026 19:12
@cursor

cursor Bot commented Jul 26, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.trajectories/completed/2026-07/traj_snj7hxsnw561.json:
- Line 149: Update the committed trajectory’s projectId value to remove the
absolute local path and username, using either an omitted field or a
repository-relative project slug instead.

In `@docs/evidence/real-time-collaboration-2026-07-26/README.md`:
- Line 73: Update the “Concurrent, interdependent work” evidence statement to
assign only BuildSHA and APIRevision to the backend, while attributing Region to
the frontend agent that rendered and tested it; preserve the existing
test-result details.

In `@scripts/measure-mount-latency.rb`:
- Around line 15-17: Update realtime_ns and the measurement flow in
scripts/measure-mount-latency.rb so reported one-way latency does not subtract
CLOCK_REALTIME timestamps from separate machines. Use a writer-side monotonic
round-trip/acknowledgment protocol, or record and apply a verified bounded clock
offset, then regenerate the evidence values using the corrected measurement.
- Around line 52-65: Update the probe collection flow around the until loop to
isolate each run with a nonce or fresh directory, ignore stale files, and accept
only sequences in 1..count. Track completion and deduplication by received
sequence number rather than file path, while preserving the existing CSV output
for valid current probes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 33e73d36-9090-4bc6-b9f0-4913a62e7e9e

📥 Commits

Reviewing files that changed from the base of the PR and between afb7da0 and 1f6461f.

⛔ Files ignored due to path filters (3)
  • docs/evidence/real-time-collaboration-2026-07-26/finn-to-sf-latency.csv is excluded by !**/*.csv
  • docs/evidence/real-time-collaboration-2026-07-26/mount-chaos-events.log is excluded by !**/*.log
  • docs/evidence/real-time-collaboration-2026-07-26/sf-to-finn-latency.csv is excluded by !**/*.csv
📒 Files selected for processing (21)
  • .trajectories/completed/2026-07/traj_snj7hxsnw561.json
  • .trajectories/completed/2026-07/traj_snj7hxsnw561.md
  • .trajectories/completed/2026-07/traj_snj7hxsnw561.trace.json
  • docs/evidence/real-time-collaboration-2026-07-26/README.md
  • docs/evidence/real-time-collaboration-2026-07-26/backend-agent-prompt.txt
  • docs/evidence/real-time-collaboration-2026-07-26/frontend-agent-prompt.txt
  • docs/evidence/real-time-collaboration-2026-07-26/frontend-partition-prompt.txt
  • docs/evidence/real-time-collaboration-2026-07-26/frontend-restart-chaos-prompt.txt
  • docs/evidence/real-time-collaboration-2026-07-26/project-sha256.txt
  • docs/evidence/real-time-collaboration-2026-07-26/results.json
  • internal/mountsync/syncer.go
  • internal/mountsync/syncer_test.go
  • scripts/measure-mount-latency.rb
  • testdata/realtime-collaboration/README.md
  • testdata/realtime-collaboration/cmd/demo/main.go
  • testdata/realtime-collaboration/go.mod
  • testdata/realtime-collaboration/internal/backend/status.go
  • testdata/realtime-collaboration/internal/backend/status_test.go
  • testdata/realtime-collaboration/internal/frontend/view.go
  • testdata/realtime-collaboration/internal/frontend/view_test.go
  • testdata/realtime-collaboration/internal/model/status.go

Comment thread .trajectories/completed/2026-07/traj_snj7hxsnw561.json Outdated
Comment thread docs/evidence/real-time-collaboration-2026-07-26/README.md Outdated
Comment thread scripts/measure-mount-latency.rb Outdated
Comment thread scripts/measure-mount-latency.rb Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9718cf1a80

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/measure-mount-latency.rb Outdated
Comment on lines +52 to +54
until seen.length == count
Dir.glob(File.join(directory, "#{prefix}-*.probe")).sort.each do |path|
next if seen[path]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Ignore stale probe files before counting samples

When receive is rerun with a prefix that already exists in the mount, this path immediately counts the old files as newly propagated samples because seen starts empty and is keyed only by pathname. If the stale count equals COUNT, the command exits with fabricated latency data before the writer runs; if it exceeds COUNT, seen.length can never equal count and the receiver times out. Ignore files that predate receiver startup or require and validate a unique run identifier.

Useful? React with 👍 / 👎.

Comment on lines +90 to +91
| sf → finn | 12 | 119.548 ms | 156.951 ms | 168.487 ms | 216.512 ms |
| finn → sf | 12 | 199.368 ms | 214.277 ms | 222.967 ms | 253.959 ms |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recompute medians from both central samples

For these 12-sample datasets, the reported medians incorrectly select only the lower central value. The raw CSVs give (156.951 + 167.760) / 2 = 162.356 ms for sf → finn and (214.277 + 215.101) / 2 = 214.689 ms for finn → sf, rather than 156.951 ms and 214.277 ms; results.json repeats the same incorrect figures, so the committed performance evidence is internally inconsistent.

Useful? React with 👍 / 👎.

@kjgbot
kjgbot merged commit 5bf5229 into main Jul 26, 2026
10 checks passed
@kjgbot
kjgbot deleted the codex/real-two-machine-collab-20260726 branch July 26, 2026 19:30
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.

2 participants