Skip to content

feat: add the execution-metrics plugin - #14

Merged
aryasaatvik merged 4 commits into
devfrom
feat/metrics-plugin
Jun 13, 2026
Merged

aryasaatvik merged 4 commits into
devfrom
feat/metrics-plugin

Conversation

@aryasaatvik

@aryasaatvik aryasaatvik commented Jun 13, 2026 •

Copy link
Copy Markdown
Owner

Adds @executor-js/plugin-execution-metrics — an opt-in metrics sink built on the observer foundation.

  • Base plugin drives Effect Metric counters + an execution-duration histogram from the event stream.
  • ./api: an auth-gated GET /execution-metrics/metrics Prometheus scrape (executionMetricsHttpPlugin).
  • ./cloudflare: a Workers Analytics Engine sink (writeDataPoint) — per-isolate Effect metrics being meaningless on a Worker fleet. Wired opt-in on host-cloudflare, gated on the ANALYTICS binding.

Base . entry free of @executor-js/api and @cloudflare/workers-types.

Stacked on the execution-observer foundation. Gates: format:check, lint, full-monorepo typecheck, and metrics-render tests green (an adversarial-verify pass caught + fixed a Prometheus histogram-bucket bug).

Stack

  1. feat: add the execution-observer foundation #12
  2. feat: add the execution-history plugin #13
  3. feat: add the execution-metrics plugin #14 👈 current

@aryasaatvik
aryasaatvik force-pushed the feat/metrics-plugin branch from 995e478 to 07dd738 Compare June 13, 2026 18:55
@socket-security

socket-security Bot commented Jun 13, 2026 •

Copy link
Copy Markdown

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

@aryasaatvik
aryasaatvik force-pushed the feat/metrics-plugin branch from 07dd738 to 099618b Compare June 13, 2026 19:00
@aryasaatvik
aryasaatvik changed the base branch from feat/observer-foundation to feat/history-plugin June 13, 2026 19:00
@aryasaatvik
aryasaatvik marked this pull request as ready for review June 13, 2026 19:06
@greptile-apps

greptile-apps Bot commented Jun 13, 2026 •

Copy link
Copy Markdown

Greptile Summary

Adds @executor-js/plugin-execution-metrics, a new opt-in plugin that fans execution lifecycle events into two distinct sinks: a global Effect Metric registry (counters + duration histogram) for long-lived self-hosted processes, and a Workers Analytics Engine sink for Cloudflare deployments where per-isolate metrics would be meaningless.

  • Base SDK plugin (./) drives Effect Metric counters and a histogram via createExecutionMetricsObserver; start timestamps are kept in a 10,000-entry bounded LRU map so ExecutionFinished can compute durations without leaking memory.
  • API sub-entry (./api) adds an auth-gated GET /execution-metrics/metrics Prometheus scrape via a hand-rolled text-exposition renderer that correctly handles all five Effect Metric types and emits the +Inf bucket exactly once (verified by adversarial test).
  • Cloudflare sub-entry (./cloudflare) writes one writeDataPoint per finished execution/tool call; gated on the optional ANALYTICS binding so the Worker boots cleanly without it.

Confidence Score: 5/5

Safe to merge — the plugin is strictly additive and opt-in; no existing paths are altered and the Cloudflare host degrades gracefully to a no-op when the ANALYTICS binding is absent.

All three sub-entries are cleanly isolated (no cross-contamination of @executor-js/api or @cloudflare/workers-types into the base entry), the bounded-map correctly handles the previously noted memory-growth risk, the +Inf duplicate-bucket bug was caught and fixed before merging (with a regression test), and the only open item is a minor rendering consistency nit in the Prometheus serializer.

No files require special attention; prometheus.ts has one minor formatValue inconsistency for _count lines but it carries no practical impact given Effect's histogram/summary state types.

Important Files Changed

