@ship.zone/ci-spec 2.0.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/.smartconfig.json +46 -0
- package/changelog.md +190 -0
- package/conformance/archive-cases.json +446 -0
- package/conformance/ci-actions/compile-invalid/build-arg-secret-collision.yml +31 -0
- package/conformance/ci-actions/compile-invalid/candidate-without-needs.yml +36 -0
- package/conformance/ci-actions/compile-invalid/needs-wider-triggers.yml +42 -0
- package/conformance/ci-actions/compile-invalid/npm-read-registry-not-allowlisted.yml +34 -0
- package/conformance/ci-actions/compile-invalid/publish-job-excludes-tag.yml +57 -0
- package/conformance/ci-actions/compile-invalid/shared-memory-above-memory.yml +28 -0
- package/conformance/ci-actions/compile-invalid/trigger-kind-without-job.yml +30 -0
- package/conformance/ci-actions/invalid/alias-affix-invalid.yml +33 -0
- package/conformance/ci-actions/invalid/alias.yml +32 -0
- package/conformance/ci-actions/invalid/bridge-network.yml +27 -0
- package/conformance/ci-actions/invalid/build-darwin-platform.yml +24 -0
- package/conformance/ci-actions/invalid/build-with-steps.yml +27 -0
- package/conformance/ci-actions/invalid/concurrency-empty-group.yml +28 -0
- package/conformance/ci-actions/invalid/concurrency-without-cancel-in-progress.yml +27 -0
- package/conformance/ci-actions/invalid/container-job-build-profile.yml +25 -0
- package/conformance/ci-actions/invalid/custom-tag.txt +23 -0
- package/conformance/ci-actions/invalid/duplicate-key.txt +24 -0
- package/conformance/ci-actions/invalid/egress-bare-wildcard.yml +29 -0
- package/conformance/ci-actions/invalid/egress-empty-allowlist.yml +28 -0
- package/conformance/ci-actions/invalid/egress-ip-literal.yml +29 -0
- package/conformance/ci-actions/invalid/egress-single-label-wildcard.yml +29 -0
- package/conformance/ci-actions/invalid/job-publish-permission.yml +28 -0
- package/conformance/ci-actions/invalid/job-trigger-undeclared-kind.yml +27 -0
- package/conformance/ci-actions/invalid/literal-alias-affix.yml +33 -0
- package/conformance/ci-actions/invalid/missing-spec.yml +24 -0
- package/conformance/ci-actions/invalid/multiple-documents.yml +25 -0
- package/conformance/ci-actions/invalid/npm-read-invalid-scope.yml +33 -0
- package/conformance/ci-actions/invalid/oci-darwin-platform.yml +25 -0
- package/conformance/ci-actions/invalid/permission-without-publication.yml +31 -0
- package/conformance/ci-actions/invalid/publish-order-duplicate.yml +50 -0
- package/conformance/ci-actions/invalid/publish-order-missing-kind.yml +48 -0
- package/conformance/ci-actions/invalid/publish-order-undeclared-kind.yml +45 -0
- package/conformance/ci-actions/invalid/publish-without-permission.yml +31 -0
- package/conformance/ci-actions/invalid/publish-without-tag-trigger.yml +31 -0
- package/conformance/ci-actions/invalid/release-notes-without-assets.yml +46 -0
- package/conformance/ci-actions/invalid/reserved-label-prefix.yml +25 -0
- package/conformance/ci-actions/invalid/reserved-label.yml +25 -0
- package/conformance/ci-actions/invalid/retention-above-maximum.yml +83 -0
- package/conformance/ci-actions/invalid/retention-below-minimum.yml +83 -0
- package/conformance/ci-actions/invalid/schema-version-field.yml +26 -0
- package/conformance/ci-actions/invalid/shared-memory-below-minimum.yml +28 -0
- package/conformance/ci-actions/invalid/shell-string.yml +21 -0
- package/conformance/ci-actions/invalid/spec-number.yml +25 -0
- package/conformance/ci-actions/invalid/spec-prerelease.yml +25 -0
- package/conformance/ci-actions/invalid/spec-range.yml +25 -0
- package/conformance/ci-actions/invalid/timeout-above-maximum.yml +26 -0
- package/conformance/ci-actions/invalid/timeout-below-minimum.yml +26 -0
- package/conformance/ci-actions/invalid/unknown-alias-kind.yml +31 -0
- package/conformance/ci-actions/invalid/unknown-key.yml +24 -0
- package/conformance/ci-actions/invalid/vm-darwin-candidate.yml +38 -0
- package/conformance/ci-actions/invalid/vm-darwin-shared-memory.yml +28 -0
- package/conformance/ci-actions/invalid/vm-oci-execution.yml +25 -0
- package/conformance/ci-actions/invalid/vm-unsupported-platform.yml +25 -0
- package/conformance/ci-actions/invalid/vm-without-platform.yml +24 -0
- package/conformance/ci-actions/valid/concurrency.yml +83 -0
- package/conformance/ci-actions/valid/egress.yml +40 -0
- package/conformance/ci-actions/valid/image-build.yml +80 -0
- package/conformance/ci-actions/valid/matrix.yml +45 -0
- package/conformance/ci-actions/valid/minimal.yml +25 -0
- package/conformance/ci-actions/valid/npm-read.yml +60 -0
- package/conformance/ci-actions/valid/release-assets.yml +114 -0
- package/conformance/ci-actions/valid/release-signing.yml +71 -0
- package/conformance/ci-actions/valid/release.yml +109 -0
- package/conformance/ci-actions/valid/resources.yml +79 -0
- package/conformance/ci-actions/valid/vm.yml +77 -0
- package/conformance/compile-cases.json +5885 -0
- package/conformance/compile-cases.schema.json +766 -0
- package/conformance/digest-cases.json +144 -0
- package/conformance/runner-cases.json +1238 -0
- package/conformance/runner-jobs/invalid/bridge-network.json +70 -0
- package/conformance/runner-jobs/invalid/build-darwin-platform.json +100 -0
- package/conformance/runner-jobs/invalid/build-with-steps.json +111 -0
- package/conformance/runner-jobs/invalid/build-without-microvm.json +100 -0
- package/conformance/runner-jobs/invalid/egress-empty-allowlist.json +71 -0
- package/conformance/runner-jobs/invalid/mutable-image.json +70 -0
- package/conformance/runner-jobs/invalid/npm-read-reserved-environment.json +82 -0
- package/conformance/runner-jobs/invalid/oci-darwin-platform.json +71 -0
- package/conformance/runner-jobs/invalid/push-permission-container.json +70 -0
- package/conformance/runner-jobs/invalid/shared-memory-below-minimum.json +71 -0
- package/conformance/runner-jobs/invalid/timeout-missing.json +69 -0
- package/conformance/runner-jobs/invalid/vm-without-microvm.json +82 -0
- package/conformance/runner-jobs/valid/candidate-test.json +72 -0
- package/conformance/runner-jobs/valid/egress.json +80 -0
- package/conformance/runner-jobs/valid/image-build.json +100 -0
- package/conformance/runner-jobs/valid/minimal.json +70 -0
- package/conformance/runner-jobs/valid/npm-read.json +81 -0
- package/conformance/runner-jobs/valid/resources.json +71 -0
- package/conformance/runner-jobs/valid/timeout-retention-defaults.json +91 -0
- package/conformance/runner-jobs/valid/vm-darwin.json +70 -0
- package/conformance/runner-jobs/valid/vm.json +82 -0
- package/conformance/runner-messages.json +2035 -0
- package/conformance/version-cases.json +125 -0
- package/dist_ts/00_commitinfo_data.d.ts +8 -0
- package/dist_ts/00_commitinfo_data.js +9 -0
- package/dist_ts/constants.d.ts +199 -0
- package/dist_ts/constants.js +106 -0
- package/dist_ts/index.d.ts +1 -0
- package/dist_ts/index.js +2 -0
- package/dist_ts/plugins.d.ts +1 -0
- package/dist_ts/plugins.js +3 -0
- package/examples/ci_actions.yml +64 -0
- package/license.md +21 -0
- package/package.json +72 -0
- package/readme.md +146 -0
- package/schemas/ci_actions.schema.json +1664 -0
- package/schemas/runner-job.schema.json +1172 -0
- package/spec/ci-actions.md +433 -0
- package/spec/runner-protocol.md +378 -0
- package/spec/runner.openapi.json +2182 -0
- package/ts/00_commitinfo_data.ts +8 -0
- package/ts/constants.ts +112 -0
- package/ts/index.ts +1 -0
- package/ts/plugins.ts +1 -0
package/readme.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# @ship.zone/ci-spec
|
|
2
|
+
|
|
3
|
+
`@ship.zone/ci-spec` defines the ship.zone CI standard: the language-neutral workflow and runner contracts between a coordinator and its runners. The normative artifacts are OpenAPI, JSON Schema, protocol prose, and conformance cases. TypeScript exports provide only the specification version, draft metadata, identifier lists, and asset locations.
|
|
4
|
+
|
|
5
|
+
The current specification is a draft. It is intentionally incompatible with the legacy internal runner protocol it replaces and must not be treated as stable until independent implementations pass the conformance suite.
|
|
6
|
+
|
|
7
|
+
## Versioning
|
|
8
|
+
|
|
9
|
+
The package version is the specification version, and it is the only version in the specification. A `ci_actions.yml` references it once, as its top-level `spec`:
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
spec: 2.0.0
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Compiled jobs and runner protocol messages carry the same `spec` field. An implementation built against version `I` accepts a declared version `D` when both have the same major version and `D` is not newer than `I`; the rule is defined in `spec/runner-protocol.md` and fixed by `conformance/version-cases.json`. Every incompatible change is a new major version, and additions arrive as new minor versions: a workflow that uses a construct introduced in a later minor version declares that version or a later one. Version 2.0.0 renames the package and its normative identifiers (see Migrating from @foss.global/ci-spec), removes the 1.x cross-version rules, and completes the compilation rules: one stable failure code per compilation failure with a fixed precedence, a stricter YAML subset, the derivation of every compiled job member, and the identities of expanded nodes. The history of the 1.x rules is in the changelog.
|
|
16
|
+
|
|
17
|
+
## Issue Reporting and Security
|
|
18
|
+
|
|
19
|
+
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
pnpm add @ship.zone/ci-spec
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Migrating from @foss.global/ci-spec
|
|
28
|
+
|
|
29
|
+
Version 2.0.0 moves the standard from `@foss.global/ci-spec` to `@ship.zone/ci-spec`. Renaming normative identifiers is an incompatible change, so a 1.x implementation does not accept a 2.0.0 document, and a 2.0.0 implementation does not accept a 1.x document: both sides move to the same major version together.
|
|
30
|
+
|
|
31
|
+
1. Replace the dependency: `pnpm remove @foss.global/ci-spec && pnpm add @ship.zone/ci-spec`, and change every import and asset subpath from `@foss.global/ci-spec` to `@ship.zone/ci-spec`. The exported names and subpaths are unchanged.
|
|
32
|
+
2. Declare `spec: 2.0.0` in every `ci_actions.yml`, and send and expect `spec` 2.0.0 in compiled jobs and runner protocol messages.
|
|
33
|
+
3. Rename the normative identifiers:
|
|
34
|
+
|
|
35
|
+
| 1.x | 2.0.0 |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| npm package `@foss.global/ci-spec` | `@ship.zone/ci-spec` |
|
|
38
|
+
| step environment `FOSS_CI_MATRIX_JSON` | `SHIPZONE_CI_MATRIX_JSON` |
|
|
39
|
+
| step environment `FOSS_CI_INPUTS_JSON` | `SHIPZONE_CI_INPUTS_JSON` |
|
|
40
|
+
| reserved environment prefix `FOSS_CI_*` | `SHIPZONE_CI_*` |
|
|
41
|
+
| reserved image label prefix `global.foss.ci.` | `zone.ship.ci.` |
|
|
42
|
+
| schema `$id` `https://foss.global/spec/ci/ci_actions.schema.json` | `https://ship.zone/spec/ci/schemas/ci_actions.schema.json` |
|
|
43
|
+
| schema `$id` `https://foss.global/spec/ci/runner-job.schema.json` | `https://ship.zone/spec/ci/schemas/runner-job.schema.json` |
|
|
44
|
+
|
|
45
|
+
4. Adopt the 2.0.0 compilation rules (see `spec/ci-actions.md`): the YAML subset now rejects keys that do not resolve to strings (quote a key such as `1`) and every explicit tag, including `!!str`; a job that declares artifacts or caches beyond its resolved permissions fails compilation instead of compiling; and every compilation failure carries one of the codes of Compilation Failures.
|
|
46
|
+
5. Register schemas under their `$id` only. Every normative JSON document is identified by `https://ship.zone/spec/ci/` followed by its package path, so the OpenAPI reference `../schemas/runner-job.schema.json` resolves to the runner job schema's `$id` when the OpenAPI components are registered under `https://ship.zone/spec/ci/spec/runner.openapi.json`:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
const ajv = new Ajv2020({ strict: true });
|
|
50
|
+
ajv.addSchema(runnerJobSchema); // registered under its $id
|
|
51
|
+
ajv.addSchema({
|
|
52
|
+
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
53
|
+
$id: 'https://ship.zone/spec/ci/spec/runner.openapi.json',
|
|
54
|
+
$defs: openApi.components.schemas, // with #/components/schemas/ rewritten to #/$defs/
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Normative Artifacts
|
|
59
|
+
|
|
60
|
+
- `spec/runner-protocol.md`: runner protocol semantics, security, lifecycle, and limits.
|
|
61
|
+
- `spec/runner.openapi.json`: runner-facing HTTP and streaming API.
|
|
62
|
+
- `spec/ci-actions.md`: repository workflow parsing and compilation rules.
|
|
63
|
+
- `schemas/runner-job.schema.json`: compiled job wire schema.
|
|
64
|
+
- `schemas/ci_actions.schema.json`: repository-root `ci_actions.yml` schema.
|
|
65
|
+
- `conformance/runner-cases.json`: implementation-independent behavior cases.
|
|
66
|
+
- `conformance/runner-messages.json`: schema-bound runner wire-message fixtures.
|
|
67
|
+
- `conformance/digest-cases.json`: canonical JSON and digest fixtures.
|
|
68
|
+
- `conformance/archive-cases.json`: byte-identical gzip/tar acceptance and rejection vectors.
|
|
69
|
+
- `conformance/version-cases.json`: specification version compatibility outcomes.
|
|
70
|
+
- `conformance/compile-cases.json` and its schema `conformance/compile-cases.schema.json`: the compilation failure codes in precedence order, trigger pattern and tag version vectors, the expected code of every invalid workflow fixture, and compile vectors that bind a workflow, run context, and deployment policy to a failure code, to not-triggered, or to the compiled nodes and plan digests. The package runs no compiler; its tests check that every vector is schema-valid and internally coherent, and compilers run the vectors.
|
|
71
|
+
- `conformance/ci-actions/` and `conformance/runner-jobs/`: valid and invalid data fixtures. `conformance/ci-actions/compile-invalid/` holds schema-valid workflows that a compiler must reject; each is bound to a case in `runner-cases.json`.
|
|
72
|
+
|
|
73
|
+
The package exports these raw asset subpaths:
|
|
74
|
+
|
|
75
|
+
- `@ship.zone/ci-spec/runner.openapi.json`
|
|
76
|
+
- `@ship.zone/ci-spec/runner-protocol.md`
|
|
77
|
+
- `@ship.zone/ci-spec/ci-actions.md`
|
|
78
|
+
- `@ship.zone/ci-spec/runner-job.schema.json`
|
|
79
|
+
- `@ship.zone/ci-spec/ci_actions.schema.json`
|
|
80
|
+
- `@ship.zone/ci-spec/runner-cases.json`
|
|
81
|
+
- `@ship.zone/ci-spec/runner-messages.json`
|
|
82
|
+
- `@ship.zone/ci-spec/digest-cases.json`
|
|
83
|
+
- `@ship.zone/ci-spec/archive-cases.json`
|
|
84
|
+
- `@ship.zone/ci-spec/version-cases.json`
|
|
85
|
+
- `@ship.zone/ci-spec/compile-cases.json`
|
|
86
|
+
- `@ship.zone/ci-spec/compile-cases.schema.json`
|
|
87
|
+
- `@ship.zone/ci-spec/conformance/ci-actions/*`
|
|
88
|
+
- `@ship.zone/ci-spec/conformance/runner-jobs/*`
|
|
89
|
+
|
|
90
|
+
TypeScript metadata exposes package-root-relative asset locations separately:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
import {
|
|
94
|
+
ciSpecAssetPaths,
|
|
95
|
+
ciSpecVersion,
|
|
96
|
+
compilationFailureCodes,
|
|
97
|
+
executionProfileIdentifiers,
|
|
98
|
+
maximumArchivePathMetadataBytes,
|
|
99
|
+
runnerProtocolBasePath,
|
|
100
|
+
} from '@ship.zone/ci-spec';
|
|
101
|
+
|
|
102
|
+
console.log(ciSpecVersion); // the installed package version, e.g. 2.0.0
|
|
103
|
+
console.log(runnerProtocolBasePath); // /api/runner
|
|
104
|
+
console.log(executionProfileIdentifiers.imageBuild); // oci-image
|
|
105
|
+
console.log(maximumArchivePathMetadataBytes); // 134217728
|
|
106
|
+
console.log(ciSpecAssetPaths.runnerOpenApi);
|
|
107
|
+
console.log(compilationFailureCodes[0]); // { code: 'workflow_too_large', layer: 'source' }
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Generated language bindings are deliberately not normative. Implementations must follow the published OpenAPI, JSON Schemas, prose rules, and conformance cases.
|
|
111
|
+
|
|
112
|
+
## Design Boundary
|
|
113
|
+
|
|
114
|
+
Coordinators read `ci_actions.yml` from the exact repository commit, validate and compile it, resolve policy and trust, and issue immutable jobs. Runners never parse repository workflow files and never receive Git repository credentials.
|
|
115
|
+
|
|
116
|
+
Three execution profiles exist. `oci` runs argument-array steps in a digest-pinned or candidate image. `vm` runs the same kind of steps as root inside one microVM guest per attempt, for jobs that need a container engine or kernel facilities, on `linux` platforms and `darwin/arm64`. `oci-image` builds one single-platform OCI image in a fresh microVM per attempt on a dedicated builder runner and pushes it by digest with an attempt-scoped grant; the coordinator assembles the multi-platform candidate index. A job can be restricted to runs of chosen trigger kinds, for example to tag runs only. Secrets a repository marks protected reach only jobs of protected tag runs, and private npm scopes are read with attempt-scoped read-only grants that only trusted runs receive. Jobs have no network unless they declare an `egress` allowlist; loopback inside an attempt's own network namespaces is always available and never shared with another attempt. Jobs may declare memory, CPU, PID, shared-memory, and workspace ceilings, and runners may advertise the maxima they enforce. Releases run in CI: the coordinator qualifies candidates and artifacts and performs every publication with credentials that never reach a job, in the default or declared order; release assets are the files of job artifacts and are verified by reading them back from the release. Further execution profiles are added as new profile identifiers in a later specification version.
|
|
117
|
+
|
|
118
|
+
## Verification
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
pnpm run lint:openapi
|
|
122
|
+
pnpm run test:types
|
|
123
|
+
pnpm test
|
|
124
|
+
pnpm run build
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## License and Legal Information
|
|
128
|
+
|
|
129
|
+
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the repository license file.
|
|
130
|
+
|
|
131
|
+
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
|
132
|
+
|
|
133
|
+
### Trademarks
|
|
134
|
+
|
|
135
|
+
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
|
|
136
|
+
|
|
137
|
+
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
|
|
138
|
+
|
|
139
|
+
### Company Information
|
|
140
|
+
|
|
141
|
+
Task Venture Capital GmbH<br>
|
|
142
|
+
Registered at District Court Bremen HRB 35230 HB, Germany
|
|
143
|
+
|
|
144
|
+
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
|
145
|
+
|
|
146
|
+
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|