Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

refactor(eve): group harness instrumentation modules (#2015)

Chad Hietala23c7354b903f
diff --git a/.changeset/tidy-harness-instrumentation.md b/.changeset/tidy-harness-instrumentation.md
new file mode 100644
index 000000000..589729395
--- /dev/null
+++ b/.changeset/tidy-harness-instrumentation.md
@@ -0,0 +1,5 @@
+---
+"eve": patch
+---
+
+Organize the internal harness instrumentation modules under a dedicated directory without changing runtime behavior.
diff --git a/packages/eve/src/context/keys.ts b/packages/eve/src/context/keys.ts
index 52ecbd1c2..4a20e8110 100644
--- a/packages/eve/src/context/keys.ts
+++ b/packages/eve/src/context/keys.ts
@@ -18,7 +18,7 @@ import type {
SessionTurn,
} from "#channel/types.js";
import { ContextKey } from "#context/key.js";
-import type { InstrumentationChannelDeliveryRef } from "#harness/instrumentation-lifecycle.js";
+import type { InstrumentationChannelDeliveryRef } from "#harness/instrumentation/lifecycle.js";
import type { HarnessToolDefinition } from "#harness/execute-tool.js";
import type { DynamicSubagentAgentConfig } from "#runtime/subagents/dynamic-agent-config.js";
import type { DynamicRemoteAgentConfig } from "#runtime/subagents/dynamic-remote-agent-config.js";
diff --git a/packages/eve/src/execution/node-step.ts b/packages/eve/src/execution/node-step.ts
index 25b8ec841..1d98b5f6a 100644
--- a/packages/eve/src/execution/node-step.ts
+++ b/packages/eve/src/execution/node-step.ts
@@ -8,7 +8,7 @@ import { LOAD_SKILL_TOOL_NAME } from "#runtime/skills/fragment-context.js";
import { createToolLoopHarness } from "#harness/tool-loop.js";
import type { HandleEventFn, HarnessToolMap, StepFn } from "#harness/types.js";
import { resolveInstalledPackageInfo } from "#internal/application/package.js";
-import { getInstrumentationRuntime } from "#harness/instrumentation-runtime.js";
+import { getInstrumentationRuntime } from "#harness/instrumentation/runtime.js";
import { createLogger } from "#internal/logging.js";
import type { RuntimeIdentity } from "#protocol/message.js";
import { UNSPECIFIED_INPUT_SCHEMA } from "#shared/tool-schema.js";
diff --git a/packages/eve/src/execution/settle-cancelled-turn-step.ts b/packages/eve/src/execution/settle-cancelled-turn-step.ts
index 1c75ab6d5..ba3817084 100644
--- a/packages/eve/src/execution/settle-cancelled-turn-step.ts
+++ b/packages/eve/src/execution/settle-cancelled-turn-step.ts
@@ -27,8 +27,8 @@ import {
} from "#harness/proxy-input-requests.js";
import { abandonRunningAgentTurns } from "#harness/handles/transitions.js";
import { clearPendingRuntimeActionBatch } from "#harness/runtime-actions.js";
-import { createInstrumentationHandleEvent } from "#harness/instrumentation-native-events.js";
-import { getInstrumentationRuntime } from "#harness/instrumentation-runtime.js";
+import { createInstrumentationHandleEvent } from "#harness/instrumentation/native-events.js";
+import { getInstrumentationRuntime } from "#harness/instrumentation/runtime.js";
import { clearPendingWorkflowInterrupt } from "#harness/workflow-interrupt-state.js";
import {
encodeMessageStreamEvent,
diff --git a/packages/eve/src/execution/workflow-steps.ts b/packages/eve/src/execution/workflow-steps.ts
index 377c35cef..0d2d28685 100644
--- a/packages/eve/src/execution/workflow-steps.ts
+++ b/packages/eve/src/execution/workflow-steps.ts
@@ -34,8 +34,8 @@ import {
channelDeliveryErrorCode,
instrumentChannelDelivery,
} from "#harness/channel-delivery-instrumentation.js";
-import { getInstrumentationRuntime } from "#harness/instrumentation-runtime.js";
-import { preserveSerializedInstrumentationState } from "#harness/instrumentation-state.js";
+import { getInstrumentationRuntime } from "#harness/instrumentation/runtime.js";
+import { preserveSerializedInstrumentationState } from "#harness/instrumentation/state.js";
import { RuntimeActionSettlementTimesKey } from "#harness/runtime-action-settlement-state.js";
import { preserveSerializedAgentTraceState } from "#tracing/agent-trace-context-store.js";
import { matchAuthorizationCallbacks } from "#execution/authorization-callback-match.js";
diff --git a/packages/eve/src/harness/ai-sdk-hook-bridge.test.ts b/packages/eve/src/harness/ai-sdk-hook-bridge.test.ts
index 675effd99..001dfcb5f 100644
--- a/packages/eve/src/harness/ai-sdk-hook-bridge.test.ts
+++ b/packages/eve/src/harness/ai-sdk-hook-bridge.test.ts
@@ -13,7 +13,7 @@ import {
type InstrumentationStepAttemptStartedEvent,
type InstrumentationToolCallStartedEvent,
type InstrumentationToolCallTerminalEvent,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
const scope: InstrumentationAttemptScope = {
attemptId: "turn-1:step-0:attempt-0",
diff --git a/packages/eve/src/harness/ai-sdk-hook-bridge.ts b/packages/eve/src/harness/ai-sdk-hook-bridge.ts
index b258de24c..7851fb5b6 100644
--- a/packages/eve/src/harness/ai-sdk-hook-bridge.ts
+++ b/packages/eve/src/harness/ai-sdk-hook-bridge.ts
@@ -13,13 +13,13 @@ import type {
InstrumentationToolCallStartedEvent,
InstrumentationToolOutput,
InstrumentationUsage,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import {
attemptIdempotencyKey,
modelCallIdempotencyKey,
toolCallIdempotencyKey,
-} from "#harness/instrumentation-lifecycle.js";
-import { structuralProviderMetadata } from "#harness/instrumentation-content.js";
+} from "#harness/instrumentation/lifecycle.js";
+import { structuralProviderMetadata } from "#harness/instrumentation/content.js";
type TelemetryEvent<TKey extends keyof Telemetry> = Parameters<NonNullable<Telemetry[TKey]>>[0];
diff --git a/packages/eve/src/harness/channel-delivery-instrumentation.test.ts b/packages/eve/src/harness/channel-delivery-instrumentation.test.ts
index e9ab1ee41..576b87d4f 100644
--- a/packages/eve/src/harness/channel-delivery-instrumentation.test.ts
+++ b/packages/eve/src/harness/channel-delivery-instrumentation.test.ts
@@ -6,7 +6,7 @@ import { instrumentChannelDelivery } from "#harness/channel-delivery-instrumenta
import {
createInstrumentationHooks,
type InstrumentationEvent,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
describe("channel delivery instrumentation", () => {
it("projects only known content and redacts it from metadata providers", async () => {
diff --git a/packages/eve/src/harness/channel-delivery-instrumentation.ts b/packages/eve/src/harness/channel-delivery-instrumentation.ts
index 2f68322e3..3ede9df1e 100644
--- a/packages/eve/src/harness/channel-delivery-instrumentation.ts
+++ b/packages/eve/src/harness/channel-delivery-instrumentation.ts
@@ -9,8 +9,8 @@ import type {
InstrumentationChannelDeliveryOutcome,
InstrumentationChannelDeliveryTerminalEvent,
InstrumentationHooks,
-} from "#harness/instrumentation-lifecycle.js";
-import { channelDeliveryIdempotencyKey } from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
+import { channelDeliveryIdempotencyKey } from "#harness/instrumentation/lifecycle.js";
interface ChannelDeliveryStartInstrumentation {
readonly agentName?: string;
diff --git a/packages/eve/src/harness/instrumentation-config.test.ts b/packages/eve/src/harness/instrumentation/config.test.ts
similarity index 91%
rename from packages/eve/src/harness/instrumentation-config.test.ts
rename to packages/eve/src/harness/instrumentation/config.test.ts
index fc027202c..8811f4e24 100644
--- a/packages/eve/src/harness/instrumentation-config.test.ts
+++ b/packages/eve/src/harness/instrumentation/config.test.ts
@@ -31,12 +31,12 @@ beforeEach(() => {
describe("instrumentation-config chunk-isolation regression", () => {
it("a config registered in one module evaluation is visible from another", async () => {
vi.resetModules();
- const moduleA = await import("#harness/instrumentation-config.js");
+ const moduleA = await import("#harness/instrumentation/config.js");
const config = { functionId: "test.instrumentation.cross-module.alice" };
await moduleA.registerInstrumentationConfig(config, { agentName: "test-agent" });
vi.resetModules();
- const moduleB = await import("#harness/instrumentation-config.js");
+ const moduleB = await import("#harness/instrumentation/config.js");
// Pre-fix: moduleB's `registeredConfig` is a fresh `undefined` binding.
// Post-fix: both evaluations share one globalThis-mounted slot.
@@ -45,7 +45,7 @@ describe("instrumentation-config chunk-isolation regression", () => {
it("the config is mounted on globalThis under the canonical symbol", async () => {
const globalKey = Symbol.for("eve.harness-instrumentation-config");
- const { registerInstrumentationConfig } = await import("#harness/instrumentation-config.js");
+ const { registerInstrumentationConfig } = await import("#harness/instrumentation/config.js");
const canary = { functionId: "test.instrumentation.global-mount.canary" };
await registerInstrumentationConfig(canary, { agentName: "test-agent" });
@@ -57,21 +57,21 @@ describe("instrumentation-config chunk-isolation regression", () => {
const globalKey = Symbol.for("eve.harness-instrumentation-config");
vi.resetModules();
- const moduleA = await import("#harness/instrumentation-config.js");
+ const moduleA = await import("#harness/instrumentation/config.js");
const config = { functionId: "test.instrumentation.reimport.canary" };
await moduleA.registerInstrumentationConfig(config, { agentName: "test-agent" });
const firstRef = (globalThis as Record<symbol, unknown>)[globalKey];
vi.resetModules();
- await import("#harness/instrumentation-config.js");
+ await import("#harness/instrumentation/config.js");
const secondRef = (globalThis as Record<symbol, unknown>)[globalKey];
expect(secondRef).toBe(firstRef);
});
it("installs harness telemetry settings on the instrumentation runtime", async () => {
- const { registerInstrumentationConfig } = await import("#harness/instrumentation-config.js");
- const { getInstrumentationRuntime } = await import("#harness/instrumentation-runtime.js");
+ const { registerInstrumentationConfig } = await import("#harness/instrumentation/config.js");
+ const { getInstrumentationRuntime } = await import("#harness/instrumentation/runtime.js");
await registerInstrumentationConfig(
{
@@ -93,7 +93,7 @@ describe("instrumentation-config chunk-isolation regression", () => {
it("awaits the setup callback with the resolved context", async () => {
vi.resetModules();
- const { registerInstrumentationConfig } = await import("#harness/instrumentation-config.js");
+ const { registerInstrumentationConfig } = await import("#harness/instrumentation/config.js");
const contexts: InstrumentationSetupContext[] = [];
await registerInstrumentationConfig(
diff --git a/packages/eve/src/harness/instrumentation-config.ts b/packages/eve/src/harness/instrumentation/config.ts
similarity index 97%
rename from packages/eve/src/harness/instrumentation-config.ts
rename to packages/eve/src/harness/instrumentation/config.ts
index 541ad1f15..4aaba953f 100644
--- a/packages/eve/src/harness/instrumentation-config.ts
+++ b/packages/eve/src/harness/instrumentation/config.ts
@@ -1,6 +1,6 @@
-import { createInstrumentationHooks } from "#harness/instrumentation-lifecycle.js";
-import { registerInstrumentationRuntime } from "#harness/instrumentation-runtime.js";
-import { createInstrumentationSetupContext } from "#harness/instrumentation-setup-context.js";
+import { createInstrumentationHooks } from "#harness/instrumentation/lifecycle.js";
+import { registerInstrumentationRuntime } from "#harness/instrumentation/runtime.js";
+import { createInstrumentationSetupContext } from "#harness/instrumentation/setup-context.js";
import type { InstrumentationDefinition } from "#public/instrumentation/index.js";
/**
diff --git a/packages/eve/src/harness/instrumentation-content.ts b/packages/eve/src/harness/instrumentation/content.ts
similarity index 99%
rename from packages/eve/src/harness/instrumentation-content.ts
rename to packages/eve/src/harness/instrumentation/content.ts
index 516c23c90..89c713836 100644
--- a/packages/eve/src/harness/instrumentation-content.ts
+++ b/packages/eve/src/harness/instrumentation/content.ts
@@ -1,4 +1,4 @@
-import type { InstrumentationEvent } from "#harness/instrumentation-lifecycle.js";
+import type { InstrumentationEvent } from "#harness/instrumentation/lifecycle.js";
/** Returns an immutable event projection with conversation content removed. */
export function withoutInstrumentationContent(event: InstrumentationEvent): InstrumentationEvent {
diff --git a/packages/eve/src/harness/instrumentation-dispatch.ts b/packages/eve/src/harness/instrumentation/dispatch.ts
similarity index 98%
rename from packages/eve/src/harness/instrumentation-dispatch.ts
rename to packages/eve/src/harness/instrumentation/dispatch.ts
index 19522a254..3cd405a88 100644
--- a/packages/eve/src/harness/instrumentation-dispatch.ts
+++ b/packages/eve/src/harness/instrumentation/dispatch.ts
@@ -7,8 +7,8 @@ import {
releaseAllInstrumentationTurnState,
takeInstrumentationActionScopes,
type InstrumentationStateOwner,
-} from "#harness/instrumentation-state.js";
-import { withoutInstrumentationContent } from "#harness/instrumentation-content.js";
+} from "#harness/instrumentation/state.js";
+import { withoutInstrumentationContent } from "#harness/instrumentation/content.js";
import { createLogger, formatError } from "#internal/logging.js";
import type {
@@ -24,7 +24,7 @@ import type {
InstrumentationSessionSettledEvent,
InstrumentationTurnFailedEvent,
InstrumentationTurnSettledEvent,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
const log = createLogger("harness.instrumentation-dispatch");
const DEFAULT_HANDLER_TIMEOUT_MS = 5_000;
diff --git a/packages/eve/src/harness/instrumentation-lifecycle.test.ts b/packages/eve/src/harness/instrumentation/lifecycle.test.ts
similarity index 99%
rename from packages/eve/src/harness/instrumentation-lifecycle.test.ts
rename to packages/eve/src/harness/instrumentation/lifecycle.test.ts
index e30593d99..cec7f8608 100644
--- a/packages/eve/src/harness/instrumentation-lifecycle.test.ts
+++ b/packages/eve/src/harness/instrumentation/lifecycle.test.ts
@@ -15,12 +15,12 @@ import {
type InstrumentationModelCallStartedEvent,
type InstrumentationProviderDefinition,
type InstrumentationToolCallCompletedEvent,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import {
findInstrumentationActionScopeForCall,
instrumentationStateSlot,
rememberInstrumentationActionScope,
-} from "#harness/instrumentation-state.js";
+} from "#harness/instrumentation/state.js";
const { logWarn } = vi.hoisted(() => ({ logWarn: vi.fn() }));
vi.mock("#internal/logging.js", () => ({
diff --git a/packages/eve/src/harness/instrumentation-lifecycle.ts b/packages/eve/src/harness/instrumentation/lifecycle.ts
similarity index 99%
rename from packages/eve/src/harness/instrumentation-lifecycle.ts
rename to packages/eve/src/harness/instrumentation/lifecycle.ts
index 6c9b892ef..36a3d098c 100644
--- a/packages/eve/src/harness/instrumentation-lifecycle.ts
+++ b/packages/eve/src/harness/instrumentation/lifecycle.ts
@@ -1,5 +1,5 @@
-import { createInstrumentationDispatcher } from "#harness/instrumentation-dispatch.js";
-import type { InstrumentationStateSlot } from "#harness/instrumentation-state.js";
+import { createInstrumentationDispatcher } from "#harness/instrumentation/dispatch.js";
+import type { InstrumentationStateSlot } from "#harness/instrumentation/state.js";
/**
* Stable eve identity for one actual model attempt.
diff --git a/packages/eve/src/harness/instrumentation-native-events.test.ts b/packages/eve/src/harness/instrumentation/native-events.test.ts
similarity index 99%
rename from packages/eve/src/harness/instrumentation-native-events.test.ts
rename to packages/eve/src/harness/instrumentation/native-events.test.ts
index bbe9b3a79..86dbdff12 100644
--- a/packages/eve/src/harness/instrumentation-native-events.test.ts
+++ b/packages/eve/src/harness/instrumentation/native-events.test.ts
@@ -19,17 +19,17 @@ import {
import {
createInstrumentationHandleEvent,
publishInputResolutions,
-} from "#harness/instrumentation-native-events.js";
+} from "#harness/instrumentation/native-events.js";
import type {
InstrumentationEvent,
InstrumentationHooks,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import {
actionIdempotencyKey,
inputIdempotencyKey,
sessionIdempotencyKey,
turnIdempotencyKey,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import { RuntimeActionSettlementTimesKey } from "#harness/runtime-action-settlement-state.js";
describe("createInstrumentationHandleEvent", () => {
diff --git a/packages/eve/src/harness/instrumentation-native-events.ts b/packages/eve/src/harness/instrumentation/native-events.ts
similarity index 98%
rename from packages/eve/src/harness/instrumentation-native-events.ts
rename to packages/eve/src/harness/instrumentation/native-events.ts
index de1e321ea..5dfc62bad 100644
--- a/packages/eve/src/harness/instrumentation-native-events.ts
+++ b/packages/eve/src/harness/instrumentation/native-events.ts
@@ -12,19 +12,19 @@ import type {
InstrumentationPointEvent,
InstrumentationTraceContext,
InstrumentationUsage,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import {
actionIdempotencyKey,
inputIdempotencyKey,
sessionIdempotencyKey,
turnIdempotencyKey,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import {
rememberInstrumentationActionScope,
rememberInstrumentationInputScope,
takeInstrumentationActionScopeForCall,
takeInstrumentationInputScope,
-} from "#harness/instrumentation-state.js";
+} from "#harness/instrumentation/state.js";
import type { ResolvedInputBatch } from "#harness/input-requests.js";
import { RuntimeActionSettlementTimesKey } from "#harness/runtime-action-settlement-state.js";
import type { HandleEventFn } from "#harness/types.js";
diff --git a/packages/eve/src/harness/instrumentation-providers-local.scenario.test.ts b/packages/eve/src/harness/instrumentation/providers-local.scenario.test.ts
similarity index 96%
rename from packages/eve/src/harness/instrumentation-providers-local.scenario.test.ts
rename to packages/eve/src/harness/instrumentation/providers-local.scenario.test.ts
index ca81922e4..f8cdb6ee6 100644
--- a/packages/eve/src/harness/instrumentation-providers-local.scenario.test.ts
+++ b/packages/eve/src/harness/instrumentation/providers-local.scenario.test.ts
@@ -9,7 +9,7 @@ import {
getInstrumentationProviders,
registerInstrumentationProvider,
seedInstrumentationProviders,
-} from "#harness/instrumentation-providers.js";
+} from "#harness/instrumentation/providers.js";
import { DEVELOPMENT_WORKER_APP_ROOT_ENV } from "#internal/workflow/development-world-protocol.js";
import { otelIntegration } from "#public/instrumentation/otel.js";
diff --git a/packages/eve/src/harness/instrumentation-providers-production.scenario.test.ts b/packages/eve/src/harness/instrumentation/providers-production.scenario.test.ts
similarity index 95%
rename from packages/eve/src/harness/instrumentation-providers-production.scenario.test.ts
rename to packages/eve/src/harness/instrumentation/providers-production.scenario.test.ts
index 1afb44245..a64c8043e 100644
--- a/packages/eve/src/harness/instrumentation-providers-production.scenario.test.ts
+++ b/packages/eve/src/harness/instrumentation/providers-production.scenario.test.ts
@@ -5,7 +5,7 @@ import {
getInstrumentationProviders,
registerInstrumentationProvider,
seedInstrumentationProviders,
-} from "#harness/instrumentation-providers.js";
+} from "#harness/instrumentation/providers.js";
import { localTraces } from "#public/instrumentation/otel.js";
afterEach(() => {
diff --git a/packages/eve/src/harness/instrumentation-providers.integration.test.ts b/packages/eve/src/harness/instrumentation/providers.integration.test.ts
similarity index 96%
rename from packages/eve/src/harness/instrumentation-providers.integration.test.ts
rename to packages/eve/src/harness/instrumentation/providers.integration.test.ts
index dfb6cd089..fc2741f0d 100644
--- a/packages/eve/src/harness/instrumentation-providers.integration.test.ts
+++ b/packages/eve/src/harness/instrumentation/providers.integration.test.ts
@@ -1,10 +1,10 @@
import { beforeEach, describe, expect, it } from "vitest";
-import { turnIdempotencyKey } from "#harness/instrumentation-lifecycle.js";
+import { turnIdempotencyKey } from "#harness/instrumentation/lifecycle.js";
import {
finalizeInstrumentationProviders,
registerInstrumentationProvider,
-} from "#harness/instrumentation-providers.js";
+} from "#harness/instrumentation/providers.js";
import { defineInstrumentation } from "#public/instrumentation/index.js";
const REGISTRY_GLOBAL_KEY = Symbol.for("eve.harness-instrumentation-providers");
diff --git a/packages/eve/src/harness/instrumentation-providers.test.ts b/packages/eve/src/harness/instrumentation/providers.test.ts
similarity index 98%
rename from packages/eve/src/harness/instrumentation-providers.test.ts
rename to packages/eve/src/harness/instrumentation/providers.test.ts
index 1b2842869..f8695ad2d 100644
--- a/packages/eve/src/harness/instrumentation-providers.test.ts
+++ b/packages/eve/src/harness/instrumentation/providers.test.ts
@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
-import { turnIdempotencyKey } from "#harness/instrumentation-lifecycle.js";
+import { turnIdempotencyKey } from "#harness/instrumentation/lifecycle.js";
import {
EVE_EVALUATION_ENV_FLAG,
EVE_EVALUATION_RUN_ID_ENV,
@@ -11,7 +11,7 @@ import {
registerInstrumentationProvider,
seedInstrumentationProviders,
shutdownInstrumentationProviders,
-} from "#harness/instrumentation-providers.js";
+} from "#harness/instrumentation/providers.js";
import { DEVELOPMENT_WORKER_APP_ROOT_ENV } from "#internal/workflow/development-world-protocol.js";
import { defineInstrumentation } from "#public/instrumentation/index.js";
import { agentRuns, localTraces, otelIntegration } from "#public/instrumentation/otel.js";
diff --git a/packages/eve/src/harness/instrumentation-providers.ts b/packages/eve/src/harness/instrumentation/providers.ts
similarity index 98%
rename from packages/eve/src/harness/instrumentation-providers.ts
rename to packages/eve/src/harness/instrumentation/providers.ts
index 2bb4c946f..7217e4205 100644
--- a/packages/eve/src/harness/instrumentation-providers.ts
+++ b/packages/eve/src/harness/instrumentation/providers.ts
@@ -1,9 +1,9 @@
-import type { InstrumentationProviderDefinition } from "#harness/instrumentation-lifecycle.js";
+import type { InstrumentationProviderDefinition } from "#harness/instrumentation/lifecycle.js";
import {
getInstrumentationRuntime,
type InstrumentationRuntime,
-} from "#harness/instrumentation-runtime.js";
-import { createInstrumentationSetupContext } from "#harness/instrumentation-setup-context.js";
+} from "#harness/instrumentation/runtime.js";
+import { createInstrumentationSetupContext } from "#harness/instrumentation/setup-context.js";
import { resolveInstalledPackageInfo } from "#internal/application/package.js";
import { DEVELOPMENT_WORKER_APP_ROOT_ENV } from "#internal/workflow/development-world-protocol.js";
import { agentRuns, localTraces } from "#public/instrumentation/otel.js";
diff --git a/packages/eve/src/harness/instrumentation-runtime-context.test.ts b/packages/eve/src/harness/instrumentation/runtime-context.test.ts
similarity index 99%
rename from packages/eve/src/harness/instrumentation-runtime-context.test.ts
rename to packages/eve/src/harness/instrumentation/runtime-context.test.ts
index 474e5fd2b..9e392cf4d 100644
--- a/packages/eve/src/harness/instrumentation-runtime-context.test.ts
+++ b/packages/eve/src/harness/instrumentation/runtime-context.test.ts
@@ -7,7 +7,7 @@ import type { HarnessEmissionState } from "#harness/emission.js";
import {
buildTelemetryRuntimeContext,
type BuildTelemetryRuntimeContextInput,
-} from "#harness/instrumentation-runtime-context.js";
+} from "#harness/instrumentation/runtime-context.js";
import type { HarnessSession } from "#harness/types.js";
import type {
InstrumentationStepStartedEventInput,
diff --git a/packages/eve/src/harness/instrumentation-runtime-context.ts b/packages/eve/src/harness/instrumentation/runtime-context.ts
similarity index 100%
rename from packages/eve/src/harness/instrumentation-runtime-context.ts
rename to packages/eve/src/harness/instrumentation/runtime-context.ts
diff --git a/packages/eve/src/harness/instrumentation-runtime.ts b/packages/eve/src/harness/instrumentation/runtime.ts
similarity index 97%
rename from packages/eve/src/harness/instrumentation-runtime.ts
rename to packages/eve/src/harness/instrumentation/runtime.ts
index 584471749..e112b3d3f 100644
--- a/packages/eve/src/harness/instrumentation-runtime.ts
+++ b/packages/eve/src/harness/instrumentation/runtime.ts
@@ -1,7 +1,7 @@
import type {
InstrumentationContextRunner,
InstrumentationHooks,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import type { OtelHarnessSettings } from "#tracing/otel-declaration.js";
const INSTRUMENTATION_RUNTIME_KEY = Symbol.for("eve.instrumentation-runtime");
diff --git a/packages/eve/src/harness/instrumentation-setup-context.ts b/packages/eve/src/harness/instrumentation/setup-context.ts
similarity index 100%
rename from packages/eve/src/harness/instrumentation-setup-context.ts
rename to packages/eve/src/harness/instrumentation/setup-context.ts
diff --git a/packages/eve/src/harness/instrumentation-state.test.ts b/packages/eve/src/harness/instrumentation/state.test.ts
similarity index 98%
rename from packages/eve/src/harness/instrumentation-state.test.ts
rename to packages/eve/src/harness/instrumentation/state.test.ts
index 3b13dc245..32c51c492 100644
--- a/packages/eve/src/harness/instrumentation-state.test.ts
+++ b/packages/eve/src/harness/instrumentation/state.test.ts
@@ -5,7 +5,7 @@ import { deserializeContext, serializeContext } from "#context/serialize.js";
import {
actionIdempotencyKey,
type InstrumentationAttemptScope,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import {
abandonInstrumentationState,
instrumentationStateSlot,
@@ -15,7 +15,7 @@ import {
releaseAllInstrumentationAttemptState,
releaseAllInstrumentationState,
takeInstrumentationActionScopeForCall,
-} from "#harness/instrumentation-state.js";
+} from "#harness/instrumentation/state.js";
describe("instrumentation state", () => {
it("survives a serialized step boundary", async () => {
diff --git a/packages/eve/src/harness/instrumentation-state.ts b/packages/eve/src/harness/instrumentation/state.ts
similarity index 99%
rename from packages/eve/src/harness/instrumentation-state.ts
rename to packages/eve/src/harness/instrumentation/state.ts
index 319b48bfa..043c441d3 100644
--- a/packages/eve/src/harness/instrumentation-state.ts
+++ b/packages/eve/src/harness/instrumentation/state.ts
@@ -2,7 +2,7 @@ import { contextStorage, loadContext } from "#context/container.js";
import { ActiveChannelDeliveriesKey } from "#context/keys.js";
import { ContextKey } from "#context/key.js";
import { type JsonValue, parseJsonValue } from "#shared/json.js";
-import type { InstrumentationAttemptScope } from "#harness/instrumentation-lifecycle.js";
+import type { InstrumentationAttemptScope } from "#harness/instrumentation/lifecycle.js";
/**
* What every provider has staged, flattened into one durable slot.
diff --git a/packages/eve/src/harness/parent-lineage.ts b/packages/eve/src/harness/parent-lineage.ts
index aca395cf1..95724ea76 100644
--- a/packages/eve/src/harness/parent-lineage.ts
+++ b/packages/eve/src/harness/parent-lineage.ts
@@ -1,6 +1,6 @@
import type { SessionParent } from "#channel/types.js";
import { isSubagentAdapterState } from "#execution/subagent-adapter-state.js";
-import type { InstrumentationParentLineage } from "#harness/instrumentation-lifecycle.js";
+import type { InstrumentationParentLineage } from "#harness/instrumentation/lifecycle.js";
/**
* Resolves the dispatch that created the running session, if any. Dispatch
diff --git a/packages/eve/src/harness/tool-loop.test.ts b/packages/eve/src/harness/tool-loop.test.ts
index 0670db76d..371f9a9b2 100644
--- a/packages/eve/src/harness/tool-loop.test.ts
+++ b/packages/eve/src/harness/tool-loop.test.ts
@@ -58,7 +58,7 @@ import type { HarnessEmitFn, HarnessSession, ToolLoopHarnessConfig } from "#harn
import {
createInstrumentationHooks,
type InstrumentationContextRunner,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import {
CONDITIONAL_DELIVERY_INSTRUCTION,
EMPTY_DELIVERY_SENTINEL,
@@ -99,12 +99,12 @@ vi.mock("./ai-sdk-telemetry.js", () => ({
}));
const mockGetInstrumentationConfig = vi.fn().mockReturnValue(undefined);
-vi.mock("./instrumentation-config.js", () => ({
+vi.mock("./instrumentation/config.js", () => ({
getInstrumentationConfig: (...args: unknown[]) => mockGetInstrumentationConfig(...args),
}));
const mockGetInstrumentationRuntime = vi.fn().mockReturnValue(undefined);
-vi.mock("./instrumentation-runtime.js", () => ({
+vi.mock("./instrumentation/runtime.js", () => ({
getInstrumentationRuntime: (...args: unknown[]) => mockGetInstrumentationRuntime(...args),
}));
diff --git a/packages/eve/src/harness/tool-loop.ts b/packages/eve/src/harness/tool-loop.ts
index e2c5c6203..e62d4a186 100644
--- a/packages/eve/src/harness/tool-loop.ts
+++ b/packages/eve/src/harness/tool-loop.ts
@@ -131,14 +131,14 @@ import {
coordinateApprovalDelivery,
shouldPrepareApprovalPolicyTools,
} from "#harness/approval-delivery-coordinator.js";
-import { buildTelemetryRuntimeContext } from "#harness/instrumentation-runtime-context.js";
+import { buildTelemetryRuntimeContext } from "#harness/instrumentation/runtime-context.js";
import { createAiSdkHookBridge } from "#harness/ai-sdk-hook-bridge.js";
import {
createInstrumentationHandleEvent,
publishInputResolutions,
-} from "#harness/instrumentation-native-events.js";
-import type { InstrumentationAttemptScope } from "#harness/instrumentation-lifecycle.js";
-import { attemptIdempotencyKey } from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/native-events.js";
+import type { InstrumentationAttemptScope } from "#harness/instrumentation/lifecycle.js";
+import { attemptIdempotencyKey } from "#harness/instrumentation/lifecycle.js";
import { resolveParentLineage } from "#harness/parent-lineage.js";
import { ChannelKey } from "#runtime/sessions/runtime-context-keys.js";
import {
@@ -156,8 +156,8 @@ import {
convertStaleResponsesToUserMessage,
dropStaleSessionLimitContinuationResponses,
} from "#harness/stale-input-responses.js";
-import { getInstrumentationConfig } from "#harness/instrumentation-config.js";
-import { getInstrumentationRuntime } from "#harness/instrumentation-runtime.js";
+import { getInstrumentationConfig } from "#harness/instrumentation/config.js";
+import { getInstrumentationRuntime } from "#harness/instrumentation/runtime.js";
import type { OtelHarnessSettings } from "#tracing/otel-declaration.js";
import { normalizeUserContent, resolveAssistantStepText } from "#harness/messages.js";
import { normalizeProviderToolHistory } from "#harness/provider-tool-history.js";
diff --git a/packages/eve/src/harness/types.ts b/packages/eve/src/harness/types.ts
index 53c01daa6..e27f0a99f 100644
--- a/packages/eve/src/harness/types.ts
+++ b/packages/eve/src/harness/types.ts
@@ -14,7 +14,7 @@ import type { InternalToolDefinition } from "#shared/tool-definition.js";
import type { WebSearchProvider } from "#shared/web-search.js";
import type { AgentReasoningDefinition } from "#shared/agent-definition.js";
import type { HarnessToolDefinition } from "#harness/execute-tool.js";
-import type { HarnessInstrumentation } from "#harness/instrumentation-runtime.js";
+import type { HarnessInstrumentation } from "#harness/instrumentation/runtime.js";
/**
* Serializable tool definition stored on the session.
diff --git a/packages/eve/src/internal/application/compiled-artifacts.ts b/packages/eve/src/internal/application/compiled-artifacts.ts
index a79a9ea0f..fe60097b7 100644
--- a/packages/eve/src/internal/application/compiled-artifacts.ts
+++ b/packages/eve/src/internal/application/compiled-artifacts.ts
@@ -434,7 +434,7 @@ function createInstrumentationPluginSource(input: {
if (input.layout.kind === "file") {
const registerConfigPath = resolvePackageSourceFilePath(
- "src/harness/instrumentation-config.ts",
+ "src/harness/instrumentation/config.ts",
);
return [
"// Generated by eve. Do not edit by hand.",
@@ -453,7 +453,7 @@ function createInstrumentationPluginSource(input: {
}
const registerProviderPath = resolvePackageSourceFilePath(
- "src/harness/instrumentation-providers.ts",
+ "src/harness/instrumentation/providers.ts",
);
const slots = Object.entries(input.layout.modulePathsBySlot);
diff --git a/packages/eve/src/internal/instrumentation.ts b/packages/eve/src/internal/instrumentation.ts
index db087c543..15a975507 100644
--- a/packages/eve/src/internal/instrumentation.ts
+++ b/packages/eve/src/internal/instrumentation.ts
@@ -1,7 +1,7 @@
/**
* Shared instrumentation primitives used by both the channel projection
* builder (`#channel/instrumentation.ts`) and the harness telemetry
- * builder (`#harness/instrumentation-runtime-context.ts`).
+ * builder (`#harness/instrumentation/runtime-context.ts`).
*
* Both layers resolve a user-authored projector callback into a plain
* record and reason about the same channel-kind vocabulary. Keeping that
diff --git a/packages/eve/src/internal/nitro/routes/channel-dispatch.test.ts b/packages/eve/src/internal/nitro/routes/channel-dispatch.test.ts
index 090c86f4f..b5bf4bc51 100644
--- a/packages/eve/src/internal/nitro/routes/channel-dispatch.test.ts
+++ b/packages/eve/src/internal/nitro/routes/channel-dispatch.test.ts
@@ -24,7 +24,7 @@ import type { RouteHandlerArgs } from "#channel/routes.js";
import {
getInstrumentationConfig,
registerInstrumentationConfig,
-} from "#harness/instrumentation-config.js";
+} from "#harness/instrumentation/config.js";
import type { Runtime } from "#channel/types.js";
import { readVercelProjectLink } from "#internal/vercel/project-link.js";
import { resolveVercelOidcCurrentProject } from "#runtime/governance/auth/vercel-oidc-project.js";
diff --git a/packages/eve/src/internal/nitro/routes/channel-request-instrumentation.ts b/packages/eve/src/internal/nitro/routes/channel-request-instrumentation.ts
index 48752f804..3f9b0431c 100644
--- a/packages/eve/src/internal/nitro/routes/channel-request-instrumentation.ts
+++ b/packages/eve/src/internal/nitro/routes/channel-request-instrumentation.ts
@@ -8,7 +8,7 @@ import {
type TextMapGetter,
trace,
} from "#compiled/@opentelemetry/api/index.js";
-import { getInstrumentationRuntime } from "#harness/instrumentation-runtime.js";
+import { getInstrumentationRuntime } from "#harness/instrumentation/runtime.js";
import { recordErrorOnSpan } from "#internal/logging.js";
/**
diff --git a/packages/eve/src/public/instrumentation/provider.ts b/packages/eve/src/public/instrumentation/provider.ts
index d3ac25b2f..7b154994d 100644
--- a/packages/eve/src/public/instrumentation/provider.ts
+++ b/packages/eve/src/public/instrumentation/provider.ts
@@ -12,7 +12,7 @@
import type {
InstrumentationCapture,
InstrumentationEvent,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import type { JsonValue } from "#public/types/json.js";
export type { JsonValue } from "#public/types/json.js";
@@ -65,7 +65,7 @@ export type {
InstrumentationTurnStartedEvent,
InstrumentationTurnTerminalEvent,
InstrumentationUsage,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
/**
* Marks a value as having come from `defineInstrumentation` or a built-in
diff --git a/packages/eve/src/tracing/agent-action-instrumentation.ts b/packages/eve/src/tracing/agent-action-instrumentation.ts
index 905546258..fb66de6c7 100644
--- a/packages/eve/src/tracing/agent-action-instrumentation.ts
+++ b/packages/eve/src/tracing/agent-action-instrumentation.ts
@@ -13,8 +13,8 @@ import type {
InstrumentationActionTerminalEvent,
InstrumentationAttemptScope,
InstrumentationProviderDefinition,
-} from "#harness/instrumentation-lifecycle.js";
-import { actionIdempotencyKey } from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
+import { actionIdempotencyKey } from "#harness/instrumentation/lifecycle.js";
import { contentAttribute } from "#tracing/agent-otel-content.js";
import { setAgentUsage } from "#tracing/agent-otel-usage.js";
import type { AgentSpanIdGenerator } from "#tracing/agent-span-id-generator.js";
diff --git a/packages/eve/src/tracing/agent-approval-instrumentation.ts b/packages/eve/src/tracing/agent-approval-instrumentation.ts
index 7ab1e2de6..6f095249c 100644
--- a/packages/eve/src/tracing/agent-approval-instrumentation.ts
+++ b/packages/eve/src/tracing/agent-approval-instrumentation.ts
@@ -12,7 +12,7 @@ import type {
InstrumentationInputRequestedEvent,
InstrumentationInputResolvedEvent,
InstrumentationProviderDefinition,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import type { JsonValue } from "#shared/json.js";
import { contentAttribute } from "#tracing/agent-otel-content.js";
import type { AgentActionContext } from "#tracing/agent-action-instrumentation.js";
diff --git a/packages/eve/src/tracing/agent-channel-delivery-instrumentation.ts b/packages/eve/src/tracing/agent-channel-delivery-instrumentation.ts
index 8f90c2368..97f861953 100644
--- a/packages/eve/src/tracing/agent-channel-delivery-instrumentation.ts
+++ b/packages/eve/src/tracing/agent-channel-delivery-instrumentation.ts
@@ -14,8 +14,8 @@ import type {
InstrumentationHandlerContext,
InstrumentationProviderDefinition,
InstrumentationSessionStartedEvent,
-} from "#harness/instrumentation-lifecycle.js";
-import { sessionIdempotencyKey } from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
+import { sessionIdempotencyKey } from "#harness/instrumentation/lifecycle.js";
import type { JsonValue } from "#shared/json.js";
import { contentAttribute } from "#tracing/agent-otel-content.js";
import type { AgentSpanIdGenerator } from "#tracing/agent-span-id-generator.js";
diff --git a/packages/eve/src/tracing/agent-otel-provider.test.ts b/packages/eve/src/tracing/agent-otel-provider.test.ts
index 666649452..002c2a14f 100644
--- a/packages/eve/src/tracing/agent-otel-provider.test.ts
+++ b/packages/eve/src/tracing/agent-otel-provider.test.ts
@@ -32,7 +32,7 @@ import {
type InstrumentationParentLineage,
type InstrumentationTraceContext,
type InstrumentationUsage,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import {
actionIdempotencyKey,
attemptIdempotencyKey,
@@ -40,7 +40,7 @@ import {
modelCallIdempotencyKey,
sessionIdempotencyKey,
turnIdempotencyKey,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
interface TestRuntime {
readonly exporter: InMemorySpanExporter;
diff --git a/packages/eve/src/tracing/agent-otel-provider.ts b/packages/eve/src/tracing/agent-otel-provider.ts
index 59699511a..79335213e 100644
--- a/packages/eve/src/tracing/agent-otel-provider.ts
+++ b/packages/eve/src/tracing/agent-otel-provider.ts
@@ -45,8 +45,8 @@ import type {
InstrumentationSessionTransitionEvent,
InstrumentationTurnStartedEvent,
InstrumentationTurnTerminalEvent,
-} from "#harness/instrumentation-lifecycle.js";
-import { sessionIdempotencyKey } from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
+import { sessionIdempotencyKey } from "#harness/instrumentation/lifecycle.js";
interface SpanState {
readonly context: Context;
diff --git a/packages/eve/src/tracing/agent-otel-usage.ts b/packages/eve/src/tracing/agent-otel-usage.ts
index b6889a9f2..1d1ce31e3 100644
--- a/packages/eve/src/tracing/agent-otel-usage.ts
+++ b/packages/eve/src/tracing/agent-otel-usage.ts
@@ -1,6 +1,6 @@
import type { Span } from "#compiled/@opentelemetry/api/index.js";
-import type { InstrumentationUsage } from "#harness/instrumentation-lifecycle.js";
+import type { InstrumentationUsage } from "#harness/instrumentation/lifecycle.js";
/** Applies eve's structural token usage attributes to an agent span. */
export function setAgentUsage(span: Span, usage: InstrumentationUsage): void {
diff --git a/packages/eve/src/tracing/agent-tool-instrumentation.ts b/packages/eve/src/tracing/agent-tool-instrumentation.ts
index 9c865e220..ed291d7b2 100644
--- a/packages/eve/src/tracing/agent-tool-instrumentation.ts
+++ b/packages/eve/src/tracing/agent-tool-instrumentation.ts
@@ -12,8 +12,8 @@ import type {
InstrumentationActionStartedEvent,
InstrumentationToolCallStartedEvent,
InstrumentationToolCallTerminalEvent,
-} from "#harness/instrumentation-lifecycle.js";
-import { actionIdempotencyKey } from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
+import { actionIdempotencyKey } from "#harness/instrumentation/lifecycle.js";
import { contentAttribute } from "#tracing/agent-otel-content.js";
import type { AgentSpanIdGenerator } from "#tracing/agent-span-id-generator.js";
import type { AgentActionContext } from "#tracing/agent-action-instrumentation.js";
diff --git a/packages/eve/src/tracing/agent-trace-context-store.ts b/packages/eve/src/tracing/agent-trace-context-store.ts
index 15c9c7d8b..104101347 100644
--- a/packages/eve/src/tracing/agent-trace-context-store.ts
+++ b/packages/eve/src/tracing/agent-trace-context-store.ts
@@ -2,7 +2,7 @@ import type { SpanContext } from "#compiled/@opentelemetry/api/index.js";
import { contextStorage, loadContext } from "#context/container.js";
import { ContextKey } from "#context/key.js";
-import type { InstrumentationParentLineage } from "#harness/instrumentation-lifecycle.js";
+import type { InstrumentationParentLineage } from "#harness/instrumentation/lifecycle.js";
import type {
AgentActionTraceState,
AgentSessionTraceState,
diff --git a/packages/eve/src/tracing/agent-trace-state.ts b/packages/eve/src/tracing/agent-trace-state.ts
index 641845db2..21c79182d 100644
--- a/packages/eve/src/tracing/agent-trace-state.ts
+++ b/packages/eve/src/tracing/agent-trace-state.ts
@@ -6,7 +6,7 @@ import type {
InstrumentationTraceContext,
InstrumentationTurnFailedEvent,
InstrumentationTurnSettledEvent,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
/** Sized so an ordinary session stays one trace and only an outsized one rolls. */
export const SESSION_WINDOW_TURN_LIMIT = 200;
diff --git a/packages/eve/src/tracing/install-instrumentation-runtime.test.ts b/packages/eve/src/tracing/install-instrumentation-runtime.test.ts
index ea6824f8d..fc4b03384 100644
--- a/packages/eve/src/tracing/install-instrumentation-runtime.test.ts
+++ b/packages/eve/src/tracing/install-instrumentation-runtime.test.ts
@@ -1,7 +1,7 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { ContextContainer, contextStorage } from "#context/container.js";
-import { turnIdempotencyKey } from "#harness/instrumentation-lifecycle.js";
+import { turnIdempotencyKey } from "#harness/instrumentation/lifecycle.js";
import { installInstrumentationRuntime } from "#tracing/install-instrumentation-runtime.js";
import { otelIntegration, collectOtelPipeline } from "#tracing/otel-declaration.js";
diff --git a/packages/eve/src/tracing/install-instrumentation-runtime.ts b/packages/eve/src/tracing/install-instrumentation-runtime.ts
index a9acad5d3..f31350f11 100644
--- a/packages/eve/src/tracing/install-instrumentation-runtime.ts
+++ b/packages/eve/src/tracing/install-instrumentation-runtime.ts
@@ -4,11 +4,11 @@ import type { SpanProcessor } from "#compiled/@vercel/otel/index.js";
import {
createInstrumentationHooks,
type InstrumentationProviderDefinition,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import {
registerInstrumentationRuntime,
type InstrumentationRuntime,
-} from "#harness/instrumentation-runtime.js";
+} from "#harness/instrumentation/runtime.js";
import { createLogger, formatError } from "#internal/logging.js";
import { ContextAgentTraceStateStore } from "#tracing/agent-trace-context-store.js";
import { createAgentOtelInstrumentation } from "#tracing/agent-otel-provider.js";
diff --git a/packages/eve/src/tracing/local-instrumentation-runtime.scenario.test.ts b/packages/eve/src/tracing/local-instrumentation-runtime.scenario.test.ts
index 422920cd0..fdca682b0 100644
--- a/packages/eve/src/tracing/local-instrumentation-runtime.scenario.test.ts
+++ b/packages/eve/src/tracing/local-instrumentation-runtime.scenario.test.ts
@@ -15,13 +15,13 @@ import {
import { ContextContainer, contextStorage } from "#context/container.js";
import { createAiSdkHookBridge } from "#harness/ai-sdk-hook-bridge.js";
import { listLocalTraces } from "#tracing/local-trace-reader.js";
-import type { InstrumentationAttemptScope } from "#harness/instrumentation-lifecycle.js";
+import type { InstrumentationAttemptScope } from "#harness/instrumentation/lifecycle.js";
import {
actionIdempotencyKey,
attemptIdempotencyKey,
sessionIdempotencyKey,
turnIdempotencyKey,
-} from "#harness/instrumentation-lifecycle.js";
+} from "#harness/instrumentation/lifecycle.js";
import { installLocalInstrumentationRuntime } from "#tracing/local-instrumentation-runtime.js";
import { LocalTraceSpanProcessor } from "#tracing/local-trace-span-processor.js";
diff --git a/packages/eve/src/tracing/local-instrumentation-runtime.ts b/packages/eve/src/tracing/local-instrumentation-runtime.ts
index c9d21980c..3695f01dd 100644
--- a/packages/eve/src/tracing/local-instrumentation-runtime.ts
+++ b/packages/eve/src/tracing/local-instrumentation-runtime.ts
@@ -1,7 +1,7 @@
import {
getInstrumentationRuntime,
type InstrumentationRuntime,
-} from "#harness/instrumentation-runtime.js";
+} from "#harness/instrumentation/runtime.js";
import { installInstrumentationRuntime } from "#tracing/install-instrumentation-runtime.js";
import { createLocalTracesProcessor, resolveLocalTracesContent } from "#tracing/local-traces.js";
import { collectOtelPipeline, otel, otelIntegration } from "#tracing/otel-declaration.js";
diff --git a/packages/eve/test/scenarios/compiled-artifacts-bootstrap.scenario.test.ts b/packages/eve/test/scenarios/compiled-artifacts-bootstrap.scenario.test.ts
index 065930565..5db98f368 100644
--- a/packages/eve/test/scenarios/compiled-artifacts-bootstrap.scenario.test.ts
+++ b/packages/eve/test/scenarios/compiled-artifacts-bootstrap.scenario.test.ts
@@ -198,7 +198,7 @@ describe("writeCompiledArtifactsFiles", () => {
// resolves it by package alias, so this also proves the globalThis rooting
// survives two module instances.
const { getInstrumentationProviders } =
- await import("../../src/harness/instrumentation-providers.js");
+ await import("../../src/harness/instrumentation/providers.js");
expect((globalThis as Record<string, unknown>).__eveProviderSetups).toEqual([
"local:compiled-artifacts-providers-test-agent",
diff --git a/scripts/guard-invariants.mjs b/scripts/guard-invariants.mjs
index 46d50511a..162fd75c1 100644
--- a/scripts/guard-invariants.mjs
+++ b/scripts/guard-invariants.mjs
@@ -94,7 +94,7 @@
* every public authoring value must belong to a capability.
*
* rule 37 — The instrumentation lifecycle contract stays provider-neutral.
- * `harness/instrumentation-lifecycle.ts` must not import from
+ * `harness/instrumentation/lifecycle.ts` must not import from
* `ai`: its event payloads are eve's published shape, so deriving
* them from the model SDK's callback types would make an SDK
* upgrade a breaking change for every provider. Map at the bridge.
@@ -346,7 +346,7 @@ function checkRule35(posix, lines, violations) {
// ---------- Rule 37: instrumentation lifecycle provider boundary ----------
-const INSTRUMENTATION_LIFECYCLE_CONTRACT = "packages/eve/src/harness/instrumentation-lifecycle.ts";
+const INSTRUMENTATION_LIFECYCLE_CONTRACT = "packages/eve/src/harness/instrumentation/lifecycle.ts";
/**
* @param {string} posix