Filename Overview
packages/plugins/execution-metrics/src/sdk/observer.ts Core Effect Metric observer: drives counters and duration histogram from the execution event stream; correctly cleans up per-execution start state and degrades gracefully when a start entry is absent.
packages/plugins/execution-metrics/src/sdk/bounded-map.ts LRU-style bounded-map helper that caps in-flight start-time entries at 10,000 and evicts the oldest on overflow; prevents unbounded memory growth in long-lived hosts.
packages/plugins/execution-metrics/src/api/prometheus.ts Custom Prometheus text-exposition renderer over the global Effect Metric registry; handles Counter, Gauge, Histogram, Summary, and Frequency; histogram and summary _count lines use raw interpolation rather than formatValue unlike their _sum counterparts.
packages/plugins/execution-metrics/src/cloudflare/index.ts WAE observer: writes one Analytics Engine data point per finished execution/tool call, tracking start times for both event types via the shared bounded-map helper; correctly fire-and-forget inside Effect.sync.
packages/plugins/execution-metrics/src/api/prometheus.test.ts End-to-end test covering the observer→registry→renderPrometheus pipeline; verifies +Inf bucket is emitted exactly once (the adversarial fix), trigger_kind label propagation, and all required TYPE headers.
apps/host-cloudflare/src/plugins.ts Wires executionMetricsPlugin with WAE observer when ANALYTICS binding is present, falling back to noopExecutionObserver; correctly avoids mounting the Prometheus HTTP route on Workers.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    EE[Execution Engine] -->|ExecutionEvent stream| CO[composeExecutionObservers]

    CO --> EMO{executionMetricsPlugin\nobserver option}
    EMO -->|default: long-lived host| EffectObs[createExecutionMetricsObserver\nSDK observer]
    EMO -->|Cloudflare + ANALYTICS binding| WAEObs[createWaeMetricsObserver\nWAE observer]
    EMO -->|Cloudflare, no binding| Noop[noopExecutionObserver]

    EffectObs -->|ExecutionStarted| BM1[rememberStart\nboundedMap 10k cap]
    EffectObs -->|ExecutionFinished| MR[Effect Metric Registry\nglobal counters + histogram]
    EffectObs -->|ToolCallStarted/Finished| MR

    WAEObs -->|ExecutionStarted| BM2[rememberStart\nboundedMap 10k cap]
    WAEObs -->|ExecutionFinished| WAE[(Workers\nAnalytics Engine)]
    WAEObs -->|ToolCallFinished| WAE

    MR -->|Metric.snapshot| Prom[renderPrometheus\ntext/plain]
    Prom -->|GET /execution-metrics/metrics\nauth-gated| Scraper[Prometheus Scraper]
Loading

Fix All in Codex Fix All in Cursor Cloud Agents Fix All in Claude Code Fix All in Cursor

Reviews (4): Last reviewed commit: "fix(plugin-execution-metrics): address G..." | Re-trigger Greptile

Comment thread packages/plugins/execution-metrics/src/api/prometheus.ts
Comment thread packages/plugins/execution-metrics/src/sdk/observer.ts
@aryasaatvik
aryasaatvik force-pushed the feat/history-plugin branch from 915777b to 2484437 Compare June 13, 2026 19:32
@aryasaatvik
aryasaatvik force-pushed the feat/metrics-plugin branch from 099618b to 6bd65e7 Compare June 13, 2026 19:32
@aryasaatvik
aryasaatvik force-pushed the feat/history-plugin branch from 2484437 to 1e981af Compare June 13, 2026 20:33
aryasaatvik added a commit that referenced this pull request Jun 13, 2026
- Bound the per-execution start-time Maps so an execution killed before its
  Finished event can't leak its entry forever in a long-lived host. A shared
  rememberStart helper evicts the oldest entry at capacity; applied to the
  Effect-metric observer's executionStarts and the WAE observer's
  executionStarts + toolCallStarts.
- Prometheus: render Frequency occurrences through formatValue, matching every
  other metric branch (bigint / special-float consistency).
@aryasaatvik
aryasaatvik force-pushed the feat/metrics-plugin branch from 6bd65e7 to 832a960 Compare June 13, 2026 20:33
aryasaatvik added a commit that referenced this pull request Jun 13, 2026
Adds the **execution-observer foundation** — the seam the history and
metrics plugins build on.

- New `ExecutionObserver` contract in the SDK: six tagged lifecycle
events (`ExecutionStarted`/`Finished`, `ToolCallStarted`/`Finished`,
`InteractionStarted`/`Resolved`) + `composeExecutionObservers`, with a
`plugin.runtime.executionObserver` hook.
- The execution engine emits the events (re-derived onto the current
Queue-based pause model), exposes `Executor.owner`, and tags the run
span with the execution id + trigger.
- `makeExecutionStack` composes plugin observers — one seam covers every
HTTP host and the MCP Durable Objects; local's fixed-execution +
in-process MCP are wired directly.

