mergeseal 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ Copyright 2026 MergeSeal. MergeSeal <team@mergeseal.dev>
4
+
3
5
  ## Unreleased
4
6
 
7
+ - The in-toto receipt predicate writes the seal's issuance time as RFC 3339 (`YYYY-MM-DDTHH:mm:ss.sssZ`). `signDsseEnvelope` is an opt-in DSSE wrapper. The export command still prints the bare statement. The compact trailer bytes are unchanged.
5
8
  - The coding-gate action can set one pull request label from the offline checks: `sealed: tests ran, no test files modified`, `unsealed / tests touched`, or `unsealed`. Create, attach, and delete send the full name, so a comma in the sealed label stays part of that name.
6
9
  - `npx mergeseal init` writes the Cursor rule and skill. No account, no API key, no network call.
7
10
  - `mergeseal init` installs opt-in local sealing for `--claude-code`, `--cursor`, `--codex`, and `--git-hook`. `--yes` installs the hosts it detects. `--dry-run` writes nothing. `--uninstall` removes only MergeSeal's entries.
@@ -15,6 +18,14 @@
15
18
  - `toBiscuitFacts` writes Datalog facts for a verified result. `gate --biscuit-facts` prints them.
16
19
  - `mergeseal export --format in-toto` verifies a compact seal, then prints an in-toto Statement v1.
17
20
 
21
+ ## 0.2.0 - 2026-11-30
22
+
23
+ - Opt-in keyless signing for GitHub Actions. `mergeseal keyless seal` and `mergeseal seal --keyless` (or `--oidc`) request an OIDC token from `ACTIONS_ID_TOKEN_REQUEST_URL` with `ACTIONS_ID_TOKEN_REQUEST_TOKEN`, generate an ephemeral Ed25519 key, and ask Sigstore Fulcio for a short-lived code-signing certificate. The private key is not written. This path does not read `MERGESEAL_KEY`.
24
+ - `mergeseal keyless verify` checks the certificate chain against `--fulcio-root`, the SAN against `--certificate-identity` or `--certificate-identity-regexp`, and the issuer extension against `--certificate-oidc-issuer`. The default issuer is `https://token.actions.githubusercontent.com`. Verification does not open a socket.
25
+ - The coding-gate action takes `keyless: true`. The workflow needs `permissions: id-token: write`. The default action does not request a token. Keyless signing runs only when the gate JSON has `ok: true`. `--warn-only` with a failed gate does not call Fulcio.
26
+ - Keyless verification requires `basicConstraints` `cA` true, `keyUsage` `keyCertSign`, and any `pathLenConstraint` on every issuer. A leaf with `cA` true is rejected. A non-CA certificate cannot sign another certificate in the chain.
27
+ - Static `MERGESEAL_KEY` signing and the 192-byte `Agent-Certificate-Portable:` trailer are unchanged.
28
+
18
29
  ## 0.1.0 - 2026-11-29
19
30
 
20
31
  First open-source release of MergeSeal.
package/CONTRIBUTING.md CHANGED
@@ -2,7 +2,69 @@
2
2
 
3
3
  MergeSeal is licensed under Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
4
4
 
