@pjmendonca/devflow 1.13.1 → 1.18.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.
- package/.claude/commands/agent.md +1 -1
- package/.claude/commands/bugfix.md +21 -0
- package/.claude/commands/checkpoint.md +0 -1
- package/.claude/commands/collab.md +0 -1
- package/.claude/commands/costs.md +88 -18
- package/.claude/commands/devflow.md +26 -0
- package/.claude/commands/handoff.md +0 -1
- package/.claude/commands/memory.md +0 -1
- package/.claude/commands/pair.md +0 -1
- package/.claude/commands/review.md +27 -0
- package/.claude/commands/route.md +0 -1
- package/.claude/commands/swarm.md +0 -1
- package/.claude/commands/validate.md +55 -0
- package/.claude/hooks/session-notification.sh +44 -0
- package/.claude/hooks/session-startup.sh +427 -0
- package/.claude/hooks/session-stop.sh +38 -0
- package/.claude/hooks/session_tracker.py +272 -0
- package/.claude/settings.json +38 -0
- package/.claude/skills/costs/SKILL.md +156 -0
- package/.claude/skills/validate/SKILL.md +101 -0
- package/CHANGELOG.md +254 -0
- package/README.md +207 -10
- package/bin/devflow-install.js +2 -1
- package/bin/devflow.js +5 -2
- package/lib/constants.js +0 -1
- package/lib/exec-python.js +1 -1
- package/package.json +1 -2
- package/tooling/.automation/.checkpoint_lock +1 -0
- package/tooling/.automation/agents/architect.md +19 -0
- package/tooling/.automation/agents/ba.md +19 -0
- package/tooling/.automation/agents/maintainer.md +19 -0
- package/tooling/.automation/agents/pm.md +19 -0
- package/tooling/.automation/agents/reviewer.md +1 -1
- package/tooling/.automation/agents/writer.md +19 -0
- package/tooling/.automation/benchmarks/benchmark_20251230_100119.json +314 -0
- package/tooling/.automation/benchmarks/benchmark_20251230_100216.json +314 -0
- package/tooling/.automation/costs/config.json +31 -0
- package/tooling/.automation/costs/sessions/2025-12-29_20251229_164128.json +22 -0
- package/tooling/.automation/memory/knowledge/kg_integration-test.json +707 -1
- package/tooling/.automation/memory/knowledge/kg_test-story.json +3273 -2
- package/tooling/.automation/memory/shared/shared_integration-test.json +181 -1
- package/tooling/.automation/memory/shared/shared_test-story.json +721 -1
- package/tooling/.automation/memory/shared/shared_test.json +1254 -0
- package/tooling/.automation/memory/shared/shared_validation-check.json +227 -0
- package/tooling/.automation/overrides/templates/architect/cloud-native.yaml +5 -5
- package/tooling/.automation/overrides/templates/architect/enterprise-architect.yaml +23 -5
- package/tooling/.automation/overrides/templates/architect/pragmatic-minimalist.yaml +24 -6
- package/tooling/.automation/overrides/templates/ba/agile-storyteller.yaml +4 -4
- package/tooling/.automation/overrides/templates/ba/domain-expert.yaml +4 -4
- package/tooling/.automation/overrides/templates/ba/requirements-engineer.yaml +4 -4
- package/tooling/.automation/overrides/templates/dev/performance-engineer.yaml +18 -0
- package/tooling/.automation/overrides/templates/dev/rapid-prototyper.yaml +19 -1
- package/tooling/.automation/overrides/templates/dev/security-focused.yaml +18 -0
- package/tooling/.automation/overrides/templates/dev/user-advocate.yaml +54 -0
- package/tooling/.automation/overrides/templates/maintainer/devops-maintainer.yaml +4 -4
- package/tooling/.automation/overrides/templates/maintainer/legacy-steward.yaml +4 -4
- package/tooling/.automation/overrides/templates/maintainer/oss-maintainer.yaml +4 -4
- package/tooling/.automation/overrides/templates/maintainer/reliability-engineer.yaml +55 -0
- package/tooling/.automation/overrides/templates/pm/agile-pm.yaml +4 -4
- package/tooling/.automation/overrides/templates/pm/hybrid-delivery.yaml +3 -3
- package/tooling/.automation/overrides/templates/pm/traditional-pm.yaml +4 -4
- package/tooling/.automation/overrides/templates/reviewer/quick-sanity.yaml +18 -0
- package/tooling/.automation/overrides/templates/reviewer/thorough-critic.yaml +18 -0
- package/tooling/.automation/overrides/templates/sm/agile-coach.yaml +2 -2
- package/tooling/.automation/overrides/templates/sm/startup-pm.yaml +3 -3
- package/tooling/.automation/overrides/templates/writer/api-documentarian.yaml +5 -5
- package/tooling/.automation/overrides/templates/writer/docs-as-code.yaml +4 -4
- package/tooling/.automation/overrides/templates/writer/user-guide-author.yaml +5 -5
- package/tooling/.automation/validation/history/2025-12-29_val_002a28c1.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_01273bb1.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_03369914.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_07a449ba.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_0df1f0a2.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_10ff3d34.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_110771d7.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_13f3a7f9.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_17ba9d21.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_22247089.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_227ea6a4.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_2335d5ae.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_246824bb.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_28b4b9cd.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_2abd12cc.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_2c801b2f.json +59 -0
- package/tooling/.automation/validation/history/2025-12-29_val_2c8cfa8e.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_2ce76eb0.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_30351948.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_30eb7229.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_34df0e77.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_376e4d6a.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_3a4e8a1a.json +59 -0
- package/tooling/.automation/validation/history/2025-12-29_val_3b77a628.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_3ea4e1cf.json +59 -0
- package/tooling/.automation/validation/history/2025-12-29_val_44aacdb4.json +59 -0
- package/tooling/.automation/validation/history/2025-12-29_val_457ddfa8.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_45af6238.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_4735dba1.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_486b203c.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_49dc56cd.json +59 -0
- package/tooling/.automation/validation/history/2025-12-29_val_4d863d6d.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_5149a808.json +59 -0
- package/tooling/.automation/validation/history/2025-12-29_val_52e0bb43.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_585d6319.json +59 -0
- package/tooling/.automation/validation/history/2025-12-29_val_5b2d859a.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_635a7081.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_64df4905.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_70634cee.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_714553f9.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_7f7bfdbf.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_7faad91d.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_81821f8f.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_8249f3c9.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_8422b50f.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_8446c134.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_879f4e26.json +59 -0
- package/tooling/.automation/validation/history/2025-12-29_val_8b6d5bd7.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_8c5cd787.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_91d20bc7.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_958a12b7.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_95d91108.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_980dbb74.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_9e40c79b.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_9f499b7c.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_9f7c3b57.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_a30d5bd4.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_a6eb09c7.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_a86f7b83.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_ad5347e1.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_b0a5a993.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_bcb0192e.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_bf3c9aaa.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_c461ff88.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_c4f4e258.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_c7f0fa6d.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_c911b0e6.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_cc581964.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_cdd5a33b.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_cfd42495.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_d1c7a4ee.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_d2280d0e.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_d2a6ff69.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_d8c53ab2.json +59 -0
- package/tooling/.automation/validation/history/2025-12-29_val_d9c1247a.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_d9d58569.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_dabb4fd9.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_dd8fe359.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_decdffc9.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_e3a95476.json +59 -0
- package/tooling/.automation/validation/history/2025-12-29_val_e776dfca.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_ea70969f.json +59 -0
- package/tooling/.automation/validation/history/2025-12-29_val_ef41ea95.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_f384f9b1.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_f8adc38c.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_fa40b69e.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_fc538d54.json +41 -0
- package/tooling/.automation/validation/history/2025-12-29_val_fe814665.json +32 -0
- package/tooling/.automation/validation/history/2025-12-29_val_ffea4b12.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_02d001e5.json +59 -0
- package/tooling/.automation/validation/history/2025-12-30_val_0b8966dc.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_15455fbf.json +59 -0
- package/tooling/.automation/validation/history/2025-12-30_val_157e34b9.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_28d1d933.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_3442a52c.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_37f1ce1e.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_4f1d8a93.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_56ff1de3.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_664fd4e2.json +41 -0
- package/tooling/.automation/validation/history/2025-12-30_val_66afb0a7.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_7634663c.json +41 -0
- package/tooling/.automation/validation/history/2025-12-30_val_8ea830c3.json +41 -0
- package/tooling/.automation/validation/history/2025-12-30_val_998957c2.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_a52177db.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_a5b65a63.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_ae391d0e.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_c7895339.json +41 -0
- package/tooling/.automation/validation/history/2025-12-30_val_ca416593.json +41 -0
- package/tooling/.automation/validation/history/2025-12-30_val_cee19422.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_ddd4f4e6.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_f2e1394b.json +32 -0
- package/tooling/.automation/validation/history/2025-12-30_val_f4a7fa06.json +41 -0
- package/tooling/.automation/validation/history/2025-12-30_val_ffea3369.json +32 -0
- package/tooling/.automation/validation-config.yaml +103 -0
- package/tooling/completions/DevflowCompletion.ps1 +21 -21
- package/tooling/completions/_run-story +3 -3
- package/tooling/completions/run-story-completion.bash +8 -8
- package/tooling/docs/DOC-STANDARD.md +14 -14
- package/tooling/docs/templates/migration-spec.md +4 -4
- package/tooling/scripts/context_checkpoint.py +5 -15
- package/tooling/scripts/cost_dashboard.py +610 -13
- package/tooling/scripts/create-persona.py +1 -12
- package/tooling/scripts/create-persona.sh +44 -44
- package/tooling/scripts/lib/__init__.py +12 -1
- package/tooling/scripts/lib/agent_handoff.py +11 -2
- package/tooling/scripts/lib/agent_router.py +31 -10
- package/tooling/scripts/lib/colors.py +106 -0
- package/tooling/scripts/lib/context_monitor.py +766 -0
- package/tooling/scripts/lib/cost_config.py +229 -10
- package/tooling/scripts/lib/cost_display.py +20 -45
- package/tooling/scripts/lib/cost_tracker.py +462 -15
- package/tooling/scripts/lib/currency_converter.py +28 -5
- package/tooling/scripts/lib/pair_programming.py +102 -3
- package/tooling/scripts/lib/personality_system.py +949 -0
- package/tooling/scripts/lib/platform.py +55 -0
- package/tooling/scripts/lib/shared_memory.py +9 -3
- package/tooling/scripts/lib/swarm_orchestrator.py +514 -75
- package/tooling/scripts/lib/validation_loop.py +1014 -0
- package/tooling/scripts/memory_summarize.py +9 -2
- package/tooling/scripts/new-doc.py +2 -9
- package/tooling/scripts/personalize_agent.py +1 -12
- package/tooling/scripts/rollback-migration.sh +60 -60
- package/tooling/scripts/run-collab.ps1 +16 -16
- package/tooling/scripts/run-collab.py +88 -53
- package/tooling/scripts/run-collab.sh +4 -4
- package/tooling/scripts/run-story.py +278 -20
- package/tooling/scripts/run-story.sh +3 -3
- package/tooling/scripts/setup-checkpoint-service.py +2 -9
- package/tooling/scripts/tech-debt-tracker.py +1 -12
- package/tooling/scripts/test_adversarial_swarm.py +452 -0
- package/tooling/scripts/update_version.py +48 -2
- package/tooling/scripts/validate-overrides.py +1 -10
- package/tooling/scripts/validate-overrides.sh +40 -40
- package/tooling/scripts/validate_loop.py +162 -0
- package/tooling/scripts/validate_setup.py +2 -30
- package/.claude/skills/init/SKILL.md +0 -496
- package/bin/devflow-init.js +0 -10
- package/tooling/scripts/init-project-workflow.ps1 +0 -651
- package/tooling/scripts/init-project-workflow.py +0 -70
- package/tooling/scripts/init-project-workflow.sh +0 -746
|
@@ -24,7 +24,6 @@ Usage:
|
|
|
24
24
|
|
|
25
25
|
import re
|
|
26
26
|
import subprocess
|
|
27
|
-
import sys
|
|
28
27
|
from dataclasses import dataclass, field
|
|
29
28
|
from datetime import datetime
|
|
30
29
|
from enum import Enum
|
|
@@ -33,13 +32,67 @@ from typing import Optional
|
|
|
33
32
|
|
|
34
33
|
# Import dependencies
|
|
35
34
|
try:
|
|
35
|
+
from platform import IS_WINDOWS
|
|
36
|
+
|
|
36
37
|
from shared_memory import get_knowledge_graph, get_shared_memory
|
|
37
38
|
except ImportError:
|
|
39
|
+
from lib.platform import IS_WINDOWS
|
|
38
40
|
from lib.shared_memory import get_knowledge_graph, get_shared_memory
|
|
39
41
|
|
|
42
|
+
# Try to import validation loop
|
|
43
|
+
try:
|
|
44
|
+
from validation_loop import (
|
|
45
|
+
INTER_PHASE_GATES,
|
|
46
|
+
LoopContext,
|
|
47
|
+
ValidationLoop,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
HAS_VALIDATION = True
|
|
51
|
+
except ImportError:
|
|
52
|
+
try:
|
|
53
|
+
from lib.validation_loop import (
|
|
54
|
+
INTER_PHASE_GATES,
|
|
55
|
+
LoopContext,
|
|
56
|
+
ValidationLoop,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
HAS_VALIDATION = True
|
|
60
|
+
except ImportError:
|
|
61
|
+
HAS_VALIDATION = False
|
|
62
|
+
|
|
40
63
|
|
|
41
64
|
PROJECT_ROOT = Path(__file__).parent.parent.parent.parent
|
|
42
|
-
CLAUDE_CLI = "claude.cmd" if
|
|
65
|
+
CLAUDE_CLI = "claude.cmd" if IS_WINDOWS else "claude"
|
|
66
|
+
|
|
67
|
+
# Security: Maximum prompt length to prevent resource exhaustion
|
|
68
|
+
MAX_PROMPT_LENGTH = 500_000 # ~500KB
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _sanitize_prompt(prompt: str) -> str:
|
|
72
|
+
"""Sanitize prompt for safe subprocess execution.
|
|
73
|
+
|
|
74
|
+
- Removes null bytes and control characters (except newlines/tabs)
|
|
75
|
+
- Truncates to maximum length
|
|
76
|
+
- Ensures valid UTF-8
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
prompt: Raw prompt string
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
Sanitized prompt safe for subprocess
|
|
83
|
+
"""
|
|
84
|
+
if not prompt:
|
|
85
|
+
return ""
|
|
86
|
+
|
|
87
|
+
# Remove null bytes and control characters (keep newlines, tabs, and printable chars)
|
|
88
|
+
# Keep: \n (10), \t (9), \r (13), and all chars >= 32 (printable ASCII + UTF-8)
|
|
89
|
+
sanitized = "".join(char for char in prompt if char in "\n\t\r" or ord(char) >= 32)
|
|
90
|
+
|
|
91
|
+
# Truncate if too long
|
|
92
|
+
if len(sanitized) > MAX_PROMPT_LENGTH:
|
|
93
|
+
sanitized = sanitized[:MAX_PROMPT_LENGTH] + "\n[TRUNCATED]"
|
|
94
|
+
|
|
95
|
+
return sanitized
|
|
43
96
|
|
|
44
97
|
|
|
45
98
|
class ChunkType(Enum):
|
|
@@ -206,12 +259,14 @@ class PairConfig:
|
|
|
206
259
|
chunk_size_hint: str = "medium" # small, medium, large
|
|
207
260
|
reviewer_model: str = "opus"
|
|
208
261
|
dev_model: str = "opus"
|
|
262
|
+
validation_enabled: bool = True # Enable validation between revisions
|
|
209
263
|
|
|
210
264
|
def to_dict(self) -> dict:
|
|
211
265
|
return {
|
|
212
266
|
"max_revisions_per_chunk": self.max_revisions_per_chunk,
|
|
213
267
|
"timeout_seconds": self.timeout_seconds,
|
|
214
268
|
"auto_apply_fixes": self.auto_apply_fixes,
|
|
269
|
+
"validation_enabled": self.validation_enabled,
|
|
215
270
|
"chunk_size_hint": self.chunk_size_hint,
|
|
216
271
|
"reviewer_model": self.reviewer_model,
|
|
217
272
|
"dev_model": self.dev_model,
|
|
@@ -235,6 +290,20 @@ class PairSession:
|
|
|
235
290
|
self.chunk_counter = 0
|
|
236
291
|
self.exchange_counter = 0
|
|
237
292
|
|
|
293
|
+
# Initialize validation loop if available and enabled
|
|
294
|
+
self.validation_loop = None
|
|
295
|
+
self.validation_context = None
|
|
296
|
+
if HAS_VALIDATION and self.config.validation_enabled:
|
|
297
|
+
self.validation_loop = ValidationLoop(
|
|
298
|
+
gates=INTER_PHASE_GATES,
|
|
299
|
+
config={"auto_fix_enabled": self.config.auto_apply_fixes},
|
|
300
|
+
story_key=story_key,
|
|
301
|
+
)
|
|
302
|
+
self.validation_context = LoopContext(
|
|
303
|
+
story_key=story_key,
|
|
304
|
+
max_iterations=self.config.max_revisions_per_chunk,
|
|
305
|
+
)
|
|
306
|
+
|
|
238
307
|
def _log(self, message: str, agent: str = "SYSTEM"):
|
|
239
308
|
"""Log a message."""
|
|
240
309
|
if self.config.verbose:
|
|
@@ -242,13 +311,40 @@ class PairSession:
|
|
|
242
311
|
emoji = {"DEV": "", "REVIEWER": "", "SYSTEM": ""}.get(agent, "•")
|
|
243
312
|
print(f"[{timestamp}] {emoji} [{agent}] {message}")
|
|
244
313
|
|
|
314
|
+
def _run_revision_validation(self, chunk_id: str, revision_num: int) -> bool:
|
|
315
|
+
"""Run validation between DEV revisions.
|
|
316
|
+
|
|
317
|
+
Args:
|
|
318
|
+
chunk_id: ID of the current chunk
|
|
319
|
+
revision_num: Current revision number
|
|
320
|
+
|
|
321
|
+
Returns:
|
|
322
|
+
True if validation passed
|
|
323
|
+
"""
|
|
324
|
+
if not self.validation_loop or not self.validation_context:
|
|
325
|
+
return True
|
|
326
|
+
|
|
327
|
+
self.validation_context.iteration = revision_num
|
|
328
|
+
self.validation_context.phase = f"chunk_{chunk_id}_revision_{revision_num}"
|
|
329
|
+
|
|
330
|
+
report = self.validation_loop.run_gates(self.validation_context, tier=2)
|
|
331
|
+
|
|
332
|
+
if report.passed:
|
|
333
|
+
self._log(f"[VALIDATION] Revision {revision_num} passed validation")
|
|
334
|
+
return True
|
|
335
|
+
else:
|
|
336
|
+
for failure in report.failures:
|
|
337
|
+
self._log(f"[VALIDATION] {failure.gate_name}: {failure.message}", "SYSTEM")
|
|
338
|
+
return True # Don't block, just inform
|
|
339
|
+
|
|
245
340
|
def _invoke_agent(self, agent: str, prompt: str) -> str:
|
|
246
341
|
"""Invoke an agent with Claude CLI."""
|
|
247
342
|
model = self.config.dev_model if agent == "DEV" else self.config.reviewer_model
|
|
343
|
+
sanitized_prompt = _sanitize_prompt(prompt)
|
|
248
344
|
|
|
249
345
|
try:
|
|
250
346
|
result = subprocess.run(
|
|
251
|
-
[CLAUDE_CLI, "--print", "--model", model, "-p",
|
|
347
|
+
[CLAUDE_CLI, "--print", "--model", model, "-p", sanitized_prompt],
|
|
252
348
|
capture_output=True,
|
|
253
349
|
text=True,
|
|
254
350
|
timeout=self.config.timeout_seconds,
|
|
@@ -510,6 +606,9 @@ Work in small, focused chunks. After each chunk, wait for reviewer feedback.
|
|
|
510
606
|
f"\n\n// Revision: {revised_chunk.description}\n{revised_chunk.content}"
|
|
511
607
|
)
|
|
512
608
|
|
|
609
|
+
# Run validation between revisions
|
|
610
|
+
self._run_revision_validation(chunk.chunk_id, revision_count)
|
|
611
|
+
|
|
513
612
|
# REVIEWER re-reviews
|
|
514
613
|
self._log("Re-reviewing...", "REVIEWER")
|
|
515
614
|
reviewer_prompt = self._build_reviewer_prompt(revised_chunk, accumulated_code)
|