Skip to content

feat(composer): add flow component debug package with OTEL-style global provider#145

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/create-flow-debugging-package
Draft

feat(composer): add flow component debug package with OTEL-style global provider#145
Copilot wants to merge 1 commit into
mainfrom
copilot/create-flow-debugging-package

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 1, 2026

Introduces internal/composer/debug — an OTEL-inspired global provider for flow component debugging. Designed to be called on every FlowComponent invocation with the noop path costing zero heap allocations.

Design

  • Debugger interfaceStartAction(ctx, componentName) Action begins a debug session per component call.
  • Action interfaceEnd(Outcome) records the result; Outcome is a plain value struct (StatusCode, Duration) with no pointers.
  • GetDebugger() / SetDebugger() — global accessors backed by atomic.Pointer[Debugger] for lock-free reads on the hot path.
  • Noop path — default provider returns pre-allocated singleton *noopAction; assigning a pointer to an interface is two-word stack storage, no heap escape. Verified at 0 B/op, 0 allocs/op.

Intended usage in a FlowComponent

action := debug.GetDebugger().StartAction(ctx, "my-component")
defer action.End(debug.Outcome{StatusCode: wrapper.StatusCode(), Duration: elapsed})

No init() functions; global state bootstrapped via var global = newGlobal() to satisfy the gochecknoinits linter.

@mr-jeeves mr-jeeves Bot force-pushed the copilot/create-flow-debugging-package branch 18 times, most recently from 2b6f01f to 1a992c2 Compare May 8, 2026 15:28
@mr-jeeves mr-jeeves Bot force-pushed the copilot/create-flow-debugging-package branch 6 times, most recently from 06e3519 to 2b581b1 Compare May 16, 2026 08:54
@mr-jeeves mr-jeeves Bot force-pushed the copilot/create-flow-debugging-package branch 2 times, most recently from 0d51f88 to 4c73b55 Compare May 20, 2026 07:06
@mr-jeeves mr-jeeves Bot force-pushed the copilot/create-flow-debugging-package branch from 4c73b55 to 0ced7c6 Compare May 20, 2026 07:10
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