cc-codeconductor 1.0.0 → 1.1.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 +324 -87
- package/dist/core/compilation/compile-checker.d.ts +2 -0
- package/dist/core/loop/loop-engine.d.ts +3 -0
- package/dist/index.js +2701 -577
- package/dist/library.js +167 -18
- package/dist/validation/schemas.d.ts +390 -44
- package/package.json +4 -1
- package/presets/agy/AGENTS.md +3 -0
- package/presets/agy/gates/pre-commit/GATE.md +5 -4
- package/presets/agy/skills/backlog/SKILL.md +91 -0
- package/presets/agy/skills/openspec/SKILL.md +5 -1
- package/presets/agy/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/agy/skills/security-blue-team/SKILL.md +43 -0
- package/presets/agy/skills/security-cloud/SKILL.md +43 -0
- package/presets/agy/skills/security-crypto/SKILL.md +43 -0
- package/presets/agy/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/agy/skills/security-grc/SKILL.md +43 -0
- package/presets/agy/skills/security-incident-response/SKILL.md +45 -0
- package/presets/agy/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/agy/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/agy/skills/security-mobile/SKILL.md +43 -0
- package/presets/agy/skills/security-network/SKILL.md +43 -0
- package/presets/agy/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/agy/skills/security-recon/SKILL.md +45 -0
- package/presets/agy/skills/security-red-team/SKILL.md +44 -0
- package/presets/agy/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/agy/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/agy/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/agy/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/agy/skills/security-web/SKILL.md +44 -0
- package/presets/agy/workflows/cc-ask.md +2 -1
- package/presets/agy/workflows/cc-backlog.md +69 -0
- package/presets/agy/workflows/cc-explore.md +1 -1
- package/presets/agy/workflows/cc-openspec.md +3 -1
- package/presets/agy/workflows/cc-security.md +180 -0
- package/presets/claude/CLAUDE.md +4 -0
- package/presets/claude/commands/cc/ask.md +2 -1
- package/presets/claude/commands/cc/backlog.md +104 -0
- package/presets/claude/commands/cc/explore.md +1 -1
- package/presets/claude/commands/cc/openspec.md +16 -1
- package/presets/claude/commands/cc/security.md +179 -0
- package/presets/claude/gates/pre-commit/GATE.md +5 -4
- package/presets/claude/skills/backlog/SKILL.md +91 -0
- package/presets/claude/skills/openspec/SKILL.md +5 -1
- package/presets/claude/skills/security/SKILL.md +382 -0
- package/presets/claude/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/claude/skills/security-blue-team/SKILL.md +43 -0
- package/presets/claude/skills/security-cloud/SKILL.md +43 -0
- package/presets/claude/skills/security-crypto/SKILL.md +43 -0
- package/presets/claude/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/claude/skills/security-grc/SKILL.md +43 -0
- package/presets/claude/skills/security-incident-response/SKILL.md +45 -0
- package/presets/claude/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/claude/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/claude/skills/security-mobile/SKILL.md +43 -0
- package/presets/claude/skills/security-network/SKILL.md +43 -0
- package/presets/claude/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/claude/skills/security-recon/SKILL.md +45 -0
- package/presets/claude/skills/security-red-team/SKILL.md +44 -0
- package/presets/claude/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/claude/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/claude/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/claude/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/claude/skills/security-web/SKILL.md +44 -0
- package/presets/codex/commands/cc-ask.md +2 -1
- package/presets/codex/gates/pre-commit/GATE.md +5 -4
- package/presets/cursor/AGENTS.md +2 -2
- package/presets/cursor/commands/cc/ask.md +2 -1
- package/presets/cursor/commands/cc/backlog.md +105 -0
- package/presets/cursor/commands/cc/explore.md +1 -1
- package/presets/cursor/commands/cc/openspec.md +16 -1
- package/presets/cursor/commands/cc/security.md +179 -0
- package/presets/cursor/gates/pre-commit/GATE.md +5 -4
- package/presets/cursor/skills/backlog/SKILL.md +91 -0
- package/presets/cursor/skills/openspec/SKILL.md +5 -1
- package/presets/cursor/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/cursor/skills/security-blue-team/SKILL.md +43 -0
- package/presets/cursor/skills/security-cloud/SKILL.md +43 -0
- package/presets/cursor/skills/security-crypto/SKILL.md +43 -0
- package/presets/cursor/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/cursor/skills/security-grc/SKILL.md +43 -0
- package/presets/cursor/skills/security-incident-response/SKILL.md +45 -0
- package/presets/cursor/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/cursor/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/cursor/skills/security-mobile/SKILL.md +43 -0
- package/presets/cursor/skills/security-network/SKILL.md +43 -0
- package/presets/cursor/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/cursor/skills/security-recon/SKILL.md +45 -0
- package/presets/cursor/skills/security-red-team/SKILL.md +44 -0
- package/presets/cursor/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/cursor/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/cursor/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/cursor/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/cursor/skills/security-web/SKILL.md +44 -0
- package/presets/opencode/commands/cc-ask.md +2 -1
- package/presets/opencode/commands/cc-backlog.md +68 -0
- package/presets/opencode/commands/cc-explore.md +1 -1
- package/presets/opencode/commands/cc-openspec.md +3 -1
- package/presets/opencode/commands/cc-security.md +179 -0
- package/presets/opencode/gates/pre-commit/GATE.md +5 -4
- package/presets/opencode/skills/backlog/SKILL.md +91 -0
- package/presets/opencode/skills/openspec/SKILL.md +5 -1
- package/presets/opencode/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/opencode/skills/security-blue-team/SKILL.md +43 -0
- package/presets/opencode/skills/security-cloud/SKILL.md +43 -0
- package/presets/opencode/skills/security-crypto/SKILL.md +43 -0
- package/presets/opencode/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/opencode/skills/security-grc/SKILL.md +43 -0
- package/presets/opencode/skills/security-incident-response/SKILL.md +45 -0
- package/presets/opencode/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/opencode/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/opencode/skills/security-mobile/SKILL.md +43 -0
- package/presets/opencode/skills/security-network/SKILL.md +43 -0
- package/presets/opencode/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/opencode/skills/security-recon/SKILL.md +45 -0
- package/presets/opencode/skills/security-red-team/SKILL.md +44 -0
- package/presets/opencode/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/opencode/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/opencode/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/opencode/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/opencode/skills/security-web/SKILL.md +44 -0
- package/src/presets/council/council.yml +12 -0
package/dist/library.js
CHANGED
|
@@ -66,6 +66,18 @@ function validateScorecardRecord(data) {
|
|
|
66
66
|
function validateTaskOutcome(data) {
|
|
67
67
|
return TaskOutcomeSchema.parse(data);
|
|
68
68
|
}
|
|
69
|
+
function validateHarnessCatalog(data) {
|
|
70
|
+
return HarnessCatalogSchema.parse(data);
|
|
71
|
+
}
|
|
72
|
+
function validateHarnessOverlay(data) {
|
|
73
|
+
return HarnessOverlaySchema.parse(data);
|
|
74
|
+
}
|
|
75
|
+
function validateHarnessExperiment(data) {
|
|
76
|
+
return HarnessExperimentSchema.parse(data);
|
|
77
|
+
}
|
|
78
|
+
function validateHarnessSuite(data) {
|
|
79
|
+
return HarnessSuiteSchema.parse(data);
|
|
80
|
+
}
|
|
69
81
|
function validateCommandEnvelope(data) {
|
|
70
82
|
return CommandEnvelopeSchema.parse(data);
|
|
71
83
|
}
|
|
@@ -105,7 +117,7 @@ function validateCanonicalTaskCard(data) {
|
|
|
105
117
|
function validateProductEvent(data) {
|
|
106
118
|
return ProductEventSchema.parse(data);
|
|
107
119
|
}
|
|
108
|
-
var CouncilAgentSpecSchema, CouncilSpecSchema, ProjectProfileSchema, CompileCheckConfigSchema, LoopConfigSchema, CodeConductorConfigSchema, RunnerTargetSchema, InstallStrategySchema, ManifestEntrySchema, InstallManifestSchema, ToolProviderNamesSchema, PermissionProviderNamesSchema, ModelConfigSchema, ContractTargetSchema, ContractFormatSchema, AgentContractSchema, CouncilFindingSchema, CouncilVerdictInputSchema, ConsensusConfigSchema, CouncilVerdictSchema, ClaudeAgentFileSchema, OpenCodeAgentFileSchema, SentryStackFrameSchema, SentryWebhookSchema, MemoryPointerSchema, MemoryIndexSchema, GoalTaskSchema, GoalGraphSchema, ConfidenceLevelSchema, ProductNodeTypeSchema, GraphRelationSchema, KnowledgeEntitySchema, DecisionSchema, EvidenceSchema, CanonicalTaskCardStatusSchema, CanonicalTaskCardSchema, ProductGraphNodeSchema, ProductGraphEdgeSchema, ProductGraphSchema, ProductMetaSchema, ProductEventTypeSchema, ProductEventSchema, OperationalStateSchema, StrategicMemorySchema, ImpactReportSchema, BusinessReviewOutputSchema, VerificationReportSchema, BacklogStatusSchema, BacklogTypeSchema, BacklogPrioritySchema, BacklogGlobalSchema, BacklogItemSchema, BacklogDocumentSchema, OpenspecTaskCardPhaseSchema, OpenspecTaskCardStatusSchema, OpenspecTaskCardSchema, OpenspecStateSchema, WorkflowCommandSchema, CcepOutputFormatSchema, CommandEnvelopeSchema, WorkflowPhaseSchema, WorkflowRiskRuleSchema, WorkflowProfileSchema, ExecutionContextSchema, PlannerOutputSchema, AgentArtifactSchema, AgentOutputSchema, ImplementerTestsSchema, ImplementerOutputSchema, ReviewAxisSchema, ReviewFindingSchema, ReviewerOutputSchema, TechnicalPlanOutputSchema, ScorecardVerdictSchema, ScorecardCriterionIdSchema, ScorecardCriterionSchema, ScorecardRecordSchema, TaskOutcomeSourceSchema, TaskOutcomeStatusSchema, TaskOutcomeSchema, EvaluationIndexSchema, ExecutionProfileNameSchema, ExecutionProfileSchema;
|
|
120
|
+
var CouncilAgentSpecSchema, CouncilSpecSchema, ProjectProfileSchema, CompileCheckConfigSchema, LoopConfigSchema, CodeConductorConfigSchema, RunnerTargetSchema, InstallStrategySchema, ManifestEntrySchema, InstallManifestSchema, ToolProviderNamesSchema, PermissionProviderNamesSchema, ModelConfigSchema, ContractTargetSchema, ContractFormatSchema, AgentContractSchema, CouncilFindingSchema, CouncilVerdictInputSchema, ConsensusConfigSchema, CouncilVerdictSchema, ClaudeAgentFileSchema, OpenCodeAgentFileSchema, SentryStackFrameSchema, SentryWebhookSchema, MemoryPointerSchema, MemoryIndexSchema, GoalTaskSchema, GoalGraphSchema, ConfidenceLevelSchema, ProductNodeTypeSchema, GraphRelationSchema, KnowledgeEntitySchema, DecisionSchema, EvidenceSchema, CanonicalTaskCardStatusSchema, CanonicalTaskCardSchema, ProductGraphNodeSchema, ProductGraphEdgeSchema, ProductGraphSchema, ProductMetaSchema, ProductEventTypeSchema, ProductEventSchema, OperationalStateSchema, StrategicMemorySchema, ImpactReportSchema, BusinessReviewOutputSchema, VerificationReportSchema, BacklogStatusSchema, BacklogTypeSchema, BacklogPrioritySchema, BacklogGlobalSchema, BacklogItemSchema, BacklogDocumentSchema, OpenspecTaskCardPhaseSchema, OpenspecTaskCardStatusSchema, OpenspecTaskCardSchema, OpenspecStateSchema, WorkflowCommandSchema, CcepOutputFormatSchema, CommandEnvelopeSchema, WorkflowPhaseSchema, WorkflowRiskRuleSchema, WorkflowProfileSchema, ExecutionContextSchema, PlannerOutputSchema, AgentArtifactSchema, AgentOutputSchema, ImplementerTestsSchema, ImplementerOutputSchema, ReviewAxisSchema, ReviewFindingSchema, ReviewerOutputSchema, TechnicalPlanOutputSchema, ScorecardVerdictSchema, ScorecardCriterionIdSchema, ScorecardCriterionSchema, ScorecardRecordSchema, TaskOutcomeSourceSchema, TaskOutcomeStatusSchema, TaskOutcomeSchema, HarnessComponentIdSchema, HarnessComponentLayerSchema, HarnessToggleKindSchema, HarnessCatalogEntrySchema, HarnessCatalogSchema, HarnessOverlaySchema, HarnessExperimentSchema, HarnessSuiteTaskSchema, HarnessSuiteSchema, EvaluationIndexSchema, ExecutionProfileNameSchema, ExecutionProfileSchema;
|
|
109
121
|
var init_schemas = __esm(() => {
|
|
110
122
|
CouncilAgentSpecSchema = z.object({
|
|
111
123
|
id: z.string(),
|
|
@@ -126,7 +138,7 @@ var init_schemas = __esm(() => {
|
|
|
126
138
|
version: z.string(),
|
|
127
139
|
description: z.string(),
|
|
128
140
|
outputContract: z.string(),
|
|
129
|
-
agents: z.array(CouncilAgentSpecSchema)
|
|
141
|
+
agents: z.array(CouncilAgentSpecSchema).min(1).refine((agents) => new Set(agents.map((a) => a.id.trim().toLowerCase())).size === agents.length, { message: "council agent ids must be unique" })
|
|
130
142
|
});
|
|
131
143
|
ProjectProfileSchema = z.object({
|
|
132
144
|
rootDir: z.string(),
|
|
@@ -248,7 +260,7 @@ var init_schemas = __esm(() => {
|
|
|
248
260
|
status: z.enum(["APPROVED", "REJECTED", "ABSTAIN"]),
|
|
249
261
|
securityVeto: z.boolean(),
|
|
250
262
|
complianceVeto: z.boolean().optional(),
|
|
251
|
-
confidence: z.number().min(0).max(1)
|
|
263
|
+
confidence: z.number().min(0).max(1),
|
|
252
264
|
findings: z.array(CouncilFindingSchema),
|
|
253
265
|
summary: z.string()
|
|
254
266
|
});
|
|
@@ -256,10 +268,15 @@ var init_schemas = __esm(() => {
|
|
|
256
268
|
algorithm: z.enum(["majority", "unanimous"]),
|
|
257
269
|
allowSecurityVeto: z.boolean(),
|
|
258
270
|
allowComplianceVeto: z.boolean().optional(),
|
|
259
|
-
expectedAgentIds: z.array(z.string().min(1).refine((id) => id.trim().length > 0)).min(1).refine((ids) => new Set(ids.map((id) => id.trim().toLowerCase())).size === ids.length).optional()
|
|
271
|
+
expectedAgentIds: z.array(z.string().min(1).refine((id) => id.trim().length > 0)).min(1).refine((ids) => new Set(ids.map((id) => id.trim().toLowerCase())).size === ids.length).optional(),
|
|
272
|
+
quorum: z.number().int().positive().optional(),
|
|
273
|
+
criticalFindingsPolicy: z.enum(["escalate", "reject", "ignore"]).optional()
|
|
260
274
|
}).refine((config) => config.algorithm !== "unanimous" || config.expectedAgentIds !== undefined, {
|
|
261
275
|
message: "unanimous consensus requires a non-empty expectedAgentIds roster",
|
|
262
276
|
path: ["expectedAgentIds"]
|
|
277
|
+
}).refine((config) => !config.allowSecurityVeto || config.expectedAgentIds === undefined || config.expectedAgentIds.some((id) => id.toLowerCase().includes("security")), {
|
|
278
|
+
message: "allowSecurityVeto requires at least one security agent in expectedAgentIds",
|
|
279
|
+
path: ["expectedAgentIds"]
|
|
263
280
|
});
|
|
264
281
|
CouncilVerdictSchema = z.object({
|
|
265
282
|
status: z.enum(["APPROVED", "REJECTED", "ESCALATED"]),
|
|
@@ -411,8 +428,17 @@ var init_schemas = __esm(() => {
|
|
|
411
428
|
agentType: z.string(),
|
|
412
429
|
evidenceRequired: z.array(z.string()).default([]),
|
|
413
430
|
status: CanonicalTaskCardStatusSchema,
|
|
414
|
-
type: z.enum(["feature", "fix", "refactor", "review", "docs", "test"])
|
|
415
|
-
linkedCapabilities: z.array(z.string()).default([])
|
|
431
|
+
type: z.enum(["feature", "fix", "refactor", "review", "docs", "test"]),
|
|
432
|
+
linkedCapabilities: z.array(z.string()).default([]),
|
|
433
|
+
boundaries: z.array(z.string()).default([]),
|
|
434
|
+
requiresHumanReview: z.boolean().optional(),
|
|
435
|
+
requiresTests: z.boolean().optional(),
|
|
436
|
+
contextScope: z.enum(["isolated", "continuation", "full"]).optional(),
|
|
437
|
+
actualBehavior: z.string().optional(),
|
|
438
|
+
expectedBehavior: z.string().optional(),
|
|
439
|
+
reproductionSteps: z.array(z.string()).optional(),
|
|
440
|
+
domain: z.string().optional(),
|
|
441
|
+
authorization: z.string().optional()
|
|
416
442
|
});
|
|
417
443
|
ProductGraphNodeSchema = z.object({
|
|
418
444
|
id: z.string(),
|
|
@@ -570,7 +596,8 @@ var init_schemas = __esm(() => {
|
|
|
570
596
|
modelHint: z.string().optional(),
|
|
571
597
|
dependsOn: z.array(z.string()).default([]),
|
|
572
598
|
acceptanceCriteria: z.array(z.string()),
|
|
573
|
-
status: OpenspecTaskCardStatusSchema
|
|
599
|
+
status: OpenspecTaskCardStatusSchema,
|
|
600
|
+
itemHash: z.string().optional()
|
|
574
601
|
});
|
|
575
602
|
OpenspecStateSchema = z.object({
|
|
576
603
|
version: z.literal(1),
|
|
@@ -592,6 +619,7 @@ var init_schemas = __esm(() => {
|
|
|
592
619
|
"db-migration",
|
|
593
620
|
"pagespeed",
|
|
594
621
|
"openspec",
|
|
622
|
+
"backlog",
|
|
595
623
|
"scorecard",
|
|
596
624
|
"council",
|
|
597
625
|
"iterative",
|
|
@@ -599,7 +627,8 @@ var init_schemas = __esm(() => {
|
|
|
599
627
|
"triage",
|
|
600
628
|
"prototype",
|
|
601
629
|
"handoff",
|
|
602
|
-
"clarify"
|
|
630
|
+
"clarify",
|
|
631
|
+
"security"
|
|
603
632
|
]);
|
|
604
633
|
CcepOutputFormatSchema = z.enum(["taskcard", "plan", "verdict"]);
|
|
605
634
|
CommandEnvelopeSchema = z.object({
|
|
@@ -833,7 +862,86 @@ var init_schemas = __esm(() => {
|
|
|
833
862
|
tokensIn: z.number().optional(),
|
|
834
863
|
tokensOut: z.number().optional(),
|
|
835
864
|
costUsd: z.number().optional(),
|
|
836
|
-
durationMs: z.number().optional()
|
|
865
|
+
durationMs: z.number().optional(),
|
|
866
|
+
experimentId: z.string().optional(),
|
|
867
|
+
variantId: z.string().optional(),
|
|
868
|
+
suiteTaskId: z.string().optional(),
|
|
869
|
+
harnessFingerprint: z.string().optional(),
|
|
870
|
+
disabledComponents: z.array(z.string()).optional()
|
|
871
|
+
});
|
|
872
|
+
HarnessComponentIdSchema = z.enum([
|
|
873
|
+
"wayfinding",
|
|
874
|
+
"intake",
|
|
875
|
+
"design",
|
|
876
|
+
"test_first",
|
|
877
|
+
"review",
|
|
878
|
+
"docs",
|
|
879
|
+
"confirmation_gates",
|
|
880
|
+
"compile_loop",
|
|
881
|
+
"council",
|
|
882
|
+
"product_graph"
|
|
883
|
+
]);
|
|
884
|
+
HarnessComponentLayerSchema = z.enum([
|
|
885
|
+
"phase",
|
|
886
|
+
"gate",
|
|
887
|
+
"loop",
|
|
888
|
+
"knowledge",
|
|
889
|
+
"council"
|
|
890
|
+
]);
|
|
891
|
+
HarnessToggleKindSchema = z.enum([
|
|
892
|
+
"ccep_phase",
|
|
893
|
+
"ccep_gates",
|
|
894
|
+
"config_loop",
|
|
895
|
+
"config_council",
|
|
896
|
+
"product_graph"
|
|
897
|
+
]);
|
|
898
|
+
HarnessCatalogEntrySchema = z.object({
|
|
899
|
+
id: HarnessComponentIdSchema,
|
|
900
|
+
layer: HarnessComponentLayerSchema,
|
|
901
|
+
label: z.string(),
|
|
902
|
+
defaultOn: z.boolean().default(true),
|
|
903
|
+
toggle: z.object({
|
|
904
|
+
kind: HarnessToggleKindSchema,
|
|
905
|
+
phaseId: z.string().optional()
|
|
906
|
+
})
|
|
907
|
+
});
|
|
908
|
+
HarnessCatalogSchema = z.object({
|
|
909
|
+
version: z.literal(1),
|
|
910
|
+
components: z.array(HarnessCatalogEntrySchema).min(1)
|
|
911
|
+
});
|
|
912
|
+
HarnessOverlaySchema = z.object({
|
|
913
|
+
experimentId: z.string().optional(),
|
|
914
|
+
variantId: z.string(),
|
|
915
|
+
disabledComponents: z.array(HarnessComponentIdSchema),
|
|
916
|
+
disableProductGraph: z.boolean().optional().default(false),
|
|
917
|
+
contractVersion: z.string().optional(),
|
|
918
|
+
ccepProfile: z.string().optional().default("feature")
|
|
919
|
+
});
|
|
920
|
+
HarnessExperimentSchema = z.object({
|
|
921
|
+
id: z.string(),
|
|
922
|
+
suiteId: z.string(),
|
|
923
|
+
createdAt: z.string(),
|
|
924
|
+
contractVersion: z.string(),
|
|
925
|
+
components: z.array(HarnessComponentIdSchema),
|
|
926
|
+
variants: z.array(z.string()).min(1),
|
|
927
|
+
suiteTaskIds: z.array(z.string()),
|
|
928
|
+
suitePath: z.string().optional()
|
|
929
|
+
});
|
|
930
|
+
HarnessSuiteTaskSchema = z.object({
|
|
931
|
+
id: z.string(),
|
|
932
|
+
title: z.string(),
|
|
933
|
+
type: z.enum(["feature", "fix", "refactor"]),
|
|
934
|
+
risk: z.enum(["low", "medium", "high"]).default("low"),
|
|
935
|
+
prompt: z.string(),
|
|
936
|
+
scope: z.string(),
|
|
937
|
+
acceptanceCriteria: z.array(z.string()).min(1),
|
|
938
|
+
testCommand: z.string().optional()
|
|
939
|
+
});
|
|
940
|
+
HarnessSuiteSchema = z.object({
|
|
941
|
+
id: z.string(),
|
|
942
|
+
version: z.number().int().positive(),
|
|
943
|
+
fixtureDir: z.string().optional(),
|
|
944
|
+
tasks: z.array(HarnessSuiteTaskSchema).min(1)
|
|
837
945
|
});
|
|
838
946
|
EvaluationIndexSchema = z.object({
|
|
839
947
|
version: z.literal(1),
|
|
@@ -1779,7 +1887,8 @@ function goalTaskToCanonicalCard(task, objective) {
|
|
|
1779
1887
|
evidenceRequired: task.evidenceRequired ?? ["acceptance_criteria_met"],
|
|
1780
1888
|
status: task.status === "in-progress" ? "in-progress" : task.status === "done" ? "done" : task.status === "blocked" ? "blocked" : "ready",
|
|
1781
1889
|
type: task.type,
|
|
1782
|
-
linkedCapabilities: []
|
|
1890
|
+
linkedCapabilities: [],
|
|
1891
|
+
boundaries: []
|
|
1783
1892
|
};
|
|
1784
1893
|
}
|
|
1785
1894
|
function buildTaskEnvelope(card, projectRoot, projectName) {
|
|
@@ -2242,6 +2351,8 @@ async function runLoop(generateFn, compileCheckFn, config = {}, taskTitle = "com
|
|
|
2242
2351
|
let state = createInitialState({ maxIterations, maxTokenBudget });
|
|
2243
2352
|
let totalErrors = 0;
|
|
2244
2353
|
let feedbackText;
|
|
2354
|
+
let compileCheck;
|
|
2355
|
+
let compileCheckSkipReason;
|
|
2245
2356
|
logTransition(state.phase, "INIT", state.iteration);
|
|
2246
2357
|
const startResult = loopStateMachine(state, { type: "START" });
|
|
2247
2358
|
state = startResult.state;
|
|
@@ -2277,6 +2388,12 @@ async function runLoop(generateFn, compileCheckFn, config = {}, taskTitle = "com
|
|
|
2277
2388
|
logTransition(state.phase, "COMPILE_CHECK", state.iteration);
|
|
2278
2389
|
const compileResult = await compileCheckFn();
|
|
2279
2390
|
totalErrors += compileResult.errors.length;
|
|
2391
|
+
if (compileResult.skipped) {
|
|
2392
|
+
compileCheck = "skipped";
|
|
2393
|
+
compileCheckSkipReason = compileResult.skipReason;
|
|
2394
|
+
} else {
|
|
2395
|
+
compileCheck = "ran";
|
|
2396
|
+
}
|
|
2280
2397
|
const checkResult = loopStateMachine(state, {
|
|
2281
2398
|
type: "COMPILE_CHECK_COMPLETED",
|
|
2282
2399
|
errors: compileResult.errors
|
|
@@ -2300,7 +2417,9 @@ async function runLoop(generateFn, compileCheckFn, config = {}, taskTitle = "com
|
|
|
2300
2417
|
iterations: state.iteration,
|
|
2301
2418
|
totalErrors,
|
|
2302
2419
|
finalPhase: "DONE",
|
|
2303
|
-
errorHistory: state.errorHistory
|
|
2420
|
+
errorHistory: state.errorHistory,
|
|
2421
|
+
compileCheck,
|
|
2422
|
+
compileCheckSkipReason
|
|
2304
2423
|
};
|
|
2305
2424
|
}
|
|
2306
2425
|
case "ESCALATED": {
|
|
@@ -2312,7 +2431,9 @@ async function runLoop(generateFn, compileCheckFn, config = {}, taskTitle = "com
|
|
|
2312
2431
|
totalErrors,
|
|
2313
2432
|
finalPhase: "ESCALATED",
|
|
2314
2433
|
escalationReport: report,
|
|
2315
|
-
errorHistory: state.errorHistory
|
|
2434
|
+
errorHistory: state.errorHistory,
|
|
2435
|
+
compileCheck,
|
|
2436
|
+
compileCheckSkipReason
|
|
2316
2437
|
};
|
|
2317
2438
|
}
|
|
2318
2439
|
case "FAILED": {
|
|
@@ -2322,7 +2443,9 @@ async function runLoop(generateFn, compileCheckFn, config = {}, taskTitle = "com
|
|
|
2322
2443
|
iterations: state.iteration,
|
|
2323
2444
|
totalErrors,
|
|
2324
2445
|
finalPhase: "FAILED",
|
|
2325
|
-
errorHistory: state.errorHistory
|
|
2446
|
+
errorHistory: state.errorHistory,
|
|
2447
|
+
compileCheck,
|
|
2448
|
+
compileCheckSkipReason
|
|
2326
2449
|
};
|
|
2327
2450
|
}
|
|
2328
2451
|
default: {
|
|
@@ -2332,7 +2455,9 @@ async function runLoop(generateFn, compileCheckFn, config = {}, taskTitle = "com
|
|
|
2332
2455
|
iterations: state.iteration,
|
|
2333
2456
|
totalErrors,
|
|
2334
2457
|
finalPhase: state.phase,
|
|
2335
|
-
errorHistory: state.errorHistory
|
|
2458
|
+
errorHistory: state.errorHistory,
|
|
2459
|
+
compileCheck,
|
|
2460
|
+
compileCheckSkipReason
|
|
2336
2461
|
};
|
|
2337
2462
|
}
|
|
2338
2463
|
}
|
|
@@ -2398,6 +2523,15 @@ var CLEAN_COMPILE = {
|
|
|
2398
2523
|
durationMs: 0,
|
|
2399
2524
|
timedOut: false
|
|
2400
2525
|
};
|
|
2526
|
+
function skippedCompileResult(reason) {
|
|
2527
|
+
return {
|
|
2528
|
+
...CLEAN_COMPILE,
|
|
2529
|
+
skipped: true,
|
|
2530
|
+
skipReason: reason,
|
|
2531
|
+
stderr: `compileCheck: skipped
|
|
2532
|
+
${reason}`
|
|
2533
|
+
};
|
|
2534
|
+
}
|
|
2401
2535
|
function shouldRunAgentLoop(type, agentType, phase) {
|
|
2402
2536
|
if (phase === "implement" || phase === "test")
|
|
2403
2537
|
return true;
|
|
@@ -2421,11 +2555,13 @@ async function runLoopForProject(projectRoot, options) {
|
|
|
2421
2555
|
const loopCfg = configResult.success ? configResult.data.loop : undefined;
|
|
2422
2556
|
const compileCheck = configResult.success ? configResult.data.safety.compileCheck : undefined;
|
|
2423
2557
|
const compileCheckFn = async () => {
|
|
2424
|
-
if (!compileCheck?.enabled || !compileCheck.command)
|
|
2425
|
-
return
|
|
2558
|
+
if (!compileCheck?.enabled || !compileCheck.command) {
|
|
2559
|
+
return skippedCompileResult(!compileCheck?.enabled ? "Compile check is not enabled in config." : "Compile check is enabled but no command is configured.");
|
|
2560
|
+
}
|
|
2426
2561
|
const allowed = options.allowCompileCheck === true || isAllowlistedCompileCommand(compileCheck.command);
|
|
2427
|
-
if (!allowed)
|
|
2428
|
-
return
|
|
2562
|
+
if (!allowed) {
|
|
2563
|
+
return skippedCompileResult("Compile check not executed: the command is not on the compile allowlist. " + "Re-run with --allow-compile-check to trust it.");
|
|
2564
|
+
}
|
|
2429
2565
|
const result = await runCompileCheck({
|
|
2430
2566
|
command: compileCheck.command,
|
|
2431
2567
|
cwd: projectRoot,
|
|
@@ -2471,6 +2607,10 @@ export {
|
|
|
2471
2607
|
validateMemoryIndex,
|
|
2472
2608
|
validateKnowledgeEntity,
|
|
2473
2609
|
validateImplementerOutput,
|
|
2610
|
+
validateHarnessSuite,
|
|
2611
|
+
validateHarnessOverlay,
|
|
2612
|
+
validateHarnessExperiment,
|
|
2613
|
+
validateHarnessCatalog,
|
|
2474
2614
|
validateGoalGraph,
|
|
2475
2615
|
validateExecutionContext,
|
|
2476
2616
|
validateEvidenceIds,
|
|
@@ -2557,6 +2697,15 @@ export {
|
|
|
2557
2697
|
ImplementerTestsSchema,
|
|
2558
2698
|
ImplementerOutputSchema,
|
|
2559
2699
|
ImpactReportSchema,
|
|
2700
|
+
HarnessToggleKindSchema,
|
|
2701
|
+
HarnessSuiteTaskSchema,
|
|
2702
|
+
HarnessSuiteSchema,
|
|
2703
|
+
HarnessOverlaySchema,
|
|
2704
|
+
HarnessExperimentSchema,
|
|
2705
|
+
HarnessComponentLayerSchema,
|
|
2706
|
+
HarnessComponentIdSchema,
|
|
2707
|
+
HarnessCatalogSchema,
|
|
2708
|
+
HarnessCatalogEntrySchema,
|
|
2560
2709
|
GraphRelationSchema,
|
|
2561
2710
|
GoalTaskSchema,
|
|
2562
2711
|
GoalGraphSchema,
|