niceeval 0.16.3-canary.99 → 0.17.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.
Files changed (258) hide show
  1. package/dist/cli/bootstrap.cjs +7 -1
  2. package/dist/cli/bootstrap.cjs.map +1 -1
  3. package/dist/cli/project-configuration.cjs +8 -11
  4. package/dist/cli/project-configuration.cjs.map +1 -1
  5. package/dist/expect/index.cjs.map +1 -1
  6. package/dist/expect/index.d.cts +1 -0
  7. package/dist/expect/index.d.mts +1 -0
  8. package/dist/expect/index.d.ts +1 -0
  9. package/dist/experiment/host/cli/contribution.cjs +6 -11
  10. package/dist/experiment/host/cli/contribution.cjs.map +1 -1
  11. package/dist/experiment/host/cli/contribution.d.cts +0 -16
  12. package/dist/experiment/host/cli/contribution.d.mts +0 -16
  13. package/dist/experiment/host/cli/contribution.d.ts +0 -16
  14. package/dist/experiment/host/operations.cjs +3 -3
  15. package/dist/experiment/host/operations.cjs.map +1 -1
  16. package/dist/experiment/host/types.cjs.map +1 -1
  17. package/dist/experiment/host/types.d.cts +0 -4
  18. package/dist/experiment/host/types.d.mts +0 -4
  19. package/dist/experiment/host/types.d.ts +0 -4
  20. package/dist/fresh-import.cjs +2 -2
  21. package/dist/fresh-import.cjs.map +1 -1
  22. package/dist/fresh-import.d.cts +3 -3
  23. package/dist/fresh-import.d.mts +3 -3
  24. package/dist/fresh-import.d.ts +3 -3
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +1 -0
  27. package/dist/index.d.mts +1 -0
  28. package/dist/index.d.ts +1 -0
  29. package/dist/inspection/codec.cjs.map +1 -1
  30. package/dist/inspection/codec.d.cts +1 -1
  31. package/dist/inspection/codec.d.mts +1 -1
  32. package/dist/inspection/codec.d.ts +1 -1
  33. package/dist/inspection/facts.cjs +66 -9
  34. package/dist/inspection/facts.cjs.map +1 -1
  35. package/dist/inspection/facts.d.cts +4 -0
  36. package/dist/inspection/facts.d.mts +4 -0
  37. package/dist/inspection/facts.d.ts +4 -0
  38. package/dist/inspection/facts.js +4 -2
  39. package/dist/inspection/index.cjs +1 -3
  40. package/dist/inspection/index.cjs.map +1 -1
  41. package/dist/inspection/index.d.cts +1 -1
  42. package/dist/inspection/index.d.mts +1 -1
  43. package/dist/inspection/index.d.ts +1 -1
  44. package/dist/inspection/index.js +44 -48
  45. package/dist/inspection/limits.cjs +3 -1
  46. package/dist/inspection/limits.cjs.map +1 -1
  47. package/dist/inspection/limits.d.cts +2 -0
  48. package/dist/inspection/limits.d.mts +2 -0
  49. package/dist/inspection/limits.d.ts +2 -0
  50. package/dist/inspection/limits.js +6 -4
  51. package/dist/inspection/project-source.cjs +4 -1
  52. package/dist/inspection/project-source.cjs.map +1 -1
  53. package/dist/inspection/protocol.cjs +10 -18
  54. package/dist/inspection/protocol.cjs.map +1 -1
  55. package/dist/inspection/protocol.d.cts +111 -173
  56. package/dist/inspection/protocol.d.mts +111 -173
  57. package/dist/inspection/protocol.d.ts +111 -173
  58. package/dist/inspection/public.mjs +73 -109
  59. package/dist/inspection/results.cjs +12 -48
  60. package/dist/inspection/results.cjs.map +1 -1
  61. package/dist/inspection/results.d.cts +124 -122
  62. package/dist/inspection/results.d.mts +124 -122
  63. package/dist/inspection/results.d.ts +124 -122
  64. package/dist/inspection/results.js +16 -20
  65. package/dist/inspection/select.cjs +80 -117
  66. package/dist/inspection/select.cjs.map +1 -1
  67. package/dist/inspection/source.cjs +14 -15
  68. package/dist/inspection/source.cjs.map +1 -1
  69. package/dist/inspection/source.d.cts +6 -3
  70. package/dist/inspection/source.d.mts +6 -3
  71. package/dist/inspection/source.d.ts +6 -3
  72. package/dist/inspection/trace.cjs +1 -1
  73. package/dist/inspection/trace.cjs.map +1 -1
  74. package/dist/load-config.cjs +17 -11
  75. package/dist/load-config.cjs.map +1 -1
  76. package/dist/load-config.d.cts +3 -2
  77. package/dist/load-config.d.mts +3 -2
  78. package/dist/load-config.d.ts +3 -2
  79. package/dist/o11y/adapter-usage-projection.cjs +5 -1
  80. package/dist/o11y/adapter-usage-projection.cjs.map +1 -1
  81. package/dist/o11y/adapter-usage-projection.d.cts +109 -1
  82. package/dist/o11y/adapter-usage-projection.d.mts +109 -1
  83. package/dist/o11y/adapter-usage-projection.d.ts +109 -1
  84. package/dist/o11y/cache-read.cjs +113 -0
  85. package/dist/o11y/cache-read.cjs.map +1 -0
  86. package/dist/o11y/cache-read.d.cts +80 -0
  87. package/dist/o11y/cache-read.d.mts +80 -0
  88. package/dist/o11y/cache-read.d.ts +80 -0
  89. package/dist/o11y/cache-read.js +8 -0
  90. package/dist/o11y/cache-read.js.map +1 -0
  91. package/dist/o11y/eval-usage.cjs +4 -1
  92. package/dist/o11y/eval-usage.cjs.map +1 -1
  93. package/dist/o11y/eval-usage.d.cts +4 -1
  94. package/dist/o11y/eval-usage.d.mts +4 -1
  95. package/dist/o11y/eval-usage.d.ts +4 -1
  96. package/dist/record/host/sqlite-host.cjs +188 -53
  97. package/dist/record/host/sqlite-host.cjs.map +1 -1
  98. package/dist/record/host/sqlite-host.d.cts +37 -1
  99. package/dist/record/host/sqlite-host.d.mts +37 -1
  100. package/dist/record/host/sqlite-host.d.ts +37 -1
  101. package/dist/record/host/sqlite-host.js +16 -8
  102. package/dist/record/maintenance/runtime.cjs +3 -3
  103. package/dist/record/maintenance/runtime.cjs.map +1 -1
  104. package/dist/record/sqlite/admission-repository.cjs +18 -18
  105. package/dist/record/sqlite/admission-repository.cjs.map +1 -1
  106. package/dist/record/sqlite/case-repository.cjs +6 -6
  107. package/dist/record/sqlite/case-repository.cjs.map +1 -1
  108. package/dist/record/sqlite/coordination-repository.cjs +25 -25
  109. package/dist/record/sqlite/coordination-repository.cjs.map +1 -1
  110. package/dist/record/sqlite/current-schema.cjs +115 -111
  111. package/dist/record/sqlite/current-schema.cjs.map +1 -1
  112. package/dist/record/sqlite/current-schema.d.cts +3 -3
  113. package/dist/record/sqlite/current-schema.d.mts +3 -3
  114. package/dist/record/sqlite/current-schema.d.ts +3 -3
  115. package/dist/record/sqlite/database.cjs +56 -53
  116. package/dist/record/sqlite/database.cjs.map +1 -1
  117. package/dist/record/sqlite/index.cjs +3 -1
  118. package/dist/record/sqlite/index.cjs.map +1 -1
  119. package/dist/record/sqlite/index.d.cts +5 -2
  120. package/dist/record/sqlite/index.d.mts +5 -2
  121. package/dist/record/sqlite/index.d.ts +5 -2
  122. package/dist/record/sqlite/legacy-schema-018.cjs +443 -0
  123. package/dist/record/sqlite/legacy-schema-018.cjs.map +1 -0
  124. package/dist/record/sqlite/legacy-schema-018.d.cts +6 -0
  125. package/dist/record/sqlite/legacy-schema-018.d.mts +6 -0
  126. package/dist/record/sqlite/legacy-schema-018.d.ts +6 -0
  127. package/dist/record/sqlite/legacy-schema-018.js +6 -0
  128. package/dist/record/sqlite/legacy-schema-018.js.map +1 -0
  129. package/dist/record/sqlite/migration.cjs +105 -46
  130. package/dist/record/sqlite/migration.cjs.map +1 -1
  131. package/dist/record/sqlite/migration.d.cts +2 -1
  132. package/dist/record/sqlite/migration.d.mts +2 -1
  133. package/dist/record/sqlite/migration.d.ts +2 -1
  134. package/dist/record/sqlite/portable-capture.cjs +13 -13
  135. package/dist/record/sqlite/portable-capture.cjs.map +1 -1
  136. package/dist/record/sqlite/registry-repository.cjs +22 -22
  137. package/dist/record/sqlite/registry-repository.cjs.map +1 -1
  138. package/dist/record/sqlite/schema.cjs +10 -2
  139. package/dist/record/sqlite/schema.cjs.map +1 -1
  140. package/dist/record/sqlite/schema.d.cts +4 -1
  141. package/dist/record/sqlite/schema.d.mts +4 -1
  142. package/dist/record/sqlite/schema.d.ts +4 -1
  143. package/dist/record/sqlite/schema.js +20 -14
  144. package/dist/record/sqlite/storage-worker.cjs +1 -1
  145. package/dist/record/sqlite/storage-worker.cjs.map +1 -1
  146. package/dist/record/sqlite/storage.cjs +316 -232
  147. package/dist/record/sqlite/storage.cjs.map +1 -1
  148. package/dist/record/sqlite/storage.d.cts +10 -2
  149. package/dist/record/sqlite/storage.d.mts +10 -2
  150. package/dist/record/sqlite/storage.d.ts +10 -2
  151. package/dist/record/sqlite/storage.js +54 -50
  152. package/dist/record/sqlite/types.cjs +1 -1
  153. package/dist/record/sqlite/types.cjs.map +1 -1
  154. package/dist/record/sqlite/types.d.cts +13 -1
  155. package/dist/record/sqlite/types.d.mts +13 -1
  156. package/dist/record/sqlite/types.d.ts +13 -1
  157. package/dist/run/cli/contribution.cjs +17 -12
  158. package/dist/run/cli/contribution.cjs.map +1 -1
  159. package/dist/run/host/lifecycle-adapter.cjs +1 -1
  160. package/dist/run/host/lifecycle-adapter.cjs.map +1 -1
  161. package/dist/run/storage/owner-identity.cjs +78 -16
  162. package/dist/run/storage/owner-identity.cjs.map +1 -1
  163. package/dist/run/storage/owner-identity.d.cts +2 -1
  164. package/dist/run/storage/owner-identity.d.mts +2 -1
  165. package/dist/run/storage/owner-identity.d.ts +2 -1
  166. package/dist/run/storage/sqlite.cjs +55 -55
  167. package/dist/run/storage/sqlite.cjs.map +1 -1
  168. package/dist/runner/accept.cjs +12 -42
  169. package/dist/runner/accept.cjs.map +1 -1
  170. package/dist/runner/accept.d.cts +2 -3
  171. package/dist/runner/accept.d.mts +2 -3
  172. package/dist/runner/accept.d.ts +2 -3
  173. package/dist/runner/adapter-usage.cjs +2 -2
  174. package/dist/runner/adapter-usage.cjs.map +1 -1
  175. package/dist/runner/adoption.cjs +14 -26
  176. package/dist/runner/adoption.cjs.map +1 -1
  177. package/dist/runner/adoption.d.cts +5 -13
  178. package/dist/runner/adoption.d.mts +5 -13
  179. package/dist/runner/adoption.d.ts +5 -13
  180. package/dist/runner/adoption.js +2 -4
  181. package/dist/runner/record.cjs +24 -18
  182. package/dist/runner/record.cjs.map +1 -1
  183. package/dist/runner/rename-experiment.cjs +5 -7
  184. package/dist/runner/rename-experiment.cjs.map +1 -1
  185. package/dist/runner/reuse-plan.cjs +37 -18
  186. package/dist/runner/reuse-plan.cjs.map +1 -1
  187. package/dist/runner/reuse-plan.d.cts +4 -1
  188. package/dist/runner/reuse-plan.d.mts +4 -1
  189. package/dist/runner/reuse-plan.d.ts +4 -1
  190. package/dist/runner/setup-prefix-plan.cjs +17 -12
  191. package/dist/runner/setup-prefix-plan.cjs.map +1 -1
  192. package/dist/runner/setup-prefix-plan.d.cts +0 -2
  193. package/dist/runner/setup-prefix-plan.d.mts +0 -2
  194. package/dist/runner/setup-prefix-plan.d.ts +0 -2
  195. package/dist/runner/setup-prefix-plan.js +8 -12
  196. package/dist/sandbox/backend.cjs +10 -1
  197. package/dist/sandbox/backend.cjs.map +1 -1
  198. package/dist/sandbox/backend.d.cts +16 -8
  199. package/dist/sandbox/backend.d.mts +16 -8
  200. package/dist/sandbox/backend.d.ts +16 -8
  201. package/dist/sandbox/backend.js +28 -26
  202. package/dist/sandbox/docker.cjs +7 -1
  203. package/dist/sandbox/docker.cjs.map +1 -1
  204. package/dist/sandbox/e2b-cache-repository.cjs +13 -3
  205. package/dist/sandbox/e2b-cache-repository.cjs.map +1 -1
  206. package/dist/sandbox/e2b-cache-repository.d.cts +3 -0
  207. package/dist/sandbox/e2b-cache-repository.d.mts +3 -0
  208. package/dist/sandbox/e2b-cache-repository.d.ts +3 -0
  209. package/dist/sandbox/e2b-cache-repository.js +16 -12
  210. package/dist/sandbox/e2b.cjs +2 -2
  211. package/dist/sandbox/e2b.cjs.map +1 -1
  212. package/dist/sandbox/incus/materialize.cjs +1 -1
  213. package/dist/sandbox/incus/materialize.cjs.map +1 -1
  214. package/dist/show/contribution.cjs +3 -3
  215. package/dist/show/contribution.cjs.map +1 -1
  216. package/dist/show/model.cjs +14 -13
  217. package/dist/show/model.cjs.map +1 -1
  218. package/dist/show/model.d.cts +7 -7
  219. package/dist/show/model.d.mts +7 -7
  220. package/dist/show/model.d.ts +7 -7
  221. package/dist/show/render.cjs +14 -0
  222. package/dist/show/render.cjs.map +1 -1
  223. package/dist/user-database/storage-worker.cjs +13 -3
  224. package/dist/user-database/storage-worker.cjs.map +1 -1
  225. package/dist/view/app-dist/.vite/manifest.json +2 -2
  226. package/dist/view/app-dist/assets/{index-CmVoXbwG.js → index-B3ijZRph.js} +17 -17
  227. package/dist/view/app-dist/assets/{quality-cost-scatter-BuLISaH4.js → quality-cost-scatter-B--DfJ9s.js} +1 -1
  228. package/dist/view/app-dist/index.html +1 -1
  229. package/dist/view/application-runtime.cjs +8 -0
  230. package/dist/view/application-runtime.cjs.map +1 -0
  231. package/dist/view/application-runtime.d.cts +9 -0
  232. package/dist/view/application-runtime.d.mts +9 -0
  233. package/dist/view/application-runtime.d.ts +9 -0
  234. package/dist/view/application-runtime.js +6 -0
  235. package/dist/view/application-runtime.js.map +1 -0
  236. package/dist/view/cli/contribution.cjs +5 -2
  237. package/dist/view/cli/contribution.cjs.map +1 -1
  238. package/dist/view/cli/contribution.d.cts +2 -1
  239. package/dist/view/cli/contribution.d.mts +2 -1
  240. package/dist/view/cli/contribution.d.ts +2 -1
  241. package/dist/view/function-runtime.mjs +1019 -456
  242. package/dist/view/http-protocol.d.cts +1 -9
  243. package/dist/view/http-protocol.d.mts +1 -9
  244. package/dist/view/http-protocol.d.ts +1 -9
  245. package/dist/view/inspection-host.cjs +39 -30
  246. package/dist/view/inspection-host.cjs.map +1 -1
  247. package/dist/view/inspection-host.d.cts +7545 -2
  248. package/dist/view/inspection-host.d.mts +7545 -2
  249. package/dist/view/inspection-host.d.ts +7545 -2
  250. package/dist/view/server.cjs +8 -5
  251. package/dist/view/server.cjs.map +1 -1
  252. package/dist/view/server.d.cts +4 -2
  253. package/dist/view/server.d.mts +4 -2
  254. package/dist/view/server.d.ts +4 -2
  255. package/docs-site/zh/reference/cli.mdx +1 -2
  256. package/docs-site/zh/tutorials/control-run-cost.mdx +22 -0
  257. package/docs-site/zh/tutorials/niceeval-taste-application.mdx +21 -0
  258. package/package.json +1 -1