**Behaviour-neutral / opt-in:** with no plugin observing, every path is
a no-op.

Gates: `format:check`, `lint`, full-monorepo `typecheck`, and observer
unit tests all green. Live app verification still to come.

<!-- stack:links:start -->
### [Stack](https://github.com/kitlangton/stack)

1. **#12** 👈 current
2. #13
3. #14
<!-- stack:links:end -->
@aryasaatvik
aryasaatvik force-pushed the feat/history-plugin branch from 1e981af to a06c2d6 Compare June 13, 2026 20:50
aryasaatvik added a commit that referenced this pull request Jun 13, 2026
- Bound the per-execution start-time Maps so an execution killed before its
  Finished event can't leak its entry forever in a long-lived host. A shared
  rememberStart helper evicts the oldest entry at capacity; applied to the
  Effect-metric observer's executionStarts and the WAE observer's
  executionStarts + toolCallStarts.
- Prometheus: render Frequency occurrences through formatValue, matching every
  other metric branch (bigint / special-float consistency).
@aryasaatvik
aryasaatvik force-pushed the feat/metrics-plugin branch from 832a960 to 4e0398a Compare June 13, 2026 20:50
@aryasaatvik
aryasaatvik changed the base branch from feat/history-plugin to dev June 13, 2026 20:50
aryasaatvik added a commit that referenced this pull request Jun 13, 2026
Adds **`@executor-js/plugin-execution-history`** — an opt-in
execution-history sink built on the observer foundation.

- Records every run (plus its tool calls and interactions) into three
owner-scoped `pluginStorage` collections via a buffered-batch writer —
**no new tables, no migrations**; works on D1/libSQL/sqlite/postgres.
- `./api`: a scoped read API (`list`/`get`/`listToolCalls`) over HttpApi
(`executionHistoryHttpPlugin`).
- `./client`: a Runs page at `/plugins/executionHistory/` (table, status
filter, pagination, 4-tab detail drawer) — mounts via the existing
plugins catch-all with zero router changes.

The base `.` entry never loads the API or React layers. Fully opt-in
(not registered in any default config).

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, unit + handler tests green. Runs-page
live render still to verify.

<!-- stack:links:start -->
### [Stack](https://github.com/kitlangton/stack)

1. #12
2. **#13** 👈 current
3. #14
<!-- stack:links:end -->
…pe, and WAE sink

New opt-in @executor-js/plugin-execution-metrics package, built on the
ExecutionObserver foundation. The base SDK plugin drives Effect Metric counters
(executions/tool-calls started/completed/failed) and an execution-duration
histogram (with a trigger_kind label) from the event stream.

./api adds executionMetricsHttpPlugin: an auth-gated GET /execution-metrics/
metrics that renders the registry as Prometheus text exposition.

./cloudflare adds createWaeMetricsObserver: a Cloudflare-only observer that
writes one Workers Analytics Engine data point per finished execution/tool call.
Base '.' entry never loads @executor-js/api or @cloudflare/workers-types.
…Engine

Wires @executor-js/plugin-execution-metrics into the Cloudflare host with a WAE
sink. The plugin is always in the tuple (no tables/API) but its observer is a
no-op until the operator binds ANALYTICS — opt-in by uncommenting
analytics_engine_datasets in wrangler.jsonc. No /metrics scrape on the Worker;
WAE is the sink.
- Bound the per-execution start-time Maps so an execution killed before its
  Finished event can't leak its entry forever in a long-lived host. A shared
  rememberStart helper evicts the oldest entry at capacity; applied to the
  Effect-metric observer's executionStarts and the WAE observer's
  executionStarts + toolCallStarts.
- Prometheus: render Frequency occurrences through formatValue, matching every
  other metric branch (bigint / special-float consistency).
@aryasaatvik
aryasaatvik force-pushed the feat/metrics-plugin branch from 4e0398a to 9308927 Compare June 13, 2026 20:51
@aryasaatvik
aryasaatvik merged commit 94b50a2 into dev Jun 13, 2026
2 of 4 checks passed
aryasaatvik added a commit that referenced this pull request Jun 23, 2026
Adds the **execution-observer foundation** — the seam the history and
metrics plugins build on.

