@bonesofspring/ai-rules 0.2.38 → 0.2.39

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 (110) hide show
  1. package/CHANGELOG.md +249 -6
  2. package/package.json +1 -1
  3. package/presets/_shared/ai-local/scripts/derive-gate-signals.mjs +4 -6
  4. package/presets/_shared/ai-local/scripts/efficacy-oracle.mjs +5 -0
  5. package/presets/_shared/ai-local/scripts/lock.mjs +101 -73
  6. package/presets/_shared/ai-local/scripts/rule-improver.mjs +1 -1
  7. package/presets/_shared/ai-local/scripts/run.mjs +13 -4
  8. package/presets/_shared/ai-local/scripts/signals.mjs +38 -8
  9. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +4 -5
  10. package/presets/_shared/hooks/check-preset-update.mjs +1 -1
  11. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +4 -5
  12. package/presets/claude/android-kotlin/hooks/check-preset-update.mjs +1 -1
  13. package/presets/claude/go/hooks/chain-team-phases.sh +4 -5
  14. package/presets/claude/go/hooks/check-preset-update.mjs +1 -1
  15. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +4 -5
  16. package/presets/claude/ios-swift/hooks/check-preset-update.mjs +1 -1
  17. package/presets/claude/java/hooks/chain-team-phases.sh +4 -5
  18. package/presets/claude/java/hooks/check-preset-update.mjs +1 -1
  19. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +4 -5
  20. package/presets/claude/mcp-ts/hooks/check-preset-update.mjs +1 -1
  21. package/presets/claude/next/hooks/chain-team-phases.sh +4 -5
  22. package/presets/claude/next/hooks/check-preset-update.mjs +1 -1
  23. package/presets/claude/nuxt/hooks/chain-team-phases.sh +4 -5
  24. package/presets/claude/nuxt/hooks/check-preset-update.mjs +1 -1
  25. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +4 -5
  26. package/presets/claude/php-hexagonal/hooks/check-preset-update.mjs +1 -1
  27. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +4 -5
  28. package/presets/claude/php-laravel/hooks/check-preset-update.mjs +1 -1
  29. package/presets/claude/svelte/hooks/chain-team-phases.sh +4 -5
  30. package/presets/claude/svelte/hooks/check-preset-update.mjs +1 -1
  31. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +4 -5
  32. package/presets/cursor/android-kotlin/hooks/check-preset-update.mjs +1 -1
  33. package/presets/cursor/go/hooks/chain-team-phases.sh +4 -5
  34. package/presets/cursor/go/hooks/check-preset-update.mjs +1 -1
  35. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +4 -5
  36. package/presets/cursor/ios-swift/hooks/check-preset-update.mjs +1 -1
  37. package/presets/cursor/java/hooks/chain-team-phases.sh +4 -5
  38. package/presets/cursor/java/hooks/check-preset-update.mjs +1 -1
  39. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +4 -5
  40. package/presets/cursor/mcp-ts/hooks/check-preset-update.mjs +1 -1
  41. package/presets/cursor/next/hooks/chain-team-phases.sh +4 -5
  42. package/presets/cursor/next/hooks/check-preset-update.mjs +1 -1
  43. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +4 -5
  44. package/presets/cursor/nuxt/hooks/check-preset-update.mjs +1 -1
  45. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +4 -5
  46. package/presets/cursor/php-hexagonal/hooks/check-preset-update.mjs +1 -1
  47. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +4 -5
  48. package/presets/cursor/php-laravel/hooks/check-preset-update.mjs +1 -1
  49. package/presets/cursor/svelte/hooks/chain-team-phases.sh +4 -5
  50. package/presets/cursor/svelte/hooks/check-preset-update.mjs +1 -1
  51. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  52. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +4 -5
  53. package/presets/mavis/android-kotlin/hooks/check-preset-update.mjs +1 -1
  54. package/presets/mavis/go/adapter-map.json +1 -1
  55. package/presets/mavis/go/hooks/chain-team-phases.sh +4 -5
  56. package/presets/mavis/go/hooks/check-preset-update.mjs +1 -1
  57. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  58. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +4 -5
  59. package/presets/mavis/ios-swift/hooks/check-preset-update.mjs +1 -1
  60. package/presets/mavis/java/adapter-map.json +1 -1
  61. package/presets/mavis/java/hooks/chain-team-phases.sh +4 -5
  62. package/presets/mavis/java/hooks/check-preset-update.mjs +1 -1
  63. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  64. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +4 -5
  65. package/presets/mavis/mcp-ts/hooks/check-preset-update.mjs +1 -1
  66. package/presets/mavis/next/adapter-map.json +1 -1
  67. package/presets/mavis/next/hooks/chain-team-phases.sh +4 -5
  68. package/presets/mavis/next/hooks/check-preset-update.mjs +1 -1
  69. package/presets/mavis/nuxt/adapter-map.json +1 -1
  70. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +4 -5
  71. package/presets/mavis/nuxt/hooks/check-preset-update.mjs +1 -1
  72. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  73. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +4 -5
  74. package/presets/mavis/php-hexagonal/hooks/check-preset-update.mjs +1 -1
  75. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  76. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +4 -5
  77. package/presets/mavis/php-laravel/hooks/check-preset-update.mjs +1 -1
  78. package/presets/mavis/svelte/adapter-map.json +1 -1
  79. package/presets/mavis/svelte/hooks/chain-team-phases.sh +4 -5
  80. package/presets/mavis/svelte/hooks/check-preset-update.mjs +1 -1
  81. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  82. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +4 -5
  83. package/presets/opencode/android-kotlin/hooks/check-preset-update.mjs +1 -1
  84. package/presets/opencode/go/adapter-map.json +1 -1
  85. package/presets/opencode/go/hooks/chain-team-phases.sh +4 -5
  86. package/presets/opencode/go/hooks/check-preset-update.mjs +1 -1
  87. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  88. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +4 -5
  89. package/presets/opencode/ios-swift/hooks/check-preset-update.mjs +1 -1
  90. package/presets/opencode/java/adapter-map.json +1 -1
  91. package/presets/opencode/java/hooks/chain-team-phases.sh +4 -5
  92. package/presets/opencode/java/hooks/check-preset-update.mjs +1 -1
  93. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  94. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +4 -5
  95. package/presets/opencode/mcp-ts/hooks/check-preset-update.mjs +1 -1
  96. package/presets/opencode/next/adapter-map.json +1 -1
  97. package/presets/opencode/next/hooks/chain-team-phases.sh +4 -5
  98. package/presets/opencode/next/hooks/check-preset-update.mjs +1 -1
  99. package/presets/opencode/nuxt/adapter-map.json +1 -1
  100. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +4 -5
  101. package/presets/opencode/nuxt/hooks/check-preset-update.mjs +1 -1
  102. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  103. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +4 -5
  104. package/presets/opencode/php-hexagonal/hooks/check-preset-update.mjs +1 -1
  105. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  106. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +4 -5
  107. package/presets/opencode/php-laravel/hooks/check-preset-update.mjs +1 -1
  108. package/presets/opencode/svelte/adapter-map.json +1 -1
  109. package/presets/opencode/svelte/hooks/chain-team-phases.sh +4 -5
  110. package/presets/opencode/svelte/hooks/check-preset-update.mjs +1 -1
