Skip to content

Keep local plans private, configure recap runners, and improve demo charts - #2046

Merged
steve8708 merged 7 commits into
mainfrom
changes-466
Jul 12, 2026
Merged

steve8708 merged 7 commits into
mainfrom
changes-466

Conversation

@steve8708

@steve8708 steve8708 commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • keep local Plan source and assets off remote validation endpoints while preserving sanitized pageviews, explicit analytics, and Sentry
  • disable rrweb and implicit DOM/network autocapture for local Plan routes, redact bridge credentials from telemetry/auth URLs, isolate simultaneous local bridges, and preserve replay options across privacy transitions
  • add configurable hosted/self-hosted runners to PR Visual Recap setup, doctor, generated workflows, docs, and trust-restricted security gates
  • make Analytics Demo mode line and area charts render deterministic upward presentation trends without changing query, table, metric, or export data

Validation

  • 251 focused core analytics/replay/recap tests plus 82 local-plan/privacy tests
  • 75 skills tests
  • 20 focused Plan tests
  • 8 focused Analytics demo/chart tests
  • core, skills, Plan, and Analytics typechecks
  • all 22 repository guards
  • core and Plan production builds

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

builder-io-integration[bot]

This comment was marked as outdated.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

builder-io-integration[bot]

This comment was marked as outdated.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

builder-io-integration[bot]

This comment was marked as outdated.

@builder-io-integration builder-io-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.

Builder reviewed your changes and found 2 potential issues 🟡

Review Details

This incremental update meaningfully improves the earlier privacy fix: the prior hash-navigation regression on local Plan routes is addressed by persisting the bridge URL across in-tab hash changes, and auth return paths now strip #bridge=... before redirecting into sign-in. The workflow side also now documents and wires a separate VISUAL_RECAP_GATE_RUNS_ON path so self-hosted-only environments can choose a gate runner explicitly. Risk assessment remains High because these changes still touch privacy-sensitive local-plan routing, telemetry/session-replay behavior, and CI security gates.

The main remaining concern is durability when more than one bridged local plan is opened in the same tab: because every bridge-backed page now uses the fixed /local-plans/local route, the new sessionStorage fallback is keyed too coarsely and can restore the wrong bridge. I also found a replay regression in the new content-capture gating: when capture is re-enabled after visiting a private route, session replay restarts without the caller’s original replay configuration. On the positive side, the previously reported hash-fragment navigation issue appears fixed and I resolved that stale review thread.

🧪 Browser testing: Attempted, but executor browser tooling was unavailable; full Plan UI verification could not be completed on this incremental review.

? new URLSearchParams(hash.slice(1))
: null;
const bridgeUrl = hashParams?.get("bridge") ?? null;
const storageKey = `agent-native.local-plan-bridge.${slug}`;

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.

🟡 Session-storage fallback aliases all bridged local plans to the same key

The new fallback stores every bridged page under agent-native.local-plan-bridge.local, because the CLI now always opens /local-plans/local#bridge=.... If a user opens plan A, then plan B in the same tab, going back to A's hash-only URL can silently restore B's bridge instead.

Additional Info
Found by 2/4 review agents and manually verified against plan-local.ts:547 (fixed route slug `local`) plus localPlanBridgeUrlFromLocation() using only the route slug to build the sessionStorage key.

Fix in Builder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in f9b58a7: each bridge URL now gets a distinct opaque 16-hex route id derived from the high-entropy bridge URL, so sessionStorage keys cannot alias plan A and plan B. The hosted path still reveals neither folder name nor token; CLI/docs/localized docs and tests are updated.

Comment thread packages/core/src/client/analytics.ts Outdated
Comment on lines +1035 to +1050
maybeInstallSessionReplay(
_trackingContentCaptureEnabled ? options.sessionReplay : false,
{
endpoint: options.endpoint,
publicKey,
},
);
maybeInstallErrorCapture(options.errorCapture);
}
}

export function setTrackingContentCaptureEnabled(enabled: boolean): void {
if (_trackingContentCaptureEnabled === enabled) return;
_trackingContentCaptureEnabled = enabled;
if (enabled) {
void maybeStartSessionReplay();

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.

🟡 Re-enabling content capture restarts session replay without the original options

When a private route disables capture, configureTracking() now installs replay with false, and re-enabling it later calls maybeStartSessionReplay() with no saved config. That drops custom replay settings like sampling, auth requirements, endpoint/publicKey overrides, or explicit enablement after the first private-route transition.

Additional Info
Found by 1/4 review agents and manually verified: the new `_trackingContentCaptureEnabled ? options.sessionReplay : false` path prevents `_sessionReplayOptions` from being preserved on initial private-route loads, while `setTrackingContentCaptureEnabled(true)` restarts replay with no options.

Fix in Builder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in f9b58a7: configureTracking now always normalizes and retains the original replay options even when initial route capture is disabled, but starts only when policy allows. Re-enabling uses startConfiguredSessionReplay(savedOptions), preserving endpoint, publicKey, auth, sampling, and explicit false. Regression coverage starts private, navigates hosted, and verifies the original options.

@steve8708 steve8708 changed the title Keep local plans private and support configurable recap runners Keep local plans private, configure recap runners, and improve demo charts Jul 12, 2026
@steve8708
steve8708 merged commit dd6a05b into main Jul 12, 2026
76 checks passed
@steve8708
steve8708 deleted the changes-466 branch July 12, 2026 16:45
steve8708 added a commit that referenced this pull request Sep 3, 2026
…harts (#2046)

* fix: keep local plans private and support recap runners

* fix: harden local plan privacy transitions

* fix: cancel private route replay startup

* test: cover replay auth retry privacy

* fix: preserve private bridge across local navigation

* fix: restrict custom recap gate runners

* fix: isolate local bridges and preserve replay settings
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