agent-merge-broker 0.14.2 → 0.15.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.
Files changed (147) hide show
  1. package/README.md +55 -30
  2. package/dist/bootstrap.d.ts +0 -1
  3. package/dist/bootstrap.js +0 -1
  4. package/dist/broker.d.ts +0 -1
  5. package/dist/broker.js +0 -1
  6. package/dist/candidate-lifecycle.d.ts +0 -1
  7. package/dist/candidate-lifecycle.js +0 -1
  8. package/dist/cli.d.ts +0 -1
  9. package/dist/cli.js +46 -1
  10. package/dist/config.d.ts +0 -1
  11. package/dist/config.js +0 -1
  12. package/dist/core.d.ts +19 -0
  13. package/dist/core.js +18 -0
  14. package/dist/errors.d.ts +0 -1
  15. package/dist/errors.js +0 -1
  16. package/dist/gate-authority.d.ts +0 -1
  17. package/dist/gate-authority.js +0 -1
  18. package/dist/git-locators.d.ts +0 -1
  19. package/dist/git-locators.js +0 -1
  20. package/dist/git.d.ts +0 -1
  21. package/dist/git.js +0 -1
  22. package/dist/hooks.d.ts +0 -1
  23. package/dist/hooks.js +0 -1
  24. package/dist/index.d.ts +1 -19
  25. package/dist/index.js +2 -18
  26. package/dist/mcp-cli.d.ts +0 -1
  27. package/dist/mcp-cli.js +0 -1
  28. package/dist/mcp.d.ts +0 -1
  29. package/dist/mcp.js +0 -1
  30. package/dist/patterns.d.ts +0 -1
  31. package/dist/patterns.js +0 -1
  32. package/dist/process.d.ts +0 -1
  33. package/dist/process.js +0 -1
  34. package/dist/provenance.d.ts +0 -1
  35. package/dist/provenance.js +0 -1
  36. package/dist/publisher.d.ts +0 -1
  37. package/dist/publisher.js +0 -1
  38. package/dist/scheduler.d.ts +0 -1
  39. package/dist/scheduler.js +0 -1
  40. package/dist/schema-identity.d.ts +0 -1
  41. package/dist/schema-identity.js +0 -1
  42. package/dist/serve-log.d.ts +0 -1
  43. package/dist/serve-log.js +0 -1
  44. package/dist/service.d.ts +0 -1
  45. package/dist/service.js +0 -1
  46. package/dist/state-codec.d.ts +0 -1
  47. package/dist/state-codec.js +0 -1
  48. package/dist/status.d.ts +0 -1
  49. package/dist/status.js +0 -1
  50. package/dist/storage.d.ts +53 -0
  51. package/dist/storage.js +310 -0
  52. package/dist/store.d.ts +2 -1
  53. package/dist/store.js +66 -17
  54. package/dist/submission-attestation.d.ts +0 -1
  55. package/dist/submission-attestation.js +0 -1
  56. package/dist/submission-retention.d.ts +0 -1
  57. package/dist/submission-retention.js +0 -1
  58. package/dist/submission.d.ts +0 -1
  59. package/dist/submission.js +0 -1
  60. package/dist/support.d.ts +0 -1
  61. package/dist/support.js +0 -1
  62. package/dist/types.d.ts +0 -1
  63. package/dist/types.js +0 -1
  64. package/dist/validation.d.ts +0 -1
  65. package/dist/validation.js +0 -1
  66. package/dist/verify.d.ts +0 -1
  67. package/dist/verify.js +0 -1
  68. package/package.json +4 -9
  69. package/CHANGELOG.md +0 -575
  70. package/CODE_OF_CONDUCT.md +0 -28
  71. package/CONTRIBUTING.md +0 -50
  72. package/ROADMAP.md +0 -121
  73. package/SUPPORT.md +0 -31
  74. package/VISION.md +0 -143
  75. package/dist/bootstrap.d.ts.map +0 -1
  76. package/dist/bootstrap.js.map +0 -1
  77. package/dist/broker.d.ts.map +0 -1
  78. package/dist/broker.js.map +0 -1
  79. package/dist/candidate-lifecycle.d.ts.map +0 -1
  80. package/dist/candidate-lifecycle.js.map +0 -1
  81. package/dist/cli.d.ts.map +0 -1
  82. package/dist/cli.js.map +0 -1
  83. package/dist/config.d.ts.map +0 -1
  84. package/dist/config.js.map +0 -1
  85. package/dist/errors.d.ts.map +0 -1
  86. package/dist/errors.js.map +0 -1
  87. package/dist/gate-authority.d.ts.map +0 -1
  88. package/dist/gate-authority.js.map +0 -1
  89. package/dist/git-locators.d.ts.map +0 -1
  90. package/dist/git-locators.js.map +0 -1
  91. package/dist/git.d.ts.map +0 -1
  92. package/dist/git.js.map +0 -1
  93. package/dist/hooks.d.ts.map +0 -1
  94. package/dist/hooks.js.map +0 -1
  95. package/dist/index.d.ts.map +0 -1
  96. package/dist/index.js.map +0 -1
  97. package/dist/mcp-cli.d.ts.map +0 -1
  98. package/dist/mcp-cli.js.map +0 -1
  99. package/dist/mcp.d.ts.map +0 -1
  100. package/dist/mcp.js.map +0 -1
  101. package/dist/patterns.d.ts.map +0 -1
  102. package/dist/patterns.js.map +0 -1
  103. package/dist/process.d.ts.map +0 -1
  104. package/dist/process.js.map +0 -1
  105. package/dist/provenance.d.ts.map +0 -1
  106. package/dist/provenance.js.map +0 -1
  107. package/dist/publisher.d.ts.map +0 -1
  108. package/dist/publisher.js.map +0 -1
  109. package/dist/scheduler.d.ts.map +0 -1
  110. package/dist/scheduler.js.map +0 -1
  111. package/dist/schema-identity.d.ts.map +0 -1
  112. package/dist/schema-identity.js.map +0 -1
  113. package/dist/serve-log.d.ts.map +0 -1
  114. package/dist/serve-log.js.map +0 -1
  115. package/dist/service.d.ts.map +0 -1
  116. package/dist/service.js.map +0 -1
  117. package/dist/state-codec.d.ts.map +0 -1
  118. package/dist/state-codec.js.map +0 -1
  119. package/dist/status.d.ts.map +0 -1
  120. package/dist/status.js.map +0 -1
  121. package/dist/store.d.ts.map +0 -1
  122. package/dist/store.js.map +0 -1
  123. package/dist/submission-attestation.d.ts.map +0 -1
  124. package/dist/submission-attestation.js.map +0 -1
  125. package/dist/submission-retention.d.ts.map +0 -1
  126. package/dist/submission-retention.js.map +0 -1
  127. package/dist/submission.d.ts.map +0 -1
  128. package/dist/submission.js.map +0 -1
  129. package/dist/support.d.ts.map +0 -1
  130. package/dist/support.js.map +0 -1
  131. package/dist/types.d.ts.map +0 -1
  132. package/dist/types.js.map +0 -1
  133. package/dist/validation.d.ts.map +0 -1
  134. package/dist/validation.js.map +0 -1
  135. package/dist/verify.d.ts.map +0 -1
  136. package/dist/verify.js.map +0 -1
  137. package/docs/ARCHITECTURE.md +0 -552
  138. package/docs/COMPATIBILITY.md +0 -369
  139. package/docs/GETTING_STARTED.md +0 -595
  140. package/docs/PROTOCOL.md +0 -624
  141. package/docs/RELEASING.md +0 -75
  142. package/docs/SECURITY.md +0 -347
  143. package/examples/local-gate/README.md +0 -25
  144. package/examples/local-gate/run.mjs +0 -137
  145. package/examples/two-agents/README.md +0 -42
  146. package/examples/two-agents/run.mjs +0 -146
  147. package/examples/two-agents/run.sh +0 -143