- New `ExecutionObserver` contract in the SDK: six tagged lifecycle
events (`ExecutionStarted`/`Finished`, `ToolCallStarted`/`Finished`,
`InteractionStarted`/`Resolved`) + `composeExecutionObservers`, with a
`plugin.runtime.executionObserver` hook.
- The execution engine emits the events (re-derived onto the current
Queue-based pause model), exposes `Executor.owner`, and tags the run
span with the execution id + trigger.
- `makeExecutionStack` composes plugin observers — one seam covers every
HTTP host and the MCP Durable Objects; local's fixed-execution +
in-process MCP are wired directly.

**Behaviour-neutral / opt-in:** with no plugin observing, every path is
a no-op.

Gates: `format:check`, `lint`, full-monorepo `typecheck`, and observer
unit tests all green. Live app verification still to come.

<!-- stack:links:start -->

1. **#12** 👈 current
2. #13
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Jun 23, 2026
Adds **`@executor-js/plugin-execution-history`** — an opt-in
execution-history sink built on the observer foundation.

- Records every run (plus its tool calls and interactions) into three
owner-scoped `pluginStorage` collections via a buffered-batch writer —
**no new tables, no migrations**; works on D1/libSQL/sqlite/postgres.
- `./api`: a scoped read API (`list`/`get`/`listToolCalls`) over HttpApi
(`executionHistoryHttpPlugin`).
- `./client`: a Runs page at `/plugins/executionHistory/` (table, status
filter, pagination, 4-tab detail drawer) — mounts via the existing
plugins catch-all with zero router changes.

The base `.` entry never loads the API or React layers. Fully opt-in
(not registered in any default config).

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, unit + handler tests green. Runs-page
live render still to verify.

<!-- stack:links:start -->
### [Stack](https://github.com/kitlangton/stack)

1. #12
2. **#13** 👈 current
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Jun 23, 2026
Adds **`@executor-js/plugin-execution-metrics`** — an opt-in metrics
sink built on the observer foundation.

- Base plugin drives Effect Metric counters + an execution-duration
histogram from the event stream.
- `./api`: an auth-gated `GET /execution-metrics/metrics` Prometheus
scrape (`executionMetricsHttpPlugin`).
- `./cloudflare`: a Workers Analytics Engine sink (`writeDataPoint`) —
per-isolate Effect metrics being meaningless on a Worker fleet. Wired
opt-in on host-cloudflare, gated on the `ANALYTICS` binding.

Base `.` entry free of `@executor-js/api` and
`@cloudflare/workers-types`.

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, and metrics-render tests green (an
adversarial-verify pass caught + fixed a Prometheus histogram-bucket
bug).

<!-- stack:links:start -->

1. #12
2. #13
3. **#14** 👈 current
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Jun 23, 2026
Adds the **execution-observer foundation** — the seam the history and
metrics plugins build on.

- New `ExecutionObserver` contract in the SDK: six tagged lifecycle
events (`ExecutionStarted`/`Finished`, `ToolCallStarted`/`Finished`,
`InteractionStarted`/`Resolved`) + `composeExecutionObservers`, with a
`plugin.runtime.executionObserver` hook.
- The execution engine emits the events (re-derived onto the current
Queue-based pause model), exposes `Executor.owner`, and tags the run
span with the execution id + trigger.
- `makeExecutionStack` composes plugin observers — one seam covers every
HTTP host and the MCP Durable Objects; local's fixed-execution +
in-process MCP are wired directly.

**Behaviour-neutral / opt-in:** with no plugin observing, every path is
a no-op.

Gates: `format:check`, `lint`, full-monorepo `typecheck`, and observer
unit tests all green. Live app verification still to come.

<!-- stack:links:start -->

1. **#12** 👈 current
2. #13
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Jun 23, 2026
Adds **`@executor-js/plugin-execution-history`** — an opt-in
execution-history sink built on the observer foundation.

- Records every run (plus its tool calls and interactions) into three
owner-scoped `pluginStorage` collections via a buffered-batch writer —
**no new tables, no migrations**; works on D1/libSQL/sqlite/postgres.
- `./api`: a scoped read API (`list`/`get`/`listToolCalls`) over HttpApi
(`executionHistoryHttpPlugin`).
- `./client`: a Runs page at `/plugins/executionHistory/` (table, status
filter, pagination, 4-tab detail drawer) — mounts via the existing
plugins catch-all with zero router changes.