5
- Copyright 2026 MergeSeal. MergeSeal Contributors.
5
+ Copyright 2026 MergeSeal. MergeSeal <team@mergeseal.dev>. MergeSeal Contributors.
6
+
7
+ Governance is in [GOVERNANCE.md](GOVERNANCE.md). Conduct is in [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). Maintainers are in [MAINTAINERS.md](MAINTAINERS.md).
8
+
9
+ ## Developer Certificate of Origin
10
+
11
+ Every commit must include a `Signed-off-by` trailer. That trailer is the [Developer Certificate of Origin](https://developercertificate.org/), version 1.1. `git commit -s` writes it from your Git identity. Use your own name and email. Do not sign for someone else.
12
+
13
+ The certificate text follows. It is included verbatim.
14
+
15
+ ```
16
+ Developer Certificate of Origin
17
+ Version 1.1
18
+
19
+ Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
20
+
21
+ Everyone is permitted to copy and distribute verbatim copies of this
22
+ license document, but changing it is not allowed.
23
+
24
+
25
+ Developer's Certificate of Origin 1.1
26
+
27
+ By making a contribution to this project, I certify that:
28
+
29
+ (a) The contribution was created in whole or in part by me and I
30
+ have the right to submit it under the open source license
31
+ indicated in the file; or
32
+
33
+ (b) The contribution is based upon previous work that, to the best
34
+ of my knowledge, is covered under an appropriate open source
35
+ license and I have the right under that license to submit that
36
+ work with modifications, whether created in whole or in part
37
+ by me, under the same open source license (unless I am
38
+ permitted to submit under a different license), as indicated
39
+ in the file; or
40
+
41
+ (c) The contribution was provided directly to me by some other
42
+ person who certified (a), (b) or (c) and I have not modified
43
+ it.
44
+
45
+ (d) I understand and agree that this project and the contribution
46
+ are public and that a record of the contribution (including all
47
+ personal information I submit with it, including my sign-off) is
48
+ maintained indefinitely and may be redistributed consistent with
49
+ this project or the open source license(s) involved.
50
+ ```
51
+
52
+ ## Commits
53
+
54
+ - Write the subject in the imperative, and say why in the body when the subject is not enough.
55
+ - Keep one change in one commit when you can.
56
+ - Add `Signed-off-by` on every commit.
57
+ - Do not commit source, prompts, diffs of private code, or claim values as test fixtures unless they are synthetic and already in this repository.
58
+ - Do not change domain-separation tags, the `ac1.` encoding, or a trailer key inside an unrelated commit.
59
+
60
+ ## Pull requests
61
+
62
+ - Open the pull request against `main`.
63
+ - Describe what changed and how you checked it.
64
+ - Run the checks below for the code you touched. `npm run check` covers the TypeScript suite.
65
+ - If you change Rust, also run `cargo fmt --check`, `cargo clippy --all-targets -- -D warnings`, and `cargo test`.
66
+ - A pull request does not bump the version, publish to a registry, or file an upstream issue. Maintainers do those as separate steps.
67
+ - Review comments stay on the pull request. [GOVERNANCE.md](GOVERNANCE.md) says how a disagreement is decided.
6
68
 
7
69
  ## Checks
8
70
 
@@ -21,7 +83,7 @@ npm run smoke:site
21
83
 
22
84
  ## Wire format
23
85
 
24
- Do not change domain-separation tags, the `ac1.` encoding, or the `Agent-Certificate` and `Agent-Certificate-Portable` trailer keys in a patch release. Those bytes are the seal.
86
+ Do not change domain-separation tags, the `ac1.` encoding, or the `Agent-Certificate` and `Agent-Certificate-Portable` trailer keys in a patch release. Those bytes are the seal. The core plus one seal is at most 192 bytes. The in-toto predicate in [docs/intoto-predicate-v1.md](docs/intoto-predicate-v1.md) is a statement about a seal that has already verified. It is not a new trailer.
25
87
 
26
88
  Questions and issues: https://github.com/mergeseal/mergeseal/issues
27
89
 
package/README.md CHANGED
@@ -10,10 +10,12 @@ MergeSeal gives every agent code change a signed receipt: which checks ran, whic
10
10
 
11
11
  Signed receipts for agent code changes · <0.5 ms offline verify
12
12
 
13
- | Tier | Runner |
14
- | ------ | ------------------ |
15
- | Tier 1 | Developer machine |
16
- | Tier 2 | Isolated CI runner |
13
+ | Tier | Runner | Signing |
14
+ | ------ | ------------------ | ------------------------------------------------------------- |
15
+ | Tier 1 | Developer machine | Static `MERGESEAL_KEY` on that machine |
16
+ | Tier 2 | Isolated CI runner | Static `MERGESEAL_KEY`, or opt-in keyless GitHub Actions OIDC |
17
+
18
+ Tier 1 and the default Tier 2 path sign with `MERGESEAL_KEY`. That path does not open a socket. Opt-in keyless signing is Tier 2 on GitHub Actions only: `mergeseal keyless seal` (or `mergeseal seal --keyless` / `--oidc`) requests an OIDC token, generates an ephemeral key, and gets a short-lived Sigstore Fulcio certificate. There is no static `MERGESEAL_KEY`. Verify that bundle with `--certificate-identity` or `--certificate-identity-regexp` and `--certificate-oidc-issuer` (default `https://token.actions.githubusercontent.com`). Verification checks the certificate chain, the SAN, and the signature locally. The 192-byte `Agent-Certificate-Portable:` trailer is unchanged.
17
19
 
18
20
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
19
21
 
@@ -72,7 +74,7 @@ https://github.com/mergeseal/mergeseal
72
74
 
73
75
  ## Offline-first
74
76
 
75
- Verification is a local signature check. It does not open a socket, and it does not send the repository anywhere.
77
+ Verification is a local signature check. It does not open a socket, and it does not send the repository anywhere. The one signing path that opens a connection is opt-in `mergeseal keyless seal`. A static `MERGESEAL_KEY` command does not take that path.
76
78
 
77
79
  - Source, prompts, diffs, and claim values stay on the machine.
78
80
  - The coding gate stores a diff digest and one secret-scan bit, not the line.
@@ -129,7 +131,28 @@ jobs:
129
131
  warn-only: "true"
130
132
  ```
131
133
 
132
- On GitHub that action is `mergeseal/mergeseal/.github/actions/coding-gate@v0.1.0`. The step reads `dist/cli.js` from the checkout, so build first. Set `hold: "true"` to label and draft an uncertified pull request until a receipt is attached.
134
+ On GitHub that action is `mergeseal/mergeseal/.github/actions/coding-gate@v0.2.0`. The step reads `dist/cli.js` from the checkout, so build first. Set `hold: "true"` to label and draft an uncertified pull request until a receipt is attached.
135
+
136
+ Opt-in keyless signing sets `keyless: "true"`. The workflow needs `id-token: write`. The action still runs the offline gate first. It requests an OIDC token only after that gate passes, then writes a Fulcio-backed bundle. The default `keyless: "false"` does not request a token.
137
+
138
+ ```yaml
139
+ permissions:
140
+ id-token: write
141
+ contents: read
142
+ jobs:
143
+ seal:
144
+ runs-on: ubuntu-latest
145
+ steps:
146
+ - uses: actions/checkout@v4
147
+ - uses: actions/setup-node@v4
148
+ with:
149
+ node-version: "22"
150
+ - run: npm ci
151
+ - run: npm run build
152
+ - uses: ./.github/actions/coding-gate
153
+ with:
154
+ keyless: "true"
155
+ ```
133
156
 
134
157
  ### Cursor, Claude Code, Codex, and Windsurf
135
158
 
@@ -22,6 +22,8 @@ export declare const NEXT: {
22
22
  readonly mcp: "npx mergeseal mcp";
23
23
  readonly exportStatement: "npx mergeseal export --format in-toto --token TOKEN --now MS --public-key KEY --name NAME --issuer-id ID --test-count N";
24
24
  readonly policySign: "npx mergeseal policy sign --issuer-id ID --issuer-key-id KID --issuer-key KEY --policy-id ID --allow GLOB --max-files N --max-lines N --test-command CMD --fresh-window MS --json";
25
+ readonly keylessSeal: "npx mergeseal keyless seal --payload-file FILE --json";
26
+ readonly keylessVerify: "npx mergeseal keyless verify --bundle FILE --certificate-identity ID --fulcio-root FILE --now MS --json";
25
27
  };
26
28
  export declare function nextLine(next: string): string;
27
29
  export declare function textFailure(error: string, next: string): string;
@@ -21,6 +21,8 @@ export const NEXT = {
21
21
  mcp: "npx mergeseal mcp",
22
22
  exportStatement: "npx mergeseal export --format in-toto --token TOKEN --now MS --public-key KEY --name NAME --issuer-id ID --test-count N",
23
23
  policySign: "npx mergeseal policy sign --issuer-id ID --issuer-key-id KID --issuer-key KEY --policy-id ID --allow GLOB --max-files N --max-lines N --test-command CMD --fresh-window MS --json",
24
+ keylessSeal: "npx mergeseal keyless seal --payload-file FILE --json",
25
+ keylessVerify: "npx mergeseal keyless verify --bundle FILE --certificate-identity ID --fulcio-root FILE --now MS --json",
24
26
  };
25
27
  export function nextLine(next) {
26
28
  return `next: ${next}\n`;
@@ -72,6 +74,9 @@ function usageNext(command) {
72
74
  case "native":
73
75
  case "registry":
74
76
  return NEXT.nativeVerify;
77
+ case "keyless":
78
+ case "seal":
79
+ return NEXT.keylessSeal;
75
80
  default:
76
81
  return NEXT.help;
77
82
  }
@@ -96,6 +101,9 @@ function failNext(command) {
96
101
  case "native":
97
102
  case "registry":
98
103
  return NEXT.nativeVerify;
104
+ case "keyless":
105
+ case "seal":
106
+ return NEXT.keylessVerify;
99
107
  default:
100
108
  return NEXT.help;
101
109
  }
package/dist/cli.js CHANGED
@@ -11,6 +11,7 @@ import { installNodeCrypto } from "./coding/fast-ed25519.js";
11
11
  import { installMergeSeal } from "./init.js";
12
12
  import { detectSealTargets, formatSealPrompt, InitError, legacyAfterEmptyPrompt, runLegacyDryRun, runSealInit, SEAL_TARGETS, } from "./init-seal.js";
13
13
  import { toInTotoStatement } from "./intoto.js";
14
+ import { KeylessUsageError, runKeylessCli } from "./keyless/cli.js";
14
15
  import { serveMcp } from "./mcp.js";
15
16
  import { NativeUsageError, runNativeCli } from "./native/cli.js";
16
17
  import { checkCertificate } from "./native/hook.js";
@@ -89,6 +90,18 @@ const HELP = `mergeseal <command> [options]
89
90
  portable receipt --deploy ID --token TOKEN --tests-id ID --tests-exit 0
90
91
  --tests-at MS --approval-by ID --approval-at MS
91
92
  portable snippets
93
+ keyless seal --payload-file FILE [--out FILE] [--fulcio-url URL]
94
+ [--audience AUD] [--ephemeral-seed HEX]
95
+ GitHub Actions OIDC only. No MERGESEAL_KEY.
96
+ Requires ACTIONS_ID_TOKEN_REQUEST_URL and
97
+ ACTIONS_ID_TOKEN_REQUEST_TOKEN
98
+ keyless verify --bundle FILE --fulcio-root FILE --now MS
99
+ (--certificate-identity ID | --certificate-identity-regexp RE)
100
+ [--certificate-oidc-issuer URL]
101
+ Default issuer https://token.actions.githubusercontent.com
102
+ No network call
103
+ seal --keyless | seal --oidc
104
+ same as keyless seal
92
105
  export --format in-toto --token TOKEN --now MS --public-key KEY
93
106
  --name NAME --issuer-id ID --test-count N
94
107
  [--key-id KID] [--secrets-clean] [--human-cosigned]
@@ -154,6 +167,14 @@ function main() {
154
167
  case "export":
155
168
  exportStatement(parsed.positionals, parsed.flags, json);
156
169
  return;
170
+ case "keyless":
171
+ case "seal": {
172
+ const pending = runKeylessCli(parsed.command, parsed.positionals, parsed.flags, json);
173
+ pending.catch((error) => {
174
+ report(error, json, parsed.command);
175
+ });
176
+ return;
177
+ }
157
178
  case "native": {
158
179
  const pending = runNativeCli(parsed.positionals, parsed.flags, json);
159
180
  if (pending instanceof Promise) {
@@ -854,6 +875,8 @@ function parseArgv(argv) {
854
875
  "cursor",
855
876
  "codex",
856
877
  "git-hook",
878
+ "keyless",
879
+ "oidc",
857
880
  ]);
858
881
  for (let index = 0; index < argv.length; index += 1) {
859
882
  const arg = argv[index] ?? "";
@@ -1003,6 +1026,7 @@ function report(error, json, command) {
1003
1026
  error instanceof CodingUsageError ||
1004
1027
  error instanceof NativeUsageError ||
1005
1028
  error instanceof PortableUsageError ||
1029
+ error instanceof KeylessUsageError ||
1006
1030
  (error instanceof CertificateError && error.code === "invalid_input")
1007
1031
  ? EXIT_USAGE
1008
1032
  : EXIT_FAIL;
@@ -24,6 +24,10 @@ const DIFF = [
24
24
  "--no-ext-diff",
25
25
  "--unified=0",
26
26
  ];
27
+ // A root commit is diffed against the empty tree, so stdout is the whole
28
+ // tree. spawnSync's 1 MiB default kills that diff and the gate exits 1
29
+ // before --warn-only can turn a missing certificate into exit 0.
30
+ const GIT_MAX_BUFFER = 1024 * 1024 * 1024;
27
31
  export function readStaged(repo) {
28
32
  const diff = gitBytes(repo, ["diff", "--cached", ...DIFF]);
29
33
  const stat = gitBytes(repo, [
@@ -346,6 +350,7 @@ function spawnGit(repo, args) {
346
350
  return spawnSync("git", ["--no-pager", ...args], {
347
351
  cwd: repo,
348
352
  encoding: "buffer",
353
+ maxBuffer: GIT_MAX_BUFFER,
349
354
  env: {
350
355
  ...process.env,
351
356
  GIT_CONFIG_NOSYSTEM: "1",
package/dist/intoto.d.ts CHANGED
@@ -1,9 +1,14 @@
1
1
  /**
2
2
  * in-toto Statement v1 for a receipt whose compact seal already verified.
3
- * This module does not call Fulcio or Rekor and does not wrap a DSSE envelope.
3
+ * The predicate timestamp is the seal's issuance time as RFC 3339.
4
+ * DSSE is an opt-in envelope. This module does not call Fulcio or Rekor.
5
+ *
6
+ * Copyright 2026 MergeSeal
7
+ * MergeSeal <team@mergeseal.dev>
4
8
  */
5
9
  export declare const IN_TOTO_STATEMENT_TYPE = "https://in-toto.io/Statement/v1";
6
10
  export declare const MERGESEAL_PREDICATE_TYPE = "https://mergeseal.dev/receipt/v1";
11
+ export declare const DSSE_PAYLOAD_TYPE = "application/vnd.in-toto+json";
7
12
  export type VerifiedReceipt = {
8
13
  readonly verified: true;
9
14
  readonly name: string;
@@ -41,4 +46,32 @@ export type InTotoStatement = {
41
46
  readonly token: string;
42
47
  };
43
48
  };
49
+ export type DsseSignature = {
50
+ readonly keyid: string;
51
+ readonly sig: string;
52
+ };
53
+ export type DsseEnvelope = {
54
+ readonly payload: string;
55
+ readonly payloadType: string;
56
+ readonly signatures: readonly [DsseSignature];
57
+ };
58
+ export type DsseSigner = {
59
+ readonly keyId: string;
60
+ sign(message: Uint8Array): Uint8Array;
61
+ };
62
+ export type DsseVerifier = {
63
+ verify(message: Uint8Array, signature: Uint8Array, keyId: string): boolean;
64
+ };
44
65
  export declare function toInTotoStatement(receipt: VerifiedReceipt): InTotoStatement;
66
+ /**
67
+ * DSSE Pre-Authentication Encoding, version 1.
68
+ * `PAE(type, body) = "DSSEv1" SP LEN(type) SP type SP LEN(body) SP body`.
69
+ */
70
+ export declare function dssePreAuthEncoding(payloadType: string, payload: Uint8Array): Uint8Array;
71
+ /** Opt-in. The export command does not call this. */
72
+ export declare function signDsseEnvelope(statement: InTotoStatement, signer: DsseSigner): DsseEnvelope;
73
+ /**
74
+ * Verifies one signature over the payload bytes, then parses those same bytes.
75
+ * The envelope is not read again after verification.
76
+ */
77
+ export declare function verifyDsseEnvelope(envelope: DsseEnvelope, verifier: DsseVerifier): InTotoStatement;