feat(bridge-core): add enumerateTraversalIds for bridge traversal path enumeration#117
Merged
aarne merged 2 commits intotraversal_id_doingfrom Mar 9, 2026
Conversation
|
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>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bridge | 4ba106c | Commit Preview URL Branch Preview URL |
Mar 09 2026, 07:10 AM |
Copilot
AI
changed the title
[WIP] Add function to enumerate traversal ids for bridges
feat(bridge-core): add enumerateTraversalIds for bridge traversal path enumeration
Mar 9, 2026
Contributor
aarne
added a commit
that referenced
this pull request
Mar 9, 2026
* feat(bridge-core): add enumerateTraversalIds for bridge traversal path 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> * feat: runtime execution trace bitmask tracking with manifest view (#119) * 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> * Rename * feat: add SocialIcons component and update social links in config --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
enumerateTraversalIds(bridge: Bridge): TraversalEntry[]— enumerates the finite set of execution paths through a bridge's wires, determined purely by structure (independent of runtime values). Intended for complexity assessment and future execution engine monitoring integration.Wire traversal classification
||(falsy) or??(nullish) gate alternatives, withgateTypeandfallbackIndexcatchgatePlain array source wires (no fallbacks/catch) are excluded since they always execute; the
empty-arrayentry covers the "no elements" outcome.Example
Changes
packages/bridge-core/src/enumerate-traversals.tswithenumerateTraversalIdsandTraversalEntrytypebridge-coreindex (auto-reexported via umbrella package)✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.