@sayoriqwq/effect-harness 0.0.4 → 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.
@@ -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"]}
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",
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
- "main": "dist/bin/effect-harness.js",
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
 
@@ -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,
package/provider/index.md CHANGED
@@ -149,6 +149,10 @@ maintain 规则处理。
149
149
  Prelude SHOULD 通过 `npx --yes @sayoriqwq/effect-harness provider-discover` 读取 provider discovery
150
150
  envelope。
151
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
+
152
156
  discovery envelope 暴露 provider identity、artifact root、package locator、target-managed surfaces、
153
157
  artifact-only references、source identity 和 internal harness surfaces。
154
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"
@@ -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"