Skip to content

Execution Trace ID#118

Merged
aarne merged 5 commits intomainfrom
traversal_id_doing
Mar 9, 2026
Merged

Execution Trace ID#118
aarne merged 5 commits intomainfrom
traversal_id_doing

Conversation

@aarne
Copy link
Contributor

@aarne aarne commented Mar 9, 2026

No description provided.

…h enumeration (#117)

* Initial plan

* feat(bridge-core): add enumerateTraversalIds function

Enumerates all possible traversal paths through a Bridge.
Each entry represents a unique code path determined by the wire
structure (fallback chains, catch gates, array scopes, ternary
branches). Useful for complexity assessment and future integration
into the execution engine for monitoring.

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
@changeset-bot
Copy link

changeset-bot bot commented Mar 9, 2026

🦋 Changeset detected

Latest commit: 0227e50

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@stackables/bridge Patch
@stackables/bridge-core Patch
@stackables/bridge-compiler Patch
@stackables/bridge-graphql Patch
@stackables/bridge-parser Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 9, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bridge 0227e50 Commit Preview URL

Branch Preview URL
Mar 09 2026, 11:59 AM

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

🐰 Bencher Report

Branchtraversal_id_doing
Testbedubuntu-latest

⚠️ WARNING: Truncated view!

The full continuous benchmarking report exceeds the maximum length allowed on this platform.

🚨 20 Alerts

🐰 View full continuous benchmarking report in Bencher

* Initial plan

* feat: add execution trace bitmask to core engine

- Add bitIndex to TraversalEntry for bitmask encoding
- Add buildTraversalManifest (alias for enumerateTraversalIds)
- Add decodeExecutionTrace to decode bitmask back to entries
- Add buildTraceBitsMap for runtime wire→bit lookup
- Add traceBits/traceMask to TreeContext interface
- Inject trace recording in resolveWires (primary/fallback/catch/then/else)
- Add executionTrace to ExecuteBridgeResult
- Propagate trace mask through shadow trees
- All existing tests pass (133 execute-bridge + 64 resilience + 14 traversal)

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* test: add comprehensive tests for execution trace feature

- Test buildTraversalManifest alias and bitIndex assignment
- Test decodeExecutionTrace with empty/single/multiple/round-trip
- Test end-to-end trace collection: primary, fallback, catch, then/else, const
- All 27 tests pass

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* feat: add execution trace and manifest view to playground

- Add executionTrace to RunResult type in engine
- Pipe executionTrace through runBridgeStandalone
- Add getTraversalManifest and decodeExecutionTrace helpers to engine
- Show execution trace badge (hex) in ResultView
- Add Manifest tab to Bridge DSL panel header
- ManifestView shows all traversal entries with kind badges
- Active paths highlighted with ring + dot based on execution trace
- Works across mobile and desktop layouts

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* refactor: address code review feedback

- Rename dslTab → activeDslTab for clarity
- Rename fi → fallbackIndex in applyFallbackGates loop
- Add comment explaining bitmask check in decodeExecutionTrace
- Add INVARIANT comment for traceMask/traceBits coupling
- Document bitIndex assignment lifecycle in enumerateTraversalIds

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* feat: BigInt trace mask, manifest grouping/filtering, scroll fix

- Switch traceMask from number to bigint for unlimited entry support
- Update all recording helpers to use BigInt bitwise ops
- Update decodeExecutionTrace, ExecuteBridgeResult, TreeContext
- Update playground engine, ResultView, Playground types
- ManifestView: group entries by wire, show group headers for alternatives
- ManifestView: add "Show alternatives only" toggle filter
- ManifestView: fix scrolling with h-full / max-h-[60vh]
- Update tests to use bigint assertions
- All 1143 tests pass

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* fix: add aria-label to manifest group count for accessibility

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* feat: source descriptions, alias labels, empty-array grouping, always-on toggle

- Add `description` field to TraversalEntry with human-readable source info
  (e.g., "api.username", "|| \"Anonymous\"", "catch continue", "= \"SBB\"")
- Fix alias wires showing as `*` — use `to.field` for `__local` module targets
- Fix empty-array entries grouped under same `*` — assign unique wireIndex per scope
- Handle map resolves tool, input, context, pipe, and alias refs to handle aliases
- Filter toggle always visible regardless of whether alternatives exist
- Consistent group headers shown for all entries (not just alternatives)
- Empty-array entries show iterator variable in description (e.g., "c[] empty")
- All 1143 tests pass

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* UI tweaks

* LSP for dead code in playground

* Docs

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
Co-authored-by: Aarne Laur <aarne.laur@gmail.com>
@aarne aarne marked this pull request as ready for review March 9, 2026 11:36
@aarne aarne changed the title Traversal-ID Execution Trace ID Mar 9, 2026
@aarne aarne merged commit d6907a2 into main Mar 9, 2026
7 of 8 checks passed
@aarne aarne deleted the traversal_id_doing branch March 9, 2026 12:03
@github-actions github-actions bot mentioned this pull request Mar 9, 2026
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