cc-codeconductor 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +22 -7
  2. package/dist/core/compilation/compile-checker.d.ts +3 -2
  3. package/dist/core/goal/goal-state.d.ts +1 -0
  4. package/dist/core/orchestrator/runtime-orchestrator.d.ts +1 -0
  5. package/dist/core/queue/lock.d.ts +3 -0
  6. package/dist/core/verification/rdd-receipt.d.ts +25 -0
  7. package/dist/core/verification/verification-runner.d.ts +27 -2
  8. package/dist/index.js +1501 -782
  9. package/dist/library.js +420 -142
  10. package/dist/validation/schemas.d.ts +65 -26
  11. package/docs/generated/cli.md +8 -0
  12. package/package.json +2 -1
  13. package/presets/agy/AGENTS.md +1 -1
  14. package/presets/agy/scripts/invoke-hook.cjs +43 -24
  15. package/presets/agy/skills/backlog/SKILL.md +1 -1
  16. package/presets/agy/skills/cc-feature/SKILL.md +17 -16
  17. package/presets/agy/skills/cc-fix/SKILL.md +28 -34
  18. package/presets/agy/skills/cc-spec-mutation/SKILL.md +1 -1
  19. package/presets/agy/skills/cc-tdd-cycle/SKILL.md +1 -1
  20. package/presets/agy/skills/evaluation/SKILL.md +1 -1
  21. package/presets/agy/skills/openspec/SKILL.md +10 -6
  22. package/presets/agy/skills/testing-tdd/SKILL.md +3 -3
  23. package/presets/agy/workflows/cc-api-contract.md +1 -1
  24. package/presets/agy/workflows/cc-ask.md +2 -2
  25. package/presets/agy/workflows/cc-council.md +2 -0
  26. package/presets/agy/workflows/cc-db-migration.md +1 -1
  27. package/presets/agy/workflows/cc-feature.md +1 -1
  28. package/presets/agy/workflows/cc-fix.md +1 -1
  29. package/presets/agy/workflows/cc-iterative.md +1 -1
  30. package/presets/agy/workflows/cc-odd.md +2 -2
  31. package/presets/agy/workflows/cc-openspec.md +1 -1
  32. package/presets/agy/workflows/cc-spec-mutation.md +2 -2
  33. package/presets/agy/workflows/cc-tdd-cycle.md +2 -2
  34. package/presets/claude/CLAUDE.md +1 -1
  35. package/presets/claude/commands/cc/api-contract.md +1 -1
  36. package/presets/claude/commands/cc/ask.md +2 -2
  37. package/presets/claude/commands/cc/council.md +2 -83
  38. package/presets/claude/commands/cc/db-migration.md +1 -1
  39. package/presets/claude/commands/cc/feature.md +1 -1
  40. package/presets/claude/commands/cc/fix.md +1 -1
  41. package/presets/claude/commands/cc/iterative.md +1 -1
  42. package/presets/claude/commands/cc/odd.md +2 -2
  43. package/presets/claude/commands/cc/openspec.md +5 -5
  44. package/presets/claude/commands/cc/spec-mutation.md +2 -2
  45. package/presets/claude/commands/cc/tdd-cycle.md +3 -3
  46. package/presets/claude/settings.json +6 -101
  47. package/presets/claude/skills/backlog/SKILL.md +1 -1
  48. package/presets/claude/skills/evaluation/SKILL.md +1 -1
  49. package/presets/claude/skills/openspec/SKILL.md +10 -6
  50. package/presets/claude/skills/testing-tdd/SKILL.md +3 -3
  51. package/presets/codex/AGENTS.md +1 -1
  52. package/presets/codex/commands/cc-ask.md +2 -2
  53. package/presets/codex/skills/backlog/SKILL.md +1 -1
  54. package/presets/codex/skills/cc-api-contract/SKILL.md +1 -1
  55. package/presets/codex/skills/cc-council/SKILL.md +2 -93
  56. package/presets/codex/skills/cc-db-migration/SKILL.md +1 -1
  57. package/presets/codex/skills/cc-feature/SKILL.md +1 -1
  58. package/presets/codex/skills/cc-fix/SKILL.md +1 -1
  59. package/presets/codex/skills/cc-iterative/SKILL.md +1 -1
  60. package/presets/codex/skills/cc-odd/SKILL.md +2 -2
  61. package/presets/codex/skills/cc-openspec/SKILL.md +10 -8
  62. package/presets/codex/skills/cc-spec-mutation/SKILL.md +2 -2
  63. package/presets/codex/skills/cc-tdd-cycle/SKILL.md +2 -2
  64. package/presets/codex/skills/django-testing/SKILL.md +1 -1
  65. package/presets/codex/skills/evaluation/SKILL.md +1 -1
  66. package/presets/codex/skills/openspec/SKILL.md +10 -6
  67. package/presets/codex/skills/python-django-stack/SKILL.md +1 -1
  68. package/presets/codex/skills/testing-tdd/SKILL.md +3 -3
  69. package/presets/cursor/AGENTS.md +1 -1
  70. package/presets/cursor/commands/cc/api-contract.md +1 -1
  71. package/presets/cursor/commands/cc/ask.md +2 -2
  72. package/presets/cursor/commands/cc/council.md +2 -83
  73. package/presets/cursor/commands/cc/db-migration.md +1 -1
  74. package/presets/cursor/commands/cc/feature.md +1 -1
  75. package/presets/cursor/commands/cc/fix.md +1 -1
  76. package/presets/cursor/commands/cc/iterative.md +1 -1
  77. package/presets/cursor/commands/cc/odd.md +2 -2
  78. package/presets/cursor/commands/cc/openspec.md +10 -8
  79. package/presets/cursor/commands/cc/spec-mutation.md +2 -2
  80. package/presets/cursor/commands/cc/tdd-cycle.md +2 -2
  81. package/presets/cursor/skills/backlog/SKILL.md +1 -1
  82. package/presets/cursor/skills/evaluation/SKILL.md +1 -1
  83. package/presets/cursor/skills/openspec/SKILL.md +10 -6
  84. package/presets/cursor/skills/testing-tdd/SKILL.md +3 -3
  85. package/presets/gemini/GEMINI.md +1 -1
  86. package/presets/gemini/commands/cc/api-contract.toml +1 -1
  87. package/presets/gemini/commands/cc/ask.toml +2 -2
  88. package/presets/gemini/commands/cc/council.toml +2 -83
  89. package/presets/gemini/commands/cc/db-migration.toml +1 -1
  90. package/presets/gemini/commands/cc/feature.toml +1 -1
  91. package/presets/gemini/commands/cc/fix.toml +1 -1
  92. package/presets/gemini/commands/cc/iterative.toml +1 -1
  93. package/presets/gemini/commands/cc/odd.toml +2 -2
  94. package/presets/gemini/commands/cc/openspec.toml +10 -8
  95. package/presets/gemini/commands/cc/spec-mutation.toml +2 -2
  96. package/presets/gemini/commands/cc/tdd-cycle.toml +2 -2
  97. package/presets/muse/AGENTS.md +1 -1
  98. package/presets/opencode/agents/implementer.md +1 -1
  99. package/presets/opencode/agents/tester.md +1 -1
  100. package/presets/opencode/commands/cc-api-contract.md +1 -1
  101. package/presets/opencode/commands/cc-ask.md +2 -2
  102. package/presets/opencode/commands/cc-council.md +2 -83
  103. package/presets/opencode/commands/cc-db-migration.md +1 -1
  104. package/presets/opencode/commands/cc-feature.md +1 -1
  105. package/presets/opencode/commands/cc-fix.md +1 -1
  106. package/presets/opencode/commands/cc-iterative.md +1 -1
  107. package/presets/opencode/commands/cc-odd.md +2 -2
  108. package/presets/opencode/commands/cc-openspec.md +2 -2
  109. package/presets/opencode/commands/cc-spec-mutation.md +2 -2
  110. package/presets/opencode/commands/cc-tdd-cycle.md +2 -2
  111. package/presets/opencode/prompts/v1.0.0/implementer.md +1 -1
  112. package/presets/opencode/prompts/v1.0.0/tester.md +1 -1
  113. package/presets/opencode/skills/backlog/SKILL.md +1 -1
  114. package/presets/opencode/skills/django-testing/SKILL.md +1 -0
  115. package/presets/opencode/skills/evaluation/SKILL.md +1 -1
  116. package/presets/opencode/skills/openspec/SKILL.md +10 -6
  117. package/presets/opencode/skills/python-django-stack/SKILL.md +1 -0
  118. package/presets/opencode/skills/python-fastapi-stack/SKILL.md +1 -0
  119. package/presets/opencode/skills/spring-boot-kotlin/SKILL.md +1 -0
  120. package/presets/opencode/skills/sqlalchemy/SKILL.md +1 -0
  121. package/presets/opencode/skills/testing-tdd/SKILL.md +3 -3
  122. package/presets/pi/AGENTS.md +1 -1
  123. package/presets/shared/invoke-hook.cjs +43 -24
  124. package/src/presets/manifests/claude.yml +1 -1
  125. package/src/presets/shared-skills.yml +30 -0
  126. package/src/presets/targets/pi.yml +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Stop prompting. Start orchestrating.**
