@inventarch/db 0.0.0-stage → 1.1.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.
- package/LANGUAGE.md +56 -0
- package/LICENSE +202 -0
- package/NOTICE +4 -0
- package/README.md +19 -2
- package/SPEC.md +71 -0
- package/dist/cache.d.ts +13 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +49 -0
- package/dist/cache.js.map +1 -0
- package/dist/descriptors/app.d.ts +89 -0
- package/dist/descriptors/app.d.ts.map +1 -0
- package/dist/descriptors/app.js +231 -0
- package/dist/descriptors/app.js.map +1 -0
- package/dist/descriptors/codec.d.ts +102 -0
- package/dist/descriptors/codec.d.ts.map +1 -0
- package/dist/descriptors/codec.js +383 -0
- package/dist/descriptors/codec.js.map +1 -0
- package/dist/descriptors/domain.d.ts +141 -0
- package/dist/descriptors/domain.d.ts.map +1 -0
- package/dist/descriptors/domain.js +287 -0
- package/dist/descriptors/domain.js.map +1 -0
- package/dist/descriptors/envelope.d.ts +52 -0
- package/dist/descriptors/envelope.d.ts.map +1 -0
- package/dist/descriptors/envelope.js +175 -0
- package/dist/descriptors/envelope.js.map +1 -0
- package/dist/descriptors/index.d.ts +18 -0
- package/dist/descriptors/index.d.ts.map +1 -0
- package/dist/descriptors/index.js +12 -0
- package/dist/descriptors/index.js.map +1 -0
- package/dist/descriptors/registry.d.ts +37 -0
- package/dist/descriptors/registry.d.ts.map +1 -0
- package/dist/descriptors/registry.js +87 -0
- package/dist/descriptors/registry.js.map +1 -0
- package/dist/descriptors/storage.d.ts +60 -0
- package/dist/descriptors/storage.d.ts.map +1 -0
- package/dist/descriptors/storage.js +158 -0
- package/dist/descriptors/storage.js.map +1 -0
- package/dist/distribution/codec.d.ts +40 -0
- package/dist/distribution/codec.d.ts.map +1 -0
- package/dist/distribution/codec.js +181 -0
- package/dist/distribution/codec.js.map +1 -0
- package/dist/distribution/contracts.d.ts +94 -0
- package/dist/distribution/contracts.d.ts.map +1 -0
- package/dist/distribution/contracts.js +241 -0
- package/dist/distribution/contracts.js.map +1 -0
- package/dist/distribution/index.d.ts +9 -0
- package/dist/distribution/index.d.ts.map +1 -0
- package/dist/distribution/index.js +5 -0
- package/dist/distribution/index.js.map +1 -0
- package/dist/distribution/membership.d.ts +9 -0
- package/dist/distribution/membership.d.ts.map +1 -0
- package/dist/distribution/membership.js +61 -0
- package/dist/distribution/membership.js.map +1 -0
- package/dist/distribution/reader.d.ts +32 -0
- package/dist/distribution/reader.d.ts.map +1 -0
- package/dist/distribution/reader.js +226 -0
- package/dist/distribution/reader.js.map +1 -0
- package/dist/editor/index.d.ts +40 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +173 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/errors.d.ts +7 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +22 -0
- package/dist/errors.js.map +1 -0
- package/dist/handle.d.ts +80 -0
- package/dist/handle.d.ts.map +1 -0
- package/dist/handle.js +227 -0
- package/dist/handle.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/inputs.d.ts +46 -0
- package/dist/inputs.d.ts.map +1 -0
- package/dist/inputs.js +397 -0
- package/dist/inputs.js.map +1 -0
- package/dist/json.d.ts +18 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +100 -0
- package/dist/json.js.map +1 -0
- package/dist/paths.d.ts +42 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +119 -0
- package/dist/paths.js.map +1 -0
- package/dist/preview.d.ts +19 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +70 -0
- package/dist/preview.js.map +1 -0
- package/dist/view.d.ts +22 -0
- package/dist/view.d.ts.map +1 -0
- package/dist/view.js +221 -0
- package/dist/view.js.map +1 -0
- package/package.json +148 -3
package/LANGUAGE.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Public IA language
|
|
2
|
+
|
|
3
|
+
IA records declare typed identities, fields and relationships. Owning canonical schemas define the structural contract; language syntax and reference resolution preserve those declarations.
|
|
4
|
+
|
|
5
|
+
The selected vocabulary below is shared by this release. Use `ia vocabulary --json` for its attributed catalogue and `ia vocabulary --schema` for canonical field schemas. `ia validate` reports structural and evaluated evidence separately. An admitted declaration does not establish semantic quality or grant execution authority.
|
|
6
|
+
|
|
7
|
+
Spec source locators do not load documents. Resource capture and disclosure require explicit selection, matching pins and a host-owned disclosure boundary. Model, operation, evaluator and authority callbacks belong to the application host.
|
|
8
|
+
|
|
9
|
+
| Word | Owner | Meaning |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| @agent | agent-system | Names a participant and the vocabulary to which its governance applies. It does not grant host permissions. |
|
|
12
|
+
| @agent-profile | agent-composition-system | Composes an agent, capabilities, optional mandate/voice/delegates and installed execution contracts. |
|
|
13
|
+
| @artifact-set | taxonomy | Defines a closed grouping of artifact genres. |
|
|
14
|
+
| @authoring-guide | authoring-system | Associates a vocabulary owner and schema with an authoring reference and usage guidance. |
|
|
15
|
+
| @axis | taxonomy | Defines a closed coordinate axis for selection. |
|
|
16
|
+
| @capability | agent-composition-system | Groups operations, procedures, templates, checks and included capabilities with declared execution bounds. |
|
|
17
|
+
| @cardinality | taxonomy | Defines relationship multiplicity constraints. |
|
|
18
|
+
| @case | compliance-system | Declares scenario inputs, expected behavior and evaluator attribution. A declaration is not an observed test result. |
|
|
19
|
+
| @category | taxonomy | Defines a closed concept classification used by record shapes and contextual selection. |
|
|
20
|
+
| @check | compliance-system | Names a check implementation and scope. Declaring an implementation name does not install or execute it. |
|
|
21
|
+
| @contract | compliance-system | Names versioned requirements that may be adopted by other records. Requirements need explicit evaluation evidence. |
|
|
22
|
+
| @convention | governance-system | Declares a convention in the shared governance shape. |
|
|
23
|
+
| @decision | work-system | Represents a choice that is needed or has been made: the question, options and decider, and once made, the choice and rationale. |
|
|
24
|
+
| @dimension | taxonomy | Defines a supported record dimension used by conditions and lookup. |
|
|
25
|
+
| @distribution | workspace-system | Declares root records from which a distributable closure is selected. |
|
|
26
|
+
| @execution-binding | agent-composition-system | Connects a native target to a host-installed entry or operation descriptor. |
|
|
27
|
+
| @harness | agent-composition-system | Composes profiles and execution bindings in a workspace under a host contract. |
|
|
28
|
+
| @hook | hook-authoring-system | Represents a host event, tool/path selection and guard message. Registration and executing a guard require a host adapter. |
|
|
29
|
+
| @improvement | learning-system | Represents a proposed change, review metadata and publication metadata. It does not authorize or apply the proposal. |
|
|
30
|
+
| @intent-shape | taxonomy | Defines a request framing and its retrieval defaults. |
|
|
31
|
+
| @kind | taxonomy | Defines a closed semantic role for records; lowering determines the role of each registered word. |
|
|
32
|
+
| @lane | taxonomy | Defines a retrieval lane associated with record kinds. |
|
|
33
|
+
| @law | governance-system | Declares a rule with severity. Structural admission cannot establish the truth or suitability of its prose. |
|
|
34
|
+
| @mandate | agent-system | States bounded authority and conditions for a participant. Host authorization remains independent. |
|
|
35
|
+
| @milestone | work-system | Represents an outcome with an exit criterion inside exactly one plan; it names a condition, not the work toward it. |
|
|
36
|
+
| @move | taxonomy | Defines the closed classification of an agent action or activity. |
|
|
37
|
+
| @observation | learning-system | Represents an attributed evidence account with interpretation and retention metadata. Evidence claims are not verified by field typing. |
|
|
38
|
+
| @operation | authoring-system | Binds a declared operation to an implementation/input/output/effect contract; the host installs implementations. |
|
|
39
|
+
| @phase | taxonomy | Defines a cognitive phase coordinate: orient, plan, act or learn. |
|
|
40
|
+
| @placement | taxonomy | Defines source authority and reach metadata. |
|
|
41
|
+
| @plan | work-system | Represents an arrangement of milestones toward an intent; it heads the work hierarchy and has no parent. Plans do not nest. |
|
|
42
|
+
| @playbook | governance-system | Represents a procedure as phase/primitive cells. Cell delivery is generic; the authored method belongs to its author. |
|
|
43
|
+
| @predicate | taxonomy | Defines a directed relationship and its inverse spelling. |
|
|
44
|
+
| @primitive | taxonomy | Defines a cognitive primitive coordinate; a cell is selected using its phase and primitive. |
|
|
45
|
+
| @principle | governance-system | Declares a governing rationale in the shared governance shape. |
|
|
46
|
+
| @run | session-system | Represents a governed run identity, declared phase, status and owner. Declaration does not start execution. |
|
|
47
|
+
| @schema | floor | Declares the structural contract for exactly one registered discriminator. |
|
|
48
|
+
| @spec | work-system | Represents a maintained specification with explicit status and at most one same-word supersession. Contents and document membership belong to its author; a source locator does not load a body or prove semantic quality. |
|
|
49
|
+
| @system | floor | Registers vocabulary, direct system dependencies, a local steward and consent for relationships. |
|
|
50
|
+
| @task | work-system | Represents one owner's action toward exactly one milestone. Whether it is ready to start is computed by a work evaluator, never stored on the record. |
|
|
51
|
+
| @template | template-system | Represents bounded rendering inputs and output structure. Rendering does not publish or install output. |
|
|
52
|
+
| @value-type | taxonomy | Defines the field types that schemas may require. |
|
|
53
|
+
| @voice | agent-composition-system | Declares communication attributes separate from authority and procedure. |
|
|
54
|
+
| @workspace | workspace-system | Groups systems into an explicit work boundary; relationships can describe dependencies between boundaries. |
|
|
55
|
+
|
|
56
|
+
This guide describes the selected structural vocabulary. Private expert procedures, live provider behavior and unobserved platform qualification are separate from the installed public contract.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @inventarch/db
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Filesystem composition of language, graph and compliance. [SPEC.md](SPEC.md) owns admitted views, revisions, read scopes and the disposable cache.
|
|
4
|
+
|
|
5
|
+
Use `open(workspacePath)` to discover `.ia/src`, then `resolveScope({root, phase})` and pass its `token` as `within` to `snapshot`, `records`, `get`, `referencedBy`, `resolve`, `search` and `traverse`. Runtime consumers must use tokens. Unscoped methods and independent scope issuance are privileged host inspection. A child scope intersects physical occurrences; changing its effective registry refuses. Identity allowlists only narrow. `report` and `refused` expose root-view admission evidence to the privileged host.
|
|
6
|
+
|
|
7
|
+
`refresh()` rebuilds and verifies stable inputs before replacing the state. A failed refresh preserves the previous view. A source change stales existing scopes even if those bytes are subsequently restored. `close()` refuses future reads. Cached root graphs are always verified against a fresh build; corrupt or forged payloads are replaced, equal bytes are not rewritten, and unavailable cache storage leaves in-memory reads usable with a warning. Set `cache:false` for a fully read-only open.
|
|
8
|
+
|
|
9
|
+
The package writes no authored source. An explicit `floor` wins; otherwise an existing local floor directory is authoritative as a whole, and an absent local directory uses the language's generated source embed. Higher systems are never implicit. Paths escaping the workspace, source aliases and invalid UTF-8 refuse by name. Per-source `locations` supply explicit placement/provenance overrides. No historical retention or source writer is implemented.
|
|
10
|
+
|
|
11
|
+
`preview([{path,text}])` validates an in-memory draft against the current source snapshot through the same admission pipeline. It returns base/candidate revisions, admitted records and full refusal/report evidence without mutating files, caches, scopes or the handle. It is a privileged authoring-host API; callers must check current source freshness before using its result. Floor edits and malformed/aliased draft paths refuse.
|
|
12
|
+
# Editor snapshots
|
|
13
|
+
|
|
14
|
+
Installed native distributions are discovered through `.ia/distributions/active.json` and the matching portable lock. Every fresh snapshot verifies selected manifests, complete file inventories, generation bytes and compatibility before ordinary admission. Sources retain their physical store paths and adopted placement; the generated installation workspace records direct distribution use. Missing/corrupt/drifted state and pending recovery refuse instead of silently dropping content. Database reads perform no installation write or network access. The public `@inventarch/db/distribution` entrypoint owns shared strict decoders and candidate-generation verification for the installer.
|
|
15
|
+
|
|
16
|
+
Activation identity and its monotonic counter participate in view/source revisions, including editor overlays and draft previews. Rollback therefore cannot revive prior scopes. The host-only `candidateInstallation` option selects a verified staged pointer for admission; explicit `null` captures authored/bound sources without an installation. Editor metadata reports installed sources and generated installation state as read-only. Matching authored system declarations may override installed authority only under the locked provider/version contract and ordinary whole-tree admission.
|
|
17
|
+
|
|
18
|
+
`@inventarch/db/editor` provides `EditorDatabase` and immutable `EditorSnapshot` readers. Overlay buffers (including explicit deletion) reuse normal discovery, registry, graph and admission rules without writing source/cache files. Reads preserve the existing location/phase/scope restrictions. Captures expose saved/dirty/source-origin/version metadata; embedded sources remain read-only. Failed refresh retains the last reader; hosts must surface unavailability and refuse stale actions. See the colocated spec and editor tests.
|
|
19
|
+
|
|
20
|
+
`@inventarch/db/descriptors` compiles OS09 domain, storage and app descriptor resources against a host-built trusted registry without I/O or code execution; see [its SPEC](src/descriptors/SPEC.md).
|
package/SPEC.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Database specification
|
|
2
|
+
|
|
3
|
+
Planned consumer: bounded repository capture specifies an explicit host collector over package-local sources. It must adapt supported public admission interfaces; it does not change this package's root discovery, adoption limits or create implicit parent/recursive scanning. Native revision and full code/toolchain identity remain distinct.
|
|
4
|
+
|
|
5
|
+
PT5 complete-disclosure refinement: `ReadHandle.isCompleteScope(token)` proves that a current handle-issued scope was created at the whole-workspace root without a phase or identity restriction, and has no narrowed ancestor. Unknown, stale and closed tokens retain existing scope errors. Selecting every admitted identity still returns false: refused source diagnostics may reveal material outside that identity set. The flag stays internal to scope storage, so serialized scope/snapshot shapes remain compatible. Whole-workspace draft preview consumers must require this proof before exposing admission diagnostics; ordinary scoped reads are unchanged.
|
|
6
|
+
|
|
7
|
+
## OS09 descriptor producer (LK-17)
|
|
8
|
+
|
|
9
|
+
The public `@inventarch/db/descriptors` entrypoint owns the pure, bounded, versioned codecs and compilers for `domain-model`, `storage-binding` and `app-composition` resources (spec-0009): strict 1 MiB/depth-16/1,000-entry JSON with duplicate-key refusal, canonical `sha256:` digests bound to the native envelope, a host-built trusted contract registry for command/query/validator/view/operation/port/adapter/migration-policy IDs, and typed single-diagnostic refusals with owner/source/resource/field attribution. It performs no I/O, DDL or code execution, and the three words remain unregistered (ALIGN-06); an isolated candidate is admitted only through `preview`. The strict JSON transport is shared with the distribution codec through `src/json.ts` with unchanged distribution messages. See the [descriptor SPEC](src/descriptors/SPEC.md).
|
|
10
|
+
|
|
11
|
+
## Distribution M1–M5 implementation packet
|
|
12
|
+
|
|
13
|
+
The public `@inventarch/db/distribution` entrypoint owns strict version-1 transport decoders and canonical bytes for release descriptors/manifests, portable locks, generation membership and activation pointers. JSON rejects duplicate decoded keys and unknown fields; object input must be bounded plain data without accessors or aliases. Native parsing stays in language. Package IDs are provider-qualified lowercase `provider/name`; versions and ranges use pinned SemVer. No absolute path or credential enters a portable lock. Metadata limits are 4 MiB, 128 selected bundles and 10,000 files, with the archive/file ceilings from DIST-05. Decoding copies and freezes output.
|
|
14
|
+
|
|
15
|
+
Generation membership enumerates selected bundle IDs/archive digests and source inventories derived from verified manifests, with deterministic identical-system deduplication and contributing-package provenance. Readers verify complete file inventory, exact canonical generation bytes and the active lock, and load only selected source bytes. An unpinned regular file named `.DS_Store` or `._*`, which a Mac writes into directories it opens, is skipped; a pinned one is verified like any other, and a link or special file of such a name is refused (`platformDebris`, #323). Candidate installation is an explicit host-selected input option; it does not bypass admission or grant writes. The generated installation workspace uses native composition and direct-distribution use edges. Installed sources retain adopted band 90/methodology; generated installation state uses band 100/workspace. Active generation and monotonic counter participate in revision and scope freshness. Existing authored/adopted callers keep their behavior when no installation exists.
|
|
16
|
+
|
|
17
|
+
The application owns archive acquisition, bounded solving and mutation. The database owns no network or installation writes. Restore-required, lock-drift, corrupt-state and pending-recovery remain named operational refusals; a fresh read never silently ignores a selected installation. Filesystem and fault-injection tests must establish M3–M5 behavior before these planned contracts are reported delivered.
|
|
18
|
+
|
|
19
|
+
Local binding adapter (2026-09-18): when `InputOptions.adopted` is absent, `readInputs` loads optional `.ia/workspace.json`: `{ "version": 1, "adopted": [{ "id": "foundation", "path": "vendor/foundation", "revision": "<sha256>" }] }`. This closed host-data format supports at most 16 bindings and 64 KiB of UTF-8 JSON. Each path is a canonical portable directory inside the current workspace and outside its `.ia` tree; absolute paths, parent traversal, duplicate IDs/directories and aliases refuse. Only the selected directory's physical `.ia/src` sources are captured, with package artifacts excluded and no recursive binding expansion. Its floor is excluded: the workspace still selects exactly one explicit/local/embedded floor. The revision uses the existing `AdoptedSource` digest of the ordered exact `{path,text}` list. Missing roots, malformed configuration or changed pinned bytes fail the capture; they never silently drop a dependency. Explicit `adopted` captures, including `[]`, replace automatic bindings. Disk/editor refresh rereads the manifest and dependency bytes; failed refresh retains internal evidence while the host marks it unavailable. Read-only adopted placement, membership, admission and stale-action semantics remain unchanged; this manifest grants no writable system or model disclosure.
|
|
20
|
+
|
|
21
|
+
Editor extension contract (2026-09-18): `/editor` owns cache-free captured-input readers, versioned unsaved overlays (including local floor buffers), deleted-source reconciliation and privileged source/registry/occurrence inspection. Reads share the existing scope, admission and view implementation; every refresh retires the previous reader. Source metadata identifies embedded/explicit floor as virtual read-only, and local sources by placement/provenance. Existing `Handle.preview` retains its non-floor draft contract. No filesystem writes occur in editor capture or preview. Candidate/baseline comparison preserves unrelated pre-existing failures while refusing new errors or loss of admitted records.
|
|
22
|
+
|
|
23
|
+
Implementation contract for database plan. Depends on @inventarch/language, @inventarch/graph and @inventarch/compliance. Node filesystem adapter; source parsing and semantic decoding stay in language, graph owns all adjacency/postings, compliance alone constructs verdicts.
|
|
24
|
+
|
|
25
|
+
D01. open(root, options) reads a canonical existing workspace directory and its .ia/src tree. A missing source tree is empty. Read only regular .ia files and all direct system directories, including empty ones. Refuse symlink/junction source or cache traversal and paths escaping the canonical workspace; never follow an alias into another source root. Canonical source names are workspace-relative and slash-separated. Windows override lookup is case-insensitive and duplicate aliases refuse. Decode UTF-8 fatally while preserving a BOM as source content; invalid encoding or unreadable source is SOURCE-UNAVAILABLE. No source file is written.
|
|
26
|
+
|
|
27
|
+
D02. Default authored sources use band100, empty reach and workspace provenance. Local or embedded .ia/src/floor sources use floor10/bootstrap. Explicit per-source Location overrides supply other closed placement/provenance values and canonical reach; validate kind/band consistency. options.floor is an explicit array of canonical floor path/text sources, replacing local/default floor. Without it, an existing local floor directory is authoritative as a whole, including when empty; only an absent directory selects language.KERNEL_SOURCES. Report embedded origin as virtual bootstrap input. Copy/freeze inputs and options so caller mutation cannot change a published view.
|
|
28
|
+
|
|
29
|
+
D03. A source snapshot includes all selected source bytes, paths, placement/provenance and discovered system folders. A derived revision-only input carries the folder inventory, floor origin and admission-policy version so empty-folder changes also change the revision; it is never parsed or exposed as an authored record. A view selects sources by reach before building its registry, compiles them independently through language, and delegates authority/phase and external resolution to graph. Never pass all shadowed external occurrences to the compiler as an ambiguous pool. Preserve language section11.2: any language error refuses every record in that file; healthy other files remain independent. Compiled preview siblings are never promoted to admission. Whole-tree requirement ids remain unique without a band exception under language S09. Before authority can hide duplicates, collect distinct physical requirement occurrences from error-free compilation at every distinct declared reach (and the requested location), using each location's registry. Deduplicate the same source occurrence across views, then invoke the shared language collision helper; every participating file is refused. This finite context set covers all registry visibility changes without inventing a second requirement parser.
|
|
30
|
+
|
|
31
|
+
D04. Compliance validates candidate schemas and system joins. A malformed system folder or missing steward refuses that join, its owned words and dependent systems; preserve the root finding. Foreign instances, invalid schemas, selectors, variants and unknown check runners are not readable admitted nodes. A schema assessment that remains not-evaluated cannot establish instance admission. Rebuild graph relationships after removing refused nodes until admission stabilizes; retain failed/unavailable assessments as admission evidence without turning earlier candidate passes into final claims. Coverage/adoption failures remain report evidence and do not erase an otherwise structurally valid contract/workspace declaration. The public snapshot identifies admitted system order and refused subjects separately from candidate vocabulary; private graph registry data is not exposed as admission proof.
|
|
32
|
+
|
|
33
|
+
D05. The root view revision is the handle's whole-source generation stamp; graph revisions additionally include the effective view registry. Every selected source participates even when unreachable in a view. Refresh fully rereads and rebuilds; system/schema changes always rebuild everything. Verify source discovery/bytes are stable before publishing a new snapshot, retry a bounded three times on concurrent changes, then SOURCE-CHANGED. Publication swaps the complete immutable state; failed refresh preserves the previous state. Source errors produce attributable partial admission, not silent success.
|
|
34
|
+
|
|
35
|
+
D06. The derived .ia/.iadb/graph.json stores a format tag, revision and deterministic serialized root graph. Always build/validate fresh and compare the complete payload before accepting a cached artifact; a matching stamp alone is insufficient. Equal bytes are not rewritten. Changed/corrupt/foreign bytes are replaced atomically through a unique same-directory temporary file. Recheck containment immediately before access/publication. Cache I/O failures produce CACHE-UNAVAILABLE and leave the valid in-memory snapshot usable; no authored file is touched. This version saves redundant writes, not parsing work. Fresh/cached/refreshed graphs are byte-equal for equal inputs.
|
|
36
|
+
|
|
37
|
+
D07. resolveScope issues an opaque unguessable token bound privately to its issuing handle, canonical root, optional phase (wildcard when omitted), view revision and source generation. The initial occurrence boundary includes every reachable candidate occurrence before phase selection; an optional identity allowlist only intersects it. A child root is the same or a segment-boundary descendant. Its occurrence boundary intersects the parent's and its admitted identities include only winners whose actual occurrence is in that boundary. A new winner with the same identity cannot widen it. A child may change phase but never add occurrences. Omitted child bindings inherit; explicit phase:null requests a wildcard. Refuse narrowing with SCOPE-MISMATCH if the effective registry differs from the parent: a read token cannot authorize new vocabulary/schema interpretation. A privileged host may issue an independent root token for that view. Explicit requested revision must agree with the inherited token when narrowing.
|
|
38
|
+
|
|
39
|
+
D08. Every read carrying a token validates issuer, open state, generation and explicit root/phase/revision assertions. Omitted bindings inherit. Unknown/forged/other-handle tokens are SCOPE-UNAVAILABLE; incompatible bindings or a wider child root SCOPE-MISMATCH; changed generation STALE (a token never revives after refresh to different inputs and back); closed handle CLOSED. No historical retain API is implemented; stale tokens never read current bytes under an old stamp. Scope grants reading only. Tokens are not transferable between processes without the later owning transport retaining their issuing handle.
|
|
40
|
+
|
|
41
|
+
D09. get, records, referencedBy, resolve, search and traverse honor the supplied token and view. get and referencedBy outside their allowed identities yield OUT-OF-SCOPE; referencedBy returns graph G06a typed field references naming the identity, pruned to holders in scope; lists/search/resolution prune and traversal cannot cross an excluded intermediary. Scope and typed traversal filters apply before emitting gated edges. A scoped snapshot exposes only allowed immutable nodes, its root/phase/view revision and admitted system order; it does not expose the private full graph/registry/indexes or unscoped diagnostics. All query products delegate to graph; db creates no second adjacency or text index. Unscoped reads are privileged host inspection, and runtime must always supply a token.
|
|
42
|
+
|
|
43
|
+
D10. Reports retain source/graph/compliance namespaces and original attribution. Database operational errors use IA-DB-ROOT-INVALID, PATH-UNSAFE, SOURCE-UNAVAILABLE, SOURCE-CHANGED, SCOPE-UNAVAILABLE, SCOPE-MISMATCH, STALE, CLOSED, OUT-OF-SCOPE and CACHE-UNAVAILABLE. Errors are typed DbError values; cache observations are warnings. Kernel/fixture/adoption evidence stays explicitly not-evaluated when unavailable; opening a corpus does not execute conformance suites or prose cases.
|
|
44
|
+
|
|
45
|
+
D11. Acceptance exercises the real five-system/floor corpus, a foreign record, missing schema restoration, view-specific vocabulary/authority, malformed siblings, source identity preservation under prose edits, cached payload forgery, byte/revision invalidation, scope narrowing across different occurrence winners, stale/closed/foreign tokens and built-package declaration/runtime consumers. No donor files are required. Source writers, historical retention, sessions and capability dispatch retain downstream owners.
|
|
46
|
+
|
|
47
|
+
Task1 delivered: immutable input discovery and explicit/local/embedded floor precedence, generated frozen kernel source export, package scaffold and operational error inventory. Thirteen tests cover default118-record floor, local holes, explicit overrides/caller mutation, exact CRLF/BOM bytes, empty folder fingerprints, invalid UTF-8, bad roots/bands/aliases, source junction refusal and the actual native tree. 1485 tests/52files pass with typecheck/build/kernel/dependency and full compliance fixture verification. Admission, handles/cache and scope APIs remain next.
|
|
48
|
+
|
|
49
|
+
Task2 delivered: private per-location view builder compiles independent visible files, delegates authority/late resolution to graph, applies whole-file language refusal and whole-tree physical requirement uniqueness before authority, and iterates structural admission to stability. Malformed/missing-steward joins block their owned words/dependents; individual compliance failures and descendants are removed with retained non-pass assessments under compliance C21. A derived metadata input stamps folder inventory/floor origin/admission version. Eleven new tests cover native/default admission, foreign records, file previews versus healthy files, instance descendants, join cascades, schema restoration, reach/phase overlays, cross-band/reach REQ duplication, contextual vocabulary and empty-folder revision changes. 1497 tests/53files, typecheck/build/kernel/dependencies pass. Handles/cache and scoped reads are next.
|
|
50
|
+
|
|
51
|
+
Task3 delivered: public open/refresh/close and immutable read products; stable-source verification retries at most three times and preserves the prior state on failure. Disposable cache comparison verifies the entire freshly derived payload, skips identical writes, atomically replaces corruption/forgery, and reports cache obstruction or junction access as warnings while retaining in-memory reads. Nine new tests;1506 workspace tests/54files, typecheck/build/kernel/dependencies pass. Task4 scope tokens and read pruning are next.
|
|
52
|
+
|
|
53
|
+
Task4 delivered: opaque per-handle scopes bind roots, phases, view revisions and monotonic source generations. Reads share binding checks, parent narrowing intersects actual occurrences, changed registries refuse, and graph owns pruned resolution/search/traversal. Eight tests cover bindings, forged/foreign/closed/stale tokens, restoration without revival, excluded intermediaries/gated edges, phase changes and same-identity winner boundaries. 1514 tests/55files, typecheck/build/kernel/dependencies pass. Task5 public built consumers and mutation acceptance next.
|
|
54
|
+
|
|
55
|
+
D acceptance complete:47db tests;1520workspace tests/56files, typecheck/build/kernel/dependencies/native/full compliance checks and emitted-declaration/built-runtime database consumer pass. Fresh/cache/refresh products agree after record/system/schema/kernel edits, actual schema admission changes restore, placement overlays invalidate and caller options remain copied. Native corpus153records; compliance485verdicts retain one adoption not-evaluated without supplied evaluators. All ten database operational codes have refusal or cache-warning tests. No source writer, retained history or execution permission is claimed. Next R scope: runtime retrieval/budgets/select, thin CLI/MCP, verified steward hook and fixture loop acceptance, then E.
|
|
56
|
+
|
|
57
|
+
D12. Stage E Task1 adds Handle.preview(changes), a privileged pure draft view over the handle's current immutable input snapshot. Each change is {path,text}; require nonempty unique canonical .ia/src/*.ia paths, no aliases/traversal or floor changes. Preserve replaced source locations; new sources are authored100/workspace, using existing explicit location overrides when supplied. Add newly represented system folders. Recompute fingerprint and run the existing viewBuilder/admission at root with no phase. Return frozen baseRevision/revision/records/report/refused. Never mutate the handle, existing scopes, cache or filesystem. Empty changes reproduce current root results. IA-DB-DRAFT-INVALID refuses malformed draft input before compilation. A valid preview does not apply edits or promise current filesystem freshness; the executing host rechecks before publishing drafts.
|
|
58
|
+
|
|
59
|
+
PT0/PT1 integration: the public `systemMember(path)` remains the sole authored/adopted membership interpreter used by the projection composition root. Consumers derive observations from the selected admitted records and bind them to that view's revision; path recognition alone is not admission, scope authorization or permission to modify an adopted root. This reuse closes only the renderer's reconstructed-local-path gap; distribution M3's full installed-generation reader remains separately scheduled.
|
|
60
|
+
|
|
61
|
+
M5 authoring asset closure: distribution metadata permits the exact `.ia/authoring.resources.json` path only as an `asset`, and explicit `.ia/src/**/*.md` paths only as `documentation`. Other hidden/build paths and role substitutions remain invalid. This is a bounded path/role allowance, not an asset validity verdict: the distribution owner verifies the closed manifest, exact resource pins and native joins before packing/verifying/installing guide-bearing archives. Native floor code remains supplied by the fixed language floor rather than an archive's documentation assets.
|
|
62
|
+
|
|
63
|
+
Path identity (#315): `src/paths.ts`, exported from `@inventarch/db`, compares paths by what the volume opens, because APFS folds case and Unicode normalization and NTFS folds case. `sameFile` compares device and inode (a path it cannot examine, such as a link loop, is compared by `pathKey`); `within(parent, child)` walks the child's real ancestors by device and inode, and compares folded settled spellings only while the parent does not exist; `unaliased(path, real)` accepts another spelling of the same existing names and refuses a link or junction in any component, and a path that is not absolute and normalized, since the kernel walks a `link/..` pair through the link (on win32, where the kernel removes `..` before it follows a junction, it compares the normalized path case-folded, which also refuses subst drives and 8.3 names); `linked` finds that link; `pathKey` folds the key of a relative path that may not exist, case on win32 and `caseFold` on darwin: NFC and full Unicode case folding, as APFS compares names, so `ß` and `ss` are one name there, while the dotless `ı` stays apart from `i` (#323). The same key names draft paths (`preview.ts`), editor overlays (`editor/index.ts`) and sources (`inputs.ts`), so on macOS two of them that differ only in case or Unicode case are one path, refused as a duplicate; a case-sensitive APFS volume holding both `A.ia` and `a.ia` is refused there as a duplicate source. `@inventarch/runtime` re-exports all of them but `linked` and `caseFold`, for the apps that depend on it rather than on `@inventarch/db`.
|
|
64
|
+
|
|
65
|
+
### Explicit package-local authored inputs (OS06 U01 prerequisite)
|
|
66
|
+
|
|
67
|
+
`InputOptions.authoredRoots` selects a frozen, sorted list of repository-relative package directories. Selection is explicit host input; the database does not discover a monorepo, inherit a parent workspace, or read package policy JSON. Each selected directory contributes only its `.ia/src/systems/<owner>/` native files, at authored workspace precedence and with the original physical `source.path`. Vocabulary identities are unchanged. The sole system declaration remains at the repository root; a package cannot carry its own system declaration, floor, workspace/adoption manifest, distribution lock, release manifest, or legacy package authority. Existing structural admission and duplicate diagnostics apply across the combined source set.
|
|
68
|
+
|
|
69
|
+
Directories must be portable, canonical, disjoint and unaliased. The reader refuses junctions/symlinks, hard-linked native files, nonregular sources, invalid UTF-8, missing root system context and ambiguous path spellings. Selected package capture is bounded to 1000 package roots, 20000 native files, 1 MiB per file and 64 MiB aggregate native bytes. Reads allocate at most the statted size plus one byte and refuse concurrent size/metadata changes. Hosts must additionally bound their full repository capture and verify inventory membership, package-to-record correspondence, ownership, policy/evaluator freshness and one writer.
|
|
70
|
+
|
|
71
|
+
Selection and exact source bytes participate in the input fingerprint and admitted revision. Refresh therefore invalidates previous scopes when a selected package source changes. A contextual scoped read uses the root handle; opening a package directory alone supplies no parent definitions and does not admit those instances. No package-local editor write or preview target is added: existing draft paths remain root `.ia/src` paths. This is the upstream read prerequisite, not a claim that a consuming monorepo has completed its package-record cutover or installed qualification.
|
package/dist/cache.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Graph } from '@inventarch/graph';
|
|
2
|
+
export interface CacheObservation {
|
|
3
|
+
readonly code: 'IA-DB-CACHE-UNAVAILABLE';
|
|
4
|
+
readonly severity: 'warning';
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly message: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CacheStatus {
|
|
9
|
+
readonly state: 'disabled' | 'hit' | 'written' | 'unavailable';
|
|
10
|
+
readonly observations: readonly CacheObservation[];
|
|
11
|
+
}
|
|
12
|
+
export declare function publishCache(root: string, graph: Graph, enabled: boolean): CacheStatus;
|
|
13
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG/C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AACD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,aAAa,CAAC;IAC/D,QAAQ,CAAC,YAAY,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACpD;AACD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,CAsCtF"}
|
package/dist/cache.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { serialize } from '@inventarch/graph';
|
|
4
|
+
import { safePath } from './inputs.js';
|
|
5
|
+
export function publishCache(root, graph, enabled) {
|
|
6
|
+
if (!enabled)
|
|
7
|
+
return Object.freeze({ state: 'disabled', observations: Object.freeze([]) });
|
|
8
|
+
const path = '.ia/.iadb/graph.json';
|
|
9
|
+
let temporary;
|
|
10
|
+
try {
|
|
11
|
+
const bytes = JSON.stringify({ format: 'ia-graph-1', revision: graph.revision, graph: serialize(graph) }) + '\n';
|
|
12
|
+
const target = safePath(root, path);
|
|
13
|
+
try {
|
|
14
|
+
if (readFileSync(target, 'utf8') === bytes)
|
|
15
|
+
return Object.freeze({ state: 'hit', observations: Object.freeze([]) });
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
if (error.code !== 'ENOENT')
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
mkdirSync(safePath(root, '.ia/.iadb'), { recursive: true });
|
|
22
|
+
temporary = `.ia/.iadb/graph.${randomUUID()}.tmp`;
|
|
23
|
+
writeFileSync(safePath(root, temporary), bytes, { encoding: 'utf8', flag: 'wx' });
|
|
24
|
+
renameSync(safePath(root, temporary), safePath(root, path));
|
|
25
|
+
temporary = undefined;
|
|
26
|
+
return Object.freeze({ state: 'written', observations: Object.freeze([]) });
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
if (temporary !== undefined)
|
|
30
|
+
try {
|
|
31
|
+
unlinkSync(safePath(root, temporary));
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
/* a disposable unpublished file cannot affect reads */
|
|
35
|
+
}
|
|
36
|
+
return Object.freeze({
|
|
37
|
+
state: 'unavailable',
|
|
38
|
+
observations: Object.freeze([
|
|
39
|
+
{
|
|
40
|
+
code: 'IA-DB-CACHE-UNAVAILABLE',
|
|
41
|
+
severity: 'warning',
|
|
42
|
+
path,
|
|
43
|
+
message: `Cache unavailable: ${error instanceof Error ? error.message : String(error)}`,
|
|
44
|
+
},
|
|
45
|
+
]),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS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,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClF,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QAC5D,SAAS,GAAG,SAAS,CAAC;QACtB,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC9E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,SAAS,KAAK,SAAS;YACzB,IAAI,CAAC;gBACH,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;YACxC,CAAC;YAAC,MAAM,CAAC;gBACP,uDAAuD;YACzD,CAAC;QACH,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,KAAK,EAAE,aAAa;YACpB,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC;gBAC1B;oBACE,IAAI,EAAE,yBAAkC;oBACxC,QAAQ,EAAE,SAAkB;oBAC5B,IAAI;oBACJ,OAAO,EAAE,sBAAsB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;iBACxF;aACF,CAAC;SACH,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { DescriptorDiagnostic, DescriptorResult } from './codec.js';
|
|
2
|
+
import type { DefinitionDigests } from './domain.js';
|
|
3
|
+
import type { DescriptorEnvelope, DisclosedResources } from './envelope.js';
|
|
4
|
+
import type { DescriptorRegistry, EffectClass } from './registry.js';
|
|
5
|
+
export type LayoutValue = number | boolean | string;
|
|
6
|
+
export interface ContractBinding {
|
|
7
|
+
readonly contract: string;
|
|
8
|
+
readonly implementation: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CompiledScreen {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly title?: string;
|
|
13
|
+
readonly view: ContractBinding;
|
|
14
|
+
readonly layout: Readonly<Record<string, LayoutValue>>;
|
|
15
|
+
readonly queries: readonly ContractBinding[];
|
|
16
|
+
readonly actions: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export interface CompiledAction {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly capability: string;
|
|
21
|
+
readonly operation: ContractBinding;
|
|
22
|
+
readonly input: string;
|
|
23
|
+
readonly output: string;
|
|
24
|
+
readonly effect: EffectClass;
|
|
25
|
+
}
|
|
26
|
+
export type ConfigurationValue = number | boolean | string;
|
|
27
|
+
/** Secret entries are references only: they never carry a value. */
|
|
28
|
+
export interface CompiledConfiguration {
|
|
29
|
+
readonly key: string;
|
|
30
|
+
readonly visibility: 'public' | 'server';
|
|
31
|
+
readonly secret: boolean;
|
|
32
|
+
readonly default?: ConfigurationValue;
|
|
33
|
+
}
|
|
34
|
+
export interface TargetSupport {
|
|
35
|
+
readonly profile: string;
|
|
36
|
+
readonly status: 'supported' | 'unsupported';
|
|
37
|
+
readonly diagnostics: readonly DescriptorDiagnostic[];
|
|
38
|
+
}
|
|
39
|
+
export interface CompiledAppComposition {
|
|
40
|
+
readonly format: 1;
|
|
41
|
+
readonly kind: 'app-composition';
|
|
42
|
+
readonly owner: string;
|
|
43
|
+
readonly source: string;
|
|
44
|
+
readonly resource: {
|
|
45
|
+
readonly key: string;
|
|
46
|
+
readonly digest: string;
|
|
47
|
+
};
|
|
48
|
+
readonly app: string;
|
|
49
|
+
readonly version: string;
|
|
50
|
+
/** Required capabilities from the native envelope refs; rendering never grants them. */
|
|
51
|
+
readonly capabilities: readonly string[];
|
|
52
|
+
readonly targets: readonly TargetSupport[];
|
|
53
|
+
readonly screens: readonly CompiledScreen[];
|
|
54
|
+
readonly navigation: readonly {
|
|
55
|
+
readonly from: string;
|
|
56
|
+
readonly to: string;
|
|
57
|
+
}[];
|
|
58
|
+
readonly actions: readonly CompiledAction[];
|
|
59
|
+
readonly configuration: readonly CompiledConfiguration[];
|
|
60
|
+
/** Only keys the host explicitly allowlisted; server and secret keys never appear here. */
|
|
61
|
+
readonly publicConfiguration: readonly {
|
|
62
|
+
readonly key: string;
|
|
63
|
+
readonly default?: ConfigurationValue;
|
|
64
|
+
}[];
|
|
65
|
+
readonly requirements: readonly {
|
|
66
|
+
readonly name: string;
|
|
67
|
+
readonly kind: 'domain-model' | 'storage-binding';
|
|
68
|
+
readonly id: string;
|
|
69
|
+
readonly version: string;
|
|
70
|
+
}[];
|
|
71
|
+
readonly digests: DefinitionDigests;
|
|
72
|
+
}
|
|
73
|
+
export interface AppInput {
|
|
74
|
+
readonly envelope: DescriptorEnvelope;
|
|
75
|
+
readonly resources: DisclosedResources;
|
|
76
|
+
readonly registry: DescriptorRegistry;
|
|
77
|
+
/** Host allowlist of configuration keys that may enter a public/browser projection (APPD-02). */
|
|
78
|
+
readonly publicConfiguration?: readonly string[];
|
|
79
|
+
}
|
|
80
|
+
/** Pure app compiler: joins view/operation IDs to trusted installed contracts; creates no context and renders nothing. */
|
|
81
|
+
export declare function compileAppComposition(input: AppInput): DescriptorResult<CompiledAppComposition>;
|
|
82
|
+
/** Activation is refused for an unsupported or undeclared target; inspection of the compiled definition continues. */
|
|
83
|
+
export declare function activateTarget(app: CompiledAppComposition, target: string): DescriptorResult<{
|
|
84
|
+
readonly app: string;
|
|
85
|
+
readonly version: string;
|
|
86
|
+
readonly target: string;
|
|
87
|
+
readonly definition: string;
|
|
88
|
+
}>;
|
|
89
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/descriptors/app.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAS,MAAM,YAAY,CAAC;AAChF,OAAO,KAAK,EAAE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