safeword 0.82.4 → 0.82.5

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/codex-plugin/.codex-plugin/plugin.json +1 -1
  2. package/codex-plugin/package.json +1 -1
  3. package/codex-plugin/runtime/cli.js +86 -16
  4. package/codex-plugin/skills/audit/SKILL.md +5 -5
  5. package/codex-plugin/skills/bdd/references/PLAN_IMPLEMENTATION.md +2 -2
  6. package/codex-plugin/skills/bdd/references/TDD.md +1 -1
  7. package/codex-plugin/skills/explain/SKILL.md +1 -1
  8. package/codex-plugin/skills/quality-review/SKILL.md +2 -2
  9. package/codex-plugin/skills/retro-filer/SKILL.md +2 -2
  10. package/codex-plugin/skills/review-spec/SKILL.md +2 -2
  11. package/codex-plugin/skills/self-review/SKILL.md +1 -1
  12. package/dist/{architecture-V6XNVK7J.js → architecture-IQQKQBML.js} +2 -2
  13. package/dist/{architecture-document-AMBH2C22.js → architecture-document-FG5EGABT.js} +2 -2
  14. package/dist/{architecture-monorepo-S3GETI3W.js → architecture-monorepo-QFGGDRJQ.js} +2 -2
  15. package/dist/{boundary-PRWLTQXI.js → boundary-3QXNYN2S.js} +2 -2
  16. package/dist/{chunk-TVNJO2EN.js → chunk-7PKXJO6S.js} +2 -2
  17. package/dist/{chunk-TVNJO2EN.js.map → chunk-7PKXJO6S.js.map} +1 -1
  18. package/dist/{chunk-LTSHW45K.js → chunk-CGYJJM2Y.js} +2 -2
  19. package/dist/{chunk-BSBKSP54.js → chunk-JIUDHG7G.js} +2 -2
  20. package/dist/{chunk-DKC24YSC.js → chunk-SMJMHOZA.js} +30 -5
  21. package/dist/chunk-SMJMHOZA.js.map +1 -0
  22. package/dist/{chunk-HK6ANRI2.js → chunk-VUDY6JBS.js} +51 -8
  23. package/dist/chunk-VUDY6JBS.js.map +1 -0
  24. package/dist/{chunk-F56GGOF4.js → chunk-WXAJFT4H.js} +14 -14
  25. package/dist/{chunk-4Z4XW6QY.js → chunk-XIG6POSC.js} +22 -7
  26. package/dist/chunk-XIG6POSC.js.map +1 -0
  27. package/dist/{cleanup-POCMRGOY.js → cleanup-Q2MDAXSN.js} +2 -2
  28. package/dist/{cleanup-command-NMBIWBCL.js → cleanup-command-JU5PTFWN.js} +2 -2
  29. package/dist/cli.js +73 -73
  30. package/dist/{clients-ZORENKZW.js → clients-OBLTCQGX.js} +2 -2
  31. package/dist/{codex-bootstrap-DY5ZKDDU.js → codex-bootstrap-WCVUVIX7.js} +5 -5
  32. package/dist/{codex-hook-D7Z5PI56.js → codex-hook-2C43X4RY.js} +4 -4
  33. package/dist/{codify-4EWI7RO7.js → codify-KGEHAQVB.js} +2 -2
  34. package/dist/{commands-OPDQW2VC.js → commands-UZ3Q3PXQ.js} +6 -6
  35. package/dist/{config-C3K6XKRU.js → config-OCQMSJXA.js} +2 -2
  36. package/dist/{configured-paths-6457NJZB.js → configured-paths-KYPI7EFT.js} +2 -2
  37. package/dist/{conformance-ARUIWFT5.js → conformance-BGIYFMXR.js} +2 -2
  38. package/dist/{contract-H2EDHGLH.js → contract-ILNHPR26.js} +2 -2
  39. package/dist/{coordinator-QQ6IUSMG.js → coordinator-CHYV2I7E.js} +2 -2
  40. package/dist/{corpus-MIZ4IKXY.js → corpus-G7WSUN4M.js} +2 -2
  41. package/dist/{cursor-R7HOMVFI.js → cursor-52K7ZN5K.js} +2 -2
  42. package/dist/{doctor-TWS4CZ4V.js → doctor-HVFA6RQV.js} +4 -4
  43. package/dist/{drain-retro-spool-SVVDHTQB.js → drain-retro-spool-AH7EBZPW.js} +2 -2
  44. package/dist/{feature-directories-PFYOAAOF.js → feature-directories-6IXUOPFV.js} +2 -2
  45. package/dist/{finalization-WFNZABKW.js → finalization-XZBHHMPZ.js} +2 -2
  46. package/dist/{gh-cli-GIZYMWII.js → gh-cli-C262ZTDO.js} +2 -2
  47. package/dist/{github-rest-77H352TI.js → github-rest-BYJT7V3S.js} +2 -2
  48. package/dist/index.js +1 -1
  49. package/dist/{job-VX2ZAJ5Z.js → job-YT7FWYKH.js} +2 -2
  50. package/dist/{learning-sync-SN64DJ4Q.js → learning-sync-K3KTFDEF.js} +2 -2
  51. package/dist/{legacy-global-guidance-FJBCL3L7.js → legacy-global-guidance-WCRFEWXM.js} +2 -2
  52. package/dist/{lint-gherkin-HZHP5WBG.js → lint-gherkin-VKDB5ALD.js} +2 -2
  53. package/dist/{namespace-root-PJ65I3DJ.js → namespace-root-RGHUF3UH.js} +2 -2
  54. package/dist/opencode/dispatcher.js +4 -3
  55. package/dist/{operations-EQXJ7BYM.js → operations-WUNYQOSY.js} +5 -5
  56. package/dist/{output-7Y6VDX5R.js → output-MVSMTFB5.js} +2 -2
  57. package/dist/{packet-K34ZB2TK.js → packet-ZZEKTQON.js} +2 -2
  58. package/dist/presets/typescript/index.js +1 -1
  59. package/dist/{profile-FWGIVRAM.js → profile-CILA5BW5.js} +2 -2
  60. package/dist/{profile-VKMIMY52.js → profile-FCZAUQYM.js} +2 -2
  61. package/dist/{prompt-EA5VOXUE.js → prompt-C2E43BKY.js} +2 -2
  62. package/dist/{public-retros-IC2KNXUC.js → public-retros-KS4XGJX2.js} +2 -2
  63. package/dist/{remove-LO6BIE3H.js → remove-LHXDIUR5.js} +2 -2
  64. package/dist/{retro-OMGVS6KF.js → retro-K7OSR37K.js} +8 -8
  65. package/dist/{retro-draft-spool-VPLRX5YF.js → retro-draft-spool-I65XMNCE.js} +2 -2
  66. package/dist/{retro-drain-MARKKH5Q.js → retro-drain-BHDRZZZJ.js} +3 -3
  67. package/dist/{retro-extract-SAJIQKKB.js → retro-extract-CENSZDL7.js} +2 -2
  68. package/dist/{review-knowledge-NSFPJXAA.js → review-knowledge-IGRODU2Y.js} +2 -2
  69. package/dist/{review-pr-ACTDSS7E.js → review-pr-OVHPSCMO.js} +2 -2
  70. package/dist/{review-pr-publication-5WNYDBMK.js → review-pr-publication-FWFSR3G6.js} +2 -2
  71. package/dist/{run-KRCAVD7D.js → run-TINV4HHU.js} +2 -2
  72. package/dist/{schema-2KLQRVP7.js → schema-CETAGYQS.js} +2 -2
  73. package/dist/{self-report-47Y2JICD.js → self-report-QTSEVZE6.js} +2 -2
  74. package/dist/{status-2JYTWRI4.js → status-64RHQ4K6.js} +2 -2
  75. package/dist/{status-YOPKHEW5.js → status-6VE5FMMT.js} +4 -4
  76. package/dist/{sync-config-GIHPD6UC.js → sync-config-STCUJ242.js} +2 -2
  77. package/dist/{sync-tracker-CVV4HE77.js → sync-tracker-JNVVSKVH.js} +2 -2
  78. package/dist/{test-execution-327VEM7Y.js → test-execution-2IOF5REY.js} +2 -2
  79. package/dist/{test-plan-DE5NQMVD.js → test-plan-OUXD3MNK.js} +2 -2
  80. package/dist/{ticket-new-PMTEOLA4.js → ticket-new-2BLVPXWW.js} +2 -2
  81. package/dist/{ticket-sync-XZ2K4IEV.js → ticket-sync-KARIVGBD.js} +2 -2
  82. package/dist/{tracker-map-CZ5EM64B.js → tracker-map-Q46M7HKV.js} +2 -2
  83. package/dist/{tracker-sync-MU3KNTV2.js → tracker-sync-AHVN4MW3.js} +2 -2
  84. package/package.json +1 -1
  85. package/dist/chunk-4Z4XW6QY.js.map +0 -1
  86. package/dist/chunk-DKC24YSC.js.map +0 -1
  87. package/dist/chunk-HK6ANRI2.js.map +0 -1
  88. /package/dist/{architecture-V6XNVK7J.js.map → architecture-IQQKQBML.js.map} +0 -0
  89. /package/dist/{architecture-document-AMBH2C22.js.map → architecture-document-FG5EGABT.js.map} +0 -0
  90. /package/dist/{architecture-monorepo-S3GETI3W.js.map → architecture-monorepo-QFGGDRJQ.js.map} +0 -0
  91. /package/dist/{boundary-PRWLTQXI.js.map → boundary-3QXNYN2S.js.map} +0 -0
  92. /package/dist/{chunk-LTSHW45K.js.map → chunk-CGYJJM2Y.js.map} +0 -0
  93. /package/dist/{chunk-BSBKSP54.js.map → chunk-JIUDHG7G.js.map} +0 -0
  94. /package/dist/{chunk-F56GGOF4.js.map → chunk-WXAJFT4H.js.map} +0 -0
  95. /package/dist/{cleanup-POCMRGOY.js.map → cleanup-Q2MDAXSN.js.map} +0 -0
  96. /package/dist/{cleanup-command-NMBIWBCL.js.map → cleanup-command-JU5PTFWN.js.map} +0 -0
  97. /package/dist/{clients-ZORENKZW.js.map → clients-OBLTCQGX.js.map} +0 -0
  98. /package/dist/{codex-bootstrap-DY5ZKDDU.js.map → codex-bootstrap-WCVUVIX7.js.map} +0 -0
  99. /package/dist/{codex-hook-D7Z5PI56.js.map → codex-hook-2C43X4RY.js.map} +0 -0
  100. /package/dist/{codify-4EWI7RO7.js.map → codify-KGEHAQVB.js.map} +0 -0
  101. /package/dist/{commands-OPDQW2VC.js.map → commands-UZ3Q3PXQ.js.map} +0 -0
  102. /package/dist/{config-C3K6XKRU.js.map → config-OCQMSJXA.js.map} +0 -0
  103. /package/dist/{configured-paths-6457NJZB.js.map → configured-paths-KYPI7EFT.js.map} +0 -0
  104. /package/dist/{conformance-ARUIWFT5.js.map → conformance-BGIYFMXR.js.map} +0 -0
  105. /package/dist/{contract-H2EDHGLH.js.map → contract-ILNHPR26.js.map} +0 -0
  106. /package/dist/{coordinator-QQ6IUSMG.js.map → coordinator-CHYV2I7E.js.map} +0 -0
  107. /package/dist/{corpus-MIZ4IKXY.js.map → corpus-G7WSUN4M.js.map} +0 -0
  108. /package/dist/{cursor-R7HOMVFI.js.map → cursor-52K7ZN5K.js.map} +0 -0
  109. /package/dist/{doctor-TWS4CZ4V.js.map → doctor-HVFA6RQV.js.map} +0 -0
  110. /package/dist/{drain-retro-spool-SVVDHTQB.js.map → drain-retro-spool-AH7EBZPW.js.map} +0 -0
  111. /package/dist/{feature-directories-PFYOAAOF.js.map → feature-directories-6IXUOPFV.js.map} +0 -0
  112. /package/dist/{finalization-WFNZABKW.js.map → finalization-XZBHHMPZ.js.map} +0 -0
  113. /package/dist/{gh-cli-GIZYMWII.js.map → gh-cli-C262ZTDO.js.map} +0 -0
  114. /package/dist/{github-rest-77H352TI.js.map → github-rest-BYJT7V3S.js.map} +0 -0
  115. /package/dist/{job-VX2ZAJ5Z.js.map → job-YT7FWYKH.js.map} +0 -0
  116. /package/dist/{learning-sync-SN64DJ4Q.js.map → learning-sync-K3KTFDEF.js.map} +0 -0
  117. /package/dist/{legacy-global-guidance-FJBCL3L7.js.map → legacy-global-guidance-WCRFEWXM.js.map} +0 -0
  118. /package/dist/{lint-gherkin-HZHP5WBG.js.map → lint-gherkin-VKDB5ALD.js.map} +0 -0
  119. /package/dist/{namespace-root-PJ65I3DJ.js.map → namespace-root-RGHUF3UH.js.map} +0 -0
  120. /package/dist/{operations-EQXJ7BYM.js.map → operations-WUNYQOSY.js.map} +0 -0
  121. /package/dist/{output-7Y6VDX5R.js.map → output-MVSMTFB5.js.map} +0 -0
  122. /package/dist/{packet-K34ZB2TK.js.map → packet-ZZEKTQON.js.map} +0 -0
  123. /package/dist/{profile-FWGIVRAM.js.map → profile-CILA5BW5.js.map} +0 -0
  124. /package/dist/{profile-VKMIMY52.js.map → profile-FCZAUQYM.js.map} +0 -0
  125. /package/dist/{prompt-EA5VOXUE.js.map → prompt-C2E43BKY.js.map} +0 -0
  126. /package/dist/{public-retros-IC2KNXUC.js.map → public-retros-KS4XGJX2.js.map} +0 -0
  127. /package/dist/{remove-LO6BIE3H.js.map → remove-LHXDIUR5.js.map} +0 -0
  128. /package/dist/{retro-OMGVS6KF.js.map → retro-K7OSR37K.js.map} +0 -0
  129. /package/dist/{retro-draft-spool-VPLRX5YF.js.map → retro-draft-spool-I65XMNCE.js.map} +0 -0
  130. /package/dist/{retro-drain-MARKKH5Q.js.map → retro-drain-BHDRZZZJ.js.map} +0 -0
  131. /package/dist/{retro-extract-SAJIQKKB.js.map → retro-extract-CENSZDL7.js.map} +0 -0
  132. /package/dist/{review-knowledge-NSFPJXAA.js.map → review-knowledge-IGRODU2Y.js.map} +0 -0
  133. /package/dist/{review-pr-ACTDSS7E.js.map → review-pr-OVHPSCMO.js.map} +0 -0
  134. /package/dist/{review-pr-publication-5WNYDBMK.js.map → review-pr-publication-FWFSR3G6.js.map} +0 -0
  135. /package/dist/{run-KRCAVD7D.js.map → run-TINV4HHU.js.map} +0 -0
  136. /package/dist/{schema-2KLQRVP7.js.map → schema-CETAGYQS.js.map} +0 -0
  137. /package/dist/{self-report-47Y2JICD.js.map → self-report-QTSEVZE6.js.map} +0 -0
  138. /package/dist/{status-2JYTWRI4.js.map → status-64RHQ4K6.js.map} +0 -0
  139. /package/dist/{status-YOPKHEW5.js.map → status-6VE5FMMT.js.map} +0 -0
  140. /package/dist/{sync-config-GIHPD6UC.js.map → sync-config-STCUJ242.js.map} +0 -0
  141. /package/dist/{sync-tracker-CVV4HE77.js.map → sync-tracker-JNVVSKVH.js.map} +0 -0
  142. /package/dist/{test-execution-327VEM7Y.js.map → test-execution-2IOF5REY.js.map} +0 -0
  143. /package/dist/{test-plan-DE5NQMVD.js.map → test-plan-OUXD3MNK.js.map} +0 -0
  144. /package/dist/{ticket-new-PMTEOLA4.js.map → ticket-new-2BLVPXWW.js.map} +0 -0
  145. /package/dist/{ticket-sync-XZ2K4IEV.js.map → ticket-sync-KARIVGBD.js.map} +0 -0
  146. /package/dist/{tracker-map-CZ5EM64B.js.map → tracker-map-Q46M7HKV.js.map} +0 -0
  147. /package/dist/{tracker-sync-MU3KNTV2.js.map → tracker-sync-AHVN4MW3.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "safeword",
3
- "version": "0.82.4",
3
+ "version": "0.82.5",
4
4
  "description": "Safeword workflow guidance and gates for Codex.",
5
5
  "author": {
6
6
  "name": "Arcade AI"
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "safeword-codex-plugin",
3
- "version": "0.82.4",
3
+ "version": "0.82.5",
4
4
  "type": "module"
5
5
  }
@@ -14114,7 +14114,7 @@ function deriveCodexMigrationResult(facts) {
14114
14114
  const hasLegacy = facts.legacyAssets.length > 0 || facts.legacyEvents.length > 0;
14115
14115
  const protectedStatus = legacyProtection(facts, hasLegacy);
14116
14116
  const state = migrationState(facts, hasLegacy);
14117
- const next = nextAction(state);
14117
+ const next = nextAction(state, facts);
14118
14118
  return {
14119
14119
  schema_version: "2",
14120
14120
  ok: state === "plugin",
@@ -14143,7 +14143,23 @@ function legacyProtection(facts, hasLegacy) {
14143
14143
  return "unprotected";
14144
14144
  return facts.viableLegacyEvents.length === facts.legacyEvents.length ? "protected" : "partial";
14145
14145
  }
14146
- function nextAction(state) {
14146
+ function nextAction(state, facts) {
14147
+ if (state === "plugin_installed_hook_activation_failed") {
14148
+ return {
14149
+ kind: "human",
14150
+ instruction: CODEX_HOOK_ACTIVATION_FAILED_ACTION,
14151
+ mutates: false,
14152
+ requires_human: true
14153
+ };
14154
+ }
14155
+ if (state === "plugin_enabled_hook_unproven" && facts.activationRestartProven && facts.proof.status === "partial") {
14156
+ return {
14157
+ kind: "human",
14158
+ instruction: CODEX_PARTIAL_ACTIVATION_ACTION,
14159
+ mutates: false,
14160
+ requires_human: true
14161
+ };
14162
+ }
14147
14163
  if (state === "plugin_installed_app_restart_required" || state === "plugin_enabled_hook_unproven") {
14148
14164
  return {
14149
14165
  kind: "human",
@@ -14157,11 +14173,9 @@ function nextAction(state) {
14157
14173
  }
14158
14174
  function renderCodexMigrationHuman(result) {
14159
14175
  const lines = [`Codex migration: ${result.state}`, `Protection: ${result.protected}`];
14160
- if (result.state === "plugin_setup_required") {
14161
- lines.push(`Setup: ${CODEX_MIGRATION_SCHEMA.paths.bootstrapSkill}`);
14162
- } else if (result.state === "plugin_installed_app_restart_required" || result.state === "plugin_enabled_hook_unproven") {
14163
- lines.push(CODEX_RESTART_CONTEXT);
14164
- }
14176
+ const context = codexMigrationContext(result);
14177
+ if (context !== undefined)
14178
+ lines.push(context);
14165
14179
  const next = result.next_actions[0];
14166
14180
  if (next !== undefined) {
14167
14181
  lines.push(`Next: ${"command" in next ? next.command : next.instruction}`);
@@ -14170,12 +14184,19 @@ function renderCodexMigrationHuman(result) {
14170
14184
  `)}
14171
14185
  `;
14172
14186
  }
14187
+ function codexMigrationContext(result) {
14188
+ const next = result.next_actions[0];
14189
+ if (result.state === "plugin_enabled_hook_unproven" && next !== undefined && "instruction" in next && next.instruction === CODEX_PARTIAL_ACTIVATION_ACTION) {
14190
+ return CODEX_PARTIAL_ACTIVATION_CONTEXT;
14191
+ }
14192
+ return CODEX_MIGRATION_CONTEXT[result.state];
14193
+ }
14173
14194
  function codexMigrationExitCode(result) {
14174
14195
  if (result.errors.length > 0)
14175
14196
  return 1;
14176
14197
  return result.ok ? 0 : 2;
14177
14198
  }
14178
- var CODEX_RESTART_ACTION = "Fully restart Codex, then resume this task", CODEX_REVIEW_THEN_RESTART_ACTION = "Review the installed hooks in Codex Desktop under Settings > Hooks (or with /hooks in the terminal TUI). Fully restart Codex, then resume this task", CODEX_RESTART_INSTRUCTION, CODEX_RESTART_CONTEXT = "This Codex app may keep its loaded Safeword catalogue.", MIGRATION_STATE_RULES, NEXT_COMMANDS;
14199
+ var CODEX_RESTART_ACTION = "Fully restart Codex, then resume this task", CODEX_REVIEW_THEN_RESTART_ACTION = "Review the installed hooks in Codex Desktop under Settings > Hooks (or with /hooks in the terminal TUI). Fully restart Codex, then resume this task", CODEX_RESTART_INSTRUCTION, CODEX_RESTART_CONTEXT = "This Codex app may keep its loaded Safeword catalogue.", CODEX_HOOK_ACTIVATION_FAILED_CONTEXT = "Codex restarted, but Safeword received no current lifecycle hook proof.", CODEX_HOOK_ACTIVATION_FAILED_ACTION = "Review the installed hooks in Codex Desktop under Settings > Hooks (or with /hooks in the terminal TUI). If they are enabled and trusted, use a Codex surface that dispatches lifecycle hooks before relying on Safeword protection.", CODEX_PARTIAL_ACTIVATION_CONTEXT = "Codex restarted and Safeword has partial current lifecycle hook proof.", CODEX_PARTIAL_ACTIVATION_ACTION = "Continue in this Codex session. Safeword will confirm protection after the remaining lifecycle hooks run.", MIGRATION_STATE_RULES, NEXT_COMMANDS, CODEX_MIGRATION_CONTEXT;
14179
14200
  var init_migration = __esm(() => {
14180
14201
  init_schema();
14181
14202
  init_inventory();
@@ -14194,6 +14215,10 @@ var init_migration = __esm(() => {
14194
14215
  state: "plugin_update_required",
14195
14216
  matches: (facts) => facts.plugin.enabled === true && !codexPluginVersionMatchesPackage(facts.plugin)
14196
14217
  },
14218
+ {
14219
+ state: "plugin_installed_hook_activation_failed",
14220
+ matches: (facts) => facts.plugin.enabled === true && !pluginProtectionIsCurrent(facts) && facts.activationPending && facts.activationRestartObserved
14221
+ },
14197
14222
  {
14198
14223
  state: "plugin_installed_app_restart_required",
14199
14224
  matches: (facts) => facts.activationPending && facts.plugin.enabled === true
@@ -14217,6 +14242,7 @@ var init_migration = __esm(() => {
14217
14242
  compatibility: "safeword codex migrate --finalize",
14218
14243
  plugin: undefined,
14219
14244
  plugin_installed_app_restart_required: undefined,
14245
+ plugin_installed_hook_activation_failed: undefined,
14220
14246
  plugin_enabled_hook_unproven: undefined,
14221
14247
  plugin_setup_required: "safeword codex migrate",
14222
14248
  plugin_disabled: "safeword codex migrate",
@@ -14224,6 +14250,19 @@ var init_migration = __esm(() => {
14224
14250
  legacy: "safeword codex migrate",
14225
14251
  not_configured: "safeword codex migrate"
14226
14252
  };
14253
+ CODEX_MIGRATION_CONTEXT = {
14254
+ recovery_required: undefined,
14255
+ plugin_setup_required: `Setup: ${CODEX_MIGRATION_SCHEMA.paths.bootstrapSkill}`,
14256
+ plugin_disabled: undefined,
14257
+ plugin_update_required: undefined,
14258
+ legacy: undefined,
14259
+ plugin_installed_app_restart_required: CODEX_RESTART_CONTEXT,
14260
+ plugin_installed_hook_activation_failed: CODEX_HOOK_ACTIVATION_FAILED_CONTEXT,
14261
+ plugin_enabled_hook_unproven: CODEX_RESTART_CONTEXT,
14262
+ compatibility: undefined,
14263
+ plugin: undefined,
14264
+ not_configured: undefined
14265
+ };
14227
14266
  });
14228
14267
 
14229
14268
  // src/codex-plugin/migration-error.ts
@@ -36201,6 +36240,24 @@ function codexActivationIsPending(environment = process.env) {
36201
36240
  return true;
36202
36241
  }
36203
36242
  }
36243
+ function codexActivationRestartWasObserved(environment = process.env, now = new Date, options = {}) {
36244
+ try {
36245
+ const identity = currentCodexPluginIdentity();
36246
+ const marker = readActivationMarkerV2(environment, identity);
36247
+ if (marker === null)
36248
+ return false;
36249
+ return activationReceiptForRestart(marker, options.hostObservation ?? observeCodexHostProcesses(), identity, now) !== null;
36250
+ } catch {
36251
+ return false;
36252
+ }
36253
+ }
36254
+ function codexActivationRestartIsProven(environment = process.env) {
36255
+ try {
36256
+ return readActivationReceipt(environment, currentCodexPluginIdentity()) !== null;
36257
+ } catch {
36258
+ return false;
36259
+ }
36260
+ }
36204
36261
  function activationIsPendingForIdentity(environment, identity) {
36205
36262
  return existsSync31(codexActivationMarkerPath(environment)) || [legacyCodexActivationMarkerPath(environment), legacyCodexRestartMarkerPath(environment)].some((path4) => legacyActivationMarkerMatches(path4, identity));
36206
36263
  }
@@ -36262,7 +36319,7 @@ function writeCodexActivationMarker(environment = process.env, now = new Date, o
36262
36319
  }
36263
36320
  function activeHostsForMarker(options) {
36264
36321
  if (options.activeHosts !== undefined) {
36265
- return options.activeHosts === null || options.activeHosts.length === 0 ? null : options.activeHosts;
36322
+ return options.activeHosts;
36266
36323
  }
36267
36324
  const observation = options.hostObservation ?? observeCodexHostProcesses();
36268
36325
  if (!observation.available)
@@ -36272,7 +36329,7 @@ function activeHostsForMarker(options) {
36272
36329
  if (currentHost !== null && activeHosts.every((host) => !sameCodexHost(host, currentHost))) {
36273
36330
  activeHosts.push(currentHost);
36274
36331
  }
36275
- return activeHosts.length === 0 ? null : activeHosts;
36332
+ return activeHosts;
36276
36333
  }
36277
36334
  function hostObservationForOverride(current = null) {
36278
36335
  return {
@@ -36283,7 +36340,8 @@ function hostObservationForOverride(current = null) {
36283
36340
  }
36284
36341
  function activationReceiptForRestart(marker, hostObservation, identity, now) {
36285
36342
  const currentHost = hostObservation.current;
36286
- if (!hostObservation.available || currentHost === null || marker.host_observation !== "observed" || marker.active_hosts.length === 0 || now.getTime() < Date.parse(marker.installed_at) || marker.active_hosts.some((installedHost) => sameCodexHost(installedHost, currentHost)) || marker.active_hosts.some((installedHost) => hostObservation.running.some((runningHost) => sameCodexHost(installedHost, runningHost)))) {
36343
+ const installedAt = Date.parse(marker.installed_at);
36344
+ if (!hostObservation.available || currentHost === null || marker.host_observation !== "observed" || now.getTime() < installedAt || Date.parse(currentHost.started_at) < installedAt || marker.active_hosts.some((installedHost) => sameCodexHost(installedHost, currentHost)) || marker.active_hosts.some((installedHost) => hostObservation.running.some((runningHost) => sameCodexHost(installedHost, runningHost)))) {
36287
36345
  return null;
36288
36346
  }
36289
36347
  return {
@@ -36649,7 +36707,7 @@ function isActivationMarkerV2(value) {
36649
36707
  if (typeof value !== "object" || value === null)
36650
36708
  return false;
36651
36709
  const marker = value;
36652
- return marker.schema_version === 2 && pluginVersionIsWellFormed(marker.plugin_version) && typeof marker.manifest_sha256 === "string" && SHA256_PATTERN.test(marker.manifest_sha256) && typeof marker.activation_id === "string" && typeof marker.installed_at === "string" && !Number.isNaN(Date.parse(marker.installed_at)) && (marker.host_observation === "observed" || marker.host_observation === "unavailable") && Array.isArray(marker.active_hosts) && marker.active_hosts.every(isCodexHostProcessIdentity) && (marker.host_observation === "observed" ? marker.active_hosts.length > 0 : marker.active_hosts.length === 0);
36710
+ return marker.schema_version === 2 && pluginVersionIsWellFormed(marker.plugin_version) && typeof marker.manifest_sha256 === "string" && SHA256_PATTERN.test(marker.manifest_sha256) && typeof marker.activation_id === "string" && typeof marker.installed_at === "string" && !Number.isNaN(Date.parse(marker.installed_at)) && (marker.host_observation === "observed" || marker.host_observation === "unavailable") && Array.isArray(marker.active_hosts) && marker.active_hosts.every(isCodexHostProcessIdentity) && (marker.host_observation === "observed" || marker.active_hosts.length === 0);
36653
36711
  }
36654
36712
  function isActivationReceiptV1(value) {
36655
36713
  if (typeof value !== "object" || value === null)
@@ -37035,7 +37093,9 @@ function observeCodexMigrationResult(cwd = process.cwd(), environment = process.
37035
37093
  viableLegacyEvents: observeViableLegacyEvents(cwd, legacyEvents, environment),
37036
37094
  finalized: codexFinalizationIsComplete(cwd),
37037
37095
  recoveryRequired,
37038
- activationPending: codexActivationIsPending(environment)
37096
+ activationPending: codexActivationIsPending(environment),
37097
+ activationRestartObserved: codexActivationRestartWasObserved(environment),
37098
+ activationRestartProven: codexActivationRestartIsProven(environment)
37039
37099
  });
37040
37100
  if (pluginObservationError !== undefined) {
37041
37101
  result.errors.push({
@@ -37053,10 +37113,19 @@ function observeCodexMigrationResult(cwd = process.cwd(), environment = process.
37053
37113
  }
37054
37114
  return result;
37055
37115
  }
37056
- function codexMigrationMessage(state, proof) {
37057
- if (state === "plugin_enabled_hook_unproven" && proof !== undefined) {
37116
+ function codexMigrationMessage(result) {
37117
+ const { proof, state } = result;
37118
+ const next = result.next_actions[0];
37119
+ if (state === "plugin_enabled_hook_unproven" && proof.status === "partial" && next !== undefined && "instruction" in next) {
37120
+ return `Codex restarted and Safeword has partial current lifecycle hook proof. Missing proof: ${proof.missing_events.join(", ")}. ${next.instruction}`;
37121
+ }
37122
+ if (state === "plugin_enabled_hook_unproven") {
37058
37123
  return `Codex migration state: plugin_enabled_hook_unproven. In the restarted Codex app, review /hooks and exercise these missing hooks: ${proof.missing_events.join(", ")}. Then run safeword codex migrate --finalize.`;
37059
37124
  }
37125
+ if (state === "plugin_installed_hook_activation_failed") {
37126
+ const protection = result.protected === "unprotected" ? "Safeword protection is unavailable in this Codex surface." : `Current plugin protection is unavailable; ${result.protected} legacy protection remains configured.`;
37127
+ return `Codex restarted, but Safeword received no current lifecycle hook proof. Missing proof: ${proof.missing_events.join(", ")}. ${protection}`;
37128
+ }
37060
37129
  return CODEX_MIGRATION_MESSAGES[state] ?? `Codex migration state: ${state}.`;
37061
37130
  }
37062
37131
  function legacyCodexMigrationState(state) {
@@ -37076,7 +37145,7 @@ function observeCodexMigration(cwd = process.cwd(), environment = process.env) {
37076
37145
  findings: result.errors.length > 0 ? [] : [
37077
37146
  {
37078
37147
  code: `CODEX_${legacyState.toUpperCase()}`,
37079
- message: codexMigrationMessage(result.state, result.proof),
37148
+ message: codexMigrationMessage(result),
37080
37149
  severity: result.ok ? "info" : "warning",
37081
37150
  metadata: {
37082
37151
  migration_schema_version: result.schema_version,
@@ -37438,6 +37507,7 @@ var init_operations = __esm(() => {
37438
37507
  CODEX_CONFIG_PATH2 = CODEX_MIGRATION_SCHEMA.paths.config;
37439
37508
  CODEX_MIGRATION_MESSAGES = {
37440
37509
  plugin_installed_app_restart_required: CODEX_RESTART_CONTEXT,
37510
+ plugin_installed_hook_activation_failed: CODEX_HOOK_ACTIVATION_FAILED_CONTEXT,
37441
37511
  compatibility: "Codex is protected by the current profile plugin; verified legacy protection remains until explicit finalization.",
37442
37512
  plugin_enabled_hook_unproven: "Codex migration state: plugin_enabled_hook_unproven. Review /hooks in the restarted Codex app; when protection is confirmed, run safeword codex migrate --finalize.",
37443
37513
  recovery_required: "Codex migration state: recovery_required. Recovery is required before migration can continue."
@@ -561,7 +561,7 @@ Changed project learnings in the resolved namespace root's `learnings/*.md` must
561
561
  PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel 2> /dev/null || pwd)}"
562
562
  source "$PROJECT_DIR/.safeword/hooks/lib/audit-scope.sh"
563
563
  audit_scope_initialize "$PROJECT_DIR" || exit $?
564
- NS_ROOT="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR")"
564
+ NS_ROOT="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR")"
565
565
 
566
566
  learning_is_in_audit_scope() {
567
567
  [ "$AUDIT_SCOPE_MODE" = "repository" ] && return 0
@@ -721,13 +721,13 @@ audit_scope_initialize "$PROJECT_DIR" || exit $?
721
721
 
722
722
  # Resolve the namespace root (honors config paths.projectRoot in real runs).
723
723
  # Fall back on directory existence — robust when the resolver hook is absent.
724
- NS_ROOT="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR" 2> /dev/null)"
724
+ NS_ROOT="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR" 2> /dev/null)"
725
725
  [ -d "$NS_ROOT" ] || {
726
726
  if [ -d "$PROJECT_DIR/.project" ]; then NS_ROOT="$PROJECT_DIR/.project"; else NS_ROOT="$PROJECT_DIR/.safeword-project"; fi
727
727
  }
728
- PERSONAS_FILE="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR" --key personas 2> /dev/null)"
729
- SURFACES_FILE="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR" --key surfaces 2> /dev/null)"
730
- GLOSSARY_FILE="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR" --key glossary 2> /dev/null)"
728
+ PERSONAS_FILE="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR" --key personas 2> /dev/null)"
729
+ SURFACES_FILE="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR" --key surfaces 2> /dev/null)"
730
+ GLOSSARY_FILE="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR" --key glossary 2> /dev/null)"
731
731
  [ -n "$PERSONAS_FILE" ] || PERSONAS_FILE="$NS_ROOT/personas.md"
732
732
  [ -n "$SURFACES_FILE" ] || SURFACES_FILE="$NS_ROOT/surfaces.md"
733
733
  [ -n "$GLOSSARY_FILE" ] || GLOSSARY_FILE="$NS_ROOT/glossary.md"
@@ -159,10 +159,10 @@ findings remain. Return findings through the typed reviewer result contract.
159
159
 
160
160
  ## Exit: review, then (optionally) the user
161
161
 
162
- 1. **Independent review first.** At review time, run `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project review-knowledge --json`. Resolve a review-capable Safeword CLI, then invoke the coordinator with the current files identified by the resolver:
162
+ 1. **Independent review first.** At review time, run `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project review-knowledge --json`. Resolve a review-capable Safeword CLI, then invoke the coordinator with the current files identified by the resolver:
163
163
 
164
164
  ```bash
165
- SAFEWORD_REVIEW_PROGRESS=1 bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" review run plan-implementation --agent-handoff --json --context spec.md ticket.md feature-file principles-file personas-file surfaces-file architecture-records -- impl-plan.md
165
+ SAFEWORD_REVIEW_PROGRESS=1 bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" review run plan-implementation --agent-handoff --json --context spec.md ticket.md feature-file principles-file personas-file surfaces-file architecture-records -- impl-plan.md
166
166
  ```
167
167
 
168
168
  The shared coordinator sends that bounded packet to the opposite headless agent when available; its typed verdict, failure classification, and independence level are authoritative. `impl-plan.md` is the work under review; all resolved feature and project artifacts are bounded context. Only when that typed result is `REVIEW_ROUTES_EXHAUSTED`, invoke `$safeword:finish-review` immediately with the original result and the same accepted targets; return every other result unchanged and do not substitute another private subagent. Fix findings, re-resolve the sources, re-review, then stamp the exit with the returned agent provenance (`write-review-stamp.ts --author-agent "author-agent" --reviewer-agent "actual-reviewer" --independence "independence" --phase plan-implementation`, where the review gate is enabled). Add `--model` only when the executed reviewer reports a verifiable model identifier; the coordinator never invents one. Human handoff happens **only after** this review passes — raw planning output is never presented for approval. Exception, any time: information only the user has (intent, priorities, constraints not in code or docs) routes to the user the moment the gap appears — `$safeword:elicit`.
@@ -196,7 +196,7 @@ Off by default. When `.safeword/config.json` sets `architectureReviewGate: true`
196
196
  2. **A fresh-context review.** Resolve a review-capable Safeword CLI, then run the shared coordinator with only the bounded design evidence:
197
197
 
198
198
  ```bash
199
- SAFEWORD_REVIEW_PROGRESS=1 bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" review run plan-implementation impl-plan.md ticket-spec feature-file --agent-handoff --json
199
+ SAFEWORD_REVIEW_PROGRESS=1 bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" review run plan-implementation impl-plan.md ticket-spec feature-file --agent-handoff --json
200
200
  ```
201
201
 
202
202
  The shared coordinator prefers the opposite headless agent. Only when its typed result is `REVIEW_ROUTES_EXHAUSTED`, invoke `$safeword:finish-review` with the original result and the same accepted targets; return every other result unchanged. Degraded findings cannot satisfy a required independent-review gate. On an independent pass, stamp it:
@@ -39,7 +39,7 @@ Gather the durable trail safeword already keeps, then narrate it. Run:
39
39
 
40
40
  ```bash
41
41
  PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel 2> /dev/null || pwd)}"
42
- NS_ROOT="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR")"
42
+ NS_ROOT="$(bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project namespace-root --cwd "$PROJECT_DIR")"
43
43
  # What you're on now: the last re-entry line names the current ticket + Next
44
44
  tail -3 "$NS_ROOT/re-entry.md" 2> /dev/null
45
45
  # Fallback when re-entry is empty: in_progress tickets (not epics)
@@ -50,7 +50,7 @@ If in a BDD workflow, read the current ticket from `<namespace-root>/tickets/` a
50
50
 
51
51
  ### Project-principle challenge
52
52
 
53
- For a BDD ticket, run `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project review-knowledge --json` at the
53
+ For a BDD ticket, run `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project review-knowledge --json` at the
54
54
  start of each pass and read the current `principles`, `personas`, and `surfaces`
55
55
  paths and content it returns (including overrides such as `paths.principles`).
56
56
  Do not substitute labels or intake-era content.
@@ -212,7 +212,7 @@ Each pass:
212
212
  guarantee a bare `safeword` on `PATH`:
213
213
 
214
214
  ```bash
215
- SAFEWORD_REVIEW_PROGRESS=1 bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" review run quality-review [--context path/to/evidence] --agent-handoff --json -- changed-file [more-changed-files...]
215
+ SAFEWORD_REVIEW_PROGRESS=1 bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" review run quality-review [--context path/to/evidence] --agent-handoff --json -- changed-file [more-changed-files...]
216
216
  ```
217
217
 
218
218
  A healthy deep review may return `REVIEW_PENDING` after its foreground
@@ -17,7 +17,7 @@ a caller-nominated path. The spool contains sanitized safeword findings for
17
17
  ## Procedure
18
18
 
19
19
  1. Before reading or making any tracker call, run
20
- `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project retro-drain "<spool-path>" --validated-jsonl`.
20
+ `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project retro-drain "<spool-path>" --validated-jsonl`.
21
21
  Use only its JSONL stdout as the filing input. A nonzero exit means validation
22
22
  failed: make no search, comment, or create call, leave the spool unchanged,
23
23
  and report `retro-filer: cannot file - draft validation failed`. If its output
@@ -60,7 +60,7 @@ a caller-nominated path. The spool contains sanitized safeword findings for
60
60
  the draft only when the append succeeded and the exact ack is visible. If the
61
61
  append or verification fails, leave the draft in place.
62
62
  5. Create at most five new issues per run. Drain only by running
63
- `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project retro-drain "<spool-path>"`; never rewrite or
63
+ `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project retro-drain "<spool-path>"`; never rewrite or
64
64
  delete the spool directly. The helper removes only drafts whose valid ack is
65
65
  reader-visible, so unfiled or unacknowledged drafts remain. If tracker write
66
66
  access is unavailable, leave the spool unchanged and report
@@ -35,7 +35,7 @@ Adversarially review a ticket's scenarios: treat them as if you're trying to bre
35
35
  - **Manual re-run** — invoke `$safeword:review-spec` anytime after `define-behavior` (e.g., scenarios changed during implement and you want to re-validate). Allowed on a closed ticket too — a post-hoc audit is still readable.
36
36
 
37
37
  Read the active ticket's `.feature` source first. At review time, run
38
- `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project review-knowledge --json` and read the current
38
+ `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project review-knowledge --json` and read the current
39
39
  `principles`, `personas`, and `surfaces` source paths and content it returns, so
40
40
  the review is grounded in project knowledge rather than labels or stale intake
41
41
  context. The resolver honors `paths.principles`, `paths.personas`, and
@@ -58,7 +58,7 @@ Resolve a review-capable Safeword CLI first; source checkouts do not guarantee
58
58
  a bare `safeword` on `PATH`:
59
59
 
60
60
  ```bash
61
- SAFEWORD_REVIEW_PROGRESS=1 bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" review run scenario-gate feature-file [legacy-test-definitions] --context ticket-spec [dimensions-file] principles-file personas-file surfaces-file --agent-handoff --json
61
+ SAFEWORD_REVIEW_PROGRESS=1 bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" review run scenario-gate feature-file [legacy-test-definitions] --context ticket-spec [dimensions-file] principles-file personas-file surfaces-file --agent-handoff --json
62
62
  ```
63
63
 
64
64
  The coordinator's assigned/actual reviewer, failure classification, and
@@ -45,7 +45,7 @@ installed helper — report it to the user and resolve before retrying.
45
45
  ## Review the spec (do this now, with the stamp written)
46
46
 
47
47
  The stamp records that a review was invoked; the actual scrutiny is yours. At
48
- review time, run `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.4/runtime/cli.js" project review-knowledge --json` and use its
48
+ review time, run `bun "${CODEX_HOME:-$HOME/.codex}/plugins/cache/safeword/safeword/0.82.5/runtime/cli.js" project review-knowledge --json` and use its
49
49
  current `principles`, `personas`, and `surfaces` source paths and content—not
50
50
  labels remembered from intake. These resolve from `paths.principles`,
51
51
  `paths.personas`, and `paths.surfaces` when configured. Read those sources with the active ticket's
@@ -25,7 +25,7 @@ import {
25
25
  readJson,
26
26
  writeJson
27
27
  } from "./chunk-HF3DXZEA.js";
28
- import "./chunk-TVNJO2EN.js";
28
+ import "./chunk-7PKXJO6S.js";
29
29
 
30
30
  // src/commands/architecture.ts
31
31
  import { execFileSync } from "child_process";
@@ -650,4 +650,4 @@ export {
650
650
  architectureStage,
651
651
  architectureStaged
652
652
  };
653
- //# sourceMappingURL=architecture-V6XNVK7J.js.map
653
+ //# sourceMappingURL=architecture-IQQKQBML.js.map
@@ -11,7 +11,7 @@ import {
11
11
  import "./chunk-NEOV7ZY3.js";
12
12
  import "./chunk-VZ5B2SIO.js";
13
13
  import "./chunk-HF3DXZEA.js";
14
- import "./chunk-TVNJO2EN.js";
14
+ import "./chunk-7PKXJO6S.js";
15
15
  export {
16
16
  isSafewordOwned,
17
17
  isWouldChangeAction,
@@ -22,4 +22,4 @@ export {
22
22
  selfHealProject,
23
23
  selfHealProjectPreservingProse
24
24
  };
25
- //# sourceMappingURL=architecture-document-AMBH2C22.js.map
25
+ //# sourceMappingURL=architecture-document-FG5EGABT.js.map
@@ -5,11 +5,11 @@ import {
5
5
  monorepoFingerprintOf
6
6
  } from "./chunk-VZ5B2SIO.js";
7
7
  import "./chunk-HF3DXZEA.js";
8
- import "./chunk-TVNJO2EN.js";
8
+ import "./chunk-7PKXJO6S.js";
9
9
  export {
10
10
  discoverUnreadableWorkspaces,
11
11
  discoverWorkspaces,
12
12
  extractMonorepoArchitectureSnapshot,
13
13
  monorepoFingerprintOf
14
14
  };
15
- //# sourceMappingURL=architecture-monorepo-S3GETI3W.js.map
15
+ //# sourceMappingURL=architecture-monorepo-QFGGDRJQ.js.map
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  readFileSafe
28
28
  } from "./chunk-HF3DXZEA.js";
29
- import "./chunk-TVNJO2EN.js";
29
+ import "./chunk-7PKXJO6S.js";
30
30
 
31
31
  // src/commands/boundary.ts
32
32
  import { execFileSync as execFileSync2 } from "child_process";
@@ -650,4 +650,4 @@ function boundary(options) {
650
650
  export {
651
651
  boundary
652
652
  };
653
- //# sourceMappingURL=boundary-PRWLTQXI.js.map
653
+ //# sourceMappingURL=boundary-3QXNYN2S.js.map
@@ -1,7 +1,7 @@
1
1
  // <define:__SAFEWORD_RELAY_BUILD_ATTESTATION__>
2
- var define_SAFEWORD_RELAY_BUILD_ATTESTATION_default = { ancestorPairs: [], artifacts: {}, buildCommit: "a304e9ae9330c0c563b508de7a5ed93d8b617c57", enabled: false, manifestBase64: "ewogICJlbmFibGVkIjogZmFsc2UsCiAgInZlcnNpb24iOiAxCn0K", manifestSha256: "946401206ee213e84b672a7f2a400cfa7da911c2f5d6da1c051e63940ed27262" };
2
+ var define_SAFEWORD_RELAY_BUILD_ATTESTATION_default = { ancestorPairs: [], artifacts: {}, buildCommit: "1d1037472a421c19b08f1a789c3f8a5e24bbad3e", enabled: false, manifestBase64: "ewogICJlbmFibGVkIjogZmFsc2UsCiAgInZlcnNpb24iOiAxCn0K", manifestSha256: "946401206ee213e84b672a7f2a400cfa7da911c2f5d6da1c051e63940ed27262" };
3
3
 
4
4
  export {
5
5
  define_SAFEWORD_RELAY_BUILD_ATTESTATION_default
6
6
  };
7
- //# sourceMappingURL=chunk-TVNJO2EN.js.map
7
+ //# sourceMappingURL=chunk-7PKXJO6S.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["<define:__SAFEWORD_RELAY_BUILD_ATTESTATION__>"],"sourcesContent":["{\"ancestorPairs\":[],\"artifacts\":{},\"buildCommit\":\"a304e9ae9330c0c563b508de7a5ed93d8b617c57\",\"enabled\":false,\"manifestBase64\":\"ewogICJlbmFibGVkIjogZmFsc2UsCiAgInZlcnNpb24iOiAxCn0K\",\"manifestSha256\":\"946401206ee213e84b672a7f2a400cfa7da911c2f5d6da1c051e63940ed27262\"}"],"mappings":";AAAA,wDAAC,eAAgB,CAAC,GAAE,WAAY,CAAC,GAAE,aAAc,4CAA2C,SAAU,OAAM,gBAAiB,wDAAuD,gBAAiB,mEAAkE;","names":[]}
1
+ {"version":3,"sources":["<define:__SAFEWORD_RELAY_BUILD_ATTESTATION__>"],"sourcesContent":["{\"ancestorPairs\":[],\"artifacts\":{},\"buildCommit\":\"1d1037472a421c19b08f1a789c3f8a5e24bbad3e\",\"enabled\":false,\"manifestBase64\":\"ewogICJlbmFibGVkIjogZmFsc2UsCiAgInZlcnNpb24iOiAxCn0K\",\"manifestSha256\":\"946401206ee213e84b672a7f2a400cfa7da911c2f5d6da1c051e63940ed27262\"}"],"mappings":";AAAA,wDAAC,eAAgB,CAAC,GAAE,WAAY,CAAC,GAAE,aAAc,4CAA2C,SAAU,OAAM,gBAAiB,wDAAuD,gBAAiB,mEAAkE;","names":[]}
@@ -5,7 +5,7 @@ import {
5
5
  CODEX_PLUGIN_HOOK_EVENTS,
6
6
  legacyCodexEventIsViable,
7
7
  recordCodexHookProof
8
- } from "./chunk-DKC24YSC.js";
8
+ } from "./chunk-SMJMHOZA.js";
9
9
  import {
10
10
  SAFEWORD_SCHEMA,
11
11
  generateOwnedPathsModule
@@ -606,4 +606,4 @@ export {
606
606
  packagedNamespaceRootLabel,
607
607
  codexHook
608
608
  };
609
- //# sourceMappingURL=chunk-LTSHW45K.js.map
609
+ //# sourceMappingURL=chunk-CGYJJM2Y.js.map
@@ -2,7 +2,7 @@ import {
2
2
  PRODUCTION_INTEGRATIONS,
3
3
  checkHealth,
4
4
  coordinateSelectedIntegrations
5
- } from "./chunk-F56GGOF4.js";
5
+ } from "./chunk-WXAJFT4H.js";
6
6
  import {
7
7
  compareVersions,
8
8
  isSafePackageVersion
@@ -266,4 +266,4 @@ export {
266
266
  summarizeLifecycleStatus,
267
267
  observeLifecycleStatus
268
268
  };
269
- //# sourceMappingURL=chunk-BSBKSP54.js.map
269
+ //# sourceMappingURL=chunk-JIUDHG7G.js.map
@@ -281,6 +281,28 @@ function codexActivationIsPending(environment = process.env) {
281
281
  return true;
282
282
  }
283
283
  }
284
+ function codexActivationRestartWasObserved(environment = process.env, now = /* @__PURE__ */ new Date(), options = {}) {
285
+ try {
286
+ const identity = currentCodexPluginIdentity();
287
+ const marker = readActivationMarkerV2(environment, identity);
288
+ if (marker === null) return false;
289
+ return activationReceiptForRestart(
290
+ marker,
291
+ options.hostObservation ?? observeCodexHostProcesses(),
292
+ identity,
293
+ now
294
+ ) !== null;
295
+ } catch {
296
+ return false;
297
+ }
298
+ }
299
+ function codexActivationRestartIsProven(environment = process.env) {
300
+ try {
301
+ return readActivationReceipt(environment, currentCodexPluginIdentity()) !== null;
302
+ } catch {
303
+ return false;
304
+ }
305
+ }
284
306
  function activationIsPendingForIdentity(environment, identity) {
285
307
  return (
286
308
  // The canonical marker is written atomically. If it exists but cannot be
@@ -359,7 +381,7 @@ function writeCodexActivationMarker(environment = process.env, now = /* @__PURE_
359
381
  }
360
382
  function activeHostsForMarker(options) {
361
383
  if (options.activeHosts !== void 0) {
362
- return options.activeHosts === null || options.activeHosts.length === 0 ? null : options.activeHosts;
384
+ return options.activeHosts;
363
385
  }
364
386
  const observation = options.hostObservation ?? observeCodexHostProcesses();
365
387
  if (!observation.available) return null;
@@ -368,7 +390,7 @@ function activeHostsForMarker(options) {
368
390
  if (currentHost !== null && activeHosts.every((host) => !sameCodexHost(host, currentHost))) {
369
391
  activeHosts.push(currentHost);
370
392
  }
371
- return activeHosts.length === 0 ? null : activeHosts;
393
+ return activeHosts;
372
394
  }
373
395
  function hostObservationForOverride(current = null) {
374
396
  return {
@@ -379,7 +401,8 @@ function hostObservationForOverride(current = null) {
379
401
  }
380
402
  function activationReceiptForRestart(marker, hostObservation, identity, now) {
381
403
  const currentHost = hostObservation.current;
382
- if (!hostObservation.available || currentHost === null || marker.host_observation !== "observed" || marker.active_hosts.length === 0 || now.getTime() < Date.parse(marker.installed_at) || marker.active_hosts.some((installedHost) => sameCodexHost(installedHost, currentHost)) || marker.active_hosts.some(
404
+ const installedAt = Date.parse(marker.installed_at);
405
+ if (!hostObservation.available || currentHost === null || marker.host_observation !== "observed" || now.getTime() < installedAt || Date.parse(currentHost.started_at) < installedAt || marker.active_hosts.some((installedHost) => sameCodexHost(installedHost, currentHost)) || marker.active_hosts.some(
383
406
  (installedHost) => hostObservation.running.some((runningHost) => sameCodexHost(installedHost, runningHost))
384
407
  )) {
385
408
  return null;
@@ -745,7 +768,7 @@ function isCodexHookProof(value) {
745
768
  function isActivationMarkerV2(value) {
746
769
  if (typeof value !== "object" || value === null) return false;
747
770
  const marker = value;
748
- return marker.schema_version === 2 && pluginVersionIsWellFormed(marker.plugin_version) && typeof marker.manifest_sha256 === "string" && SHA256_PATTERN.test(marker.manifest_sha256) && typeof marker.activation_id === "string" && typeof marker.installed_at === "string" && !Number.isNaN(Date.parse(marker.installed_at)) && (marker.host_observation === "observed" || marker.host_observation === "unavailable") && Array.isArray(marker.active_hosts) && marker.active_hosts.every(isCodexHostProcessIdentity) && (marker.host_observation === "observed" ? marker.active_hosts.length > 0 : marker.active_hosts.length === 0);
771
+ return marker.schema_version === 2 && pluginVersionIsWellFormed(marker.plugin_version) && typeof marker.manifest_sha256 === "string" && SHA256_PATTERN.test(marker.manifest_sha256) && typeof marker.activation_id === "string" && typeof marker.installed_at === "string" && !Number.isNaN(Date.parse(marker.installed_at)) && (marker.host_observation === "observed" || marker.host_observation === "unavailable") && Array.isArray(marker.active_hosts) && marker.active_hosts.every(isCodexHostProcessIdentity) && (marker.host_observation === "observed" || marker.active_hosts.length === 0);
749
772
  }
750
773
  function isActivationReceiptV1(value) {
751
774
  if (typeof value !== "object" || value === null) return false;
@@ -766,10 +789,12 @@ export {
766
789
  legacyCodexEventIsViable,
767
790
  CODEX_PLUGIN_HOOK_EVENTS,
768
791
  codexActivationIsPending,
792
+ codexActivationRestartWasObserved,
793
+ codexActivationRestartIsProven,
769
794
  codexActivationMarkerIssue,
770
795
  writeCodexActivationMarker,
771
796
  recordCodexHookProof,
772
797
  observeCodexSessionProof,
773
798
  observeCodexHookProof
774
799
  };
775
- //# sourceMappingURL=chunk-DKC24YSC.js.map
800
+ //# sourceMappingURL=chunk-SMJMHOZA.js.map