package/README.md CHANGED
@@ -18,22 +18,24 @@ protection, or forge merge queue.
18
18
 
19
19
  ## Release status
20
20
 
21
- Version **0.14.2** includes the complete Coordinate workflow and trusted local-ref Gate validation,
21
+ Version **0.15.0** includes the complete Coordinate workflow and trusted local-ref Gate validation,
22
22
  with Gate diagnostics, abandonment and archival, detached signed validation evidence, offline
23
- verification, stricter state diagnostics, and release safeguards. The documentation tracks source;
23
+ verification, stricter state diagnostics, leaner packaging, storage maintenance, and release safeguards.
24
+ The documentation tracks source;
24
25
  check the [npm version history](https://www.npmjs.com/package/agent-merge-broker?activeTab=versions)
25
26
  for published availability.
26
27
 
27
28
  The `v0.14.0` and `v0.14.1` GitHub tags remain available, but neither version was published to npm.
28
- Version 0.14.2 is the corrected npm release target for these features; the registry confirms when it
29
- is available.
29
+ The companion core package is published separately; confirm its version in
30
+ [npm's core package history](https://www.npmjs.com/package/agent-merge-broker-core?activeTab=versions).
30
31
 
31
- Version 0.14.2 requires **Node.js 22 or newer**; version 0.13.0 supported Node.js 20.12 or newer.
32
+ Version 0.15.0 requires **Node.js 22 or newer**; version 0.13.0 supported Node.js 20.12 or newer.
32
33
  Git 2.31+ is required for Coordinate; Gate requires Git 2.46+. Linux, macOS, and Windows are
33
34
  supported. GitHub CLI is required only for GitHub pull-request publication.
34
35
 
35
- See [Compatibility](docs/COMPATIBILITY.md), [Changelog](CHANGELOG.md), and
36
- [Roadmap](ROADMAP.md) for the exact boundaries. Gate approval, publication, and merge authorization
36
+ See [Compatibility](https://github.com/WeSpitfire/agent-merge-broker/blob/main/docs/COMPATIBILITY.md),
37
+ [Changelog](https://github.com/WeSpitfire/agent-merge-broker/blob/main/CHANGELOG.md), and
38
+ [Roadmap](https://github.com/WeSpitfire/agent-merge-broker/blob/main/ROADMAP.md) for the exact boundaries. Gate approval, publication, and merge authorization
37
39
  remain planned.
38
40
 
39
41
  ## Try both routes locally
@@ -53,16 +55,31 @@ The Coordinate example combines four commits from two workers and rejects an ove
53
55
  The Gate example validates one candidate, rejects another, signs the accepted result, verifies it
54
56
  offline, and previews archival.
55
57
 
56
- ## Install and review repository policy
58
+ ## Install once, use across projects
59
+
60
+ Keep the tool outside your project's dependencies with a version-pinned global installation:
57
61
 
58
62
  ```bash
59
- npm install --save-dev agent-merge-broker
60
- npx merge-broker init --base main --base-ref origin/main --remote origin
63
+ npm install --global agent-merge-broker@0.15.0
64
+ # From the repository you want to coordinate:
65
+ merge-broker init --base main --base-ref origin/main --remote origin
61
66
  git add .merge-broker AGENTS.md
62
67
  git commit -m 'Configure Agent Merge Broker'
63
- npx merge-broker doctor
68
+ merge-broker doctor
64
69
  ```
65
70
 
71
+ This does not add the broker to your project's `package.json` or `node_modules`. Prefer a
72
+ project-local, lockfile-pinned dev dependency when a team or CI needs to reproduce the entire
73
+ dependency tree. For pinned execution through npm's cache, or local installation instructions, see
74
+ [Getting started](https://github.com/WeSpitfire/agent-merge-broker/blob/main/docs/GETTING_STARTED.md#2-install-and-initialize).
75
+
76
+ `agent-merge-broker-core` offers the same Coordinate/Gate CLI and core Node API
77
+ without the MCP server or SDK dependency. Keep `agent-merge-broker` for MCP support and existing
78
+ imports. Choose one package per installation because they share CLI aliases, and confirm the
79
+ desired version is published for that package. Version 0.15.0 tarballs omit debug maps and long guides/examples while keeping
80
+ runtime code, TypeScript definitions, schemas, templates, README, and license. Full source and
81
+ guides remain on GitHub.
82
+
66
83
  Initialization detects validation commands the repository already declares. Review
67
84
  `.merge-broker/config.json` before using it: configuration is executable policy, and validators run
68
85
  with the broker user's permissions. The public signing key belongs in committed policy; the private
@@ -76,18 +93,18 @@ protected-branch provenance verification load their applicable policy from the e
76
93
  In each worker's linked worktree:
77
94
 
78
95
  ```bash
79
- npx merge-broker task claim SEARCH-1 --holder worker/search --path 'src/search/**'
96
+ merge-broker task claim SEARCH-1 --holder worker/search --path 'src/search/**'
80
97
  # Edit and commit the change.
81
- npx merge-broker task candidate SEARCH-1 --since-base
98
+ merge-broker task candidate SEARCH-1 --since-base
82
99
  ```
83
100
 
84
101
  The integration owner then runs:
85
102
 
86
103
  ```bash
87
- npx merge-broker plan
88
- npx merge-broker integrate --dry-run
89
- npx merge-broker integrate
90
- npx merge-broker status
104
+ merge-broker plan
105
+ merge-broker integrate --dry-run
106
+ merge-broker integrate
107
+ merge-broker status
91
108
  ```
92
109
 
93
110
  Expiring leases reduce predictable collisions; commit receipts identify immutable work. The broker
@@ -97,8 +114,8 @@ branch, or GitHub pull request. Optional approval binds evidence and permission
97
114
  candidate, base, and policy revision. Durable intents allow interrupted publication and merge
98
115
  decisions to be reconciled.
99
116
 
100
- Use [Getting started](docs/GETTING_STARTED.md) for validation, publication, approval, service, and
101
- recovery recipes. The [worker protocol](docs/PROTOCOL.md) documents CLI/JSON, Node, and permission-
117
+ Use [Getting started](https://github.com/WeSpitfire/agent-merge-broker/blob/main/docs/GETTING_STARTED.md) for validation, publication, approval, service, and
118
+ recovery recipes. The [worker protocol](https://github.com/WeSpitfire/agent-merge-broker/blob/main/docs/PROTOCOL.md) documents CLI/JSON, Node, and permission-
102
119
  separated stdio MCP integration.
103
120
 
104
121
  ## Route 2: validate a trusted existing branch
@@ -106,9 +123,9 @@ separated stdio MCP integration.
106
123
  From a reviewed checkout whose protected base contains the committed broker policy:
107
124
 
108
125
  ```bash
109
- npx merge-broker candidate authority setup
110
- npx merge-broker candidate adopt --ref refs/heads/producer/candidate
111
- npx merge-broker candidate show <submission-id>
126
+ merge-broker candidate authority setup
127
+ merge-broker candidate adopt --ref refs/heads/producer/candidate
128
+ merge-broker candidate show <submission-id>
112
129
  ```
113
130
 
114
131
  The candidate must already exist locally and be a nonempty linear descendant of the registered
@@ -116,7 +133,7 @@ base. Gate derives its history and paths, materializes its raw Git bytes, and ru
116
133
  broker-authoritative validators. A `SubmissionRecord` reports `validated`, `rejected`, or `failed`
117
134
  without inventing tasks or leases. A rejected candidate exits nonzero.
118
135
 
119
- Version 0.14.2 includes these operational commands:
136
+ Version 0.15.0 includes these operational commands:
120
137
 
121
138
  ```bash
122
139
  merge-broker doctor --gate
@@ -130,11 +147,11 @@ merge-broker candidate list --all
130
147
  Detached attestations use Ed25519 DSSE and a versioned in-toto validation statement. Offline
131
148
  verification requires an independently trusted key and expected commit, tree, base, policy digest,
132
149
  and authority digest. A valid signature can describe a rejection; validation evidence never grants
133
- merge authorization. [Protocol](docs/PROTOCOL.md) includes the full verifier command, abandonment,
134
- retention options, and immutable [schema identities](schemas/identities.json).
150
+ merge authorization. [Protocol](https://github.com/WeSpitfire/agent-merge-broker/blob/main/docs/PROTOCOL.md) includes the full verifier command, abandonment,
151
+ retention options, and immutable [schema identities](https://github.com/WeSpitfire/agent-merge-broker/blob/main/schemas/identities.json).
135
152
 
136
153
  Gate accepts trusted local code. A disposable worktree is not an execution sandbox. Read the
137
- [security model](docs/SECURITY.md) before choosing the broker host and credentials.
154
+ [security model](https://github.com/WeSpitfire/agent-merge-broker/blob/main/docs/SECURITY.md) before choosing the broker host and credentials.
138
155
 
139
156
  ## Operate and contribute
140
157
 
@@ -143,14 +160,22 @@ replays local interrupted operations. Coordinate publication uses `batch publish
143
160
  and `batch refresh` to observe the forge before proceeding. Gate archival preserves audit records,
144
161
  and releasing a retained Git ref requires an explicit option.
145
162
 
163
+ `storage show` reports broker-managed file sizes without reading file contents.
164
+ `storage compact --older-than 30` previews lossless compression of closed audit-log rotations;
165
+ add `--apply` to perform it. It does not prune evidence, recovery state, keys, worktrees, or Git refs.
166
+ Upgrade all audit readers first: versions before 0.15.0 cannot read compressed rotations.
167
+ See the [storage recipe](https://github.com/WeSpitfire/agent-merge-broker/blob/main/docs/GETTING_STARTED.md#inspect-and-compact-storage).
168
+
146
169
  For protected-branch enforcement of Coordinate provenance, pin the composite action to the matching
147
- release tag: `WeSpitfire/agent-merge-broker/verify@v0.14.2`. Configuration examples are in
148
- [Getting started](docs/GETTING_STARTED.md) and the [release guide](docs/RELEASING.md).
170
+ release tag: `WeSpitfire/agent-merge-broker/verify@v0.15.0`. Configuration examples are in
171
+ [Getting started](https://github.com/WeSpitfire/agent-merge-broker/blob/main/docs/GETTING_STARTED.md) and the [release guide](https://github.com/WeSpitfire/agent-merge-broker/blob/main/docs/RELEASING.md).
149
172
 
150
173
  Source verification includes the full test suite, both examples, and installation of the actual npm
151
174
  tarball. Publication waits for the same immutable commit to pass Linux, macOS, and Windows checks
152
175
  and publishes the tested tarball through npm trusted publishing.
153
176
 
154
- See [Architecture](docs/ARCHITECTURE.md), [Vision](VISION.md), [Contributing](CONTRIBUTING.md), and
155
- [Support](SUPPORT.md). The project is licensed under [Apache-2.0](LICENSE). Pre-1.0 persisted formats
177
+ See [Architecture](https://github.com/WeSpitfire/agent-merge-broker/blob/main/docs/ARCHITECTURE.md),
178
+ [Vision](https://github.com/WeSpitfire/agent-merge-broker/blob/main/VISION.md),
179
+ [Contributing](https://github.com/WeSpitfire/agent-merge-broker/blob/main/CONTRIBUTING.md), and
180
+ [Support](https://github.com/WeSpitfire/agent-merge-broker/blob/main/SUPPORT.md). The project is licensed under [Apache-2.0](LICENSE). Pre-1.0 persisted formats
156
181
  are versioned, but compatibility changes may still require a documented migration.
@@ -14,4 +14,3 @@ export declare function detectBootstrapPlan(root: string): Promise<BootstrapPlan
14
14
  export declare function applyBootstrapPlan(config: BrokerConfig, plan: BootstrapPlan): boolean;
15
15
  export declare function installAgentContract(root: string): Promise<AgentContractResult>;
16
16
  export declare function hasAgentContract(root: string): Promise<boolean>;
17
- //# sourceMappingURL=bootstrap.d.ts.map
package/dist/bootstrap.js CHANGED
@@ -359,4 +359,3 @@ export async function hasAgentContract(root) {
359
359
  const contents = await readFile(target, "utf8");
360
360
  return contents.includes(AGENT_BLOCK_START) && contents.includes(AGENT_BLOCK_END);
361
361
  }
362
- //# sourceMappingURL=bootstrap.js.map
package/dist/broker.d.ts CHANGED
@@ -307,4 +307,3 @@ export declare class MergeBroker {
307
307
  gate?: boolean;
308
308
  }): Promise<Record<string, unknown>>;
309
309
  }
310
- //# sourceMappingURL=broker.d.ts.map
package/dist/broker.js CHANGED
@@ -3973,4 +3973,3 @@ export class MergeBroker {
3973
3973
  };
3974
3974
  }
3975
3975
  }
3976
- //# sourceMappingURL=broker.js.map
@@ -16,4 +16,3 @@ export declare function assertCandidateBinding(candidate: CandidateRecord, bindi
16
16
  }): void;
17
17
  export declare function assertCurrentApprovalPolicy(config: BrokerConfig, candidate: CandidateRecord): void;
18
18
  export declare function upsertEvidence(candidate: CandidateRecord, evidence: VerificationEvidence): void;
19
- //# sourceMappingURL=candidate-lifecycle.d.ts.map
@@ -169,4 +169,3 @@ export function upsertEvidence(candidate, evidence) {
169
169
  candidate.state = candidateState(candidate);
170
170
  delete candidate.reason;
171
171
  }
172
- //# sourceMappingURL=candidate-lifecycle.js.map
package/dist/cli.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
2
  export {};
3
- //# sourceMappingURL=cli.d.ts.map
package/dist/cli.js CHANGED
@@ -9,6 +9,9 @@ import { BrokerError, CommandError } from "./errors.js";
9
9
  import { formatServeEvent, isErrorEvent, serveEventJson, shouldReportIdle, } from "./serve-log.js";
10
10
  import { MergeBroker } from "./broker.js";
11
11
  import { GitRepository } from "./git.js";
12
+ import { loadConfig } from "./config.js";
13
+ import { StateStore } from "./store.js";
14
+ import { compactAuditStorage, inspectStorage } from "./storage.js";
12
15
  import { prePushHook } from "./hooks.js";
13
16
  import { formatBrokerStatus } from "./status.js";
14
17
  import { createSupportBundle } from "./support.js";
@@ -1048,6 +1051,49 @@ program
1048
1051
  ...(result.archivePath ? [`Archive: ${result.archivePath}`] : []),
1049
1052
  ].join("\n"));
1050
1053
  });
1054
+ const storage = program.command("storage").description("inspect broker storage and compact closed audit logs without deleting evidence");
1055
+ // Inspection/preview must not initialize absent state or create keys and lock directories.
1056
+ async function storageContext() {
1057
+ const repo = await GitRepository.discover(globalOptions().cwd);
1058
+ const config = await loadConfig(repo.root);
1059
+ const store = new StateStore(repo.commonGitDir, config.stateDirectory, config.leases.lockTimeoutSeconds);
1060
+ return { repo, config, store };
1061
+ }
1062
+ storage.command("show")
1063
+ .description("report logical bytes and file counts; never read stored secrets or follow symlinks")
1064
+ .action(async () => {
1065
+ const { repo, config, store } = await storageContext();
1066
+ const report = await inspectStorage(store, {
1067
+ repositoryRoot: repo.root,
1068
+ ...(config.integration.provenance?.directory ? { provenanceDirectory: config.integration.provenance.directory } : {}),
1069
+ });
1070
+ output(report, [
1071
+ `Broker storage: ${report.logicalBytes.toLocaleString("en-US")} logical bytes in ${report.files} files${report.complete ? "" : " (partial)"}.`,
1072
+ ...report.categories.map((item) => ` ${item.category}: ${item.logicalBytes.toLocaleString("en-US")} bytes, ${item.files} files`),
1073
+ "Excludes npm installations, general repository files, Git object history, and filesystem allocation overhead.",
1074
+ ...report.skipped.map((item) => `Skipped ${item.path}: ${item.reason}`),
1075
+ ].join("\n"));
1076
+ });
1077
+ storage.command("compact")
1078
+ .description("preview lossless compression of closed audit logs; active and recovery data stay untouched")
1079
+ .option("--older-than <days>", "minimum modification age of closed audit logs", "30")
1080
+ .option("--apply", "write verified gzip copies and remove only their redundant originals")
1081
+ .action(async (options) => {
1082
+ const { store } = await storageContext();
1083
+ const result = await compactAuditStorage(store, {
1084
+ olderThanDays: Number(options.olderThan),
1085
+ apply: options.apply ?? false,
1086
+ });
1087
+ output(result, [
1088
+ result.applied
1089
+ ? `Compressed ${result.compressedFiles} closed audit segments; saved ${result.savedBytes.toLocaleString("en-US")} bytes.`
1090
+ : `Eligible: ${result.eligibleFiles} closed audit segments (${result.eligibleBytes.toLocaleString("en-US")} bytes). Preview only; add --apply to compress.`,
1091
+ "Audit evidence is preserved. No active state, signing keys, worktrees, or retained Git refs are deleted.",
1092
+ "Compacted audit history requires a broker version with gzip archive support.",
1093
+ ...result.entries.map((item) => `${item.status}: ${item.path}${item.reason ? ` — ${item.reason}` : ""}`),
1094
+ ...result.skipped.map((item) => `Skipped ${item.path}: ${item.reason}`),
1095
+ ].join("\n"));
1096
+ });
1051
1097
  program
1052
1098
  .command("recover")
1053
1099
  .description("recover interrupted integrations and candidate validation submissions")
@@ -1325,4 +1371,3 @@ program.parseAsync().catch((error) => {
1325
1371
  }
1326
1372
  process.exitCode = 1;
1327
1373
  });
1328
- //# sourceMappingURL=cli.js.map
package/dist/config.d.ts CHANGED
@@ -19,4 +19,3 @@ export declare function isSafeStateDirectory(value: unknown): value is string;
19
19
  export declare function validateConfig(value: unknown): BrokerConfig;
20
20
  export declare function loadConfig(repoRoot: string): Promise<BrokerConfig>;
21
21
  export declare function writeConfig(repoRoot: string, config: BrokerConfig): Promise<string>;
22
- //# sourceMappingURL=config.d.ts.map
package/dist/config.js CHANGED
@@ -524,4 +524,3 @@ export async function writeConfig(repoRoot, config) {
524
524
  await writeFile(target, `${JSON.stringify(config, null, 2)}\n`, "utf8");
525
525
  return target;
526
526
  }
527
- //# sourceMappingURL=config.js.map
package/dist/core.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ export { MergeBroker, type AdoptCandidateInput, type ClaimTaskInput, type RegisterCandidateAuthorityOptions, type RegisterTaskInput, } from "./broker.js";
2
+ export { adoptedRef, GitRepository, type LinearCommitHistory, type PinnedGitCommit, type WorktreeInfo, } from "./git.js";
3
+ export { StateStore, type ArchivedStateSlice, type LockStatus } from "./store.js";
4
+ export { inspectStorage, compactAuditStorage, type StorageCategory, type StorageReport, type StorageCompactionOptions, type StorageCompactionResult, } from "./storage.js";
5
+ export { installHooks, prePushHook, uninstallHooks, type HookInstallation } from "./hooks.js";
6
+ export { describeServeEvent, formatServeEvent, serveEventJson, shouldReportIdle, type ServeEvent, } from "./serve-log.js";
7
+ export { currentServicePlatform, installService, launchdPlist, serviceFilePath, serviceName, systemdUnit, windowsTaskXml, quoteWindowsArgument, uninstallService, type ServiceDefinition, type ServiceInstallation, type ServiceOptions, type ServicePlatform, } from "./service.js";
8
+ export { defaultConfig, initializeConfig, loadConfig, validateConfig, writeConfig } from "./config.js";
9
+ export { applyBootstrapPlan, detectBootstrapPlan, hasAgentContract, installAgentContract, type AgentContractResult, type BootstrapPlan, } from "./bootstrap.js";
10
+ export { scheduleTasks } from "./scheduler.js";
11
+ export { formatBrokerStatus } from "./status.js";
12
+ export { createSupportBundle, sanitizeSupportData, type SupportBundle } from "./support.js";
13
+ export { githubCliPublisher, type ForgePublisher, type PublicationResult, type PullRequestState, } from "./publisher.js";
14
+ export { buildBatchProvenance, generateProvenanceSigningIdentity, provenanceKeyId, provenancePath, publicKeyFromPrivate, signBatchProvenance, validateProvenancePublicKey, verifyBatchProvenanceSignature, type ProvenanceSigningIdentity, } from "./provenance.js";
15
+ export { batchIdFromBranch, policyFromBase, verifyProvenance, type ProvenanceVerification, type VerifyProvenanceOptions, } from "./verify.js";
16
+ export { BrokerError, CommandError, ValidationError } from "./errors.js";
17
+ export { signSubmissionAttestation, verifySubmissionAttestation, submissionAttestationEnvelopeSchema, submissionAttestationStatementSchema, SUBMISSION_ATTESTATION_PAYLOAD_TYPE, SUBMISSION_ATTESTATION_PREDICATE_TYPE, type SubmissionAttestationEnvelope, type SubmissionAttestationStatement, type SubmissionAttestationVerificationOptions, type SubmissionAttestationVerificationResult, } from "./submission-attestation.js";
18
+ export { schemaFingerprint, schemaSnapshotIdentity } from "./schema-identity.js";
19
+ export type * from "./types.js";
package/dist/core.js ADDED
@@ -0,0 +1,18 @@
1
+ export { MergeBroker, } from "./broker.js";
2
+ export { adoptedRef, GitRepository, } from "./git.js";
3
+ export { StateStore } from "./store.js";
4
+ export { inspectStorage, compactAuditStorage, } from "./storage.js";
5
+ export { installHooks, prePushHook, uninstallHooks } from "./hooks.js";
6
+ export { describeServeEvent, formatServeEvent, serveEventJson, shouldReportIdle, } from "./serve-log.js";
7
+ export { currentServicePlatform, installService, launchdPlist, serviceFilePath, serviceName, systemdUnit, windowsTaskXml, quoteWindowsArgument, uninstallService, } from "./service.js";
8
+ export { defaultConfig, initializeConfig, loadConfig, validateConfig, writeConfig } from "./config.js";
9
+ export { applyBootstrapPlan, detectBootstrapPlan, hasAgentContract, installAgentContract, } from "./bootstrap.js";
10
+ export { scheduleTasks } from "./scheduler.js";
11
+ export { formatBrokerStatus } from "./status.js";
12
+ export { createSupportBundle, sanitizeSupportData } from "./support.js";
13
+ export { githubCliPublisher, } from "./publisher.js";
14
+ export { buildBatchProvenance, generateProvenanceSigningIdentity, provenanceKeyId, provenancePath, publicKeyFromPrivate, signBatchProvenance, validateProvenancePublicKey, verifyBatchProvenanceSignature, } from "./provenance.js";
15
+ export { batchIdFromBranch, policyFromBase, verifyProvenance, } from "./verify.js";
16
+ export { BrokerError, CommandError, ValidationError } from "./errors.js";
17
+ export { signSubmissionAttestation, verifySubmissionAttestation, submissionAttestationEnvelopeSchema, submissionAttestationStatementSchema, SUBMISSION_ATTESTATION_PAYLOAD_TYPE, SUBMISSION_ATTESTATION_PREDICATE_TYPE, } from "./submission-attestation.js";
18
+ export { schemaFingerprint, schemaSnapshotIdentity } from "./schema-identity.js";
package/dist/errors.d.ts CHANGED
@@ -13,4 +13,3 @@ export declare class CommandError extends BrokerError {
13
13
  export declare class ValidationError extends BrokerError {
14
14
  constructor(message: string, details?: Record<string, unknown>);
15
15
  }
16
- //# sourceMappingURL=errors.d.ts.map
package/dist/errors.js CHANGED
@@ -33,4 +33,3 @@ export class ValidationError extends BrokerError {
33
33
  this.name = "ValidationError";
34
34
  }
35
35
  }
36
- //# sourceMappingURL=errors.js.map
@@ -19,4 +19,3 @@ export declare class GateAuthorityStore {
19
19
  private atomicReplace;
20
20
  private writeTemporary;
21
21
  }
22
- //# sourceMappingURL=gate-authority.d.ts.map
@@ -285,4 +285,3 @@ export class GateAuthorityStore {
285
285
  return temporary;
286
286
  }
287
287
  }
288
- //# sourceMappingURL=gate-authority.js.map
@@ -5,4 +5,3 @@ export declare function canonicalRemoteUrl(value: string, repoRoot: string): str
5
5
  export declare function localFileRemotePath(value: string, remote: string, purpose: "fetch" | "publication"): string;
6
6
  /** Remove one command record terminator without changing legal whitespace in a local pathname. */
7
7
  export declare function singleGitOutputRecord(output: string): string | undefined;
8
- //# sourceMappingURL=git-locators.d.ts.map
@@ -107,4 +107,3 @@ export function singleGitOutputRecord(output) {
107
107
  // risk resolving the replacement-character spelling to a different repository on disk.
108
108
  return value.length > 0 && !/[\0\r\n\ufffd]/u.test(value) ? value : undefined;
109
109
  }
110
- //# sourceMappingURL=git-locators.js.map
package/dist/git.d.ts CHANGED
@@ -212,4 +212,3 @@ export declare class GitRepository {
212
212
  replaceLocalBranch(branch: string, nextHead: string): Promise<void>;
213
213
  listWorktrees(): Promise<WorktreeInfo[]>;
214
214
  }
215
- //# sourceMappingURL=git.d.ts.map
package/dist/git.js CHANGED
@@ -2366,4 +2366,3 @@ export class GitRepository {
2366
2366
  return records;
2367
2367
  }
2368
2368
  }
2369
- //# sourceMappingURL=git.js.map
package/dist/hooks.d.ts CHANGED
@@ -19,4 +19,3 @@ export declare function installHooks(options: {
19
19
  force?: boolean;
20
20
  }): Promise<HookInstallation>;
21
21
  export declare function uninstallHooks(repo: GitRepository): Promise<HookInstallation>;
22
- //# sourceMappingURL=hooks.d.ts.map
package/dist/hooks.js CHANGED
@@ -123,4 +123,3 @@ export async function uninstallHooks(repo) {
123
123
  }
124
124
  return { hooksPath, hookFile, installed: false };
125
125
  }
126
- //# sourceMappingURL=hooks.js.map
package/dist/index.d.ts CHANGED
@@ -1,20 +1,2 @@
1
- export { MergeBroker, type AdoptCandidateInput, type ClaimTaskInput, type RegisterCandidateAuthorityOptions, type RegisterTaskInput, } from "./broker.js";
2
- export { adoptedRef, GitRepository, type LinearCommitHistory, type PinnedGitCommit, type WorktreeInfo, } from "./git.js";
3
- export { StateStore, type ArchivedStateSlice, type LockStatus } from "./store.js";
4
- export { installHooks, prePushHook, uninstallHooks, type HookInstallation } from "./hooks.js";
5
- export { describeServeEvent, formatServeEvent, serveEventJson, shouldReportIdle, type ServeEvent, } from "./serve-log.js";
6
- export { currentServicePlatform, installService, launchdPlist, serviceFilePath, serviceName, systemdUnit, windowsTaskXml, quoteWindowsArgument, uninstallService, type ServiceDefinition, type ServiceInstallation, type ServiceOptions, type ServicePlatform, } from "./service.js";
7
- export { defaultConfig, initializeConfig, loadConfig, validateConfig, writeConfig } from "./config.js";
8
- export { applyBootstrapPlan, detectBootstrapPlan, hasAgentContract, installAgentContract, type AgentContractResult, type BootstrapPlan, } from "./bootstrap.js";
9
- export { scheduleTasks } from "./scheduler.js";
10
- export { formatBrokerStatus } from "./status.js";
11
- export { createSupportBundle, sanitizeSupportData, type SupportBundle } from "./support.js";
1
+ export * from "./core.js";
12
2
  export { createMcpServer, mcpToolNames, type McpProfile } from "./mcp.js";
13
- export { githubCliPublisher, type ForgePublisher, type PublicationResult, type PullRequestState, } from "./publisher.js";
14
- export { buildBatchProvenance, generateProvenanceSigningIdentity, provenanceKeyId, provenancePath, publicKeyFromPrivate, signBatchProvenance, validateProvenancePublicKey, verifyBatchProvenanceSignature, type ProvenanceSigningIdentity, } from "./provenance.js";
15
- export { batchIdFromBranch, policyFromBase, verifyProvenance, type ProvenanceVerification, type VerifyProvenanceOptions, } from "./verify.js";
16
- export { BrokerError, CommandError, ValidationError } from "./errors.js";
17
- export { signSubmissionAttestation, verifySubmissionAttestation, submissionAttestationEnvelopeSchema, submissionAttestationStatementSchema, SUBMISSION_ATTESTATION_PAYLOAD_TYPE, SUBMISSION_ATTESTATION_PREDICATE_TYPE, type SubmissionAttestationEnvelope, type SubmissionAttestationStatement, type SubmissionAttestationVerificationOptions, type SubmissionAttestationVerificationResult, } from "./submission-attestation.js";
18
- export { schemaFingerprint, schemaSnapshotIdentity } from "./schema-identity.js";
19
- export type * from "./types.js";
20
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,19 +1,3 @@
1
- export { MergeBroker, } from "./broker.js";
2
- export { adoptedRef, GitRepository, } from "./git.js";
3
- export { StateStore } from "./store.js";
4
- export { installHooks, prePushHook, uninstallHooks } from "./hooks.js";
5
- export { describeServeEvent, formatServeEvent, serveEventJson, shouldReportIdle, } from "./serve-log.js";
6
- export { currentServicePlatform, installService, launchdPlist, serviceFilePath, serviceName, systemdUnit, windowsTaskXml, quoteWindowsArgument, uninstallService, } from "./service.js";
7
- export { defaultConfig, initializeConfig, loadConfig, validateConfig, writeConfig } from "./config.js";
8
- export { applyBootstrapPlan, detectBootstrapPlan, hasAgentContract, installAgentContract, } from "./bootstrap.js";
9
- export { scheduleTasks } from "./scheduler.js";
10
- export { formatBrokerStatus } from "./status.js";
11
- export { createSupportBundle, sanitizeSupportData } from "./support.js";
1
+ // Preserve the full package's public API; CLI-only consumers use the shared core entry point.
2
+ export * from "./core.js";
12
3
  export { createMcpServer, mcpToolNames } from "./mcp.js";
13
- export { githubCliPublisher, } from "./publisher.js";
14
- export { buildBatchProvenance, generateProvenanceSigningIdentity, provenanceKeyId, provenancePath, publicKeyFromPrivate, signBatchProvenance, validateProvenancePublicKey, verifyBatchProvenanceSignature, } from "./provenance.js";
15
- export { batchIdFromBranch, policyFromBase, verifyProvenance, } from "./verify.js";
16
- export { BrokerError, CommandError, ValidationError } from "./errors.js";
17
- export { signSubmissionAttestation, verifySubmissionAttestation, submissionAttestationEnvelopeSchema, submissionAttestationStatementSchema, SUBMISSION_ATTESTATION_PAYLOAD_TYPE, SUBMISSION_ATTESTATION_PREDICATE_TYPE, } from "./submission-attestation.js";
18
- export { schemaFingerprint, schemaSnapshotIdentity } from "./schema-identity.js";
19
- //# sourceMappingURL=index.js.map
package/dist/mcp-cli.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
2
  export {};
3
- //# sourceMappingURL=mcp-cli.d.ts.map
package/dist/mcp-cli.js CHANGED
@@ -18,4 +18,3 @@ for (const signal of ["SIGINT", "SIGTERM"]) {
18
18
  void handle.close().finally(() => process.exit(0));
19
19
  });
