@planu/cli 0.96.5 → 0.97.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/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +3 -1
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/config/compliance-profiles.json +62 -0
- package/dist/config/license-plans.json +18 -2
- package/dist/config/spec-templates/crud-rest-api/spec.md +35 -0
- package/dist/config/spec-templates/crud-rest-api/template.json +10 -0
- package/dist/config/spec-templates/email-notifications/spec.md +31 -0
- package/dist/config/spec-templates/email-notifications/template.json +10 -0
- package/dist/config/spec-templates/file-upload-s3/spec.md +31 -0
- package/dist/config/spec-templates/file-upload-s3/template.json +11 -0
- package/dist/config/spec-templates/jwt-auth/spec.md +35 -0
- package/dist/config/spec-templates/jwt-auth/template.json +10 -0
- package/dist/config/spec-templates/oauth-social-login/spec.md +31 -0
- package/dist/config/spec-templates/oauth-social-login/template.json +10 -0
- package/dist/config/spec-templates/rate-limiting/spec.md +31 -0
- package/dist/config/spec-templates/rate-limiting/template.json +10 -0
- package/dist/config/spec-templates/stripe-payments/spec.md +32 -0
- package/dist/config/spec-templates/stripe-payments/template.json +10 -0
- package/dist/config/spec-templates/webhook-system/spec.md +36 -0
- package/dist/config/spec-templates/webhook-system/template.json +10 -0
- package/dist/engine/agent-ready-exporter/formatters/devin.d.ts +7 -0
- package/dist/engine/agent-ready-exporter/formatters/devin.d.ts.map +1 -0
- package/dist/engine/agent-ready-exporter/formatters/devin.js +23 -0
- package/dist/engine/agent-ready-exporter/formatters/devin.js.map +1 -0
- package/dist/engine/agent-ready-exporter/formatters/generic.d.ts +7 -0
- package/dist/engine/agent-ready-exporter/formatters/generic.d.ts.map +1 -0
- package/dist/engine/agent-ready-exporter/formatters/generic.js +9 -0
- package/dist/engine/agent-ready-exporter/formatters/generic.js.map +1 -0
- package/dist/engine/agent-ready-exporter/formatters/kiro.d.ts +6 -0
- package/dist/engine/agent-ready-exporter/formatters/kiro.d.ts.map +1 -0
- package/dist/engine/agent-ready-exporter/formatters/kiro.js +34 -0
- package/dist/engine/agent-ready-exporter/formatters/kiro.js.map +1 -0
- package/dist/engine/agent-ready-exporter/formatters/swe-agent.d.ts +6 -0
- package/dist/engine/agent-ready-exporter/formatters/swe-agent.d.ts.map +1 -0
- package/dist/engine/agent-ready-exporter/formatters/swe-agent.js +40 -0
- package/dist/engine/agent-ready-exporter/formatters/swe-agent.js.map +1 -0
- package/dist/engine/agent-ready-exporter.d.ts +11 -0
- package/dist/engine/agent-ready-exporter.d.ts.map +1 -0
- package/dist/engine/agent-ready-exporter.js +86 -0
- package/dist/engine/agent-ready-exporter.js.map +1 -0
- package/dist/engine/compliance-checker.d.ts +19 -0
- package/dist/engine/compliance-checker.d.ts.map +1 -0
- package/dist/engine/compliance-checker.js +145 -0
- package/dist/engine/compliance-checker.js.map +1 -0
- package/dist/engine/generate-tests/generators/property-based-generator.d.ts +12 -0
- package/dist/engine/generate-tests/generators/property-based-generator.d.ts.map +1 -0
- package/dist/engine/generate-tests/generators/property-based-generator.js +159 -0
- package/dist/engine/generate-tests/generators/property-based-generator.js.map +1 -0
- package/dist/engine/jira-exporter.d.ts +39 -0
- package/dist/engine/jira-exporter.d.ts.map +1 -0
- package/dist/engine/jira-exporter.js +190 -0
- package/dist/engine/jira-exporter.js.map +1 -0
- package/dist/engine/linear-exporter.d.ts +32 -0
- package/dist/engine/linear-exporter.d.ts.map +1 -0
- package/dist/engine/linear-exporter.js +184 -0
- package/dist/engine/linear-exporter.js.map +1 -0
- package/dist/engine/property-test-generator.d.ts +14 -0
- package/dist/engine/property-test-generator.d.ts.map +1 -0
- package/dist/engine/property-test-generator.js +223 -0
- package/dist/engine/property-test-generator.js.map +1 -0
- package/dist/engine/skill-evaluator.d.ts +21 -0
- package/dist/engine/skill-evaluator.d.ts.map +1 -0
- package/dist/engine/skill-evaluator.js +126 -0
- package/dist/engine/skill-evaluator.js.map +1 -0
- package/dist/engine/spec-quality-scorer.d.ts +4 -0
- package/dist/engine/spec-quality-scorer.d.ts.map +1 -0
- package/dist/engine/spec-quality-scorer.js +334 -0
- package/dist/engine/spec-quality-scorer.js.map +1 -0
- package/dist/engine/spec-template-engine.d.ts +26 -0
- package/dist/engine/spec-template-engine.d.ts.map +1 -0
- package/dist/engine/spec-template-engine.js +127 -0
- package/dist/engine/spec-template-engine.js.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/compliance-store.d.ts +11 -0
- package/dist/storage/compliance-store.d.ts.map +1 -0
- package/dist/storage/compliance-store.js +30 -0
- package/dist/storage/compliance-store.js.map +1 -0
- package/dist/storage/jira-store.d.ts +30 -0
- package/dist/storage/jira-store.d.ts.map +1 -0
- package/dist/storage/jira-store.js +84 -0
- package/dist/storage/jira-store.js.map +1 -0
- package/dist/storage/linear-store.d.ts +30 -0
- package/dist/storage/linear-store.d.ts.map +1 -0
- package/dist/storage/linear-store.js +84 -0
- package/dist/storage/linear-store.js.map +1 -0
- package/dist/tools/check-readiness.d.ts.map +1 -1
- package/dist/tools/check-readiness.js +8 -2
- package/dist/tools/check-readiness.js.map +1 -1
- package/dist/tools/compliance-handler.d.ts +6 -0
- package/dist/tools/compliance-handler.d.ts.map +1 -0
- package/dist/tools/compliance-handler.js +99 -0
- package/dist/tools/compliance-handler.js.map +1 -0
- package/dist/tools/eval-skill-handler.d.ts +4 -0
- package/dist/tools/eval-skill-handler.d.ts.map +1 -0
- package/dist/tools/eval-skill-handler.js +26 -0
- package/dist/tools/eval-skill-handler.js.map +1 -0
- package/dist/tools/export-spec.d.ts.map +1 -1
- package/dist/tools/export-spec.js +42 -1
- package/dist/tools/export-spec.js.map +1 -1
- package/dist/tools/generate-tests/generators/property-based-generator.d.ts +11 -0
- package/dist/tools/generate-tests/generators/property-based-generator.d.ts.map +1 -0
- package/dist/tools/generate-tests/generators/property-based-generator.js +27 -0
- package/dist/tools/generate-tests/generators/property-based-generator.js.map +1 -0
- package/dist/tools/generate-tests/spec-dispatcher.d.ts +5 -0
- package/dist/tools/generate-tests/spec-dispatcher.d.ts.map +1 -1
- package/dist/tools/generate-tests/spec-dispatcher.js +18 -1
- package/dist/tools/generate-tests/spec-dispatcher.js.map +1 -1
- package/dist/tools/jira-sync-handler.d.ts +6 -0
- package/dist/tools/jira-sync-handler.d.ts.map +1 -0
- package/dist/tools/jira-sync-handler.js +220 -0
- package/dist/tools/jira-sync-handler.js.map +1 -0
- package/dist/tools/linear-sync-handler.d.ts +6 -0
- package/dist/tools/linear-sync-handler.d.ts.map +1 -0
- package/dist/tools/linear-sync-handler.js +212 -0
- package/dist/tools/linear-sync-handler.js.map +1 -0
- package/dist/tools/register-export-tools.d.ts.map +1 -1
- package/dist/tools/register-export-tools.js +10 -3
- package/dist/tools/register-export-tools.js.map +1 -1
- package/dist/tools/register-spec-314.d.ts +3 -0
- package/dist/tools/register-spec-314.d.ts.map +1 -0
- package/dist/tools/register-spec-314.js +38 -0
- package/dist/tools/register-spec-314.js.map +1 -0
- package/dist/tools/register-spec-316.d.ts +3 -0
- package/dist/tools/register-spec-316.d.ts.map +1 -0
- package/dist/tools/register-spec-316.js +71 -0
- package/dist/tools/register-spec-316.js.map +1 -0
- package/dist/tools/register-spec-317.d.ts +3 -0
- package/dist/tools/register-spec-317.d.ts.map +1 -0
- package/dist/tools/register-spec-317.js +158 -0
- package/dist/tools/register-spec-317.js.map +1 -0
- package/dist/tools/register-spec-319.d.ts +3 -0
- package/dist/tools/register-spec-319.d.ts.map +1 -0
- package/dist/tools/register-spec-319.js +59 -0
- package/dist/tools/register-spec-319.js.map +1 -0
- package/dist/tools/register-spec-320.d.ts +3 -0
- package/dist/tools/register-spec-320.d.ts.map +1 -0
- package/dist/tools/register-spec-320.js +60 -0
- package/dist/tools/register-spec-320.js.map +1 -0
- package/dist/tools/spec-marketplace-handler.d.ts +6 -0
- package/dist/tools/spec-marketplace-handler.d.ts.map +1 -0
- package/dist/tools/spec-marketplace-handler.js +113 -0
- package/dist/tools/spec-marketplace-handler.js.map +1 -0
- package/dist/tools/spec-quality-score-handler.d.ts +7 -0
- package/dist/tools/spec-quality-score-handler.d.ts.map +1 -0
- package/dist/tools/spec-quality-score-handler.js +106 -0
- package/dist/tools/spec-quality-score-handler.js.map +1 -0
- package/dist/types/agent-ready.d.ts +58 -0
- package/dist/types/agent-ready.d.ts.map +1 -0
- package/dist/types/agent-ready.js +3 -0
- package/dist/types/agent-ready.js.map +1 -0
- package/dist/types/compliance.d.ts +44 -0
- package/dist/types/compliance.d.ts.map +1 -0
- package/dist/types/compliance.js +3 -0
- package/dist/types/compliance.js.map +1 -0
- package/dist/types/export.d.ts +5 -1
- package/dist/types/export.d.ts.map +1 -1
- package/dist/types/export.js +1 -1
- package/dist/types/export.js.map +1 -1
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/jira-linear.d.ts +216 -0
- package/dist/types/jira-linear.d.ts.map +1 -0
- package/dist/types/jira-linear.js +3 -0
- package/dist/types/jira-linear.js.map +1 -0
- package/dist/types/property-testing.d.ts +50 -0
- package/dist/types/property-testing.d.ts.map +1 -0
- package/dist/types/property-testing.js +3 -0
- package/dist/types/property-testing.js.map +1 -0
- package/dist/types/skill-eval.d.ts +41 -0
- package/dist/types/skill-eval.d.ts.map +1 -0
- package/dist/types/skill-eval.js +3 -0
- package/dist/types/skill-eval.js.map +1 -0
- package/dist/types/spec-marketplace.d.ts +31 -0
- package/dist/types/spec-marketplace.d.ts.map +1 -0
- package/dist/types/spec-marketplace.js +3 -0
- package/dist/types/spec-marketplace.js.map +1 -0
- package/dist/types/spec-quality.d.ts +36 -0
- package/dist/types/spec-quality.d.ts.map +1 -0
- package/dist/types/spec-quality.js +3 -0
- package/dist/types/spec-quality.js.map +1 -0
- package/package.json +7 -2
- package/src/config/compliance-profiles.json +62 -0
- package/src/config/license-plans.json +18 -2
- package/src/config/spec-templates/crud-rest-api/spec.md +35 -0
- package/src/config/spec-templates/crud-rest-api/template.json +10 -0
- package/src/config/spec-templates/email-notifications/spec.md +31 -0
- package/src/config/spec-templates/email-notifications/template.json +10 -0
- package/src/config/spec-templates/file-upload-s3/spec.md +31 -0
- package/src/config/spec-templates/file-upload-s3/template.json +11 -0
- package/src/config/spec-templates/jwt-auth/spec.md +35 -0
- package/src/config/spec-templates/jwt-auth/template.json +10 -0
- package/src/config/spec-templates/oauth-social-login/spec.md +31 -0
- package/src/config/spec-templates/oauth-social-login/template.json +10 -0
- package/src/config/spec-templates/rate-limiting/spec.md +31 -0
- package/src/config/spec-templates/rate-limiting/template.json +10 -0
- package/src/config/spec-templates/stripe-payments/spec.md +32 -0
- package/src/config/spec-templates/stripe-payments/template.json +10 -0
- package/src/config/spec-templates/webhook-system/spec.md +36 -0
- package/src/config/spec-templates/webhook-system/template.json +10 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgentReadySpec } from '../../../types/agent-ready.js';
|
|
2
|
+
/**
|
|
3
|
+
* Augment an AgentReadySpec with Kiro-specific EARS requirements and steering context.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatKiro(spec: AgentReadySpec): string;
|
|
6
|
+
//# sourceMappingURL=kiro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiro.d.ts","sourceRoot":"","sources":["../../../../src/engine/agent-ready-exporter/formatters/kiro.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAA6B,MAAM,+BAA+B,CAAC;AAc/F;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAoBvD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// engine/agent-ready-exporter/formatters/kiro.ts — Kiro EARS format — SPEC-318
|
|
2
|
+
/**
|
|
3
|
+
* Convert a success criterion to EARS (Easy Approach to Requirements Syntax) format.
|
|
4
|
+
* Pattern: "WHEN <trigger> THE SYSTEM SHALL <response>"
|
|
5
|
+
*/
|
|
6
|
+
function toEarsFormat(criterion) {
|
|
7
|
+
const lower = criterion.toLowerCase();
|
|
8
|
+
if (lower.startsWith('when ') || lower.startsWith('the system')) {
|
|
9
|
+
return criterion;
|
|
10
|
+
}
|
|
11
|
+
return `THE SYSTEM SHALL ${criterion}`;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Augment an AgentReadySpec with Kiro-specific EARS requirements and steering context.
|
|
15
|
+
*/
|
|
16
|
+
export function formatKiro(spec) {
|
|
17
|
+
const requirements = spec.agent_context.success_criteria.map((criterion, idx) => ({
|
|
18
|
+
id: `REQ-${String(idx + 1).padStart(3, '0')}`,
|
|
19
|
+
ears_format: toEarsFormat(criterion),
|
|
20
|
+
original: criterion,
|
|
21
|
+
}));
|
|
22
|
+
const kiroSpec = {
|
|
23
|
+
...spec,
|
|
24
|
+
_format: 'kiro',
|
|
25
|
+
kiro_requirements: requirements,
|
|
26
|
+
steering: {
|
|
27
|
+
product: `Implement ${spec.title} following the success criteria`,
|
|
28
|
+
tech: spec.agent_context.constraints.join('; ') || 'Follow existing project conventions',
|
|
29
|
+
structure: 'Respect the files_to_create and files_to_modify boundaries',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
return JSON.stringify(kiroSpec, null, 2);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=kiro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiro.js","sourceRoot":"","sources":["../../../../src/engine/agent-ready-exporter/formatters/kiro.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAI/E;;;GAGG;AACH,SAAS,YAAY,CAAC,SAAiB;IACrC,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IACtC,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChE,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,oBAAoB,SAAS,EAAE,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAoB;IAC7C,MAAM,YAAY,GAAsB,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,GAAG,CAC7E,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACnB,EAAE,EAAE,OAAO,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE;QAC7C,WAAW,EAAE,YAAY,CAAC,SAAS,CAAC;QACpC,QAAQ,EAAE,SAAS;KACpB,CAAC,CACH,CAAC;IAEF,MAAM,QAAQ,GAAa;QACzB,GAAG,IAAI;QACP,OAAO,EAAE,MAAM;QACf,iBAAiB,EAAE,YAAY;QAC/B,QAAQ,EAAE;YACR,OAAO,EAAE,aAAa,IAAI,CAAC,KAAK,iCAAiC;YACjE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,qCAAqC;YACxF,SAAS,EAAE,4DAA4D;SACxE;KACF,CAAC;IACF,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgentReadySpec } from '../../../types/agent-ready.js';
|
|
2
|
+
/**
|
|
3
|
+
* Augment an AgentReadySpec with SWE-agent trajectory hints and instance metadata.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatSweAgent(spec: AgentReadySpec): string;
|
|
6
|
+
//# sourceMappingURL=swe-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swe-agent.d.ts","sourceRoot":"","sources":["../../../../src/engine/agent-ready-exporter/formatters/swe-agent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,+BAA+B,CAAC;AAmCvC;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAQ3D"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// engine/agent-ready-exporter/formatters/swe-agent.ts — SWE-agent trajectory format — SPEC-318
|
|
2
|
+
/**
|
|
3
|
+
* Build trajectory hints from spec context.
|
|
4
|
+
* SWE-agent benefits from structured thought/action pairs as navigation hints.
|
|
5
|
+
*/
|
|
6
|
+
function buildTrajectoryHints(spec) {
|
|
7
|
+
const steps = [
|
|
8
|
+
{
|
|
9
|
+
thought: `I need to implement: ${spec.agent_context.objective}`,
|
|
10
|
+
action: `Read existing files: ${spec.agent_context.files_to_modify.join(', ') || 'none to modify'}`,
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
if (spec.agent_context.files_to_create.length > 0) {
|
|
14
|
+
steps.push({
|
|
15
|
+
thought: 'I need to create new files as specified',
|
|
16
|
+
action: `Create files: ${spec.agent_context.files_to_create.join(', ')}`,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
steps.push({
|
|
20
|
+
thought: 'Run tests to verify the implementation',
|
|
21
|
+
action: spec.agent_context.test_command,
|
|
22
|
+
}, {
|
|
23
|
+
thought: 'Validate the full solution',
|
|
24
|
+
action: spec.agent_context.validation_command,
|
|
25
|
+
});
|
|
26
|
+
return steps;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Augment an AgentReadySpec with SWE-agent trajectory hints and instance metadata.
|
|
30
|
+
*/
|
|
31
|
+
export function formatSweAgent(spec) {
|
|
32
|
+
const sweSpec = {
|
|
33
|
+
...spec,
|
|
34
|
+
_format: 'swe-agent',
|
|
35
|
+
instance_id: `${spec.spec_id.toLowerCase().replace(/[^a-z0-9]/g, '-')}-instance`,
|
|
36
|
+
trajectory_hints: buildTrajectoryHints(spec),
|
|
37
|
+
};
|
|
38
|
+
return JSON.stringify(sweSpec, null, 2);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=swe-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swe-agent.js","sourceRoot":"","sources":["../../../../src/engine/agent-ready-exporter/formatters/swe-agent.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAQ/F;;;GAGG;AACH,SAAS,oBAAoB,CAAC,IAAoB;IAChD,MAAM,KAAK,GAA6B;QACtC;YACE,OAAO,EAAE,wBAAwB,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE;YAC/D,MAAM,EAAE,wBAAwB,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,gBAAgB,EAAE;SACpG;KACF,CAAC;IAEF,IAAI,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClD,KAAK,CAAC,IAAI,CAAC;YACT,OAAO,EAAE,yCAAyC;YAClD,MAAM,EAAE,iBAAiB,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SACzE,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CACR;QACE,OAAO,EAAE,wCAAwC;QACjD,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,YAAY;KACxC,EACD;QACE,OAAO,EAAE,4BAA4B;QACrC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,kBAAkB;KAC9C,CACF,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,IAAoB;IACjD,MAAM,OAAO,GAAiB;QAC5B,GAAG,IAAI;QACP,OAAO,EAAE,WAAW;QACpB,WAAW,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,WAAW;QAChF,gBAAgB,EAAE,oBAAoB,CAAC,IAAI,CAAC;KAC7C,CAAC;IACF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Spec } from '../types/index.js';
|
|
2
|
+
import type { AgentTarget, AgentReadySpec } from '../types/agent-ready.js';
|
|
3
|
+
/**
|
|
4
|
+
* Convert a Spec into an AgentReadySpec structure optimized for autonomous coding agents.
|
|
5
|
+
*/
|
|
6
|
+
export declare function specToAgentReady(spec: Spec, agentTarget: AgentTarget): AgentReadySpec;
|
|
7
|
+
/**
|
|
8
|
+
* Serialize an AgentReadySpec to a string using the appropriate formatter.
|
|
9
|
+
*/
|
|
10
|
+
export declare function serializeAgentReady(agentSpec: AgentReadySpec, target: AgentTarget): string;
|
|
11
|
+
//# sourceMappingURL=agent-ready-exporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-ready-exporter.d.ts","sourceRoot":"","sources":["../../src/engine/agent-ready-exporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAgB,MAAM,yBAAyB,CAAC;AAuEzF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,GAAG,cAAc,CAOrF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAW1F"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// engine/agent-ready-exporter.ts — Agent-Ready spec export central module — SPEC-318
|
|
2
|
+
import { formatGeneric } from './agent-ready-exporter/formatters/generic.js';
|
|
3
|
+
import { formatDevin } from './agent-ready-exporter/formatters/devin.js';
|
|
4
|
+
import { formatKiro } from './agent-ready-exporter/formatters/kiro.js';
|
|
5
|
+
import { formatSweAgent } from './agent-ready-exporter/formatters/swe-agent.js';
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Context extraction helpers
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
function extractObjective(spec) {
|
|
10
|
+
return `Implement "${spec.title}" (${spec.id}) — a ${spec.type} spec with ${spec.scope} scope.`;
|
|
11
|
+
}
|
|
12
|
+
function extractSuccessCriteria(spec) {
|
|
13
|
+
// Build criteria from spec metadata — technical path is the source of truth at runtime,
|
|
14
|
+
// but at export time we derive criteria from available structured fields.
|
|
15
|
+
const criteria = [
|
|
16
|
+
`Spec ${spec.id} passes validation (pnpm validate or equivalent)`,
|
|
17
|
+
`All tests pass for modified/created files`,
|
|
18
|
+
`TypeScript strict mode: zero type errors`,
|
|
19
|
+
`ESLint: zero warnings or errors`,
|
|
20
|
+
];
|
|
21
|
+
if (spec.estimation.devHours > 0) {
|
|
22
|
+
criteria.push(`Implementation completed within estimated ${String(spec.estimation.devHours)}h`);
|
|
23
|
+
}
|
|
24
|
+
return criteria;
|
|
25
|
+
}
|
|
26
|
+
function extractConstraints(spec) {
|
|
27
|
+
const constraints = [
|
|
28
|
+
'TypeScript strict mode enforced — no any types',
|
|
29
|
+
'ES modules with .js extensions on all imports',
|
|
30
|
+
`Risk level is ${spec.risk} — review carefully before merging`,
|
|
31
|
+
];
|
|
32
|
+
if (spec.tags.length > 0) {
|
|
33
|
+
constraints.push(`Tagged: ${spec.tags.join(', ')} — respect domain conventions`);
|
|
34
|
+
}
|
|
35
|
+
return constraints;
|
|
36
|
+
}
|
|
37
|
+
function extractDependencies(spec) {
|
|
38
|
+
return spec.dependencies.length > 0
|
|
39
|
+
? spec.dependencies
|
|
40
|
+
: ['No blocking dependencies — can start immediately'];
|
|
41
|
+
}
|
|
42
|
+
function buildAgentContext(spec) {
|
|
43
|
+
return {
|
|
44
|
+
objective: extractObjective(spec),
|
|
45
|
+
success_criteria: extractSuccessCriteria(spec),
|
|
46
|
+
constraints: extractConstraints(spec),
|
|
47
|
+
files_to_create: [],
|
|
48
|
+
files_to_modify: [spec.specPath, spec.technicalPath].filter(Boolean),
|
|
49
|
+
forbidden_files: ['src/index.ts', 'src/types/index.ts'],
|
|
50
|
+
test_command: 'pnpm test',
|
|
51
|
+
validation_command: 'pnpm typecheck && pnpm lint',
|
|
52
|
+
effort_estimate: `${String(spec.estimation.devHours)}h (${spec.difficulty} difficulty)`,
|
|
53
|
+
dependencies: extractDependencies(spec),
|
|
54
|
+
rollback: `git revert HEAD or delete branch feat/${spec.id.toLowerCase()}-*`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// Public API
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
/**
|
|
61
|
+
* Convert a Spec into an AgentReadySpec structure optimized for autonomous coding agents.
|
|
62
|
+
*/
|
|
63
|
+
export function specToAgentReady(spec, agentTarget) {
|
|
64
|
+
return {
|
|
65
|
+
spec_id: spec.id,
|
|
66
|
+
title: spec.title,
|
|
67
|
+
agent_context: buildAgentContext(spec),
|
|
68
|
+
_format: agentTarget,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Serialize an AgentReadySpec to a string using the appropriate formatter.
|
|
73
|
+
*/
|
|
74
|
+
export function serializeAgentReady(agentSpec, target) {
|
|
75
|
+
switch (target) {
|
|
76
|
+
case 'devin':
|
|
77
|
+
return formatDevin(agentSpec);
|
|
78
|
+
case 'kiro':
|
|
79
|
+
return formatKiro(agentSpec);
|
|
80
|
+
case 'swe-agent':
|
|
81
|
+
return formatSweAgent(agentSpec);
|
|
82
|
+
case 'generic':
|
|
83
|
+
return formatGeneric(agentSpec);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=agent-ready-exporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-ready-exporter.js","sour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AK,OAAO;YACV,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;QAChC,KAAK,MAAM;YACT,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QAC/B,KAAK,WAAW;YACd,OAAO,cAAc,CAAC,SAAS,CAAC,CAAC;QACnC,KAAK,SAAS;YACZ,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComplianceSpecFramework, ComplianceGapReport } from '../types/compliance.js';
|
|
2
|
+
import type { Spec } from '../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Detect which compliance frameworks apply based on keyword matching
|
|
5
|
+
* in the spec title and description text.
|
|
6
|
+
*/
|
|
7
|
+
export declare function detectComplianceContext(title: string, description: string): ComplianceSpecFramework[];
|
|
8
|
+
/**
|
|
9
|
+
* Evaluate a spec's acceptance criteria against required compliance criteria.
|
|
10
|
+
* Reads the spec markdown file to extract AC content.
|
|
11
|
+
* Returns a full gap report including missing criteria and coverage percentage.
|
|
12
|
+
*/
|
|
13
|
+
export declare function checkCompliance(spec: Spec, frameworks: ComplianceSpecFramework[]): Promise<ComplianceGapReport>;
|
|
14
|
+
/**
|
|
15
|
+
* Return the full list of compliance criteria for the specified frameworks.
|
|
16
|
+
* Used when injecting missing criteria into a spec.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getComplianceCriteria(frameworks: ComplianceSpecFramework[]): string[];
|
|
19
|
+
//# sourceMappingURL=compliance-checker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compliance-checker.d.ts","sourceRoot":"","sources":["../../src/engine/compliance-checker.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,uBAAuB,EAEvB,mBAAmB,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAwB9C;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAClB,uBAAuB,EAAE,CAiB3B;AAMD;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,uBAAuB,EAAE,GACpC,OAAO,CAAC,mBAAmB,CAAC,CAiC9B;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,uBAAuB,EAAE,GAAG,MAAM,EAAE,CAarF"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// engine/compliance-checker.ts — Compliance-as-Specs logic (SPEC-319)
|
|
2
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Profile loading
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
let _profiles = null;
|
|
10
|
+
function loadProfiles() {
|
|
11
|
+
if (_profiles !== null) {
|
|
12
|
+
return _profiles;
|
|
13
|
+
}
|
|
14
|
+
const dir = fileURLToPath(new URL('../config', import.meta.url));
|
|
15
|
+
const raw = readFileSync(join(dir, 'compliance-profiles.json'), 'utf-8');
|
|
16
|
+
_profiles = JSON.parse(raw);
|
|
17
|
+
return _profiles;
|
|
18
|
+
}
|
|
19
|
+
const ALL_FRAMEWORKS = ['gdpr', 'hipaa', 'pci-dss', 'soc2', 'ccpa'];
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Context detection
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
/**
|
|
24
|
+
* Detect which compliance frameworks apply based on keyword matching
|
|
25
|
+
* in the spec title and description text.
|
|
26
|
+
*/
|
|
27
|
+
export function detectComplianceContext(title, description) {
|
|
28
|
+
const profiles = loadProfiles();
|
|
29
|
+
const text = `${title} ${description}`.toLowerCase();
|
|
30
|
+
const detected = [];
|
|
31
|
+
for (const framework of ALL_FRAMEWORKS) {
|
|
32
|
+
const profile = profiles[framework];
|
|
33
|
+
if (profile === undefined) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const matches = profile.keywords.some((kw) => text.includes(kw.toLowerCase()));
|
|
37
|
+
if (matches) {
|
|
38
|
+
detected.push(framework);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return detected;
|
|
42
|
+
}
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Gap analysis
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
/**
|
|
47
|
+
* Evaluate a spec's acceptance criteria against required compliance criteria.
|
|
48
|
+
* Reads the spec markdown file to extract AC content.
|
|
49
|
+
* Returns a full gap report including missing criteria and coverage percentage.
|
|
50
|
+
*/
|
|
51
|
+
export async function checkCompliance(spec, frameworks) {
|
|
52
|
+
const profiles = loadProfiles();
|
|
53
|
+
const specContent = await readSpecContent(spec);
|
|
54
|
+
const acText = `${spec.title} ${specContent}`.toLowerCase();
|
|
55
|
+
const gaps = [];
|
|
56
|
+
for (const framework of frameworks) {
|
|
57
|
+
const profile = profiles[framework];
|
|
58
|
+
if (profile === undefined) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
for (const criterion of profile.criteria) {
|
|
62
|
+
const status = matchCriterion(criterion, acText);
|
|
63
|
+
if (status !== 'present') {
|
|
64
|
+
gaps.push({ framework, criterion, status });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const totalCriteria = countTotalCriteria(frameworks, profiles);
|
|
69
|
+
const missingCriteria = gaps.filter((g) => g.status === 'missing').map((g) => g.criterion);
|
|
70
|
+
const presentCount = totalCriteria - gaps.length;
|
|
71
|
+
const coveragePercent = totalCriteria === 0 ? 100 : Math.round((presentCount / totalCriteria) * 100);
|
|
72
|
+
return {
|
|
73
|
+
specId: spec.id,
|
|
74
|
+
frameworks,
|
|
75
|
+
gaps,
|
|
76
|
+
missingCriteria,
|
|
77
|
+
coveragePercent,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Return the full list of compliance criteria for the specified frameworks.
|
|
82
|
+
* Used when injecting missing criteria into a spec.
|
|
83
|
+
*/
|
|
84
|
+
export function getComplianceCriteria(frameworks) {
|
|
85
|
+
const profiles = loadProfiles();
|
|
86
|
+
const criteria = [];
|
|
87
|
+
for (const framework of frameworks) {
|
|
88
|
+
const profile = profiles[framework];
|
|
89
|
+
if (profile === undefined) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
criteria.push(...profile.criteria);
|
|
93
|
+
}
|
|
94
|
+
return criteria;
|
|
95
|
+
}
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
// Helpers
|
|
98
|
+
// ---------------------------------------------------------------------------
|
|
99
|
+
async function readSpecContent(spec) {
|
|
100
|
+
/* v8 ignore start */
|
|
101
|
+
if (existsSync(spec.specPath)) {
|
|
102
|
+
return readFile(spec.specPath, 'utf-8');
|
|
103
|
+
}
|
|
104
|
+
/* v8 ignore stop */
|
|
105
|
+
return '';
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Check how well a compliance criterion is represented in the spec content text.
|
|
109
|
+
* Uses keyword extraction to match against the full spec markdown.
|
|
110
|
+
*/
|
|
111
|
+
function matchCriterion(criterion, acText) {
|
|
112
|
+
const keywords = extractKeywords(criterion);
|
|
113
|
+
if (keywords.length === 0) {
|
|
114
|
+
return 'missing';
|
|
115
|
+
}
|
|
116
|
+
const matched = keywords.filter((kw) => acText.includes(kw));
|
|
117
|
+
const ratio = matched.length / keywords.length;
|
|
118
|
+
if (ratio >= 0.7) {
|
|
119
|
+
return 'present';
|
|
120
|
+
}
|
|
121
|
+
if (ratio >= 0.3) {
|
|
122
|
+
return 'partial';
|
|
123
|
+
}
|
|
124
|
+
return 'missing';
|
|
125
|
+
}
|
|
126
|
+
const STOPWORDS = new Set([
|
|
127
|
+
'a', 'an', 'the', 'is', 'are', 'in', 'of', 'for', 'and', 'or',
|
|
128
|
+
'to', 'with', 'all', 'at', 'be', 'by', 'on', 'that', 'this',
|
|
129
|
+
'it', 'its', 'not', 'as', 'from', 'before', 'after',
|
|
130
|
+
]);
|
|
131
|
+
function extractKeywords(text) {
|
|
132
|
+
return text
|
|
133
|
+
.toLowerCase()
|
|
134
|
+
.replace(/[()[\]{}.,;:!?'"]/g, ' ')
|
|
135
|
+
.split(/\s+/)
|
|
136
|
+
.filter((w) => w.length > 2 && !STOPWORDS.has(w));
|
|
137
|
+
}
|
|
138
|
+
function countTotalCriteria(frameworks, profiles) {
|
|
139
|
+
let total = 0;
|
|
140
|
+
for (const fw of frameworks) {
|
|
141
|
+
total += profiles[fw]?.criteria.length ?? 0;
|
|
142
|
+
}
|
|
143
|
+
return total;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=compliance-checker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compliance-checker.js","sourceRoot":"","sources":["../../src/engine/compliance-checker.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AASzC,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E,IAAI,SAAS,GAAgC,IAAI,CAAC;AAElD,SAAS,YAAY;IACnB,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,MAAM,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C;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACxB,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI;IAC7D,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM;IAC3D,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO;CACpD,CAAC,CAAC;AAEH,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,IAAI;SACR,WAAW,EAAE;SACb,OAAO,CAAC,oBAAoB,EAAE,GAAG,CAAC;SAClC,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,kBAAkB,CAAC,UAAqC,EAAE,QAA8B;IAC/F,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;QAC5B,KAAK,IAAI,QAAQ,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Spec, ProjectKnowledge } from '../../../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate a complete property-based test file as a string.
|
|
4
|
+
* Adapts output to fast-check (JS/TS), hypothesis (Python), jqwik (Java/Kotlin),
|
|
5
|
+
* or pseudo-code generic format based on detected framework.
|
|
6
|
+
*
|
|
7
|
+
* @param spec - The spec metadata (title, id used for file naming/headers).
|
|
8
|
+
* @param context - Project knowledge (language, stack) for framework detection.
|
|
9
|
+
* @param criteria - Acceptance criteria strings extracted from spec.md by the caller.
|
|
10
|
+
*/
|
|
11
|
+
export declare function generatePropertyBasedTests(spec: Spec, context: ProjectKnowledge, criteria?: string[]): string;
|
|
12
|
+
//# sourceMappingURL=property-based-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-based-generator.d.ts","sourceRoot":"","sources":["../../../../src/engine/generate-tests/generators/property-based-generator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAgItE;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,EACzB,QAAQ,GAAE,MAAM,EAAO,GACtB,MAAM,CA0CR"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// engine/generate-tests/generators/property-based-generator.ts — SPEC-315
|
|
2
|
+
// High-level generator: produces a full test file string from spec + context.
|
|
3
|
+
import { extractPropertyTests, detectPropertyFramework } from '../../property-test-generator.js';
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
// File header builders per framework
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
function buildFastCheckHeader(specTitle) {
|
|
8
|
+
return `// Property-based tests for: ${specTitle}
|
|
9
|
+
// Generated by Planu SDD — strategy:property-based (SPEC-315)
|
|
10
|
+
// Framework: fast-check
|
|
11
|
+
|
|
12
|
+
import * as fc from 'fast-check';
|
|
13
|
+
import { describe, it } from 'vitest';
|
|
14
|
+
|
|
15
|
+
describe('${specTitle} — property-based tests', () => {`;
|
|
16
|
+
}
|
|
17
|
+
function buildHypothesisHeader(specTitle) {
|
|
18
|
+
return `# Property-based tests for: ${specTitle}
|
|
19
|
+
# Generated by Planu SDD — strategy:property-based (SPEC-315)
|
|
20
|
+
# Framework: hypothesis
|
|
21
|
+
|
|
22
|
+
from hypothesis import given, settings, HealthCheck
|
|
23
|
+
from hypothesis import strategies as st
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Test${specTitle.replace(/[^a-zA-Z0-9]/g, '')}Properties:
|
|
27
|
+
"""Property-based tests for ${specTitle}."""
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
function buildJqwikHeader(specTitle) {
|
|
31
|
+
const className = specTitle.replace(/[^a-zA-Z0-9]/g, '');
|
|
32
|
+
return `// Property-based tests for: ${specTitle}
|
|
33
|
+
// Generated by Planu SDD — strategy:property-based (SPEC-315)
|
|
34
|
+
// Framework: jqwik
|
|
35
|
+
|
|
36
|
+
import net.jqwik.api.*;
|
|
37
|
+
import static org.assertj.core.api.Assertions.assertThat;
|
|
38
|
+
|
|
39
|
+
class ${className}PropertyTest {`;
|
|
40
|
+
}
|
|
41
|
+
function buildGenericHeader(specTitle) {
|
|
42
|
+
return `# Property-based tests for: ${specTitle}
|
|
43
|
+
# Generated by Planu SDD — strategy:property-based (SPEC-315)
|
|
44
|
+
# Framework: generic (adapt to your property testing library)
|
|
45
|
+
#
|
|
46
|
+
# Each property below describes an invariant that must hold for ALL valid inputs.
|
|
47
|
+
# Implement using your project's property testing framework.
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
// Test block builders per framework
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
function buildFastCheckBlock(test, index) {
|
|
54
|
+
return `
|
|
55
|
+
it('property ${index + 1}: ${test.invariant}', () => {
|
|
56
|
+
// Input domain: ${test.inputDomain}
|
|
57
|
+
// Shrink: ${test.shrinkStrategy}
|
|
58
|
+
${test.generatorCode}
|
|
59
|
+
});`;
|
|
60
|
+
}
|
|
61
|
+
function buildHypothesisBlock(test, _index) {
|
|
62
|
+
return `
|
|
63
|
+
${test.generatorCode}
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
function buildJqwikBlock(test, _index) {
|
|
67
|
+
return `
|
|
68
|
+
// Input domain: ${test.inputDomain}
|
|
69
|
+
// Shrink: ${test.shrinkStrategy}
|
|
70
|
+
${test.generatorCode}
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
function buildGenericBlock(test, index) {
|
|
74
|
+
return `
|
|
75
|
+
# Property ${index + 1}
|
|
76
|
+
${test.generatorCode}
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
// File footer builders
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
function buildFastCheckFooter() {
|
|
83
|
+
return '\n});\n';
|
|
84
|
+
}
|
|
85
|
+
function buildJqwikFooter() {
|
|
86
|
+
return '\n}\n';
|
|
87
|
+
}
|
|
88
|
+
function buildNoFooter() {
|
|
89
|
+
return '\n';
|
|
90
|
+
}
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// No-properties fallback
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
function buildFallbackContent(specTitle, language) {
|
|
95
|
+
if (language === 'python') {
|
|
96
|
+
return `# Property-based tests for: ${specTitle}
|
|
97
|
+
# Generated by Planu SDD — strategy:property-based (SPEC-315)
|
|
98
|
+
# No invariants detected in acceptance criteria.
|
|
99
|
+
# Add criteria with keywords: "must be positive", "idempotent", "for any input", etc.
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
return `// Property-based tests for: ${specTitle}
|
|
103
|
+
// Generated by Planu SDD — strategy:property-based (SPEC-315)
|
|
104
|
+
// No invariants detected in acceptance criteria.
|
|
105
|
+
// Add criteria with keywords: "must be positive", "idempotent", "for any input", etc.
|
|
106
|
+
`;
|
|
107
|
+
}
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
// Public API
|
|
110
|
+
// ---------------------------------------------------------------------------
|
|
111
|
+
/**
|
|
112
|
+
* Generate a complete property-based test file as a string.
|
|
113
|
+
* Adapts output to fast-check (JS/TS), hypothesis (Python), jqwik (Java/Kotlin),
|
|
114
|
+
* or pseudo-code generic format based on detected framework.
|
|
115
|
+
*
|
|
116
|
+
* @param spec - The spec metadata (title, id used for file naming/headers).
|
|
117
|
+
* @param context - Project knowledge (language, stack) for framework detection.
|
|
118
|
+
* @param criteria - Acceptance criteria strings extracted from spec.md by the caller.
|
|
119
|
+
*/
|
|
120
|
+
export function generatePropertyBasedTests(spec, context, criteria = []) {
|
|
121
|
+
const framework = detectPropertyFramework(context.language, context.stack);
|
|
122
|
+
const tests = extractPropertyTests({
|
|
123
|
+
criteria,
|
|
124
|
+
language: context.language,
|
|
125
|
+
stack: context.stack,
|
|
126
|
+
});
|
|
127
|
+
if (tests.length === 0) {
|
|
128
|
+
return buildFallbackContent(spec.title, context.language);
|
|
129
|
+
}
|
|
130
|
+
// Build header
|
|
131
|
+
let header;
|
|
132
|
+
let blockBuilder;
|
|
133
|
+
let footer;
|
|
134
|
+
switch (framework) {
|
|
135
|
+
case 'fast-check':
|
|
136
|
+
header = buildFastCheckHeader(spec.title);
|
|
137
|
+
blockBuilder = buildFastCheckBlock;
|
|
138
|
+
footer = buildFastCheckFooter();
|
|
139
|
+
break;
|
|
140
|
+
case 'hypothesis':
|
|
141
|
+
header = buildHypothesisHeader(spec.title);
|
|
142
|
+
blockBuilder = buildHypothesisBlock;
|
|
143
|
+
footer = buildNoFooter();
|
|
144
|
+
break;
|
|
145
|
+
case 'jqwik':
|
|
146
|
+
header = buildJqwikHeader(spec.title);
|
|
147
|
+
blockBuilder = buildJqwikBlock;
|
|
148
|
+
footer = buildJqwikFooter();
|
|
149
|
+
break;
|
|
150
|
+
case 'generic':
|
|
151
|
+
header = buildGenericHeader(spec.title);
|
|
152
|
+
blockBuilder = buildGenericBlock;
|
|
153
|
+
footer = buildNoFooter();
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
const blocks = tests.map((test, i) => blockBuilder(test, i)).join('');
|
|
157
|
+
return `${header}${blocks}${footer}`;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=property-based-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-based-generator.js","sourceRoot":"","sources":["../../../../src/engine/generate-tests/generators/property-based-generator.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,8EAA8E;AAI9E,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAEjG,8EAA8E;AAC9E,qCAAqC;AACrC,8EAA8E;AAE9E,SAAS,oBAAoB,CAAC,SAAiB;IAC7C,OAAO,gCAAgC,SAAS;;;;;;;YAOtC,SAAS,mCAAmC,CAAC;AACzD,CAAC;AAED,SAAS,qBAAqB,CAAC,SAAiB;IAC9C,OAAO,+BAA+B,SAAS;;;;;;;;YAQrC,SAAS,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;kCAChB,SAAS;CAC1C,CAAC;AACF,CAAC;AAED,SAAS,gBAAgB,CAAC,SAAiB;IACzC,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IACzD,OAAO,gCAAgC,SAAS;;;;;;;QAO1C,SAAS,gBAAgB,CAAC;AAClC,CAAC;AAED,SAAS,kBAAkB,CAAC,SAAiB;IAC3C,OAAO,+BAA+B,SAAS;;;;;;CAMhD,CAAC;AACF,CAAC;AAED,8EAA8E;AAC9E,oCAAoC;AACpC,8EAA8E;AAE9E,SAAS,mBAAmB,CAAC,IAAkB,EAAE,KAAa;IAC5D,OAAO;iBACQ,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,SAAS;uBACtB,IAAI,CAAC,WAAW;iBACtB,IAAI,CAAC,cAAc;MAC9B,IAAI,CAAC,aAAa;MAClB,CAAC;AACP,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAkB,EAAE,MAAc;IAC9D,OAAO;MACH,IAAI,CAAC,aAAa;CACvB,CAAC;AACF,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,CAAC,CAAC;IAC5D,CAAC;IAED,eAAe;IACf,IAAI,MAAc,CAAC;IACnB,IAAI,YAA2D,CAAC;IAChE,IAAI,MAAc,CAAC;IAEnB,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,YAAY;YACf,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1C,YAAY,GAAG,mBAAmB,CAAC;YACnC,MAAM,GAAG,oBAAoB,EAAE,CAAC;YAChC,MAAM;QACR,KAAK,YAAY;YACf,MAAM,GAAG,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3C,YAAY,GAAG,oBAAoB,CAAC;YACpC,MAAM,GAAG,aAAa,EAAE,CAAC;YACzB,MAAM;QACR,KAAK,OAAO;YACV,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtC,YAAY,GAAG,eAAe,CAAC;YAC/B,MAAM,GAAG,gBAAgB,EAAE,CAAC;YAC5B,MAAM;QACR,KAAK,SAAS;YACZ,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACxC,YAAY,GAAG,iBAAiB,CAAC;YACjC,MAAM,GAAG,aAAa,EAAE,CAAC;YACzB,MAAM;IACV,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { JiraConfig, JiraIssueRef, JiraApiIssue, Spec } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Map a Planu spec status to a Jira status name.
|
|
4
|
+
*/
|
|
5
|
+
export declare function mapSpecStatusToJira(specStatus: string): string;
|
|
6
|
+
export declare class JiraClient {
|
|
7
|
+
private readonly config;
|
|
8
|
+
private readonly authHeader;
|
|
9
|
+
private readonly baseUrl;
|
|
10
|
+
constructor(config: JiraConfig);
|
|
11
|
+
/**
|
|
12
|
+
* Create an Epic in Jira from a spec.
|
|
13
|
+
* Returns a JiraIssueRef with the new issue details.
|
|
14
|
+
*/
|
|
15
|
+
createEpic(spec: Spec): Promise<JiraIssueRef>;
|
|
16
|
+
/**
|
|
17
|
+
* Create a Story in Jira linked to a parent Epic.
|
|
18
|
+
* Returns a JiraIssueRef for the created story.
|
|
19
|
+
*/
|
|
20
|
+
createStory(specId: string, criterionText: string, epicKey: string): Promise<JiraIssueRef>;
|
|
21
|
+
/**
|
|
22
|
+
* Fetch a Jira issue by key.
|
|
23
|
+
* Returns the issue or null if not found.
|
|
24
|
+
*/
|
|
25
|
+
getIssue(key: string): Promise<JiraApiIssue | null>;
|
|
26
|
+
/**
|
|
27
|
+
* Transition a Jira issue to a target status name.
|
|
28
|
+
* Looks up available transitions and applies the matching one.
|
|
29
|
+
*/
|
|
30
|
+
updateIssueStatus(issueKey: string, targetStatus: string): Promise<void>;
|
|
31
|
+
private getTransitions;
|
|
32
|
+
private postJson;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Build a minimal Atlassian Document Format (ADF) document.
|
|
36
|
+
* Used for Jira issue descriptions in the REST API v3.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildAtlassianDoc(heading: string, bodyText: string): Record<string, unknown>;
|
|
39
|
+
//# sourceMappingURL=jira-exporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jira-exporter.d.ts","sourceRoot":"","sources":["../../src/engine/jira-exporter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EAEZ,IAAI,EACL,MAAM,mBAAmB,CAAC;AAc3B;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE9D;AAMD,qBAAa,UAAU;IAIT,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAEJ,MAAM,EAAE,UAAU;IAM/C;;;OAGG;IACG,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;IA0BnD;;;OAGG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IA2BhG;;;OAGG;IACG,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAqBzD;;;OAGG;IACG,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAgChE,cAAc;YAkBd,QAAQ;CAmBvB;AAMD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgBzB"}
|