@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
|
@@ -5,6 +5,9 @@ export const expectedPackageBaseline = {
|
|
|
5
5
|
'@effect/tsgo': '0.15.0',
|
|
6
6
|
'@effect/language-service': '0.86.2',
|
|
7
7
|
'@typescript/native-preview': '7.0.0-dev.20260630.1',
|
|
8
|
+
'@antfu/eslint-config': '^9.0.0',
|
|
9
|
+
'eslint': '^10.3.0',
|
|
10
|
+
'vitest': '^4.1.8',
|
|
8
11
|
};
|
|
9
12
|
export const expectedEffectTsgoVersion = '0.15.0';
|
|
10
13
|
export const expectedPrepareCommand = 'effect-tsgo patch';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TsgoPolicy.js","sourceRoot":"","sources":["../../../../src/harness/verify/TsgoPolicy.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAA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AG;IACxC,uBAAuB;IACvB,wBAAwB;IACxB,iBAAiB;IACjB,qBAAqB;IACrB,kBAAkB;IAClB,qBAAqB;IACrB,qBAAqB;IACrB,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;CACX,CAAA","sourcesContent":["export type TsgoDiagnosticSeverity = 'error' | 'message' | 'suggestion' | 'warning'\n\nexport const expectedPackageBaseline = {\n 'effect': '4.0.0-beta.92',\n '@effect/platform-node': '4.0.0-beta.92',\n '@effect/vitest': '4.0.0-beta.92',\n '@effect/tsgo': '0.15.0',\n '@effect/language-service': '0.86.2',\n '@typescript/native-preview': '7.0.0-dev.20260630.1',\n '@antfu/eslint-config': '^9.0.0',\n 'eslint': '^10.3.0',\n 'vitest': '^4.1.8',\n} as const\n\nexport const expectedEffectTsgoVersion = '0.15.0'\nexport const expectedPrepareCommand = 'effect-tsgo patch'\nexport const expectedTypecheckCommand = 'tsgo --noEmit'\n\nexport const strictDiagnosticSeverity = {\n anyUnknownInErrorContext: 'error',\n asyncFunction: 'warning',\n catchAllToMapError: 'suggestion',\n catchToOrElseSucceed: 'suggestion',\n catchUnfailableEffect: 'suggestion',\n classSelfMismatch: 'error',\n cryptoRandomUUID: 'warning',\n cryptoRandomUUIDInEffect: 'warning',\n deterministicKeys: 'warning',\n duplicatePackage: 'warning',\n effectDoNotation: 'warning',\n effectFnIife: 'warning',\n effectFnImplicitAny: 'error',\n effectFnOpportunity: 'suggestion',\n effectGenUsesAdapter: 'warning',\n effectInFailure: 'warning',\n effectInVoidSuccess: 'warning',\n effectMapFlatten: 'suggestion',\n effectMapVoid: 'suggestion',\n effectSucceedWithVoid: 'suggestion',\n extendsNativeError: 'warning',\n floatingEffect: 'error',\n genericEffectServices: 'warning',\n globalConsole: 'warning',\n globalConsoleInEffect: 'warning',\n globalDate: 'warning',\n globalDateInEffect: 'warning',\n globalErrorInEffectCatch: 'warning',\n globalErrorInEffectFailure: 'warning',\n globalFetch: 'warning',\n globalFetchInEffect: 'warning',\n globalRandom: 'warning',\n globalRandomInEffect: 'warning',\n globalTimers: 'warning',\n globalTimersInEffect: 'warning',\n instanceOfSchema: 'warning',\n layerMergeAllWithDependencies: 'warning',\n lazyEffect: 'suggestion',\n lazyPromiseInEffectSync: 'warning',\n leakingRequirements: 'suggestion',\n missedPipeableOpportunity: 'warning',\n missingEffectContext: 'error',\n missingEffectError: 'error',\n missingLayerContext: 'error',\n missingReturnYieldStar: 'error',\n missingStarInYieldEffectGen: 'error',\n multipleCatchTag: 'suggestion',\n multipleEffectProvide: 'warning',\n nestedEffectGenYield: 'warning',\n newPromise: 'warning',\n newSchemaClass: 'warning',\n nodeBuiltinImport: 'warning',\n outdatedApi: 'warning',\n overriddenSchemaConstructor: 'error',\n preferSchemaOverJson: 'warning',\n processEnv: 'warning',\n processEnvInEffect: 'warning',\n redundantMapError: 'suggestion',\n redundantOrDie: 'suggestion',\n redundantSchemaTagIdentifier: 'suggestion',\n returnEffectInGen: 'suggestion',\n runEffectInsideEffect: 'suggestion',\n schemaNumber: 'suggestion',\n schemaStructWithTag: 'suggestion',\n serviceNotAsClass: 'warning',\n strictBooleanExpressions: 'warning',\n strictEffectProvide: 'warning',\n tryCatchInEffectGen: 'suggestion',\n unknownInEffectCatch: 'warning',\n unnecessaryArrowBlock: 'warning',\n unnecessaryEffectGen: 'suggestion',\n unnecessaryFailYieldableError: 'suggestion',\n unnecessaryPipe: 'suggestion',\n unnecessaryPipeChain: 'suggestion',\n unnecessaryTypeofType: 'suggestion',\n unsafeEffectTypeAssertion: 'warning',\n} as const satisfies Readonly<Record<string, TsgoDiagnosticSeverity>>\n\nexport const strictDiagnosticGate = {\n includeSuggestionsInTsc: true,\n ignoreEffectSuggestionsInTscExitCode: false,\n ignoreEffectWarningsInTscExitCode: false,\n ignoreEffectErrorsInTscExitCode: false,\n} as const\n\nexport const strictLanguageServicePlugin = {\n name: '@effect/language-service',\n diagnostics: true,\n ...strictDiagnosticGate,\n diagnosticSeverity: strictDiagnosticSeverity,\n barrelImportPackages: ['effect'],\n topLevelNamedReexports: 'follow',\n effectFn: ['span'],\n keyPatterns: [\n {\n target: 'service',\n pattern: 'default',\n skipLeadingPath: ['src/'],\n },\n {\n target: 'error',\n pattern: 'default',\n skipLeadingPath: ['src/'],\n },\n {\n target: 'custom',\n pattern: 'default',\n skipLeadingPath: ['src/'],\n },\n ],\n extendedKeyDetection: true,\n layerGraphFollowDepth: 1,\n noExternal: true,\n inlays: true,\n allowedDuplicatedPackages: [],\n pipeableMinArgCount: 2,\n} as const\n\nexport const requiredTsgoPolicyKeywords = [\n 'POLICY_NATIVE_BACKEND',\n 'POLICY_DIAGNOSTIC_GATE',\n 'POLICY_RULE_MAP',\n 'POLICY_IMPORT_STYLE',\n 'POLICY_OVERRIDES',\n 'POLICY_SUPPRESSIONS',\n 'POLICY_KEY_PATTERNS',\n 'POLICY_LAYER_GRAPH',\n 'POLICY_UPGRADE_LOOP',\n 'VERIFIER_CONTRACT',\n] as const\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProviderDiscovery, ProviderDiscoveryFailure, ProviderDiscoveryFailureInput } from './harness/ProviderDiscovery.ts';
|
|
2
|
+
import { classifyProviderDiscoveryFailure, discoverProvider, resolvePackageArtifactRoot } from './harness/ProviderDiscovery.ts';
|
|
3
|
+
export type { ProviderDiscovery, ProviderDiscoveryFailure, ProviderDiscoveryFailureInput, };
|
|
4
|
+
export { classifyProviderDiscoveryFailure, discoverProvider, resolvePackageArtifactRoot, };
|
|
5
|
+
export interface DiscoverProviderArtifactOptions {
|
|
6
|
+
readonly artifactRoot?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function discoverProviderArtifact(options?: DiscoverProviderArtifactOptions): Promise<ProviderDiscovery>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import * as NodeServices from '@effect/platform-node/NodeServices';
|
|
3
|
+
import { Effect, Layer } from 'effect';
|
|
4
|
+
import { classifyProviderDiscoveryFailure, discoverProvider, resolvePackageArtifactRoot, } from "./harness/ProviderDiscovery.js";
|
|
5
|
+
export { classifyProviderDiscoveryFailure, discoverProvider, resolvePackageArtifactRoot, };
|
|
6
|
+
export function discoverProviderArtifact(options = {}) {
|
|
7
|
+
const artifactRoot = options.artifactRoot ?? resolvePackageArtifactRoot(fileURLToPath(import.meta.url));
|
|
8
|
+
return runWithNodeServices(discoverProvider(artifactRoot));
|
|
9
|
+
}
|
|
10
|
+
function runWithNodeServices(effect) {
|
|
11
|
+
return Effect.runPromise(Effect.scoped(Effect.gen(function* () {
|
|
12
|
+
const context = yield* Layer.build(NodeServices.layer);
|
|
13
|
+
return yield* Effect.promise(() => Effect.runPromiseWith(context)(effect));
|
|
14
|
+
})));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,YAAY,MAAM,oCAAoC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EACL,gCAAgC,EAChC,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAA;AAQvC,OAAO,EACL,gCAAgC,EAChC,gBAAgB,EAChB,0BAA0B,GAC3B,CAAA;AAMD,MAAM,UAAU,wBAAwB,CACtC,UAA2C,EAAE;IAE7C,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,0BAA0B,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IACvG,OAAO,mBAAmB,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAA;AAC5D,CAAC;AAED,SAAS,mBAAmB,CAC1B,MAAsD;IAEtD,OAAO,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACzD,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QACtD,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5E,CAAC,CAAC,CAAC,CAAC,CAAA;AACN,CAAC","sourcesContent":["import type {\n ProviderDiscovery,\n ProviderDiscoveryFailure,\n ProviderDiscoveryFailureInput,\n} from './harness/ProviderDiscovery.ts'\nimport { fileURLToPath } from 'node:url'\nimport * as NodeServices from '@effect/platform-node/NodeServices'\nimport { Effect, Layer } from 'effect'\nimport {\n classifyProviderDiscoveryFailure,\n discoverProvider,\n resolvePackageArtifactRoot,\n} from './harness/ProviderDiscovery.ts'\n\nexport type {\n ProviderDiscovery,\n ProviderDiscoveryFailure,\n ProviderDiscoveryFailureInput,\n}\n\nexport {\n classifyProviderDiscoveryFailure,\n discoverProvider,\n resolvePackageArtifactRoot,\n}\n\nexport interface DiscoverProviderArtifactOptions {\n readonly artifactRoot?: string\n}\n\nexport function discoverProviderArtifact(\n options: DiscoverProviderArtifactOptions = {},\n): Promise<ProviderDiscovery> {\n const artifactRoot = options.artifactRoot ?? resolvePackageArtifactRoot(fileURLToPath(import.meta.url))\n return runWithNodeServices(discoverProvider(artifactRoot))\n}\n\nfunction runWithNodeServices<A, E>(\n effect: Effect.Effect<A, E, NodeServices.NodeServices>,\n): Promise<A> {\n return Effect.runPromise(Effect.scoped(Effect.gen(function* () {\n const context = yield* Layer.build(NodeServices.layer)\n return yield* Effect.promise(() => Effect.runPromiseWith(context)(effect))\n })))\n}\n"]}
|
|
@@ -59,7 +59,7 @@ ESLint 是 lint stage 的入口。它只负责不需要 tsgo 类型语义、但
|
|
|
59
59
|
|
|
60
60
|
- import boundary:应用代码和测试代码不能从 `repos/effect` 或 `repos/tsgo` import。
|
|
61
61
|
- package baseline:不使用 `@effect/cli`,CLI 代码使用 `effect/unstable/cli`。
|
|
62
|
-
- test entry:本仓测试使用 `@effect/vitest`,不使用 `node:test`
|
|
62
|
+
- test entry:本仓测试使用 `@effect/vitest`,不使用 `node:test` 或从 `vitest` 导入普通测试入口。
|
|
63
63
|
- harness baseline:当前 service definition baseline 不新增 `Context.Tag` service definition。
|
|
64
64
|
- syntax-level bans:只有当 tsgo 没有对应 rule,且规则是本仓制度时才放进 ESLint。例如
|
|
65
65
|
`{ disableValidation: true }` 禁令属于 lint 层。
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sayoriqwq/effect-harness",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public",
|
|
@@ -13,7 +13,14 @@
|
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "https://github.com/sayoriqwq/effect-harness"
|
|
15
15
|
},
|
|
16
|
-
"
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/src/index.d.ts",
|
|
19
|
+
"import": "./dist/src/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"main": "dist/src/index.js",
|
|
23
|
+
"types": "dist/src/index.d.ts",
|
|
17
24
|
"bin": {
|
|
18
25
|
"effect-harness": "dist/bin/effect-harness.js"
|
|
19
26
|
},
|
|
@@ -19,6 +19,8 @@ updated: 2026-07-02
|
|
|
19
19
|
Prelude SHOULD 通过 package artifact 执行 discovery,而不是复制
|
|
20
20
|
`provider/effect-harness.provider.json` 到 Prelude 源码中维护。
|
|
21
21
|
|
|
22
|
+
边界口径是:npm selects the artifact,effect-harness owns desired semantics,Prelude projects the artifact,target repositories are mutated only by Prelude lifecycle commands。
|
|
23
|
+
|
|
22
24
|
稳定入口是:
|
|
23
25
|
|
|
24
26
|
```bash
|
|
@@ -31,9 +33,29 @@ npx --yes @sayoriqwq/effect-harness provider-discover
|
|
|
31
33
|
node bin/effect-harness.ts provider-discover --harness .
|
|
32
34
|
```
|
|
33
35
|
|
|
36
|
+
public programmatic API 暴露同一套 discovery contract:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { discoverProviderArtifact } from '@sayoriqwq/effect-harness'
|
|
40
|
+
|
|
41
|
+
const discovery = await discoverProviderArtifact()
|
|
42
|
+
```
|
|
43
|
+
|
|
34
44
|
discovery 输出是 machine-readable JSON。它从 provider profile 和 package manifest 派生,不是第二份
|
|
35
45
|
profile 真源。
|
|
36
46
|
|
|
47
|
+
## Failure Classification
|
|
48
|
+
|
|
49
|
+
`provider-discover` 启动后产生的 profile、docs、snippets 或 artifact-only reference 错误属于
|
|
50
|
+
provider discovery failure。
|
|
51
|
+
|
|
52
|
+
npm、npx 或 shell 在启动 `effect-harness` binary 前失败,属于 npm invocation failure。
|
|
53
|
+
|
|
54
|
+
已知特殊情况:在 effect-harness provider repository 根目录下运行同名同版本
|
|
55
|
+
`npx @sayoriqwq/effect-harness@... provider-discover`,可能因为 npm same-name cwd short-circuit 报
|
|
56
|
+
`sh: effect-harness: command not found`。这不是 provider discovery failure;应从 neutral working
|
|
57
|
+
directory 执行,或使用 `--package`/`--prefix` 让 npm 明确选择 package artifact。
|
|
58
|
+
|
|
37
59
|
## Shape
|
|
38
60
|
|
|
39
61
|
discovery envelope MUST 暴露 provider identity:
|
|
@@ -52,6 +74,8 @@ discovery envelope MUST 暴露 package locator:
|
|
|
52
74
|
- provider profile path
|
|
53
75
|
- package files
|
|
54
76
|
- discovery command
|
|
77
|
+
- package artifact identity
|
|
78
|
+
- npm invocation failure classification
|
|
55
79
|
|
|
56
80
|
discovery envelope MUST 暴露 target-managed surfaces:
|
|
57
81
|
|
|
@@ -76,6 +100,8 @@ discovery envelope MUST 暴露 artifact-only references:
|
|
|
76
100
|
- tsgo anchor doc identity
|
|
77
101
|
- tsgo route doc identity
|
|
78
102
|
|
|
103
|
+
discovery envelope MUST audit artifact-only references against the selected package artifact root。
|
|
104
|
+
|
|
79
105
|
discovery envelope MUST 暴露 internal harness surfaces,使 Prelude 能明确这些内容只服务
|
|
80
106
|
effect-harness 本仓维护和 self-conformance。
|
|
81
107
|
|
|
@@ -19,10 +19,14 @@ target 的 runtime dependencies MUST 包含 `effect` 和 `@effect/platform-node`
|
|
|
19
19
|
|
|
20
20
|
target 的 Effect testing dependency MUST 包含 `@effect/vitest`。
|
|
21
21
|
|
|
22
|
+
target 的 test runner dependency MUST 包含 `vitest`。
|
|
23
|
+
|
|
22
24
|
target 的 diagnostics dependencies MUST 包含 `@effect/tsgo` 和 `@effect/language-service`。
|
|
23
25
|
|
|
24
26
|
target 的 native backend dependency MUST 包含 `@typescript/native-preview`。
|
|
25
27
|
|
|
28
|
+
target 的 lint dependencies MUST 包含 `eslint` 和 `@antfu/eslint-config`。
|
|
29
|
+
|
|
26
30
|
版本基线由 provider profile 管理。target 不应该用局部版本覆盖降低 Effect v4 beta、tsgo 或
|
|
27
31
|
language-service baseline。
|
|
28
32
|
|
|
@@ -40,6 +44,18 @@ target 的 primary diagnostics script SHOULD 指向:
|
|
|
40
44
|
tsgo --noEmit
|
|
41
45
|
```
|
|
42
46
|
|
|
47
|
+
target 的 test script SHOULD 指向:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
vitest run
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
target 的 lint script SHOULD 指向:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
eslint
|
|
57
|
+
```
|
|
58
|
+
|
|
43
59
|
这些 script 是 provider-managed 指针。Prelude materialization 和 maintain 应按 provider record
|
|
44
60
|
判断本地 drift。
|
|
45
61
|
|
|
@@ -19,9 +19,15 @@ updated: 2026-07-02
|
|
|
19
19
|
|
|
20
20
|
lint policy 负责 repository boundary 和 syntax-level guardrails。
|
|
21
21
|
|
|
22
|
-
lint
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
target 的 lint entry 由 provider package contribution 暴露为 `pnpm lint`,底层脚本是 `eslint`。
|
|
23
|
+
需要 hard gate 时,verification policy 使用 `pnpm lint --max-warnings 0`。
|
|
24
|
+
|
|
25
|
+
lint policy SHOULD block provider-internal source imports、`@effect/cli` imports、`node:test` imports、
|
|
26
|
+
从 `vitest` 导入测试入口(`describe`、`it`、`test`)、`Context.Tag` service definitions、指定 Effect
|
|
27
|
+
member,以及关闭 Schema validation 的写法。
|
|
28
|
+
|
|
29
|
+
lint policy SHOULD allow Vitest mock/lifecycle API(例如 `vi`、`beforeEach`)直接从 `vitest` 导入,因为
|
|
30
|
+
Vitest 的 mock transformer 依赖直接导入。
|
|
25
31
|
|
|
26
32
|
lint policy MUST NOT 替代 tsgo diagnostics。Effect semantic diagnostics、type requirement diagnostics 和
|
|
27
33
|
strict rule severity map 由 tsgo policy 负责。
|
|
@@ -30,6 +36,9 @@ strict rule severity map 由 tsgo policy 负责。
|
|
|
30
36
|
|
|
31
37
|
test policy 使用 `@effect/vitest`。
|
|
32
38
|
|
|
39
|
+
target 的 test entry 由 provider package contribution 暴露为 `pnpm test`,底层脚本是
|
|
40
|
+
`vitest run`。
|
|
41
|
+
|
|
33
42
|
Effect tests SHOULD 使用 `it.effect`、`it.live` 或 layer 组织。
|
|
34
43
|
|
|
35
44
|
target SHOULD 保留 provider record 中声明的 test entry pattern,并通过 package script 执行测试。
|
|
@@ -41,7 +50,8 @@ target SHOULD 保留 provider record 中声明的 test entry pattern,并通过
|
|
|
41
50
|
verification policy 描述 local diagnostic commands 和 stage semantics,但不实现 Prelude target lifecycle。
|
|
42
51
|
|
|
43
52
|
Prelude 仍负责 target materialization、provider record maintain、drift handling 和 target-level verify
|
|
44
|
-
orchestration。
|
|
53
|
+
orchestration。target 的总 `pnpm verify` MAY include build、knip 或 release gates;effect-harness
|
|
54
|
+
必须至少把 `pnpm typecheck`、`pnpm test` 和 `pnpm lint --max-warnings 0` 组合进 target verify。
|
|
45
55
|
|
|
46
56
|
## Stages
|
|
47
57
|
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"mode": "provider-artifact-reference",
|
|
45
45
|
"targetDelivery": "identity-only",
|
|
46
46
|
"packageSurface": [
|
|
47
|
+
"dist",
|
|
47
48
|
"provider",
|
|
48
49
|
"harness",
|
|
49
50
|
"repos",
|
|
@@ -120,8 +121,8 @@
|
|
|
120
121
|
"format": "github-subtree"
|
|
121
122
|
},
|
|
122
123
|
"commands": {
|
|
123
|
-
"update": "partita pin update --contract repos/effect.subtree.json --name effect --prefix repos/effect --dry-run",
|
|
124
|
-
"verify": "partita pin verify --contract repos/effect.subtree.json --name effect --prefix repos/effect"
|
|
124
|
+
"update": "npx --yes @sayoriqwq/partita pin update --contract repos/effect.subtree.json --name effect --prefix repos/effect --dry-run",
|
|
125
|
+
"verify": "npx --yes @sayoriqwq/partita pin verify --contract repos/effect.subtree.json --name effect --prefix repos/effect"
|
|
125
126
|
},
|
|
126
127
|
"importBoundary": {
|
|
127
128
|
"applicationImportsForbidden": true,
|
|
@@ -140,8 +141,8 @@
|
|
|
140
141
|
"format": "github-subtree"
|
|
141
142
|
},
|
|
142
143
|
"commands": {
|
|
143
|
-
"update": "partita pin update --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo --dry-run",
|
|
144
|
-
"verify": "partita pin verify --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo"
|
|
144
|
+
"update": "npx --yes @sayoriqwq/partita pin update --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo --dry-run",
|
|
145
|
+
"verify": "npx --yes @sayoriqwq/partita pin verify --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo"
|
|
145
146
|
},
|
|
146
147
|
"importBoundary": {
|
|
147
148
|
"applicationImportsForbidden": true,
|
|
@@ -221,7 +222,10 @@
|
|
|
221
222
|
"@effect/vitest": "4.0.0-beta.92",
|
|
222
223
|
"@effect/tsgo": "0.15.0",
|
|
223
224
|
"@effect/language-service": "0.86.2",
|
|
224
|
-
"@typescript/native-preview": "7.0.0-dev.20260630.1"
|
|
225
|
+
"@typescript/native-preview": "7.0.0-dev.20260630.1",
|
|
226
|
+
"@antfu/eslint-config": "^9.0.0",
|
|
227
|
+
"eslint": "^10.3.0",
|
|
228
|
+
"vitest": "^4.1.8"
|
|
225
229
|
},
|
|
226
230
|
"managedSurfaces": {
|
|
227
231
|
"targetReceives": [
|
|
@@ -229,6 +233,8 @@
|
|
|
229
233
|
"package.json dependency and devDependency structured pointers",
|
|
230
234
|
"tsconfig.json @effect/language-service plugin structured pointer",
|
|
231
235
|
"editor policy structured pointer for target editor settings",
|
|
236
|
+
"eslint package baseline and lint script structured pointers",
|
|
237
|
+
"test package baseline and test script structured pointers",
|
|
232
238
|
"lint, test, and verification policy records",
|
|
233
239
|
"provider-managed docs bundle at .prelude/providers/effect-harness/docs",
|
|
234
240
|
"provider-managed snippets at .prelude/providers/effect-harness/snippets"
|
|
@@ -264,7 +270,8 @@
|
|
|
264
270
|
"testing": {
|
|
265
271
|
"field": "devDependencies",
|
|
266
272
|
"packages": {
|
|
267
|
-
"@effect/vitest": "4.0.0-beta.92"
|
|
273
|
+
"@effect/vitest": "4.0.0-beta.92",
|
|
274
|
+
"vitest": "^4.1.8"
|
|
268
275
|
}
|
|
269
276
|
},
|
|
270
277
|
"diagnostics": {
|
|
@@ -279,6 +286,13 @@
|
|
|
279
286
|
"packages": {
|
|
280
287
|
"@typescript/native-preview": "7.0.0-dev.20260630.1"
|
|
281
288
|
}
|
|
289
|
+
},
|
|
290
|
+
"linting": {
|
|
291
|
+
"field": "devDependencies",
|
|
292
|
+
"packages": {
|
|
293
|
+
"@antfu/eslint-config": "^9.0.0",
|
|
294
|
+
"eslint": "^10.3.0"
|
|
295
|
+
}
|
|
282
296
|
}
|
|
283
297
|
},
|
|
284
298
|
"scripts": {
|
|
@@ -289,6 +303,14 @@
|
|
|
289
303
|
"typecheck": {
|
|
290
304
|
"semantic": "primary Effect diagnostics",
|
|
291
305
|
"defaultCommand": "tsgo --noEmit"
|
|
306
|
+
},
|
|
307
|
+
"test": {
|
|
308
|
+
"semantic": "run Effect tests",
|
|
309
|
+
"defaultCommand": "vitest run"
|
|
310
|
+
},
|
|
311
|
+
"lint": {
|
|
312
|
+
"semantic": "run ESLint guardrails",
|
|
313
|
+
"defaultCommand": "eslint"
|
|
292
314
|
}
|
|
293
315
|
}
|
|
294
316
|
},
|
|
@@ -573,12 +595,23 @@
|
|
|
573
595
|
"rules": {
|
|
574
596
|
"restrictedImports": [
|
|
575
597
|
"node:test",
|
|
576
|
-
"vitest",
|
|
577
598
|
"@effect/cli",
|
|
578
599
|
"@effect/cli/*",
|
|
579
600
|
"repos/effect/**",
|
|
580
601
|
"repos/tsgo/**"
|
|
581
602
|
],
|
|
603
|
+
"restrictedVitestImports": [
|
|
604
|
+
"describe",
|
|
605
|
+
"it",
|
|
606
|
+
"test"
|
|
607
|
+
],
|
|
608
|
+
"allowedVitestImports": [
|
|
609
|
+
"vi",
|
|
610
|
+
"beforeEach",
|
|
611
|
+
"afterEach",
|
|
612
|
+
"beforeAll",
|
|
613
|
+
"afterAll"
|
|
614
|
+
],
|
|
582
615
|
"restrictedSyntax": [
|
|
583
616
|
"Context.Tag",
|
|
584
617
|
"Effect.catchAllCause",
|
|
@@ -598,10 +631,10 @@
|
|
|
598
631
|
"mode": "command-policy",
|
|
599
632
|
"stage": "tests",
|
|
600
633
|
"command": "pnpm test",
|
|
601
|
-
"packageScript": "vitest run
|
|
634
|
+
"packageScript": "vitest run",
|
|
602
635
|
"framework": "@effect/vitest",
|
|
603
636
|
"expectedEntries": [
|
|
604
|
-
"tests
|
|
637
|
+
"tests/**/*.test.ts"
|
|
605
638
|
],
|
|
606
639
|
"effectEntrypoints": [
|
|
607
640
|
"it.effect",
|
|
@@ -609,8 +642,12 @@
|
|
|
609
642
|
"layer"
|
|
610
643
|
],
|
|
611
644
|
"disallowedImports": [
|
|
612
|
-
"node:test"
|
|
613
|
-
|
|
645
|
+
"node:test"
|
|
646
|
+
],
|
|
647
|
+
"disallowedVitestImports": [
|
|
648
|
+
"describe",
|
|
649
|
+
"it",
|
|
650
|
+
"test"
|
|
614
651
|
]
|
|
615
652
|
},
|
|
616
653
|
"verificationPolicy": {
|
package/provider/index.md
CHANGED
|
@@ -77,8 +77,11 @@ provider 当前暴露以下能力:
|
|
|
77
77
|
| Effect testing baseline | `contributions.packageJson.dependencyGroups.testing` | `package.json` devDependencies |
|
|
78
78
|
| Effect diagnostics packages | `contributions.packageJson.dependencyGroups.diagnostics` | `package.json` devDependencies |
|
|
79
79
|
| Native tsgo backend package | `contributions.packageJson.dependencyGroups.nativeBackend` | `package.json` devDependencies |
|
|
80
|
+
| ESLint baseline | `contributions.packageJson.dependencyGroups.linting` | `package.json` devDependencies |
|
|
80
81
|
| Effect diagnostics | `contributions.packageJson.scripts.typecheck` | `tsgo --noEmit` |
|
|
81
82
|
| Native tsgo backend setup | `contributions.packageJson.scripts.prepare` | `effect-tsgo patch` |
|
|
83
|
+
| Effect tests | `contributions.packageJson.scripts.test` | `vitest run` |
|
|
84
|
+
| ESLint guardrail entry | `contributions.packageJson.scripts.lint` | `eslint` |
|
|
82
85
|
| Strict language-service policy | `contributions.tsconfig.compilerOptions.plugins[]` | `tsconfig.json` plugin |
|
|
83
86
|
| Strict tsgo execution policy | `contributions.tsconfig.tsgo` | `tsconfig.json` projection and package scripts |
|
|
84
87
|
| Editor policy | `contributions.editorPolicy` | editor settings projection |
|
|
@@ -103,6 +106,7 @@ Target 应该接收:
|
|
|
103
106
|
- `package.json` dependencies and scripts
|
|
104
107
|
- `tsconfig.json` strict language-service plugin
|
|
105
108
|
- editor settings projection
|
|
109
|
+
- ESLint package baseline and guardrail config projection
|
|
106
110
|
- lint/test/verification policy records
|
|
107
111
|
- `.prelude/providers/effect-harness/provider.json` provider record
|
|
108
112
|
- `.prelude/providers/effect-harness/docs/**` docs bundle
|
|
@@ -145,6 +149,10 @@ maintain 规则处理。
|
|
|
145
149
|
Prelude SHOULD 通过 `npx --yes @sayoriqwq/effect-harness provider-discover` 读取 provider discovery
|
|
146
150
|
envelope。
|
|
147
151
|
|
|
152
|
+
package-backed discovery 的职责边界是:npm selects the artifact,effect-harness owns desired
|
|
153
|
+
semantics,Prelude projects the artifact,target repositories are mutated only by Prelude lifecycle
|
|
154
|
+
commands。
|
|
155
|
+
|
|
148
156
|
discovery envelope 暴露 provider identity、artifact root、package locator、target-managed surfaces、
|
|
149
157
|
artifact-only references、source identity 和 internal harness surfaces。
|
|
150
158
|
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"llmDocument": "repos/effect/LLMS.md"
|
|
19
19
|
},
|
|
20
20
|
"commands": {
|
|
21
|
-
"update": "partita pin update --contract repos/effect.subtree.json --name effect --prefix repos/effect --dry-run",
|
|
22
|
-
"verify": "partita pin verify --contract repos/effect.subtree.json --name effect --prefix repos/effect"
|
|
21
|
+
"update": "npx --yes @sayoriqwq/partita pin update --contract repos/effect.subtree.json --name effect --prefix repos/effect --dry-run",
|
|
22
|
+
"verify": "npx --yes @sayoriqwq/partita pin verify --contract repos/effect.subtree.json --name effect --prefix repos/effect"
|
|
23
23
|
},
|
|
24
24
|
"agent": {
|
|
25
25
|
"route": "harness/effect-routes.md"
|
package/repos/tsgo.subtree.json
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"llmDocument": "repos/tsgo/README.md"
|
|
19
19
|
},
|
|
20
20
|
"commands": {
|
|
21
|
-
"update": "partita pin update --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo --dry-run",
|
|
22
|
-
"verify": "partita pin verify --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo"
|
|
21
|
+
"update": "npx --yes @sayoriqwq/partita pin update --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo --dry-run",
|
|
22
|
+
"verify": "npx --yes @sayoriqwq/partita pin verify --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo"
|
|
23
23
|
},
|
|
24
24
|
"agent": {
|
|
25
25
|
"route": "harness/tsgo-routes.md"
|