release-skill 0.6.2 → 0.7.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 (112) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codebuddy-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +2 -2
  5. package/.kimi-plugin/plugin.json +1 -1
  6. package/CHANGELOG.md +48 -0
  7. package/CONTRIBUTING.md +1 -1
  8. package/INSTALL.md +47 -2
  9. package/INSTALL.zh-CN.md +29 -2
  10. package/README.md +137 -12
  11. package/README.zh-CN.md +110 -9
  12. package/adapters/claude/.claude-plugin/marketplace.json +1 -1
  13. package/adapters/claude/.claude-plugin/plugin.json +1 -1
  14. package/adapters/claude/bin/error-codes.json +1 -1
  15. package/adapters/claude/bin/kernel-protocol.json +1 -1
  16. package/adapters/claude/bin/license-texts/Apache-2.0.txt +201 -0
  17. package/adapters/claude/bin/license-texts/MIT.txt +21 -0
  18. package/adapters/claude/bin/registry.json +64 -1
  19. package/adapters/claude/bin/release-skill.bundle.mjs +50570 -42208
  20. package/adapters/claude/bin/rules.json +1 -1
  21. package/adapters/claude/schemas/.render-manifest.json +10 -6
  22. package/adapters/claude/schemas/postpublish-approval-record.schema.json +47 -0
  23. package/adapters/claude/schemas/release-plan.schema.json +200 -4
  24. package/adapters/claude/schemas/release-project.schema.json +86 -5
  25. package/adapters/claude/schemas/release-run.schema.json +11 -6
  26. package/adapters/codex/.codex-plugin/plugin.json +2 -2
  27. package/adapters/codex/bin/error-codes.json +1 -1
  28. package/adapters/codex/bin/kernel-protocol.json +1 -1
  29. package/adapters/codex/bin/license-texts/Apache-2.0.txt +201 -0
  30. package/adapters/codex/bin/license-texts/MIT.txt +21 -0
  31. package/adapters/codex/bin/registry.json +64 -1
  32. package/adapters/codex/bin/release-skill.bundle.mjs +50570 -42208
  33. package/adapters/codex/bin/rules.json +1 -1
  34. package/adapters/codex/schemas/.render-manifest.json +10 -6
  35. package/adapters/codex/schemas/postpublish-approval-record.schema.json +47 -0
  36. package/adapters/codex/schemas/release-plan.schema.json +200 -4
  37. package/adapters/codex/schemas/release-project.schema.json +86 -5
  38. package/adapters/codex/schemas/release-run.schema.json +11 -6
  39. package/adapters/kimi/.kimi-plugin/plugin.json +1 -1
  40. package/adapters/kimi/bin/error-codes.json +1 -1
  41. package/adapters/kimi/bin/kernel-protocol.json +1 -1
  42. package/adapters/kimi/bin/license-texts/Apache-2.0.txt +201 -0
  43. package/adapters/kimi/bin/license-texts/MIT.txt +21 -0
  44. package/adapters/kimi/bin/registry.json +64 -1
  45. package/adapters/kimi/bin/release-skill.bundle.mjs +50570 -42208
  46. package/adapters/kimi/bin/rules.json +1 -1
  47. package/adapters/kimi/schemas/.render-manifest.json +10 -6
  48. package/adapters/kimi/schemas/postpublish-approval-record.schema.json +47 -0
  49. package/adapters/kimi/schemas/release-plan.schema.json +200 -4
  50. package/adapters/kimi/schemas/release-project.schema.json +86 -5
  51. package/adapters/kimi/schemas/release-run.schema.json +11 -6
  52. package/adapters/workbuddy/.codebuddy-plugin/plugin.json +1 -1
  53. package/adapters/workbuddy/bin/error-codes.json +1 -1
  54. package/adapters/workbuddy/bin/kernel-protocol.json +1 -1
  55. package/adapters/workbuddy/bin/license-texts/Apache-2.0.txt +201 -0
  56. package/adapters/workbuddy/bin/license-texts/MIT.txt +21 -0
  57. package/adapters/workbuddy/bin/registry.json +64 -1
  58. package/adapters/workbuddy/bin/release-skill.bundle.mjs +50570 -42208
  59. package/adapters/workbuddy/bin/rules.json +1 -1
  60. package/adapters/workbuddy/schemas/.render-manifest.json +10 -6
  61. package/adapters/workbuddy/schemas/postpublish-approval-record.schema.json +47 -0
  62. package/adapters/workbuddy/schemas/release-plan.schema.json +200 -4
  63. package/adapters/workbuddy/schemas/release-project.schema.json +86 -5
  64. package/adapters/workbuddy/schemas/release-run.schema.json +11 -6
  65. package/bin/error-codes.json +1 -1
  66. package/bin/kernel-protocol.json +1 -1
  67. package/bin/license-texts/Apache-2.0.txt +201 -0
  68. package/bin/license-texts/MIT.txt +21 -0
  69. package/bin/registry.json +64 -1
  70. package/bin/release-skill-cli.mjs +187 -9
  71. package/bin/release-skill.bundle.mjs +50570 -42208
  72. package/bin/rules.json +1 -1
  73. package/package.json +6 -4
  74. package/platform-manifest.json +4 -4
  75. package/references/.render-manifest.json +5 -5
  76. package/references/01-state-machine.md +22 -2
  77. package/references/02-project-config.md +1 -1
  78. package/references/06-adapter-contract.md +6 -3
  79. package/schemas/.render-manifest.json +10 -6
  80. package/schemas/postpublish-approval-record.schema.json +47 -0
  81. package/schemas/release-plan.schema.json +200 -4
  82. package/schemas/release-project.schema.json +86 -5
  83. package/schemas/release-run.schema.json +11 -6
  84. package/src/adapters/distribute-git.mjs +17 -11
  85. package/src/commands/approve.mjs +163 -1
  86. package/src/commands/distribute.mjs +649 -89
  87. package/src/commands/postverify.mjs +808 -0
  88. package/src/commands/prepare.mjs +456 -45
  89. package/src/commands/setup.mjs +715 -0
  90. package/src/commands/ship.mjs +152 -5
  91. package/src/commands/verify.mjs +92 -15
  92. package/src/core/approval.mjs +93 -68
  93. package/src/core/bounded-output.mjs +46 -0
  94. package/src/core/derived-artifact-gates.mjs +258 -0
  95. package/src/core/docs-refresh-preset.mjs +171 -0
  96. package/src/core/errors.mjs +4 -0
  97. package/src/core/evidence.mjs +8 -1
  98. package/src/core/git-url-policy.mjs +214 -0
  99. package/src/core/hooks.mjs +28 -0
  100. package/src/core/marketplace-registry-entry.mjs +175 -0
  101. package/src/core/notify-handoff.mjs +76 -0
  102. package/src/core/postpublish-approval.mjs +241 -0
  103. package/src/core/postpublish-bundle.mjs +342 -0
  104. package/src/core/postpublish-projection.mjs +210 -0
  105. package/src/core/postpublish.mjs +449 -25
  106. package/src/core/preset-executor.mjs +175 -0
  107. package/src/core/preset-gitwrite.mjs +484 -0
  108. package/src/core/presets.mjs +754 -0
  109. package/src/core/proposal-inbox.mjs +646 -0
  110. package/src/core/redact.mjs +16 -3
  111. package/src/core/run.mjs +91 -6
  112. package/src/producers/build-adapters.mjs +28 -14
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) {{YEAR}} {{COPYRIGHT_HOLDER}}
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/bin/registry.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "kind": "skill-family.contracts.registry",
4
- "contractsVersion": "1.5.0",
4
+ "contractsVersion": "1.7.0",
5
5
  "note": "Protocol-name and schema-$id registry. Registration mechanically rejects duplicate protocol name/version (SFC1004) and duplicate $id (SFC1003). This file is the single registration surface; adding an entry is a contracts change.",
