@chenmk/superflow 0.2.5 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +24 -2
  2. package/README.zh-CN.md +17 -1
  3. package/assets/manifest.json +7 -4
  4. package/assets/prompts/superflow-clarify.md +6 -0
  5. package/assets/prompts/superflow-design.md +3 -0
  6. package/assets/prompts/superflow-docs.md +4 -1
  7. package/assets/prompts/superflow-pipeline.md +8 -0
  8. package/assets/scripts/superflow-archive-command-hook.sh +80 -0
  9. package/assets/scripts/superflow-delivery-check.sh +23 -4
  10. package/assets/scripts/superflow-dependency-update-hook.sh +1 -1
  11. package/assets/scripts/superflow-managed-work-check.mjs +194 -0
  12. package/assets/scripts/superflow-managed-work-guard.sh +103 -0
  13. package/assets/skills/openspec-propose/SKILL.md +11 -0
  14. package/assets/skills/superflow-archive/SKILL.md +5 -0
  15. package/assets/skills/superflow-clarify/SKILL.md +26 -7
  16. package/assets/skills/superflow-design/SKILL.md +38 -7
  17. package/assets/skills/superflow-docs/SKILL.md +27 -0
  18. package/assets/skills/superflow-pipeline/SKILL.md +75 -0
  19. package/assets/skills/superflow-pipeline/references/api-design-template.md +11 -0
  20. package/assets/skills/superflow-pipeline/references/batch-prompt-template.md +27 -0
  21. package/assets/skills/superflow-pipeline/references/document-templates.md +8 -0
  22. package/assets/skills/superflow-pipeline/references/implementation-prompt-template.md +29 -1
  23. package/assets/skills/superflow-pipeline/references/managed-work.md +58 -0
  24. package/assets/skills/superflow-pipeline/references/quality-gate.md +3 -0
  25. package/assets/skills/superflow-pipeline/references/superpower-technical-design-template.md +51 -0
  26. package/assets/skills/superflow-pipeline/references/test-execution-template.md +10 -0
  27. package/assets/skills/superflow-pipeline/scripts/superflow-archive.sh +1 -1
  28. package/assets/skills/superflow-pipeline/scripts/superflow-guard.sh +215 -2
  29. package/assets/skills/superflow-verify/SKILL.md +7 -0
  30. package/assets/skills-en/openspec-propose/SKILL.md +14 -0
  31. package/assets/skills-en/superflow-archive/SKILL.md +6 -0
  32. package/assets/skills-en/superflow-clarify/SKILL.md +26 -7
  33. package/assets/skills-en/superflow-design/SKILL.md +38 -6
  34. package/assets/skills-en/superflow-docs/SKILL.md +27 -0
  35. package/assets/skills-en/superflow-pipeline/SKILL.md +76 -0
  36. package/assets/skills-en/superflow-pipeline/references/api-design-template.md +13 -0
  37. package/assets/skills-en/superflow-pipeline/references/batch-prompt-template.md +16 -0
  38. package/assets/skills-en/superflow-pipeline/references/document-templates.md +5 -0
  39. package/assets/skills-en/superflow-pipeline/references/implementation-prompt-template.md +17 -0
  40. package/assets/skills-en/superflow-pipeline/references/managed-work.md +34 -0
  41. package/assets/skills-en/superflow-pipeline/references/quality-gate.md +25 -0
  42. package/assets/skills-en/superflow-pipeline/references/superpower-technical-design-template.md +57 -0
  43. package/assets/skills-en/superflow-pipeline/references/test-execution-template.md +12 -0
  44. package/assets/skills-en/superflow-pipeline/scripts/superflow-archive.sh +1 -1
  45. package/assets/skills-en/superflow-pipeline/scripts/superflow-guard.sh +214 -2
  46. package/assets/skills-en/superflow-verify/SKILL.md +8 -0
  47. package/dist/app/cli.js +120 -102
  48. package/dist/app/cli.js.map +1 -1
  49. package/dist/app/commands/archive.js +7 -3
  50. package/dist/app/commands/archive.js.map +1 -1
  51. package/dist/app/commands/change-guard.js +27 -0
  52. package/dist/app/commands/change-guard.js.map +1 -0
  53. package/dist/app/commands/design.js +2 -20
  54. package/dist/app/commands/design.js.map +1 -1
  55. package/dist/app/commands/init.js +7 -7
  56. package/dist/app/commands/init.js.map +1 -1
  57. package/dist/app/commands/managed-service.js +5 -0
  58. package/dist/app/commands/managed-service.js.map +1 -0
  59. package/dist/app/commands/pipeline.js +123 -3
  60. package/dist/app/commands/pipeline.js.map +1 -1
  61. package/dist/app/commands/status.js +199 -77
  62. package/dist/app/commands/status.js.map +1 -1
  63. package/dist/app/commands/uninstall.js +5 -2
  64. package/dist/app/commands/uninstall.js.map +1 -1
  65. package/dist/app/commands/update.js +33 -11
  66. package/dist/app/commands/update.js.map +1 -1
  67. package/dist/app/commands/verify.js +7 -3
  68. package/dist/app/commands/verify.js.map +1 -1
  69. package/dist/domains/config/cli-help.js +103 -73
  70. package/dist/domains/config/cli-help.js.map +1 -1
  71. package/dist/domains/config/context.js +1 -5
  72. package/dist/domains/config/context.js.map +1 -1
  73. package/dist/domains/deps.js +3 -6
  74. package/dist/domains/deps.js.map +1 -1
  75. package/dist/domains/hook.js +71 -37
  76. package/dist/domains/hook.js.map +1 -1
  77. package/dist/domains/managed-work/contract.js +218 -0
  78. package/dist/domains/managed-work/contract.js.map +1 -0
  79. package/dist/domains/managed-work/i18n.js +12 -0
  80. package/dist/domains/managed-work/i18n.js.map +1 -0
  81. package/dist/domains/managed-work/input.js +111 -0
  82. package/dist/domains/managed-work/input.js.map +1 -0
  83. package/dist/domains/managed-work/journal.js +122 -0
  84. package/dist/domains/managed-work/journal.js.map +1 -0
  85. package/dist/domains/managed-work/lock.js +40 -0
  86. package/dist/domains/managed-work/lock.js.map +1 -0
  87. package/dist/domains/managed-work/notifications.js +53 -0
  88. package/dist/domains/managed-work/notifications.js.map +1 -0
  89. package/dist/domains/managed-work/paths.js +18 -0
  90. package/dist/domains/managed-work/paths.js.map +1 -0
  91. package/dist/domains/managed-work/prompts.js +218 -0
  92. package/dist/domains/managed-work/prompts.js.map +1 -0
  93. package/dist/domains/managed-work/runner.js +626 -0
  94. package/dist/domains/managed-work/runner.js.map +1 -0
  95. package/dist/domains/managed-work/schemas.js +85 -0
  96. package/dist/domains/managed-work/schemas.js.map +1 -0
  97. package/dist/domains/managed-work/service.js +121 -0
  98. package/dist/domains/managed-work/service.js.map +1 -0
  99. package/dist/domains/managed-work/state.js +90 -0
  100. package/dist/domains/managed-work/state.js.map +1 -0
  101. package/dist/domains/managed-work/storage.js +181 -0
  102. package/dist/domains/managed-work/storage.js.map +1 -0
  103. package/dist/domains/managed-work/types.js +16 -0
  104. package/dist/domains/managed-work/types.js.map +1 -0
  105. package/dist/domains/managed-work/wait.js +40 -0
  106. package/dist/domains/managed-work/wait.js.map +1 -0
  107. package/dist/platform/agent-process.js +308 -0
  108. package/dist/platform/agent-process.js.map +1 -0
  109. package/dist/platform/assets.js +9 -0
  110. package/dist/platform/assets.js.map +1 -0
  111. package/dist/platform/process-liveness.js +10 -0
  112. package/dist/platform/process-liveness.js.map +1 -0
  113. package/dist/platform/version-check.js +30 -9
  114. package/dist/platform/version-check.js.map +1 -1
  115. package/package.json +3 -2
  116. package/scripts/release-notes-check.js +102 -0