20
20
  }
21
- //# sourceMappingURL=mcp-cli.js.map
package/dist/mcp.d.ts CHANGED
@@ -10,4 +10,3 @@ export declare function createMcpServer(options?: {
10
10
  profile?: McpProfile;
11
11
  version?: string;
12
12
  }): McpServer;
13
- //# sourceMappingURL=mcp.d.ts.map
package/dist/mcp.js CHANGED
@@ -370,4 +370,3 @@ export function createMcpServer(options = {}) {
370
370
  }, wrapped(async () => await (await open()).recoverAbandonedIntegrations()));
371
371
  return server;
372
372
  }
373
- //# sourceMappingURL=mcp.js.map
@@ -6,4 +6,3 @@ export declare function patternsMayOverlap(left: string, right: string): boolean
6
6
  export declare function patternSetsMayOverlap(left: string[], right: string[]): boolean;
7
7
  export declare function pathsOverlap(left: string[], right: string[]): string | undefined;
8
8
  export declare function matchedSerializedPatterns(paths: string[], patterns: string[]): string[];
9
- //# sourceMappingURL=patterns.d.ts.map
package/dist/patterns.js CHANGED
@@ -63,4 +63,3 @@ export function pathsOverlap(left, right) {
63
63
  export function matchedSerializedPatterns(paths, patterns) {
64
64
  return patterns.filter((pattern) => paths.some((file) => matchesPattern(file, pattern)));
65
65
  }
66
- //# sourceMappingURL=patterns.js.map
package/dist/process.d.ts CHANGED
@@ -42,4 +42,3 @@ export declare function runCommand(executable: string, args: string[], options:
42
42
  export declare function runShell(command: string, options: RunOptions & {
43
43
  shell?: ResolvedShell;
44
44
  }): Promise<CommandResult>;
45
- //# sourceMappingURL=process.d.ts.map
package/dist/process.js CHANGED
@@ -186,4 +186,3 @@ export async function runShell(command, options) {
186
186
  const shell = options.shell ?? resolveShell();
187
187
  return await runCommand(shell.executable, [...shell.args, command], options);
188
188
  }
189
- //# sourceMappingURL=process.js.map
@@ -19,4 +19,3 @@ export declare function buildBatchProvenance(options: {
19
19
  integratedPaths: string[];
20
20
  history?: HistoryMode;
21
21
  }): BatchProvenance;
22
- //# sourceMappingURL=provenance.d.ts.map
@@ -137,4 +137,3 @@ export function buildBatchProvenance(options) {
137
137
  createdAt: new Date().toISOString(),
138
138
  };
139
139
  }
140
- //# sourceMappingURL=provenance.js.map
@@ -77,4 +77,3 @@ export interface PullRequestState {
77
77
  export declare function inspectPullRequest(repoRoot: string, pullRequestUrl: string): Promise<PullRequestState>;
78
78
  export declare function defaultProjectTitle(repoRoot: string): string;
79
79
  export declare const githubCliPublisher: ForgePublisher;
80
- //# sourceMappingURL=publisher.d.ts.map
package/dist/publisher.js CHANGED
@@ -401,4 +401,3 @@ export const githubCliPublisher = {
401
401
  disableAutoMerge,
402
402
  inspectPullRequest,
403
403
  };
404
- //# sourceMappingURL=publisher.js.map
@@ -3,4 +3,3 @@ export declare function scheduleTasks(state: BrokerState, config: BrokerConfig,
3
3
  taskIds?: string[];
4
4
  maxTasks?: number;
5
5
  }): SchedulePlan;
6
- //# sourceMappingURL=scheduler.d.ts.map
package/dist/scheduler.js CHANGED
@@ -93,4 +93,3 @@ export function scheduleTasks(state, config, options = {}) {
93
93
  }
94
94
  return { selected, rejected, totalCommits };
95
95
  }
