agent-merge-broker 0.12.1 → 0.14.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/CONTRIBUTING.md +17 -3
  3. package/README.md +102 -617
  4. package/ROADMAP.md +52 -35
  5. package/SUPPORT.md +6 -0
  6. package/VISION.md +29 -17
  7. package/dist/broker.d.ts +35 -3
  8. package/dist/broker.d.ts.map +1 -1
  9. package/dist/broker.js +223 -171
  10. package/dist/broker.js.map +1 -1
  11. package/dist/candidate-lifecycle.d.ts +19 -0
  12. package/dist/candidate-lifecycle.d.ts.map +1 -0
  13. package/dist/candidate-lifecycle.js +172 -0
  14. package/dist/candidate-lifecycle.js.map +1 -0
  15. package/dist/cli.js +234 -8
  16. package/dist/cli.js.map +1 -1
  17. package/dist/config.d.ts +2 -0
  18. package/dist/config.d.ts.map +1 -1
  19. package/dist/config.js +86 -4
  20. package/dist/config.js.map +1 -1
  21. package/dist/gate-authority.d.ts +22 -0
  22. package/dist/gate-authority.d.ts.map +1 -0
  23. package/dist/gate-authority.js +288 -0
  24. package/dist/gate-authority.js.map +1 -0
  25. package/dist/git-locators.d.ts +8 -0
  26. package/dist/git-locators.d.ts.map +1 -0
  27. package/dist/git-locators.js +110 -0
  28. package/dist/git-locators.js.map +1 -0
  29. package/dist/git.d.ts +140 -9
  30. package/dist/git.d.ts.map +1 -1
  31. package/dist/git.js +2079 -100
  32. package/dist/git.js.map +1 -1
  33. package/dist/index.d.ts +4 -2
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +4 -2
  36. package/dist/index.js.map +1 -1
  37. package/dist/publisher.js +1 -1
  38. package/dist/publisher.js.map +1 -1
  39. package/dist/schema-identity.d.ts +11 -0
  40. package/dist/schema-identity.d.ts.map +1 -0
  41. package/dist/schema-identity.js +33 -0
  42. package/dist/schema-identity.js.map +1 -0
  43. package/dist/serve-log.d.ts +4 -0
  44. package/dist/serve-log.d.ts.map +1 -1
  45. package/dist/serve-log.js +9 -2
  46. package/dist/serve-log.js.map +1 -1
  47. package/dist/state-codec.d.ts +6 -0
  48. package/dist/state-codec.d.ts.map +1 -0
  49. package/dist/state-codec.js +178 -0
  50. package/dist/state-codec.js.map +1 -0
  51. package/dist/status.d.ts.map +1 -1
  52. package/dist/status.js +25 -0
  53. package/dist/status.js.map +1 -1
  54. package/dist/store.d.ts +28 -3
  55. package/dist/store.d.ts.map +1 -1
  56. package/dist/store.js +207 -32
  57. package/dist/store.js.map +1 -1
  58. package/dist/submission-attestation.d.ts +111 -0
  59. package/dist/submission-attestation.d.ts.map +1 -0
  60. package/dist/submission-attestation.js +260 -0
  61. package/dist/submission-attestation.js.map +1 -0
  62. package/dist/submission-retention.d.ts +19 -0
  63. package/dist/submission-retention.d.ts.map +1 -0
  64. package/dist/submission-retention.js +183 -0
  65. package/dist/submission-retention.js.map +1 -0
  66. package/dist/submission.d.ts +37 -0
  67. package/dist/submission.d.ts.map +1 -0
  68. package/dist/submission.js +661 -0
  69. package/dist/submission.js.map +1 -0
  70. package/dist/support.d.ts.map +1 -1
  71. package/dist/support.js +17 -2
  72. package/dist/support.js.map +1 -1
  73. package/dist/types.d.ts +156 -0
  74. package/dist/types.d.ts.map +1 -1
  75. package/dist/types.js +2 -0
  76. package/dist/types.js.map +1 -1
  77. package/dist/validation.d.ts +4 -0
  78. package/dist/validation.d.ts.map +1 -1
  79. package/dist/validation.js +178 -12
  80. package/dist/validation.js.map +1 -1
  81. package/docs/ARCHITECTURE.md +183 -8
  82. package/docs/COMPATIBILITY.md +179 -12
  83. package/docs/GETTING_STARTED.md +201 -13
  84. package/docs/PROTOCOL.md +262 -8
  85. package/docs/RELEASING.md +47 -4
  86. package/docs/SECURITY.md +160 -17
  87. package/examples/local-gate/README.md +25 -0
  88. package/examples/local-gate/run.mjs +137 -0
  89. package/package.json +6 -3
  90. package/schemas/config.schema.json +11 -2
  91. package/schemas/gate-authority.schema.json +39 -0
  92. package/schemas/identities.json +71 -0
  93. package/schemas/immutable/candidate.36fa2d519ef286301b4294bf9b32e325b84d556c48f762361cab057a5926c22e.schema.json +179 -0
  94. package/schemas/immutable/config.b16e5d9943091f04f9e11901bf8b1ca5ded2800395704b80769a074a548d6bff.schema.json +565 -0
  95. package/schemas/immutable/gate-authority.ee9db06506f1628e58bfacd86fac4a292cda55e0f83236c82fa9eb285fc2817a.schema.json +76 -0
  96. package/schemas/immutable/provenance.0c70eee61e81b91705ced11df623caa1c3d621f710fffa645e709fd1e662db41.schema.json +168 -0
  97. package/schemas/immutable/receipt.c8b78ab9d86e9228d58c4b8bdb1547ff2142809bafe9bf05551638e7cbe644af.schema.json +85 -0
  98. package/schemas/immutable/submission-attestation-envelope.fa16a61bdbf08fa447d42a9f1a71f45563a8a2e792055f0906603c9d29d96ca0.schema.json +45 -0
  99. package/schemas/immutable/submission-attestation-statement.e4d76e08ed099c18d184b2a489570f58624f7af0df0c685f3a5c200d763d92cb.schema.json +320 -0
  100. package/schemas/immutable/submission.8fddd4d1951a2303d7be3fa74a545ab9c35edbf06dcc2280e88f4038342e550b.schema.json +333 -0
  101. package/schemas/submission-attestation-envelope.schema.json +45 -0
  102. package/schemas/submission-attestation-statement.schema.json +320 -0
  103. package/schemas/submission.schema.json +173 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,93 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.14.2 — 2026-09-06