The base `.` entry never loads the API or React layers. Fully opt-in
(not registered in any default config).

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, unit + handler tests green. Runs-page
live render still to verify.

<!-- stack:links:start -->
### [Stack](https://github.com/kitlangton/stack)

1. #12
2. **#13** 👈 current
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Jun 23, 2026
Adds **`@executor-js/plugin-execution-metrics`** — an opt-in metrics
sink built on the observer foundation.

- Base plugin drives Effect Metric counters + an execution-duration
histogram from the event stream.
- `./api`: an auth-gated `GET /execution-metrics/metrics` Prometheus
scrape (`executionMetricsHttpPlugin`).
- `./cloudflare`: a Workers Analytics Engine sink (`writeDataPoint`) —
per-isolate Effect metrics being meaningless on a Worker fleet. Wired
opt-in on host-cloudflare, gated on the `ANALYTICS` binding.

Base `.` entry free of `@executor-js/api` and
`@cloudflare/workers-types`.

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, and metrics-render tests green (an
adversarial-verify pass caught + fixed a Prometheus histogram-bucket
bug).

<!-- stack:links:start -->

1. #12
2. #13
3. **#14** 👈 current
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 18, 2026
Adds the **execution-observer foundation** — the seam the history and
metrics plugins build on.

- New `ExecutionObserver` contract in the SDK: six tagged lifecycle
events (`ExecutionStarted`/`Finished`, `ToolCallStarted`/`Finished`,
`InteractionStarted`/`Resolved`) + `composeExecutionObservers`, with a
`plugin.runtime.executionObserver` hook.
- The execution engine emits the events (re-derived onto the current
Queue-based pause model), exposes `Executor.owner`, and tags the run
span with the execution id + trigger.
- `makeExecutionStack` composes plugin observers — one seam covers every
HTTP host and the MCP Durable Objects; local's fixed-execution +
in-process MCP are wired directly.

**Behaviour-neutral / opt-in:** with no plugin observing, every path is
a no-op.

Gates: `format:check`, `lint`, full-monorepo `typecheck`, and observer
unit tests all green. Live app verification still to come.

<!-- stack:links:start -->

1. **#12** 👈 current
2. #13
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 18, 2026
Adds **`@executor-js/plugin-execution-history`** — an opt-in
execution-history sink built on the observer foundation.

- Records every run (plus its tool calls and interactions) into three
owner-scoped `pluginStorage` collections via a buffered-batch writer —
**no new tables, no migrations**; works on D1/libSQL/sqlite/postgres.
- `./api`: a scoped read API (`list`/`get`/`listToolCalls`) over HttpApi
(`executionHistoryHttpPlugin`).
- `./client`: a Runs page at `/plugins/executionHistory/` (table, status
filter, pagination, 4-tab detail drawer) — mounts via the existing
plugins catch-all with zero router changes.

The base `.` entry never loads the API or React layers. Fully opt-in
(not registered in any default config).

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, unit + handler tests green. Runs-page
live render still to verify.

<!-- stack:links:start -->
### [Stack](https://github.com/kitlangton/stack)

1. #12
2. **#13** 👈 current
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 18, 2026
Adds **`@executor-js/plugin-execution-metrics`** — an opt-in metrics
sink built on the observer foundation.

- Base plugin drives Effect Metric counters + an execution-duration
histogram from the event stream.
- `./api`: an auth-gated `GET /execution-metrics/metrics` Prometheus
scrape (`executionMetricsHttpPlugin`).
- `./cloudflare`: a Workers Analytics Engine sink (`writeDataPoint`) —
per-isolate Effect metrics being meaningless on a Worker fleet. Wired
opt-in on host-cloudflare, gated on the `ANALYTICS` binding.

Base `.` entry free of `@executor-js/api` and
`@cloudflare/workers-types`.

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, and metrics-render tests green (an
adversarial-verify pass caught + fixed a Prometheus histogram-bucket
bug).

<!-- stack:links:start -->

1. #12
2. #13
3. **#14** 👈 current
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 23, 2026
Adds the **execution-observer foundation** — the seam the history and
metrics plugins build on.