96
- //# sourceMappingURL=scheduler.js.map
@@ -8,4 +8,3 @@ export declare function schemaSnapshotIdentity(name: string, schema: Record<stri
8
8
  fingerprint: string;
9
9
  path: string;
10
10
  };
11
- //# sourceMappingURL=schema-identity.d.ts.map
@@ -30,4 +30,3 @@ export function schemaSnapshotIdentity(name, schema) {
30
30
  path: `schemas/immutable/${name}.${fingerprint}.schema.json`,
31
31
  };
32
32
  }
33
- //# sourceMappingURL=schema-identity.js.map
@@ -86,4 +86,3 @@ export declare function serveEventJson(event: ServeEvent, now: Date): string;
86
86
  * on its own slower clock.
87
87
  */
88
88
  export declare function shouldReportIdle(lastOutputAtMs: number, nowMs: number, intervalMs?: number): boolean;
89
- //# sourceMappingURL=serve-log.d.ts.map
package/dist/serve-log.js CHANGED
@@ -81,4 +81,3 @@ export function serveEventJson(event, now) {
81
81
  export function shouldReportIdle(lastOutputAtMs, nowMs, intervalMs = HEARTBEAT_INTERVAL_MS) {
82
82
  return nowMs - lastOutputAtMs >= intervalMs;
83
83
  }
84
- //# sourceMappingURL=serve-log.js.map
package/dist/service.d.ts CHANGED
@@ -66,4 +66,3 @@ export declare function uninstallService(repositoryRoot: string, home?: string):
66
66
  file: string;
67
67
  removed: boolean;
68
68
  }>;
