soloforge 1.4.4 → 1.4.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 (95) hide show
  1. package/README.md +6 -5
  2. package/dist/adapters/claude_code/tools.d.ts.map +1 -1
  3. package/dist/adapters/claude_code/tools.js +50 -12
  4. package/dist/adapters/claude_code/tools.js.map +1 -1
  5. package/dist/adapters/shared/workflow_template.js +1 -1
  6. package/dist/bin/soloforge.d.ts.map +1 -1
  7. package/dist/bin/soloforge.js +62 -15
  8. package/dist/bin/soloforge.js.map +1 -1
  9. package/dist/engine/backend_implementation_contract.js +1 -1
  10. package/dist/engine/code_maintainability_observability_contract.js +7 -7
  11. package/dist/engine/code_maintainability_observability_contract.js.map +1 -1
  12. package/dist/engine/consumption_trace_store.d.ts +9 -1
  13. package/dist/engine/consumption_trace_store.d.ts.map +1 -1
  14. package/dist/engine/consumption_trace_store.js +3 -0
  15. package/dist/engine/consumption_trace_store.js.map +1 -1
  16. package/dist/engine/design_artifact_pack.d.ts +2 -0
  17. package/dist/engine/design_artifact_pack.d.ts.map +1 -1
  18. package/dist/engine/design_artifact_pack.js +20 -17
  19. package/dist/engine/design_artifact_pack.js.map +1 -1
  20. package/dist/engine/design_lifecycle_contract.d.ts +60 -0
  21. package/dist/engine/design_lifecycle_contract.d.ts.map +1 -0
  22. package/dist/engine/design_lifecycle_contract.js +497 -0
  23. package/dist/engine/design_lifecycle_contract.js.map +1 -0
  24. package/dist/engine/diagnostic_registry.js +2 -2
  25. package/dist/engine/diagnostic_registry.js.map +1 -1
  26. package/dist/engine/foundation_scenario_registry.js +2 -2
  27. package/dist/engine/foundation_scenario_registry.js.map +1 -1
  28. package/dist/engine/foundation_scenario_runners.js +9 -9
  29. package/dist/engine/foundation_scenario_runners.js.map +1 -1
  30. package/dist/engine/historical_issue_mechanization_matrix.js +1 -1
  31. package/dist/engine/historical_issue_mechanization_matrix.js.map +1 -1
  32. package/dist/engine/implementation_roadmap_registry.js +2 -2
  33. package/dist/engine/implementation_roadmap_registry.js.map +1 -1
  34. package/dist/engine/input_material_extractor.js +1 -1
  35. package/dist/engine/input_material_extractor.js.map +1 -1
  36. package/dist/engine/intent_expander.d.ts.map +1 -1
  37. package/dist/engine/intent_expander.js +38 -15
  38. package/dist/engine/intent_expander.js.map +1 -1
  39. package/dist/engine/knowledge_asset_consumer.d.ts.map +1 -1
  40. package/dist/engine/knowledge_asset_consumer.js +21 -13
  41. package/dist/engine/knowledge_asset_consumer.js.map +1 -1
  42. package/dist/engine/knowledge_injection_boundary.d.ts +2 -2
  43. package/dist/engine/knowledge_injection_boundary.d.ts.map +1 -1
  44. package/dist/engine/knowledge_injection_boundary.js +19 -7
  45. package/dist/engine/knowledge_injection_boundary.js.map +1 -1
  46. package/dist/engine/lifecycle_knowledge_contract.d.ts +59 -0
  47. package/dist/engine/lifecycle_knowledge_contract.d.ts.map +1 -0
  48. package/dist/engine/lifecycle_knowledge_contract.js +203 -0
  49. package/dist/engine/lifecycle_knowledge_contract.js.map +1 -0
  50. package/dist/engine/next_action_planner.js +56 -20
  51. package/dist/engine/next_action_planner.js.map +1 -1
  52. package/dist/engine/observed_consumption.d.ts.map +1 -1
  53. package/dist/engine/observed_consumption.js +2 -1
  54. package/dist/engine/observed_consumption.js.map +1 -1
  55. package/dist/engine/project_knowledge_contract.d.ts +75 -1
  56. package/dist/engine/project_knowledge_contract.d.ts.map +1 -1
  57. package/dist/engine/project_knowledge_contract.js +267 -30
  58. package/dist/engine/project_knowledge_contract.js.map +1 -1
  59. package/dist/engine/regression_matrix.js +1 -1
  60. package/dist/engine/regression_matrix.js.map +1 -1
  61. package/dist/engine/release_issue_scenario_registry.d.ts.map +1 -1
  62. package/dist/engine/release_issue_scenario_registry.js +15 -12
  63. package/dist/engine/release_issue_scenario_registry.js.map +1 -1
  64. package/dist/engine/release_readiness_gate.d.ts.map +1 -1
  65. package/dist/engine/release_readiness_gate.js +183 -54
  66. package/dist/engine/release_readiness_gate.js.map +1 -1
  67. package/dist/engine/stale_current_task_detector.d.ts +1 -1
  68. package/dist/engine/stale_current_task_detector.js +4 -4
  69. package/dist/engine/stale_current_task_detector.js.map +1 -1
  70. package/dist/engine/task_context.d.ts.map +1 -1
  71. package/dist/engine/task_context.js +2 -0
  72. package/dist/engine/task_context.js.map +1 -1
  73. package/dist/engine/traceability.d.ts +2 -2
  74. package/dist/engine/traceability.d.ts.map +1 -1
  75. package/dist/engine/traceability.js +78 -15
  76. package/dist/engine/traceability.js.map +1 -1
  77. package/dist/engine/workflow_navigation_contract.d.ts +11 -0
  78. package/dist/engine/workflow_navigation_contract.d.ts.map +1 -1
  79. package/dist/engine/workspace_resumer.d.ts.map +1 -1
  80. package/dist/engine/workspace_resumer.js +2 -1
  81. package/dist/engine/workspace_resumer.js.map +1 -1
  82. package/dist/knowledge/conflict_detector.d.ts +1 -1
  83. package/dist/knowledge/conflict_detector.d.ts.map +1 -1
  84. package/dist/knowledge/conflict_detector.js +86 -2
  85. package/dist/knowledge/conflict_detector.js.map +1 -1
  86. package/dist/types.d.ts +14 -0
  87. package/dist/types.d.ts.map +1 -1
  88. package/package.json +1 -1
  89. package/templates/knowledge/acceptance_templates//344/273/243/347/240/201/346/263/250/351/207/212/344/270/216/346/227/245/345/277/227/351/252/214/346/224/266/346/250/241/346/235/277.md +1 -1
  90. package/templates/knowledge/acceptance_templates//345/216/237/345/236/213/350/257/264/346/230/216/346/250/241/347/211/210.md +6 -6
  91. package/templates/knowledge/acceptance_templates//351/234/200/346/261/202/345/216/237/345/236/213/350/256/276/350/256/241/345/256/236/347/216/260/350/277/275/350/270/252/347/237/251/351/230/265/346/250/241/347/211/210.md +25 -20
  92. package/templates/knowledge/procedures//346/272/220/347/240/201/345/216/237/345/236/213/344/272/244/344/273/230/346/265/201/347/250/213.md +8 -5
  93. package/templates/knowledge/procedures//350/257/246/347/273/206/350/256/276/350/256/241/346/265/201/347/250/213.md +19 -6
  94. package/templates/knowledge/rules//344/273/243/347/240/201/346/263/250/351/207/212/344/270/216/346/227/245/345/277/227/345/245/221/347/272/246/350/247/204/345/210/231.md +4 -4
  95. package/templates/knowledge/rules//350/256/276/350/256/241/344/272/247/347/211/251/345/214/205/350/247/204/345/210/231.md +16 -0
