@sayoriqwq/effect-harness 0.0.3 → 0.0.5
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/bin/effect-harness.js +2 -13
- package/dist/bin/effect-harness.js.map +1 -1
- package/dist/src/harness/ProviderDiscovery.d.ts +96 -10
- package/dist/src/harness/ProviderDiscovery.js +107 -18
- package/dist/src/harness/ProviderDiscovery.js.map +1 -1
- package/dist/src/harness/verify/ProviderProfile.js +45 -19
- package/dist/src/harness/verify/ProviderProfile.js.map +1 -1
- package/dist/src/harness/verify/TsgoPolicy.d.ts +3 -0
- package/dist/src/harness/verify/TsgoPolicy.js +3 -0
- package/dist/src/harness/verify/TsgoPolicy.js.map +1 -1
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.js +16 -0
- package/dist/src/index.js.map +1 -0
- package/harness/diagnostic-layers.md +1 -1
- package/package.json +9 -2
- package/provider/docs/discovery.md +26 -0
- package/provider/docs/package-config.md +16 -0
- package/provider/docs/quality-policy.md +14 -4
- package/provider/effect-harness.provider.json +48 -11
- package/provider/index.md +8 -0
- package/repos/effect.subtree.json +2 -2
- package/repos/tsgo.subtree.json +2 -2
|
@@ -158,7 +158,7 @@ const expectedPackageGroups = {
|
|
|
158
158
|
},
|
|
159
159
|
testing: {
|
|
160
160
|
field: 'devDependencies',
|
|
161
|
-
packageNames: ['@effect/vitest'],
|
|
161
|
+
packageNames: ['@effect/vitest', 'vitest'],
|
|
162
162
|
},
|
|
163
163
|
diagnostics: {
|
|
164
164
|
field: 'devDependencies',
|
|
@@ -168,11 +168,15 @@ const expectedPackageGroups = {
|
|
|
168
168
|
field: 'devDependencies',
|
|
169
169
|
packageNames: ['@typescript/native-preview'],
|
|
170
170
|
},
|
|
171
|
+
linting: {
|
|
172
|
+
field: 'devDependencies',
|
|
173
|
+
packageNames: ['@antfu/eslint-config', 'eslint'],
|
|
174
|
+
},
|
|
171
175
|
};
|
|
172
176
|
const expectedLintCommand = 'pnpm lint --max-warnings 0';
|
|
173
177
|
const expectedLintScript = 'eslint';
|
|
174
178
|
const expectedTestCommand = 'pnpm test';
|
|
175
|
-
const expectedTestScript = 'vitest run
|
|
179
|
+
const expectedTestScript = 'vitest run';
|
|
176
180
|
const expectedVerifyCommand = 'pnpm verify';
|
|
177
181
|
const expectedVerifyScript = 'node bin/effect-harness.ts verify --harness .';
|
|
178
182
|
function assertPackageBaseline(errors, profileBaseline) {
|
|
@@ -275,7 +279,7 @@ function assertLintGuardrailsContribution(errors, contributions, packageManifest
|
|
|
275
279
|
assertArrayContainsString(errors, doesNotOwn, 'tsgo rule severity map', 'provider profile lintGuardrails.layers.doesNotOwn');
|
|
276
280
|
const rules = recordField(errors, lintGuardrails, 'rules', 'provider profile lintGuardrails contribution');
|
|
277
281
|
const restrictedImports = arrayField(errors, rules, 'restrictedImports', 'provider profile lintGuardrails.rules');
|
|
278
|
-
for (const source of ['node:test', '
|
|
282
|
+
for (const source of ['node:test', '@effect/cli', '@effect/cli/*', 'repos/effect/**', 'repos/tsgo/**']) {
|
|
279
283
|
assertArrayContainsString(errors, restrictedImports, source, 'provider profile lintGuardrails.rules.restrictedImports');
|
|
280
284
|
const eslintMarker = source.endsWith('/**')
|
|
281
285
|
? source.slice(0, -3)
|
|
@@ -284,6 +288,16 @@ function assertLintGuardrailsContribution(errors, contributions, packageManifest
|
|
|
284
288
|
: source;
|
|
285
289
|
assertEslintConfigContains(errors, eslintText, eslintMarker);
|
|
286
290
|
}
|
|
291
|
+
const restrictedVitestImports = arrayField(errors, rules, 'restrictedVitestImports', 'provider profile lintGuardrails.rules');
|
|
292
|
+
for (const importName of ['describe', 'it', 'test']) {
|
|
293
|
+
assertArrayContainsString(errors, restrictedVitestImports, importName, 'provider profile lintGuardrails.rules.restrictedVitestImports');
|
|
294
|
+
}
|
|
295
|
+
const allowedVitestImports = arrayField(errors, rules, 'allowedVitestImports', 'provider profile lintGuardrails.rules');
|
|
296
|
+
for (const importName of ['vi', 'beforeEach', 'afterEach', 'beforeAll', 'afterAll']) {
|
|
297
|
+
assertArrayContainsString(errors, allowedVitestImports, importName, 'provider profile lintGuardrails.rules.allowedVitestImports');
|
|
298
|
+
}
|
|
299
|
+
assertEslintConfigContains(errors, eslintText, 'vitest');
|
|
300
|
+
assertEslintConfigContains(errors, eslintText, 'importNames');
|
|
287
301
|
const restrictedSyntax = arrayField(errors, rules, 'restrictedSyntax', 'provider profile lintGuardrails.rules');
|
|
288
302
|
for (const syntax of ['Context.Tag', 'Effect.catchAllCause', 'Effect.ignore', 'Effect.serviceOption', '{ disableValidation: true }', 'plain it() in tests']) {
|
|
289
303
|
assertArrayContainsString(errors, restrictedSyntax, syntax, 'provider profile lintGuardrails.rules.restrictedSyntax');
|
|
@@ -297,21 +311,22 @@ function assertLintGuardrailsContribution(errors, contributions, packageManifest
|
|
|
297
311
|
assertEslintConfigContains(errors, eslintText, marker);
|
|
298
312
|
}
|
|
299
313
|
}
|
|
300
|
-
function assertTestPolicyContribution(errors, contributions
|
|
314
|
+
function assertTestPolicyContribution(errors, contributions) {
|
|
301
315
|
const testPolicy = recordField(errors, contributions, 'testPolicy', 'provider profile.profiles.codex-effect-v4.contributions');
|
|
302
316
|
assertStringValue(errors, stringField(errors, testPolicy, 'mode', 'provider profile testPolicy contribution'), 'command-policy', 'provider profile testPolicy.mode');
|
|
303
317
|
assertStringValue(errors, stringField(errors, testPolicy, 'stage', 'provider profile testPolicy contribution'), 'tests', 'provider profile testPolicy.stage');
|
|
304
318
|
assertStringValue(errors, stringField(errors, testPolicy, 'command', 'provider profile testPolicy contribution'), expectedTestCommand, 'provider profile testPolicy.command');
|
|
305
319
|
assertStringValue(errors, stringField(errors, testPolicy, 'packageScript', 'provider profile testPolicy contribution'), expectedTestScript, 'provider profile testPolicy.packageScript');
|
|
306
320
|
assertStringValue(errors, stringField(errors, testPolicy, 'framework', 'provider profile testPolicy contribution'), '@effect/vitest', 'provider profile testPolicy.framework');
|
|
307
|
-
assertArrayContainsString(errors, arrayField(errors, testPolicy, 'expectedEntries', 'provider profile testPolicy contribution'), 'tests
|
|
321
|
+
assertArrayContainsString(errors, arrayField(errors, testPolicy, 'expectedEntries', 'provider profile testPolicy contribution'), 'tests/**/*.test.ts', 'provider profile testPolicy.expectedEntries');
|
|
308
322
|
assertArrayContainsString(errors, arrayField(errors, testPolicy, 'effectEntrypoints', 'provider profile testPolicy contribution'), 'it.effect', 'provider profile testPolicy.effectEntrypoints');
|
|
309
323
|
assertArrayContainsString(errors, arrayField(errors, testPolicy, 'effectEntrypoints', 'provider profile testPolicy contribution'), 'it.live', 'provider profile testPolicy.effectEntrypoints');
|
|
310
324
|
assertArrayContainsString(errors, arrayField(errors, testPolicy, 'effectEntrypoints', 'provider profile testPolicy contribution'), 'layer', 'provider profile testPolicy.effectEntrypoints');
|
|
311
325
|
assertArrayContainsString(errors, arrayField(errors, testPolicy, 'disallowedImports', 'provider profile testPolicy contribution'), 'node:test', 'provider profile testPolicy.disallowedImports');
|
|
312
|
-
|
|
313
|
-
const
|
|
314
|
-
|
|
326
|
+
const disallowedVitestImports = arrayField(errors, testPolicy, 'disallowedVitestImports', 'provider profile testPolicy contribution');
|
|
327
|
+
for (const importName of ['describe', 'it', 'test']) {
|
|
328
|
+
assertArrayContainsString(errors, disallowedVitestImports, importName, 'provider profile testPolicy.disallowedVitestImports');
|
|
329
|
+
}
|
|
315
330
|
}
|
|
316
331
|
function stageRecordByTag(stages, tag) {
|
|
317
332
|
return stages?.find(stage => isRecord(stage) && stage.tag === tag);
|
|
@@ -377,11 +392,16 @@ function assertPackageScriptsContribution(errors, packageContribution, packageMa
|
|
|
377
392
|
const contributionScripts = recordField(errors, packageContribution, 'scripts', 'provider profile packageJson contribution');
|
|
378
393
|
const prepare = recordField(errors, contributionScripts, 'prepare', 'provider profile packageJson.scripts');
|
|
379
394
|
const typecheck = recordField(errors, contributionScripts, 'typecheck', 'provider profile packageJson.scripts');
|
|
395
|
+
const test = recordField(errors, contributionScripts, 'test', 'provider profile packageJson.scripts');
|
|
396
|
+
const lint = recordField(errors, contributionScripts, 'lint', 'provider profile packageJson.scripts');
|
|
380
397
|
assertStringValue(errors, stringField(errors, prepare, 'defaultCommand', 'provider profile packageJson.scripts.prepare'), expectedPrepareCommand, 'provider profile packageJson.scripts.prepare.defaultCommand');
|
|
381
398
|
assertStringValue(errors, stringField(errors, typecheck, 'defaultCommand', 'provider profile packageJson.scripts.typecheck'), expectedTypecheckCommand, 'provider profile packageJson.scripts.typecheck.defaultCommand');
|
|
399
|
+
assertStringValue(errors, stringField(errors, test, 'defaultCommand', 'provider profile packageJson.scripts.test'), expectedTestScript, 'provider profile packageJson.scripts.test.defaultCommand');
|
|
400
|
+
assertStringValue(errors, stringField(errors, lint, 'defaultCommand', 'provider profile packageJson.scripts.lint'), expectedLintScript, 'provider profile packageJson.scripts.lint.defaultCommand');
|
|
382
401
|
const manifestScripts = recordField(errors, packageManifest, 'scripts', 'package.json');
|
|
383
402
|
assertStringValue(errors, stringField(errors, manifestScripts, 'prepare', 'package.json.scripts'), expectedPrepareCommand, 'package.json.scripts.prepare');
|
|
384
403
|
assertStringValue(errors, stringField(errors, manifestScripts, 'typecheck', 'package.json.scripts'), expectedTypecheckCommand, 'package.json.scripts.typecheck');
|
|
404
|
+
assertStringValue(errors, stringField(errors, manifestScripts, 'lint', 'package.json.scripts'), expectedLintScript, 'package.json.scripts.lint');
|
|
385
405
|
}
|
|
386
406
|
function assertPackageJsonContribution(errors, contributions, packageManifest, workspaceText) {
|
|
387
407
|
const packageJson = recordField(errors, contributions, 'packageJson', 'provider profile.profiles.codex-effect-v4.contributions');
|
|
@@ -445,12 +465,18 @@ function assertArtifactReference(errors, references, expected) {
|
|
|
445
465
|
assertStringValue(errors, stringField(errors, reference, 'targetDelivery', `provider profile.artifactReferences.references.${expected.id}`), 'artifact-only', `provider profile.artifactReferences.references.${expected.id}.targetDelivery`);
|
|
446
466
|
}
|
|
447
467
|
function assertArtifactReferencesContract(errors, providerProfile, packageManifest) {
|
|
468
|
+
assertStringValue(errors, stringField(errors, packageManifest, 'main', 'package.json'), 'dist/src/index.js', 'package.json.main');
|
|
469
|
+
assertStringValue(errors, stringField(errors, packageManifest, 'types', 'package.json'), 'dist/src/index.d.ts', 'package.json.types');
|
|
470
|
+
const packageExports = recordField(errors, packageManifest, 'exports', 'package.json');
|
|
471
|
+
const rootExport = recordField(errors, packageExports, '.', 'package.json.exports');
|
|
472
|
+
assertStringValue(errors, stringField(errors, rootExport, 'import', 'package.json.exports["."]'), './dist/src/index.js', 'package.json.exports["."].import');
|
|
473
|
+
assertStringValue(errors, stringField(errors, rootExport, 'types', 'package.json.exports["."]'), './dist/src/index.d.ts', 'package.json.exports["."].types');
|
|
448
474
|
const artifactReferences = recordField(errors, providerProfile, 'artifactReferences', 'provider profile');
|
|
449
475
|
assertStringValue(errors, stringField(errors, artifactReferences, 'mode', 'provider profile.artifactReferences'), 'provider-artifact-reference', 'provider profile.artifactReferences.mode');
|
|
450
476
|
assertStringValue(errors, stringField(errors, artifactReferences, 'targetDelivery', 'provider profile.artifactReferences'), 'identity-only', 'provider profile.artifactReferences.targetDelivery');
|
|
451
477
|
const packageFiles = arrayField(errors, packageManifest, 'files', 'package.json');
|
|
452
478
|
const packageSurface = arrayField(errors, artifactReferences, 'packageSurface', 'provider profile.artifactReferences');
|
|
453
|
-
for (const path of ['provider', 'harness', 'repos', 'repos/effect.subtree.json', 'repos/tsgo.subtree.json']) {
|
|
479
|
+
for (const path of ['dist', 'provider', 'harness', 'repos', 'repos/effect.subtree.json', 'repos/tsgo.subtree.json']) {
|
|
454
480
|
assertArrayContainsString(errors, packageFiles, path, 'package.json.files');
|
|
455
481
|
assertArrayContainsString(errors, packageSurface, path, 'provider profile.artifactReferences.packageSurface');
|
|
456
482
|
}
|
|
@@ -519,14 +545,14 @@ export const verifyProviderProfileContract = Effect.fnUntraced(function* (errors
|
|
|
519
545
|
assertProviderSourceEntry(errors, sourceEntries, {
|
|
520
546
|
contractPath: 'repos/effect.subtree.json',
|
|
521
547
|
id: 'effect-official-source',
|
|
522
|
-
updateCommand: 'partita pin update --contract repos/effect.subtree.json --name effect --prefix repos/effect --dry-run',
|
|
523
|
-
verifyCommand: 'partita pin verify --contract repos/effect.subtree.json --name effect --prefix repos/effect',
|
|
548
|
+
updateCommand: 'npx --yes @sayoriqwq/partita pin update --contract repos/effect.subtree.json --name effect --prefix repos/effect --dry-run',
|
|
549
|
+
verifyCommand: 'npx --yes @sayoriqwq/partita pin verify --contract repos/effect.subtree.json --name effect --prefix repos/effect',
|
|
524
550
|
});
|
|
525
551
|
assertProviderSourceEntry(errors, sourceEntries, {
|
|
526
552
|
contractPath: 'repos/tsgo.subtree.json',
|
|
527
553
|
id: 'tsgo-official-source',
|
|
528
|
-
updateCommand: 'partita pin update --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo --dry-run',
|
|
529
|
-
verifyCommand: 'partita pin verify --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo',
|
|
554
|
+
updateCommand: 'npx --yes @sayoriqwq/partita pin update --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo --dry-run',
|
|
555
|
+
verifyCommand: 'npx --yes @sayoriqwq/partita pin verify --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo',
|
|
530
556
|
});
|
|
531
557
|
assertPartitaSubtreeContract(errors, effectContract, {
|
|
532
558
|
anchor: 'repos/effect/LLMS.md',
|
|
@@ -536,8 +562,8 @@ export const verifyProviderProfileContract = Effect.fnUntraced(function* (errors
|
|
|
536
562
|
prefix: 'repos/effect',
|
|
537
563
|
repository: 'https://github.com/Effect-TS/effect-smol',
|
|
538
564
|
route: 'harness/effect-routes.md',
|
|
539
|
-
updateCommand: 'partita pin update --contract repos/effect.subtree.json --name effect --prefix repos/effect --dry-run',
|
|
540
|
-
verifyCommand: 'partita pin verify --contract repos/effect.subtree.json --name effect --prefix repos/effect',
|
|
565
|
+
updateCommand: 'npx --yes @sayoriqwq/partita pin update --contract repos/effect.subtree.json --name effect --prefix repos/effect --dry-run',
|
|
566
|
+
verifyCommand: 'npx --yes @sayoriqwq/partita pin verify --contract repos/effect.subtree.json --name effect --prefix repos/effect',
|
|
541
567
|
});
|
|
542
568
|
assertPartitaSubtreeContract(errors, tsgoContract, {
|
|
543
569
|
anchor: 'repos/tsgo/README.md',
|
|
@@ -547,8 +573,8 @@ export const verifyProviderProfileContract = Effect.fnUntraced(function* (errors
|
|
|
547
573
|
prefix: 'repos/tsgo',
|
|
548
574
|
repository: 'https://github.com/Effect-TS/tsgo',
|
|
549
575
|
route: 'harness/tsgo-routes.md',
|
|
550
|
-
updateCommand: 'partita pin update --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo --dry-run',
|
|
551
|
-
verifyCommand: 'partita pin verify --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo',
|
|
576
|
+
updateCommand: 'npx --yes @sayoriqwq/partita pin update --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo --dry-run',
|
|
577
|
+
verifyCommand: 'npx --yes @sayoriqwq/partita pin verify --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo',
|
|
552
578
|
});
|
|
553
579
|
const providerRecord = recordField(errors, providerProfile, 'providerRecord', 'provider profile');
|
|
554
580
|
const sourceDelivery = recordField(errors, providerRecord, 'sourceDelivery', 'provider profile.providerRecord');
|
|
@@ -592,7 +618,7 @@ export const verifyProviderProfileContract = Effect.fnUntraced(function* (errors
|
|
|
592
618
|
assertTsconfigContributionMetadata(errors, contributions);
|
|
593
619
|
assertEditorPolicyContribution(errors, contributions, effectContract, tsgoContract, vscodeSettings);
|
|
594
620
|
assertLintGuardrailsContribution(errors, contributions, packageManifest, eslintText);
|
|
595
|
-
assertTestPolicyContribution(errors, contributions
|
|
621
|
+
assertTestPolicyContribution(errors, contributions);
|
|
596
622
|
assertVerificationPolicyContribution(errors, contributions, packageManifest);
|
|
597
623
|
yield* assertManagedFileBundle(errors, harness, recordField(errors, contributions, 'documentationBundle', 'provider profile.profiles.codex-effect-v4.contributions'), '.prelude/providers/effect-harness/docs', [
|
|
598
624
|
{
|
|
@@ -621,7 +647,7 @@ export const verifyProviderProfileContract = Effect.fnUntraced(function* (errors
|
|
|
621
647
|
},
|
|
622
648
|
{
|
|
623
649
|
id: 'discovery',
|
|
624
|
-
requiredKeywords: ['Provider Discovery', 'provider-discover', 'Prelude', 'target-managed surfaces', 'artifact-only', 'internal harness'],
|
|
650
|
+
requiredKeywords: ['Provider Discovery', 'provider-discover', 'Prelude', 'target-managed surfaces', 'artifact-only', 'internal harness', 'npm selects the artifact', 'effect-harness owns desired semantics', 'Prelude projects the artifact', 'Prelude lifecycle commands', 'npm same-name cwd short-circuit'],
|
|
625
651
|
sourcePath: 'provider/docs/discovery.md',
|
|
626
652
|
targetPath: 'discovery.md',
|
|
627
653
|
},
|