@effect-agent/testing 0.1.0-beta.48 → 0.1.0-beta.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Certification.mjs +1 -0
- package/dist/Certification.mjs.map +1 -1
- package/dist/Chaos.d.mts +1 -1
- package/dist/ScriptedModel-DAvxIiud.d.mts +220 -0
- package/dist/ScriptedModel.d.mts +1 -1
- package/dist/ScriptedModel.mjs +5 -27
- package/dist/ScriptedModel.mjs.map +1 -1
- package/dist/TravelPlanner.d.mts +8 -130
- package/dist/TravelPlanner.mjs +6 -162
- package/dist/TravelPlanner.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/package.json +1 -1
- package/src/Certification.ts +1 -0
- package/src/ScriptedModel.ts +4 -25
- package/src/TravelPlanner.ts +0 -12
- package/src/fixtures/travel-planner/phase3.ts +0 -18
- package/src/fixtures/travel-planner/phase4.ts +0 -23
- package/src/fixtures/travel-planner/phase5.ts +0 -30
- package/src/fixtures/travel-planner/phase6.ts +1 -44
- package/src/fixtures/travel-planner/phase7.ts +4 -102
- package/src/fixtures/travel-planner/subagents-durable.ts +1 -34
- package/dist/ScriptedModel-Dx8aW73W.d.mts +0 -679
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as ScriptedModel_d_exports } from "./ScriptedModel-
|
|
1
|
+
import { i as ScriptedModel_d_exports } from "./ScriptedModel-DAvxIiud.mjs";
|
|
2
2
|
export { ScriptedModel_d_exports as ScriptedModel };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@effect-agent/testing","version":"0.1.0-beta.
|
|
1
|
+
{"name":"@effect-agent/testing","version":"0.1.0-beta.50","dependencies":{"@effect-agent/capabilities":"0.1.0-beta.50","@effect-agent/core":"0.1.0-beta.50","@effect-agent/engine":"0.1.0-beta.50","@effect-agent/sandbox":"0.1.0-beta.50","@effect-agent/thread":"0.1.0-beta.50"},"devDependencies":{"@effect-agent/platform-node":"0.1.0-beta.50","@effect-agent/storage-memory":"0.1.0-beta.50","@effect-agent/storage-sqlite":"0.1.0-beta.50","@effect/platform-node":"4.0.0-rc.112","@effect/sql-sqlite-node":"4.0.0-rc.112","@effect/vitest":"4.0.0-rc.112","effect":"4.0.0-rc.112","typescript":"7.0.2","vite-plus":"0.3.0"},"peerDependencies":{"effect":"^4.0.0-rc.112"},"exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./Certification":{"types":"./dist/Certification.d.mts","default":"./dist/Certification.mjs"},"./Chaos":{"types":"./dist/Chaos.d.mts","default":"./dist/Chaos.mjs"},"./CodeExecutorConformance":{"types":"./dist/CodeExecutorConformance.d.mts","default":"./dist/CodeExecutorConformance.mjs"},"./CodeExecutorSubstitute":{"types":"./dist/CodeExecutorSubstitute.d.mts","default":"./dist/CodeExecutorSubstitute.mjs"},"./DocsResearcher":{"types":"./dist/DocsResearcher.d.mts","default":"./dist/DocsResearcher.mjs"},"./ScriptedModel":{"types":"./dist/ScriptedModel.d.mts","default":"./dist/ScriptedModel.mjs"},"./TravelPlanner":{"types":"./dist/TravelPlanner.d.mts","default":"./dist/TravelPlanner.mjs"}},"description":"Scripted models, deterministic fixtures, and adapter conformance kits for testing Effect Agent applications.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/danieljvdm/effect-agent.git","directory":"packages/testing"},"files":["dist","src"],"type":"module","sideEffects":[],"publishConfig":{"access":"public"},"scripts":{"build":"vp pack","check":"tsc --noEmit -p tsconfig.json","test":"vp test --passWithNoTests"}}
|
package/src/Certification.ts
CHANGED
|
@@ -175,6 +175,7 @@ export const TIER2_UNREACHED_LOCATIONS: ReadonlyArray<DurableRuntimeFailpointLoc
|
|
|
175
175
|
// none of the six scenario shapes carries; pinned in-process by the
|
|
176
176
|
// RUN-026 rows in `packages/testing/test/durable-runtime.test.ts`
|
|
177
177
|
// (compaction failpoint idempotence across re-drive).
|
|
178
|
+
"compaction:before-canonical-append",
|
|
178
179
|
"compaction:after-canonical-append",
|
|
179
180
|
// These shapes use neither programmatic Tools nor grace finalization. Their reservations
|
|
180
181
|
// are exercised before/after append in the public durable-runtime regression suite.
|
package/src/ScriptedModel.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Ref, Schema, Stream } from "effect";
|
|
2
|
-
import { AiError, LanguageModel, Response } from "effect/unstable/ai";
|
|
2
|
+
import { AiError, LanguageModel, Response, Toolkit } from "effect/unstable/ai";
|
|
3
3
|
|
|
4
4
|
const ScriptedPartMetadata = Schema.Record(Schema.String, Schema.NullOr(Schema.Json));
|
|
5
5
|
|
|
@@ -34,18 +34,12 @@ const ScriptedToolResultPart = Schema.Struct({
|
|
|
34
34
|
* performs the toolkit-specific decode when the scripted response is consumed.
|
|
35
35
|
*/
|
|
36
36
|
export const ScriptedGeneratePart = Schema.Union([
|
|
37
|
-
Schema.toEncoded(Response.
|
|
38
|
-
|
|
37
|
+
Schema.toEncoded(Response.Part(Toolkit.empty)),
|
|
38
|
+
// PartEncoded also admits these reasoning markers, which the Part schema omits.
|
|
39
39
|
Schema.toEncoded(Response.ReasoningDeltaPart),
|
|
40
40
|
Schema.toEncoded(Response.ReasoningEndPart),
|
|
41
41
|
ScriptedToolCallPart,
|
|
42
42
|
ScriptedToolResultPart,
|
|
43
|
-
Schema.toEncoded(Response.ToolApprovalRequestPart),
|
|
44
|
-
Schema.toEncoded(Response.FilePart),
|
|
45
|
-
Schema.toEncoded(Response.DocumentSourcePart),
|
|
46
|
-
Schema.toEncoded(Response.UrlSourcePart),
|
|
47
|
-
Schema.toEncoded(Response.ResponseMetadataPart),
|
|
48
|
-
Schema.toEncoded(Response.FinishPart),
|
|
49
43
|
]).annotate({ identifier: "ScriptedGeneratePart" });
|
|
50
44
|
|
|
51
45
|
export type ScriptedGeneratePart = typeof ScriptedGeneratePart.Type;
|
|
@@ -54,24 +48,9 @@ export type ScriptedGeneratePart = typeof ScriptedGeneratePart.Type;
|
|
|
54
48
|
* Schema for encoded Effect AI streaming response parts.
|
|
55
49
|
*/
|
|
56
50
|
export const ScriptedStreamPart = Schema.Union([
|
|
57
|
-
Schema.toEncoded(Response.
|
|
58
|
-
Schema.toEncoded(Response.TextDeltaPart),
|
|
59
|
-
Schema.toEncoded(Response.TextEndPart),
|
|
60
|
-
Schema.toEncoded(Response.ReasoningStartPart),
|
|
61
|
-
Schema.toEncoded(Response.ReasoningDeltaPart),
|
|
62
|
-
Schema.toEncoded(Response.ReasoningEndPart),
|
|
63
|
-
Schema.toEncoded(Response.ToolParamsStartPart),
|
|
64
|
-
Schema.toEncoded(Response.ToolParamsDeltaPart),
|
|
65
|
-
Schema.toEncoded(Response.ToolParamsEndPart),
|
|
51
|
+
Schema.toEncoded(Response.StreamPart(Toolkit.empty)),
|
|
66
52
|
ScriptedToolCallPart,
|
|
67
53
|
ScriptedToolResultPart,
|
|
68
|
-
Schema.toEncoded(Response.ToolApprovalRequestPart),
|
|
69
|
-
Schema.toEncoded(Response.FilePart),
|
|
70
|
-
Schema.toEncoded(Response.DocumentSourcePart),
|
|
71
|
-
Schema.toEncoded(Response.UrlSourcePart),
|
|
72
|
-
Schema.toEncoded(Response.ResponseMetadataPart),
|
|
73
|
-
Schema.toEncoded(Response.FinishPart),
|
|
74
|
-
Schema.toEncoded(Response.ErrorPart),
|
|
75
54
|
]).annotate({ identifier: "ScriptedStreamPart" });
|
|
76
55
|
|
|
77
56
|
export type ScriptedStreamPart = typeof ScriptedStreamPart.Type;
|
package/src/TravelPlanner.ts
CHANGED
|
@@ -61,8 +61,6 @@ export {
|
|
|
61
61
|
} from "./fixtures/travel-planner/phase2.ts";
|
|
62
62
|
|
|
63
63
|
export {
|
|
64
|
-
TravelPlannerPersistenceProfile,
|
|
65
|
-
phase3TravelPlannerProfile,
|
|
66
64
|
phase3TravelPlannerThreadId,
|
|
67
65
|
phase3TravelPlannerProducerId,
|
|
68
66
|
phase3TravelPlannerRunId,
|
|
@@ -77,8 +75,6 @@ export {
|
|
|
77
75
|
} from "./fixtures/travel-planner/phase3.ts";
|
|
78
76
|
|
|
79
77
|
export {
|
|
80
|
-
TravelPlannerDurabilityProfile,
|
|
81
|
-
phase4TravelPlannerProfile,
|
|
82
78
|
phase4TravelPlannerDeploymentId,
|
|
83
79
|
phase4TravelPlannerProducerId,
|
|
84
80
|
phase4TravelPlannerPrincipal,
|
|
@@ -98,8 +94,6 @@ export {
|
|
|
98
94
|
} from "./fixtures/travel-planner/phase4.ts";
|
|
99
95
|
|
|
100
96
|
export {
|
|
101
|
-
TravelPlannerBookingProfile,
|
|
102
|
-
phase5TravelPlannerProfile,
|
|
103
97
|
phase5TravelPlannerDeploymentId,
|
|
104
98
|
phase5TravelPlannerProducerId,
|
|
105
99
|
phase5TravelPlannerPrincipal,
|
|
@@ -128,8 +122,6 @@ export {
|
|
|
128
122
|
} from "./fixtures/travel-planner/phase5.ts";
|
|
129
123
|
|
|
130
124
|
export {
|
|
131
|
-
TravelPlannerCloudflareProfile,
|
|
132
|
-
phase6TravelPlannerProfile,
|
|
133
125
|
phase6TravelPlannerDeploymentId,
|
|
134
126
|
phase6TravelPlannerProducerPrefix,
|
|
135
127
|
phase6TravelPlannerProducerId,
|
|
@@ -164,8 +156,6 @@ export {
|
|
|
164
156
|
} from "./fixtures/travel-planner/phase6.ts";
|
|
165
157
|
|
|
166
158
|
export {
|
|
167
|
-
TravelPlannerPhase7Profile,
|
|
168
|
-
phase7TravelPlannerProfile,
|
|
169
159
|
PHASE7_LIVE_GATE_ENV,
|
|
170
160
|
PHASE7_LIVE_CREDENTIAL_ENV,
|
|
171
161
|
type Phase7LiveGateEnvironment,
|
|
@@ -220,8 +210,6 @@ export {
|
|
|
220
210
|
} from "./fixtures/travel-planner/subagents.ts";
|
|
221
211
|
|
|
222
212
|
export {
|
|
223
|
-
TravelPlannerSubagentDurabilityProfile,
|
|
224
|
-
s2TravelPlannerProfile,
|
|
225
213
|
s2TravelPlannerDeploymentId,
|
|
226
214
|
s2TravelPlannerProducerId,
|
|
227
215
|
s2TravelPlannerPrincipal,
|
|
@@ -16,24 +16,6 @@ import { Effect, Schema } from "effect";
|
|
|
16
16
|
import { TravelPlan, TripRequest } from "./definition.ts";
|
|
17
17
|
import { expectedTravelPlan, phase1Trip } from "./scenarios.ts";
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* The Phase 3 profile persists Thread history but deliberately does not
|
|
21
|
-
* claim durable admission or recovery of accepted work.
|
|
22
|
-
*/
|
|
23
|
-
export class TravelPlannerPersistenceProfile extends Schema.Class<TravelPlannerPersistenceProfile>(
|
|
24
|
-
"@effect-agent/testing/travel-planner/TravelPlannerPersistenceProfile",
|
|
25
|
-
)({
|
|
26
|
-
deploymentClass: Schema.Literal("P"),
|
|
27
|
-
durableAcceptedWork: Schema.Literal(false),
|
|
28
|
-
canonicalSchemaVersion: Schema.Literal(1),
|
|
29
|
-
}) {}
|
|
30
|
-
|
|
31
|
-
export const phase3TravelPlannerProfile = TravelPlannerPersistenceProfile.make({
|
|
32
|
-
deploymentClass: "P",
|
|
33
|
-
durableAcceptedWork: false,
|
|
34
|
-
canonicalSchemaVersion: 1,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
19
|
export const phase3TravelPlannerThreadId = Schema.decodeSync(ThreadId)("travel-planner-p3-thread");
|
|
38
20
|
|
|
39
21
|
export const phase3TravelPlannerProducerId = Schema.decodeSync(ProducerId)(
|
|
@@ -41,29 +41,6 @@ import {
|
|
|
41
41
|
} from "./deterministic-layers.ts";
|
|
42
42
|
import { phase1HappyPathTurns } from "./scenarios.ts";
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
* The Phase 4 profile claims durable accepted work on the Node/SQLite runtime (deployment class
|
|
46
|
-
* DN): once `submit` returns a Receipt, the Submission settles exactly once even across process
|
|
47
|
-
* loss. The claim is limited to safe-to-repeat toolkits (D6): supplier booking is explicitly NOT
|
|
48
|
-
* claimed safely replayable — replay-safe external mutation is P5 (Durable Tools) scope.
|
|
49
|
-
*/
|
|
50
|
-
export class TravelPlannerDurabilityProfile extends Schema.Class<TravelPlannerDurabilityProfile>(
|
|
51
|
-
"@effect-agent/testing/travel-planner/TravelPlannerDurabilityProfile",
|
|
52
|
-
)({
|
|
53
|
-
deploymentClass: Schema.Literal("DN"),
|
|
54
|
-
durableAcceptedWork: Schema.Literal(true),
|
|
55
|
-
canonicalSchemaVersion: Schema.Literal(1),
|
|
56
|
-
/** Supplier booking replay safety is P5 (Durable Tools) scope; DN does not claim it. */
|
|
57
|
-
supplierBookingReplaySafe: Schema.Literal(false),
|
|
58
|
-
}) {}
|
|
59
|
-
|
|
60
|
-
export const phase4TravelPlannerProfile = TravelPlannerDurabilityProfile.make({
|
|
61
|
-
deploymentClass: "DN",
|
|
62
|
-
durableAcceptedWork: true,
|
|
63
|
-
canonicalSchemaVersion: 1,
|
|
64
|
-
supplierBookingReplaySafe: false,
|
|
65
|
-
});
|
|
66
|
-
|
|
67
44
|
export const phase4TravelPlannerDeploymentId = Schema.decodeSync(DeploymentId)(
|
|
68
45
|
"travel-planner-p4-deployment",
|
|
69
46
|
);
|
|
@@ -49,36 +49,6 @@ import {
|
|
|
49
49
|
} from "./deterministic-layers.ts";
|
|
50
50
|
import { DurableSearchActivities, DurableSearchFlights, DurableSearchLodging } from "./phase4.ts";
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
* The Phase 5 profile extends the P4 `DN` claim to consequential supplier mutation: booking
|
|
54
|
-
* Tools enter the prepared/settled uncertainty protocol, unresolved external effects stop at
|
|
55
|
-
* Unknown Outcomes instead of replaying, Durable Steps replay recorded results, and queued
|
|
56
|
-
* traveler input joins the active Run. Exactly-once EXTERNAL execution is still — deliberately —
|
|
57
|
-
* not claimed (DUR-003): the supplier's own idempotency keys are what dedupe repeats.
|
|
58
|
-
*/
|
|
59
|
-
export class TravelPlannerBookingProfile extends Schema.Class<TravelPlannerBookingProfile>(
|
|
60
|
-
"@effect-agent/testing/travel-planner/TravelPlannerBookingProfile",
|
|
61
|
-
)({
|
|
62
|
-
deploymentClass: Schema.Literal("DN"),
|
|
63
|
-
durableAcceptedWork: Schema.Literal(true),
|
|
64
|
-
canonicalSchemaVersion: Schema.Literal(1),
|
|
65
|
-
/** P5: supplier mutations get prepared/settled records, Unknown Outcomes, and reconciliation. */
|
|
66
|
-
supplierBookingUncertaintyProtocol: Schema.Literal(true),
|
|
67
|
-
/** P5: Durable Steps are exactly-once-RECORDED; their side effects stay at-least-once. */
|
|
68
|
-
durableStepsRecorded: Schema.Literal(true),
|
|
69
|
-
/** Never claimed at any phase (DUR-003). */
|
|
70
|
-
exactlyOnceExternalEffects: Schema.Literal(false),
|
|
71
|
-
}) {}
|
|
72
|
-
|
|
73
|
-
export const phase5TravelPlannerProfile = TravelPlannerBookingProfile.make({
|
|
74
|
-
deploymentClass: "DN",
|
|
75
|
-
durableAcceptedWork: true,
|
|
76
|
-
canonicalSchemaVersion: 1,
|
|
77
|
-
supplierBookingUncertaintyProtocol: true,
|
|
78
|
-
durableStepsRecorded: true,
|
|
79
|
-
exactlyOnceExternalEffects: false,
|
|
80
|
-
});
|
|
81
|
-
|
|
82
52
|
export const phase5TravelPlannerDeploymentId = Schema.decodeSync(DeploymentId)(
|
|
83
53
|
"travel-planner-p5-deployment",
|
|
84
54
|
);
|
|
@@ -53,50 +53,7 @@ import {
|
|
|
53
53
|
encodedDestinationReport,
|
|
54
54
|
} from "./subagents.ts";
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
// Phase 6 (P6): the SAME cumulative Travel Planner on the Cloudflare Durable
|
|
58
|
-
// Object runtime, deployment class DC. This module is deliberately
|
|
59
|
-
// platform-neutral (it imports no Cloudflare types): the worker Bindings it
|
|
60
|
-
// builds are plain `ResolvedBinding` values a Thread Object registers,
|
|
61
|
-
// and the cross-platform evidence normal form is shared by the DN and DC
|
|
62
|
-
// halves of the equivalence suite (plan §1.8, D-P6-6).
|
|
63
|
-
// ---------------------------------------------------------------------------
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* The Phase 6 profile: the P4/P5/S2 Travel Planner claims re-earned on the Cloudflare Durable
|
|
67
|
-
* Object runtime (deployment class `DC`), where eviction and alarm redelivery replace process
|
|
68
|
-
* kill and restart as the exercised recovery path. `cloudflareEquivalence` is the claim the S2
|
|
69
|
-
* fixture explicitly deferred to P6 (`TravelPlannerSubagentDurabilityProfile` pins it `false`
|
|
70
|
-
* for `DN`): it flips to `true` here ONLY because the phase-6 suites assert byte-equal
|
|
71
|
-
* cross-platform normalized canonical evidence against one committed golden. Exactly-once
|
|
72
|
-
* EXTERNAL effects remain — deliberately — unclaimed on every platform (DUR-003).
|
|
73
|
-
*/
|
|
74
|
-
export class TravelPlannerCloudflareProfile extends Schema.Class<TravelPlannerCloudflareProfile>(
|
|
75
|
-
"@effect-agent/testing/travel-planner/TravelPlannerCloudflareProfile",
|
|
76
|
-
)({
|
|
77
|
-
deploymentClass: Schema.Literal("DC"),
|
|
78
|
-
durableAcceptedWork: Schema.Literal(true),
|
|
79
|
-
canonicalSchemaVersion: Schema.Literal(1),
|
|
80
|
-
/** P5 semantics under DC recovery: prepared/settled records, Unknown Outcomes, approvals. */
|
|
81
|
-
supplierBookingUncertaintyProtocol: Schema.Literal(true),
|
|
82
|
-
/** S2 semantics under DC recovery: cross-Object establishment/join, completed child never re-runs. */
|
|
83
|
-
durableAttachedSubagents: Schema.Literal(true),
|
|
84
|
-
/** DN and DC produce byte-equal cross-platform normalized canonical evidence (one golden). */
|
|
85
|
-
cloudflareEquivalence: Schema.Literal(true),
|
|
86
|
-
/** Never claimed at any phase on any platform (DUR-003). */
|
|
87
|
-
exactlyOnceExternalEffects: Schema.Literal(false),
|
|
88
|
-
}) {}
|
|
89
|
-
|
|
90
|
-
export const phase6TravelPlannerProfile = TravelPlannerCloudflareProfile.make({
|
|
91
|
-
deploymentClass: "DC",
|
|
92
|
-
durableAcceptedWork: true,
|
|
93
|
-
canonicalSchemaVersion: 1,
|
|
94
|
-
supplierBookingUncertaintyProtocol: true,
|
|
95
|
-
durableAttachedSubagents: true,
|
|
96
|
-
cloudflareEquivalence: true,
|
|
97
|
-
exactlyOnceExternalEffects: false,
|
|
98
|
-
});
|
|
99
|
-
|
|
56
|
+
/** Platform-neutral bindings and canonical evidence shared by Node and Cloudflare tests. */
|
|
100
57
|
export const phase6TravelPlannerDeploymentId = Schema.decodeSync(DeploymentId)(
|
|
101
58
|
"travel-planner-p6-deployment",
|
|
102
59
|
);
|
|
@@ -1,112 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// ---------------------------------------------------------------------------
|
|
4
|
-
// Phase 7 (P7): the Travel Planner as an INTERNAL agent with two explicit
|
|
5
|
-
// profiles (ROADMAP P7 exit gate: "Travel Planner ... retains a deterministic
|
|
6
|
-
// offline conformance profile alongside its live integration profiles").
|
|
7
|
-
//
|
|
8
|
-
// - The OFFLINE profile is the cumulative P1–P6/S1/S2 suite set that already
|
|
9
|
-
// exists: scripted `LanguageModel`, deterministic supplier Layers,
|
|
10
|
-
// controllable time and IDs, no network, no credentials. Nothing in P7
|
|
11
|
-
// weakens it; this module only pins the claim as a Schema value so evidence
|
|
12
|
-
// can cite one committed fact instead of prose.
|
|
13
|
-
// - The LIVE profile is opt-in and test-side: a suite gates itself with
|
|
14
|
-
// `describe.skipIf(...)` on the environment predicate below, so ordinary
|
|
15
|
-
// `bun run test` never makes a network request and never needs a credential.
|
|
16
|
-
// Live profiles bind live MODEL Layers only. No real travel supplier exists
|
|
17
|
-
// to integrate, so the deterministic supplier desk is retained deliberately
|
|
18
|
-
// and `liveSupplierLayers` is pinned `false` — the roadmap's "selected
|
|
19
|
-
// supplier Layers" is honestly scoped to live-model-only (P7 plan decision
|
|
20
|
-
// 9), recorded here rather than silently claimed.
|
|
21
|
-
// ---------------------------------------------------------------------------
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The P7 dual-profile claim, schema-first so the exact scope of "live
|
|
25
|
-
* integration profiles" is a committed, decodable value:
|
|
26
|
-
*
|
|
27
|
-
* - `offlineConformanceDeterministic` / `offlineRequiresCredentials`: the
|
|
28
|
-
* cumulative conformance suites stay deterministic and credential-free.
|
|
29
|
-
* - `liveProfileOptIn`: live suites are excluded from ordinary gates by the
|
|
30
|
-
* environment predicate (`phase7LiveProfileEnabled`), never by test-runner
|
|
31
|
-
* configuration that could silently drift.
|
|
32
|
-
* - `liveModelLayers` / `liveSupplierLayers`: live profiles exercise real
|
|
33
|
-
* model Layers over the SAME deterministic supplier desk — no claim of a
|
|
34
|
-
* live supplier integration is made anywhere (decision 9).
|
|
35
|
-
* - `structurallyRedactedTranscripts`: transcript evidence a live profile
|
|
36
|
-
* emits passes through the structural `Redactor` first (SEC-008,
|
|
37
|
-
* testing.md §12: "live model and supplier profiles are opt-in smoke or
|
|
38
|
-
* release tests, rate-limited and structurally redacted").
|
|
39
|
-
* - `exactlyOnceExternalEffects`: never claimed at any phase (DUR-003).
|
|
40
|
-
*/
|
|
41
|
-
export class TravelPlannerPhase7Profile extends Schema.Class<TravelPlannerPhase7Profile>(
|
|
42
|
-
"@effect-agent/testing/travel-planner/TravelPlannerPhase7Profile",
|
|
43
|
-
)({
|
|
44
|
-
phase: Schema.Literal("P7"),
|
|
45
|
-
offlineConformanceDeterministic: Schema.Literal(true),
|
|
46
|
-
offlineRequiresCredentials: Schema.Literal(false),
|
|
47
|
-
liveProfileOptIn: Schema.Literal(true),
|
|
48
|
-
liveModelLayers: Schema.Literal(true),
|
|
49
|
-
liveSupplierLayers: Schema.Literal(false),
|
|
50
|
-
structurallyRedactedTranscripts: Schema.Literal(true),
|
|
51
|
-
exactlyOnceExternalEffects: Schema.Literal(false),
|
|
52
|
-
}) {}
|
|
53
|
-
|
|
54
|
-
export const phase7TravelPlannerProfile = TravelPlannerPhase7Profile.make({
|
|
55
|
-
phase: "P7",
|
|
56
|
-
offlineConformanceDeterministic: true,
|
|
57
|
-
offlineRequiresCredentials: false,
|
|
58
|
-
liveProfileOptIn: true,
|
|
59
|
-
liveModelLayers: true,
|
|
60
|
-
liveSupplierLayers: false,
|
|
61
|
-
structurallyRedactedTranscripts: true,
|
|
62
|
-
exactlyOnceExternalEffects: false,
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* The one opt-in switch for EVERY live profile in this repository. `"1"` is
|
|
67
|
-
* the only enabling value: an unset, empty, or differently-truthy value keeps
|
|
68
|
-
* the suite skipped, so CI and ordinary developer runs stay offline.
|
|
69
|
-
*/
|
|
1
|
+
/** Explicit opt-in switch for live integration tests. */
|
|
70
2
|
export const PHASE7_LIVE_GATE_ENV = "EFFECT_AGENT_LIVE";
|
|
71
3
|
|
|
72
|
-
/** The credential
|
|
4
|
+
/** The credential required by the Travel Planner live-model tests. */
|
|
73
5
|
export const PHASE7_LIVE_CREDENTIAL_ENV = "OPENAI_API_KEY";
|
|
74
6
|
|
|
75
|
-
/** Structural shape of
|
|
7
|
+
/** Structural shape of an environment without importing Node types. */
|
|
76
8
|
export interface Phase7LiveGateEnvironment {
|
|
77
9
|
readonly [name: string]: string | undefined;
|
|
78
10
|
}
|
|
79
11
|
|
|
80
|
-
/**
|
|
81
|
-
* The test-side live gate (P7 plan §6: no test-side live-gating pattern
|
|
82
|
-
* existed before this — the demo gates at serve time via
|
|
83
|
-
* `Config.redacted("OPENAI_API_KEY")`). Suites use it as
|
|
84
|
-
* `describe.skipIf(!phase7LiveProfileEnabled(process.env))`, which keeps the
|
|
85
|
-
* live block out of ordinary gates while the SAME file's ungated tests keep
|
|
86
|
-
* pinning the profile schema on every run.
|
|
87
|
-
*/
|
|
12
|
+
/** Enable live tests only when both the opt-in flag and credential are present. */
|
|
88
13
|
export const phase7LiveProfileEnabled = (env: Phase7LiveGateEnvironment): boolean =>
|
|
89
14
|
env[PHASE7_LIVE_GATE_ENV] === "1" && (env[PHASE7_LIVE_CREDENTIAL_ENV] ?? "") !== "";
|
|
90
|
-
|
|
91
|
-
// ---------------------------------------------------------------------------
|
|
92
|
-
// Authoring friction note (WP7 input; real observations from wiring the P7
|
|
93
|
-
// live profile onto the existing Travel Planner):
|
|
94
|
-
//
|
|
95
|
-
// 1. There was no framework-owned place to put a test-side live gate: every
|
|
96
|
-
// earlier profile was either always-deterministic or gated at serve time
|
|
97
|
-
// inside an application. The predicate had to be invented here as a plain
|
|
98
|
-
// exported function because `packages/testing/src` must stay
|
|
99
|
-
// platform-neutral and cannot read `process.env` itself — fine, but the
|
|
100
|
-
// split (fixture exports the predicate, the example test applies it to
|
|
101
|
-
// `process.env`) is a convention a future author has to discover by
|
|
102
|
-
// reading this file rather than a typed seam.
|
|
103
|
-
// 2. Capturing a structurally redacted transcript from a live Run takes
|
|
104
|
-
// manual assembly: collect `RunEvent`s, `Schema.encode` each one, pass the
|
|
105
|
-
// encoded value through `Redactor.redact`. Nothing composes those three
|
|
106
|
-
// steps, and nothing type-level stops a test from logging the RAW event by
|
|
107
|
-
// accident. A `redactedTranscript(events)` helper in capabilities (or an
|
|
108
|
-
// engine stream combinator) would make the safe path the short path.
|
|
109
|
-
// 3. Binding a live model to the existing definition was pleasantly trivial
|
|
110
|
-
// (`Agent.withModel` + the upstream client Layer): no friction to report
|
|
111
|
-
// on the authoring surface itself for plain ephemeral runs.
|
|
112
|
-
// ---------------------------------------------------------------------------
|
|
@@ -36,40 +36,7 @@ import {
|
|
|
36
36
|
TravelCoordinator,
|
|
37
37
|
} from "./subagents.ts";
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
// S2 durability profile: the S1 coordinator →
|
|
41
|
-
// destination-researcher delegation re-run as ACCEPTED WORK on the Node/SQLite
|
|
42
|
-
// runtime. The claim is `DN` durable attached Subagents only: establishment
|
|
43
|
-
// and join are replay-safe by construction (SUB-016/SUB-019), a completed
|
|
44
|
-
// child is never re-executed on a lost join acknowledgment, and NO claim of
|
|
45
|
-
// exactly-once child external effects is made (rule 8; an unresolved ordinary
|
|
46
|
-
// child Tool blocks as an Unknown Outcome instead, SUB-021). Cloudflare
|
|
47
|
-
// equivalence is P6 scope and explicitly not claimed here.
|
|
48
|
-
// ---------------------------------------------------------------------------
|
|
49
|
-
|
|
50
|
-
export class TravelPlannerSubagentDurabilityProfile extends Schema.Class<TravelPlannerSubagentDurabilityProfile>(
|
|
51
|
-
"@effect-agent/testing/travel-planner/TravelPlannerSubagentDurabilityProfile",
|
|
52
|
-
)({
|
|
53
|
-
deploymentClass: Schema.Literal("DN"),
|
|
54
|
-
durableAttachedSubagents: Schema.Literal(true),
|
|
55
|
-
canonicalSchemaVersion: Schema.Literal(1),
|
|
56
|
-
/** Establishment/join replay converges on one child Receipt, Thread, and join batch. */
|
|
57
|
-
subagentReplaySafe: Schema.Literal(true),
|
|
58
|
-
/** Never claimed (rule 8): child ordinary Tools stop at Unknown Outcomes, they do not replay. */
|
|
59
|
-
childExternalEffectsExactlyOnce: Schema.Literal(false),
|
|
60
|
-
/** The same conformance suite under DO eviction/alarms is P6 scope (spec §17 `DC`). */
|
|
61
|
-
cloudflareEquivalence: Schema.Literal(false),
|
|
62
|
-
}) {}
|
|
63
|
-
|
|
64
|
-
export const s2TravelPlannerProfile = TravelPlannerSubagentDurabilityProfile.make({
|
|
65
|
-
deploymentClass: "DN",
|
|
66
|
-
durableAttachedSubagents: true,
|
|
67
|
-
canonicalSchemaVersion: 1,
|
|
68
|
-
subagentReplaySafe: true,
|
|
69
|
-
childExternalEffectsExactlyOnce: false,
|
|
70
|
-
cloudflareEquivalence: false,
|
|
71
|
-
});
|
|
72
|
-
|
|
39
|
+
/** Registered coordinator and researcher bindings for durable delegation tests. */
|
|
73
40
|
export const s2TravelPlannerDeploymentId = Schema.decodeSync(DeploymentId)(
|
|
74
41
|
"travel-planner-s2-deployment",
|
|
75
42
|
);
|