Skip to content

data-elbobserve#692

Merged
alexanderkirtzel merged 12 commits into
mainfrom
691-data-elbobserve
Jul 11, 2026
Merged

data-elbobserve#692
alexanderkirtzel merged 12 commits into
mainfrom
691-data-elbobserve

Conversation

@alexanderkirtzel

@alexanderkirtzel alexanderkirtzel commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Added data-elbobserve declarative discovery for SPA-injected tagged content, including automatic cleanup and support for open shadow roots.
    • Added --release <id> to walkeros bundle to stamp per-flow source.release provenance.
  • Bug Fixes
    • Telemetry and emitted events now consistently use per-flow source.release (and omit source.version), with correct per-flow flowId.
    • Improved browser observe lifecycle so dynamically added/removed elements reliably register and stop, including shadow-root scenarios.
    • Included-section flattening is now deeper for nested objects.
  • Documentation
    • Updated event model, browser tagging, and bundling examples to reflect source.release and data-elbobserve.

@alexanderkirtzel alexanderkirtzel linked an issue Jul 8, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds per-flow event provenance via source.release, introduces data-elbobserve auto-registration for browser-injected content, deepens include flattening, and updates related docs, tests, and site navigation to match the new behavior.

Changes

Source Release Provenance

Layer / File(s) Summary
Schema and type contracts
packages/core/src/schemas/..., packages/core/src/types/..., packages/transformers/validate/src/event-format.schema.ts, .changeset/source-release-provenance.md
Adds name/release fields and source.release schema support across core contracts.
Collector runtime stamping
packages/collector/src/..., packages/collector/src/__tests__/flow-identity.test.ts
Collector instances, event creation, and flow state now derive provenance from collector name/release.
CLI bundle release stamping
packages/cli/src/cli.ts, packages/cli/src/commands/bundle/..., related tests
Adds --release and wires provenance stamping into bundle execution and tests.
Telemetry emitter release stamping
packages/cli/src/telemetry/..., packages/mcps/mcp/src/__tests__/telemetry.test.ts
Emitter and telemetry tests now use source.release instead of source.version.
Downstream fixtures and docs
apps/quickstart/..., packages/server/core/src/__tests__/*, packages/web/destinations/gtag/src/examples/step.ts, skills/walkeros-understanding-events/SKILL.md, website/docs/getting-started/event-model.mdx
Updates examples and assertions to include source.release.

Browser data-elbobserve Auto-Registration

Layer / File(s) Summary
Scope type extraction
packages/web/sources/browser/src/types/...
Moves scope types to a shared module and expands scope state for registrations and observers.
Element registration registry
packages/web/sources/browser/src/trigger.ts
Adds per-element registration tracking, teardown, and registry-backed scope cleanup.
Discovery scanning and trigger wiring
packages/web/sources/browser/src/trigger.ts
Adds observer-based container discovery and per-action registration bookkeeping.
Registry and reaper tests
packages/web/sources/browser/src/__tests__/*Registry*, *Register*, *Reaper*
Covers registration, ownership, and teardown paths.
Mutation and shadow DOM integration tests
packages/web/sources/browser/src/__tests__/observeMutation.test.ts, observeIntegration.test.ts, observeShadow.test.ts, trigger.test.ts
Validates discovery, cleanup, nested containers, and shadow-root behavior.
data-elbobserve docs and changeset
website/docs/sources/web/browser/commands.mdx, website/docs/sources/web/browser/tagging/html-attributes.mdx, .changeset/browser-data-elbobserve.md
Documents the new auto-registration flow and its limitations.

Include Section Flattening

Layer / File(s) Summary
Recursive include flattening
packages/core/src/include.ts, packages/core/src/__tests__/include.test.ts
Flattens nested include payloads recursively with underscore-joined keys and updated tests.

Docs, Sidebar, and Theme Updates

App docs and MCP/cloud styling

Layer / File(s) Summary
App docs and cloud UI support
website/docs/apps/mcp.mdx, website/docs/apps/runner.mdx, website/docusaurus.config.ts, website/src/css/custom.css, website/src/theme/Admonition/Types.tsx
Adds cloud admonition support and revises MCP/runner documentation.

Getting started content and examples

Layer / File(s) Summary
New getting-started pages and examples
website/docs/getting-started/deploy.mdx, website/docs/getting-started/examples/*
Adds deploy and example pages for bot detection, fingerprinting, and multi-destination examples.
Quickstart, flow, modes, and GA4 updates
website/docs/getting-started/{quickstart,flow,modes,ga4-ecommerce,index}.mdx, website/docs/guides/deploy-bunny-magic-containers.mdx, website/docs/destinations/web/gtag/ga4.mdx, website/docs/destinations/index.mdx
Revises quickstart, flow, modes, GA4, destination, and guide content.
Event-model and browser-source references
website/docs/getting-started/event-model.mdx, website/docs/sources/web/browser/commands.mdx, website/docs/migrating/v3-to-v4.mdx
Adds provenance and data-elbobserve references and adjusts migration text formatting.

Sidebar and navigation ordering

Layer / File(s) Summary
Sidebar ordering
website/sidebars.ts, website/docs/getting-started/index.mdx
Reorders get-started sidebar entries and updates landing-page navigation guidance.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • elbwalker/walkerOS#580: Touches the same operating-modes and quickstart documentation areas updated here.
  • elbwalker/walkerOS#657: Related to the collector observerEmit / buildBaseState flow-state path that this PR also updates.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title names a real feature in the changeset, but it is too generic to clearly describe the main change. Use a concise descriptive title that states the primary change, such as adding data-elbobserve support for SPA-injected content.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 691-data-elbobserve

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.

@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: 1

🧹 Nitpick comments (1)
packages/core/src/include.ts (1)

29-36: 🗄️ Data Integrity & Integration | 🔵 Trivial | 💤 Low value

Underscore-joined keys can silently collide.

Flattening joins nested keys with _, so an already-underscored flat key and a nested map can resolve to the same output key and overwrite each other (e.g. { a_b: 1 } vs { a: { b: 2 } } both → a_b). This is an edge case for the current event shapes, but worth a note since the last writer silently wins.

🤖 Prompt for 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.

In `@packages/core/src/include.ts` around lines 29 - 36, The flattenInto helper in
include.ts can overwrite values when underscore-joined keys collide, so update
the key handling to avoid silent last-writer-wins behavior. Either add collision
detection/guarding before assigning to out[prefix], or change the flattening
strategy in flattenInto to preserve both paths unambiguously; use flattenInto
and isObject to locate the nested/object branch and the final assignment.
🤖 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 `@packages/web/sources/browser/src/trigger.ts`:
- Around line 125-131: `reapElement` in `trigger.ts` only removes the first
matching `scrollElements` tuple for an element, leaving stale entries behind for
multi-trigger registrations. Update the cleanup logic in `reapElement` so it
removes all `[HTMLElement, number]` entries matching the target element from
`bucket.scrollElements` (instead of using `findIndex`/`splice`), ensuring
`handleTrigger` won’t later process detached elements.

---

Nitpick comments:
In `@packages/core/src/include.ts`:
- Around line 29-36: The flattenInto helper in include.ts can overwrite values
when underscore-joined keys collide, so update the key handling to avoid silent
last-writer-wins behavior. Either add collision detection/guarding before
assigning to out[prefix], or change the flattening strategy in flattenInto to
preserve both paths unambiguously; use flattenInto and isObject to locate the
nested/object branch and the final assignment.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: fa5c2d0b-ad2a-4d23-8f97-865f8ea428ad

📥 Commits

Reviewing files that changed from the base of the PR and between d73c8db and 9506e3e.

📒 Files selected for processing (41)
  • .changeset/browser-data-elbobserve.md
  • .changeset/source-release-provenance.md
  • apps/quickstart/src/__tests__/web-basic.test.ts
  • packages/cli/src/__tests__/integration/bundle/programmatic.test.ts
  • packages/cli/src/__tests__/unit/bundle/bundler-codegen.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/bundle/__tests__/archive-output.test.ts
  • packages/cli/src/commands/bundle/__tests__/multi-flow-output.test.ts
  • packages/cli/src/commands/bundle/bundler.ts
  • packages/cli/src/commands/bundle/index.ts
  • packages/cli/src/telemetry/__tests__/emitter.test.ts
  • packages/cli/src/telemetry/emitter.ts
  • packages/collector/src/__tests__/flow-identity.test.ts
  • packages/collector/src/collector.ts
  • packages/collector/src/handle.ts
  • packages/collector/src/observerEmit.ts
  • packages/core/src/__tests__/include.test.ts
  • packages/core/src/include.ts
  • packages/core/src/schemas/collector.ts
  • packages/core/src/schemas/walkeros.ts
  • packages/core/src/types/collector.ts
  • packages/core/src/types/walkeros.ts
  • packages/mcps/mcp/src/__tests__/telemetry.test.ts
  • packages/server/core/src/__tests__/collector.test.ts
  • packages/server/core/src/__tests__/destination.test.ts
  • packages/transformers/validate/src/event-format.schema.ts
  • packages/web/destinations/gtag/src/examples/step.ts
  • packages/web/sources/browser/src/__tests__/observeIntegration.test.ts
  • packages/web/sources/browser/src/__tests__/observeMutation.test.ts
  • packages/web/sources/browser/src/__tests__/observeReaper.test.ts
  • packages/web/sources/browser/src/__tests__/observeRegister.test.ts
  • packages/web/sources/browser/src/__tests__/observeRegistry.test.ts
  • packages/web/sources/browser/src/__tests__/observeShadow.test.ts
  • packages/web/sources/browser/src/__tests__/trigger.test.ts
  • packages/web/sources/browser/src/trigger.ts
  • packages/web/sources/browser/src/types/elb.ts
  • packages/web/sources/browser/src/types/index.ts
  • packages/web/sources/browser/src/types/scope.ts
  • skills/walkeros-understanding-events/SKILL.md
  • website/docs/getting-started/event-model.mdx
  • website/docs/sources/web/browser/commands.mdx

Comment thread packages/web/sources/browser/src/trigger.ts
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Preview deployed

https://walkeros-io.b-cdn.net/preview/pr-692/

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

📦 Pre-release published (next)

Packages

Install: npm i @walkeros/core@next

🐳 Docker images published

  • walkeros/flow:4.3.0-next-1783517345197 (:next)
  • walkeros/cli:4.3.0-next-1783517345197 (:next)

Docker: docker pull walkeros/flow:next

@github-actions

Copy link
Copy Markdown
Contributor

📦 Pre-release published (next)

Packages

Install: npm i @walkeros/core@next

🐳 Docker images published

  • walkeros/flow:4.3.0-next-1783710078012 (:next)
  • walkeros/cli:4.3.0-next-1783710078012 (:next)

Docker: docker pull walkeros/flow:next

@alexanderkirtzel alexanderkirtzel merged commit c9a8c9c into main Jul 11, 2026
2 of 4 checks passed
@alexanderkirtzel alexanderkirtzel deleted the 691-data-elbobserve branch July 11, 2026 11:20
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.

data-elbobserve

1 participant