devcouncil 0.1.1 → 0.2.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/README.md +190 -6
- package/package.json +9 -2
- package/pyproject.toml +34 -2
- package/src/devcouncil/app/config.py +167 -5
- package/src/devcouncil/artifacts/graph.py +23 -3
- package/src/devcouncil/assets/__init__.py +1 -0
- package/src/devcouncil/assets/devcouncil-logo.svg +60 -0
- package/src/devcouncil/assets/devcouncil_logo_premium.png +0 -0
- package/src/devcouncil/cli/commands/agents.py +292 -0
- package/src/devcouncil/cli/commands/artifacts.py +6 -3
- package/src/devcouncil/cli/commands/check.py +209 -0
- package/src/devcouncil/cli/commands/config.py +43 -4
- package/src/devcouncil/cli/commands/cost.py +57 -0
- package/src/devcouncil/cli/commands/dashboard.py +6 -1
- package/src/devcouncil/cli/commands/doctor.py +221 -21
- package/src/devcouncil/cli/commands/evidence.py +48 -0
- package/src/devcouncil/cli/commands/go.py +452 -33
- package/src/devcouncil/cli/commands/handoff.py +69 -0
- package/src/devcouncil/cli/commands/hook.py +124 -15
- package/src/devcouncil/cli/commands/init.py +154 -18
- package/src/devcouncil/cli/commands/integrate.py +894 -105
- package/src/devcouncil/cli/commands/map.py +80 -10
- package/src/devcouncil/cli/commands/plan.py +212 -51
- package/src/devcouncil/cli/commands/prompt.py +18 -7
- package/src/devcouncil/cli/commands/repair.py +40 -23
- package/src/devcouncil/cli/commands/report.py +8 -0
- package/src/devcouncil/cli/commands/reset_demo_state.py +4 -2
- package/src/devcouncil/cli/commands/rollback.py +27 -28
- package/src/devcouncil/cli/commands/run.py +69 -49
- package/src/devcouncil/cli/commands/runs.py +223 -0
- package/src/devcouncil/cli/commands/scaffold.py +32 -0
- package/src/devcouncil/cli/commands/semantic.py +47 -0
- package/src/devcouncil/cli/commands/setup.py +145 -6
- package/src/devcouncil/cli/commands/shell.py +73 -0
- package/src/devcouncil/cli/commands/skills.py +88 -0
- package/src/devcouncil/cli/commands/status.py +25 -1
- package/src/devcouncil/cli/commands/trace.py +47 -3
- package/src/devcouncil/cli/commands/verify.py +138 -3
- package/src/devcouncil/cli/commands/watch.py +9 -9
- package/src/devcouncil/cli/commands/watch_fs.py +40 -0
- package/src/devcouncil/cli/main.py +56 -7
- package/src/devcouncil/domain/evidence.py +22 -2
- package/src/devcouncil/domain/gap.py +27 -1
- package/src/devcouncil/domain/task.py +31 -2
- package/src/devcouncil/execution/checkpoints.py +246 -0
- package/src/devcouncil/execution/context_builder.py +1 -1
- package/src/devcouncil/execution/fs_watcher.py +180 -0
- package/src/devcouncil/execution/handoff.py +102 -0
- package/src/devcouncil/execution/hook_policy.py +162 -74
- package/src/devcouncil/execution/patch.py +59 -10
- package/src/devcouncil/execution/permissions.py +17 -24
- package/src/devcouncil/execution/policy_engine.py +343 -0
- package/src/devcouncil/execution/prompt_builder.py +633 -21
- package/src/devcouncil/execution/shell_session.py +225 -0
- package/src/devcouncil/execution/task_runner.py +6 -2
- package/src/devcouncil/executors/agent_registry.py +575 -0
- package/src/devcouncil/executors/coding_cli.py +663 -39
- package/src/devcouncil/executors/native/agent.py +121 -20
- package/src/devcouncil/gating/checks/clean_git.py +3 -1
- package/src/devcouncil/gating/checks/secret_scan_check.py +40 -21
- package/src/devcouncil/gating/policy.py +158 -10
- package/src/devcouncil/hardware.py +184 -0
- package/src/devcouncil/indexing/ast_matcher.py +1 -1
- package/src/devcouncil/indexing/lsp.py +45 -4
- package/src/devcouncil/indexing/repo_mapper.py +1256 -9
- package/src/devcouncil/indexing/semantic_index.py +205 -0
- package/src/devcouncil/integrations/actions.py +146 -0
- package/src/devcouncil/integrations/check.py +423 -0
- package/src/devcouncil/integrations/github_intent.py +142 -0
- package/src/devcouncil/integrations/gitnexus.py +35 -0
- package/src/devcouncil/integrations/mcp/server.py +1552 -29
- package/src/devcouncil/integrations/opencode_devcouncil_plugin.mjs +24 -0
- package/src/devcouncil/live/cards.py +161 -19
- package/src/devcouncil/live/signals.py +2 -2
- package/src/devcouncil/live/transcripts.py +9 -6
- package/src/devcouncil/llm/cache.py +10 -6
- package/src/devcouncil/llm/model_defaults.yaml +44 -0
- package/src/devcouncil/llm/provider.py +515 -34
- package/src/devcouncil/llm/router.py +231 -46
- package/src/devcouncil/optimization/__init__.py +1 -0
- package/src/devcouncil/optimization/gepa_agent.py +318 -0
- package/src/devcouncil/planning/correction_manifest.py +303 -0
- package/src/devcouncil/planning/critique_service.py +7 -2
- package/src/devcouncil/planning/plan_service.py +17 -3
- package/src/devcouncil/planning/prompt_enhancer_service.py +82 -1
- package/src/devcouncil/planning/spec_service.py +27 -1
- package/src/devcouncil/repo/ci_scaffold.py +157 -0
- package/src/devcouncil/repo/gitignore.py +123 -0
- package/src/devcouncil/repo/sca.py +374 -0
- package/src/devcouncil/reporting/json_report.py +11 -1
- package/src/devcouncil/reporting/markdown_report.py +15 -0
- package/src/devcouncil/skills/__init__.py +19 -0
- package/src/devcouncil/skills/library/README.md +46 -0
- package/src/devcouncil/skills/library/ai-training.md +50 -0
- package/src/devcouncil/skills/library/android.md +50 -0
- package/src/devcouncil/skills/library/backend.md +52 -0
- package/src/devcouncil/skills/library/core-engineering.md +95 -0
- package/src/devcouncil/skills/library/data-engineering.md +47 -0
- package/src/devcouncil/skills/library/desktop.md +46 -0
- package/src/devcouncil/skills/library/devops.md +48 -0
- package/src/devcouncil/skills/library/game-dev.md +46 -0
- package/src/devcouncil/skills/library/ios.md +48 -0
- package/src/devcouncil/skills/library/mobile-cross-platform.md +46 -0
- package/src/devcouncil/skills/library/security.md +48 -0
- package/src/devcouncil/skills/library/systems.md +48 -0
- package/src/devcouncil/skills/library/web.md +47 -0
- package/src/devcouncil/skills/library/windows.md +47 -0
- package/src/devcouncil/skills/registry.py +330 -0
- package/src/devcouncil/storage/db.py +83 -2
- package/src/devcouncil/storage/models.py +121 -0
- package/src/devcouncil/storage/native.py +557 -0
- package/src/devcouncil/storage/repositories.py +137 -75
- package/src/devcouncil/telemetry/cost.py +123 -17
- package/src/devcouncil/telemetry/model_pricing.yaml +48 -0
- package/src/devcouncil/telemetry/pricing.py +28 -0
- package/src/devcouncil/telemetry/traces.py +62 -7
- package/src/devcouncil/telemetry/tracker.py +12 -9
- package/src/devcouncil/ui/dashboard.py +324 -23
- package/src/devcouncil/utils/redaction.py +9 -3
- package/src/devcouncil/utils/subprocess_env.py +69 -0
- package/src/devcouncil/verification/acceptance_compiler.py +125 -0
- package/src/devcouncil/verification/ad_hoc_check.py +129 -0
- package/src/devcouncil/verification/diff_coverage.py +353 -0
- package/src/devcouncil/verification/next_actions.py +189 -0
- package/src/devcouncil/verification/sandbox.py +178 -0
- package/src/devcouncil/verification/test_resolver.py +91 -0
- package/src/devcouncil/verification/verifier.py +1065 -47
- package/uv.lock +205 -64
- package/src/devcouncil/indexing/symbol_index.py +0 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
"""Correction manifest generation for repair loops."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import uuid
|
|
7
|
+
from datetime import datetime, timezone
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
from pydantic import BaseModel, Field
|
|
11
|
+
|
|
12
|
+
from devcouncil.app.config import load_config
|
|
13
|
+
from devcouncil.domain.gap import Gap
|
|
14
|
+
from devcouncil.domain.task import Task
|
|
15
|
+
from devcouncil.storage.db import get_db
|
|
16
|
+
from devcouncil.storage.native import CorrectionManifestRepository
|
|
17
|
+
from devcouncil.storage.repositories import EvidenceRepository, GapRepository, TaskRepository
|
|
18
|
+
from devcouncil.utils.redaction import redact_text
|
|
19
|
+
|
|
20
|
+
# Bounds for the prior-attempt context folded into the manifest. These reach the
|
|
21
|
+
# next executor's prompt verbatim, so they must stay small enough not to crowd out
|
|
22
|
+
# the task spec / blow the context window while still carrying the signal the agent
|
|
23
|
+
# needs (what it changed last time, and why verification rejected it).
|
|
24
|
+
_MAX_PRIOR_DIFF_CHARS = 8000
|
|
25
|
+
_MAX_FAILING_OUTPUT_CHARS = 4000
|
|
26
|
+
# Per failed command, how much of the captured stdout/stderr tail to keep. Test
|
|
27
|
+
# runners put the actual assertion/traceback at the end, so we keep the tail.
|
|
28
|
+
_MAX_PER_COMMAND_OUTPUT_CHARS = 1500
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class CorrectionManifest(BaseModel):
|
|
32
|
+
task_id: str
|
|
33
|
+
root_cause: str
|
|
34
|
+
failed_evidence: list[str] = Field(default_factory=list)
|
|
35
|
+
allowed_repair_files: list[str] = Field(default_factory=list)
|
|
36
|
+
forbidden_changes: list[str] = Field(default_factory=list)
|
|
37
|
+
commands_to_rerun: list[str] = Field(default_factory=list)
|
|
38
|
+
prior_failed_attempts: int = 0
|
|
39
|
+
retry_budget: int = 3
|
|
40
|
+
executor_recommendation: str = "manual"
|
|
41
|
+
created_at: str
|
|
42
|
+
# Blocking gaps ordered most-actionable-first (severity, then gap-type priority),
|
|
43
|
+
# so the repair loop is steered at the real defect (a failing test) rather than an
|
|
44
|
+
# arbitrary first gap (e.g. an orphan_diff). The first entry is the root_cause.
|
|
45
|
+
ordered_blocking_gaps: list[str] = Field(default_factory=list)
|
|
46
|
+
# Prior-attempt context (optional, backward-compatible). Without these the repair
|
|
47
|
+
# executor only sees the root_cause text and re-derives the same wrong approach
|
|
48
|
+
# blind. ``prior_diff`` is what the previous attempt actually changed; it lets the
|
|
49
|
+
# agent see (and stop re-applying) its rejected edit. ``failing_output`` is the
|
|
50
|
+
# captured failing test / verification output that explains *why* it was rejected.
|
|
51
|
+
# Both are redacted and size-bounded before being written.
|
|
52
|
+
prior_diff: str = ""
|
|
53
|
+
failing_output: str = ""
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
# Severity ordering: most severe first.
|
|
57
|
+
_SEVERITY_RANK = {"critical": 0, "high": 1, "medium": 2, "low": 3}
|
|
58
|
+
|
|
59
|
+
# Gap-type priority within a severity band. Lower sorts first. Executable-evidence
|
|
60
|
+
# failures (a failing test / unproven acceptance criterion) are the real defect signal
|
|
61
|
+
# and must outrank scope (orphan/dependency) and advisory (review/secret) gaps so the
|
|
62
|
+
# repair loop targets the failing test, not an orphan_diff.
|
|
63
|
+
_GAP_TYPE_PRIORITY = {
|
|
64
|
+
"test_failed": 0,
|
|
65
|
+
"acceptance_criteria_unproven": 1,
|
|
66
|
+
"diff_not_exercised": 1,
|
|
67
|
+
"task_not_implemented": 2,
|
|
68
|
+
"migration_gap": 2,
|
|
69
|
+
"orphan_diff": 3,
|
|
70
|
+
"planned_file_not_changed": 3,
|
|
71
|
+
"dependency_risk": 3,
|
|
72
|
+
"architecture_drift": 4,
|
|
73
|
+
"assumption_violated": 4,
|
|
74
|
+
"security_risk": 5,
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _ordered_blocking_gaps(blocking_gaps: list[Gap]) -> list[Gap]:
|
|
79
|
+
"""Stable-sort blocking gaps by (severity, gap-type priority).
|
|
80
|
+
|
|
81
|
+
``test_failed`` / ``acceptance_*`` gaps come before orphan/dependency before
|
|
82
|
+
review/secret, so the picked root_cause is the failing behavior rather than an
|
|
83
|
+
incidental scope finding. Unknown severities/types sort last (defensive)."""
|
|
84
|
+
return sorted(
|
|
85
|
+
blocking_gaps,
|
|
86
|
+
key=lambda g: (
|
|
87
|
+
_SEVERITY_RANK.get(g.severity, 9),
|
|
88
|
+
_GAP_TYPE_PRIORITY.get(g.gap_type, 9),
|
|
89
|
+
),
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _latest_agent_run(project_root: Path, task_id: str) -> dict | None:
|
|
94
|
+
runs_dir = project_root / ".devcouncil" / "runs"
|
|
95
|
+
if not runs_dir.exists():
|
|
96
|
+
return None
|
|
97
|
+
candidates = sorted(runs_dir.glob("*/agent-run.json"), reverse=True)
|
|
98
|
+
for path in candidates:
|
|
99
|
+
try:
|
|
100
|
+
payload = json.loads(path.read_text(encoding="utf-8"))
|
|
101
|
+
except Exception:
|
|
102
|
+
continue
|
|
103
|
+
if payload.get("task_id") == task_id:
|
|
104
|
+
return payload
|
|
105
|
+
return None
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def _truncate_tail(text: str, limit: int) -> str:
|
|
109
|
+
"""Keep the last ``limit`` chars of ``text`` (the actionable tail of test output),
|
|
110
|
+
prefixing a marker when truncated. Empty/whitespace input returns ""."""
|
|
111
|
+
text = (text or "").strip()
|
|
112
|
+
if len(text) <= limit:
|
|
113
|
+
return text
|
|
114
|
+
return "[devcouncil: output truncated, showing last "f"{limit} chars]\n" + text[-limit:]
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def _truncate_head(text: str, limit: int) -> str:
|
|
118
|
+
"""Keep the first ``limit`` chars of ``text`` (diffs read top-down), with a marker
|
|
119
|
+
when truncated. Empty/whitespace input returns ""."""
|
|
120
|
+
text = (text or "").strip()
|
|
121
|
+
if len(text) <= limit:
|
|
122
|
+
return text
|
|
123
|
+
return text[:limit] + "\n[devcouncil: diff truncated, "f"{len(text) - limit} chars omitted]"
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def _read_text_tail(path: Path, limit: int) -> str:
|
|
127
|
+
"""Best-effort read of a captured stdout/stderr file, keeping its tail. Never raises."""
|
|
128
|
+
try:
|
|
129
|
+
if not path.is_file():
|
|
130
|
+
return ""
|
|
131
|
+
return _truncate_tail(path.read_text(encoding="utf-8", errors="replace"), limit)
|
|
132
|
+
except Exception:
|
|
133
|
+
return ""
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def _collect_prior_diff(project_root: Path, task_id: str) -> str:
|
|
137
|
+
"""The prior attempt's working-tree diff, from the task's ``after`` checkpoint patch.
|
|
138
|
+
|
|
139
|
+
The checkpoint service writes ``<task_id>-after.patch`` after each executor run, so
|
|
140
|
+
this is exactly what the previous attempt changed. Redacted and head-bounded so the
|
|
141
|
+
repair executor can see (and avoid re-applying) its rejected edit without the diff
|
|
142
|
+
swamping the prompt. Returns "" when no patch exists (e.g. first attempt)."""
|
|
143
|
+
patch_path = project_root / ".devcouncil" / "checkpoints" / f"{task_id}-after.patch"
|
|
144
|
+
try:
|
|
145
|
+
if not patch_path.is_file():
|
|
146
|
+
return ""
|
|
147
|
+
raw = patch_path.read_text(encoding="utf-8", errors="replace")
|
|
148
|
+
except Exception:
|
|
149
|
+
return ""
|
|
150
|
+
return _truncate_head(redact_text(raw), _MAX_PRIOR_DIFF_CHARS)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def _collect_failing_output(project_root: Path, failed_results) -> str:
|
|
154
|
+
"""The captured stdout/stderr of the failing verification commands.
|
|
155
|
+
|
|
156
|
+
Folds each failed command's summary plus the tail of its captured stdout/stderr so
|
|
157
|
+
the repair executor sees *why* it was rejected (the actual assertion / traceback),
|
|
158
|
+
not just that a command exited non-zero. Redacted and size-bounded. Returns ""
|
|
159
|
+
when there is nothing useful to show."""
|
|
160
|
+
blocks: list[str] = []
|
|
161
|
+
for result in failed_results:
|
|
162
|
+
parts = [f"$ {result.command} (exit {result.exit_code})"]
|
|
163
|
+
if result.summary and result.summary.strip():
|
|
164
|
+
parts.append(result.summary.strip())
|
|
165
|
+
for label, rel in (("stdout", result.stdout_path), ("stderr", result.stderr_path)):
|
|
166
|
+
if not rel:
|
|
167
|
+
continue
|
|
168
|
+
path = Path(rel)
|
|
169
|
+
if not path.is_absolute():
|
|
170
|
+
path = project_root / rel
|
|
171
|
+
tail = _read_text_tail(path, _MAX_PER_COMMAND_OUTPUT_CHARS)
|
|
172
|
+
if tail:
|
|
173
|
+
parts.append(f"--- {label} ---\n{tail}")
|
|
174
|
+
blocks.append("\n".join(parts))
|
|
175
|
+
if not blocks:
|
|
176
|
+
return ""
|
|
177
|
+
return _truncate_tail(redact_text("\n\n".join(blocks)), _MAX_FAILING_OUTPUT_CHARS)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def build_correction_manifest(
|
|
181
|
+
project_root: Path,
|
|
182
|
+
task: Task,
|
|
183
|
+
blocking_gaps: list[Gap],
|
|
184
|
+
*,
|
|
185
|
+
repair_service=None,
|
|
186
|
+
prior_attempts: int = 0,
|
|
187
|
+
) -> CorrectionManifest:
|
|
188
|
+
config = load_config(project_root)
|
|
189
|
+
failed: list[str] = []
|
|
190
|
+
failed_results: list = []
|
|
191
|
+
db = get_db(project_root)
|
|
192
|
+
if db:
|
|
193
|
+
with db.get_session() as session:
|
|
194
|
+
# Scope failed evidence to THIS task. Scanning every evidence row made a
|
|
195
|
+
# repair for one task chase unrelated failures from another, so the loop
|
|
196
|
+
# never converged on the real defect.
|
|
197
|
+
for result in EvidenceRepository(session).get_command_results_for_task(task.id):
|
|
198
|
+
if result.exit_code != 0:
|
|
199
|
+
failed.append(f"{result.command} (exit {result.exit_code})")
|
|
200
|
+
failed_results.append(result)
|
|
201
|
+
|
|
202
|
+
# Steer the repair at the most actionable failure (a failing test / unproven AC),
|
|
203
|
+
# not an arbitrary first gap such as an orphan_diff.
|
|
204
|
+
ordered_gaps = _ordered_blocking_gaps(blocking_gaps)
|
|
205
|
+
root_cause = ordered_gaps[0].description if ordered_gaps else "Unknown failure"
|
|
206
|
+
manifest = CorrectionManifest(
|
|
207
|
+
task_id=task.id,
|
|
208
|
+
root_cause=root_cause,
|
|
209
|
+
ordered_blocking_gaps=[g.description for g in ordered_gaps],
|
|
210
|
+
failed_evidence=failed,
|
|
211
|
+
allowed_repair_files=[pf.path for pf in task.planned_files],
|
|
212
|
+
forbidden_changes=list(task.forbidden_changes),
|
|
213
|
+
commands_to_rerun=task.expected_tests or task.allowed_commands,
|
|
214
|
+
# The number of repair attempts already made on this task — real, not a
|
|
215
|
+
# hardcoded 0. The agent sees how much of its budget is spent so it knows
|
|
216
|
+
# when to change approach rather than retry the same fix.
|
|
217
|
+
prior_failed_attempts=prior_attempts,
|
|
218
|
+
retry_budget=config.execution.max_repair_attempts,
|
|
219
|
+
executor_recommendation=config.execution.default_executor,
|
|
220
|
+
created_at=datetime.now(timezone.utc).isoformat(),
|
|
221
|
+
# Prior-attempt context so the next executor repairs against what actually
|
|
222
|
+
# happened (its rejected diff + the failing output) instead of re-deriving
|
|
223
|
+
# the same wrong approach blind. Both are redacted and size-bounded.
|
|
224
|
+
prior_diff=_collect_prior_diff(project_root, task.id),
|
|
225
|
+
failing_output=_collect_failing_output(project_root, failed_results),
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
if repair_service is not None:
|
|
229
|
+
try:
|
|
230
|
+
import asyncio
|
|
231
|
+
|
|
232
|
+
plan = asyncio.run(repair_service.generate_repair_plan(blocking_gaps, task.description))
|
|
233
|
+
if plan.suggested_tasks:
|
|
234
|
+
suggested = plan.suggested_tasks[0]
|
|
235
|
+
manifest.root_cause = suggested.description or manifest.root_cause
|
|
236
|
+
# Use the repair plan's concrete scope instead of throwing it away:
|
|
237
|
+
# union its targeted files/tests with the task's so the re-implement
|
|
238
|
+
# step focuses on what actually needs fixing without losing task scope.
|
|
239
|
+
manifest.allowed_repair_files = _union(
|
|
240
|
+
manifest.allowed_repair_files, [pf.path for pf in suggested.planned_files]
|
|
241
|
+
)
|
|
242
|
+
manifest.commands_to_rerun = _union(manifest.commands_to_rerun, suggested.expected_tests)
|
|
243
|
+
except Exception:
|
|
244
|
+
pass
|
|
245
|
+
return manifest
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def _union(base: list[str], extra: list[str]) -> list[str]:
|
|
249
|
+
"""Append items from ``extra`` not already in ``base`` (order-preserving dedupe)."""
|
|
250
|
+
merged = list(base)
|
|
251
|
+
for item in extra:
|
|
252
|
+
if item and item not in merged:
|
|
253
|
+
merged.append(item)
|
|
254
|
+
return merged
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def write_correction_manifest(project_root: Path, task_id: str, *, repair_service=None) -> Path | None:
|
|
258
|
+
db = get_db(project_root)
|
|
259
|
+
if not db:
|
|
260
|
+
return None
|
|
261
|
+
with db.get_session() as session:
|
|
262
|
+
task = TaskRepository(session).get_by_id(task_id)
|
|
263
|
+
if not task:
|
|
264
|
+
return None
|
|
265
|
+
gaps = [g for g in GapRepository(session).get_all() if g.task_id == task_id and g.blocking]
|
|
266
|
+
if not gaps:
|
|
267
|
+
return None
|
|
268
|
+
prior_record = CorrectionManifestRepository(session).latest_for_task(task_id)
|
|
269
|
+
prior_attempts = (prior_record.attempt + 1) if prior_record else 1
|
|
270
|
+
|
|
271
|
+
manifest = build_correction_manifest(
|
|
272
|
+
project_root, task, gaps, repair_service=repair_service, prior_attempts=prior_attempts
|
|
273
|
+
)
|
|
274
|
+
run_id = str(uuid.uuid4())
|
|
275
|
+
run_dir = project_root / ".devcouncil" / "runs" / run_id
|
|
276
|
+
run_dir.mkdir(parents=True, exist_ok=True)
|
|
277
|
+
path = run_dir / "correction-manifest.json"
|
|
278
|
+
path.write_text(manifest.model_dump_json(indent=2), encoding="utf-8")
|
|
279
|
+
|
|
280
|
+
with db.get_session() as session:
|
|
281
|
+
CorrectionManifestRepository(session).save(
|
|
282
|
+
task_id,
|
|
283
|
+
str(path),
|
|
284
|
+
"open",
|
|
285
|
+
run_id=run_id,
|
|
286
|
+
retry_budget=manifest.retry_budget,
|
|
287
|
+
attempt=manifest.prior_failed_attempts,
|
|
288
|
+
)
|
|
289
|
+
return path
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
def load_latest_correction_manifest(project_root: Path, task_id: str) -> CorrectionManifest | None:
|
|
293
|
+
db = get_db(project_root)
|
|
294
|
+
if not db:
|
|
295
|
+
return None
|
|
296
|
+
with db.get_session() as session:
|
|
297
|
+
record = CorrectionManifestRepository(session).latest_for_task(task_id)
|
|
298
|
+
if not record:
|
|
299
|
+
return None
|
|
300
|
+
path = Path(record.manifest_path)
|
|
301
|
+
if not path.exists():
|
|
302
|
+
return None
|
|
303
|
+
return CorrectionManifest.model_validate(json.loads(path.read_text(encoding="utf-8")))
|
|
@@ -39,7 +39,10 @@ Every finding must include a falsifiable_check.
|
|
|
39
39
|
return await self.router.complete_structured(
|
|
40
40
|
role=role,
|
|
41
41
|
messages=messages,
|
|
42
|
-
schema=CritiqueOutput
|
|
42
|
+
schema=CritiqueOutput,
|
|
43
|
+
# Degrade gracefully on weaker models: an un-critiqued plan is still a
|
|
44
|
+
# usable plan, far better than crashing the whole planning run.
|
|
45
|
+
fallback=CritiqueOutput(findings=[]),
|
|
43
46
|
)
|
|
44
47
|
|
|
45
48
|
async def generate_rebuttal(self, role: str, original_plan_json: str, findings_json: str) -> RebuttalOutput:
|
|
@@ -62,5 +65,7 @@ You are the planner who created the original plan. Review the critique findings.
|
|
|
62
65
|
return await self.router.complete_structured(
|
|
63
66
|
role=role,
|
|
64
67
|
messages=messages,
|
|
65
|
-
schema=RebuttalOutput
|
|
68
|
+
schema=RebuttalOutput,
|
|
69
|
+
# No rebuttals means findings stand as-is — a safe, conservative default.
|
|
70
|
+
fallback=RebuttalOutput(rebuttals=[]),
|
|
66
71
|
)
|
|
@@ -23,9 +23,23 @@ Repository Map:
|
|
|
23
23
|
{repo_map_json}
|
|
24
24
|
|
|
25
25
|
Your task is to create a detailed implementation plan.
|
|
26
|
-
- Break down the requirements into atomic implementation tasks
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
- Break down the requirements into atomic implementation tasks, but use the FEWEST
|
|
27
|
+
tasks that cover them — do NOT over-decompose. A small goal (e.g. add one function
|
|
28
|
+
plus its test) is typically one or two tasks, not four.
|
|
29
|
+
- Each file's changes must be OWNED BY A SINGLE TASK. Never create two tasks that both
|
|
30
|
+
create/modify the same file — that causes duplicate or conflicting edits. If work on
|
|
31
|
+
a file spans concerns, keep it in one task or split by FILE, not by sub-edit.
|
|
32
|
+
- For each task, specify which files will be created or modified. Every implementation
|
|
33
|
+
task must declare at least one writable (create/modify) planned file — a task that
|
|
34
|
+
only reads files cannot implement anything.
|
|
35
|
+
- Fill expected_tests with RUNNABLE shell commands (not prose) that exit 0 iff the
|
|
36
|
+
task's acceptance criteria hold and can run immediately after THIS task with no
|
|
37
|
+
missing tools or files. Prove BEHAVIOR with self-contained inline assertions, e.g.
|
|
38
|
+
python -c "import calc; assert calc.add(2,3)==5". Use pytest only on a whole test
|
|
39
|
+
file this or an earlier task creates (python -m pytest tests/test_x.py -q), never a
|
|
40
|
+
::node id. Do NOT assert repository/git state (git status, changed-file sets,
|
|
41
|
+
append-only contents) and do NOT invoke flake8/mypy/ruff/eslint/tsc/npm unless the
|
|
42
|
+
repo is already configured for them.
|
|
29
43
|
- Ensure each task maps back to at least one requirement.
|
|
30
44
|
|
|
31
45
|
Role-specific instructions:
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
1
3
|
from pydantic import BaseModel, Field
|
|
2
4
|
|
|
3
5
|
from devcouncil.llm.router import ModelRouter
|
|
4
6
|
|
|
7
|
+
# Cap how much skill text we feed the enhancer so a repo matching many skills
|
|
8
|
+
# can't blow up the planning prompt. Domain skills are ~50 lines each.
|
|
9
|
+
_MAX_SKILLS_FOR_INTAKE = 4
|
|
10
|
+
_MAX_INTAKE_CHARS = 8000
|
|
11
|
+
|
|
5
12
|
|
|
6
13
|
class PromptEnhancement(BaseModel):
|
|
7
14
|
original_goal: str
|
|
@@ -9,6 +16,12 @@ class PromptEnhancement(BaseModel):
|
|
|
9
16
|
codebase_context: list[str] = Field(default_factory=list)
|
|
10
17
|
debate_focus: list[str] = Field(default_factory=list)
|
|
11
18
|
constraints: list[str] = Field(default_factory=list)
|
|
19
|
+
# Senior-level domain intake folded in from the skills library (android, ios,
|
|
20
|
+
# web, ...). ``applied_skills`` are the matched skill names; ``skills_brief`` is
|
|
21
|
+
# the compact title+description block the council debates with. Both are set
|
|
22
|
+
# deterministically after the model call — the LLM does not populate them.
|
|
23
|
+
applied_skills: list[str] = Field(default_factory=list)
|
|
24
|
+
skills_brief: str = ""
|
|
12
25
|
|
|
13
26
|
def normalized(self, original_goal: str) -> "PromptEnhancement":
|
|
14
27
|
enhanced_goal = self.enhanced_goal.strip() or original_goal
|
|
@@ -41,6 +54,15 @@ class PromptEnhancement(BaseModel):
|
|
|
41
54
|
if self.debate_focus:
|
|
42
55
|
sections.extend(["", "## Debate focus"])
|
|
43
56
|
sections.extend(f"- {item}" for item in self.debate_focus)
|
|
57
|
+
if self.skills_brief:
|
|
58
|
+
sections.extend([
|
|
59
|
+
"",
|
|
60
|
+
"## Domain engineering intake (apply current senior-level practices)",
|
|
61
|
+
"Plan to the *current* state of these domains — recommended libraries, "
|
|
62
|
+
"deprecations to avoid, and the right build/test CLI commands. The coding "
|
|
63
|
+
"agent receives the full skill text; the plan must already assume it.",
|
|
64
|
+
self.skills_brief,
|
|
65
|
+
])
|
|
44
66
|
return "\n".join(sections)
|
|
45
67
|
|
|
46
68
|
|
|
@@ -53,7 +75,12 @@ class PromptEnhancerService:
|
|
|
53
75
|
goal: str,
|
|
54
76
|
repo_map_json: str,
|
|
55
77
|
graph_context_json: str | None = None,
|
|
78
|
+
project_root: Path | None = None,
|
|
56
79
|
) -> PromptEnhancement:
|
|
80
|
+
skills = _select_skills(goal, project_root)
|
|
81
|
+
skills_intake = _full_intake(skills)
|
|
82
|
+
skills_brief = _compact_brief(skills)
|
|
83
|
+
|
|
57
84
|
prompt = f"""
|
|
58
85
|
Original user goal:
|
|
59
86
|
{goal}
|
|
@@ -64,12 +91,19 @@ Repository map:
|
|
|
64
91
|
Code review graph context:
|
|
65
92
|
{graph_context_json or "{}"}
|
|
66
93
|
|
|
94
|
+
Applicable engineering skills (senior-level domain intake for this codebase/goal):
|
|
95
|
+
{skills_intake or "(no domain skills matched; rely on general engineering judgment)"}
|
|
96
|
+
|
|
67
97
|
You are DevCouncil's codebase-specific prompt enhancer.
|
|
68
98
|
Rewrite the user goal into a better planning prompt before it is sent to the council debate.
|
|
69
99
|
|
|
70
100
|
Requirements:
|
|
71
101
|
- Preserve the user's intent exactly; do not add unrelated features.
|
|
72
102
|
- Make the goal specific to the mapped repository architecture, languages, tests, and likely ownership boundaries.
|
|
103
|
+
- Fold the relevant skill intake into the goal and constraints like a senior engineer who
|
|
104
|
+
just briefed themselves: name the *current* recommended libraries/APIs, the deprecated
|
|
105
|
+
ones to avoid, the platform/SDK/toolchain versions to target, and the exact build/test
|
|
106
|
+
CLI commands that will prove the change. Only include skill points relevant to THIS goal.
|
|
73
107
|
- Identify constraints the planners and critics must preserve.
|
|
74
108
|
- Identify debate focus areas that should force useful disagreement between pragmatic and production-readiness plans.
|
|
75
109
|
- Keep the enhanced_goal concise enough to be used as the goal for spec, planning, critique, and arbitration.
|
|
@@ -78,8 +112,55 @@ Requirements:
|
|
|
78
112
|
role="prompt_enhancer",
|
|
79
113
|
messages=[{"role": "user", "content": prompt}],
|
|
80
114
|
schema=PromptEnhancement,
|
|
115
|
+
# If enhancement fails on a weak model, fall back to the raw goal —
|
|
116
|
+
# planning proceeds with the user's original intent unchanged.
|
|
117
|
+
fallback=PromptEnhancement(original_goal=goal, enhanced_goal=goal),
|
|
118
|
+
)
|
|
119
|
+
# Skill provenance is deterministic, not model-decided: stamp it after the call
|
|
120
|
+
# so the artifact/report shows exactly which skills shaped this plan.
|
|
121
|
+
return enhancement.normalized(goal).model_copy(
|
|
122
|
+
update={
|
|
123
|
+
"applied_skills": [skill.name for skill in skills],
|
|
124
|
+
"skills_brief": skills_brief,
|
|
125
|
+
}
|
|
81
126
|
)
|
|
82
|
-
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def _select_skills(goal: str, project_root: Path | None):
|
|
130
|
+
"""Codebase-aware skill selection; never raises (skills are best-effort)."""
|
|
131
|
+
try:
|
|
132
|
+
from devcouncil.skills.registry import select_skills
|
|
133
|
+
|
|
134
|
+
return select_skills(goal=goal, project_root=project_root)
|
|
135
|
+
except Exception:
|
|
136
|
+
return []
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def _full_intake(skills: list) -> str:
|
|
140
|
+
"""Full skill bodies (capped) for the one-shot enhancer call."""
|
|
141
|
+
if not skills:
|
|
142
|
+
return ""
|
|
143
|
+
blocks: list[str] = []
|
|
144
|
+
total = 0
|
|
145
|
+
for skill in skills[:_MAX_SKILLS_FOR_INTAKE]:
|
|
146
|
+
body = (getattr(skill, "body", "") or "").strip()
|
|
147
|
+
if not body:
|
|
148
|
+
continue
|
|
149
|
+
block = f"### Skill: {skill.name}\n{body}"
|
|
150
|
+
total += len(block)
|
|
151
|
+
if total > _MAX_INTAKE_CHARS:
|
|
152
|
+
break
|
|
153
|
+
blocks.append(block)
|
|
154
|
+
return "\n\n".join(blocks).strip()
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def _compact_brief(skills: list) -> str:
|
|
158
|
+
"""One line per skill (name + description) for the council debate prompt."""
|
|
159
|
+
lines = []
|
|
160
|
+
for skill in skills:
|
|
161
|
+
description = (getattr(skill, "description", "") or "").strip()
|
|
162
|
+
lines.append(f"- **{skill.name}** — {description}" if description else f"- **{skill.name}**")
|
|
163
|
+
return "\n".join(lines).strip()
|
|
83
164
|
|
|
84
165
|
|
|
85
166
|
def _clean_items(items: list[str]) -> list[str]:
|
|
@@ -30,7 +30,33 @@ Your task is to draft the initial software specification for this goal.
|
|
|
30
30
|
2. Extract any assumptions you are making about the codebase or architecture.
|
|
31
31
|
3. List any blocking questions that the user must answer before implementation can proceed.
|
|
32
32
|
|
|
33
|
-
Each requirement MUST have clear acceptance criteria with verification methods.
|
|
33
|
+
Each requirement MUST have clear, testable acceptance criteria with verification methods.
|
|
34
|
+
Be RIGOROUS about edge cases — a terse goal hides most of the real requirements.
|
|
35
|
+
For every behavior, add explicit acceptance criteria covering, where applicable:
|
|
36
|
+
- the normal/happy path with concrete example inputs and expected outputs;
|
|
37
|
+
- boundary and degenerate inputs (empty, single element, zero, negative, very large,
|
|
38
|
+
duplicate, already-sorted vs. unsorted, min/max);
|
|
39
|
+
- invalid or malformed inputs and the EXACT expected error behavior (e.g. raises
|
|
40
|
+
ValueError/TypeError) rather than silent or undefined behavior;
|
|
41
|
+
- non-mutation / no-unexpected-side-effects on inputs when the behavior is a pure
|
|
42
|
+
transformation;
|
|
43
|
+
- correct result TYPE (e.g. float vs int) when it matters.
|
|
44
|
+
Prefer several small, individually-verifiable acceptance criteria over one vague one.
|
|
45
|
+
|
|
46
|
+
Acceptance criteria MUST assert observable BEHAVIOR — return values, raised exceptions,
|
|
47
|
+
output, or side effects on supplied data — not repository state or tooling. DevCouncil's
|
|
48
|
+
own gates enforce file scope, clean diffs, and planned-file limits, so do NOT write
|
|
49
|
+
criteria about `git status`/`--porcelain` output, the exact set of changed/created files,
|
|
50
|
+
`git show HEAD` byte/append-only contents, commit shape, or whether flake8/mypy/ruff/
|
|
51
|
+
eslint/tsc/npm pass. Never require a tool the repo is not already configured for. Use the
|
|
52
|
+
`static_check` verification method ONLY for behavior expressible as a runnable assertion
|
|
53
|
+
(an importable function's result or raised exception), never to mean "a linter runs clean"
|
|
54
|
+
or "these files exist". If a criterion genuinely cannot be proven by running code
|
|
55
|
+
(architecture choices, repo scope, "works without extra configuration", subjective
|
|
56
|
+
quality), give it verification_method "manual" — it will be surfaced for human review
|
|
57
|
+
rather than block the automated gate. Prefer rewriting such a criterion as a concrete
|
|
58
|
+
behavioral one whenever possible.
|
|
59
|
+
|
|
34
60
|
Each assumption MUST have a confidence and impact level.
|
|
35
61
|
"""
|
|
36
62
|
messages = [
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"""Scaffold a starter GitHub Actions workflow for a target repository.
|
|
2
|
+
|
|
3
|
+
DevCouncil already knows a project's test/lint/typecheck commands (config.yaml), so
|
|
4
|
+
it can emit a sensible CI starter that runs them. The workflow is a *template* the
|
|
5
|
+
user can adjust; scaffolding never overwrites an existing workflow unless forced.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
from devcouncil.app.config import load_config
|
|
13
|
+
|
|
14
|
+
WORKFLOW_RELPATH = Path(".github") / "workflows" / "devcouncil.yml"
|
|
15
|
+
|
|
16
|
+
_PYTHON_TOOLS = {
|
|
17
|
+
"pytest", "flake8", "ruff", "mypy", "tox", "python", "python3", "uv",
|
|
18
|
+
"poetry", "black", "isort", "pyright",
|
|
19
|
+
}
|
|
20
|
+
_NODE_TOOLS = {
|
|
21
|
+
"npm", "npx", "pnpm", "yarn", "bun", "eslint", "tsc", "jest", "vitest", "node",
|
|
22
|
+
}
|
|
23
|
+
_PYTHON_MARKERS = ("pyproject.toml", "requirements.txt", "setup.py", "setup.cfg", "Pipfile")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def detect_stacks(project_root: Path) -> set[str]:
|
|
27
|
+
"""Best-effort detection of the language stacks present in the repo."""
|
|
28
|
+
stacks: set[str] = set()
|
|
29
|
+
if any((project_root / marker).exists() for marker in _PYTHON_MARKERS):
|
|
30
|
+
stacks.add("python")
|
|
31
|
+
if (project_root / "package.json").exists():
|
|
32
|
+
stacks.add("node")
|
|
33
|
+
return stacks
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _command_stack(command: str) -> str | None:
|
|
37
|
+
tool = command.split()[0] if command.strip() else ""
|
|
38
|
+
if tool in _PYTHON_TOOLS:
|
|
39
|
+
return "python"
|
|
40
|
+
if tool in _NODE_TOOLS:
|
|
41
|
+
return "node"
|
|
42
|
+
return None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _applicable_commands(commands: list[str], stacks: set[str]) -> list[str]:
|
|
46
|
+
"""Keep commands whose tool matches a detected stack; if none detected, keep all."""
|
|
47
|
+
if not stacks:
|
|
48
|
+
return list(commands)
|
|
49
|
+
kept = []
|
|
50
|
+
for command in commands:
|
|
51
|
+
stack = _command_stack(command)
|
|
52
|
+
if stack is None or stack in stacks:
|
|
53
|
+
kept.append(command)
|
|
54
|
+
return kept
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# Optional dependency-audit step per stack. Emitted only when the matching stack is
|
|
58
|
+
# detected, so a Python-only repo never gets an npm audit (and vice versa). These are
|
|
59
|
+
# non-blocking (continue-on-error) starters the user can tighten.
|
|
60
|
+
_AUDIT_STEPS: dict[str, list[str]] = {
|
|
61
|
+
"python": [
|
|
62
|
+
" - name: Dependency audit (pip-audit)",
|
|
63
|
+
" continue-on-error: true",
|
|
64
|
+
" run: pip-audit",
|
|
65
|
+
],
|
|
66
|
+
"node": [
|
|
67
|
+
" - name: Dependency audit (npm audit)",
|
|
68
|
+
" continue-on-error: true",
|
|
69
|
+
" run: npm audit --audit-level=high",
|
|
70
|
+
],
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _add_audit_steps(steps: list[str], stacks: set[str]) -> None:
|
|
75
|
+
"""Append an optional SCA audit step for each detected stack (only)."""
|
|
76
|
+
for stack in sorted(stacks):
|
|
77
|
+
steps.extend(_AUDIT_STEPS.get(stack, []))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _python_version(project_root: Path) -> str:
|
|
81
|
+
version_file = project_root / ".python-version"
|
|
82
|
+
if version_file.exists():
|
|
83
|
+
first = version_file.read_text(encoding="utf-8").strip().splitlines()
|
|
84
|
+
if first and first[0].strip():
|
|
85
|
+
return first[0].strip()
|
|
86
|
+
return "3.12"
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def render_workflow(project_root: Path, default_branch: str = "main") -> str:
|
|
90
|
+
"""Render the workflow YAML text deterministically from config + detected stacks."""
|
|
91
|
+
config = load_config(project_root)
|
|
92
|
+
stacks = detect_stacks(project_root)
|
|
93
|
+
commands = config.commands
|
|
94
|
+
|
|
95
|
+
steps: list[str] = [
|
|
96
|
+
" - name: Checkout",
|
|
97
|
+
" uses: actions/checkout@v4",
|
|
98
|
+
]
|
|
99
|
+
if "python" in stacks:
|
|
100
|
+
steps += [
|
|
101
|
+
" - name: Set up Python",
|
|
102
|
+
" uses: actions/setup-python@v5",
|
|
103
|
+
" with:",
|
|
104
|
+
f' python-version: "{_python_version(project_root)}"',
|
|
105
|
+
]
|
|
106
|
+
if "node" in stacks:
|
|
107
|
+
steps += [
|
|
108
|
+
" - name: Set up Node",
|
|
109
|
+
" uses: actions/setup-node@v4",
|
|
110
|
+
" with:",
|
|
111
|
+
' node-version: "20"',
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
def add_command_steps(label: str, raw_commands: list[str]) -> None:
|
|
115
|
+
for command in _applicable_commands(raw_commands, stacks):
|
|
116
|
+
steps.append(f" - name: {label} ({command.split()[0]})")
|
|
117
|
+
steps.append(f" run: {command}")
|
|
118
|
+
|
|
119
|
+
add_command_steps("Lint", commands.lint)
|
|
120
|
+
add_command_steps("Typecheck", commands.typecheck)
|
|
121
|
+
add_command_steps("Test", commands.test)
|
|
122
|
+
_add_audit_steps(steps, stacks)
|
|
123
|
+
|
|
124
|
+
body = "\n".join(steps)
|
|
125
|
+
return (
|
|
126
|
+
"# Starter CI workflow generated by DevCouncil from .devcouncil/config.yaml.\n"
|
|
127
|
+
"# Adjust the setup steps, dependency install, and commands for your stack.\n"
|
|
128
|
+
"name: DevCouncil CI\n"
|
|
129
|
+
"\n"
|
|
130
|
+
"on:\n"
|
|
131
|
+
" push:\n"
|
|
132
|
+
f' branches: ["{default_branch}"]\n'
|
|
133
|
+
" pull_request:\n"
|
|
134
|
+
f' branches: ["{default_branch}"]\n'
|
|
135
|
+
"\n"
|
|
136
|
+
"jobs:\n"
|
|
137
|
+
" checks:\n"
|
|
138
|
+
" runs-on: ubuntu-latest\n"
|
|
139
|
+
" steps:\n"
|
|
140
|
+
f"{body}\n"
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def scaffold_ci(project_root: Path, force: bool = False) -> Path | None:
|
|
145
|
+
"""Write the starter workflow. Returns the path, or None if one already exists.
|
|
146
|
+
|
|
147
|
+
Does not overwrite an existing ``.github/workflows/devcouncil.yml`` unless
|
|
148
|
+
``force`` is set, so re-running is safe and user edits are preserved.
|
|
149
|
+
"""
|
|
150
|
+
project_root = project_root.resolve()
|
|
151
|
+
target = project_root / WORKFLOW_RELPATH
|
|
152
|
+
if target.exists() and not force:
|
|
153
|
+
return None
|
|
154
|
+
default_branch = load_config(project_root).project.default_branch or "main"
|
|
155
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
156
|
+
target.write_text(render_workflow(project_root, default_branch), encoding="utf-8")
|
|
157
|
+
return target
|