cc-codeconductor 0.4.3 → 1.0.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 +95 -95
- package/dist/cli/errors.d.ts +65 -0
- package/dist/core/compilation/compile-checker.d.ts +51 -0
- package/dist/core/config/codeconductor-config.d.ts +42 -0
- package/dist/core/config/config-loader.d.ts +11 -0
- package/dist/core/filesystem/credential-guard.d.ts +18 -0
- package/dist/core/goal/goal-planner.d.ts +8 -0
- package/dist/core/goal/goal-state.d.ts +15 -0
- package/dist/core/loop/git-stats.d.ts +13 -0
- package/dist/core/loop/loop-engine.d.ts +79 -0
- package/dist/core/memory/episodic-store.d.ts +6 -0
- package/dist/core/memory/operational-state.d.ts +6 -0
- package/dist/core/orchestrator/runtime-orchestrator.d.ts +25 -0
- package/dist/core/planner/product-planner.d.ts +18 -0
- package/dist/core/presets/package-paths.d.ts +4 -0
- package/dist/core/product-graph/graph-store.d.ts +11 -0
- package/dist/core/product-graph/paths.d.ts +18 -0
- package/dist/core/verification/verification-runner.d.ts +57 -0
- package/dist/domain/loop/loop-state.d.ts +74 -0
- package/dist/domain/product/entities.d.ts +11 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +23721 -15064
- package/dist/library.js +2595 -0
- package/dist/utils/result.d.ts +36 -0
- package/dist/validation/schemas.d.ts +3660 -0
- package/package.json +15 -2
- package/policy.yml +12 -11
- package/presets/agy/AGENTS.md +11 -5
- package/presets/agy/gates/pre-commit/GATE.md +136 -0
- package/presets/agy/skills/cc-fix/SKILL.md +2 -2
- package/presets/agy/skills/cc-tdd-cycle/SKILL.md +11 -0
- package/presets/agy/skills/evaluation/SKILL.md +6 -0
- package/presets/agy/skills/openspec/SKILL.md +32 -0
- package/presets/agy/workflows/cc-api-contract.md +12 -0
- package/presets/agy/workflows/cc-ask.md +55 -0
- package/presets/agy/workflows/cc-clarify.md +33 -0
- package/presets/agy/workflows/cc-council.md +31 -7
- package/presets/agy/workflows/cc-db-migration.md +22 -9
- package/presets/agy/workflows/cc-explore.md +37 -0
- package/presets/agy/workflows/cc-feature.md +41 -19
- package/presets/agy/workflows/cc-fix.md +50 -23
- package/presets/agy/workflows/cc-handoff.md +42 -0
- package/presets/agy/workflows/cc-iterative.md +128 -0
- package/presets/agy/workflows/cc-openspec.md +75 -0
- package/presets/agy/workflows/cc-pagespeed.md +12 -0
- package/presets/agy/workflows/cc-prototype.md +39 -0
- package/presets/agy/workflows/cc-refactor.md +12 -0
- package/presets/agy/workflows/cc-review.md +12 -0
- package/presets/agy/workflows/cc-scorecard.md +29 -0
- package/presets/agy/workflows/cc-tdd-cycle.md +24 -0
- package/presets/agy/workflows/cc-test-plan.md +12 -0
- package/presets/agy/workflows/cc-triage.md +35 -0
- package/presets/claude/CLAUDE.md +64 -0
- package/presets/claude/commands/cc/api-contract.md +12 -0
- package/presets/claude/commands/cc/ask.md +55 -0
- package/presets/claude/commands/cc/clarify.md +32 -0
- package/presets/claude/commands/cc/council.md +87 -0
- package/presets/claude/commands/cc/db-migration.md +22 -9
- package/presets/claude/commands/cc/explore.md +36 -0
- package/presets/claude/commands/cc/feature.md +49 -22
- package/presets/claude/commands/cc/fix.md +74 -20
- package/presets/claude/commands/cc/handoff.md +44 -0
- package/presets/claude/commands/cc/iterative.md +132 -0
- package/presets/claude/commands/cc/openspec.md +169 -0
- package/presets/claude/commands/cc/pagespeed.md +12 -0
- package/presets/claude/commands/cc/prototype.md +38 -0
- package/presets/claude/commands/cc/refactor.md +152 -1
- package/presets/claude/commands/cc/review.md +90 -17
- package/presets/claude/commands/cc/scorecard.md +77 -0
- package/presets/claude/commands/cc/tdd-cycle.md +53 -3
- package/presets/claude/commands/cc/test-plan.md +12 -0
- package/presets/claude/commands/cc/triage.md +34 -0
- package/presets/claude/gates/pre-commit/GATE.md +136 -0
- package/presets/claude/settings.json +8 -46
- package/presets/claude/skills/evaluation/SKILL.md +42 -0
- package/presets/claude/skills/openspec/SKILL.md +54 -0
- package/presets/codex/AGENTS.md +62 -5
- package/presets/codex/commands/cc-ask.md +55 -0
- package/presets/codex/gates/pre-commit/GATE.md +136 -0
- package/presets/cursor/.cursorignore +15 -0
- package/presets/cursor/AGENTS.md +504 -0
- package/presets/cursor/agents/architect.md +211 -0
- package/presets/cursor/agents/business-agent.md +44 -0
- package/presets/cursor/agents/complexity-auditor.md +76 -0
- package/presets/cursor/agents/continuous-architect.md +37 -0
- package/presets/cursor/agents/contract-builder.md +75 -0
- package/presets/cursor/agents/docs.md +181 -0
- package/presets/cursor/agents/goal-planner.md +71 -0
- package/presets/cursor/agents/impact-analyst.md +43 -0
- package/presets/cursor/agents/implementer.md +161 -0
- package/presets/cursor/agents/orchestrator.md +377 -0
- package/presets/cursor/agents/repo-explorer.md +100 -0
- package/presets/cursor/agents/reviewer.md +237 -0
- package/presets/cursor/agents/security-reviewer.md +113 -0
- package/presets/cursor/agents/task-coach.md +145 -0
- package/presets/cursor/agents/tester.md +241 -0
- package/presets/cursor/commands/cc/api-contract.md +70 -0
- package/presets/cursor/commands/cc/ask.md +55 -0
- package/presets/cursor/commands/cc/clarify.md +32 -0
- package/presets/cursor/commands/cc/council.md +87 -0
- package/presets/cursor/commands/cc/db-migration.md +71 -0
- package/presets/cursor/commands/cc/explore.md +36 -0
- package/presets/cursor/commands/cc/feature.md +137 -0
- package/presets/cursor/commands/cc/fix.md +148 -0
- package/presets/cursor/commands/cc/handoff.md +41 -0
- package/presets/cursor/commands/cc/iterative.md +133 -0
- package/presets/cursor/commands/cc/openspec.md +159 -0
- package/presets/cursor/commands/cc/pagespeed.md +115 -0
- package/presets/cursor/commands/cc/prototype.md +38 -0
- package/presets/cursor/commands/cc/refactor.md +160 -0
- package/presets/cursor/commands/cc/review.md +149 -0
- package/presets/cursor/commands/cc/scorecard.md +77 -0
- package/presets/cursor/commands/cc/tdd-cycle.md +250 -0
- package/presets/cursor/commands/cc/test-plan.md +150 -0
- package/presets/cursor/commands/cc/triage.md +34 -0
- package/presets/cursor/gates/pre-commit/GATE.md +136 -0
- package/presets/cursor/rules/behavioral-discipline.mdc +14 -0
- package/presets/cursor/rules/context-budget.mdc +12 -0
- package/presets/cursor/rules/orchestration.mdc +12 -0
- package/presets/cursor/rules/yagni-stdlib.mdc +11 -0
- package/presets/cursor/skills/android/SKILL.md +122 -0
- package/presets/cursor/skills/api-versioning/SKILL.md +394 -0
- package/presets/cursor/skills/astro/SKILL.md +322 -0
- package/presets/cursor/skills/auth-token-inspector/SKILL.md +33 -0
- package/presets/cursor/skills/code-review/SKILL.md +208 -0
- package/presets/cursor/skills/conductor-setup/SKILL.md +127 -0
- package/presets/cursor/skills/django-orm/SKILL.md +463 -0
- package/presets/cursor/skills/django-testing/SKILL.md +417 -0
- package/presets/cursor/skills/django-uv/SKILL.md +409 -0
- package/presets/cursor/skills/drizzle-schema-architect/SKILL.md +54 -0
- package/presets/cursor/skills/evaluation/SKILL.md +8 -0
- package/presets/cursor/skills/fastapi-pydantic-strict/SKILL.md +46 -0
- package/presets/cursor/skills/find-skills/SKILL.md +144 -0
- package/presets/cursor/skills/jpa-nplusone-detector/SKILL.md +49 -0
- package/presets/cursor/skills/jpa-postgres/SKILL.md +626 -0
- package/presets/cursor/skills/laravel-specialist/SKILL.md +267 -0
- package/presets/cursor/skills/laravel-specialist/references/eloquent.md +351 -0
- package/presets/cursor/skills/laravel-specialist/references/livewire.md +512 -0
- package/presets/cursor/skills/laravel-specialist/references/queues.md +423 -0
- package/presets/cursor/skills/laravel-specialist/references/routing.md +362 -0
- package/presets/cursor/skills/laravel-specialist/references/testing.md +522 -0
- package/presets/cursor/skills/livewire-alpine-bridge/SKILL.md +39 -0
- package/presets/cursor/skills/multi-agent-orchestration/README.md +144 -0
- package/presets/cursor/skills/multi-agent-orchestration/SKILL.md +579 -0
- package/presets/cursor/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
- package/presets/cursor/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
- package/presets/cursor/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
- package/presets/cursor/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
- package/presets/cursor/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
- package/presets/cursor/skills/nextjs-typescript/SKILL.md +394 -0
- package/presets/cursor/skills/openspec/SKILL.md +52 -0
- package/presets/cursor/skills/pagespeed-insights/SKILL.md +445 -0
- package/presets/cursor/skills/pagespeed-insights/reference.md +50 -0
- package/presets/cursor/skills/pagespeed-perf/SKILL.md +281 -0
- package/presets/cursor/skills/php-pro/SKILL.md +210 -0
- package/presets/cursor/skills/php-pro/references/async-patterns.md +412 -0
- package/presets/cursor/skills/php-pro/references/laravel-patterns.md +377 -0
- package/presets/cursor/skills/php-pro/references/modern-php-features.md +323 -0
- package/presets/cursor/skills/php-pro/references/symfony-patterns.md +466 -0
- package/presets/cursor/skills/php-pro/references/testing-quality.md +466 -0
- package/presets/cursor/skills/python/SKILL.md +613 -0
- package/presets/cursor/skills/python-django-stack/SKILL.md +500 -0
- package/presets/cursor/skills/python-fastapi-stack/SKILL.md +464 -0
- package/presets/cursor/skills/security/SKILL.md +384 -0
- package/presets/cursor/skills/seo-analytics-injector/SKILL.md +44 -0
- package/presets/cursor/skills/spring-auth-auditor/SKILL.md +33 -0
- package/presets/cursor/skills/spring-boot-feature/SKILL.md +566 -0
- package/presets/cursor/skills/spring-boot-kotlin/SKILL.md +408 -0
- package/presets/cursor/skills/spring-boot-testing-strategy/SKILL.md +479 -0
- package/presets/cursor/skills/sqlalchemy/SKILL.md +473 -0
- package/presets/cursor/skills/tailwind-responsive-auditor/SKILL.md +32 -0
- package/presets/cursor/skills/tdd-mutation-tester/SKILL.md +28 -0
- package/presets/cursor/skills/testing-tdd/SKILL.md +592 -0
- package/presets/cursor/skills/workflow-orchestration-patterns/SKILL.md +98 -0
- package/presets/cursor/skills/workflow-orchestration-patterns/references/details.md +223 -0
- package/presets/opencode/agents/architect.md +22 -2
- package/presets/opencode/agents/complexity-auditor.md +16 -0
- package/presets/opencode/agents/contract-builder.md +109 -0
- package/presets/opencode/agents/devil.md +158 -0
- package/presets/opencode/agents/docs.md +19 -2
- package/presets/opencode/agents/goal-planner.md +112 -0
- package/presets/opencode/agents/implementer.md +39 -2
- package/presets/opencode/agents/orchestrator.md +124 -19
- package/presets/opencode/agents/planner.md +61 -0
- package/presets/opencode/agents/repo-explorer.md +15 -0
- package/presets/opencode/agents/reviewer.md +53 -2
- package/presets/opencode/agents/security-reviewer.md +159 -0
- package/presets/opencode/agents/task-coach.md +69 -2
- package/presets/opencode/agents/tester.md +18 -2
- package/presets/opencode/commands/cc-api-contract.md +12 -0
- package/presets/opencode/commands/cc-ask.md +55 -0
- package/presets/opencode/commands/cc-clarify.md +31 -0
- package/presets/opencode/commands/cc-council.md +87 -0
- package/presets/opencode/commands/cc-db-migration.md +22 -9
- package/presets/opencode/commands/cc-explore.md +35 -0
- package/presets/opencode/commands/cc-feature.md +41 -19
- package/presets/opencode/commands/cc-fix.md +50 -23
- package/presets/opencode/commands/cc-handoff.md +40 -0
- package/presets/opencode/commands/cc-iterative.md +127 -0
- package/presets/opencode/commands/cc-openspec.md +74 -0
- package/presets/opencode/commands/cc-pagespeed.md +12 -0
- package/presets/opencode/commands/cc-prototype.md +37 -0
- package/presets/opencode/commands/cc-refactor.md +12 -0
- package/presets/opencode/commands/cc-review.md +12 -0
- package/presets/opencode/commands/cc-scorecard.md +28 -0
- package/presets/opencode/commands/cc-tdd-cycle.md +24 -0
- package/presets/opencode/commands/cc-test-plan.md +12 -0
- package/presets/opencode/commands/cc-triage.md +33 -0
- package/presets/opencode/gates/pre-commit/GATE.md +136 -0
- package/presets/opencode/prompts/v0.1.0/DEPRECATED.md +11 -0
- package/presets/opencode/prompts/v0.2.0/DEPRECATED.md +11 -0
- package/presets/opencode/prompts/v0.3.0/DEPRECATED.md +11 -0
- package/presets/opencode/prompts/v0.4.0/DEPRECATED.md +11 -0
- package/presets/opencode/prompts/v0.5.0/architect.md +222 -0
- package/presets/opencode/prompts/v0.5.0/complexity-auditor.md +91 -0
- package/presets/opencode/prompts/v0.5.0/contract-builder.md +84 -0
- package/presets/opencode/prompts/v0.5.0/docs.md +190 -0
- package/presets/opencode/prompts/v0.5.0/goal-planner.md +80 -0
- package/presets/opencode/prompts/v0.5.0/implementer.md +171 -0
- package/presets/opencode/prompts/v0.5.0/orchestrator.md +388 -0
- package/presets/opencode/prompts/v0.5.0/repo-explorer.md +111 -0
- package/presets/opencode/prompts/v0.5.0/reviewer.md +248 -0
- package/presets/opencode/prompts/v0.5.0/security-reviewer.md +123 -0
- package/presets/opencode/prompts/v0.5.0/task-coach.md +156 -0
- package/presets/opencode/prompts/v0.5.0/tester.md +252 -0
- package/presets/opencode/prompts/v0.6.0/implementer.md +35 -0
- package/presets/opencode/prompts/v0.6.0/planner.md +36 -0
- package/presets/opencode/prompts/v0.6.0/reviewer.md +40 -0
- package/presets/opencode/prompts/v1.0.0/README.md +47 -0
- package/presets/opencode/prompts/v1.0.0/architect.md +259 -0
- package/presets/opencode/prompts/v1.0.0/complexity-auditor.md +116 -0
- package/presets/opencode/prompts/v1.0.0/contract-builder.md +120 -0
- package/presets/opencode/prompts/v1.0.0/devil.md +169 -0
- package/presets/opencode/prompts/v1.0.0/docs.md +229 -0
- package/presets/opencode/prompts/v1.0.0/goal-planner.md +123 -0
- package/presets/opencode/prompts/v1.0.0/implementer.md +228 -0
- package/presets/opencode/prompts/v1.0.0/orchestrator.md +474 -0
- package/presets/opencode/prompts/v1.0.0/planner.md +72 -0
- package/presets/opencode/prompts/v1.0.0/repo-explorer.md +147 -0
- package/presets/opencode/prompts/v1.0.0/reviewer.md +295 -0
- package/presets/opencode/prompts/v1.0.0/security-reviewer.md +170 -0
- package/presets/opencode/prompts/v1.0.0/task-coach.md +235 -0
- package/presets/opencode/prompts/v1.0.0/tester.md +298 -0
- package/presets/opencode/skills/evaluation/SKILL.md +6 -0
- package/presets/opencode/skills/openspec/SKILL.md +50 -0
- package/presets/seo-hotel/settings.json +0 -17
- package/presets/templates/BACKLOG.md +33 -0
- package/presets/templates/execution-profile.yml +6 -0
- package/presets/templates/model-comparison.md +11 -0
- package/presets/templates/regression-checklist.yml +10 -0
- package/src/presets/manifests/agy.yml +2 -2
- package/src/presets/manifests/claude.yml +2 -2
- package/src/presets/manifests/codex.yml +2 -2
- package/src/presets/manifests/cursor.yml +19 -3
- package/src/presets/manifests/gemini.yml +2 -2
- package/src/presets/manifests/opencode.yml +2 -2
- package/src/presets/models/agy.yml +97 -49
- package/src/presets/models/claude.yml +83 -39
- package/src/presets/models/codex.yml +83 -40
- package/src/presets/models/cursor.yml +83 -39
- package/src/presets/models/gemini.yml +83 -39
- package/src/presets/models/opencode.yml +78 -34
package/README.md
CHANGED
|
@@ -13,93 +13,55 @@ contracts, task cards, and risk-based routing.
|
|
|
13
13
|
>
|
|
14
14
|
> ## Current Scope
|
|
15
15
|
>
|
|
16
|
-
>
|
|
16
|
+
> Canonical matrix: [docs/current-status.md](docs/current-status.md).
|
|
17
|
+
> Published package is **0.5.0**. The next documented release is **v1.0.0**
|
|
18
|
+
> (Product OS). This repository: `bun run dev …` (not `npx`) while iterating.
|
|
19
|
+
>
|
|
20
|
+
> Published in 0.5.0:
|
|
17
21
|
>
|
|
18
22
|
> - `npx cc-codeconductor init` — detects project stack, writes
|
|
19
23
|
> `.codeconductor/config.yml`, copies `council.yml` and `policy.yml` into
|
|
20
24
|
> `.codeconductor/presets/`
|
|
21
|
-
> - `npx cc-codeconductor install council --target <opencode|claude|codex|agy|all>`
|
|
22
|
-
>
|
|
23
|
-
>
|
|
24
|
-
> - `npx cc-codeconductor
|
|
25
|
-
>
|
|
26
|
-
>
|
|
27
|
-
> - `npx cc-codeconductor
|
|
28
|
-
> - `npx cc-codeconductor
|
|
29
|
-
>
|
|
30
|
-
>
|
|
31
|
-
>
|
|
32
|
-
> -
|
|
33
|
-
>
|
|
34
|
-
>
|
|
35
|
-
>
|
|
36
|
-
>
|
|
37
|
-
> -
|
|
38
|
-
>
|
|
39
|
-
> -
|
|
40
|
-
> (skills, subagents, commands) for the active or specified target
|
|
41
|
-
> - `npx cc-codeconductor debt-harvest` (alias: `harvest`) — scans source files
|
|
42
|
-
> for `// defer` comments and writes `.codeconductor/debt-ledger.md`
|
|
43
|
-
> - `npx cc-codeconductor goal "<objective>"` (alias: `cc-goal`) — decomposes an
|
|
44
|
-
> objective into a dependency-ordered task graph, writes
|
|
45
|
-
> `.codeconductor/current-goal.yml`
|
|
46
|
-
> - `/cc-pagespeed --url <url>` — audits web performance using the PageSpeed
|
|
47
|
-
> Insights API; applies the 80/20 principle to produce a prioritized report of
|
|
48
|
-
> Core Web Vitals (LCP, TBT, CLS, FCP, TTFB) with framework-specific fixes;
|
|
49
|
-
> requires `PAGESPEED_API_KEY` env var for full CrUX field data (optional but
|
|
50
|
-
> recommended)
|
|
51
|
-
> - `npx cc-codeconductor install preset --target <opencode|claude|codex|agy|all>` —
|
|
52
|
-
> installs the full preset (agents, prompts, skills, commands, settings) for the
|
|
53
|
-
> chosen runner; use `--locale=es` to inject Spanish-aware instructions into
|
|
54
|
-
> agent files, or rely on the locale saved during `init`
|
|
55
|
-
> - **Stack-specific presets (v0.4.0)**: `ts-next-drizzle`, `spring-kotlin-jpa`,
|
|
56
|
-
> `laravel-tall`, `python-data-api` — bundle `architect` + `implementer`
|
|
57
|
-
> contracts tuned to a single framework so `install preset` drops in the right
|
|
58
|
-
> defaults for that stack.
|
|
59
|
-
> - **9 specialized skills (v0.4.0)**: `drizzle-schema-architect`,
|
|
60
|
-
> `tailwind-responsive-auditor`, `seo-analytics-injector`,
|
|
61
|
-
> `jpa-nplusone-detector`, `spring-auth-auditor`, `livewire-alpine-bridge`,
|
|
62
|
-
> `fastapi-pydantic-strict`, `tdd-mutation-tester`, `auth-token-inspector` —
|
|
63
|
-
> loaded automatically by the matching preset.
|
|
64
|
-
> - **Workflow Loop Core (v0.4.0)** — 8-phase pipeline
|
|
65
|
-
> (`intake → structure → design → test → implement → validate → council →
|
|
66
|
-
> compact`) with operational guardrails (wall-clock timeout, max files
|
|
67
|
-
> modified, max lines changed) and human-in-the-loop STOP gates after Design
|
|
68
|
-
> and Council Verdict.
|
|
69
|
-
> - **Council consensus v0.4.0** — agent confidence thresholds
|
|
70
|
-
> (`< 0.6` per-agent or `< 0.7` average escalates) and a `complianceVeto`
|
|
71
|
-
> channel that overrides majority the same way `securityVeto` does.
|
|
72
|
-
> - **Goal orchestration (v0.4.0)** — `goal` planner writes
|
|
73
|
-
> `.codeconductor/current-goal.yml`; the orchestrator delegates tasks in
|
|
74
|
-
> dependency order and blocks dependents when a prerequisite is `blocked`.
|
|
75
|
-
> - **Memory compression + escalation emitter (v0.4.0)** — Phase 5 memory index
|
|
76
|
-
> + token budget hook keeps inter-agent context below the configured budget;
|
|
77
|
-
> the loop controller emits escalation reports when guardrails fire.
|
|
78
|
-
> - **Parallel subagents (v0.4.0)** — risk-based routing policy v0.4.0 enables
|
|
79
|
-
> parallel execution for eligible agent sequences (architect + implementer
|
|
80
|
-
> pattern, council verdict fan-out).
|
|
81
|
-
> - Manual presets for OpenCode, Claude Code, and Codex
|
|
82
|
-
> - Versioned Agent Contracts
|
|
83
|
-
> - Routing Policy documentation
|
|
84
|
-
> - Task Card, Scorecard, and workflow templates
|
|
85
|
-
> - Spring Boot/Kotlin and Python/Django workflow guidance
|
|
25
|
+
> - `npx cc-codeconductor install council --target <opencode|claude|codex|agy|all>`
|
|
26
|
+
> - `npx cc-codeconductor install preset --target <opencode|claude|codex|gemini|cursor|agy|all>`
|
|
27
|
+
> - `npx cc-codeconductor install lsp --target <…>`
|
|
28
|
+
> - `npx cc-codeconductor detect` / `doctor` / `update`
|
|
29
|
+
> - `npx cc-codeconductor seo audit` / `seo llms` (SSRF-guarded fetch)
|
|
30
|
+
> - `npx cc-codeconductor help` / `cc-help`
|
|
31
|
+
> - `npx cc-codeconductor debt-harvest` (alias: `harvest`)
|
|
32
|
+
> - `npx cc-codeconductor ccep …` — CCEP is the canonical consumer workflow loop
|
|
33
|
+
> - `npx cc-codeconductor openspec …` — OpenSpec is a **delivery loop** and the
|
|
34
|
+
> backlog tool (`validate` / `scan` / `plan` / `status` / `next`)
|
|
35
|
+
> - `npx cc-codeconductor scorecard …`
|
|
36
|
+
> - Slash commands after `install preset` — prefer `/cc-iterative`, `/cc-triage`,
|
|
37
|
+
> `/cc-handoff`; `/cc-openspec` runs the OpenSpec loop
|
|
38
|
+
> - `/cc-pagespeed --url <url>` — PageSpeed Insights / Core Web Vitals after
|
|
39
|
+
> `install preset`; `PAGESPEED_API_KEY` is optional but recommended for CrUX
|
|
40
|
+
> field data (see [docs/pagespeed-usage.md](docs/pagespeed-usage.md))
|
|
41
|
+
> - Stack-specific skill selection (`ts-next-drizzle`, `spring-kotlin-jpa`,
|
|
42
|
+
> `laravel-tall`, `python-data-api`)
|
|
43
|
+
> - Council consensus: confidence thresholds + `securityVeto` / `complianceVeto`
|
|
86
44
|
>
|
|
87
|
-
>
|
|
88
|
-
> full v0.4.0 feature breakdown.
|
|
45
|
+
> Documented as **v1.0.0** (in this repo, not in published 0.5.0):
|
|
89
46
|
>
|
|
90
|
-
>
|
|
47
|
+
> - `goal` / `ingest` / `product` / `orchestrate` / `impact` / `verify`
|
|
48
|
+
> - Product graph in `.codeconductor/product-graph.json`
|
|
49
|
+
> - See [docs/v1.0.0-release-notes.md](docs/v1.0.0-release-notes.md)
|
|
50
|
+
>
|
|
51
|
+
> Experimental (library only, not a CLI runtime):
|
|
91
52
|
>
|
|
92
|
-
> -
|
|
93
|
-
>
|
|
94
|
-
>
|
|
95
|
-
> - Safe Merger
|
|
53
|
+
> - `runWorkflowPipeline()` — 8-phase loop in `src/core/pipeline/workflow-loop.ts`
|
|
54
|
+
>
|
|
55
|
+
> What does not exist yet:
|
|
96
56
|
>
|
|
97
|
-
>
|
|
57
|
+
> - Runtime sandbox / OS-level isolation
|
|
58
|
+
> - Policy compiler / uniform target enforcement
|
|
59
|
+
> - Full stack-specific asset pruning
|
|
98
60
|
>
|
|
99
|
-
>
|
|
100
|
-
>
|
|
101
|
-
>
|
|
102
|
-
>
|
|
61
|
+
> Security note: policies are declarative. Agent execution depends on the
|
|
62
|
+
> target runner. `install preset --target cursor` overwrites runner command
|
|
63
|
+
> dirs; maintainer-only stubs (`cc-self-review`, `cc-update-preset-models`)
|
|
64
|
+
> are skipped so this repo can dogfood `install preset`.
|
|
103
65
|
|
|
104
66
|
---
|
|
105
67
|
|
|
@@ -168,7 +130,7 @@ Task Card → Risk Classification → Routing Policy → Conductor Agent → Del
|
|
|
168
130
|
- Provider-agnostic `AgentContract` abstraction with target renderers for Claude, OpenCode, Codex, and Agy
|
|
169
131
|
- Council consensus engine (`councilConsensus()`) for multi-agent governance with majority/unanimous algorithms, security veto, **compliance veto**, and **agent confidence thresholds** (v0.4.0)
|
|
170
132
|
- Phase 5 runtime modules — scoped context injection, TDD history compaction, concise inter-agent messaging, and token budget enforcement in the compile-fix loop
|
|
171
|
-
- **Workflow Loop Core (v0.4.0)** — 8-phase pipeline (`runWorkflowPipeline`) with wall-clock / files-modified / lines-changed guardrails and STOP gates at Design and Council Verdict
|
|
133
|
+
- **Workflow Loop Core (v0.4.0, experimental)** — 8-phase pipeline (`runWorkflowPipeline`) with wall-clock / files-modified / lines-changed guardrails and STOP gates at Design and Council Verdict (library-only; not a shipped CLI runtime)
|
|
172
134
|
- **Stack-specific presets (v0.4.0)** — `ts-next-drizzle`, `spring-kotlin-jpa`, `laravel-tall`, `python-data-api`
|
|
173
135
|
- **9 specialized skills (v0.4.0)** — drizzle-schema-architect, tailwind-responsive-auditor, seo-analytics-injector, jpa-nplusone-detector, spring-auth-auditor, livewire-alpine-bridge, fastapi-pydantic-strict, tdd-mutation-tester, auth-token-inspector
|
|
174
136
|
- **Goal orchestration (v0.4.0)** — `goal` planner + `goal-state` writer feed the orchestrator's dependency-order delegation loop
|
|
@@ -176,6 +138,41 @@ Task Card → Risk Classification → Routing Policy → Conductor Agent → Del
|
|
|
176
138
|
|
|
177
139
|
---
|
|
178
140
|
|
|
141
|
+
## Programmatic API
|
|
142
|
+
|
|
143
|
+
`cc-codeconductor` ships a library entry in addition to the CLI. The `bin`
|
|
144
|
+
commands still resolve to `dist/index.js`. Application code should import the
|
|
145
|
+
package root:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
import {
|
|
149
|
+
LoopEngine,
|
|
150
|
+
runLoop,
|
|
151
|
+
runVerification,
|
|
152
|
+
getNextTask,
|
|
153
|
+
startTask,
|
|
154
|
+
completeTask,
|
|
155
|
+
loopStateMachine,
|
|
156
|
+
createInitialState,
|
|
157
|
+
} from 'cc-codeconductor';
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Exported surface (stable for this minor):
|
|
161
|
+
|
|
162
|
+
- Orchestrator: `getReadyTasks`, `getNextTask`, `startTask`, `completeTask`, `goalTaskToCanonicalCard`, `buildTaskEnvelope`, `formatGoalStatus`
|
|
163
|
+
- Loop engine (TC3): `LoopEngine`, `runLoop`, `runLoopForProject`, `shouldRunAgentLoop`, `formatFeedback`
|
|
164
|
+
- Verification: `runVerification`, `gateTaskCompletion`, `validateEvidenceIds`
|
|
165
|
+
- Zod contracts: everything from `src/validation/schemas.ts`
|
|
166
|
+
- Domain loop: `createInitialState`, `loopStateMachine` and their types
|
|
167
|
+
|
|
168
|
+
`infrastructure/` and `*-internal` modules are not part of the public API.
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
bun run build # CLI → dist/index.js, library → dist/library.js + .d.ts
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
179
176
|
## CLI Usage
|
|
180
177
|
|
|
181
178
|
### Install
|
|
@@ -292,7 +289,12 @@ const next = getPreset('ts-next-drizzle');
|
|
|
292
289
|
```
|
|
293
290
|
|
|
294
291
|
`init` / `detect` identifies the stack from the project and wires the
|
|
295
|
-
matching specialized skills
|
|
292
|
+
matching specialized skills onto the **generic** target workflow when you run
|
|
293
|
+
`install preset`. Full stack-specific asset pruning/replacement (swapping the
|
|
294
|
+
entire agent/command tree for a stack pack) is **not implemented yet** — the
|
|
295
|
+
registry and skill wiring are real; treat claims of a full stack install swap
|
|
296
|
+
as aspirational until that lands.
|
|
297
|
+
|
|
296
298
|
The full set of assets for a stack-specific preset is in
|
|
297
299
|
`presets/<preset-name>/agents/` — copy them manually if you need to apply a
|
|
298
300
|
preset by name.
|
|
@@ -347,17 +349,19 @@ npx cc-codeconductor update --global
|
|
|
347
349
|
|
|
348
350
|
Smart updates all currently installed target presets, council configurations, and skills (from `skills-lock.json`), preserving user edits outside managed blocks. Also validates that `AGENTS.md` and `CLAUDE.md` do not exceed the 40KB size limit.
|
|
349
351
|
|
|
350
|
-
#### `help` —
|
|
352
|
+
#### `help` / `cc-help` — distinct help contracts
|
|
351
353
|
|
|
352
354
|
```bash
|
|
353
|
-
npx cc-codeconductor help #
|
|
354
|
-
npx cc-codeconductor help
|
|
355
|
-
npx cc-codeconductor cc-help #
|
|
356
|
-
npx cc-codeconductor help --
|
|
355
|
+
npx cc-codeconductor help # general CLI usage
|
|
356
|
+
npx cc-codeconductor --help # same general usage text
|
|
357
|
+
npx cc-codeconductor cc-help # preset inventory for active target
|
|
358
|
+
npx cc-codeconductor cc-help --target claude # inventory for a specific target
|
|
359
|
+
npx cc-codeconductor cc-help --output json # machine-readable inventory
|
|
357
360
|
```
|
|
358
361
|
|
|
359
|
-
|
|
360
|
-
|
|
362
|
+
`help` prints the CLI command list. `cc-help` lists skills, subagents,
|
|
363
|
+
commands, and workflows for the active preset (or a specified `--target`).
|
|
364
|
+
Reads inventory from `presets/<target>/` in the project root.
|
|
361
365
|
|
|
362
366
|
#### `debt-harvest` — collect deferred debt items
|
|
363
367
|
|
|
@@ -531,15 +535,11 @@ codeconductor/
|
|
|
531
535
|
|
|
532
536
|
## Roadmap
|
|
533
537
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
| v0.3.0 | Next.js, FastAPI, generic presets, monorepo support |
|
|
538
|
-
| **v0.4.0** | **Workflow Loop Core, stack-specific presets, 9 specialized skills, confidence thresholds + compliance veto in council consensus, goal orchestration, memory compression — shipped** ✅ |
|
|
539
|
-
| v0.5.0 | Scorecard CLI, task outcome tracking, prompt regression |
|
|
540
|
-
| v1.0.0 | Stable contracts, stable routing, documented evaluation |
|
|
538
|
+
Published package: **0.5.0**. The next documented release is **v1.0.0**
|
|
539
|
+
(Product OS). Details: [docs/current-status.md](docs/current-status.md) and
|
|
540
|
+
[docs/v1.0.0-release-notes.md](docs/v1.0.0-release-notes.md).
|
|
541
541
|
|
|
542
|
-
See [ROADMAP.md](ROADMAP.md) for
|
|
542
|
+
See [ROADMAP.md](ROADMAP.md) for historical notes.
|
|
543
543
|
|
|
544
544
|
---
|
|
545
545
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exit codes as per CLI contract
|
|
3
|
+
*/
|
|
4
|
+
export declare const ExitCode: {
|
|
5
|
+
readonly SUCCESS: 0;
|
|
6
|
+
readonly VALIDATION_ERROR: 1;
|
|
7
|
+
readonly UNSAFE_OPERATION: 2;
|
|
8
|
+
readonly UNSUPPORTED_PROJECT: 3;
|
|
9
|
+
readonly CONFIG_CONFLICT: 4;
|
|
10
|
+
readonly CREDENTIAL_LEAK: 5;
|
|
11
|
+
};
|
|
12
|
+
export type ExitCodeType = (typeof ExitCode)[keyof typeof ExitCode];
|
|
13
|
+
/**
|
|
14
|
+
* Base error class for CLI errors
|
|
15
|
+
*/
|
|
16
|
+
export declare class CliError extends Error {
|
|
17
|
+
readonly code: ExitCodeType;
|
|
18
|
+
readonly details?: unknown | undefined;
|
|
19
|
+
constructor(message: string, code: ExitCodeType, details?: unknown | undefined);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validation error - invalid arguments, malformed config, Zod validation failure
|
|
23
|
+
*/
|
|
24
|
+
export declare class ValidationError extends CliError {
|
|
25
|
+
constructor(message: string, details?: unknown);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Unsafe operation - destructive operation without --force, protected path conflict
|
|
29
|
+
*/
|
|
30
|
+
export declare class UnsafeOperationError extends CliError {
|
|
31
|
+
constructor(message: string, details?: unknown);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Unsupported project - project stack not detected or not supported
|
|
35
|
+
*/
|
|
36
|
+
export declare class UnsupportedProjectError extends CliError {
|
|
37
|
+
constructor(message: string, details?: unknown);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Config conflict - existing config conflicts with requested operation
|
|
41
|
+
*/
|
|
42
|
+
export declare class ConfigConflictError extends CliError {
|
|
43
|
+
constructor(message: string, details?: unknown);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Credential leak - content contains secrets or API keys
|
|
47
|
+
*/
|
|
48
|
+
export declare class CredentialGuardError extends CliError {
|
|
49
|
+
readonly matches: ReadonlyArray<{
|
|
50
|
+
filePath: string;
|
|
51
|
+
line: number;
|
|
52
|
+
pattern: string;
|
|
53
|
+
matched: string;
|
|
54
|
+
}>;
|
|
55
|
+
constructor(message: string, matches: ReadonlyArray<{
|
|
56
|
+
filePath: string;
|
|
57
|
+
line: number;
|
|
58
|
+
pattern: string;
|
|
59
|
+
matched: string;
|
|
60
|
+
}>, details?: unknown);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Map error to exit code
|
|
64
|
+
*/
|
|
65
|
+
export declare function getExitCode(error: unknown): ExitCodeType;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile Check — runs a build command via Bun.spawn, captures output,
|
|
3
|
+
* parses errors, and returns structured results for re-injection.
|
|
4
|
+
*/
|
|
5
|
+
export interface CompileError {
|
|
6
|
+
file: string;
|
|
7
|
+
line?: number;
|
|
8
|
+
column?: number;
|
|
9
|
+
code: string;
|
|
10
|
+
message: string;
|
|
11
|
+
raw: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CompileResult {
|
|
14
|
+
success: boolean;
|
|
15
|
+
exitCode: number;
|
|
16
|
+
stdout: string;
|
|
17
|
+
stderr: string;
|
|
18
|
+
errors: CompileError[];
|
|
19
|
+
durationMs: number;
|
|
20
|
+
timedOut: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface CompileCheckOptions {
|
|
23
|
+
/**
|
|
24
|
+
* Shell command to run (string or pre-split args). Default: `tsc --noEmit`.
|
|
25
|
+
* Must be a project-trusted compile command from config, never unsanitized CLI input.
|
|
26
|
+
*/
|
|
27
|
+
command?: string | string[];
|
|
28
|
+
/** Working directory. Default: process.cwd() */
|
|
29
|
+
cwd?: string;
|
|
30
|
+
/** Timeout in milliseconds. Default: 120 000 (2 min) */
|
|
31
|
+
timeoutMs?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Tokenize a shell command string, respecting single and double quotes.
|
|
35
|
+
*
|
|
36
|
+
* Exported so other modules that must spawn configured commands (e.g. the
|
|
37
|
+
* regression checklist) can avoid invoking a shell entirely.
|
|
38
|
+
*/
|
|
39
|
+
export declare function tokenizeCommand(cmd: string): string[];
|
|
40
|
+
export declare function isAllowlistedCompileCommand(command: string | string[]): boolean;
|
|
41
|
+
/** Allowlisted commands that actually run a test suite (`bun test`, `npm test`, …). */
|
|
42
|
+
export declare function isAllowlistedTestCommand(command: string | string[]): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Parse compile stderr output into structured CompileError[].
|
|
45
|
+
* Tries TypeScript format first, then ESLint, then generic.
|
|
46
|
+
*/
|
|
47
|
+
export declare function parseCompileErrors(stderr: string): CompileError[];
|
|
48
|
+
/**
|
|
49
|
+
* Run a compile check via Bun.spawn with configurable timeout.
|
|
50
|
+
*/
|
|
51
|
+
export declare function runCompileCheck(options?: CompileCheckOptions): Promise<CompileResult>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeConductor configuration interface
|
|
3
|
+
*/
|
|
4
|
+
export interface CodeConductorConfig {
|
|
5
|
+
version: string;
|
|
6
|
+
project: {
|
|
7
|
+
name: string;
|
|
8
|
+
profile?: string;
|
|
9
|
+
};
|
|
10
|
+
defaults: {
|
|
11
|
+
target: 'opencode' | 'claude' | 'codex' | 'gemini' | 'cursor' | 'agy';
|
|
12
|
+
overwrite: boolean;
|
|
13
|
+
locale: 'en' | 'es';
|
|
14
|
+
};
|
|
15
|
+
presets: {
|
|
16
|
+
council: {
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
version: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
safety: {
|
|
22
|
+
destructiveCommands: string[];
|
|
23
|
+
secretPatterns: string[];
|
|
24
|
+
compileCheck?: {
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
command?: string;
|
|
27
|
+
timeoutMs?: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
loop?: {
|
|
31
|
+
enabled?: boolean;
|
|
32
|
+
maxIterations?: number;
|
|
33
|
+
maxTokenBudget?: number;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Default configuration.
|
|
38
|
+
* `safety.secretPatterns` references `DEFAULT_SECRET_PATTERNS` from
|
|
39
|
+
* credential-guard.ts so there is a single source of truth for default
|
|
40
|
+
* credential patterns.
|
|
41
|
+
*/
|
|
42
|
+
export declare const DEFAULT_CONFIG: CodeConductorConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ValidationError } from '../../cli/errors';
|
|
2
|
+
import { type Result } from '../../utils/result';
|
|
3
|
+
import type { CodeConductorConfig } from './codeconductor-config';
|
|
4
|
+
/**
|
|
5
|
+
* Load configuration from project root
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadConfig(projectRoot: string): Promise<Result<CodeConductorConfig, ValidationError>>;
|
|
8
|
+
/**
|
|
9
|
+
* Check if config exists
|
|
10
|
+
*/
|
|
11
|
+
export declare function configExists(projectRoot: string): Promise<boolean>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CodeConductorConfig } from '../config/codeconductor-config';
|
|
2
|
+
/**
|
|
3
|
+
* Default keyword patterns. Empty by design: built-in detection is handled by
|
|
4
|
+
* the high-confidence signatures in `safety.ts`, which match provider-specific
|
|
5
|
+
* credential shapes instead of generic keyword assignments. Keyword matching
|
|
6
|
+
* remains available as an opt-in via project `secretPatterns`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_SECRET_PATTERNS: string[];
|
|
9
|
+
/**
|
|
10
|
+
* Load opt-in keyword patterns by merging sources in priority order:
|
|
11
|
+
* 1. CodeConductorConfig.safety.secretPatterns (highest — user/project overrides)
|
|
12
|
+
* 2. policy.yml secretPatterns (declarative policy)
|
|
13
|
+
* 3. DEFAULT_SECRET_PATTERNS (empty — see above)
|
|
14
|
+
*
|
|
15
|
+
* These are additive to the always-on high-confidence signatures.
|
|
16
|
+
* Note: policy.yml loading is async, so this function is async.
|
|
17
|
+
*/
|
|
18
|
+
export declare function loadCredentialPatterns(config?: CodeConductorConfig): Promise<ReadonlyArray<string>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GoalGraphInput } from '../../validation/schemas';
|
|
2
|
+
/**
|
|
3
|
+
* Pure function: objective string → GoalGraph
|
|
4
|
+
*
|
|
5
|
+
* Matches the objective against built-in templates (auth, crud, search,
|
|
6
|
+
* notification, migration) or falls back to a generic 4-task chain.
|
|
7
|
+
*/
|
|
8
|
+
export declare function planGoal(objective: string): GoalGraphInput;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type GoalGraphInput } from '../../validation/schemas';
|
|
2
|
+
import { type Result } from '../../utils/result';
|
|
3
|
+
/**
|
|
4
|
+
* Write a goal graph to .codeconductor/current-goal.yml
|
|
5
|
+
*/
|
|
6
|
+
export declare function writeGoal(projectRoot: string, graph: GoalGraphInput): Promise<Result<void, Error>>;
|
|
7
|
+
/**
|
|
8
|
+
* Load and validate a goal graph from .codeconductor/current-goal.yml
|
|
9
|
+
*/
|
|
10
|
+
export declare function loadGoal(projectRoot: string): Promise<Result<GoalGraphInput, Error>>;
|
|
11
|
+
/**
|
|
12
|
+
* Mark a task as blocked in the goal graph.
|
|
13
|
+
* Loads the graph, finds the task by ID, sets status to 'blocked', and writes back.
|
|
14
|
+
*/
|
|
15
|
+
export declare function markTaskBlocked(projectRoot: string, taskId: string, reason: string): Promise<Result<void, Error>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Shared TTL so loop iterations do not spawn git on every tick. */
|
|
2
|
+
export declare const GIT_STATS_CACHE_TTL_MS = 3000;
|
|
3
|
+
export interface GitChangeStats {
|
|
4
|
+
readonly filesModified: number;
|
|
5
|
+
readonly linesChanged: number;
|
|
6
|
+
}
|
|
7
|
+
export type GitStatsReader = (cwd: string) => Promise<GitChangeStats>;
|
|
8
|
+
export declare function resetGitStatsCache(): void;
|
|
9
|
+
export declare function fetchGitChangeStats(cwd: string): Promise<GitChangeStats>;
|
|
10
|
+
export declare function readGitChangeStats(cwd: string, options?: {
|
|
11
|
+
readonly now?: number;
|
|
12
|
+
readonly fetch?: GitStatsReader;
|
|
13
|
+
}): Promise<GitChangeStats>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type CompileError, type CompileResult } from '../compilation/compile-checker';
|
|
2
|
+
import { type LoopState, type TddState } from '../../domain/loop/loop-state';
|
|
3
|
+
import { type GitStatsReader } from './git-stats';
|
|
4
|
+
import { type Result } from '../../utils/result';
|
|
5
|
+
export interface LoopConfig {
|
|
6
|
+
maxIterations?: number;
|
|
7
|
+
maxTokenBudget?: number;
|
|
8
|
+
buildCommand?: string;
|
|
9
|
+
cwd?: string;
|
|
10
|
+
maxWallClockSeconds?: number;
|
|
11
|
+
maxFilesModified?: number;
|
|
12
|
+
maxLinesChanged?: number;
|
|
13
|
+
gitStats?: GitStatsReader;
|
|
14
|
+
}
|
|
15
|
+
export interface EscalationReport {
|
|
16
|
+
readonly taskTitle: string;
|
|
17
|
+
readonly iterationsAttempted: number;
|
|
18
|
+
readonly errorHistory: readonly (readonly CompileError[])[];
|
|
19
|
+
readonly attemptedFixes: readonly string[];
|
|
20
|
+
readonly originalContext: string;
|
|
21
|
+
readonly recommendedAction: string;
|
|
22
|
+
}
|
|
23
|
+
export interface LoopResult {
|
|
24
|
+
readonly success: boolean;
|
|
25
|
+
readonly iterations: number;
|
|
26
|
+
readonly totalErrors: number;
|
|
27
|
+
readonly finalPhase: LoopState['phase'];
|
|
28
|
+
readonly escalationReport?: EscalationReport;
|
|
29
|
+
readonly errorHistory: readonly (readonly CompileError[])[];
|
|
30
|
+
}
|
|
31
|
+
export type GuardrailHit = {
|
|
32
|
+
readonly kind: 'timeout';
|
|
33
|
+
readonly elapsedSeconds: number;
|
|
34
|
+
readonly limit: number;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: 'files';
|
|
37
|
+
readonly count: number;
|
|
38
|
+
readonly limit: number;
|
|
39
|
+
} | {
|
|
40
|
+
readonly kind: 'lines';
|
|
41
|
+
readonly count: number;
|
|
42
|
+
readonly limit: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Shared wall-clock / git-diff budget checks for compile-fix and the 8-phase pipeline.
|
|
46
|
+
*/
|
|
47
|
+
export declare class LoopEngine {
|
|
48
|
+
private readonly limits;
|
|
49
|
+
readonly startedAt: number;
|
|
50
|
+
constructor(limits: {
|
|
51
|
+
readonly maxWallClockSeconds?: number;
|
|
52
|
+
readonly maxFilesModified?: number;
|
|
53
|
+
readonly maxLinesChanged?: number;
|
|
54
|
+
readonly cwd?: string;
|
|
55
|
+
}, gitStats?: GitStatsReader, startedAt?: number);
|
|
56
|
+
private readonly gitStats;
|
|
57
|
+
evaluate(scope?: 'time' | 'all'): Promise<GuardrailHit | null>;
|
|
58
|
+
}
|
|
59
|
+
export declare function formatFeedback(errors: readonly CompileError[]): string;
|
|
60
|
+
export type GenerateFn = (feedback?: string) => Promise<{
|
|
61
|
+
tokenUsage: number;
|
|
62
|
+
} | void>;
|
|
63
|
+
export type CompileCheckFn = () => Promise<CompileResult>;
|
|
64
|
+
export declare function runLoop(generateFn: GenerateFn, compileCheckFn: CompileCheckFn, config?: LoopConfig, taskTitle?: string, originalTask?: string): Promise<LoopResult>;
|
|
65
|
+
/** implement / test agent phases that must run the compile-fix engine. */
|
|
66
|
+
export declare function shouldRunAgentLoop(type?: string, agentType?: string, phase?: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Apply runner-captured TDD suite evidence to the domain TDD machine.
|
|
69
|
+
* Hand-written evidence files fail closed via `loadTddSuiteEvidence`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function advanceTddPhase(projectRoot: string, taskId: string, state: TddState, evidenceId: string): Promise<Result<{
|
|
72
|
+
state: TddState;
|
|
73
|
+
result: 'CONTINUE' | 'TERMINATE';
|
|
74
|
+
}, Error>>;
|
|
75
|
+
export declare function runLoopForProject(projectRoot: string, options: {
|
|
76
|
+
readonly taskTitle: string;
|
|
77
|
+
readonly allowCompileCheck?: boolean;
|
|
78
|
+
readonly originalTask?: string;
|
|
79
|
+
}): Promise<LoopResult>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ProductEventInput } from '../../validation/schemas';
|
|
2
|
+
import { type Result } from '../../utils/result';
|
|
3
|
+
export declare function appendEvent(projectRoot: string, event: Omit<ProductEventInput, 'id'> & {
|
|
4
|
+
id?: string;
|
|
5
|
+
}): Promise<Result<ProductEventInput, Error>>;
|
|
6
|
+
export declare function listEvents(projectRoot: string, since?: string, type?: ProductEventInput['type']): Promise<Result<ProductEventInput[], Error>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type OperationalStateInput } from '../../validation/schemas';
|
|
2
|
+
import { type Result } from '../../utils/result';
|
|
3
|
+
export declare function loadOperationalState(projectRoot: string): Promise<Result<OperationalStateInput, Error>>;
|
|
4
|
+
export declare function saveOperationalState(projectRoot: string, state: OperationalStateInput): Promise<Result<void, Error>>;
|
|
5
|
+
export declare function setActiveTask(projectRoot: string, taskId: string, agent?: string): Promise<Result<void, Error>>;
|
|
6
|
+
export declare function clearActiveTask(projectRoot: string, taskId: string): Promise<Result<void, Error>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CanonicalTaskCardInput, GoalGraphInput, GoalTaskInput, OperationalStateInput } from '../../validation/schemas';
|
|
2
|
+
import { type Result } from '../../utils/result';
|
|
3
|
+
import type { CommandEnvelopeInput } from '../../validation/schemas';
|
|
4
|
+
/**
|
|
5
|
+
* Undo a task status change and restore the operational state captured before
|
|
6
|
+
* it. Used when a later step fails, so a task is never left half-transitioned.
|
|
7
|
+
* The original failure is returned, annotated when the undo itself fails.
|
|
8
|
+
*/
|
|
9
|
+
export declare function rollbackTaskStatus(projectRoot: string, graph: GoalGraphInput, task: GoalTaskInput, previousStatus: GoalTaskInput['status'], previousState: OperationalStateInput, cause: Error): Promise<Result<never, Error>>;
|
|
10
|
+
export declare function getReadyTasks(graph: GoalGraphInput): GoalTaskInput[];
|
|
11
|
+
export declare function goalTaskToCanonicalCard(task: GoalTaskInput & {
|
|
12
|
+
targetFiles?: string[];
|
|
13
|
+
agentType?: string;
|
|
14
|
+
evidenceRequired?: string[];
|
|
15
|
+
}, objective: string): CanonicalTaskCardInput;
|
|
16
|
+
export declare function buildTaskEnvelope(card: CanonicalTaskCardInput, projectRoot: string, projectName: string): CommandEnvelopeInput;
|
|
17
|
+
export interface OrchestratorNextResult {
|
|
18
|
+
task: CanonicalTaskCardInput;
|
|
19
|
+
envelope: CommandEnvelopeInput;
|
|
20
|
+
readyCount: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function getNextTask(projectRoot: string, projectName: string): Promise<Result<OrchestratorNextResult, Error>>;
|
|
23
|
+
export declare function startTask(projectRoot: string, taskId: string, agent?: string): Promise<Result<void, Error>>;
|
|
24
|
+
export declare function completeTask(projectRoot: string, taskId: string, evidenceIds?: string[]): Promise<Result<void, Error>>;
|
|
25
|
+
export declare function formatGoalStatus(graph: GoalGraphInput): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GoalGraphInput, GoalTaskInput, ProductGraphInput } from '../../validation/schemas';
|
|
2
|
+
export declare function inferEvidenceRequired(task: GoalTaskInput): string[];
|
|
3
|
+
export interface ProductGoalGraph extends GoalGraphInput {
|
|
4
|
+
productEnriched: boolean;
|
|
5
|
+
impactPreview?: {
|
|
6
|
+
components: string[];
|
|
7
|
+
requirements: string[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare function planProductGoal(objective: string, graph?: ProductGraphInput): ProductGoalGraph;
|
|
11
|
+
export declare function enrichGoalWithProduct(graph: GoalGraphInput, productGraph?: ProductGraphInput): GoalGraphInput & {
|
|
12
|
+
enrichedTasks: Array<GoalTaskInput & {
|
|
13
|
+
targetFiles: string[];
|
|
14
|
+
agentType: string;
|
|
15
|
+
evidenceRequired: string[];
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
export declare function scoreTaskPriority(task: GoalTaskInput, graph?: ProductGraphInput): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ProductNodeType } from '../../domain/product/entities';
|
|
2
|
+
import { type ProductGraphInput, type ProductGraphNodeInput, type ProductGraphEdgeInput } from '../../validation/schemas';
|
|
3
|
+
import { type Result } from '../../utils/result';
|
|
4
|
+
export declare function loadGraph(projectRoot: string): Promise<Result<ProductGraphInput, Error>>;
|
|
5
|
+
export declare function saveGraph(projectRoot: string, graph: ProductGraphInput): Promise<Result<void, Error>>;
|
|
6
|
+
export declare function upsertNode(graph: ProductGraphInput, node: ProductGraphNodeInput): ProductGraphInput;
|
|
7
|
+
export declare function linkNodes(graph: ProductGraphInput, edge: ProductGraphEdgeInput): ProductGraphInput;
|
|
8
|
+
export declare function queryNodes(graph: ProductGraphInput, type?: ProductNodeType, textFilter?: string): ProductGraphNodeInput[];
|
|
9
|
+
export declare function findPath(graph: ProductGraphInput, fromId: string, toId: string): string[] | null;
|
|
10
|
+
export declare function countByType(graph: ProductGraphInput): Record<string, number>;
|
|
11
|
+
export declare function getNeighbors(graph: ProductGraphInput, nodeId: string, relation?: ProductGraphEdgeInput['relation']): ProductGraphNodeInput[];
|