@volter/twin-catalog 0.2.2

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 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/README.md ADDED
@@ -0,0 +1,148 @@
1
+ # Twin catalog
2
+
3
+ The catalog admits and distributes twin packages from independent publishers. It prepares evidence for moderators;
4
+ people decide what merges. The platform and pack repositories have their own release cycles. The
5
+ [process contract](docs/process.md) defines the boundaries, states and acceptance cases.
6
+
7
+ ## Submit a release
8
+
9
+ Register a source with a pull request adding one entry to `sources.json`:
10
+
11
+ ```json
12
+ { "name": "example-team", "repository": "example/twins", "scope": "@example", "official": false, "protocol": "3", "workflow": "release.yml" }
13
+ ```
14
+
15
+ The CLI can prepare that addition in your catalog fork:
16
+
17
+ ```sh
18
+ twin-catalog register --source example-team --source-repository example/twins --scope @example
19
+ ```
20
+
21
+ It writes `sources.json` only. An installed CLI outside a fork writes `registration/sources.json`; use `--out` for
22
+ another output path. Open a separate source-registration PR before submitting releases. A matching existing source
23
+ is idempotent; conflicting registration data is refused.
24
+
25
+ After registration merges, publish a package from that public repository with npm provenance. Its package.json names
26
+ the registered repository; its generated pack facts name the vendor it simulates. A package may have any scoped npm
27
+ name. Its artifact includes the source, spec and journeys required by the released Protocol 3 standard. Build against
28
+ the published SDK and standard; no platform checkout is needed by this catalog.
29
+
30
+ In a fork of this catalog, create the submission with its released CLI or this identical repository command:
31
+
32
+ ```sh
33
+ node bin/twin-catalog.mjs submit --source example-team --vendor stripe --package @example/stripe-simulator --version 1.2.3
34
+ ```
35
+
36
+ Open a PR adding only the generated `submissions/<sha256>.json`. The CLI writes data only. Automation downloads the
37
+ exact artifact, verifies its integrity and provenance, installs dependencies without scripts, runs the standard in
38
+ an offline container and a World, and updates one feedback comment. Download the JSON report and diagnostics from
39
+ the workflow artifacts; admitted reports also have a durable evidence release and an index-package copy. Code fixes require a new published version and updated submission filename. Do not edit the
40
+ index, policy or source registration as part of a release submission.
41
+
42
+ Passing automation means ready for a maintainer decision. Untrusted-account submissions require moderator review
43
+ of the exact head before merge. Direct trusted-account submissions, including forks, and eligible internal publisher
44
+ submissions permit an authorized maintainer merge without a separate review. The catalog does not approve or merge itself. A rejection is a closed PR with a reason. Moderators are named
45
+ in `.github/CODEOWNERS`.
46
+
47
+ ## Consume the index
48
+
49
+ An unassessed historical release may be submitted with `--reassess`; its file belongs in `reassessments/` and goes
50
+ through the same checks and moderation. A version without its original provenance must be followed by a new release.
51
+
52
+ `@volter/twin-catalog` carries `sources.json`, `vendors/`, `recommendations.json`, `revocations.json` and `catalog.json`.
53
+ Vendor and package identities are separate. Multiple implementations remain visible; recommendations select a default
54
+ package when necessary. Stable approved versions are selected within that package. World pins do not move. Historical
55
+ index entries without an assessment are identified as unassessed.
56
+
57
+ ```sh
58
+ node bin/twin-catalog.mjs check
59
+ node bin/twin-catalog.mjs defaults
60
+ node bin/twin-catalog.mjs build --out /tmp/new-catalog-output
61
+ ```
62
+
63
+ The build requires committed admission records and a new output directory. It generates data without importing packs.
64
+ The website and hosted runtime consume this artifact independently; publishing it does not deploy either.
65
+
66
+ For discovery, use the JSON-only reader against an installed index:
67
+
68
+ ```sh
69
+ twin-catalog browse --root ./node_modules/@volter/twin-catalog
70
+ twin-catalog browse --root ./node_modules/@volter/twin-catalog --vendor stripe
71
+ ```
72
+
73
+ The `./browse` library export provides the same projection for a website build or another consumer:
74
+
75
+ ```js
76
+ import { browse } from '@volter/twin-catalog/browse';
77
+ const catalog = browse('./node_modules/@volter/twin-catalog');
78
+ ```
79
+
80
+ Every implementation and recorded release remains visible. An ambiguous vendor has `selection.state: "choice-required"`.
81
+ Filtering a package does not change the vendor's default. Revocation, selectability and assessment availability are
82
+ separate fields. Bound report measurements retain their original scope; absent measurements are `null`. The reader
83
+ checks snapshot and report digests without importing packs or reading Git history. `snapshot.integrity` is `null`
84
+ unless the caller supplies retained installation evidence; the reader does not verify the package tarball. See
85
+ [the read contract](docs/process.md#read-the-published-catalog).
86
+
87
+ ## Operate admission
88
+
89
+ The [operator procedure](docs/operations.md) covers failed phases, immutable retries, revocation and credential roles.
90
+
91
+ `policy.json` pins released evaluator versions and the registry. Policy changes are separate moderator-reviewed PRs.
92
+ The evaluator requires Docker on Linux with an x86-64 runner (the pinned Bun binary is linux-x64). Reports record the actual image identity and dependency lock, PR head/base,
93
+ and policy identity. Docker network isolation applies to evaluation; preparation downloads npm packages and
94
+ attestations. No credentials enter either container.
95
+
96
+ With a repository administration token in `GH_TOKEN`, inspect the proposed branch rule:
97
+
98
+ ```sh
99
+ node bin/twin-catalog.mjs configure --repository volter-ai/twin-catalog-open
100
+ ```
101
+
102
+ An authorized operator adds `--apply` to require current-head readiness, stale-review dismissal, code-owner approval,
103
+ last-push approval and administrator enforcement, and enable Actions. CODEOWNERS initially names the existing
104
+ catalog administrator, `@yueranyuan`; add other authorized people or teams there through moderator review.
105
+ Ordinary commands never modify these settings. Source and catalog repositories must be public for npm provenance;
106
+ publication needs npm trusted publishing or the workflow's scoped `NPM_TOKEN`. These are activation prerequisites,
107
+ not changes performed by implementing this process.
108
+
109
+ `policy.reviewBypassUsers` names maintainers allowed to merge direct trusted-account and internal changes without
110
+ a separate review. `policy.trustedAccounts` binds direct PR authors by GitHub numeric ID, exact login and account
111
+ type, including contributions from forks. `policy.internalRepositories` separately lists registered pack repositories
112
+ eligible for the internal publisher path. Untrusted accounts still need human review; all admissions need verified
113
+ provenance and current-head readiness. The [process contract](docs/process.md) defines these admission paths.
114
+ `policy.internalBotAuthors` binds each trusted publisher bot by GitHub user ID and exact login. It grants no
115
+ exception without the internal source, same-catalog PR and authorized maintainer merge.
116
+
117
+ The publication workflow uses a GitHub App with repository administration read, contents read, checks read and
118
+ pull requests read. Install it only on the catalog repositories, set repository variable `CATALOG_READ_APP_CLIENT_ID`
119
+ and secret `CATALOG_READ_APP_PRIVATE_KEY`, and keep its private key out of source and diagnostic output. Each job
120
+ mints a short-lived token limited to its own repository; the action revokes it after the job. Existing deployments
121
+ may supply an equivalent scoped `CATALOG_READ_TOKEN`. No administration write permission is needed by publication.
122
+ Missing policy access refuses publication. Publisher CI can run `twin-catalog propose --from <submission-directory> --send` with its
123
+ separate catalog PR token; that command opens idempotent submission PRs and never approves or merges them.
124
+
125
+ Workflow dispatch with a PR number reruns readiness after an infrastructure failure. Publication dispatch retries
126
+ the same source commit: its version derives from first-parent history, and an already published matching identity is
127
+ reused. Force pushes are forbidden. A conflicting identity fails. `publish` verifies branch protection and admission
128
+ PRs before using npm credentials. Append a `package`, `version`, and `reason` entry to `revocations.json` to remove a
129
+ release from future selection; existing World pins are preserved.
130
+
131
+ Set `CATALOG_PUBLISH_ENABLED=true` only after readiness verification and moderator setup.
132
+
133
+ Volter's pack release workflow stays inactive while its source repository is private, as required by npm provenance.
134
+ Its trusted release workflow uses `CATALOG_PR_APP_CLIENT_ID` and `CATALOG_PR_APP_PRIVATE_KEY` in the pack repository
135
+ to mint a short-lived catalog contents/pull-request write token, without administration. Install that separate App
136
+ only on the target catalogs. Existing scoped `CATALOG_PR_TOKEN` configuration remains supported. Outside publishers
137
+ use their own GitHub accounts/forks, never Volter's App key. Source visibility exposes Git history and remains an
138
+ explicit owner decision.
139
+
140
+ [Build in your own repository](docs/contributing.md) uses the released tools.
141
+
142
+ Browser pages are separate work. JSON reports distinguish quick replay from full admission conformance; unmeasured
143
+ DOM, line and state coverage remain explicit. Readiness artifacts are evidence, not a fidelity guarantee.
144
+
145
+ A publisher that has just completed npm upload can use `submit --confirm-published` to wait for its exact
146
+ version metadata before opening a PR. Only HTTP 404 is retried, every 15 seconds for at most ten minutes, based
147
+ on [the registry measurement](docs/measurements/registry-confirmation.json). Other errors and identity mismatches
148
+ fail immediately. This option performs registry reads only; it never uploads or evaluates a package.
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readFileSync } from 'node:fs';
3
+ import { dirname, join, resolve } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { loadIndex, defaults, read, write, requireThat, stable, submissionId, validateSubmission } from '../lib/model.mjs';
6
+ import { metadata } from '../lib/registry.mjs';
7
+ import { GitHub } from '../lib/github.mjs';
8
+ import { assessPullRequest, configure } from '../lib/automation.mjs';
9
+ import { build, builtIndex, publish, verifyAdmission } from '../lib/publication.mjs';
10
+ import { persistEvidence } from '../lib/evidence.mjs';
11
+ import { propose } from '../lib/propose.mjs';
12
+ import { browse } from '../lib/browse.mjs';
13
+ import { register } from '../lib/register.mjs';
14
+
15
+ const [command, ...args] = process.argv.slice(2);
16
+ const arg = (name, fallback) => { const at = args.indexOf(`--${name}`); if (at < 0) return fallback; requireThat(args[at + 1] && !args[at + 1].startsWith('--'), `--${name} needs a value`); return args[at + 1]; };
17
+ const root = resolve(arg('root', process.cwd()));
18
+ const installed = resolve(dirname(fileURLToPath(import.meta.url)), '..');
19
+ const policy = () => read(join(existsSync(join(root, 'policy.json')) ? root : installed, 'policy.json'));
20
+ const github = () => new GitHub(arg('repository', process.env.GITHUB_REPOSITORY ?? 'volter-ai/twin-catalog-open'), process.env.GH_TOKEN ?? process.env.GITHUB_TOKEN);
21
+ try {
22
+ let result;
23
+ switch (command) {
24
+ case 'browse': {
25
+ const indexRoot = args.includes('--root') || existsSync(join(root, 'catalog.json')) ? root : installed;
26
+ result = browse(indexRoot, { vendor: arg('vendor'), package: arg('package'), integrity: arg('integrity', null) });
27
+ break;
28
+ }
29
+ case 'register': {
30
+ const fork = existsSync(join(root, 'sources.json'));
31
+ const indexRoot = fork ? root : installed;
32
+ result = register(read(join(indexRoot, 'sources.json')), {
33
+ name: arg('source'), repository: arg('source-repository'), scope: arg('scope'),
34
+ official: args.includes('--official'), protocol: '3', workflow: arg('workflow', 'release.yml')
35
+ }, resolve(arg('out', join(root, fork ? 'sources.json' : 'registration/sources.json'))));
36
+ break;
37
+ }
38
+ case 'submit': {
39
+ const indexRoot = existsSync(join(root, 'sources.json')) ? root : installed;
40
+ const p = policy();
41
+ const doc = await metadata(arg('package'), arg('version'), p.registry, fetch, args.includes('--confirm-published') ? {} : undefined);
42
+ const submission = { schemaVersion: 1, source: arg('source'), vendor: arg('vendor'), package: doc.name, version: doc.version, integrity: doc.dist?.integrity };
43
+ validateSubmission(submission, loadIndex(indexRoot).sources);
44
+ const file = resolve(arg('out', join(resolve(arg('out-dir', join(root, args.includes('--reassess') ? 'reassessments' : 'submissions'))), `${submissionId(submission)}.json`)));
45
+ requireThat(file.endsWith(`/${submissionId(submission)}.json`), 'output must be named for the submission identity');
46
+ if (existsSync(file)) requireThat(stable(read(file)) === stable(submission), 'submission output already exists with different content');
47
+ write(file, submission);
48
+ result = { file, submission, next: 'Open a pull request adding only this submission file to the catalog. No publication or PR was performed.' };
49
+ break;
50
+ }
51
+ case 'defaults': result = defaults(builtIndex(existsSync(join(root, 'sources.json')) ? root : installed)); break;
52
+ case 'check': result = { valid: Boolean(builtIndex(existsSync(join(root, 'sources.json')) ? root : installed)) }; break;
53
+ case 'assess-pr': {
54
+ const event = process.env.GITHUB_EVENT_PATH ? read(process.env.GITHUB_EVENT_PATH) : {};
55
+ result = await assessPullRequest(root, github(), Number(arg('pr', process.env.CATALOG_PR ?? event.pull_request?.number)), resolve(arg('out', 'assessment/report.json')));
56
+ if (result.status !== 'ready') process.exitCode = 1;
57
+ break;
58
+ }
59
+ case 'configure': result = await configure(github(), args.includes('--apply'), policy().reviewBypassUsers ?? []); break;
60
+ case 'propose': {
61
+ requireThat(args.includes('--send'), 'propose opens GitHub PRs; pass --send for this explicit publisher action');
62
+ result = await propose(github(), resolve(arg('from', args.includes('--reassess') ? 'reassessments' : 'submissions')), args.includes('--reassess'));
63
+ break;
64
+ }
65
+ case 'build': result = build(root, resolve(arg('out', 'dist'))); break;
66
+ case 'publish': {
67
+ const client = github();
68
+ const policyClient = process.env.CATALOG_READ_TOKEN ? new GitHub(client.repository, process.env.CATALOG_READ_TOKEN) : client;
69
+ const proofs = await verifyAdmission(root, client, policyClient);
70
+ const evidence = await persistEvidence(proofs, client);
71
+ const output = resolve(arg('out', 'dist'));
72
+ build(root, output, evidence);
73
+ result = await publish(output, policy().registry);
74
+ break;
75
+ }
76
+ default: throw new Error('usage: twin-catalog register --source <id> --source-repository <owner/repo> --scope <@scope> [--out <sources.json>] | submit --source <id> --vendor <vendor> --package <@scope/name> --version <exact> | browse [--root <installed-index>] [--vendor <vendor>] [--package <@scope/name>] | assess-pr --pr <number> | check | defaults | build --out <new-directory> | publish | configure [--apply] | propose --from <submission-directory> --send');
77
+ }
78
+ console.log(JSON.stringify(result, null, 2));
79
+ } catch (error) { console.error(`twin-catalog: ${error.message ?? error}`); process.exitCode = 1; }
package/catalog.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "sourceCommit": "646cb5db50f24248f177e1fab1ccdeb681e7005b",
4
+ "digest": "1c1ad9dfb2fd6cba0923988b3a1f17c6da892efc3a5ec36f230a91c88a437ff6",
5
+ "versions": []
6
+ }
@@ -0,0 +1,91 @@
1
+ # Publish from your own repository
2
+
3
+ The catalog accepts independently named packages from independently owned repositories. Use the released standard,
4
+ not scripts from a platform checkout. Read the [process](process.md) for identity, assessment and moderator authority.
5
+
6
+ ## Build a pack
7
+
8
+ Install Bun at the catalog policy's version and the public `@volter/world-core`, `@volter/world-runtime` and
9
+ `@volter/twin-standard` versions in `policy.json`. Install TypeScript and its Node/Bun types as development dependencies.
10
+ Keep the package directory named for the vendor; its npm package name is independent.
11
+
12
+ ```sh
13
+ bunx --bun twin-standard create stripe --init stripe --package @example/payments
14
+ ```
15
+
16
+ The generated files contain explicit fill markers. Author the vendored spec and its provenance, demand, manifest,
17
+ stored resource states, decision table, handlers and customer journey in the standard's required order. The package
18
+ README describes its vendor surface, refusals and limits. Declare your own public GitHub repository and license in
19
+ package.json. Complete source requirements before derivation:
20
+
21
+ ```sh
22
+ bunx --bun twin-standard check-sources stripe
23
+ bunx --bun twin-standard derive stripe
24
+ bunx --bun twin-standard create stripe --index
25
+ bunx --bun twin-standard facts stripe
26
+ ```
27
+
28
+ The command has the same handler-map and kernel contract as Volter's own wrapper. The generated facts belong in the
29
+ package artifact; keep source, spec, journeys and required fixtures there too. Publish compiled JavaScript for Node
30
+ consumers while retaining the TypeScript source the pinned standard reads. Use TypeScript's
31
+ `rewriteRelativeImportExtensions`, copy generated JSON alongside emitted modules, and point the package export and
32
+ bin at their compiled entrypoints. A `files` list includes `src`, `dist`, `generated`, `spec`, `journeys`, README and
33
+ LICENSE. A build and `npm pack --dry-run` must show those paths; no platform-specific prepack script is required.
34
+
35
+ ## Assess before submitting
36
+
37
+ Walk the life's journeys while implementing. For the final assessment, run the released standard through a World:
38
+
39
+ Create `assessment.world.config.json`:
40
+
41
+ ```json
42
+ { "id": "pack-assessment", "services": [], "network": { "egress": [] } }
43
+ ```
44
+
45
+ ```sh
46
+ volter-world run assessment.world.config.json --root . --env-out /tmp/new-assessment.env --owner pack-assessment -- bunx --bun twin-standard assess stripe --browser --out assessment.json
47
+ ```
48
+
49
+ The assessment config has no vendor services; the standard creates fresh in-memory World state for each journey.
50
+ For an HTTP browser target, use Linux, install Playwright at the catalog policy version and its Chromium binary,
51
+ and install `libfaketime` (Debian/Ubuntu: `sudo apt-get install libfaketime`). The browser process uses the World
52
+ clock for native cookie expiry, at one-second precision; JavaScript time retains millisecond precision. Authors on
53
+ other platforms can omit `--browser` for in-process assessment; catalog Actions supplies the browser target. The report
54
+ separates declared served/gap counts, operations actually exercised, deterministic replay, conformance and Chromium
55
+ results. It does not measure DOM interactions, line coverage, real-vendor parity or every possible state transition.
56
+
57
+ Local assessment helps authors; it does not replace the independent catalog assessment of the published tarball.
58
+ Linux catalog preparation disables installation scripts. A dependency that requires a build cannot depend on its
59
+ postinstall having run there: distribute the needed portable build or choose supported dependencies.
60
+
61
+ ## Register and publish
62
+
63
+ Register your public repository, npm scope and release workflow in a separate authorized `sources.json` PR; untrusted accounts need moderator review.
64
+ In your catalog fork, prepare the one-source change using the catalog CLI:
65
+
66
+ ```sh
67
+ twin-catalog register --source example-team --source-repository example/twins --scope @example --workflow release.yml
68
+ ```
69
+
70
+ The command prepares data only and refuses conflicting registrations. Outside a fork it writes `registration/sources.json`;
71
+ copy that file into your fork and open the separate PR. Registration does not authorize a release or grant maintainer status.
72
+
73
+ Pin your own dependencies and commit the lock. Your workflow runs on GitHub-hosted Linux with `id-token: write`,
74
+ builds your artifact, and uses npm trusted publishing or your own scoped npm credential:
75
+
76
+ ```sh
77
+ npm publish --ignore-scripts --access public --provenance
78
+ ```
79
+
80
+ The artifact's repository URL matches the registered repository; the signing workflow filename matches registration.
81
+ Publishing does not admit a release. After source registration has merged, use the catalog CLI from a catalog fork:
82
+
83
+ ```sh
84
+ twin-catalog submit --source example-team --vendor stripe --package @example/payments --version 1.2.3
85
+ ```
86
+
87
+ Open a PR adding only its generated submission. The Actions job checks the registry artifact at the exact integrity,
88
+ using catalog policy and released tools, then posts readiness evidence. Untrusted accounts need moderator review;
89
+ directly trusted accounts need no separate review. The [process contract](process.md) defines account trust and
90
+ maintainer authority. Fixes need a new immutable release; infrastructure failures can be retried. Authorized
91
+ maintainers merge; the publisher and catalog workflows do not.
@@ -0,0 +1,14 @@
1
+ {
2
+ "mode": "GitHub Actions preparation failure and exact-version confirmation",
3
+ "sourceCommit": "6b1eeacaf7f629db2985d213f52fdcf0013dc045",
4
+ "assessmentBase": "31af65e30b619cf47fd3387c6de97611effe56c0",
5
+ "workflowRun": 37350037621,
6
+ "failedAttempt": 1,
7
+ "successfulAttempt": 2,
8
+ "command": "node bin/twin-catalog.mjs assess-pr --out assessment/report.json; npm install --ignore-scripts --no-audit --no-fund --registry https://registry.npmjs.org",
9
+ "concurrentWork": "exact-version metadata and artifact preparation within the same credential-free container; no candidate evaluation before the failure",
10
+ "observation": "Exact-version metadata and tarball were available, but npm install received 404 for the package installation metadata; the same unchanged submission passed on retry. This is an endpoint-visibility observation, not a latency benchmark.",
11
+ "retainedDiagnostics": "https://github.com/volter-ai/twin-catalog-rollout-test/actions/runs/37350037621",
12
+ "confirmationPolicySource": "registry-confirmation.json",
13
+ "reproduce": "After a new immutable public test release, compare its exact-version endpoint with GET of the package endpoint using Accept: application/vnd.npm.install-v1+json; retain both responses and source/run identity. Do not republish an accepted version."
14
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "mode": "GitHub Actions npm publication and public registry GET",
3
+ "sourceCommit": "59469beb7c34fbadf6102fccc4a4f576907b309f",
4
+ "workflowRun": 37326269193,
5
+ "command": "node bin/twin-catalog.mjs publish --out dist; urllib.request.urlopen(exactVersionURL)",
6
+ "concurrentWork": "admission policy and durable-evidence verification in the same publisher job; no candidate tests or builds",
7
+ "postPublish404At": "2026-10-05T14:38:56.872636+00:00",
8
+ "confirmedAt": "2026-10-05T14:42:03.692478+00:00",
9
+ "observedConfirmationDelayUpperBoundSeconds": 186.819842,
10
+ "version": "0.2.7",
11
+ "integrity": "sha512-QbilRGDn7YtSeGPOMOdlWlmHTSpQqtpq7nU1h20Z6QDm+cx1zmIJSlQ3h/TVtO6G33I1SLOtyzU5N/v6Hcw39w==",
12
+ "remeasure": "On a fresh public sandbox main commit, run node bin/twin-catalog.mjs publish --out dist in publish.yml, then repeat urllib.request.urlopen('https://registry.npmjs.org/@volter%2ftwin-catalog-sandbox/<exact-new-version>') with datetime.datetime.now(datetime.timezone.utc) until HTTP 200. Retain the workflow source SHA, first post-upload 404 time and first observed 200 time."
13
+ }