@fabricorg/assembly 0.3.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/CHANGELOG.md ADDED
@@ -0,0 +1,84 @@
1
+ # @fabricorg/assembly
2
+
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 89982ba: Lock federated component-pack delivery. A component pack may declare a `remote` with its entry URL,
8
+ a subresource-integrity value, and its exposed modules; `resolveAssembly` locks that binding in the
9
+ lockfile alongside the artifact digest, and `validateSduiRelease` rejects a release whose declared
10
+ remote does not match the locked one, or which adds or drops a remote the assembly did not.
11
+
12
+ A federated pack executes whatever its remote entry serves at load time, so an approved artifact
13
+ digest describes the pack that was reviewed rather than the code that runs. Locking the entry and
14
+ its integrity closes that gap without Fabric loading anything: the shell verifies integrity against
15
+ the lockfile before executing. The field is optional, so packs delivered any other way are unchanged.
16
+
17
+ ### Patch Changes
18
+
19
+ - 6f5471b: Close the gaps an independent review found in the grant, remote and identity work.
20
+
21
+ A capability reference object was treated as a leaf, so a granted reference could shield ungranted
22
+ ones parked beside it on the same object; sibling keys are now walked. Prop recursion is depth
23
+ bounded, so cyclic programmatic input reports a finding instead of exhausting the stack. Federated
24
+ remotes now compare their exposed-module mapping, not only entry and integrity, and the locked remote
25
+ is carried onto the promoted release so two releases differing only in their remote cannot share a
26
+ digest. Pack lookup matches full pack identity rather than namespace and name alone, and a stored
27
+ lockfile that declares one pack or capability twice is rejected rather than resolved by first match.
28
+
29
+ Grant digests omit `variants` and `fragments` when absent, so a release that declares neither digests
30
+ exactly as it did before those fields existed and previously promoted releases keep verifying.
31
+ Variants are hashed in id order, so reordering the same set no longer churns the digest. Fragment
32
+ grants written as a `{ __proto__: … }` object literal are rejected, because that sets the prototype
33
+ rather than creating the entry and the narrowing would silently disappear.
34
+
35
+ `assertActorClaimsCoverScope` no longer fails open: an invalid clock is rejected instead of making
36
+ every temporal comparison false, timestamps must be RFC 3339 with an explicit offset so a credential
37
+ cannot expire at different instants on different hosts, and `spaceIds` must be an array of strings so
38
+ a bare string cannot reach substring matching where `"space_10"` would cover `"space_1"`.
39
+
40
+ - Updated dependencies
41
+ - @fabricorg/gen-capability@0.5.0
42
+
43
+ ## 0.2.0
44
+
45
+ ### Minor Changes
46
+
47
+ - 62dd1ca: Add deterministic application assembly: versioned assembly manifests, resolved
48
+ lockfiles, and a single build gate for capabilities, component packs, and
49
+ adoption bindings. `resolveAssembly` resolves semver ranges against available
50
+ versions, rejects unresolved or duplicate capability identities, validates
51
+ usage contracts, component packs, and adoption bindings as one gate, and
52
+ produces a locked lockfile with a canonical SHA-256 digest. Lockfiles now hash
53
+ the resolved application, capability manifests, generated usage-contract
54
+ content, component-pack artifacts, and adoption bindings rather than the input
55
+ ranges. `assertAssemblyLockfile` rejects content changed after resolution.
56
+ Assembly manifest and lockfile documents move to format version 2.
57
+
58
+ ### Patch Changes
59
+
60
+ - Updated dependencies [62dd1ca]
61
+ - Updated dependencies [b932767]
62
+ - @fabricorg/adoption-bindings@0.2.1
63
+ - @fabricorg/gen-capability@0.4.1
64
+
65
+ ## 0.1.0
66
+
67
+ ### Minor Changes
68
+
69
+ - First release. Deterministic application assembly: versioned assembly manifests,
70
+ resolved lockfiles, and a single build gate for capabilities, component packs,
71
+ and adoption bindings.
72
+
73
+ `resolveAssembly` resolves semver ranges (`^`, `~`, `>=`, `>`, `<=`, `<`, `=`,
74
+ exact, `*`, compound) against available versions, rejects unresolved or
75
+ duplicate capability identities, validates usage contracts, component packs,
76
+ and adoption bindings as one gate, and produces a locked lockfile with a
77
+ canonical SHA-256 digest. `assertAssemblyResolved` throws with every finding
78
+ listed for use as a CI step.
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies
83
+ - @fabricorg/adoption-bindings@0.2.0
84
+ - @fabricorg/gen-capability@0.4.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fabric
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # `@fabricorg/assembly`
2
+
3
+ Deterministic application assembly for Fabric verticals. It takes a versioned
4
+ assembly manifest — the capabilities, component packs, adoption bindings, and
5
+ usage contracts a vertical assembles — resolves dependency ranges
6
+ deterministically, validates contracts, packs, and bindings as one build gate,
7
+ and produces a locked, digest-bearing lockfile.
8
+
9
+ ## What it does
10
+
11
+ - **Assembly manifest** (`AssemblyManifest`): a versioned declaration of what a
12
+ vertical assembles. Capabilities and component packs carry semver ranges;
13
+ bindings and generated usage-contract documents are supplied inline for
14
+ validation.
15
+ - **Lockfile** (`AssemblyLockfile`): the resolved, deterministic output. Every
16
+ capability and pack version is locked with its range and artifact digest,
17
+ generated contracts are tied to the resolved capability manifest, every
18
+ binding carries a content digest, and the whole resolved document carries a
19
+ canonical SHA-256 digest.
20
+ - **Resolution** (`resolveAssembly`): resolves semver ranges against available
21
+ versions, rejects unresolved or duplicate capability identities, validates
22
+ usage contracts, component packs, and adoption bindings, and returns every
23
+ finding rather than throwing on the first.
24
+ - **Build gate** (`assertAssemblyResolved`): throws with every finding listed,
25
+ for use as a CI step.
26
+ - **Runtime verification** (`assertAssemblyLockfile`): validates a stored or
27
+ transported lockfile and rejects any resolved content that no longer matches
28
+ its `assemblyDigest`.
29
+ - **Runtime compatibility** (`assertAssemblyRuntimeCompatible`): fails startup
30
+ unless loaded capability versions and manifest digests exactly match the
31
+ approved lockfile, including rejection of missing or extra modules.
32
+
33
+ ## Semver ranges
34
+
35
+ The resolver supports the subset of npm range syntax a deterministic lockfile
36
+ needs: `^` (caret), `~` (tilde), `>=`, `>`, `<=`, `<`, `=` (exact), bare exact
37
+ versions, `*` (wildcard), and compound ranges (`>=1.0.0 <2.0.0`). Prerelease
38
+ versions follow npm semantics: a prerelease only satisfies a range when a
39
+ comparator in the range declares a prerelease at the same `[major, minor, patch]`
40
+ tuple.
41
+
42
+ ## Usage
43
+
44
+ ```typescript
45
+ import { assertAssemblyResolved } from "@fabricorg/assembly";
46
+
47
+ const lockfile = assertAssemblyResolved({
48
+ manifest: {
49
+ formatVersion: 2,
50
+ application: "lending",
51
+ capabilities: [{ namespace: "recovery", range: "^1.0.0" }],
52
+ componentPacks: [{ pack: "lender-components", namespace: "lender", range: "^1.0.0" }],
53
+ bindings: [{ capability: "recovery", binding }],
54
+ contracts: [{ namespace: "recovery", document: usageContractDocument }],
55
+ },
56
+ capabilities: [{ namespace: "recovery", version: "1.1.0", manifestDigest: "…" }],
57
+ componentPacks: [{
58
+ pack: "lender-components",
59
+ namespace: "lender",
60
+ version: "1.1.0",
61
+ artifactDigest: "…",
62
+ }],
63
+ packManifests: [pack],
64
+ coreComponents: ["Card", "List", "DetailLayout"],
65
+ });
66
+ ```
67
+
68
+ It does not load live modules, execute handlers, or run inside
69
+ `@fabricorg/platform`. The assembly package depends on `@fabricorg/adoption-bindings`
70
+ and `@fabricorg/gen-capability` for contract and binding validation.