69
- //# sourceMappingURL=service.d.ts.map
package/dist/service.js CHANGED
@@ -364,4 +364,3 @@ export async function uninstallService(repositoryRoot, home = homedir()) {
364
364
  await rm(file, { force: true });
365
365
  return { name, file, removed: existed };
366
366
  }
367
- //# sourceMappingURL=service.js.map
@@ -3,4 +3,3 @@ import { type CurrentBrokerState, type SubmissionRecord } from "./types.js";
3
3
  export declare function decodeBrokerState(value: unknown): CurrentBrokerState;
4
4
  /** Shared decoder for archived submission manifests, with the same additive-field behavior. */
5
5
  export declare function decodeSubmissionRecord(value: unknown, location?: string): SubmissionRecord;
6
- //# sourceMappingURL=state-codec.d.ts.map
@@ -175,4 +175,3 @@ export function decodeSubmissionRecord(value, location = "$") {
175
175
  submission(value, location);
176
176
  return value;
177
177
  }
178
- //# sourceMappingURL=state-codec.js.map
package/dist/status.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  import type { BrokerConfig, BrokerState } from "./types.js";
2
2
  /** Human status is an operator surface: it includes both state and the safest useful next action. */
3
3
  export declare function formatBrokerStatus(state: BrokerState, config: BrokerConfig, at?: Date): string;
4
- //# sourceMappingURL=status.d.ts.map
package/dist/status.js CHANGED
@@ -103,4 +103,3 @@ export function formatBrokerStatus(state, config, at = new Date()) {
103
103
  ...(actions.length > 0 ? [...new Set(actions)].map((action) => ` - ${action}`) : [" none — no work is waiting"]),
104
104
  ].join("\n");
105
105
  }
106
- //# sourceMappingURL=status.js.map