@@ -109,7 +109,7 @@ export function validateWorkflowRuleSources(rootDir) {
109
109
  };
110
110
  }
111
111
  /** 当前嵌入的权威规则校验和 — 由 `npm run update-workflow-checksum` 更新。 */
112
- const EMBEDDED_CHECKSUM = "3620b50bb23320b5";
112
+ const EMBEDDED_CHECKSUM = "1329a153ea580993";
113
113
  function getEmbeddedChecksum() {
114
114
  return EMBEDDED_CHECKSUM;
115
115
  }
@@ -1 +1 @@
1
- {"version":3,"file":"soloforge.d.ts","sourceRoot":"","sources":["../../src/bin/soloforge.ts"],"names":[],"mappings":";AAqgCA,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC"}
1
+ {"version":3,"file":"soloforge.d.ts","sourceRoot":"","sources":["../../src/bin/soloforge.ts"],"names":[],"mappings":";AAshCA,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC"}
@@ -18,6 +18,7 @@ import { isReadForbidden } from "../engine/privacy_secret_contract.js";
18
18
  import { routeIntent } from "../engine/intent_router.js";
19
19
  import { debugLog, debug, userInfo, userWarn, userError, internalWarn, jsonSafeError, initLoggerFromEnv } from "../engine/logger.js";
