@sayoriqwq/effect-harness 0.2.0 → 0.3.0

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/eslint.d.ts CHANGED
@@ -2701,7 +2701,7 @@ declare namespace ESLint {
2701
2701
  //#endregion
2702
2702
  //#region src/eslint.d.ts
2703
2703
  /**
2704
- * Composable Effect guardrails for a target-owned ESLint flat config.
2704
+ * Composable pinned-reference boundaries for a target-owned ESLint flat config.
2705
2705
  *
2706
2706
  * Targets import this value from `@sayoriqwq/effect-harness/eslint`; Prelude
2707
2707
  * intentionally never rewrites executable config files.
package/dist/eslint.js CHANGED
@@ -1,97 +1,20 @@
1
- const effectHarnessEslintPlugin = { rules: { "no-disable-validation": {
2
- meta: {
3
- type: "problem",
4
- docs: { description: "Disallow disabling Effect Schema validation." },
5
- messages: { noDisableValidation: "Do not use { disableValidation: true }. Fix the data or schema instead of disabling validation." },
6
- schema: []
7
- },
8
- create(context) {
9
- return { Property(node) {
10
- if ((node.key.type === "Identifier" && node.key.name === "disableValidation" || node.key.type === "Literal" && node.key.value === "disableValidation") && node.value.type === "Literal" && node.value.value === true) context.report({
11
- node,
12
- messageId: "noDisableValidation"
13
- });
14
- } };
15
- }
16
- } } };
17
- const sharedEffectEslintPolicy = {
18
- rules: { "effect-harness/no-disable-validation": "error" },
19
- restrictedImports: {
20
- paths: [{
21
- name: "node:test",
22
- message: "Use @effect/vitest for Effect test entries."
23
- }, {
24
- name: "@effect/cli",
25
- message: "Use effect/unstable/cli for Effect v4 beta."
26
- }],
27
- patterns: [
28
- {
29
- group: ["@effect/cli/*"],
30
- message: "Use effect/unstable/cli for Effect v4 beta."
31
- },
32
- {
33
- group: ["repos/effect/**", "**/repos/effect/**"],
34
- message: "Import installed packages, never pinned source trees."
35
- },
36
- {
37
- group: ["repos/tsgo/**", "**/repos/tsgo/**"],
38
- message: "Use tsgo through its installed package."
39
- }
40
- ]
41
- },
42
- restrictedSyntax: [{
43
- selector: "MemberExpression[object.name=\"Context\"][property.name=\"Tag\"]",
44
- message: "Use Context.Service for Effect v4 services."
45
- }, {
46
- selector: "MemberExpression[object.name=\"Effect\"][property.name=/^(catchAllCause|serviceOption)$/]",
47
- message: "Use the Effect-native safer pattern."
48
- }]
49
- };
50
- const effectTestEslintPolicy = {
51
- restrictedImportPaths: [{
52
- name: "vitest",
53
- importNames: [
54
- "describe",
55
- "it",
56
- "test"
57
- ],
58
- message: "Use @effect/vitest Effect entries."
59
- }],
60
- restrictedSyntax: [{
61
- selector: "CallExpression[callee.name=\"it\"]",
62
- message: "Use it.effect, it.live, or layer from @effect/vitest."
63
- }]
64
- };
65
1
  //#endregion
66
2
  //#region src/eslint.ts
67
3
  /**
68
- * Composable Effect guardrails for a target-owned ESLint flat config.
4
+ * Composable pinned-reference boundaries for a target-owned ESLint flat config.
69
5
  *
70
6
  * Targets import this value from `@sayoriqwq/effect-harness/eslint`; Prelude
71
7
  * intentionally never rewrites executable config files.
72
8
  */
73
9
  const effectHarnessEslintConfig = [{
74
10
  name: "effect-harness/guardrails",
75
- plugins: { "effect-harness": effectHarnessEslintPlugin },
76
- rules: {
77
- ...sharedEffectEslintPolicy.rules,
78
- "no-restricted-imports": ["error", sharedEffectEslintPolicy.restrictedImports],
79
- "no-restricted-syntax": ["error", ...sharedEffectEslintPolicy.restrictedSyntax]
80
- }
81
- }, {
82
- name: "effect-harness/tests",
83
- files: ["tests/**/*.test.{js,mjs,ts}"],
84
- rules: {
85
- "no-restricted-imports": ["error", {
86
- paths: [...sharedEffectEslintPolicy.restrictedImports.paths, ...effectTestEslintPolicy.restrictedImportPaths],
87
- patterns: sharedEffectEslintPolicy.restrictedImports.patterns
88
- }],
89
- "no-restricted-syntax": [
90
- "error",
91
- ...sharedEffectEslintPolicy.restrictedSyntax,
92
- ...effectTestEslintPolicy.restrictedSyntax
93
- ]
94
- }
11
+ rules: { "no-restricted-imports": ["error", { restrictedImports: { patterns: [{
12
+ group: ["repos/effect/**", "**/repos/effect/**"],
13
+ message: "Import installed packages, never pinned Effect reference trees."
14
+ }, {
15
+ group: ["repos/tsgo/**", "**/repos/tsgo/**"],
16
+ message: "Use tsgo through its installed package, never its pinned reference tree."
17
+ }] } }.restrictedImports] }
95
18
  }];
96
19
  //#endregion
97
20
  export { effectHarnessEslintConfig as default };
package/dist/prelude.d.ts CHANGED
@@ -1,22 +1,13 @@
1
1
  import * as _$_sayoriqwq_prelude_contract0 from "@sayoriqwq/prelude-contract";
2
- import * as _$effect_Schema0 from "effect/Schema";
3
2
 
4
3
  //#region src/prelude.d.ts
5
- declare const harnessModule: _$_sayoriqwq_prelude_contract0.HarnessModule<_$effect_Schema0.Struct.ReadonlySide<{
6
- readonly _tag: _$effect_Schema0.tag<"TargetObservationError">;
7
- readonly operation: _$effect_Schema0.Literals<readonly ["readBytes", "readText", "readDirectory", "readPackageManifest"]>;
8
- readonly locator: _$effect_Schema0.Union<readonly [_$effect_Schema0.Struct<{
9
- readonly root: _$effect_Schema0.Literal<"ControlRoot">;
10
- readonly path: _$effect_Schema0.String;
11
- }>, _$effect_Schema0.Struct<{
12
- readonly root: _$effect_Schema0.Literal<"IntegrationWorkspace">;
13
- readonly path: _$effect_Schema0.String;
14
- }>, _$effect_Schema0.Struct<{
15
- readonly root: _$effect_Schema0.Literal<"PackageRoot">;
16
- readonly packageRoot: _$effect_Schema0.String;
17
- readonly path: _$effect_Schema0.String;
18
- }>]>;
19
- readonly message: _$effect_Schema0.String;
20
- }, "Type">>;
4
+ /**
5
+ * Read-only Effect Harness Module.
6
+ *
7
+ * Prelude converges only stable Harness-owned assets. Repository-specific
8
+ * package, TypeScript, editor, lint, activation, and verification adaptation
9
+ * begins after delivery through the managed Target Adaptation skill.
10
+ */
11
+ declare const harnessModule: _$_sayoriqwq_prelude_contract0.HarnessModule<never>;
21
12
  //#endregion
22
13
  export { harnessModule };
package/dist/prelude.js CHANGED
@@ -1,7 +1,29 @@
1
- import { Buffer } from "node:buffer";
2
1
  import { CANONICAL_TREE_ARCHIVE_FORMAT, MODULE_PROTOCOL_V2, PRELUDE_V2_SUPPORTED_FEATURES, defineHarnessModule } from "@sayoriqwq/prelude-contract";
3
2
  import { Effect } from "effect";
4
- import * as TypeScript from "typescript";
3
+ //#region artifact-assets/effect/reference-archives/effect.json
4
+ var effect_default = {
5
+ archive: { "format": "prelude-canonical-tree-archive-v1" },
6
+ name: "effect",
7
+ provenance: {
8
+ "sourceUrl": "https://github.com/Effect-TS/effect-smol",
9
+ "revision": "f643dbb265093065dc0a61ca6133693dc2401678",
10
+ "treeDigest": "d797515e8ecb2e164deef65b6b7abde6445201ce9d1e9e584f39d634c2469e95"
11
+ },
12
+ schemaVersion: 1
13
+ };
14
+ //#endregion
15
+ //#region artifact-assets/effect/reference-archives/tsgo.json
16
+ var tsgo_default = {
17
+ archive: { "format": "prelude-canonical-tree-archive-v1" },
18
+ name: "tsgo",
19
+ provenance: {
20
+ "sourceUrl": "https://github.com/Effect-TS/tsgo",
21
+ "revision": "f0d48a67515048d277feb2c184c41cd7cffa51a4",
22
+ "treeDigest": "f76adab084de0de584e0a565679b3afca2b48674a28e36c7dd6398846fd2bd9d"
23
+ },
24
+ schemaVersion: 1
25
+ };
26
+ //#endregion
5
27
  //#region src/harness/Baseline.ts
6
28
  const versions = {
7
29
  effect: "4.0.0-beta.97",
@@ -33,6 +55,11 @@ const requiredDevToolTarget = {
33
55
  */
34
56
  const acceptedEffectBaseline = {
35
57
  versions,
58
+ typescriptTopology: {
59
+ primaryCompiler: "nativeTypescript",
60
+ effectSemanticAuthority: "tsgo",
61
+ compilerApiCompatibility: "typescript"
62
+ },
36
63
  packages: {
37
64
  effect: {
38
65
  id: "runtime",
@@ -122,145 +149,6 @@ const acceptedEffectBaseline = {
122
149
  }
123
150
  }
124
151
  };
125
- /** Policy item projected into each approved Target Package Root by Prelude. */
126
- const effectTsgoTargetProjection = { languageServicePlugin: {
127
- name: "@effect/language-service",
128
- diagnostics: true,
129
- includeSuggestionsInTsc: true,
130
- ignoreEffectSuggestionsInTscExitCode: false,
131
- ignoreEffectWarningsInTscExitCode: false,
132
- ignoreEffectErrorsInTscExitCode: false,
133
- diagnosticSeverity: {
134
- anyUnknownInErrorContext: "error",
135
- asyncFunction: "warning",
136
- catchAllToMapError: "suggestion",
137
- catchToIgnore: "suggestion",
138
- catchToOrElseSucceed: "suggestion",
139
- catchUnfailableEffect: "suggestion",
140
- classSelfMismatch: "error",
141
- cryptoRandomUUID: "warning",
142
- cryptoRandomUUIDInEffect: "warning",
143
- deterministicKeys: "warning",
144
- duplicatePackage: "warning",
145
- effectDoNotation: "warning",
146
- effectFnIife: "warning",
147
- effectFnImplicitAny: "error",
148
- effectFnOpportunity: "suggestion",
149
- effectGenUsesAdapter: "warning",
150
- effectInFailure: "warning",
151
- effectInVoidSuccess: "warning",
152
- effectMapFlatten: "suggestion",
153
- effectMapVoid: "suggestion",
154
- effectSucceedWithVoid: "suggestion",
155
- extendsNativeError: "warning",
156
- flatMapToMap: "suggestion",
157
- floatingEffect: "error",
158
- genericEffectServices: "warning",
159
- globalConsole: "warning",
160
- globalConsoleInEffect: "warning",
161
- globalDate: "warning",
162
- globalDateInEffect: "warning",
163
- globalErrorInEffectCatch: "warning",
164
- globalErrorInEffectFailure: "warning",
165
- globalFetch: "warning",
166
- globalFetchInEffect: "warning",
167
- globalRandom: "warning",
168
- globalRandomInEffect: "warning",
169
- globalTimers: "warning",
170
- globalTimersInEffect: "warning",
171
- instanceOfSchema: "warning",
172
- layerMergeAllWithDependencies: "warning",
173
- lazyEffect: "suggestion",
174
- lazyPromiseInEffectSync: "warning",
175
- leakingRequirements: "suggestion",
176
- missedPipeableOpportunity: "warning",
177
- missingEffectContext: "error",
178
- missingEffectError: "error",
179
- missingLayerContext: "error",
180
- missingReturnYieldStar: "error",
181
- missingStarInYieldEffectGen: "error",
182
- multipleCatchTag: "suggestion",
183
- multipleEffectProvide: "warning",
184
- nestedEffectGenYield: "warning",
185
- newPromise: "warning",
186
- newSchemaClass: "warning",
187
- nodeBuiltinImport: "warning",
188
- outdatedApi: "warning",
189
- overriddenSchemaConstructor: "error",
190
- preferSchemaOverJson: "warning",
191
- processEnv: "warning",
192
- processEnvInEffect: "warning",
193
- redundantMapError: "suggestion",
194
- redundantOrDie: "suggestion",
195
- redundantSchemaTagIdentifier: "suggestion",
196
- returnEffectInGen: "suggestion",
197
- runEffectInsideEffect: "suggestion",
198
- schemaNumber: "suggestion",
199
- schemaStructWithTag: "suggestion",
200
- serviceNotAsClass: "warning",
201
- strictBooleanExpressions: "warning",
202
- strictEffectProvide: "warning",
203
- tryCatchInEffectGen: "suggestion",
204
- unknownInEffectCatch: "warning",
205
- unnecessaryArrowBlock: "warning",
206
- unnecessaryEffectGen: "suggestion",
207
- unnecessaryFailYieldableError: "suggestion",
208
- unnecessaryPipe: "suggestion",
209
- unnecessaryPipeChain: "suggestion",
210
- unnecessaryTypeofType: "suggestion",
211
- unsafeEffectTypeAssertion: "warning"
212
- },
213
- barrelImportPackages: ["effect"],
214
- topLevelNamedReexports: "follow",
215
- effectFn: ["span"],
216
- keyPatterns: [
217
- {
218
- target: "service",
219
- pattern: "default",
220
- skipLeadingPath: ["src/"]
221
- },
222
- {
223
- target: "error",
224
- pattern: "default",
225
- skipLeadingPath: ["src/"]
226
- },
227
- {
228
- target: "custom",
229
- pattern: "default",
230
- skipLeadingPath: ["src/"]
231
- }
232
- ],
233
- extendedKeyDetection: true,
234
- layerGraphFollowDepth: 1,
235
- noExternal: true,
236
- inlays: true,
237
- allowedDuplicatedPackages: [],
238
- pipeableMinArgCount: 2
239
- } };
240
- //#endregion
241
- //#region artifact-assets/effect/reference-archives/effect.json
242
- var effect_default = {
243
- archive: { "format": "prelude-canonical-tree-archive-v1" },
244
- name: "effect",
245
- provenance: {
246
- "sourceUrl": "https://github.com/Effect-TS/effect-smol",
247
- "revision": "f643dbb265093065dc0a61ca6133693dc2401678",
248
- "treeDigest": "d797515e8ecb2e164deef65b6b7abde6445201ce9d1e9e584f39d634c2469e95"
249
- },
250
- schemaVersion: 1
251
- };
252
- //#endregion
253
- //#region artifact-assets/effect/reference-archives/tsgo.json
254
- var tsgo_default = {
255
- archive: { "format": "prelude-canonical-tree-archive-v1" },
256
- name: "tsgo",
257
- provenance: {
258
- "sourceUrl": "https://github.com/Effect-TS/tsgo",
259
- "revision": "f0d48a67515048d277feb2c184c41cd7cffa51a4",
260
- "treeDigest": "f76adab084de0de584e0a565679b3afca2b48674a28e36c7dd6398846fd2bd9d"
261
- },
262
- schemaVersion: 1
263
- };
264
152
  //#endregion
265
153
  //#region src/harness/SourcePins.ts
266
154
  const effectPin = acceptedEffectBaseline.sourcePins.effect;
@@ -269,281 +157,74 @@ function verifiedProvenance(publication, identity) {
269
157
  if (publication.name !== identity.publicationName || publication.provenance.sourceUrl !== identity.sourceUrl) throw new Error(`Source Pin publication does not match accepted Baseline identity: ${identity.publicationName}`);
270
158
  return publication.provenance;
271
159
  }
272
- /**
273
- * Immutable declarations derived from the Source Pin publications.
274
- *
275
- * Partita publishes each archive and its generic provenance. Effect Harness
276
- * adds only its concrete pin identity and Target delivery policy.
277
- */
278
- const pinnedReferenceOutputs = [{
279
- kind: "PinnedReferenceTree",
280
- id: effectPin.outputId,
281
- archive: {
282
- path: `artifact-assets/effect/reference-archives/${effectPin.publicationName}.pta`,
283
- format: CANONICAL_TREE_ARCHIVE_FORMAT
284
- },
285
- locator: {
286
- root: "IntegrationWorkspace",
287
- path: effectPin.targetPath
288
- },
289
- provenance: verifiedProvenance(effect_default, effectPin),
290
- referenceOnly: true
291
- }, {
292
- kind: "PinnedReferenceTree",
293
- id: tsgoPin.outputId,
294
- archive: {
295
- path: `artifact-assets/effect/reference-archives/${tsgoPin.publicationName}.pta`,
296
- format: CANONICAL_TREE_ARCHIVE_FORMAT
297
- },
298
- locator: {
299
- root: "IntegrationWorkspace",
300
- path: tsgoPin.targetPath
301
- },
302
- provenance: verifiedProvenance(tsgo_default, tsgoPin),
303
- referenceOnly: true
304
- }];
305
160
  //#endregion
306
161
  //#region src/prelude.ts
307
- const routingBlock = `## Effect Harness\n\nFor Effect application, test, package, TypeScript, editor, or lint changes, read the current Effect integration's \`.prelude/**/managed/docs/index.md\` first. Use \`.prelude/**/managed/skills/adapt-effect-target/SKILL.md\` when package selection or target-owned TypeScript topology needs adaptation. Keep \`.prelude/**/feedback/**\` target-owned. Treat \`.prelude/**/repos/**\` as read-only source diagnostics: consult it when installed declarations and managed guidance are insufficient, but never import or edit it.\n`;
308
- const managedTreeOutput = {
309
- kind: "ManagedTree",
310
- id: "effect.managed",
311
- sourceRoot: "artifact-assets/effect/managed",
312
- locator: {
313
- root: "IntegrationWorkspace",
314
- path: "managed"
315
- }
316
- };
317
- const routingOutput = {
318
- kind: "ManagedBlock",
319
- id: "effect.agent-routing",
320
- locator: {
321
- root: "ControlRoot",
322
- path: "AGENTS.md"
323
- },
324
- blockId: "effect-harness-routing",
325
- content: routingBlock
326
- };
327
- const editorPolicyOutputs = [
162
+ const stableHarnessOutputs = [
328
163
  {
329
- kind: "JsonValue",
330
- id: "effect.vscode.auto-import-exclude",
164
+ kind: "ManagedTree",
165
+ id: "effect.managed",
166
+ sourceRoot: "artifact-assets/effect/managed",
331
167
  locator: {
332
- root: "ControlRoot",
333
- path: ".vscode/settings.json"
334
- },
335
- pointer: "/typescript.preferences.autoImportFileExcludePatterns",
336
- value: [".prelude/**/repos/**"]
168
+ root: "IntegrationWorkspace",
169
+ path: "managed"
170
+ }
337
171
  },
338
172
  {
339
- kind: "JsonValue",
340
- id: "effect.vscode.javascript-auto-import-exclude",
173
+ kind: "ManagedBlock",
174
+ id: "effect.agent-routing",
341
175
  locator: {
342
176
  root: "ControlRoot",
343
- path: ".vscode/settings.json"
177
+ path: "AGENTS.md"
344
178
  },
345
- pointer: "/javascript.preferences.autoImportFileExcludePatterns",
346
- value: [".prelude/**/repos/**"]
179
+ blockId: "effect-harness-routing",
180
+ content: `## Effect Harness\n\nFor Effect application, test, package, TypeScript, editor, or lint changes, read the current Effect integration's \`.prelude/**/managed/docs/index.md\` first. Use \`.prelude/**/managed/skills/adapt-effect-target/SKILL.md\` when package selection or target-owned TypeScript topology needs adaptation. Keep \`.prelude/**/feedback/**\` target-owned. Treat \`.prelude/**/repos/**\` as read-only source diagnostics: consult it when installed declarations and managed guidance are insufficient, but never import or edit it.\n`
347
181
  },
348
- {
349
- kind: "JsonValue",
350
- id: "effect.zed.auto-import-exclude",
351
- locator: {
352
- root: "ControlRoot",
353
- path: ".zed/settings.json"
182
+ ...[{
183
+ kind: "PinnedReferenceTree",
184
+ id: effectPin.outputId,
185
+ archive: {
186
+ path: `artifact-assets/effect/reference-archives/${effectPin.publicationName}.pta`,
187
+ format: CANONICAL_TREE_ARCHIVE_FORMAT
354
188
  },
355
- pointer: "/lsp/typescript-language-server/initialization_options/preferences/autoImportFileExcludePatterns",
356
- value: [".prelude/**/repos/**"]
357
- }
358
- ];
359
- const baselineDevRequirements = [
360
- acceptedEffectBaseline.packages.effectVitest,
361
- acceptedEffectBaseline.packages.tsgo,
362
- acceptedEffectBaseline.packages.nativeTypescript,
363
- acceptedEffectBaseline.packages.typescript
364
- ].map((entry) => ({
365
- id: entry.id,
366
- packageName: entry.packageName,
367
- range: entry.range,
368
- section: entry.target.defaultSection
369
- }));
370
- const deliveryToolRequirements = [
371
- {
372
- id: "eslint",
373
- packageName: "eslint",
374
- range: "^10.3.0",
375
- section: "devDependencies"
376
- },
377
- {
378
- id: "antfu-eslint-config",
379
- packageName: "@antfu/eslint-config",
380
- range: "^9.0.0",
381
- section: "devDependencies"
382
- },
383
- {
384
- id: "vitest-runner",
385
- packageName: "vitest",
386
- range: "^4.1.8",
387
- section: "devDependencies"
388
- }
389
- ];
390
- function packageRootKey(packageRoot) {
391
- return Buffer.from(packageRoot, "utf8").toString("hex");
392
- }
393
- function packageOutputs(packageRoot) {
394
- return [{
395
- kind: "JsonKeyedItem",
396
- id: `effect.tsconfig.language-service.${packageRootKey(packageRoot)}`,
397
189
  locator: {
398
- root: "PackageRoot",
399
- packageRoot,
400
- path: "tsconfig.json"
190
+ root: "IntegrationWorkspace",
191
+ path: effectPin.targetPath
401
192
  },
402
- collectionPointer: "/compilerOptions/plugins",
403
- keyField: "name",
404
- keyValue: "@effect/language-service",
405
- item: effectTsgoTargetProjection.languageServicePlugin
406
- }];
407
- }
408
- function hasManifestDependency(manifest, section, packageName) {
409
- const entries = manifest?.[section];
410
- return typeof entries === "object" && entries !== null && !Array.isArray(entries) && typeof entries[packageName] === "string";
411
- }
412
- function selectedSection(manifest, packageName, fallback, peerFallback) {
413
- if (hasManifestDependency(manifest, "dependencies", packageName)) return "dependencies";
414
- if (hasManifestDependency(manifest, "devDependencies", packageName)) return "devDependencies";
415
- if (hasManifestDependency(manifest, "peerDependencies", packageName)) return peerFallback;
416
- return fallback;
417
- }
418
- function hasDeclaredDependency(manifest, packageName) {
419
- return hasManifestDependency(manifest, "dependencies", packageName) || hasManifestDependency(manifest, "devDependencies", packageName) || hasManifestDependency(manifest, "peerDependencies", packageName);
420
- }
421
- function shouldPlanBaselinePackage(manifest, entry) {
422
- return entry.target.presence === "required" || manifest === void 0 || hasDeclaredDependency(manifest, entry.packageName);
423
- }
424
- function requirementsFor(packageRoot, manifest) {
425
- const rootKey = packageRootKey(packageRoot);
426
- const runtime = acceptedEffectBaseline.packages.effect;
427
- const platform = acceptedEffectBaseline.packages.platformNode;
428
- const runtimeRequirements = [{
429
- id: runtime.id,
430
- packageName: runtime.packageName,
431
- range: runtime.range,
432
- section: selectedSection(manifest, runtime.packageName, runtime.target.defaultSection, runtime.target.peerFallbackSection)
433
- }];
434
- const platformSection = selectedSection(manifest, platform.packageName, platform.target.defaultSection, platform.target.peerFallbackSection);
435
- const platformRequirements = shouldPlanBaselinePackage(manifest, platform) ? [{
436
- id: platform.id,
437
- packageName: platform.packageName,
438
- range: platform.range,
439
- section: platformSection
440
- }] : [];
441
- return [
442
- ...runtimeRequirements,
443
- ...platformRequirements,
444
- ...baselineDevRequirements,
445
- ...deliveryToolRequirements
446
- ].map((requirement) => ({
447
- ...requirement,
448
- id: `effect.${requirement.id}.${rootKey}`,
449
- packageRoot
450
- }));
451
- }
452
- function checksFor(packageRoot) {
453
- const rootKey = packageRootKey(packageRoot);
454
- return [
455
- {
456
- id: `effect.typecheck.${rootKey}`,
457
- summary: "Run strict Effect diagnostics",
458
- packageRoot,
459
- argv: ["pnpm", "typecheck"]
193
+ provenance: verifiedProvenance(effect_default, effectPin),
194
+ referenceOnly: true
195
+ }, {
196
+ kind: "PinnedReferenceTree",
197
+ id: tsgoPin.outputId,
198
+ archive: {
199
+ path: `artifact-assets/effect/reference-archives/${tsgoPin.publicationName}.pta`,
200
+ format: CANONICAL_TREE_ARCHIVE_FORMAT
460
201
  },
461
- {
462
- id: `effect.lint.${rootKey}`,
463
- summary: "Run Effect lint guardrails",
464
- packageRoot,
465
- argv: [
466
- "pnpm",
467
- "lint",
468
- "--max-warnings",
469
- "0"
470
- ]
202
+ locator: {
203
+ root: "IntegrationWorkspace",
204
+ path: tsgoPin.targetPath
471
205
  },
472
- {
473
- id: `effect.verify.${rootKey}`,
474
- summary: "Run Effect domain verification",
475
- packageRoot,
476
- argv: ["pnpm", "verify"]
477
- }
478
- ];
479
- }
480
- function eslintIntegrationIssue(content) {
481
- if (typeof content === "string") {
482
- if (hasEffectHarnessEslintComposition(content)) return [];
483
- }
484
- return [{
485
- id: "effect.eslint.integration",
486
- summary: "Target ESLint config does not compose Effect Harness guardrails",
487
- detail: "The target-owned eslint.config.mjs must import and include @sayoriqwq/effect-harness/eslint.",
488
- evidence: content === void 0 ? "eslint.config.mjs is absent." : "eslint.config.mjs does not reference the stable Effect Harness ESLint export.",
489
- guidance: "artifact-assets/effect/managed/docs/package-config.md"
490
- }];
491
- }
492
- function hasEffectHarnessEslintComposition(content) {
493
- const source = TypeScript.createSourceFile("eslint.config.mjs", content, TypeScript.ScriptTarget.Latest, false, TypeScript.ScriptKind.JS);
494
- let antfuBinding = "";
495
- for (const statement of source.statements) if (TypeScript.isImportDeclaration(statement) && TypeScript.isStringLiteral(statement.moduleSpecifier) && statement.moduleSpecifier.text === "@antfu/eslint-config") antfuBinding = statement.importClause?.name?.text ?? "";
496
- for (const statement of source.statements) {
497
- if (!TypeScript.isImportDeclaration(statement) || !TypeScript.isStringLiteral(statement.moduleSpecifier) || statement.moduleSpecifier.text !== "@sayoriqwq/effect-harness/eslint") continue;
498
- const binding = statement.importClause?.name?.text ?? "";
499
- if (binding.length > 0 && composesEslintBinding(source, binding, antfuBinding)) return true;
500
- }
501
- return false;
502
- }
503
- function composesEslintBinding(source, binding, antfuBinding) {
504
- return source.statements.some((statement) => {
505
- if (TypeScript.isExportAssignment(statement) === false) return false;
506
- if (statement.isExportEquals === true) return false;
507
- if (TypeScript.isArrayLiteralExpression(statement.expression)) return statement.expression.elements.some((element) => TypeScript.isSpreadElement(element) && TypeScript.isIdentifier(element.expression) && element.expression.text === binding) && !spreadsAntfuCall(statement.expression, antfuBinding);
508
- return appendsEffectConfigToAntfu(statement.expression, binding, antfuBinding);
509
- });
510
- }
511
- function spreadsAntfuCall(expression, antfuBinding) {
512
- return antfuBinding.length > 0 && expression.elements.some((element) => TypeScript.isSpreadElement(element) && TypeScript.isCallExpression(element.expression) && TypeScript.isIdentifier(element.expression.expression) && element.expression.expression.text === antfuBinding);
513
- }
514
- function appendsEffectConfigToAntfu(expression, effectBinding, antfuBinding) {
515
- if (antfuBinding.length === 0 || !TypeScript.isCallExpression(expression)) return false;
516
- const append = expression.expression;
517
- if (!TypeScript.isPropertyAccessExpression(append) || append.name.text !== "append") return false;
518
- if (!TypeScript.isCallExpression(append.expression) || !TypeScript.isIdentifier(append.expression.expression) || append.expression.expression.text !== antfuBinding) return false;
519
- return expression.arguments.some((argument) => TypeScript.isSpreadElement(argument) && TypeScript.isIdentifier(argument.expression) && argument.expression.text === effectBinding);
520
- }
206
+ provenance: verifiedProvenance(tsgo_default, tsgoPin),
207
+ referenceOnly: true
208
+ }]
209
+ ];
210
+ /**
211
+ * Read-only Effect Harness Module.
212
+ *
213
+ * Prelude converges only stable Harness-owned assets. Repository-specific
214
+ * package, TypeScript, editor, lint, activation, and verification adaptation
215
+ * begins after delivery through the managed Target Adaptation skill.
216
+ */
521
217
  const harnessModule = defineHarnessModule({
522
218
  descriptor: {
523
219
  harnessId: "effect-harness",
524
220
  protocolVersion: MODULE_PROTOCOL_V2,
525
221
  requiredFeatures: PRELUDE_V2_SUPPORTED_FEATURES
526
222
  },
527
- plan: (context) => Effect.gen(function* () {
528
- const eslintConfig = yield* context.target.readText({
529
- root: "ControlRoot",
530
- path: "eslint.config.mjs"
531
- });
532
- const outputs = context.integration.packageRoots.flatMap(packageOutputs);
533
- const requirements = (yield* Effect.forEach(context.integration.packageRoots, (packageRoot) => context.target.readPackageManifest(packageRoot).pipe(Effect.map((manifest) => requirementsFor(packageRoot, manifest))))).flat();
534
- const checks = context.integration.packageRoots.flatMap(checksFor);
535
- return {
536
- outputs: [
537
- managedTreeOutput,
538
- routingOutput,
539
- ...pinnedReferenceOutputs,
540
- ...outputs,
541
- ...editorPolicyOutputs
542
- ],
543
- requirements,
544
- checks,
545
- issues: eslintIntegrationIssue(eslintConfig)
546
- };
223
+ plan: () => Effect.succeed({
224
+ outputs: stableHarnessOutputs,
225
+ requirements: [],
226
+ checks: [],
227
+ issues: []
547
228
  })
548
229
  });
549
230
  //#endregion