@hatiolab/figure-model 0.2.0 → 0.2.1
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/kernel-version.d.ts +1 -1
- package/dist/kernel-version.js +1 -1
- package/dist/words.d.ts +5 -5
- package/dist/words.js +5 -5
- package/docs/document-contract.md +1 -1
- package/docs/shape-contract.md +2 -2
- package/package.json +2 -1
package/dist/kernel-version.d.ts
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* different result. Kept equal to package.json's version by `npm version` (the `version` script rewrites this file)
|
|
5
5
|
* and by `kernel-version.test.ts`.
|
|
6
6
|
*/
|
|
7
|
-
export declare const FIGURE_KERNEL_VERSION = "0.2.
|
|
7
|
+
export declare const FIGURE_KERNEL_VERSION = "0.2.1";
|
|
8
8
|
//# sourceMappingURL=kernel-version.d.ts.map
|
package/dist/kernel-version.js
CHANGED
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* different result. Kept equal to package.json's version by `npm version` (the `version` script rewrites this file)
|
|
8
8
|
* and by `kernel-version.test.ts`.
|
|
9
9
|
*/
|
|
10
|
-
export const FIGURE_KERNEL_VERSION = '0.2.
|
|
10
|
+
export const FIGURE_KERNEL_VERSION = '0.2.1';
|
|
11
11
|
//# sourceMappingURL=kernel-version.js.map
|
package/dist/words.d.ts
CHANGED
|
@@ -112,10 +112,10 @@ export declare function placeholderType(now?: number): string;
|
|
|
112
112
|
/** Whether a type is the temporary name given before anyone names the figure. */
|
|
113
113
|
export declare function isPlaceholderType(type: string): boolean;
|
|
114
114
|
/**
|
|
115
|
-
* The most nodes one figure's graph may have:
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
115
|
+
* The most nodes one figure's graph may have: a fence against a malformed document, set large (designer's ruling,
|
|
116
|
+
* docs/shape-contract.md Q10, 2026-09-29). The 1 MiB document limit binds first -- stored nodes run 125 to 190 bytes, so a
|
|
117
|
+
* mebibyte holds some 5,500 to 8,400 -- and the largest stored figure has 517. A graph this size compiles in about 25 ms and
|
|
118
|
+
* evaluates in about 2 ms.
|
|
119
119
|
*/
|
|
120
|
-
export declare const FIGURE_DOCUMENT_NODE_LIMIT =
|
|
120
|
+
export declare const FIGURE_DOCUMENT_NODE_LIMIT = 8192;
|
|
121
121
|
//# sourceMappingURL=words.d.ts.map
|
package/dist/words.js
CHANGED
|
@@ -114,10 +114,10 @@ export function isPlaceholderType(type) {
|
|
|
114
114
|
return PLACEHOLDER_TYPE.test(type);
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
|
-
* The most nodes one figure's graph may have:
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
117
|
+
* The most nodes one figure's graph may have: a fence against a malformed document, set large (designer's ruling,
|
|
118
|
+
* docs/shape-contract.md Q10, 2026-09-29). The 1 MiB document limit binds first -- stored nodes run 125 to 190 bytes, so a
|
|
119
|
+
* mebibyte holds some 5,500 to 8,400 -- and the largest stored figure has 517. A graph this size compiles in about 25 ms and
|
|
120
|
+
* evaluates in about 2 ms.
|
|
121
121
|
*/
|
|
122
|
-
export const FIGURE_DOCUMENT_NODE_LIMIT =
|
|
122
|
+
export const FIGURE_DOCUMENT_NODE_LIMIT = 8192;
|
|
123
123
|
//# sourceMappingURL=words.js.map
|
|
@@ -35,7 +35,7 @@ JSON Schema는 필드 구조·자료형·기본 enum·버전을 검사한다. op
|
|
|
35
35
|
- 알 수 없는 문서/계약 버전과 추가 필드를 거부한다. 현재 capability V3는 transform 또는 표면 참조 pose를 허용한다. V1/V2를 추측 변환하지 않는다.
|
|
36
36
|
- JSON 키 중복은 마지막 값으로 덮지 않고 거부한다. Unicode escape로 같은 키가 표현된 경우도 포함한다.
|
|
37
37
|
- 잘린 JSON, 비유한 수, undefined, 함수, Date, 순환, sparse array, accessor·숨겨진 속성 등 JSON으로 손실되는 입력을 거부한다.
|
|
38
|
-
- 실험 자원 제한: 1MiB UTF-8, 객체 깊이64, 그래프 node
|
|
38
|
+
- 실험 자원 제한: 1MiB UTF-8, 객체 깊이64, 그래프 node 8192(`FIGURE_DOCUMENT_NODE_LIMIT`, 2026-09-29 판정 — shape-contract Q10: 충분히 크게. 실제로는 1MiB 가 먼저 걸린다).
|
|
39
39
|
- 선언 공간(occupancy)의 경계는 `affine-bounds@1` 한 노드의 출력 여섯이다. 압축 인자 모양(`layout` = `L` + 여섯 묶음 + 후보별 항 수)은 [연산 계약 §4](operator-contracts.md#4-연산-catalog)에 적었다 — AI 저작·내보내기는 거기서 풀어 읽는다.
|
|
40
40
|
- round-trip은 의미·수치·선언 동일성을 대상으로 한다. 원본 JSON의 공백·키 표기·서식은 보존하지 않는다.
|
|
41
41
|
- 함수는 파일/DB에 직접 쓰지 않는다. 저장 API의 원자성, 권한, 버전 충돌, 마이그레이션은 제품 통합 시 별도로 구현해야 한다.
|
package/docs/shape-contract.md
CHANGED
|
@@ -62,7 +62,7 @@ What the kernel does now, where it differs from the text below, and why. Branch
|
|
|
62
62
|
- **The one-time rewrite:** `scripts/rewrite-shapes.ts` and `scripts/rewrite-shapes-files.ts`. A file is written only
|
|
63
63
|
when every body's world box and pose agree with the old kernel's (0.1.95) at the drawn values, at half and twice
|
|
64
64
|
the size, and at each state input's ends. All 24 fixtures agree.
|
|
65
|
-
- **Q10 (
|
|
65
|
+
- **Q10 (ruled 2026-09-29, "make it large enough"):** the node limit is 8192 (`FIGURE_DOCUMENT_NODE_LIMIT`), a fence against malformed documents; the 1 MiB limit binds first. No start shorthand.
|
|
66
66
|
A start node per part took two stored figures, of 493 and 497 nodes, past 512. The alternative is a `start` left out
|
|
67
67
|
for a centred push, which is a stored shorthand and a change of format.
|
|
68
68
|
|
|
@@ -436,4 +436,4 @@ Joint ends on a cylinder's side faces: `left` 6, `right` 6, `front` 5, `back` 5
|
|
|
436
436
|
| Q7 | One cavity per part in the first contract | yes (§3) |
|
|
437
437
|
| Q8 | Tolerance 1e-6 mm and 256 points, pending the measurement in §6 | yes |
|
|
438
438
|
| Q9 | A drawn point's id is `p<n>`, a new point takes the highest n + 1, and screens show n, never the point's place in the loop | yes (§4) |
|
|
439
|
-
| Q10 | The node limit,
|
|
439
|
+
| Q10 | The node limit, or a centred push written without its start | **Ruled: 8192**, no shorthand |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatiolab/figure-model",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "The figure format (figure-asset-1): a kernel that evaluates a figure from its declared relations, the authoring commands a modeller and an AI share, the release gate and the score.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"figure",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"build": "tsc -p tsconfig.build.json",
|
|
50
50
|
"check": "tsc -p tsconfig.json --noEmit",
|
|
51
51
|
"test": "npm run check && node --test src/*.test.ts",
|
|
52
|
+
"test:rewrite": "node --test scripts/*.test.ts",
|
|
52
53
|
"test:coverage": "node --test --experimental-test-coverage --test-coverage-lines=100 --test-coverage-branches=95 --test-coverage-functions=100 src/*.test.ts",
|
|
53
54
|
"format": "prettier --write \"src/**/*.ts\" \"docs/**/*.md\" \"*.md\" \"*.json\"",
|
|
54
55
|
"format:check": "prettier --check \"src/**/*.ts\" \"docs/**/*.md\" \"*.md\" \"*.json\"",
|