4
+
5
+ ### Fixed
6
+
7
+ - Accepted both npm 10's root-level publish dry-run JSON fields and npm 11/12's package-name wrapper
8
+ when checking the tested tarball. Versions `0.14.0` and `0.14.1` have immutable GitHub tags but were
9
+ not published to npm; `0.14.2` is the corrected release target pending registry confirmation.
10
+
11
+ ## 0.14.1 — 2026-09-06
12
+
13
+ This GitHub release was not published to npm; its dry-run JSON compatibility correction is in `0.14.2`.
14
+
15
+ ### Fixed
16
+
17
+ - Prefixed the tested release tarball path with `./` so npm treats it as a local package rather than
18
+ GitHub shorthand. Added a publish dry-run to the packaged smoke test to verify that path before
19
+ granting publication authority.
20
+ - Updated release references to `0.14.1`. The immutable `v0.14.0` GitHub tag remains available, but
21
+ its npm publication failed before uploading a package. Version `0.14.1` is the first npm release
22
+ target for the features below; confirm completed publication in npm's version history.
23
+
24
+ ## 0.14.0 — 2026-09-06
25
+
26
+ This GitHub release was not published to npm; its publishing-path correction is in `0.14.1`.
27
+
28
+ ### Added
29
+
30
+ - Added Gate readiness checks through `doctor --gate`, captured validator output through
31
+ `candidate show --logs`, archived-submission inspection with `candidate list --all`, and
32
+ submission counts in metrics.
33
+ - Added deliberate `candidate abandon --reason` and preview-first `candidate archive` operations.
34
+ Abandonment preserves the original evidence and retries cleanup without rerunning validators.
35
+ Archival retires terminal records from active state while preserving their audit history; refs
36
+ remain retained unless `--release-artifacts` explicitly releases the exact broker-owned ref.
37
+ - Added detached Ed25519 DSSE attestations containing an in-toto Gate validation statement, plus
38
+ offline verification against an independently trusted public key and expected artifact, base,
39
+ policy, and authority. Signed validation evidence does not authorize publication or merging.
40
+ - Added fingerprint-addressed, packaged schema snapshots and an identity manifest while preserving
41
+ legacy schema aliases. Added a runnable local Gate example with accepted and rejected candidates.
42
+ - Added runtime validation of saved state with field-specific corruption diagnostics, portable
43
+ GitHub CLI test fixtures, and real subprocess termination/restart recovery tests.
44
+
45
+ ### Changed
46
+
47
+ - Raised the minimum Node.js version to 22, from 20.12 in `0.13.0`. The reusable release matrix
48
+ tests Node.js 22, 24, and 26 on Linux, macOS, and Windows.
49
+ - Publication now waits for all platform checks against one immutable commit, installs and exercises
50
+ the actual npm tarball, and publishes those tested bytes with npm trusted publishing/provenance.
51
+ - Extracted pure candidate lifecycle and Git locator logic and Gate retention into focused internal
52
+ modules while preserving the public Coordinate API.
53
+ - Shortened the README into Coordinate and Gate entry routes and aligned operations, security,
54
+ compatibility, release, and roadmap documentation with the implemented capability boundaries.
55
+
56
+ ## 0.13.0 — 2026-09-04
57
+
58
+ ### Added
59
+
60
+ - Added validation-only Gate intake for trusted Git refs already present in the broker repository.
61
+ `candidate authority setup` first records a versioned protected-target trust root at a fixed path
62
+ in Git's common directory; `candidate adopt --ref` then pins the exact commit, derives its
63
+ base-relative history and paths, loads committed policy from the registered base, and records a
64
+ standalone, schema-backed submission without manufacturing tasks, leases, receipts, or batches.
65
+ - Added `candidate list` and `candidate show`, plus recovery of interrupted `received` and
66
+ `validating` submissions.
67
+
68
+ ### Changed
69
+
70
+ - Validator environments now expose `MERGE_BROKER_SUBMISSION_ID` during trusted local-ref intake.
71
+ - Validators now receive an owner-readable UTF-8 JSON path list through
72
+ `MERGE_BROKER_FILES_FILE`, `MERGE_BROKER_FILES_FILE_FORMAT=json`, and shell-safe `{filesFile}`.
73
+ Inline input remains the compatibility default but fails closed when either legacy representation
74
+ exceeds 4 KiB; `filesInput: "json"` explicitly selects file-only transport for large path sets.
75
+ - Gate requires Git 2.46 or newer, binds protected-base refresh to the canonical fetch URL (separate
76
+ from any publication `pushurl`), rejects and scrubs Git repository/index/object/history and
77
+ configuration-injection or transport-command overrides, refuses configured URL/transport
78
+ rewrites, proxy/TLS/routing overrides, and exact-locator remote shorthand collisions, physically
79
+ binds local transport paths, rejects URL forms whose Git and web interpretations differ,
80
+ recursively inspects the owned object store, recomputes commit/tree/blob identities,
81
+ applies documented aggregate diff/tree/path ceilings, materializes raw filter-free blob bytes,
82
+ binds state/worktree/cache/hook directories to physical filesystem identities, journals retained-ref
83
+ establishment and later loss, bounds untracked-path diagnostics, and serializes authority
84
+ replacement against adoption and recovery.
85
+
86
+ ### Fixed
87
+
88
+ - Kept exact-target checks compatible with Git for Windows' standard unscoped Schannel TLS backend,
89
+ and made lock release retry transient Windows sharing violations without weakening nonce fencing.
90
+
3
91
  ## 0.12.1 — 2026-09-04
