release-skill 0.1.4 → 0.1.6

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 (71) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +2 -2
  4. package/CHANGELOG.md +104 -0
  5. package/INSTALL.md +81 -1
  6. package/INSTALL.zh-CN.md +69 -1
  7. package/README.md +233 -8
  8. package/README.zh-CN.md +188 -8
  9. package/adapters/claude/.claude-plugin/marketplace.json +1 -1
  10. package/adapters/claude/.claude-plugin/plugin.json +1 -1
  11. package/adapters/claude/bin/release-skill.bundle.mjs +14164 -9912
  12. package/adapters/claude/bin/release-skill.mjs +24 -4
  13. package/adapters/claude/native/safe-write/binding.gyp +2 -1
  14. package/adapters/claude/native/safe-write/prebuilds/darwin-arm64/safe_write.node +0 -0
  15. package/adapters/claude/native/safe-write/prebuilds.json +1 -1
  16. package/adapters/claude/schemas/.render-manifest.json +10 -10
  17. package/adapters/claude/schemas/release-project.schema.json +141 -0
  18. package/adapters/claude/skills/release-help/SKILL.md +21 -0
  19. package/adapters/claude/skills/release-prepare/SKILL.md +17 -6
  20. package/adapters/claude/skills/release-publish/SKILL.md +3 -1
  21. package/adapters/claude/skills/release-reconcile/SKILL.md +1 -1
  22. package/adapters/codex/.codex-plugin/plugin.json +2 -2
  23. package/adapters/codex/bin/release-skill.bundle.mjs +14164 -9912
  24. package/adapters/codex/bin/release-skill.mjs +24 -4
  25. package/adapters/codex/native/safe-write/binding.gyp +2 -1
  26. package/adapters/codex/native/safe-write/prebuilds/darwin-arm64/safe_write.node +0 -0
  27. package/adapters/codex/native/safe-write/prebuilds.json +1 -1
  28. package/adapters/codex/schemas/.render-manifest.json +10 -10
  29. package/adapters/codex/schemas/release-project.schema.json +141 -0
  30. package/adapters/codex/skills/release-help/SKILL.md +21 -0
  31. package/adapters/codex/skills/release-prepare/SKILL.md +17 -6
  32. package/adapters/codex/skills/release-publish/SKILL.md +3 -1
  33. package/adapters/codex/skills/release-reconcile/SKILL.md +1 -1
  34. package/bin/release-skill-cli.mjs +163 -4
  35. package/bin/release-skill.bundle.mjs +14164 -9912
  36. package/bin/release-skill.mjs +24 -4
  37. package/native/safe-write/binding.gyp +2 -1
  38. package/native/safe-write/prebuilds/darwin-arm64/safe_write.node +0 -0
  39. package/native/safe-write/prebuilds.json +1 -1
  40. package/package.json +2 -2
  41. package/references/.render-manifest.json +4 -4
  42. package/references/02-project-config.md +24 -0
  43. package/references/05-evidence-and-errors.md +5 -0
  44. package/schemas/.render-manifest.json +10 -10
  45. package/schemas/release-project.schema.json +141 -0
  46. package/scripts/build-bundle.mjs +15 -2
  47. package/skills/release-help/SKILL.md +21 -0
  48. package/skills/release-prepare/SKILL.md +17 -6
  49. package/skills/release-publish/SKILL.md +3 -1
  50. package/skills/release-reconcile/SKILL.md +1 -1
  51. package/skills-src/release-help/SKILL.md +21 -0
  52. package/skills-src/release-prepare/SKILL.md +17 -6
  53. package/skills-src/release-publish/SKILL.md +3 -1
  54. package/skills-src/release-reconcile/SKILL.md +1 -1
  55. package/src/adapters/plugin-marketplace.mjs +70 -3
  56. package/src/artifacts/transaction-journal.mjs +1126 -105
  57. package/src/artifacts/transaction.mjs +313 -130
  58. package/src/commands/docs.mjs +332 -0
  59. package/src/commands/prepare.mjs +324 -17
  60. package/src/commands/reconcile.mjs +4 -1
  61. package/src/commands/verify.mjs +4 -1
  62. package/src/core/errors.mjs +64 -2
  63. package/src/core/plan.mjs +59 -1
  64. package/src/core/redact.mjs +206 -0
  65. package/src/docs/changelog-renderer.mjs +853 -0
  66. package/src/docs/config.mjs +337 -0
  67. package/src/docs/notes-loader.mjs +432 -0
  68. package/src/docs/notes.mjs +553 -0
  69. package/src/docs/readme-renderer.mjs +647 -0
  70. package/src/docs/refresh-planner.mjs +542 -0
  71. package/src/docs/refresh-service.mjs +675 -0
