@things-factory/figure-service 10.1.71 → 10.1.73
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/figure-service",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.73",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"@things-factory:registry": "https://registry.npmjs.org"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"test:templates": "node --test scripts/templates.test.mts"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@hatiolab/figure-model": "^0.1.
|
|
28
|
+
"@hatiolab/figure-model": "^0.1.89",
|
|
29
29
|
"@operato/typeorm-history": "^10.0.0",
|
|
30
30
|
"@things-factory/ai-client-base": "^10.1.53",
|
|
31
31
|
"@things-factory/auth-base": "^10.1.47",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"graphql-upload": "^15.0.2",
|
|
36
36
|
"koa-router": "^7.4.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "5b5ef6baa7709c2fcbd2f08b8f9c6a750393dfa6"
|
|
39
39
|
}
|
|
@@ -12,7 +12,7 @@ import assert from 'node:assert/strict'
|
|
|
12
12
|
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
13
13
|
import { join } from 'node:path'
|
|
14
14
|
|
|
15
|
-
import { applyV3Proposal, applyV3Recipe, checkV3Recipe, compileV3Asset, inspectV3Asset, serializeV3Asset } from '@hatiolab/figure-model'
|
|
15
|
+
import { applyV3Proposal, applyV3Recipe, checkV3Recipe, compileV3Asset, compileV3Document, inspectV3Asset, serializeV3Asset } from '@hatiolab/figure-model'
|
|
16
16
|
import type { V3Asset } from '@hatiolab/figure-model'
|
|
17
17
|
|
|
18
18
|
import { buildTemplate, modelFileOf, RECIPES } from './build-templates.mts'
|
|
@@ -69,6 +69,30 @@ for (const name of names) {
|
|
|
69
69
|
}
|
|
70
70
|
})
|
|
71
71
|
|
|
72
|
+
test(`${name}: an instance's evaluator gives what a whole evaluation gives, through its controls and its host's sizes`, async () => {
|
|
73
|
+
/* The per-instance evaluator runs again only what changed (2026-09-26); it must answer as a whole evaluation does. */
|
|
74
|
+
const { models } = await buildTemplate(name)
|
|
75
|
+
for (const { values, asset } of models) {
|
|
76
|
+
const plan = compileV3Document(asset.document)
|
|
77
|
+
const own = plan.evaluator()
|
|
78
|
+
const base = { ...asset.designInputs, ...asset.stateDefaults }
|
|
79
|
+
const states = asset.document.model.inputs.filter(i => i.role === 'state')
|
|
80
|
+
const steps: Array<Record<string, number>> = [base]
|
|
81
|
+
for (const k of [0.5, 2, 1]) steps.push({ ...withHost(asset, k).designInputs, ...asset.stateDefaults })
|
|
82
|
+
for (const input of states) for (const v of [input.min!, input.max!, (input.min! + input.max!) / 2]) steps.push({ ...base, [input.id]: v })
|
|
83
|
+
for (const inputs of steps) {
|
|
84
|
+
let whole: unknown, refused = false
|
|
85
|
+
try {
|
|
86
|
+
whole = plan.evaluate(inputs)
|
|
87
|
+
} catch {
|
|
88
|
+
refused = true
|
|
89
|
+
}
|
|
90
|
+
if (refused) assert.throws(() => own.evaluate(inputs), `${JSON.stringify(values)}: refused as the whole is`)
|
|
91
|
+
else assert.equal(JSON.stringify(own.evaluate(inputs)), JSON.stringify(whole), `${JSON.stringify(values)}: ${JSON.stringify(inputs).slice(0, 120)}`)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
|
|
72
96
|
test(`${name}: the words and the picture are there`, () => {
|
|
73
97
|
for (const file of ['guide.ko.md', 'guide.en.md', 'facts.md', 'thumbnail.png']) assert.ok(existsSync(join(RECIPES, name, file)), `${file}`)
|
|
74
98
|
})
|