4
92
 
5
93
  ### Added
package/CONTRIBUTING.md CHANGED
@@ -14,19 +14,33 @@ npm install
14
14
  npm run verify
15
15
  node dist/cli.js --help
16
16
  npm run example
17
+ npm run example:gate
18
+ npm run test:package
17
19
  ```
18
20
 
19
- Tests use temporary real Git repositories rather than mocks for transaction behavior. Add a regression fixture for changes to leases, receipts, cherry-picking, validation, batching, or lifecycle transitions.
21
+ The source checkout requires Node.js 22+ and Git 2.46+ for the Gate example. Tests use temporary real
22
+ Git repositories for transaction behavior, portable GitHub CLI fixtures, and subprocess
23
+ termination/restart checks for recovery. Add a regression fixture for changes to leases, receipts,
24
+ cherry-picking, validation, batching, or lifecycle transitions.
20
25
 
21
26
  ## Pull requests
22
27
 
23
28
  - Keep changes focused and explain any state or protocol compatibility impact.
24
29
  - Update JSON schemas and documentation with persisted-format changes.
25
30
  - Avoid agent-specific behavior in the core; expose it through an adapter boundary.
26
- - Preserve the invariant that no branch is retained after failed validation.
31
+ - Preserve the invariant that failed Coordinate validation cannot retain a publication branch.
32
+ Gate deliberately retains rejected artifacts for evidence and operator-controlled retirement.
27
33
  - Include tests for both the successful transaction and its recovery path.
28
34
 
29
- Run `npm run verify` before submitting. CI also runs `npm pack --dry-run` to verify the distributable package.
35
+ Run `npm run verify` before submitting. CI repeats verification and both examples on Linux, macOS,
36
+ and Windows with Node.js 22, 24, and 26, then installs and exercises the actual npm tarball. Releases
37
+ publish the tested tarball only after the complete matrix succeeds.
38
+
39
+ For schema changes, run `npm run build` and
40
+ `node scripts/update-schema-snapshots.mjs --write`. The generator adds new fingerprint snapshots and
41
+ updates the alias manifest; it refuses to overwrite changed immutable content. Commit new snapshots
42
+ alongside the root alias change, and retain existing snapshots for consumers. `--check` is read-only
43
+ and runs in CI. See [Protocol](docs/PROTOCOL.md) for identity and compatibility semantics.
30
44
 
31
45
  See [SUPPORT.md](SUPPORT.md) for usage questions and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for the
32
46
  project's participation expectations.