20
20
  import { auditControlPlaneProject, isSoloforgeStateBypassCommand } from "../engine/control_plane_contract.js";
21
+ import { getDesignLifecycleArtifactPaths } from "../engine/design_lifecycle_contract.js";
21
22
  const command = process.argv[2];
22
23
  const args = process.argv.slice(3);
23
24
  async function main() {
@@ -741,9 +742,24 @@ function isImplementationSourcePath(relativeFilePath) {
741
742
  return /\.(?:java|kt|kts|scala|ts|tsx|js|jsx|mjs|cjs|py|go|rs|php|rb|cs|swift|vue|svelte|sql|xml|yml|yaml|properties)$/.test(relativeFilePath);
742
743
  }
743
744
  function isDesignArtifactPath(relativeFilePath) {
745
+ const lifecyclePaths = getDesignLifecycleArtifactPaths();
746
+ if ([
747
+ lifecyclePaths.decision_record,
748
+ lifecyclePaths.architecture_document,
749
+ lifecyclePaths.database_document,
750
+ lifecyclePaths.api_document,
751
+ lifecyclePaths.optional_detail_design_document,
752
+ lifecyclePaths.slice_plan,
753
+ lifecyclePaths.consistency_report,
754
+ lifecyclePaths.traceability_matrix,
755
+ lifecyclePaths.openapi,
756
+ ].includes(relativeFilePath))
757
+ return true;
744
758
  return /^docs\/architecture\//.test(relativeFilePath) ||
759
+ /^docs\/traceability\//.test(relativeFilePath) ||
745
760
  /^docs\/api\/openapi\.(?:ya?ml|json)$/.test(relativeFilePath) ||
746
- /^db\/(?:migrations|schema)\//.test(relativeFilePath);
761
+ /^db\/(?:migrations?|schema|changelog)\//.test(relativeFilePath) ||
762
+ /(?:^|\/)(?:src\/main\/resources\/)?db\/(?:migrations?|schema|changelog)\//.test(relativeFilePath);
747
763
  }
748
764
  function denyPreToolUse(reason) {
749
765
  process.stdout.write(JSON.stringify({
@@ -776,23 +792,25 @@ async function evaluateImplementationWriteGate(projectPath, relativeFilePath) {
776
792
  return "检测到项目已有设计产物,但当前任务缺少 design_artifact_pack 复验状态。不得取消任务后直接写业务实现,不得改用 Bash 绕过;请先运行 soloforge audit-design-artifacts,并通过 sf_expand/sf_verify 绑定设计产物包。";
777
793
  }
778
794
  if (designPack && designPack.status !== "implementation_ready") {
779
- return `设计产物包状态为 ${designPack.status},不得改用 Bash/Edit/Write 绕过设计复验;请先完善 docs/architecture、docs/api/openapi 或 db/migrations|schema 并通过复验,再写入业务实现`;
795
+ return `设计产物包状态为 ${designPack.status},不得改用 Bash/Edit/Write 绕过设计复验;请先完善 docs/architecture、docs/traceability、docs/api/openapi 或 db/migration|migrations|schema|changelog 并通过复验,再写入业务实现`;
780
796
  }
781
797
  return undefined;
782
798
  }
783
799
  function hasDesignArtifacts(projectPath) {
800
+ const lifecyclePaths = getDesignLifecycleArtifactPaths();
784
801
  const candidates = [
785
- path.join(projectPath, "docs", "architecture", "00-架构决策记录.md"),
786
- path.join(projectPath, "docs", "architecture", "01-架构设计文档.md"),
787
- path.join(projectPath, "docs", "architecture", "02-数据库设计文档.md"),
788
- path.join(projectPath, "docs", "architecture", "03-API接口规格文档.md"),
789
- path.join(projectPath, "docs", "architecture", "04-详细设计文档.md"),
790
- path.join(projectPath, "docs", "architecture", "99-设计一致性验收报告.md"),
791
- path.join(projectPath, "docs", "api", "openapi.yaml"),
802
+ lifecyclePaths.decision_record,
803
+ lifecyclePaths.architecture_document,
804
+ lifecyclePaths.database_document,
805
+ lifecyclePaths.api_document,
806
+ lifecyclePaths.optional_detail_design_document,
807
+ lifecyclePaths.slice_plan,
808
+ lifecyclePaths.consistency_report,
809
+ lifecyclePaths.traceability_matrix,
810
+ lifecyclePaths.openapi,
792
811
  path.join(projectPath, "docs", "api", "openapi.yml"),
793
- path.join(projectPath, "db", "migrations"),
794
- path.join(projectPath, "db", "migration"),
795
- ];
812
+ ...lifecyclePaths.sql_roots,
813
+ ].map((candidate) => path.join(projectPath, candidate));
796
814
  return candidates.some((candidate) => fss.existsSync(candidate));
797
815
  }
798
816
  async function cmdPostBash() {
@@ -2498,7 +2516,20 @@ async function cmdNext() {
2498
2516
  if (plan.project_knowledge_context.selected.length > 0) {
2499
2517
  userInfo(" 下一步会优先参考:");
2500
2518
  for (const item of plan.project_knowledge_context.selected) {
2501
- userInfo(` - ${item.name} (${item.rel_path}, ${item.consumption})`);
2519
+ userInfo(` - ${item.name} (${item.rel_path}, ${item.enforcement ?? item.consumption})`);
2520
+ if (item.reason_zh)
2521
+ userInfo(` 原因: ${item.reason_zh}`);
2522
+ if (item.verification_command)
2523
+ userInfo(` 复验: ${item.verification_command}`);
2524
+ }
2525
+ }
2526
+ if (plan.project_knowledge_context.blocked && plan.project_knowledge_context.blocked.length > 0) {
2527
+ userInfo(" 必须先处理:");
2528
+ for (const item of plan.project_knowledge_context.blocked) {
2529
+ userInfo(` - ${item.name} (${item.rel_path})`);
2530
+ userInfo(` 原因: ${item.reason_zh}`);
2531
+ if (item.recovery)
2532
+ userInfo(` 恢复: ${item.recovery}`);
2502
2533
  }
2503
2534
  }
2504
2535
  }
@@ -2912,14 +2943,30 @@ async function cmdAuditProjectKnowledge() {
2912
2943
  userInfo(` hard_fail: ${report.hard_fail_count}`);
2913
2944
  userInfo(` warning: ${report.warning_count}`);
2914
2945
  for (const asset of report.assets) {
2915
- if (asset.findings.length === 0)
2916
- continue;
2917
2946
  userInfo(` - ${asset.rel_path} (${asset.identity}/${asset.consumption})`);
2947
+ userInfo(` 创建: ${asset.evidence.created_by};索引: ${asset.evidence.indexed_by}`);
2948
+ if (asset.lifecycle_stages.length > 0)
2949
+ userInfo(` 阶段: ${asset.lifecycle_stages.join(", ")}`);
2950
+ if (asset.path_patterns.length > 0)
2951
+ userInfo(` 路径: ${asset.path_patterns.join(", ")}`);
2952
+ if (asset.traceability_ids.length > 0)
2953
+ userInfo(` 追踪: ${asset.traceability_ids.join(", ")}`);
2954
+ if (asset.verification_commands.length > 0)
2955
+ userInfo(` 复验: ${asset.verification_commands.join(" / ")}`);
2956
+ if (asset.evidence.last_consumed_at) {
2957
+ userInfo(` 最近消费: ${asset.evidence.last_consumption_consumer}/${asset.evidence.last_consumption_action} ${asset.evidence.last_consumed_task} @ ${asset.evidence.last_consumed_at}`);
2958
+ }
2918
2959
  for (const finding of asset.findings) {
2919
2960
  const mark = finding.severity === "hard_fail" ? "❌" : finding.severity === "warning" ? "⚠️" : "ℹ️";
2920
2961
  userInfo(` ${mark} [${finding.code}] ${finding.message_zh}`);
2921
2962
  }
2922
2963
  }
2964
+ if (report.recent_consumption.length > 0) {
2965
+ userInfo(" 最近消费证据:");
2966
+ for (const item of report.recent_consumption.slice(0, 10)) {
2967
+ userInfo(` - ${item.rel_path ?? item.asset_id}: ${item.consumer}/${item.action ?? "unknown"} ${item.lifecycle_stage ?? "unknown_stage"} ${item.task_id_or_route} ${item.decision ?? ""}`);
2968
+ }
2969
+ }
2923
2970
  if (report.recommended_next_steps.length > 0) {
2924
2971
  userInfo(" 下一步:");
2925
2972
  for (const step of report.recommended_next_steps)