6
6
  "protocols": [
7
7
  {
@@ -27,6 +27,13 @@
27
27
  "status": "stable",
28
28
  "file": "src/schemas/profile-descriptor.schema.json"
29
29
  },
30
+ {
31
+ "$id": "https://contracts.skill-family.example/v1/project-profile.json",
32
+ "object": "project-profile",
33
+ "dialect": "2020-12",
34
+ "status": "stable",
35
+ "file": "src/schemas/project-profile.schema.json"
36
+ },
30
37
  {
31
38
  "$id": "https://contracts.skill-family.example/v1/managed-file-lock.json",
32
39
  "object": "managed-file-lock",
@@ -166,6 +173,62 @@
166
173
  "dialect": "2020-12",
167
174
  "status": "stable",
168
175
  "file": "src/schemas/structured-scan-policy.schema.json"
176
+ },
177
+ {
178
+ "$id": "https://contracts.skill-family.example/v1/timeout-policy.json",
179
+ "object": "timeout-policy",
180
+ "dialect": "2020-12",
181
+ "status": "stable",
182
+ "file": "src/schemas/timeout-policy.schema.json"
183
+ },
184
+ {
185
+ "$id": "https://contracts.skill-family.example/v1/watchdog-termination-envelope.json",
186
+ "object": "watchdog-termination-envelope",
187
+ "dialect": "2020-12",
188
+ "status": "stable",
189
+ "file": "src/schemas/watchdog-termination-envelope.schema.json"
190
+ },
191
+ {
192
+ "$id": "https://contracts.skill-family.example/v1/public-boundary-declaration.json",
193
+ "object": "public-boundary-declaration",
194
+ "dialect": "2020-12",
195
+ "status": "stable",
196
+ "file": "src/schemas/public-boundary-declaration.schema.json"
197
+ },
198
+ {
199
+ "$id": "https://contracts.skill-family.example/v1/platform-difference-registry.json",
200
+ "object": "platform-difference-registry",
201
+ "dialect": "2020-12",
202
+ "status": "stable",
203
+ "file": "src/schemas/platform-difference-registry.schema.json"
204
+ },
205
+ {
206
+ "$id": "https://contracts.skill-family.example/v1/observation-scope.json",
207
+ "object": "observation-scope",
208
+ "dialect": "2020-12",
209
+ "status": "stable",
210
+ "file": "src/schemas/observation-scope.schema.json"
211
+ },
212
+ {
213
+ "$id": "https://contracts.skill-family.example/v1/profile-adoption-declaration.json",
214
+ "object": "profile-adoption-declaration",
215
+ "dialect": "2020-12",
216
+ "status": "stable",
217
+ "file": "src/schemas/profile-adoption-declaration.schema.json"
218
+ },
219
+ {
220
+ "$id": "https://contracts.skill-family.example/v1/audit-baseline-pin.json",
221
+ "object": "audit-baseline-pin",
222
+ "dialect": "2020-12",
223
+ "status": "stable",
224
+ "file": "src/schemas/audit-baseline-pin.schema.json"
225
+ },
226
+ {
227
+ "$id": "https://contracts.skill-family.example/v1/token-estimate-record.json",
228
+ "object": "token-estimate-record",
229
+ "dialect": "2020-12",
230
+ "status": "stable",
231
+ "file": "src/schemas/token-estimate-record.schema.json"
169
232
  }
170
233
  ],