@@ -17,7 +17,9 @@ description: 从已批准且摘要确认的生产计划发布冻结 Git branch/t
17
17
  不得把沙箱通过描述成真实发布成功。
18
18
 
19
19
  只发布 `prepare --production` 封存的 Git object 和 npm tarball,不从活动工作区重新
20
- 打包,不生成或覆盖 README。远端 branch/tag/Release/npm version 已存在、查询不确定、
20
+ 打包,不生成或覆盖 README,也永不隐式刷新工作树中的发布文档;
21
+ 遇到 `RELEASE_DOCS_STALE` 或文档陈旧只能回到 `docs refresh` → 人工审阅 → 提交 →
22
+ 重新 prepare。远端 branch/tag/Release/npm version 已存在、查询不确定、
21
23
  认证失败或摘要漂移时,在全局预检阶段停止并交给人工。禁止覆盖、删除和自动回滚;
22
24
  新建 ref 的 create-only CAS(`--force-with-lease=<ref>:`)只断言目标不存在,不授权覆盖。
23
25
 
@@ -19,7 +19,7 @@ marketplace 隔离消费者 checkpoint,但只恢复到 `PUBLISHED`;最终 np
19
19
 
20
20
  ## 职责与边界
21
21
 
22
- 查询远端实际状态,对照冻结计划识别一致/不一致检查点。已成功的步骤幂等跳过,只重试安全且未完成的步骤。远端冲突时停止并要求人工决策。不删除远端资源。`--run` 必需;重试需 `--approval`。
22
+ 查询远端实际状态,对照冻结计划识别一致/不一致检查点。已成功的步骤幂等跳过,只重试安全且未完成的步骤。远端冲突时停止并要求人工决策。不删除远端资源。`--run` 必需;重试需 `--approval`。reconcile 永不隐式刷新工作树中的发布文档;陈旧文档只能回到 `docs refresh` → 人工审阅 → 提交 → 重新 prepare。
23
23
 
24
24
  **阶段通过规则**: 本阶段的通过只能由 CLI exit code 0 和结构化状态码 `PUBLISHED` 确认。随后必须以 reconcile 返回的新 `runPath` 执行 verify;只有 verify 的 `VERIFIED` 才是完整终态。
25
25
 
@@ -185,6 +185,42 @@ function validateMarketplaceParams(params) {
185
185
  }
186
186
 
187
187
 
188
+ /**
189
+ * Resolve and validate the frozen timeoutMs from the expanded adapter action.
190
+ *
191
+ * The publish/reconcile/verify call path expands plan actions as
192
+ * `{ actionType, ...action.parameters }`, so `parameters.timeoutMs` in the
193
+ * plan becomes `action.timeoutMs` at the adapter level. This function reads
194
+ * from the top-level action, not from a nested `parameters` sub-object.
195
+ *
196
+ * Rules:
197
+ * - Missing field (undefined): returns 300000 default (legacy compatibility).
198
+ * - Present but null/invalid (null, string, NaN, Infinity, non-integer,
199
+ * out of range): fail-closed, throws.
200
+ * - Valid integer in [30000, 900000]: returns the value as-is.
201
+ *
202
+ * @param {object} action - The expanded adapter action (top-level).
203
+ * @returns {number} Validated timeout in milliseconds.
204
+ * @throws {Error} If the value is present but invalid.
205
+ */
206
+ function resolveTimeoutMs(action) {
207
+ const raw = action?.timeoutMs;
208
+ if (raw === undefined) {
209
+ return 300000;
210
+ }
211
+ if (raw === null || typeof raw !== 'number' || !Number.isFinite(raw) || !Number.isInteger(raw)) {
212
+ throw new Error(
213
+ `action.timeoutMs must be a finite integer, got: ${JSON.stringify(raw)}`,
214
+ );
215
+ }
216
+ if (raw < 30000 || raw > 900000) {
217
+ throw new Error(
218
+ `action.timeoutMs must be between 30000 and 900000, got: ${raw}`,
219
+ );
220
+ }
221
+ return raw;
222
+ }
223
+
188
224
  /**
189
225
  * Run a CLI command using execFile (never shell: true).
190
226
  */