- New `ExecutionObserver` contract in the SDK: six tagged lifecycle
events (`ExecutionStarted`/`Finished`, `ToolCallStarted`/`Finished`,
`InteractionStarted`/`Resolved`) + `composeExecutionObservers`, with a
`plugin.runtime.executionObserver` hook.
- The execution engine emits the events (re-derived onto the current
Queue-based pause model), exposes `Executor.owner`, and tags the run
span with the execution id + trigger.
- `makeExecutionStack` composes plugin observers — one seam covers every
HTTP host and the MCP Durable Objects; local's fixed-execution +
in-process MCP are wired directly.

**Behaviour-neutral / opt-in:** with no plugin observing, every path is
a no-op.

Gates: `format:check`, `lint`, full-monorepo `typecheck`, and observer
unit tests all green. Live app verification still to come.

<!-- stack:links:start -->

1. **#12** 👈 current
2. #13
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 23, 2026
Adds **`@executor-js/plugin-execution-history`** — an opt-in
execution-history sink built on the observer foundation.

- Records every run (plus its tool calls and interactions) into three
owner-scoped `pluginStorage` collections via a buffered-batch writer —
**no new tables, no migrations**; works on D1/libSQL/sqlite/postgres.
- `./api`: a scoped read API (`list`/`get`/`listToolCalls`) over HttpApi
(`executionHistoryHttpPlugin`).
- `./client`: a Runs page at `/plugins/executionHistory/` (table, status
filter, pagination, 4-tab detail drawer) — mounts via the existing
plugins catch-all with zero router changes.

The base `.` entry never loads the API or React layers. Fully opt-in
(not registered in any default config).

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, unit + handler tests green. Runs-page
live render still to verify.

<!-- stack:links:start -->

1. #12
2. **#13** 👈 current
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 27, 2026
Adds the **execution-observer foundation** — the seam the history and
metrics plugins build on.

- New `ExecutionObserver` contract in the SDK: six tagged lifecycle
events (`ExecutionStarted`/`Finished`, `ToolCallStarted`/`Finished`,
`InteractionStarted`/`Resolved`) + `composeExecutionObservers`, with a
`plugin.runtime.executionObserver` hook.
- The execution engine emits the events (re-derived onto the current
Queue-based pause model), exposes `Executor.owner`, and tags the run
span with the execution id + trigger.
- `makeExecutionStack` composes plugin observers — one seam covers every
HTTP host and the MCP Durable Objects; local's fixed-execution +
in-process MCP are wired directly.

**Behaviour-neutral / opt-in:** with no plugin observing, every path is
a no-op.

Gates: `format:check`, `lint`, full-monorepo `typecheck`, and observer
unit tests all green. Live app verification still to come.

<!-- stack:links:start -->

1. **#12** 👈 current
2. #13
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 27, 2026
Adds **`@executor-js/plugin-execution-history`** — an opt-in
execution-history sink built on the observer foundation.

- Records every run (plus its tool calls and interactions) into three
owner-scoped `pluginStorage` collections via a buffered-batch writer —
**no new tables, no migrations**; works on D1/libSQL/sqlite/postgres.
- `./api`: a scoped read API (`list`/`get`/`listToolCalls`) over HttpApi
(`executionHistoryHttpPlugin`).
- `./client`: a Runs page at `/plugins/executionHistory/` (table, status
filter, pagination, 4-tab detail drawer) — mounts via the existing
plugins catch-all with zero router changes.

The base `.` entry never loads the API or React layers. Fully opt-in
(not registered in any default config).

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, unit + handler tests green. Runs-page
live render still to verify.

<!-- stack:links:start -->

1. #12
2. **#13** 👈 current
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 28, 2026
Adds the **execution-observer foundation** — the seam the history and
metrics plugins build on.

- New `ExecutionObserver` contract in the SDK: six tagged lifecycle
events (`ExecutionStarted`/`Finished`, `ToolCallStarted`/`Finished`,
`InteractionStarted`/`Resolved`) + `composeExecutionObservers`, with a
`plugin.runtime.executionObserver` hook.
- The execution engine emits the events (re-derived onto the current
Queue-based pause model), exposes `Executor.owner`, and tags the run
span with the execution id + trigger.
- `makeExecutionStack` composes plugin observers — one seam covers every
HTTP host and the MCP Durable Objects; local's fixed-execution +
in-process MCP are wired directly.

**Behaviour-neutral / opt-in:** with no plugin observing, every path is
a no-op.

Gates: `format:check`, `lint`, full-monorepo `typecheck`, and observer
unit tests all green. Live app verification still to come.

<!-- stack:links:start -->