171
234
  "dialects": {
@@ -237,7 +237,8 @@ Commands:
237
237
  publish Publish frozen GitHub/npm artifacts after approval
238
238
  reconcile Resume PARTIAL state from evidence; conflicts require a human
239
239
  verify Fresh remote and consumer verification; only this reaches VERIFIED
240
- ship Resume one durable prepare -> approve -> publish -> verify flow
240
+ ship Resume one durable prepare -> approve -> publish -> verify flow; completes a parked
241
+ postVerify hook once its checkpoint approval is provided (--hook-approval)
241
242
  attest Legacy only: record a Kimi/CodeBuddy result for an old frozen plan
242
243
  hooks Run declared development hooks and populate reusable receipts
243
244
  artifacts Artifact status, inspect, update/apply, resolution, and diagnostics
@@ -249,7 +250,8 @@ Commands:
249
250
  Options:
250
251
  --root <path> Project root directory (default: cwd)
251
252
  --plan <path> Path to the release plan file
252
- --run <path> Path to the release run file (required for reconcile/verify)
253
+ --run <path> Path to the release run file, or a run directory whose release-run.json
254
+ is resolved automatically (required for reconcile/verify)
253
255
  --approval <path> Path to the approval record
254
256
  --production Prepare immutable Git/npm production artifacts
255
257
  --output <path> Override prepare/approve output path (non-production only)
@@ -264,6 +266,12 @@ Options:
264
266
  --answers <path> Human-reviewed setup answers JSON
265
267
  --write Create an absent project.yaml during setup; never overwrites
266
268
  --confirm-setup <digest> Confirm exact setup facts and answers before create
269
+ --discover-downstream Read-only discovery of downstream candidates (git remotes, marketplace/docs
270
+ clues, artifact-graph.config.yaml, foundation profile). Never writes
271
+ --propose-hooks Produce postPublish hook declaration drafts; with --write and exact --confirm-setup,
272
+ performs an append-only hooks edit of an existing config (create-once is untouched)
273
+ --select-hooks <ids> Comma-separated proposal ids to adopt (propose-hooks mode)
274
+ --foundation-profile <path> Explicit foundation postPublish profile JSON (proposal input only; never auto-applied)
267
275
  --unit <id> Release unit whose declared release documents are refreshed (docs refresh)
268
276
  --confirm-refresh <sha256:...> Confirm the exact dry-run refreshDigest before any document write
269
277
  --ack-local-document-write Acknowledge the explicit local release-document write (docs refresh --write)
@@ -274,6 +282,7 @@ Options:
274
282
  --install-path <path> Actual managed plugin path when closure verification requires it
275
283
  --install-channel <desktop|cli> CodeBuddy installation channel when required
276
284
  --approve Approve the ship plan (boolean; plan digest is auto-resolved)
285
+ --hook-approval <path> Checkpoint approval for a requiresApproval postPublish hook (ship/distribute; repeatable)
277
286
  --state <path> Override the durable ship state file
278
287
  --no-hook-cache Force every prepare hook to run in full; neither read nor write the hook cache
279
288
  --json Output results as JSON
@@ -467,6 +476,59 @@ if (command === 'setup') {
467
476
  ? args[confirmationIdx + 1]
468
477
  : undefined;
469
478
  const write = args.includes('--write');
479
+
480
+ // R5 — downstream discovery + postPublish hook proposal (guided config) and
481
+ // the independent incremental-proposal mode for existing projects. These
482
+ // modes are read-only until --write + exact --confirm-setup, and the write is
483
+ // an append-only hooks edit; they never touch the create-once setup path.
484
+ const discoverDownstreamMode = args.includes('--discover-downstream');
485
+ const proposeHooksMode = args.includes('--propose-hooks');
486
+ if (discoverDownstreamMode || proposeHooksMode) {
487
+ const flagValue = (flag) => {
488
+ const idx = args.indexOf(flag);
489
+ return idx !== -1 && args[idx + 1] ? args[idx + 1] : undefined;
490
+ };
491
+ const foundationProfilePath = flagValue('--foundation-profile');
492
+ const unitId = flagValue('--unit');
493
+ const selectRaw = flagValue('--select-hooks');
494
+ const selectedHookIds = selectRaw
495
+ ? selectRaw.split(',').map((item) => item.trim()).filter(Boolean)
496
+ : undefined;
497
+ try {
498
+ const setupModule = await import('../src/commands/setup.mjs');
499
+ const report = discoverDownstreamMode
500
+ ? await setupModule.discoverDownstream({ root, foundationProfilePath })
501
+ : await setupModule.proposePostPublishHooks({
502
+ root, write, confirmSetup, selectedHookIds, foundationProfilePath, unitId,
503
+ });
504
+ if (hasJson) {
505
+ console.log(JSON.stringify(report, null, 2));
506
+ } else {
507
+ console.log(`Status: ${report.status ?? report.mode}`);
508
+ if (report.setupDigest) console.log(`Setup digest: ${report.setupDigest}`);
509
+ if (report.hookProposals) {
510
+ console.log(`Hook proposals: ${report.hookProposals.map((p) => p.id).join(', ') || '(none)'}`);
511
+ }
512
+ if (report.configPath) console.log(`Config: ${report.configPath}`);
513
+ if (report.next) console.log(`Next: ${report.next}`);
514
+ }
515
+ const okStatuses = ['HOOKS_PROPOSAL_READY', 'HOOKS_APPENDED', 'HOOKS_NO_CHANGE', 'postpublish-discovery'];
516
+ process.exit(okStatuses.includes(report.status ?? report.mode) ? 0 : 2);
517
+ } catch (err) {
518
+ if (hasJson) {
519
+ console.log(JSON.stringify({
520
+ error: err.code ?? 'UNKNOWN_ERROR',
521
+ message: err.message,
522
+ details: err.details ?? {},
523
+ exitCode: err.exitCode ?? 1,
524
+ }));
525
+ } else {
526
+ console.error(`Error: ${err.message}`);
527
+ }
528
+ process.exit(err.exitCode ?? 1);
529
+ }
530
+ }
531
+
470
532
  try {
471
533
  const { setupProject } = await import('../src/commands/setup.mjs');
472
534
  const report = await setupProject({ root, answersPath, write, confirmSetup });
@@ -575,6 +637,16 @@ if (command === 'ship') {
575
637
  return idx !== -1 && args[idx + 1] ? args[idx + 1] : undefined;
576
638
  };
577
639
  const root = resolve(value('--root') ?? process.cwd());
640
+ // Repeatable --hook-approval <path>: checkpoint approvals for
641
+ // requiresApproval postPublish hooks (same convention as distribute;
642
+ // review major-1 — without this the ship flow can never complete a
643
+ // parked AWAITING_APPROVAL postVerify hook).
644
+ const postpublishApprovalPaths = [];
645
+ for (let i = 0; i < args.length; i += 1) {
646
+ if (args[i] === '--hook-approval' && args[i + 1]) {
647
+ postpublishApprovalPaths.push(resolve(args[i + 1]));
648
+ }
649
+ }
578
650
  try {
579
651
  const [
580
652
  { advanceShip },
@@ -582,6 +654,7 @@ if (command === 'ship') {
582
654
  { createNpmAdapter },
583
655
  { createPluginMarketplaceAdapter },
584
656
  { createPushSnapshotAdapter },
657
+ { createDistributeGitAdapter },
585
658
  { createAdapterRegistry },
586
659
  ] = await Promise.all([
587
660
  import('../src/commands/ship.mjs'),
@@ -589,13 +662,17 @@ if (command === 'ship') {
589
662
  import('../src/adapters/npm.mjs'),
590
663
  import('../src/adapters/plugin-marketplace.mjs'),
591
664
  import('../src/adapters/push-snapshot.mjs'),
665
+ import('../src/adapters/distribute-git.mjs'),
592
666
  import('../src/adapters/contract.mjs'),
593
667
  ]);
668
+ // v0.6.3 R1: ship auto-routes into the distribute saga; the registry must
669
+ // carry the distribute-git adapter or that production path fails closed.
594
670
  const adapterRegistry = createAdapterRegistry([
595
671
  createGitGithubAdapter(),
596
672
  createNpmAdapter(),
597
673
  createPluginMarketplaceAdapter(),
598
674
  createPushSnapshotAdapter(),
675
+ createDistributeGitAdapter(),
599
676
  ]);
600
677
  const result = await advanceShip({
601
678
  root,
@@ -605,15 +682,27 @@ if (command === 'ship') {
605
682
  planApprovalDigest: value('--approve-plan'),
606
683
  actor: value('--actor'),
607
684
  adapterRegistry,
685
+ ...(postpublishApprovalPaths.length > 0 ? { postpublishApprovalPaths } : {}),
608
686
  });
609
687
  if (hasJson) {
610
688
  console.log(JSON.stringify(result, null, 2));
611
689
  } else {
612
690
  console.log(`Ship status: ${result.status}`);
613
691
  console.log(`State: ${result.statePath}`);
692
+ for (const warning of result.warnings ?? []) {
693
+ console.log(`Warning [${warning.code}] ${warning.message}`);
694
+ }
614
695
  if (result.planDigest && result.status === 'NEEDS_PLAN_APPROVAL') {
615
696
  console.log(`Approve plan: ship --approve --actor <person>`);
616
697
  }
698
+ if (result.postVerify) {
699
+ console.log(`PostVerify: ${result.postVerify.status}${result.postVerify.runPath ? ` (run: ${result.postVerify.runPath})` : ''}`);
700
+ if (['NEEDS_INPUT', 'PARTIAL', 'BLOCKED', 'FAILED'].includes(result.postVerify.status)) {
701
+ console.log('PostVerify incomplete: re-run release-skill ship to retry non-gated hooks (no approval needed for them).');
702
+ console.log('For requiresApproval hooks, mint a checkpoint approval (release-skill approve --plan <plan> --hook <hookId> --actor <person>)');
703
+ console.log('then re-run: release-skill ship --root <root> --hook-approval <approval-record>');
704
+ }
705
+ }
617
706
  for (const followUp of result.manualFollowUps ?? []) {
618
707
  console.log(`Manual follow-up [${followUp.platform}] ${followUp.plugin}: not verified by system`);
619
708
  }
@@ -757,6 +846,7 @@ if (command === 'prepare') {
757
846
  unitId: action.unitId,
758
847
  })),
759
848
  warnings: result.warnings,
849
+ nextSteps: result.nextSteps ?? [],
760
850
  }, null, 2));
761
851
  } else {
762
852
  for (const warning of result.warnings) {
@@ -765,6 +855,9 @@ if (command === 'prepare') {
765
855
  console.log(`Plan frozen at: ${result.planPath}`);
766
856
  console.log(`Plan digest: ${result.planDigest}`);
767
857
  console.log(`Evidence: ${result.evidenceDir}`);
858
+ for (const step of result.nextSteps ?? []) {
859
+ console.log(`Next [${step.code}] ${step.message}`);
860
+ }
768
861
  if (plan.workflowKind && plan.workflowKind !== 'full') {
769
862
  console.log(`Workflow: ${plan.workflowKind}`);
770
863
  }
@@ -804,6 +897,10 @@ if (command === 'approve') {
804
897
  const actor = actorIdx !== -1 && args[actorIdx + 1] ? args[actorIdx + 1] : undefined;
805
898
  const outputIdx = args.indexOf('--output');
806
899
  const outputPath = outputIdx !== -1 && args[outputIdx + 1] ? resolve(args[outputIdx + 1]) : undefined;
900
+ const hookIdx = args.indexOf('--hook');
901
+ const hookId = hookIdx !== -1 && args[hookIdx + 1] ? args[hookIdx + 1] : undefined;
902
+ const runIdIdx = args.indexOf('--run-id');
903
+ const runId = runIdIdx !== -1 && args[runIdIdx + 1] ? args[runIdIdx + 1] : undefined;
807
904
 
808
905
  if (!planPath || !actor) {
809
906
  const msg = 'approve requires --plan <path> and --actor <name>';
@@ -815,6 +912,44 @@ if (command === 'approve') {
815
912
  process.exit(1);
816
913
  }
817
914
 
915
+ // --- Checkpoint-level postPublish hook approval (v0.6.3 R1, review N-6) ---
916
+ if (hookId) {
917
+ try {
918
+ const { approvePostPublishHook } = await import('../src/commands/approve.mjs');
919
+ const record = await approvePostPublishHook({
920
+ planPath: resolve(planPath),
921
+ hookId,
922
+ actor,
923
+ ...(runId ? { runId } : {}),
924
+ });
925
+ if (hasJson) {
926
+ console.log(JSON.stringify(record, null, 2));
927
+ } else {
928
+ console.log(`Checkpoint approval for postPublish hook "${record.hookId}" by ${record.actor}`);
929
+ console.log(`Approval record: ${record.approvalPath}`);
930
+ console.log(`Approved at: ${record.approvedAt}`);
931
+ console.log(`Expires at: ${record.expiresAt}`);
932
+ console.log('Approved hook (normalized entry summary):');
933
+ const summary = record.hookSummary ?? {};
934
+ for (const [key, value] of Object.entries(summary)) {
935
+ console.log(` ${key}: ${typeof value === 'object' ? JSON.stringify(value) : value}`);
936
+ }
937
+ }
938
+ process.exit(0);
939
+ } catch (err) {
940
+ if (hasJson) {
941
+ console.log(JSON.stringify({
942
+ error: err.code ?? 'UNKNOWN_ERROR',
943
+ message: err.message,
944
+ exitCode: err.exitCode ?? 1,
945
+ }));
946
+ } else {
947
+ console.error(`Error: ${err.message}`);
948
+ }
949
+ process.exit(err.exitCode ?? 1);
950
+ }
951
+ }
952
+
818
953
  try {
819
954
  const { approvePlan } = await import('../src/commands/approve.mjs');
820
955
  const { computePlanDigest } = await import('../src/core/plan.mjs');
@@ -1259,19 +1394,55 @@ if (command === 'distribute') {
1259
1394
  const approvalPath = value('--approval');
1260
1395
  const runPath = value('--run');
1261
1396
  const dryRun = args.includes('--dry-run');
1397
+ // Repeatable --hook-approval <path>: checkpoint approvals for
1398
+ // requiresApproval postPublish hooks (v0.6.3 R1).
1399
+ const postpublishApprovalPaths = [];
1400
+ for (let i = 0; i < args.length; i += 1) {
1401
+ if (args[i] === '--hook-approval' && args[i + 1]) {
1402
+ postpublishApprovalPaths.push(resolve(args[i + 1]));
1403
+ }
1404
+ }
1262
1405
 
1406
+ // R2: enumerate the postPublish preset registry (ships with the bundle).
1407
+ // Read-only; needs no --plan/--run, so it short-circuits parameter checks.
1408
+ if (args.includes('--list-presets')) {
1409
+ const { listPostPublishPresets } = await import('../src/core/presets.mjs');
1410
+ const presets = listPostPublishPresets();
1411
+ if (hasJson) {
1412
+ console.log(JSON.stringify({ command: 'distribute', presets }, null, 2));
1413
+ } else {
1414
+ console.log('postPublish presets:');
1415
+ for (const preset of presets) {
1416
+ const status = preset.implemented ? 'implemented' : 'reserved (behavior lands in a later release)';
1417
+ console.log(` ${preset.name}`);
1418
+ console.log(` description: ${preset.description}`);
1419
+ console.log(` requiresApproval default: ${preset.defaultRequiresApproval}`);
1420
+ if (preset.requiresApprovalNote) {
1421
+ console.log(` requiresApproval note: ${preset.requiresApprovalNote}`);
1422
+ }
1423
+ if (preset.targetsFormOnly) {
1424
+ console.log(' declaration form: targets-form only (declare under postPublish.targets, not postPublish.hooks)');
1425
+ }
1426
+ console.log(` write-downstream: ${preset.writeDownstream}; target optional: ${preset.targetOptional}; status: ${status}`);
1427
+ }
1428
+ }
1429
+ process.exit(0);
1430
+ }
1431
+
1263
1432
  // Handle --help explicitly
1264
1433
  if (args.includes('--help')) {
1265
1434
  const helpText = `Distribute command: Distributes frozen artifacts to post-publish targets
1266
1435
 
1267
- Usage: release-skill distribute --plan <path> --run <path> [options]
1436
+ Usage: release-skill distribute --plan <path> --run <path> --approval <path> [options]
1268
1437
 
1269
1438
  Options:
1270
1439
  --root Project root directory (default: cwd)
1271
1440
  --plan Path to the release plan file (required)
1272
1441
  --run Path to the release run file (required)
1273
- --approval Path to the approval record (optional but recommended)
1442
+ --approval Path to the approval record (required)
1443
+ --hook-approval <path> Checkpoint approval for a requiresApproval postPublish hook (repeatable)
1274
1444
  --dry-run Preview distribution steps without executing (default: false)
1445
+ --list-presets Enumerate the postPublish preset registry (no plan/run needed)
1275
1446
 
1276
1447
  Description:
1277
1448
  After PUBLISHED state, distributes to configured postPublish targets:
@@ -1282,15 +1453,17 @@ Description:
1282
1453
  console.log(JSON.stringify({
1283
1454
  command: 'distribute',
1284
1455
  description: 'Distributes frozen artifacts to post-publish targets (git mirror + marketplace) after PUBLISHED',
1285
- usage: 'release-skill distribute --plan <path> --run <path> [options]',
1456
+ usage: 'release-skill distribute --plan <path> --run <path> --approval <path> [options]',
1286
1457
  options: {
1287
1458
  '--root': 'Project root directory (default: cwd)',
1288
1459
  '--plan': 'Path to the release plan file (required)',
1289
1460
  '--run': 'Path to the release run file (required)',
1290
- '--approval': 'Path to the approval record (optional but recommended)',
1461
+ '--approval': 'Path to the approval record (required)',
1462
+ '--hook-approval': 'Checkpoint approval for a requiresApproval postPublish hook (repeatable)',
1291
1463
  '--dry-run': 'Preview distribution steps without executing (default: false)',
1464
+ '--list-presets': 'Enumerate the postPublish preset registry (no plan/run needed)',
1292
1465
  },
1293
- description: 'After PUBLISHED state, distributes to configured postPublish targets: git mirrors + marketplace index updates. Requires plan.postPublish config. Reconciles PARTIAL runs.',
1466
+ details: 'After PUBLISHED state, distributes to configured postPublish targets: git mirrors + marketplace index updates. Requires plan.postPublish config. Reconciles PARTIAL runs.',
1294
1467
  }, null, 2));
1295
1468
  } else {
1296
1469
  console.log(helpText);
@@ -1298,8 +1471,8 @@ Description:
1298
1471
  process.exit(0);
1299
1472
  }
1300
1473
 
1301
- if (!planPath || !runPath) {
1302
- const msg = 'distribute requires --plan <path> and --run <path>';
1474
+ if (!planPath || !runPath || !approvalPath) {
1475
+ const msg = 'distribute requires --plan <path>, --run <path>, and --approval <path>';
1303
1476
  if (hasJson) {
1304
1477
  console.log(JSON.stringify({ error: 'MISSING_PARAMETERS', message: msg, exitCode: 1 }));
1305
1478
  } else {
@@ -1314,13 +1487,17 @@ Description:
1314
1487
  const { createNpmAdapter } = await import('../src/adapters/npm.mjs');
1315
1488
  const { createPluginMarketplaceAdapter } = await import('../src/adapters/plugin-marketplace.mjs');
1316
1489
  const { createPushSnapshotAdapter } = await import('../src/adapters/push-snapshot.mjs');
1490
+ const { createDistributeGitAdapter } = await import('../src/adapters/distribute-git.mjs');
1317
1491
  const { createAdapterRegistry } = await import('../src/adapters/contract.mjs');
1318
1492
 
1493
+ // v0.6.3 R1: the distribute saga executes through the distribute-git
1494
+ // adapter; without this registration the production path fails closed.
1319
1495
  const registry = createAdapterRegistry([
1320
1496
  createGitGithubAdapter(),
1321
1497
  createNpmAdapter(),
1322
1498
  createPluginMarketplaceAdapter(),
1323
1499
  createPushSnapshotAdapter(),
1500
+ createDistributeGitAdapter(),
1324
1501
  ]);
1325
1502
 
1326
1503
  const result = await distributeRelease({
@@ -1330,6 +1507,7 @@ Description:
1330
1507
  root,
1331
1508
  dryRun,
1332
1509
  planPath,
1510
+ ...(postpublishApprovalPaths.length > 0 ? { postpublishApprovalPaths } : {}),
1333
1511
  });
1334
1512
 
1335
1513
  if (hasJson) {