@@ -32,21 +32,13 @@ export declare const ViewInspectionHttpRequestSchema: Schema.Struct<{
32
32
  } & {
33
33
  experimentId: Schema.Codec<import("../record/model/identifiers.cjs").ExperimentId, string, never, never>;
34
34
  }> | Schema.Struct<{
35
- readonly kind: Schema.Literal<"runs.list">;
35
+ readonly kind: Schema.Literal<"run.list">;
36
36
  } & {
37
37
  continuation: Schema.optional<Schema.String>;
38
38
  }> | Schema.Struct<{
39
39
  readonly kind: Schema.Literal<"run.get">;
40
40
  } & {
41
41
  runId: Schema.Codec<import("../record/model/identifiers.cjs").RunId, string, never, never>;
42
- }> | Schema.Struct<{
43
- readonly kind: Schema.Literal<"run.summary">;
44
- } & {
45
- runId: Schema.Codec<import("../record/model/identifiers.cjs").RunId, string, never, never>;
46
- }> | Schema.Struct<{
47
- readonly kind: Schema.Literal<"run.overview">;
48
- } & {
49
- runId: Schema.Codec<import("../record/model/identifiers.cjs").RunId, string, never, never>;
50
42
  }> | Schema.Struct<{
51
43
  readonly kind: Schema.Literal<"attempt.get">;
52
44
  } & {
@@ -32,21 +32,13 @@ export declare const ViewInspectionHttpRequestSchema: Schema.Struct<{
32
32
  } & {
33
33
  experimentId: Schema.Codec<import("../record/model/identifiers.mjs").ExperimentId, string, never, never>;
34
34
  }> | Schema.Struct<{
35
- readonly kind: Schema.Literal<"runs.list">;
35
+ readonly kind: Schema.Literal<"run.list">;
36
36
  } & {
37
37
  continuation: Schema.optional<Schema.String>;
38
38
  }> | Schema.Struct<{
39
39
  readonly kind: Schema.Literal<"run.get">;
40
40
  } & {
41
41
  runId: Schema.Codec<import("../record/model/identifiers.mjs").RunId, string, never, never>;
42
- }> | Schema.Struct<{
43
- readonly kind: Schema.Literal<"run.summary">;
44
- } & {
45
- runId: Schema.Codec<import("../record/model/identifiers.mjs").RunId, string, never, never>;
46
- }> | Schema.Struct<{
47
- readonly kind: Schema.Literal<"run.overview">;
48
- } & {
49
- runId: Schema.Codec<import("../record/model/identifiers.mjs").RunId, string, never, never>;
50
42
  }> | Schema.Struct<{
51
43
  readonly kind: Schema.Literal<"attempt.get">;
52
44
  } & {
@@ -32,21 +32,13 @@ export declare const ViewInspectionHttpRequestSchema: Schema.Struct<{
32
32
  } & {
33
33
  experimentId: Schema.Codec<import("../record/model/identifiers.js").ExperimentId, string, never, never>;
34
34
  }> | Schema.Struct<{
35
- readonly kind: Schema.Literal<"runs.list">;
35
+ readonly kind: Schema.Literal<"run.list">;
36
36
  } & {
37
37
  continuation: Schema.optional<Schema.String>;
38
38
  }> | Schema.Struct<{
39
39
  readonly kind: Schema.Literal<"run.get">;
40
40
  } & {
41
41
  runId: Schema.Codec<import("../record/model/identifiers.js").RunId, string, never, never>;
42
- }> | Schema.Struct<{
43
- readonly kind: Schema.Literal<"run.summary">;
44
- } & {
45
- runId: Schema.Codec<import("../record/model/identifiers.js").RunId, string, never, never>;
46
- }> | Schema.Struct<{
47
- readonly kind: Schema.Literal<"run.overview">;
48
- } & {
49
- runId: Schema.Codec<import("../record/model/identifiers.js").RunId, string, never, never>;
50
42
  }> | Schema.Struct<{
51
43
  readonly kind: Schema.Literal<"attempt.get">;
52
44
  } & {
@@ -9,38 +9,47 @@ const codec_ts_1 = require("../inspection/codec.cjs");
9
9
  const source_ts_1 = require("../inspection/source.cjs");
10
10
  const select_ts_1 = require("../inspection/select.cjs");
11
11
  const project_input_ts_1 = require("../inspection/project-input.cjs");
12
+ const facts_ts_1 = require("../inspection/facts.cjs");
12
13
  // @concord-code ne-surface-inspect-view-generation
13
14
  // @concord-implements docs/feature/inspection/architecture.md
14
- async function inspectViewGeneration(generation, input) {
15
- const decoded = (0, codec_ts_1.decodeInspectionRequest)(input);
16
- if (effect_1.Result.isFailure(decoded))
17
- throw decoded.failure;
18
- return effect_1.Effect.runPromise(effect_1.Effect.scoped(effect_1.Effect.gen(function* () {
19
- const opened = yield* (0, source_ts_1.openHostOwnedInspectionSource)(generation.recordPath);
20
- const facts = decoded.success.operation.kind === "project.get" && generation.target.kind === "current"
21
- ? Object.freeze({ ...opened, kind: "project-record" })
22
- : opened;
23
- const cutoff = facts.cutoff();
24
- if (cutoff.identity !== generation.sourceCutoffIdentity) {
25
- return yield* effect_1.Effect.fail(new Error("Pinned generation cutoff did not match its descriptor"));
26
- }
27
- if (decoded.success.operation.kind === "project.get" && generation.target.kind === "current") {
28
- if (generation.target.input.cutoffIdentity !== cutoff.identity ||
29
- generation.target.input.target.identity !== generation.target.identity) {
30
- return yield* effect_1.Effect.fail(new Error("Pinned current target did not match its descriptor"));
15
+ function inspectViewGeneration(generation, input) {
16
+ return effect_1.Effect.suspend(() => {
17
+ const decoded = (0, codec_ts_1.decodeInspectionRequest)(input);
18
+ if (effect_1.Result.isFailure(decoded))
19
+ return effect_1.Effect.fail(decoded.failure);
20
+ return effect_1.Effect.scoped(effect_1.Effect.gen(function* () {
21
+ const opened = yield* (0, source_ts_1.openHostOwnedInspectionSource)(generation.recordPath);
22
+ const facts = decoded.success.operation.kind === "project.get" && generation.target.kind === "current"
23
+ ? Object.freeze({ ...opened, kind: "project-record" })
24
+ : opened;
25
+ const cutoff = facts.cutoff();
26
+ if (cutoff.identity !== generation.sourceCutoffIdentity) {
27
+ return yield* effect_1.Effect.fail(new Error("Pinned generation cutoff did not match its descriptor"));
31
28
  }
32
- (0, project_input_ts_1.bindProjectInput)(facts, generation.target.input);
33
- }
34
- return (0, select_ts_1.selectInspectionOperation)(facts, decoded.success.operation);
35
- })).pipe(effect_1.Effect.catch((cause) => effect_1.Effect.succeed(Object.freeze({
36
- protocol: codec_ts_1.QUERY_PROTOCOL,
37
- outcome: "failure",
38
- operation: decoded.success.operation.kind,
39
- failure: Object.freeze({
40
- code: "inspection-operation-failed",
41
- reason: "Inspection could not be completed for this generation.",
42
- correction: "retry",
43
- }),
44
- })))));
29
+ if (decoded.success.operation.kind === "project.get" && generation.target.kind === "current") {
30
+ if (generation.target.input.cutoffIdentity !== cutoff.identity ||
31
+ generation.target.input.target.identity !== generation.target.identity) {
32
+ return yield* effect_1.Effect.fail(new Error("Pinned current target did not match its descriptor"));
33
+ }
34
+ // Prepared Runs contain lazy attachment readers owned by preparation's
35
+ // closed Scope. Rebind their exact identities to this request's reader
36
+ // at the already verified generation cutoff; keep the frozen target.
37
+ (0, project_input_ts_1.bindProjectInput)(facts, {
38
+ ...generation.target.input,
39
+ runs: (0, facts_ts_1.loadSelectedInspectionRuns)(facts, generation.target.input.runs.map((run) => run.run.runId)),
40
+ });
41
+ }
42
+ return (0, select_ts_1.selectInspectionOperation)(facts, decoded.success.operation);
43
+ })).pipe(effect_1.Effect.catch(() => effect_1.Effect.succeed(Object.freeze({
44
+ protocol: codec_ts_1.QUERY_PROTOCOL,
45
+ outcome: "failure",
46
+ operation: decoded.success.operation.kind,
47
+ failure: Object.freeze({
48
+ code: "inspection-operation-failed",
49
+ reason: "Inspection could not be completed for this generation.",
50
+ correction: "retry",
51
+ }),
52
+ }))));
53
+ });
45
54
  }
46
55
  //# sourceMappingURL=inspection-host.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspection-host.js","sourceRoot":"","sources":["inspection-host.ts"],"names":[],"mappings":";;AAYA,sDA+BC;AA3CD,gDAAgD;AAChD,8DAA8D;AAC9D,4DAA4D;AAC5D,mCAAwC;AACxC,qDAAiF;AACjF,uDAAwE;AACxE,uDAAoE;AACpE,qEAAkE;AAGlE,mDAAmD;AACnD,8DAA8D;AACvD,KAAK,UAAU,qBAAqB,CAAC,UAA0B,EAAE,KAAc;IAClF,MAAM,OAAO,GAAG,IAAA,kCAAuB,EAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,eAAM,CAAC,SAAS,CAAC,OAAO,CAAC;QACzB,MAAM,OAAO,CAAC,OAAO,CAAC;IAC1B,OAAO,eAAM,CAAC,UAAU,CAAC,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACvD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,IAAA,yCAA6B,EAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC3E,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,aAAa,IAAI,UAAU,CAAC,MAAM,CA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AC,SAAS,CAAC,IAAI;QACzC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,6BAAsC;YAC5C,MAAM,EAAE,wDAAwD;YAChE,UAAU,EAAE,OAAgB;SAC/B,CAAC;KACL,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACX,CAAC","sourcesContent":["// @concord-file ne-surface-view-inspection-host\n// @concord-implements docs/feature/inspection/architecture.md\n// @concord-implements docs/feature/run-inspection/README.md\nimport { Effect, Result } from \"effect\";\nimport { decodeInspectionRequest, QUERY_PROTOCOL } from \"../inspection/codec.ts\";\nimport { openHostOwnedInspectionSource } from \"../inspection/source.ts\";\nimport { selectInspectionOperation } from \"../inspection/select.ts\";\nimport { bindProjectInput } from \"../inspection/project-input.ts\";\nimport type { InspectionDocument } from \"../inspection/protocol.ts\";\nimport type { ViewGeneration } from \"./revision.ts\";\n// @concord-code ne-surface-inspect-view-generation\n// @concord-implements docs/feature/inspection/architecture.md\nexport async function inspectViewGeneration(generation: ViewGeneration, input: unknown): Promise<InspectionDocument> {\n const decoded = decodeInspectionRequest(input);\n if (Result.isFailure(decoded))\n throw decoded.failure;\n return Effect.runPromise(Effect.scoped(Effect.gen(function* () {\n const opened = yield* openHostOwnedInspectionSource(generation.recordPath);\n const facts = decoded.success.operation.kind === \"project.get\" && generation.target.kind === \"current\"\n ? Object.freeze({ ...opened, kind: \"project-record\" as const })\n : opened;\n const cutoff = facts.cutoff();\n if (cutoff.identity !== generation.sourceCutoffIdentity) {\n return yield* Effect.fail(new Error(\"Pinned generation cutoff did not match its descriptor\"));\n }\n if (decoded.success.operation.kind === \"project.get\" && generation.target.kind === \"current\") {\n if (generation.target.input.cutoffIdentity !== cutoff.identity ||\n generation.target.input.target.identity !== generation.target.identity) {\n return yield* Effect.fail(new Error(\"Pinned current target did not match its descriptor\"));\n }\n bindProjectInput(facts, generation.target.input);\n }\n return selectInspectionOperation(facts, decoded.success.operation);\n })).pipe(Effect.catch((cause) => Effect.succeed(Object.freeze({\n protocol: QUERY_PROTOCOL,\n outcome: \"failure\" as const,\n operation: decoded.success.operation.kind,\n failure: Object.freeze({\n code: \"inspection-operation-failed\" as const,\n reason: \"Inspection could not be completed for this generation.\",\n correction: \"retry\" as const,\n }),\n })))));\n}\n"]}
1
+ {"version":3,"file":"inspection-host.js","sourceRoot":"","sources":["inspection-host.ts"],"names":[],"mappings":";;AAaA,sDAuCC;AApDD,gDAAgD;AAChD,8DAA8D;AAC9D,4DAA4D;AAC5D,mCAAwC;AACxC,qDAAiF;AACjF,uDAAwE;AACxE,uDAAoE;AACpE,qEAAkE;AAClE,qDAAoE;AAGpE,mDAAmD;AACnD,8DAA8D;AAC9D,SAAgB,qBAAqB,CAAC,UAA0B,EAAE,KAAc;IAC5E,OAAO,eAAM,CAAC,OAAO,CAAC,GAAG,EAAE;QACvB,MAAM,OAAO,GAAG,IAAA,kCAAuB,EAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,eAAM,CAAC,SAAS,CAAC,OAAO,CAAC;YACzB,OAAO,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACxC,OAAO,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;YACrC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,IAAA,yCAA6B,EAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAC3E,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,aAAa,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS;gBAClG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,gBAAyB,EAAE,CAAC;gBAC/D,CAAC,CAAC,MAAM,CAAC;YACb,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC9B,IAAI,MAAM,CAAC,QAAQ,KAAK,UAAU,CAAC,oBA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IAAI;YACzC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;gBACnB,IAAI,EAAE,6BAAsC;gBAC5C,MAAM,EAAE,wDAAwD;gBAChE,UAAU,EAAE,OAAgB;aAC/B,CAAC;SACL,CAA8B,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["// @concord-file ne-surface-view-inspection-host\n// @concord-implements docs/feature/inspection/architecture.md\n// @concord-implements docs/feature/run-inspection/README.md\nimport { Effect, Result } from \"effect\";\nimport { decodeInspectionRequest, QUERY_PROTOCOL } from \"../inspection/codec.ts\";\nimport { openHostOwnedInspectionSource } from \"../inspection/source.ts\";\nimport { selectInspectionOperation } from \"../inspection/select.ts\";\nimport { bindProjectInput } from \"../inspection/project-input.ts\";\nimport { loadSelectedInspectionRuns } from \"../inspection/facts.ts\";\nimport type { InspectionDocument } from \"../inspection/protocol.ts\";\nimport type { ViewGeneration } from \"./revision.ts\";\n// @concord-code ne-surface-inspect-view-generation\n// @concord-implements docs/feature/inspection/architecture.md\nexport function inspectViewGeneration(generation: ViewGeneration, input: unknown) {\n return Effect.suspend(() => {\n const decoded = decodeInspectionRequest(input);\n if (Result.isFailure(decoded))\n return Effect.fail(decoded.failure);\n return Effect.scoped(Effect.gen(function* () {\n const opened = yield* openHostOwnedInspectionSource(generation.recordPath);\n const facts = decoded.success.operation.kind === \"project.get\" && generation.target.kind === \"current\"\n ? Object.freeze({ ...opened, kind: \"project-record\" as const })\n : opened;\n const cutoff = facts.cutoff();\n if (cutoff.identity !== generation.sourceCutoffIdentity) {\n return yield* Effect.fail(new Error(\"Pinned generation cutoff did not match its descriptor\"));\n }\n if (decoded.success.operation.kind === \"project.get\" && generation.target.kind === \"current\") {\n if (generation.target.input.cutoffIdentity !== cutoff.identity ||\n generation.target.input.target.identity !== generation.target.identity) {\n return yield* Effect.fail(new Error(\"Pinned current target did not match its descriptor\"));\n }\n // Prepared Runs contain lazy attachment readers owned by preparation's\n // closed Scope. Rebind their exact identities to this request's reader\n // at the already verified generation cutoff; keep the frozen target.\n bindProjectInput(facts, {\n ...generation.target.input,\n runs: loadSelectedInspectionRuns(facts, generation.target.input.runs.map((run) => run.run.runId)),\n });\n }\n return selectInspectionOperation(facts, decoded.success.operation);\n })).pipe(Effect.catch(() => Effect.succeed(Object.freeze({\n protocol: QUERY_PROTOCOL,\n outcome: \"failure\" as const,\n operation: decoded.success.operation.kind,\n failure: Object.freeze({\n code: \"inspection-operation-failed\" as const,\n reason: \"Inspection could not be completed for this generation.\",\n correction: \"retry\" as const,\n }),\n }) satisfies InspectionDocument)));\n });\n}\n"]}