1. **#12** 👈 current
2. #13
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 28, 2026
Adds **`@executor-js/plugin-execution-history`** — an opt-in
execution-history sink built on the observer foundation.

- Records every run (plus its tool calls and interactions) into three
owner-scoped `pluginStorage` collections via a buffered-batch writer —
**no new tables, no migrations**; works on D1/libSQL/sqlite/postgres.
- `./api`: a scoped read API (`list`/`get`/`listToolCalls`) over HttpApi
(`executionHistoryHttpPlugin`).
- `./client`: a Runs page at `/plugins/executionHistory/` (table, status
filter, pagination, 4-tab detail drawer) — mounts via the existing
plugins catch-all with zero router changes.

The base `.` entry never loads the API or React layers. Fully opt-in
(not registered in any default config).

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, unit + handler tests green. Runs-page
live render still to verify.

<!-- stack:links:start -->

1. #12
2. **#13** 👈 current
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 29, 2026
Adds the **execution-observer foundation** — the seam the history and
metrics plugins build on.

- New `ExecutionObserver` contract in the SDK: six tagged lifecycle
events (`ExecutionStarted`/`Finished`, `ToolCallStarted`/`Finished`,
`InteractionStarted`/`Resolved`) + `composeExecutionObservers`, with a
`plugin.runtime.executionObserver` hook.
- The execution engine emits the events (re-derived onto the current
Queue-based pause model), exposes `Executor.owner`, and tags the run
span with the execution id + trigger.
- `makeExecutionStack` composes plugin observers — one seam covers every
HTTP host and the MCP Durable Objects; local's fixed-execution +
in-process MCP are wired directly.

**Behaviour-neutral / opt-in:** with no plugin observing, every path is
a no-op.

Gates: `format:check`, `lint`, full-monorepo `typecheck`, and observer
unit tests all green. Live app verification still to come.

<!-- stack:links:start -->

1. **#12** 👈 current
2. #13
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 29, 2026
Adds **`@executor-js/plugin-execution-history`** — an opt-in
execution-history sink built on the observer foundation.

- Records every run (plus its tool calls and interactions) into three
owner-scoped `pluginStorage` collections via a buffered-batch writer —
**no new tables, no migrations**; works on D1/libSQL/sqlite/postgres.
- `./api`: a scoped read API (`list`/`get`/`listToolCalls`) over HttpApi
(`executionHistoryHttpPlugin`).
- `./client`: a Runs page at `/plugins/executionHistory/` (table, status
filter, pagination, 4-tab detail drawer) — mounts via the existing
plugins catch-all with zero router changes.

The base `.` entry never loads the API or React layers. Fully opt-in
(not registered in any default config).

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, unit + handler tests green. Runs-page
live render still to verify.

<!-- stack:links:start -->

1. #12
2. **#13** 👈 current
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 31, 2026
Adds the **execution-observer foundation** — the seam the history and
metrics plugins build on.

- New `ExecutionObserver` contract in the SDK: six tagged lifecycle
events (`ExecutionStarted`/`Finished`, `ToolCallStarted`/`Finished`,
`InteractionStarted`/`Resolved`) + `composeExecutionObservers`, with a
`plugin.runtime.executionObserver` hook.
- The execution engine emits the events (re-derived onto the current
Queue-based pause model), exposes `Executor.owner`, and tags the run
span with the execution id + trigger.
- `makeExecutionStack` composes plugin observers — one seam covers every
HTTP host and the MCP Durable Objects; local's fixed-execution +
in-process MCP are wired directly.

**Behaviour-neutral / opt-in:** with no plugin observing, every path is
a no-op.

Gates: `format:check`, `lint`, full-monorepo `typecheck`, and observer
unit tests all green. Live app verification still to come.

<!-- stack:links:start -->

1. **#12** 👈 current
2. #13
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Aug 31, 2026
Adds **`@executor-js/plugin-execution-history`** — an opt-in
execution-history sink built on the observer foundation.

- Records every run (plus its tool calls and interactions) into three
owner-scoped `pluginStorage` collections via a buffered-batch writer —
**no new tables, no migrations**; works on D1/libSQL/sqlite/postgres.
- `./api`: a scoped read API (`list`/`get`/`listToolCalls`) over HttpApi
(`executionHistoryHttpPlugin`).
- `./client`: a Runs page at `/plugins/executionHistory/` (table, status
filter, pagination, 4-tab detail drawer) — mounts via the existing
plugins catch-all with zero router changes.