@@ -24,6 +24,7 @@ VALIDATE="$SCRIPT_DIR/superflow-yaml-validate.sh"
24
24
  CHANGE_DIR="${1:-}"
25
25
  PHASE="${2:-}"
26
26
  MODE="${3:-}"
27
+ CHANGE_DIR_INPUT="${CHANGE_DIR%/}"
27
28
 
28
29
  [[ -n "$CHANGE_DIR" && -n "$PHASE" ]] || {
29
30
  usage
@@ -35,6 +36,25 @@ MODE="${3:-}"
35
36
  CHANGE_DIR="$(cd "$CHANGE_DIR" && pwd)"
36
37
  issues=()
37
38
 
39
+ require_canonical_change_layout() {
40
+ local suffix
41
+
42
+ if [[ -L "$CHANGE_DIR_INPUT" ]]; then
43
+ issues+=("symlinked OpenSpec change directory is forbidden; keep one physical openspec/changes/<change-name> directory")
44
+ fi
45
+
46
+ [[ "$CHANGE_DIR" == */openspec/changes/* ]] || return 0
47
+ suffix="${CHANGE_DIR#*/openspec/changes/}"
48
+ case "$suffix" in
49
+ archive/*|*/embedded-changes/*) return 0 ;;
50
+ esac
51
+ if [[ "$suffix" == */* ]]; then
52
+ issues+=("non-canonical OpenSpec change directory: encode the version in <change-name> and use openspec/changes/<change-name>")
53
+ fi
54
+ }
55
+
56
+ require_canonical_change_layout
57
+
38
58
  require_file() {
39
59
  local path="$1"
40
60
  [[ -f "$CHANGE_DIR/$path" ]] || issues+=("missing file: $path")
@@ -178,6 +198,60 @@ require_state_file() {
178
198
  require_file .sdd/state.yaml
179
199
  }
180
200
 
201
+ require_tasks_complete() {
202
+ local task_count unchecked_count
203
+ require_file tasks.md
204
+ [[ -f "$CHANGE_DIR/tasks.md" ]] || return 0
205
+ task_count="$(grep -Ec '^[[:space:]]*-[[:space:]]+\[[ xX]\]' "$CHANGE_DIR/tasks.md" || true)"
206
+ unchecked_count="$(grep -Ec '^[[:space:]]*-[[:space:]]+\[[[:space:]]\]' "$CHANGE_DIR/tasks.md" || true)"
207
+ [[ "$task_count" -gt 0 ]] || issues+=("tasks.md has no checkbox tasks")
208
+ [[ "$unchecked_count" -eq 0 ]] || issues+=("$unchecked_count unchecked task(s) remain in tasks.md")
209
+ }
210
+
211
+ verification_report_path() {
212
+ local value
213
+ value="$(state_get verification_report)"
214
+ [[ -n "$value" && "$value" != "null" ]] || return 1
215
+ if [[ -f "$CHANGE_DIR/$value" ]]; then
216
+ printf '%s\n' "$CHANGE_DIR/$value"
217
+ return 0
218
+ fi
219
+ if [[ -f "$value" ]]; then
220
+ printf '%s\n' "$value"
221
+ return 0
222
+ fi
223
+ return 1
224
+ }
225
+
226
+ require_closeout_markers() {
227
+ local report="${1:-$CHANGE_DIR/test-report.md}"
228
+ if [[ ! -f "$report" ]]; then
229
+ issues+=("verification report path does not exist: $report")
230
+ return 0
231
+ fi
232
+ if ! grep -Eiq '(Verification Result)[[:space:]:|*-]*(PASS)' "$report"; then
233
+ issues+=("verification result PASS marker not found in verification report")
234
+ fi
235
+ if ! grep -Eiq '(Archive Readiness)[[:space:]:|*-]*(PASS|READY)' "$report"; then
236
+ issues+=("archive readiness PASS marker not found in verification report")
237
+ fi
238
+ }
239
+
240
+ require_branch_handled() {
241
+ local branch_status
242
+ branch_status="$(state_get branch_status)"
243
+ [[ "$branch_status" == "handled" ]] || issues+=("branch_status must be handled before verification closeout")
244
+ }
245
+
246
+ require_full_verification_fingerprint() {
247
+ local report="$CHANGE_DIR/test-report.md"
248
+ [[ "$(state_get verify_mode)" == "full" ]] || return 0
249
+ require_grep 'test environment|staging|sandbox' "$report" "full verification test environment"
250
+ require_grep 'branch|commit|tag|build|image' "$report" "full verification deployment fingerprint"
251
+ require_grep 'https?://|Base URL' "$report" "full verification base URL"
252
+ require_grep 'timestamp|verified[_ -]?at|20[0-9]{2}-[0-9]{2}-[0-9]{2}' "$report" "full verification timestamp"
253
+ }
254
+
181
255
  require_spec_doc() {
182
256
  if [[ -f "$CHANGE_DIR/spec.md" ]]; then
183
257
  return
@@ -248,6 +322,42 @@ change_has_field_status_risk() {
248
322
  "$CHANGE_DIR"/*.md "$CHANGE_DIR"/**/*.md 2>/dev/null
249
323
  }
250
324
 
325
+ change_contract_docs_without_complexity_budget() {
326
+ local path
327
+ for path in proposal.md api.md design.md tests.md spec.md; do
328
+ [[ -f "$CHANGE_DIR/$path" ]] || continue
329
+ sed -E '/New-item counts|Complexity budget/d' "$CHANGE_DIR/$path"
330
+ done
331
+ if [[ -d "$CHANGE_DIR/specs" ]]; then
332
+ find "$CHANGE_DIR/specs" -path '*/spec.md' -type f \
333
+ -exec sed -E '/New-item counts|Complexity budget/d' {} +
334
+ fi
335
+ }
336
+
337
+ change_all_docs_without_complexity_budget() {
338
+ find "$CHANGE_DIR" -maxdepth 2 -name '*.md' -type f \
339
+ -exec sed -E '/New-item counts|Complexity budget/d' {} +
340
+ }
341
+
342
+ change_has_external_config_risk() {
343
+ local content
344
+ content="$(change_contract_docs_without_complexity_budget)"
345
+ grep -Eiq \
346
+ 'third[- ]party|external (platform|tool|integration|system)|SDK|MQ|Kafka|RocketMQ|TDMQ|callback|webhook|payment gateway|cloud service' \
347
+ <<< "$content"
348
+ }
349
+
350
+ change_has_concurrency_idempotency_risk() {
351
+ grep -RIEiq \
352
+ 'concurren|idempoten|race condition|duplicate (request|callback|consumption|delivery)|atomic claim|batch (issue|activate|renew)' \
353
+ "$CHANGE_DIR/proposal.md" \
354
+ "$CHANGE_DIR/api.md" \
355
+ "$CHANGE_DIR/design.md" \
356
+ "$CHANGE_DIR/tests.md" \
357
+ "$CHANGE_DIR/spec.md" \
358
+ "$CHANGE_DIR"/specs/*/spec.md 2>/dev/null
359
+ }
360
+
251
361
  change_has_money_precision_risk() {
252
362
  grep -RIEiq \
253
363
  '(^|[^[:alnum:]_])(amount|fee|fees|price|discount|deduction|refund|payment|invoice|balance|proration|allocation|reconciliation|residual|precision|rounding)([^[:alnum:]_]|$)|revenue sharing|profit sharing|split payment|electricity fee|service fee|package settlement|serviceFee|chargeFee|totalAmount|actualAmount|payAmount|refundAmount|discountAmount|invoiceAmount|balanceAmount' \
@@ -271,9 +381,11 @@ change_has_fx_precision_risk() {
271
381
  }
272
382
 
273
383
  change_has_architecture_boundary_risk() {
274
- grep -RIEiq \
384
+ local content
385
+ content="$(change_all_docs_without_complexity_budget)"
386
+ grep -Eiq \
275
387
  'cross-repo|cross-service|sibling|SDK|MQ|topic|consumer|scheduler|scheduled|device|callback|third[- ]party|mini[- ]program|gateway|adapter|protocol|interconnect|call chain|entry|exit' \
276
- "$CHANGE_DIR"/*.md "$CHANGE_DIR"/**/*.md 2>/dev/null
388
+ <<< "$content"
277
389
  }
278
390
 
279
391
  first_prompt_rel() {
@@ -335,6 +447,33 @@ require_money_precision_contract() {
335
447
  fi
336
448
  }
337
449
 
450
+ require_external_config_contract() {
451
+ local path="$1"
452
+ local label="$2"
453
+ require_grep 'External Integration Configuration And Deployment Contract' "$path" "$label"
454
+ require_grep 'local.*test.*production|local.*staging.*production' "$path" "$label environment matrix"
455
+ require_grep 'provision|injection|IaC|Secret|console' "$path" "$label injection/provisioning"
456
+ require_grep 'provisioning owner|runtime owner|owner.*time' "$path" "$label owner and timing"
457
+ require_grep 'readiness|trace|health' "$path" "$label readiness evidence"
458
+ require_grep 'rollback|disable' "$path" "$label rollback"
459
+ require_grep 'secret|credential' "$path" "$label secret handling"
460
+ require_grep 'not.*hard.?cod|must not.*hard.?cod|do not hard.?code' "$path" "$label no hard-coded external config"
461
+ require_grep 'test.*production|staging.*production' "$path" "$label test-production distinction"
462
+ }
463
+
464
+ require_concurrency_idempotency_contract() {
465
+ local path="$1"
466
+ local label="$2"
467
+ require_grep 'Concurrency And Idempotency Ownership|application.layer atomic claim|atomic claim' "$path" "$label"
468
+ require_grep 'business idempotency key|business key' "$path" "$label business idempotency key"
469
+ require_grep 'application.layer atomic claim|atomic claim' "$path" "$label application-layer atomic claim"
470
+ require_grep 'short transaction|transaction boundary' "$path" "$label short transaction boundary"
471
+ require_grep 'pending|success|failed|state machine' "$path" "$label state machine"
472
+ require_grep 'retry' "$path" "$label retry contract"
473
+ require_grep 'external call|third.party call' "$path" "$label external-call boundary"
474
+ require_grep 'unique index.*not.*default|do not.*default.*unique index' "$path" "$label unique index is not the default"
475
+ }
476
+
338
477
  require_money_precision_evidence() {
339
478
  local path="$1"
340
479
  local label="$2"
@@ -357,6 +496,29 @@ require_money_precision_evidence() {
357
496
  fi
358
497
  }
359
498
 
499
+ require_minimal_design_review() {
500
+ local path="$1"
501
+ local label="$2"
502
+ require_grep 'Minimal Design Review|Complexity Reduction Review' "$path" "$label"
503
+ require_grep 'reuse|existing capability|existing module' "$path" "$label reuse evidence"
504
+ require_grep 'simplest|minimum design|minimal implementation' "$path" "$label simplest implementation"
505
+ require_grep 'removed|rejected|do not add|out of scope' "$path" "$label removed or rejected complexity"
506
+ require_grep 'New-item counts|Complexity budget' "$path" "$label complexity budget"
507
+ require_grep 'table' "$path" "$label table count"
508
+ require_grep 'field' "$path" "$label field count"
509
+ require_grep 'API' "$path" "$label API count"
510
+ require_grep 'service|component' "$path" "$label service/component count"
511
+ require_grep 'cache' "$path" "$label cache count"
512
+ require_grep 'MQ|event|async' "$path" "$label async/event count"
513
+ require_grep 'scheduled job|scheduler' "$path" "$label scheduled-job count"
514
+ require_grep 'compatibility layer' "$path" "$label compatibility-layer count"
515
+ }
516
+
517
+ require_minimal_design_pass() {
518
+ local path="$1"
519
+ require_grep '(Minimal Design Review|Complexity Reduction Review).*PASS|PASS.*(Minimal Design Review|Complexity Reduction Review)' "$path" "complexity reduction review PASS verdict"
520
+ }
521
+
360
522
  transition_event=""
361
523
 
362
524
  if [[ -x "$VALIDATE" && -f "$CHANGE_DIR/.sdd/state.yaml" ]]; then
@@ -386,9 +548,22 @@ case "$PHASE" in
386
548
  require_grep 'RED|red-green|GREEN' tests.md "RED/GREEN test contract"
387
549
  require_grep 'curl|Postman|Newman|pytest|RestAssured|automation command' tests.md "interface automation command"
388
550
  require_grep 'handoff_hash|sdd-context|context package|anti-drift' sdd-quality-gate.md "handoff/context-drift gate"
551
+ workflow="$(state_get workflow)"
552
+ if [[ "$workflow" == "full" ]]; then
553
+ require_minimal_design_review design.md "complexity reduction review"
554
+ require_grep 'Minimal Design Review|Complexity Reduction Review' sdd-quality-gate.md "complexity reduction quality gate"
555
+ require_minimal_design_pass sdd-quality-gate.md
556
+ fi
389
557
  if change_has_money_precision_risk; then
390
558
  require_grep 'Money Precision Boundary' sdd-quality-gate.md "money precision quality gate"
391
559
  fi
560
+ if change_has_external_config_risk; then
561
+ require_external_config_contract api.md "external integration configuration contract"
562
+ require_external_config_contract sdd-quality-gate.md "external integration deployment gate"
563
+ fi
564
+ if change_has_concurrency_idempotency_risk; then
565
+ require_concurrency_idempotency_contract sdd-quality-gate.md "concurrency and idempotency ownership quality gate"
566
+ fi
392
567
  require_markdown_links_valid
393
568
  transition_event="docs-complete"
394
569
  ;;
@@ -410,6 +585,9 @@ case "$PHASE" in
410
585
  require_hash_recorded
411
586
  workflow="$(state_get workflow)"
412
587
  if [[ "$workflow" == "full" ]]; then
588
+ require_minimal_design_review design.md "complexity reduction review"
589
+ require_grep 'Minimal Design Review|Complexity Reduction Review' sdd-quality-gate.md "complexity reduction quality gate"
590
+ require_minimal_design_pass sdd-quality-gate.md
413
591
  require_optional_state_path technical_design "technical_design"
414
592
  technical_design_rel="$(state_get technical_design)"
415
593
  if [[ -n "${technical_design_rel:-}" && "$technical_design_rel" != "null" ]]; then
@@ -421,9 +599,16 @@ case "$PHASE" in
421
599
  if change_has_field_status_risk; then
422
600
  require_grep 'Field And Status Reverse Impact|Field And Status Reverse Impact|write point.*read|read/filter points|derived/sync points' "$technical_design_rel" "field/status reverse impact matrix"
423
601
  fi
602
+ if change_has_external_config_risk; then
603
+ require_external_config_contract "$technical_design_rel" "external integration configuration and deployment contract"
604
+ fi
605
+ if change_has_concurrency_idempotency_risk; then
606
+ require_concurrency_idempotency_contract "$technical_design_rel" "concurrency and idempotency ownership contract"
607
+ fi
424
608
  if change_has_money_precision_risk; then
425
609
  require_money_precision_contract "$technical_design_rel" "money precision boundary"
426
610
  fi
611
+ require_minimal_design_review "$technical_design_rel" "technical design minimal design review"
427
612
  fi
428
613
  fi
429
614
  require_grep 'Superpowers Technical Design Handoff|Superpowers Technical Design|technical_design|source-level HOW' design.md "Superpowers technical design handoff"
@@ -449,6 +634,12 @@ case "$PHASE" in
449
634
  if change_has_field_status_risk; then
450
635
  require_grep 'Field And Status Reverse Impact|Field And Status Reverse Impact|read/filter points|derived/sync points' "$prompt_rel" "prompt field/status reverse impact inheritance"
451
636
  fi
637
+ if change_has_external_config_risk; then
638
+ require_external_config_contract "$prompt_rel" "prompt external integration configuration inheritance"
639
+ fi
640
+ if change_has_concurrency_idempotency_risk; then
641
+ require_concurrency_idempotency_contract "$prompt_rel" "prompt concurrency and idempotency ownership inheritance"
642
+ fi
452
643
  if change_has_money_precision_risk; then
453
644
  require_money_precision_contract "$prompt_rel" "prompt money precision inheritance"
454
645
  fi
@@ -471,6 +662,7 @@ case "$PHASE" in
471
662
  ;;
472
663
  verify)
473
664
  require_state_file
665
+ require_tasks_complete
474
666
  require_file test-report.md
475
667
  require_grep 'RED|failure evidence' test-report.md "RED evidence"
476
668
  require_grep 'GREEN|pass evidence' test-report.md "GREEN evidence"
@@ -480,7 +672,18 @@ case "$PHASE" in
480
672
  if change_has_money_precision_risk; then
481
673
  require_money_precision_evidence test-report.md "money precision runtime evidence"
482
674
  fi
675
+ if change_has_external_config_risk; then
676
+ require_grep 'External Integration Configuration And Deployment Contract' test-report.md "external integration configuration runtime evidence"
677
+ require_grep 'production.*ready|provision.*verified|resource.*exists' test-report.md "external production readiness evidence"
678
+ fi
679
+ if change_has_concurrency_idempotency_risk; then
680
+ require_grep 'Concurrency And Idempotency Ownership|application.layer atomic claim|atomic claim' test-report.md "concurrency and idempotency runtime evidence"
681
+ require_grep 'concurren|duplicate|retry' test-report.md "concurrency duplicate and retry cases"
682
+ fi
483
683
  require_test_report_lint
684
+ require_closeout_markers "$CHANGE_DIR/test-report.md"
685
+ require_branch_handled
686
+ require_full_verification_fingerprint
484
687
  require_markdown_links_valid
485
688
  if [[ "$(state_get verification_report)" == "" || "$(state_get verification_report)" == "null" ]]; then
486
689
  "$STATE" set "$CHANGE_DIR" verification_report test-report.md
@@ -489,11 +692,20 @@ case "$PHASE" in
489
692
  ;;
490
693
  archive)
491
694
  require_state_file
695
+ require_tasks_complete
492
696
  verify_result="$(state_get verify_result)"
493
697
  [[ "$verify_result" == "pass" ]] || issues+=("verify_result must be pass before archive")
494
698
  archived="$(state_get archived)"
495
699
  [[ "$archived" != "true" ]] || issues+=("archived is already true")
496
700
  require_state_value verification_report "verification_report"
701
+ report_path="$(verification_report_path || true)"
702
+ if [[ -z "$report_path" ]]; then
703
+ issues+=("verification_report path does not exist")
704
+ else
705
+ require_closeout_markers "$report_path"
706
+ fi
707
+ require_branch_handled
708
+ require_state_value verified_at "verified_at"
497
709
  transition_event="archived"
498
710
  ;;
499
711
  *)
@@ -111,6 +111,14 @@ Before pass:
111
111
  complement.
112
112
  7. Branch/worktree status is handled and `.sdd/state.yaml` has:
113
113
  `branch_status: handled`.
114
+ 8. Every checkbox in `tasks.md` is checked. A completed implementation with
115
+ stale task documentation is a verification failure, not an archive-time
116
+ cleanup item.
117
+ 9. `test-report.md` ends with the machine-checkable closeout markers
118
+ `Verification Result: PASS` and `Archive Readiness: PASS`. For
119
+ `verify_mode: full`, it also records the test environment,
120
+ branch/commit/build or image fingerprint, Base URL, and verification
121
+ timestamp.
114
122
 
115
123
  Only then run:
116
124