4
4
 
5
- [![Socket Badge](https://badge.socket.dev/npm/package/cc-codeconductor/1.6.0)](https://badge.socket.dev/npm/package/cc-codeconductor/1.6.0)
5
+ [![Socket Badge](https://badge.socket.dev/npm/package/cc-codeconductor/1.7.0)](https://badge.socket.dev/npm/package/cc-codeconductor/1.7.0)
6
6
 
7
7
  CodeConductor is an open-source framework for building structured, reproducible
8
8
  AI-assisted software engineering workflows.
@@ -15,12 +15,19 @@ contracts, task cards, and risk-based routing.
15
15
  >
16
16
  > ## Current Scope
17
17
  >
18
- > Published package is **1.6.0** (current stable line: **1.6.x**). Limitations
18
+ > Published package is **1.7.0** (current stable line: **1.7.x**). Limitations
19
19
  > matrix:
20
20
  > [docs/current-status.md](docs/current-status.md). This repository:
21
21
  > `bun run dev …` (not `npx`) while iterating.
22
22
  >
23
- > Shipped in the 1.6.x stable line:
23
+ > Changes after v1.6.1 are implemented, unreleased: runner-captured TDD,
24
+ > persistent RED validation, OpenSpec completion fixes, shared skills,
25
+ > safer hooks and Claude installation, atomic Goal DAG claims, native delta
26
+ > specs, and scorecards that preserve unmeasured signals. See the
27
+ > [post-v1.6.1 guide](docs/post-v1.6.1.md) for the exact commit range and
28
+ > upgrade steps.
29
+ >
30
+ > Shipped in the 1.7.x stable line:
24
31
  >
25
32
  > - `npx cc-codeconductor setup --target <target> --yes` — onboarding flow
26
33
  > - `npx cc-codeconductor init` — detects project stack, writes
@@ -188,6 +195,13 @@ Agent phases: validate-backlog → discover → design → **test** → implemen
188
195
  review. Test-before-implement is required whenever both phases apply.
189
196
  `/cc-tdd-cycle` enforces Red → Green → Refactor (`tester` then `implementer`).
190
197
 
198
+ In the unreleased checkout, `tdd capture` runs and records RED/GREEN suites.
199
+ When `BACKLOG.md` Global requires TDD, closing a test card validates and persists
200
+ RED before implementation changes the candidate; GREEN must still match the
201
+ current candidate. `done` preserves
202
+ agent edits in `tasks.md`, and `archive` gates unchecked boxes. See
203
+ [the delivery and evidence guide](docs/post-v1.6.1.md#entrega-openspec-y-evidencia-tdd).
204
+
191
205
  ### Receipt-Driven Development
192
206
 
193
207
  RDD binds local verification evidence to the exact code, tests, contracts,
@@ -325,14 +339,14 @@ Task Card → Risk Classification → Routing Policy → Conductor Agent → Del
325
339
 
326
340
  ## Supply chain
327
341
 
328
- Published **1.6.0** declares two production dependencies (`package.json`
342
+ Published **1.7.0** declares two production dependencies (`package.json`
329
343
  `dependencies`; same on
330
344
  [npm](https://www.npmjs.com/package/cc-codeconductor)). Neither has further
331
345
  npm transitive dependencies.
332
346
 
333
347
  ```mermaid
334
348
  graph LR
335
- cc["cc-codeconductor@1.6.0"]
349
+ cc["cc-codeconductor@1.7.0"]
336
350
  zod["zod@^3.23.8"]
337
351
  yaml["yaml@^2.4.5"]
338
352
  cc --> zod
@@ -692,7 +706,8 @@ npx cc-codeconductor odd handoff --id delivery-001 --output json
692
706
  ```
693
707
 
694
708
  Subcommands: `validate` / `scan` / `plan` / `analyze` / `status` / `next` /
695
- `start` / `done` / `block` / `archive`. `analyze` is read-only coverage
709
+ `start` / `done` / `block` / `unblock` / `archive`, plus implemented, unreleased
710
+ `sync` / `verify` gates. `analyze` is read-only coverage
696
711
  (FR/SC → tasks → tests). Planned changes use capability-scoped delta specs;
697
712
  archive synchronizes validated deltas into durable specs before filing the
698
713
  change. Illegal status transitions fail closed. See
@@ -860,7 +875,7 @@ codeconductor/
860
875
 
861
876
  ## Roadmap
862
877
 
863
- Published package: **1.6.x (current stable: 1.6.0)**. Remaining gaps (sandbox, policy compiler, full
878
+ Published package: **1.7.x (current stable: 1.7.0)**. Remaining gaps (sandbox, policy compiler, full
864
879
  stack-specific asset pruning): [docs/current-status.md](docs/current-status.md).
865
880
  Release history: [CHANGELOG.md](CHANGELOG.md).
866
881
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Compile Check — runs a build command via Bun.spawn, captures output,
2
+ * Compile Check — runs a build command via node:child_process, captures output,
3
3
  * parses errors, and returns structured results for re-injection.
4
4
  */
5
5
  export interface CompileError {
@@ -48,6 +48,7 @@ export declare function isAllowlistedTestCommand(command: string | string[]): bo
48
48
  */
49
49
  export declare function parseCompileErrors(stderr: string): CompileError[];
50
50
  /**
51
- * Run a compile check via Bun.spawn with configurable timeout.
51
+ * Run a compile check with configurable timeout. Uses `node:child_process`
52
+ * because the published bundle runs under Node (`npx cc-codeconductor`).
52
53
  */
53
54
  export declare function runCompileCheck(options?: CompileCheckOptions): Promise<CompileResult>;
@@ -1,5 +1,6 @@
1
1
  import { type GoalGraphInput } from '../../validation/schemas';
2
2
  import { type Result } from '../../utils/result';
3
+ export declare function propagateBlockedTasks(graph: GoalGraphInput): boolean;
3
4
  /**
4
5
  * Write a goal graph to .codeconductor/current-goal.yml
5
6
  */
@@ -20,6 +20,7 @@ export interface OrchestratorNextResult {
20
20
  readyCount: number;
21
21
  }
22
22
  export declare function getNextTask(projectRoot: string, projectName: string): Promise<Result<OrchestratorNextResult, Error>>;
23
+ export declare function claimNextTask(projectRoot: string, projectName: string): Promise<Result<OrchestratorNextResult, Error>>;
23
24
  export declare function startTask(projectRoot: string, taskId: string, agent?: string): Promise<Result<void, Error>>;
24
25
  export declare function completeTask(projectRoot: string, taskId: string, evidenceIds?: string[]): Promise<Result<void, Error>>;
25
26
  export declare function formatGoalStatus(graph: GoalGraphInput): string;
@@ -0,0 +1,3 @@
1
+ import { type Result } from '../../utils/result';
2
+ /** Serialize each full goal transition, including its operational state and rollback. */
3
+ export declare function withQueueLock<T>(projectRoot: string, action: () => Promise<Result<T, Error>>): Promise<Result<T, Error>>;
@@ -13,6 +13,14 @@ export interface RddReceipt {
13
13
  readonly command?: string;
14
14
  readonly outcome: 'passed' | 'failed';
15
15
  readonly capturedAt: string;
16
+ /**
17
+ * Random capture binding minted by captureReceipt and registered under
18
+ * `.codeconductor/rdd-receipts/`. A receipt whose nonce was never
19
+ * registered — including hand-written JSON with correct hashes — never
20
+ * verifies. Optional so previously persisted shapes still parse (and then
21
+ * fail closed at verification).
22
+ */
23
+ readonly nonce?: string;
16
24
  }
17
25
  export interface ReceiptVerification {
18
26
  readonly valid: boolean;
@@ -20,6 +28,12 @@ export interface ReceiptVerification {
20
28
  readonly actualHash: string;
21
29
  readonly changedPaths: readonly string[];
22
30
  }
31
+ /**
32
+ * True only when this receipt was minted by captureReceipt in this project:
33
+ * the nonce is well-formed, a registry entry exists for it, and the entry
34
+ * binds the nonce to this exact manifest. Anything else fails closed.
35
+ */
36
+ export declare function isRegisteredReceipt(projectRoot: string, receipt: RddReceipt): Promise<boolean>;
23
37
  export declare function isRddReceipt(value: unknown): value is RddReceipt;
24
38
  export declare function captureReceipt(projectRoot: string, input: {
25
39
  readonly taskId: string;
@@ -37,3 +51,14 @@ export declare function captureReceipt(projectRoot: string, input: {
37
51
  */
38
52
  export declare function collectReceiptPaths(projectRoot: string): Promise<string[]>;
39
53
  export declare function verifyReceipt(projectRoot: string, receipt: RddReceipt): Promise<ReceiptVerification>;
54
+ export interface ReceiptLockVerification {
55
+ readonly valid: boolean;
56
+ readonly changedPaths: readonly string[];
57
+ }
58
+ /**
59
+ * Re-verify a persisted receipt lock (cc-spec-mutation pattern: freeze
60
+ * specs+tests behind a SHA-256 lock, recompute before every gate, abort on
61
+ * any single-byte difference). A missing, corrupt, or non-receipt lock fails
62
+ * closed — it reports invalid, never valid.
63
+ */
64
+ export declare function verifyReceiptLock(projectRoot: string, lockPath: string): Promise<ReceiptLockVerification>;
@@ -1,4 +1,5 @@
1
1
  import type { GoalGraphInput } from '../../validation/schemas';
2
+ import { type TddValidationRecordInput } from '../../validation/schemas';
2
3
  import type { TddSuiteEvidence } from '../../domain/loop/loop-state';
3
4
  import { type Result } from '../../utils/result';
4
5
  import { type RddReceipt } from './rdd-receipt';
@@ -38,6 +39,22 @@ export declare function runVerification(projectRoot: string, taskId: string, goa
38
39
  * unreadable evidence all block completion.
39
40
  */
40
41
  export declare function gateTaskCompletion(projectRoot: string, taskId: string, evidenceRequired: string[], evidenceIds?: string[]): Promise<Result<boolean, Error>>;
42
+ export interface SpecTestDiffGateOptions {
43
+ readonly changedFiles: readonly string[];
44
+ /** True only when the mutation_testing HANDS_OFF protocol routed back to add the missing test. */
45
+ readonly handover?: boolean;
46
+ }
47
+ export interface SpecTestDiffGateResult {
48
+ readonly passed: boolean;
49
+ readonly violations: readonly string[];
50
+ }
51
+ /**
52
+ * No specs/tests diffs except via HANDS_OFF (cc-spec-mutation Stage 3 hard
53
+ * rule + Stage 5 hands-off): specs/ and tests/ are read-only for
54
+ * implementers, and only the mutation runner routing back to the craftsman
55
+ * may add the missing test.
56
+ */
57
+ export declare function gateSpecTestDiffs(options: SpecTestDiffGateOptions): SpecTestDiffGateResult;
41
58
  export declare const TDD_EVIDENCE_SOURCE = "cc verify";
42
59
  export declare const TDD_CAPTURED_BY = "verification-runner";
43
60
  export interface CaptureTddSuiteOptions extends RunVerificationOptions {
@@ -58,13 +75,21 @@ export declare function captureTddSuiteEvidence(projectRoot: string, taskId: str
58
75
  }, Error>>;
59
76
  /**
60
77
  * Load TDD suite evidence written by `captureTddSuiteEvidence`. Hand-edited
61
- * files (wrong source/type/`capturedBy`) are rejected.
78
+ * files (wrong source/type/`capturedBy`) are rejected, and so is a receipt
79
+ * that no longer matches the current project.
62
80
  */
63
81
  export declare function loadTddSuiteEvidence(projectRoot: string, taskId: string, evidenceId: string): Promise<Result<TddSuiteEvidence & {
64
82
  receipt: RddReceipt;
65
83
  }, Error>>;
84
+ /**
85
+ * Validate the RED evidence of a task against the current project and persist
86
+ * a record so later project changes do not invalidate it. With several fresh
87
+ * REDs the latest `receipt.capturedAt` wins (tie: greater evidence id).
88
+ */
89
+ export declare function recordRedValidation(projectRoot: string, taskId: string): Promise<Result<TddValidationRecordInput, Error>>;
66
90
  /**
67
91
  * True when the verification runner stored TDD evidence for this task.
68
- * Handmade JSON (wrong source/type/capturedBy) does not count.
92
+ * Handmade JSON (wrong source/type/capturedBy) does not count. RED is also
93
+ * accepted from a matching validation record written by `recordRedValidation`.
69
94
  */
70
95
  export declare function hasTddRunnerEvidence(projectRoot: string, taskId: string, expectedPhase?: 'red' | 'green'): Promise<boolean>;