The base `.` entry never loads the API or React layers. Fully opt-in
(not registered in any default config).

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, unit + handler tests green. Runs-page
live render still to verify.

<!-- stack:links:start -->

1. #12
2. **#13** 👈 current
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Sep 13, 2026
Adds the **execution-observer foundation** — the seam the history and
metrics plugins build on.

- New `ExecutionObserver` contract in the SDK: six tagged lifecycle
events (`ExecutionStarted`/`Finished`, `ToolCallStarted`/`Finished`,
`InteractionStarted`/`Resolved`) + `composeExecutionObservers`, with a
`plugin.runtime.executionObserver` hook.
- The execution engine emits the events (re-derived onto the current
Queue-based pause model), exposes `Executor.owner`, and tags the run
span with the execution id + trigger.
- `makeExecutionStack` composes plugin observers — one seam covers every
HTTP host and the MCP Durable Objects; local's fixed-execution +
in-process MCP are wired directly.

**Behaviour-neutral / opt-in:** with no plugin observing, every path is
a no-op.

Gates: `format:check`, `lint`, full-monorepo `typecheck`, and observer
unit tests all green. Live app verification still to come.

<!-- stack:links:start -->

1. **#12** 👈 current
2. #13
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Sep 13, 2026
Adds **`@executor-js/plugin-execution-history`** — an opt-in
execution-history sink built on the observer foundation.

- Records every run (plus its tool calls and interactions) into three
owner-scoped `pluginStorage` collections via a buffered-batch writer —
**no new tables, no migrations**; works on D1/libSQL/sqlite/postgres.
- `./api`: a scoped read API (`list`/`get`/`listToolCalls`) over HttpApi
(`executionHistoryHttpPlugin`).
- `./client`: a Runs page at `/plugins/executionHistory/` (table, status
filter, pagination, 4-tab detail drawer) — mounts via the existing
plugins catch-all with zero router changes.

The base `.` entry never loads the API or React layers. Fully opt-in
(not registered in any default config).

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, unit + handler tests green. Runs-page
live render still to verify.

<!-- stack:links:start -->

1. #12
2. **#13** 👈 current
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Sep 18, 2026
Adds the **execution-observer foundation** — the seam the history and
metrics plugins build on.

- New `ExecutionObserver` contract in the SDK: six tagged lifecycle
events (`ExecutionStarted`/`Finished`, `ToolCallStarted`/`Finished`,
`InteractionStarted`/`Resolved`) + `composeExecutionObservers`, with a
`plugin.runtime.executionObserver` hook.
- The execution engine emits the events (re-derived onto the current
Queue-based pause model), exposes `Executor.owner`, and tags the run
span with the execution id + trigger.
- `makeExecutionStack` composes plugin observers — one seam covers every
HTTP host and the MCP Durable Objects; local's fixed-execution +
in-process MCP are wired directly.

**Behaviour-neutral / opt-in:** with no plugin observing, every path is
a no-op.

Gates: `format:check`, `lint`, full-monorepo `typecheck`, and observer
unit tests all green. Live app verification still to come.

<!-- stack:links:start -->

1. **#12** 👈 current
2. #13
3. #14
<!-- stack:links:end -->
aryasaatvik added a commit that referenced this pull request Sep 18, 2026
Adds **`@executor-js/plugin-execution-history`** — an opt-in
execution-history sink built on the observer foundation.

- Records every run (plus its tool calls and interactions) into three
owner-scoped `pluginStorage` collections via a buffered-batch writer —
**no new tables, no migrations**; works on D1/libSQL/sqlite/postgres.
- `./api`: a scoped read API (`list`/`get`/`listToolCalls`) over HttpApi
(`executionHistoryHttpPlugin`).
- `./client`: a Runs page at `/plugins/executionHistory/` (table, status
filter, pagination, 4-tab detail drawer) — mounts via the existing
plugins catch-all with zero router changes.

The base `.` entry never loads the API or React layers. Fully opt-in
(not registered in any default config).

Stacked on the execution-observer foundation. Gates: `format:check`,
`lint`, full-monorepo `typecheck`, unit + handler tests green. Runs-page
live render still to verify.

<!-- stack:links:start -->

1. #12
2. **#13** 👈 current
3. #14
<!-- stack:links:end -->
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