@@ -439,6 +439,10 @@ function completePipeline(statusPatch) {
439
439
  out(`Pipeline blocked for "${slug}": .ai.local/pipeline-gates.json requireArtifacts missing completed receipt(s): ${missing.join(', ')}.`);
440
440
  process.exit(0);
441
441
  }
442
+ // task_completed is written only on this branch. A missing receipt blocks
443
+ // above and must not be counted as a finished task.
444
+ status.state = 'completed';
445
+ completeTaskMetrics();
442
446
  writeStatus(statusPatch);
443
447
  out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
444
448
  process.exit(0);
@@ -950,7 +954,6 @@ if (hookInput.action === 'end_human_gate') {
950
954
  if (dispatchReadyWave()) process.exit(0);
951
955
  if (pendingStepIndexes().length === 0) {
952
956
  status.state = 'completed';
953
- completeTaskMetrics();
954
957
  completePipeline({ pipelineIndex: resumeSteps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
955
958
  }
956
959
  out(noProgressNotice());
@@ -976,7 +979,6 @@ if (hookInput.action === 'end_human_gate') {
976
979
  // Gate on the final step: no executable step remains. Complete the
977
980
  // pipeline instead of leaving it in_progress forever.
978
981
  status.state = 'completed';
979
- completeTaskMetrics();
980
982
  completePipeline({
981
983
  pipelineIndex: resumeSteps.length,
982
984
  phase: 'done',
@@ -1287,7 +1289,6 @@ if (waveIndexes) {
1287
1289
  process.exit(0);
1288
1290
  }
1289
1291
  if (pendingStepIndexes().length === 0) {
1290
- completeTaskMetrics();
1291
1292
  completePipeline({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
1292
1293
  }
1293
1294
  out(noProgressNotice());
@@ -1401,7 +1402,6 @@ if (isGraphMode()) {
1401
1402
  }
1402
1403
  if (dispatchReadyWave()) process.exit(0);
1403
1404
  if (pendingStepIndexes().length === 0) {
1404
- completeTaskMetrics();
1405
1405
  completePipeline({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
1406
1406
  }
1407
1407
  out(noProgressNotice());
@@ -1410,7 +1410,6 @@ if (isGraphMode()) {
1410
1410
 
1411
1411
  const next = findNextExecutableStep(steps, idx + 1, taskDir);
1412
1412
  if (!next) {
1413
- completeTaskMetrics();
1414
1413
  completePipeline({
1415
1414
  pipelineIndex: steps.length,
1416
1415
  phase: 'done',
@@ -9,7 +9,7 @@ import { fileURLToPath } from 'node:url';
9
9
 
10
10
  export const PACKAGE_NAME = '@bonesofspring/ai-rules';
11
11
  export const REGISTRY_URL = 'https://registry.npmjs.org/@bonesofspring/ai-rules/latest';
12
- export const CACHE_TTL_MS = 12 * 60 * 60 * 1000;
12
+ export const CACHE_TTL_MS = 60 * 60 * 1000;
13
13
  export const TOOL_ROOTS = ['.cursor', '.claude', '.mavis', '.opencode'];
14
14
 
15
15
  const RELEASE_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
@@ -3,7 +3,7 @@
3
3
  "platform": "opencode",
4
4
  "stack": "php-laravel",
5
5
  "semanticSource": "cursor/php-laravel",
6
- "sourceRevision": "2d9fb0f056af1c6eb9356a56072b85e32f5f9a62f5581ff15528ccc34539d7b6",
6
+ "sourceRevision": "0318729636610b6fcebe3e594c46f3fd874705d83f37f7cc4cff8ceed00b47da",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -439,6 +439,10 @@ function completePipeline(statusPatch) {
439
439
  out(`Pipeline blocked for "${slug}": .ai.local/pipeline-gates.json requireArtifacts missing completed receipt(s): ${missing.join(', ')}.`);
440
440
  process.exit(0);
441
441
  }
442
+ // task_completed is written only on this branch. A missing receipt blocks
443
+ // above and must not be counted as a finished task.
444
+ status.state = 'completed';
445
+ completeTaskMetrics();
442
446
  writeStatus(statusPatch);
443
447
  out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
444
448
  process.exit(0);
@@ -950,7 +954,6 @@ if (hookInput.action === 'end_human_gate') {
950
954
  if (dispatchReadyWave()) process.exit(0);
951
955
  if (pendingStepIndexes().length === 0) {
952
956
  status.state = 'completed';
953
- completeTaskMetrics();
954
957
  completePipeline({ pipelineIndex: resumeSteps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
955
958
  }
956
959
  out(noProgressNotice());
@@ -976,7 +979,6 @@ if (hookInput.action === 'end_human_gate') {
976
979
  // Gate on the final step: no executable step remains. Complete the
977
980
  // pipeline instead of leaving it in_progress forever.
978
981
  status.state = 'completed';
979
- completeTaskMetrics();
980
982
  completePipeline({
981
983
  pipelineIndex: resumeSteps.length,
982
984
  phase: 'done',
@@ -1287,7 +1289,6 @@ if (waveIndexes) {
1287
1289
  process.exit(0);
1288
1290
  }
1289
1291
  if (pendingStepIndexes().length === 0) {
1290
- completeTaskMetrics();
1291
1292
  completePipeline({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
1292
1293
  }
1293
1294
  out(noProgressNotice());
@@ -1401,7 +1402,6 @@ if (isGraphMode()) {
1401
1402
  }
1402
1403
  if (dispatchReadyWave()) process.exit(0);
1403
1404
  if (pendingStepIndexes().length === 0) {
1404
- completeTaskMetrics();
1405
1405
  completePipeline({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
1406
1406
  }
1407
1407
  out(noProgressNotice());
@@ -1410,7 +1410,6 @@ if (isGraphMode()) {
1410
1410
 
1411
1411
  const next = findNextExecutableStep(steps, idx + 1, taskDir);
1412
1412
  if (!next) {
1413
- completeTaskMetrics();
1414
1413
  completePipeline({
1415
1414
  pipelineIndex: steps.length,
1416
1415
  phase: 'done',
@@ -9,7 +9,7 @@ import { fileURLToPath } from 'node:url';
9
9
 
10
10
  export const PACKAGE_NAME = '@bonesofspring/ai-rules';
11
11
  export const REGISTRY_URL = 'https://registry.npmjs.org/@bonesofspring/ai-rules/latest';
12
- export const CACHE_TTL_MS = 12 * 60 * 60 * 1000;
12
+ export const CACHE_TTL_MS = 60 * 60 * 1000;
13
13
  export const TOOL_ROOTS = ['.cursor', '.claude', '.mavis', '.opencode'];
14
14
 
15
15
  const RELEASE_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
@@ -3,7 +3,7 @@
3
3
  "platform": "opencode",
4
4
  "stack": "svelte",
5
5
  "semanticSource": "cursor/svelte",
6
- "sourceRevision": "bd9c67b8e49c671adc64f654ef7481b00f0b89545b8fd01116644eee53c0bd97",
6
+ "sourceRevision": "283718e2b0e8f361c6db80ffccd5009928888d1f8f5b6678587899f26d3f5907",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -439,6 +439,10 @@ function completePipeline(statusPatch) {
439
439
  out(`Pipeline blocked for "${slug}": .ai.local/pipeline-gates.json requireArtifacts missing completed receipt(s): ${missing.join(', ')}.`);
440
440
  process.exit(0);
441
441
  }
442
+ // task_completed is written only on this branch. A missing receipt blocks
443
+ // above and must not be counted as a finished task.
444
+ status.state = 'completed';
445
+ completeTaskMetrics();
442
446
  writeStatus(statusPatch);
443
447
  out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
444
448
  process.exit(0);
@@ -952,7 +956,6 @@ if (hookInput.action === 'end_human_gate') {
952
956
  if (dispatchReadyWave()) process.exit(0);
953
957
  if (pendingStepIndexes().length === 0) {
954
958
  status.state = 'completed';
955
- completeTaskMetrics();
956
959
  completePipeline({ pipelineIndex: resumeSteps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
957
960
  }
958
961
  out(noProgressNotice());
@@ -978,7 +981,6 @@ if (hookInput.action === 'end_human_gate') {
978
981
  // Gate on the final step: no executable step remains. Complete the
979
982
  // pipeline instead of leaving it in_progress forever.
980
983
  status.state = 'completed';
981
- completeTaskMetrics();
982
984
  completePipeline({
983
985
  pipelineIndex: resumeSteps.length,
984
986
  phase: 'done',
@@ -1289,7 +1291,6 @@ if (waveIndexes) {
1289
1291
  process.exit(0);
1290
1292
  }
1291
1293
  if (pendingStepIndexes().length === 0) {
1292
- completeTaskMetrics();
1293
1294
  completePipeline({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
1294
1295
  }
1295
1296
  out(noProgressNotice());
@@ -1403,7 +1404,6 @@ if (isGraphMode()) {
1403
1404
  }
1404
1405
  if (dispatchReadyWave()) process.exit(0);
1405
1406
  if (pendingStepIndexes().length === 0) {
1406
- completeTaskMetrics();
1407
1407
  completePipeline({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
1408
1408
  }
1409
1409
  out(noProgressNotice());
@@ -1412,7 +1412,6 @@ if (isGraphMode()) {
1412
1412
 
1413
1413
  const next = findNextExecutableStep(steps, idx + 1, taskDir);
1414
1414
  if (!next) {
1415
- completeTaskMetrics();
1416
1415
  completePipeline({
1417
1416
  pipelineIndex: steps.length,
1418
1417
  phase: 'done',
@@ -9,7 +9,7 @@ import { fileURLToPath } from 'node:url';
9
9
 
10
10
  export const PACKAGE_NAME = '@bonesofspring/ai-rules';
11
11
  export const REGISTRY_URL = 'https://registry.npmjs.org/@bonesofspring/ai-rules/latest';
12
- export const CACHE_TTL_MS = 12 * 60 * 60 * 1000;
12
+ export const CACHE_TTL_MS = 60 * 60 * 1000;
13
13
  export const TOOL_ROOTS = ['.cursor', '.claude', '.mavis', '.opencode'];
14
14
 
15
15
  const RELEASE_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;