@nakafa/aksara-contracts 0.51.0 → 1.0.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/LICENSE +207 -152
- package/README.md +13 -10
- package/dist/artifact/integrity.d.ts +22 -10
- package/dist/artifact/integrity.js +16 -2
- package/dist/artifact/limits.d.ts +13 -7
- package/dist/artifact/limits.js +5 -12
- package/dist/artifact/source.d.ts +10 -4
- package/dist/artifact/spec.d.ts +27 -15
- package/dist/artifact/spec.js +7 -8
- package/dist/artifact/verify.d.ts +11 -5
- package/dist/content.d.ts +37 -11
- package/dist/content.js +7 -21
- package/dist/limits.d.ts +2 -2
- package/dist/limits.js +2 -2
- package/dist/release/rollback/spec.d.ts +102 -24
- package/dist/runtime/protected/spec.d.ts +61 -16
- package/dist/runtime/protected/verify.d.ts +11 -5
- package/dist/runtime/spec.d.ts +44 -12
- package/dist/runtime/verify.d.ts +22 -10
- package/dist/signature/trusted.d.ts +4 -1
- package/dist/signature/trusted.js +4 -1
- package/dist/transport/batch.d.ts +34 -8
- package/dist/transport/group.d.ts +51 -12
- package/dist/transport/request.d.ts +94 -32
- package/dist/transport/response.d.ts +122 -32
- package/dist/tree.d.ts +52 -0
- package/dist/tree.js +162 -0
- package/package.json +5 -1
package/LICENSE
CHANGED
|
@@ -1,185 +1,240 @@
|
|
|
1
|
-
# Nakafa Source Available License
|
|
1
|
+
# Nakafa Source Available License 2.0
|
|
2
2
|
|
|
3
|
-
Effective date:
|
|
3
|
+
Effective date: October 24, 2026
|
|
4
4
|
|
|
5
5
|
Copyright (c) 2026 PT NAKAFA TEKNO KREATIF. All rights reserved.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Nakafa is source available. It is not open source, and it is not free to
|
|
8
|
+
reuse. The source is public for one reason: so that anyone can read it, audit
|
|
9
|
+
it, and understand how Nakafa works. It is not public so that anyone can copy
|
|
10
|
+
it, fork it, rebrand it, publish it, or gain anything from it.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
`Nakafa` means the software, source code, build files, configuration, scripts,
|
|
15
|
-
database schema, prompts, UI, and related code made available in this repository.
|
|
16
|
-
|
|
17
|
-
`You` means the individual or entity receiving or using Nakafa.
|
|
18
|
-
|
|
19
|
-
`Personal use` means use by one individual for that individual's own learning,
|
|
20
|
-
research, testing, security review, or hobby evaluation. Personal use does not
|
|
21
|
-
include use for an employer, client, school, organization, product, service,
|
|
22
|
-
team, or business purpose.
|
|
12
|
+
By reading, cloning, downloading, forking, running, or otherwise using Nakafa,
|
|
13
|
+
you accept this license. If you do not accept it, do not use Nakafa.
|
|
23
14
|
|
|
24
|
-
|
|
25
|
-
without making Nakafa available to any other person over the internet, an
|
|
26
|
-
intranet, a private network, a shared server, or any hosted environment.
|
|
15
|
+
## 1. Definitions
|
|
27
16
|
|
|
28
|
-
`
|
|
29
|
-
|
|
17
|
+
`Nakafa` means the software in this repository, in the Aksara repository, and
|
|
18
|
+
in every earlier version of them: source code, build files, configuration,
|
|
19
|
+
scripts, database schema, prompts, tests, documentation, user interface,
|
|
20
|
+
design, and the material the software produces or the official services serve.
|
|
21
|
+
|
|
22
|
+
`Official services` means `https://nakafa.com`, its subdomains, and the
|
|
23
|
+
official Nakafa apps and APIs.
|
|
24
|
+
|
|
25
|
+
`You` means the person or entity that receives, reads, or uses Nakafa.
|
|
26
|
+
|
|
27
|
+
`Benefit` means any advantage, with or without money, for you or for anyone
|
|
28
|
+
else. It includes revenue, payment, salary, sponsorship, advertising or
|
|
29
|
+
affiliate income, donations, grants, prizes, followers, subscribers, views,
|
|
30
|
+
likes, audience growth, attention, virality, reputation, portfolio or career
|
|
31
|
+
value, hiring, investment, traffic, leads, data, and any product or
|
|
32
|
+
competitive advantage. These are not a Benefit: learning that stays private to
|
|
33
|
+
one person; a grade, score, or certificate that a school, university, or exam
|
|
34
|
+
body gives you for your own work; and submitting a contribution to an official
|
|
35
|
+
Nakafa repository under `.github/CONTRIBUTING.md`, with the public record of
|
|
36
|
+
that submission.
|
|
37
|
+
|
|
38
|
+
`Personal private use` means use by one natural person, alone, for that
|
|
39
|
+
person's own learning, audit, or evaluation, that produces no Benefit and is
|
|
40
|
+
not done for, shown to, or shared with any employer, client, school,
|
|
41
|
+
organization, team, community, channel, or social media account. Using the
|
|
42
|
+
official services with your own account under their terms is personal private
|
|
43
|
+
use.
|
|
44
|
+
|
|
45
|
+
`Publish` means to make something available to, or perceivable by, anyone other
|
|
46
|
+
than you, by any means. It includes repositories, forks, mirrors, archives,
|
|
47
|
+
packages, releases, hosted or deployed instances whether public or private,
|
|
48
|
+
screenshots, recordings, live streams, videos, posts, articles, courses,
|
|
49
|
+
slides, talks, demos, datasets, and output of AI systems.
|
|
50
|
+
|
|
51
|
+
`Copy` means a reproduction of Nakafa in whole or in part, or a modified
|
|
52
|
+
version, translation, port, or reimplementation that reproduces Nakafa's code
|
|
53
|
+
or content, whether made by hand or with AI tools. Ideas, methods, and
|
|
54
|
+
functions are not protected by this license; work that does not reproduce
|
|
55
|
+
Nakafa's code or content is not a copy, even if it covers the same subject.
|
|
56
|
+
|
|
57
|
+
`Written permission` means a written agreement signed by an authorized
|
|
58
|
+
representative of PT NAKAFA TEKNO KREATIF, or a written approval sent from the
|
|
59
|
+
official address in Section 15 that names you and the exact use it allows. A
|
|
60
|
+
written permission given before the effective date stays valid for the use it
|
|
61
|
+
covers.
|
|
30
62
|
|
|
31
63
|
## 2. Scope
|
|
32
64
|
|
|
33
|
-
This license applies to
|
|
34
|
-
file
|
|
35
|
-
|
|
36
|
-
This license does not apply to:
|
|
65
|
+
This license applies to Nakafa unless a license file names a different license
|
|
66
|
+
for a file. It does not apply to:
|
|
37
67
|
|
|
38
|
-
- Third-party dependencies, packages, services, fonts,
|
|
68
|
+
- Third-party dependencies, packages, services, fonts, and libraries, which keep
|
|
39
69
|
their own licenses.
|
|
40
70
|
- Educational content, articles, exercises, explanations, datasets, copy,
|
|
41
|
-
images, video, audio, and other non-code
|
|
42
|
-
|
|
43
|
-
- The Nakafa name, logos, domains, product names,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
images, video, audio, and other non-code material, which `CONTENT_LICENSE.md`
|
|
72
|
+
covers.
|
|
73
|
+
- The Nakafa name, logos, domains, product names, mascot, characters, and visual
|
|
74
|
+
identity, which `TRADEMARKS.md` covers.
|
|
75
|
+
|
|
76
|
+
All rights that this license does not expressly grant are reserved by
|
|
77
|
+
PT NAKAFA TEKNO KREATIF.
|
|
78
|
+
|
|
79
|
+
## 3. What You May Do
|
|
80
|
+
|
|
81
|
+
Without written permission, you may do only the following:
|
|
82
|
+
|
|
83
|
+
- Use the official services under their terms.
|
|
84
|
+
- Read, view, inspect, audit, and study the source code, including how it works,
|
|
85
|
+
only within personal private use.
|
|
86
|
+
- Keep one copy of Nakafa, plus any backup copy that applicable law lets you
|
|
87
|
+
make, run it, and change it, only within personal private use.
|
|
88
|
+
- Ask an AI system to explain or review Nakafa that you lawfully have, for your
|
|
89
|
+
own personal private use, with a setting that does not keep or train on your
|
|
90
|
+
input where your provider offers one, without publishing the output.
|
|
91
|
+
- Create a fork on GitHub only to prepare and submit a pull request to an
|
|
92
|
+
official Nakafa repository. The fork may not be used for anything else: no
|
|
93
|
+
releases, packages, pages, deployments, promotion, or independent
|
|
94
|
+
development. Delete it within 7 days after the pull request is merged or
|
|
95
|
+
closed, and in any case when it has had no open pull request for 14 days.
|
|
96
|
+
GitHub's terms let any user create a fork of a public repository; this
|
|
97
|
+
license grants no other right in that fork.
|
|
98
|
+
- Report security issues privately as `SECURITY.md` describes, and open issues
|
|
99
|
+
and pull requests under `.github/CONTRIBUTING.md`, without pasting Nakafa's
|
|
100
|
+
code into them beyond the lines needed to show the problem.
|
|
101
|
+
- Mention Nakafa by name and link to an official repository or to
|
|
102
|
+
`https://nakafa.com`, truthfully, without reproducing Nakafa, as
|
|
103
|
+
`TRADEMARKS.md` allows.
|
|
69
104
|
|
|
70
105
|
These permissions are personal, limited, non-exclusive, non-transferable, and
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
## 4.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
## 5.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
your
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
106
|
+
non-sublicensable.
|
|
107
|
+
|
|
108
|
+
## 4. What Is Forbidden
|
|
109
|
+
|
|
110
|
+
Everything that Section 3 does not list is forbidden without written
|
|
111
|
+
permission. In particular, you may not:
|
|
112
|
+
|
|
113
|
+
- Publish Nakafa or any copy, in whole or in part.
|
|
114
|
+
- Fork, mirror, redistribute, package, sublicense, sell, rent, lend, host, or
|
|
115
|
+
deploy Nakafa or any copy, for anyone, including on a private network or for
|
|
116
|
+
a team, school, or organization.
|
|
117
|
+
- Rebrand, rename, or white-label Nakafa or any copy, or present it as your own
|
|
118
|
+
work, as someone else's work, or as a new or independent project.
|
|
119
|
+
- Use Nakafa or any copy to obtain any Benefit, for you or for anyone else,
|
|
120
|
+
except the search and answer use that `CONTENT_LICENSE.md` Section 4 allows.
|
|
121
|
+
- Use Nakafa's code, content, structure, or output, or anything you learned
|
|
122
|
+
from them, in any work shown to or shared with anyone other than you,
|
|
123
|
+
including an explanation, review, walkthrough, tutorial, talk, slide deck,
|
|
124
|
+
course, quiz, lesson, or rewritten text, whether or not it copies the words
|
|
125
|
+
or code.
|
|
126
|
+
- Use Nakafa for or within any employer, client, school, organization, team,
|
|
127
|
+
community, product, service, course, competition, hackathon, channel, or
|
|
128
|
+
account, other than your own use of the official services.
|
|
129
|
+
- Show, record, stream, or post Nakafa's source code, your copy, your changed
|
|
130
|
+
version, or their screens or output.
|
|
131
|
+
- Train, fine-tune, evaluate, or benchmark an AI model with Nakafa; build a
|
|
132
|
+
dataset, embedding store, or retrieval index from it; have an AI system or
|
|
133
|
+
another person rewrite, translate, port, or reimplement Nakafa from your
|
|
134
|
+
reading of it; or give Nakafa to an AI system except as Section 3 allows.
|
|
135
|
+
- Remove, hide, or change any copyright, license, attribution, source, or
|
|
136
|
+
brand notice.
|
|
137
|
+
- Get around any access control or technical protection of the official
|
|
138
|
+
services.
|
|
139
|
+
|
|
140
|
+
## 5. Credit Is Not Permission
|
|
141
|
+
|
|
142
|
+
Credit, attribution, or a link to Nakafa does not make a forbidden use allowed.
|
|
143
|
+
This is true whether the credit comes before, during, or after the use,
|
|
144
|
+
including after a post has spread or gone viral. Deleting a post or
|
|
145
|
+
apologizing later does not undo a breach or the Benefit already obtained.
|
|
146
|
+
|
|
147
|
+
## 6. Brand, Content, Hosting, and Contributions
|
|
148
|
+
|
|
149
|
+
This license grants no right in the Nakafa brand; see `TRADEMARKS.md`. It grants
|
|
150
|
+
no right in Nakafa content; see `CONTENT_LICENSE.md`.
|
|
151
|
+
|
|
152
|
+
Nakafa's repositories are hosted by a third-party platform whose own terms may
|
|
153
|
+
let that platform use hosted content. This license grants no such right to
|
|
154
|
+
anyone else.
|
|
155
|
+
|
|
156
|
+
Contributions are made under `.github/CONTRIBUTING.md`; do not contribute if you
|
|
157
|
+
cannot grant the rights it describes.
|
|
158
|
+
|
|
159
|
+
## 7. Termination and Remedies
|
|
160
|
+
|
|
161
|
+
Sections 3, 4, and 5 are conditions of your rights. If you breach a condition,
|
|
162
|
+
your rights end automatically, without notice. For any other breach,
|
|
163
|
+
PT NAKAFA TEKNO KREATIF may give written notice, and your rights end if you do
|
|
164
|
+
not cure the breach within 30 days after it. Where copyright or another right
|
|
165
|
+
protects a use, using it after your rights end is infringement.
|
|
166
|
+
|
|
167
|
+
When your rights end, you must stop using Nakafa, delete every copy, fork,
|
|
168
|
+
clone, mirror, deployment, recording, and post under your control within two
|
|
169
|
+
business days, except copies you must keep to comply with law, and confirm the
|
|
170
|
+
deletion in writing when PT NAKAFA TEKNO KREATIF asks.
|
|
171
|
+
|
|
172
|
+
PT NAKAFA TEKNO KREATIF may seek every remedy the law allows, including
|
|
173
|
+
takedowns, injunctions, damages, and the value of any Benefit obtained through
|
|
174
|
+
the breach. Only PT NAKAFA TEKNO KREATIF can reinstate your rights, and only by
|
|
175
|
+
written permission. Sections 5 and 7 to 14 continue after your rights end.
|
|
176
|
+
|
|
177
|
+
## 8. Rights the Law Gives You
|
|
178
|
+
|
|
179
|
+
This license does not limit any right that applicable law gives you and that a
|
|
180
|
+
contract cannot remove. Nothing in it stops you, while you lawfully use Nakafa,
|
|
181
|
+
from making a backup copy you need, from observing, studying, or testing how a
|
|
182
|
+
program works, or from decompiling it for interoperability, to the extent the
|
|
183
|
+
law does not let a contract stop these acts; nor does it remove statutory
|
|
184
|
+
exceptions for quotation, education, and research. It does not expand those
|
|
185
|
+
rights either, and any use under them must name Nakafa as the source.
|
|
186
|
+
|
|
187
|
+
## 9. Moral Rights
|
|
188
|
+
|
|
189
|
+
The authors' moral rights, including the right to be named and the right to
|
|
190
|
+
object to distortion, are not waived.
|
|
140
191
|
|
|
141
192
|
## 10. No Warranty
|
|
142
193
|
|
|
143
194
|
Nakafa is provided "as is" and "as available", without warranties or conditions
|
|
144
|
-
of any kind, whether express, implied, statutory, or otherwise.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
complete, uninterrupted, error-free, fit for a particular purpose, or
|
|
148
|
-
non-infringing.
|
|
195
|
+
of any kind, whether express, implied, statutory, or otherwise. PT NAKAFA TEKNO
|
|
196
|
+
KREATIF does not warrant that Nakafa is accurate, secure, complete,
|
|
197
|
+
uninterrupted, error-free, fit for a particular purpose, or non-infringing.
|
|
149
198
|
|
|
150
199
|
## 11. Limitation of Liability
|
|
151
200
|
|
|
152
|
-
To the fullest extent
|
|
153
|
-
|
|
154
|
-
|
|
201
|
+
To the fullest extent the law allows, PT NAKAFA TEKNO KREATIF is not liable for
|
|
202
|
+
any indirect, incidental, special, consequential, exemplary, punitive, or
|
|
203
|
+
similar damages, or for any loss of profits, revenue, data, goodwill, or
|
|
155
204
|
business opportunity, arising from or related to Nakafa or this license.
|
|
156
205
|
|
|
157
206
|
## 12. Governing Law and Venue
|
|
158
207
|
|
|
159
|
-
This license
|
|
160
|
-
regard to conflict of law principles.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
to
|
|
164
|
-
Republic of Indonesia
|
|
165
|
-
|
|
166
|
-
|
|
208
|
+
This license's contract terms are governed by the laws of the Republic of
|
|
209
|
+
Indonesia, without regard to conflict of law principles. Copyright and trademark
|
|
210
|
+
infringement is governed by the law of each country where protection is sought.
|
|
211
|
+
Nothing in this license removes a consumer's right to bring a claim at home or
|
|
212
|
+
to rely on the mandatory protections of their home law. Other disputes are
|
|
213
|
+
decided by the courts of the Republic of Indonesia, except where the law
|
|
214
|
+
forbids this. PT NAKAFA TEKNO KREATIF may also seek an injunction or other
|
|
215
|
+
relief in any court where the infringing use takes place or that has
|
|
216
|
+
jurisdiction over you.
|
|
167
217
|
|
|
168
|
-
|
|
169
|
-
waive the right to enforce that term later.
|
|
218
|
+
## 13. Earlier Versions
|
|
170
219
|
|
|
171
|
-
|
|
220
|
+
A copy that you lawfully received before the effective date under version 1.0
|
|
221
|
+
stays under version 1.0 for that copy, and only for the acts version 1.0
|
|
222
|
+
allowed. Every act you start on or after the effective date, including a fork,
|
|
223
|
+
publication, recording, post, Benefit, or AI use, is under this version.
|
|
224
|
+
Version 1.0 is the text at commit ec5cb15359fcab334397fe0dc42730d52a2330d3 of
|
|
225
|
+
the nakafa.com repository and commit 9b8cbbd9cc82704d9d7e36af04eb6bb439953fcd
|
|
226
|
+
of the Aksara repository.
|
|
172
227
|
|
|
173
|
-
## 14. Severability
|
|
228
|
+
## 14. No Waiver and Severability
|
|
174
229
|
|
|
175
|
-
If
|
|
176
|
-
|
|
177
|
-
enforceable while preserving the original intent.
|
|
230
|
+
If PT NAKAFA TEKNO KREATIF does not enforce a term at once, it keeps the right
|
|
231
|
+
to enforce it later. A waiver counts only as written permission.
|
|
178
232
|
|
|
179
|
-
|
|
233
|
+
If a court finds any part of this license unenforceable, the rest stays in
|
|
234
|
+
effect, and that part is read as narrowly as needed to be enforceable while
|
|
235
|
+
keeping its purpose.
|
|
180
236
|
|
|
181
|
-
|
|
182
|
-
private-label, rebrand, AI-training, or other non-personal use requires a
|
|
183
|
-
separate written agreement.
|
|
237
|
+
## 15. Contact
|
|
184
238
|
|
|
185
|
-
|
|
239
|
+
Written permission, licensing questions, and reports of misuse:
|
|
240
|
+
nakafaai@gmail.com
|
package/README.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
This package defines exact runtime contracts for the Aksara compiler and
|
|
4
4
|
publisher. Nakafa runtime consumes the exact published contract: a proven npm
|
|
5
|
-
package, its immutable release archive, and
|
|
5
|
+
package, its immutable release archive, and the renderer manifest that its
|
|
6
|
+
releases sign.
|
|
6
7
|
|
|
7
8
|
This package contains schemas, branded identifiers, canonical wire encodings,
|
|
8
9
|
and Web Crypto signature verification. It contains no corpus, renderer
|
|
@@ -11,9 +12,8 @@ runtime.
|
|
|
11
12
|
|
|
12
13
|
Consumers install the exact `@nakafa/aksara-contracts` version from npm and
|
|
13
14
|
commit its pnpm lockfile integrity. npm provenance and the matching immutable
|
|
14
|
-
GitHub Release bind those package bytes to the reviewed Aksara source.
|
|
15
|
-
|
|
16
|
-
renderer is live.
|
|
15
|
+
GitHub Release bind those package bytes to the reviewed Aksara source. A contract
|
|
16
|
+
change ships with the Nakafa renderer that consumes it, in one step.
|
|
17
17
|
|
|
18
18
|
Node-only writer and incremental digest exports remain isolated behind package
|
|
19
19
|
conditions. Default-runtime exports used by Convex are audited to reject
|
|
@@ -25,6 +25,9 @@ remains trusted executable source.
|
|
|
25
25
|
|
|
26
26
|
Current consumers use unversioned semantic Interfaces:
|
|
27
27
|
|
|
28
|
+
- `tree` owns the signed content tree: a fragment of intrinsic tags, renderer
|
|
29
|
+
components, and text, whose props are JSON data or nested elements.
|
|
30
|
+
`canonicalizeContentTree` gives the bytes that hashes and signatures cover.
|
|
28
31
|
- `graph/family` classifies either a complete graph identity or one exact
|
|
29
32
|
asset ID into its application locale and content family.
|
|
30
33
|
- `tryout/catalog` owns minimal catalog node schemas, while `tryout/identity`
|
|
@@ -65,9 +68,9 @@ Current consumers use unversioned semantic Interfaces:
|
|
|
65
68
|
with typed `figure` props, twelve `interaction` kinds that hold no answer
|
|
66
69
|
key, `scoring` as data, the `key` and the `explanation` of an item version as
|
|
67
70
|
records of their own, `item` and `stimulus` versions named by a content hash,
|
|
68
|
-
and the exam `profile`, the frozen `paper`, and the `tools` registry. It
|
|
69
|
-
|
|
70
|
-
switches their readers deletes
|
|
71
|
+
and the exam `profile`, the frozen `paper`, and the `tools` registry. It is
|
|
72
|
+
the successor to the `question/` and `tryout/` contracts, which the change that
|
|
73
|
+
switches their readers deletes.
|
|
71
74
|
[ADR 0005](https://github.com/nakafaai/aksara/blob/main/docs/adr/assessment.md)
|
|
72
75
|
records the decisions.
|
|
73
76
|
|
|
@@ -106,9 +109,9 @@ it still publishes the selected domain and contains every required component
|
|
|
106
109
|
name. Every current manifest contains the complete canonical domain set. The same
|
|
107
110
|
contract validates stored and deployed manifests. A renderer-changing release
|
|
108
111
|
remains bound to the exact deployed manifest. A scoped content-only release may
|
|
109
|
-
retain the active frozen manifest only when activation proves the live renderer
|
|
110
|
-
domain and contains every frozen component name. The
|
|
111
|
-
third signed value. Current production trusts authenticated
|
|
112
|
+
retain the active frozen manifest only when activation proves the live renderer
|
|
113
|
+
still publishes every frozen domain and contains every frozen component name. The
|
|
114
|
+
renderer is not a third signed value. Current production trusts authenticated
|
|
112
115
|
Convex state for route/head membership, delivery class, and the active pointer;
|
|
113
116
|
a release result digest is not a per-row inclusion proof. This boundary is
|
|
114
117
|
recorded explicitly in
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { ArtifactHashComputationError, ArtifactHashMismatchError, ArtifactVerificationDecodeError } from "#contracts/artifact/spec";
|
|
2
|
+
import { ArtifactHashComputationError, ArtifactHashMismatchError, ArtifactTreeComponentUnlistedError, ArtifactVerificationDecodeError } from "#contracts/artifact/spec";
|
|
3
3
|
/** Computes the immutable identity of one canonical compiled payload. */
|
|
4
4
|
export declare const hashCompiledContentPayload: (payload: {
|
|
5
5
|
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
6
|
-
readonly byteLength: number;
|
|
7
|
-
readonly compiledCode: string;
|
|
8
6
|
readonly compilerConfigHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
9
|
-
readonly compilerVersion: "0.
|
|
7
|
+
readonly compilerVersion: "0.2.0";
|
|
10
8
|
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
11
|
-
readonly
|
|
9
|
+
readonly contentTree: {
|
|
10
|
+
readonly $node: "element";
|
|
11
|
+
readonly children: readonly import("#contracts/tree").ContentTreeChild[];
|
|
12
|
+
readonly name: import("#contracts/tree").ContentTreeElementName;
|
|
13
|
+
readonly props: {
|
|
14
|
+
readonly [key: string]: import("#contracts/tree").ContentTreeValue;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
readonly format: "content-tree";
|
|
12
18
|
readonly mdxCompilerVersion: "3.1.1";
|
|
13
19
|
readonly plainText: string;
|
|
14
20
|
readonly rawMdx: string;
|
|
@@ -22,12 +28,18 @@ export declare const verifySignedContentArtifactIntegrity: (input: unknown) => E
|
|
|
22
28
|
readonly keyId: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSigningKeyId">;
|
|
23
29
|
readonly payload: {
|
|
24
30
|
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
25
|
-
readonly byteLength: number;
|
|
26
|
-
readonly compiledCode: string;
|
|
27
31
|
readonly compilerConfigHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
28
|
-
readonly compilerVersion: "0.
|
|
32
|
+
readonly compilerVersion: "0.2.0";
|
|
29
33
|
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
30
|
-
readonly
|
|
34
|
+
readonly contentTree: {
|
|
35
|
+
readonly $node: "element";
|
|
36
|
+
readonly children: readonly import("#contracts/tree").ContentTreeChild[];
|
|
37
|
+
readonly name: import("#contracts/tree").ContentTreeElementName;
|
|
38
|
+
readonly props: {
|
|
39
|
+
readonly [key: string]: import("#contracts/tree").ContentTreeValue;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly format: "content-tree";
|
|
31
43
|
readonly mdxCompilerVersion: "3.1.1";
|
|
32
44
|
readonly plainText: string;
|
|
33
45
|
readonly rawMdx: string;
|
|
@@ -36,4 +48,4 @@ export declare const verifySignedContentArtifactIntegrity: (input: unknown) => E
|
|
|
36
48
|
readonly sourceHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
37
49
|
};
|
|
38
50
|
readonly signature: string & import("effect/Brand").Brand<"@NakafaAI/AksaraEd25519Signature">;
|
|
39
|
-
},
|
|
51
|
+
}, ArtifactHashComputationError | ArtifactHashMismatchError | import("#contracts/artifact/spec").ArtifactPayloadFieldByteLimitError | import("#contracts/artifact/spec").ArtifactSourceHashComputationError | import("#contracts/artifact/spec").ArtifactSourceHashMismatchError | ArtifactTreeComponentUnlistedError | import("#contracts/artifact/spec").ArtifactVerificationByteLimitError | ArtifactVerificationDecodeError | import("../signature/spec.js").PublicKeyParseError | import("../signature/spec.js").PublicKeyTypeError | import("../signature/spec.js").SignatureCheckError | import("../signature/spec.js").SignatureInvalidError | import("../signature/spec.js").SigningKeyNotFoundError | import("../signature/spec.js").SigningKeyResolutionError, import("../signature/spec.js").ContentVerificationKeyResolver>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Effect, Schema } from "effect";
|
|
1
|
+
import { Array as Arr, Effect, Option, Schema } from "effect";
|
|
2
2
|
import { validateArtifactByteIntegrity } from "#contracts/artifact/limits";
|
|
3
3
|
import { verifyCompiledContentSourceHash } from "#contracts/artifact/source";
|
|
4
|
-
import { ArtifactHashComputationError, ArtifactHashMismatchError, ArtifactVerificationDecodeError, } from "#contracts/artifact/spec";
|
|
4
|
+
import { ArtifactHashComputationError, ArtifactHashMismatchError, ArtifactTreeComponentUnlistedError, ArtifactVerificationDecodeError, } from "#contracts/artifact/spec";
|
|
5
5
|
import { canonicalizeCompiledContentPayload, canonicalizeContentArtifactSigningInput, SignedContentArtifactSchema, } from "#contracts/content";
|
|
6
6
|
import { hashText } from "#contracts/hash/text";
|
|
7
7
|
import { verifyEd25519Signature } from "#contracts/signature/verify";
|
|
8
|
+
import { contentTreeComponentNames } from "#contracts/tree";
|
|
8
9
|
/** Computes the immutable identity of one canonical compiled payload. */
|
|
9
10
|
export const hashCompiledContentPayload = Effect.fn("AksaraContracts.hashCompiledContentPayload")((payload) => hashText(canonicalizeCompiledContentPayload(payload)).pipe(Effect.mapError(() => new ArtifactHashComputationError({ contentKey: payload.contentKey }))));
|
|
10
11
|
/** Confirms that an artifact envelope identifies its canonical payload. */
|
|
@@ -18,6 +19,18 @@ function validateArtifactHash(artifact, actualHash) {
|
|
|
18
19
|
expectedHash: artifact.artifactHash,
|
|
19
20
|
}));
|
|
20
21
|
}
|
|
22
|
+
/** Confirms that every component the content tree renders is one the artifact requires. */
|
|
23
|
+
function validateTreeComponents(payload) {
|
|
24
|
+
const declared = payload.requiredComponents;
|
|
25
|
+
const unlisted = Arr.findFirst(contentTreeComponentNames(payload.contentTree), (componentName) => !Arr.contains(declared, componentName));
|
|
26
|
+
if (Option.isNone(unlisted)) {
|
|
27
|
+
return Effect.void;
|
|
28
|
+
}
|
|
29
|
+
return Effect.fail(new ArtifactTreeComponentUnlistedError({
|
|
30
|
+
componentName: unlisted.value,
|
|
31
|
+
contentKey: payload.contentKey,
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
21
34
|
/** Verifies immutable bytes, hashes, source, and signature without a renderer. */
|
|
22
35
|
function authenticateSignedArtifact(artifact) {
|
|
23
36
|
return Effect.gen(function* () {
|
|
@@ -30,6 +43,7 @@ function authenticateSignedArtifact(artifact) {
|
|
|
30
43
|
subject: "artifact",
|
|
31
44
|
});
|
|
32
45
|
yield* validateArtifactByteIntegrity(artifact);
|
|
46
|
+
yield* validateTreeComponents(artifact.payload);
|
|
33
47
|
yield* verifyCompiledContentSourceHash(artifact.payload);
|
|
34
48
|
return artifact;
|
|
35
49
|
});
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import {
|
|
3
|
-
/** Verifies complete wire
|
|
2
|
+
import { ArtifactPayloadFieldByteLimitError, ArtifactVerificationByteLimitError } from "#contracts/artifact/spec";
|
|
3
|
+
/** Verifies the complete wire and every bounded payload field. */
|
|
4
4
|
export declare const validateArtifactByteIntegrity: (artifact: {
|
|
5
5
|
readonly artifactHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
6
6
|
readonly keyId: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSigningKeyId">;
|
|
7
7
|
readonly payload: {
|
|
8
8
|
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
9
|
-
readonly byteLength: number;
|
|
10
|
-
readonly compiledCode: string;
|
|
11
9
|
readonly compilerConfigHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
12
|
-
readonly compilerVersion: "0.
|
|
10
|
+
readonly compilerVersion: "0.2.0";
|
|
13
11
|
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
14
|
-
readonly
|
|
12
|
+
readonly contentTree: {
|
|
13
|
+
readonly $node: "element";
|
|
14
|
+
readonly children: readonly import("#contracts/tree").ContentTreeChild[];
|
|
15
|
+
readonly name: import("#contracts/tree").ContentTreeElementName;
|
|
16
|
+
readonly props: {
|
|
17
|
+
readonly [key: string]: import("#contracts/tree").ContentTreeValue;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly format: "content-tree";
|
|
15
21
|
readonly mdxCompilerVersion: "3.1.1";
|
|
16
22
|
readonly plainText: string;
|
|
17
23
|
readonly rawMdx: string;
|
|
@@ -20,4 +26,4 @@ export declare const validateArtifactByteIntegrity: (artifact: {
|
|
|
20
26
|
readonly sourceHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
21
27
|
};
|
|
22
28
|
readonly signature: string & import("effect/Brand").Brand<"@NakafaAI/AksaraEd25519Signature">;
|
|
23
|
-
}) => Effect.Effect<
|
|
29
|
+
}) => Effect.Effect<void, ArtifactPayloadFieldByteLimitError | ArtifactVerificationByteLimitError, never>;
|