@@ -792,6 +828,23 @@ export function createPluginMarketplaceAdapter(deps = {}) {
792
828
  };
793
829
  // Ensure real HOME/CODEX_HOME don't leak back (already overridden above)
794
830
 
831
+ // Resolve frozen timeoutMs from the expanded action (top-level,
832
+ // not action.parameters -- the publish/reconcile/verify call path
833
+ // expands plan action as { actionType, ...action.parameters }).
834
+ // Default to 300000 for old plans that lack the field.
835
+ // Fail closed on invalid values (null, non-integer, non-finite,
836
+ // out of range).
837
+ let frozenTimeoutMs;
838
+ try {
839
+ frozenTimeoutMs = resolveTimeoutMs(action);
840
+ } catch (timeoutErr) {
841
+ return createResult({
842
+ actionType,
843
+ status: ActionStatus.EXECUTE_FAILED,
844
+ error: timeoutErr.message,
845
+ });
846
+ }
847
+
795
848
  // Step 1: Add marketplace
796
849
  const ref = action.ref ?? `v${action.version}`;
797
850
  let addOutput;
@@ -799,7 +852,7 @@ export function createPluginMarketplaceAdapter(deps = {}) {
799
852
  ? ['plugin', 'marketplace', 'add', `${action.repo}@${ref}`]
800
853
  : ['plugin', 'marketplace', 'add', action.repo, '--ref', ref, '--json'];
801
854
  try {
802
- const addResult = await exec(cliCmd, marketplaceArgs, { env, cwd: context.root });
855
+ const addResult = await exec(cliCmd, marketplaceArgs, { env, cwd: context.root, timeout: frozenTimeoutMs });
803
856
  if (consumer === 'codex') {
804
857
  try {
805
858
  addOutput = JSON.parse(addResult.stdout);
@@ -839,7 +892,7 @@ export function createPluginMarketplaceAdapter(deps = {}) {
839
892
  ? ['plugin', 'install', `${action.plugin}@${action.marketplace}`]
840
893
  : ['plugin', 'add', `${action.plugin}@${action.marketplace}`, '--json'];
841
894
  try {
842
- const installResult = await exec(cliCmd, installArgs, { env, cwd: context.root });
895
+ const installResult = await exec(cliCmd, installArgs, { env, cwd: context.root, timeout: frozenTimeoutMs });
843
896
  if (consumer === 'codex') {
844
897
  try {
845
898
  installOutput = JSON.parse(installResult.stdout);
@@ -1053,6 +1106,20 @@ export function createPluginMarketplaceAdapter(deps = {}) {
1053
1106
  : { HOME: isolatedHome, CODEX_HOME: isolatedHome }),
1054
1107
  };
1055
1108
 
1109
+ // Resolve frozen timeoutMs from the expanded action (top-level).
1110
+ // Default to 300000 for old plans. Fail closed on invalid values.
1111
+ let frozenTimeoutMs;
1112
+ try {
1113
+ frozenTimeoutMs = resolveTimeoutMs(action);
1114
+ } catch (timeoutErr) {
1115
+ return createResult({
1116
+ actionType,
1117
+ status: ActionStatus.OBSERVED,
1118
+ observation: { installed: false, error: timeoutErr.message },
1119
+ error: timeoutErr.message,
1120
+ });
1121
+ }
1122
+
1056
1123
  // Read execute evidence — mandatory for observe validation
1057
1124
  let evidence = null;
1058
1125
  try {
@@ -1095,7 +1162,7 @@ export function createPluginMarketplaceAdapter(deps = {}) {
1095
1162
 
1096
1163
  let listOutput;
1097
1164
  try {
1098
- const result = await exec(cliCmd, listArgs, { env, cwd: context.root });
1165
+ const result = await exec(cliCmd, listArgs, { env, cwd: context.root, timeout: frozenTimeoutMs });
1099
1166
  listOutput = JSON.parse(result.stdout);
1100
1167
  } catch (listErr) {
1101
1168
  return createResult({