Skip to content

feat(logger): stamp model + rulesCount onto every event#3

Merged
bigboateng merged 1 commit intomainfrom
feat/event-model-and-rules-count
Apr 18, 2026
Merged

feat(logger): stamp model + rulesCount onto every event#3
bigboateng merged 1 commit intomainfrom
feat/event-model-and-rules-count

Conversation

@bigboateng
Copy link
Copy Markdown
Contributor

Summary

  • Adds `model` to `BoundaryLoggerOptions` so every emitted event is tagged with the LLM label. Per-call override is honored via `contract.accept(run, { model })`.
  • Stamps `rulesCount` on every event, taken from the contract's rule list at runtime.
  • Bumps the `@withboundary/contract` peer to `^1.2.0` for the new `onRunStart` hook shape (`rulesCount` + `model`).

Why

Downstream observability sinks want to slice runs by model and see how many rules a contract enforces at any given time. The fields are purely additive and optional on the wire.

Test plan

  • `pnpm test` (39 passing, three new cases: default model applied, per-call override wins, rulesCount matches rule array length)
  • `pnpm build`

- BoundaryLoggerOptions gains a default model label.
- Per-call override flows through from contract.accept({ model }).
- rulesCount is populated from the contract's rules array at runtime.

Requires @withboundary/contract@^1.2.0 for the updated onRunStart hook.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bigboateng bigboateng merged commit e15896e into main Apr 18, 2026
3 checks passed
@bigboateng bigboateng deleted the feat/event-model-and-rules-count branch April 19, 2026 14:42
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