@devtrack-solution/codesdd 1.2.3 → 1.2.4

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 (213) hide show
  1. package/.sdd/skills/curated/devtrack-api/SKILL.md +98 -12
  2. package/.sdd/skills/curated/devtrack-api/agents/claude-code.yaml +10 -0
  3. package/.sdd/skills/curated/devtrack-api/agents/codex.yaml +10 -0
  4. package/.sdd/skills/curated/devtrack-api/agents/cursor.yaml +10 -0
  5. package/.sdd/skills/curated/devtrack-api/agents/gemini.yaml +10 -0
  6. package/.sdd/skills/curated/devtrack-api/agents/kimi.yaml +10 -0
  7. package/.sdd/skills/curated/devtrack-api/agents/openai.yaml +5 -3
  8. package/.sdd/skills/curated/devtrack-api/agents/opencode.yaml +12 -0
  9. package/.sdd/skills/curated/devtrack-api/references/application-presentation.md +61 -5
  10. package/.sdd/skills/curated/devtrack-api/references/consumer-sync-policy.md +15 -3
  11. package/.sdd/skills/curated/devtrack-api/references/contract-pack.yaml +1951 -0
  12. package/.sdd/skills/curated/devtrack-api/references/domain-modeling.md +16 -14
  13. package/.sdd/skills/curated/devtrack-api/references/field-validation-protocol.md +40 -0
  14. package/.sdd/skills/curated/devtrack-api/references/foundation-layout.md +19 -2
  15. package/.sdd/skills/curated/devtrack-api/references/generated-artifact-invalidation.md +97 -0
  16. package/.sdd/skills/curated/devtrack-api/references/implementation-checklist.md +30 -1
  17. package/.sdd/skills/curated/devtrack-api/references/portable-agent-contract.md +42 -0
  18. package/.sdd/skills/curated/devtrack-api/references/testing-validation.md +22 -1
  19. package/.sdd/skills/curated/devtrack-api/references/typeorm-infrastructure.md +9 -7
  20. package/README.md +280 -29
  21. package/dist/applications/sdd/index.d.ts +16 -0
  22. package/dist/applications/sdd/index.js +16 -0
  23. package/dist/cli/program.js +180 -11
  24. package/dist/commands/config.js +197 -10
  25. package/dist/commands/sdd/execution.js +408 -16
  26. package/dist/commands/sdd/plugin.js +5 -0
  27. package/dist/commands/sdd/shared.d.ts +1 -0
  28. package/dist/commands/sdd/shared.js +10 -0
  29. package/dist/commands/sdd.js +157 -7
  30. package/dist/core/cli/command-matrix.d.ts +18 -0
  31. package/dist/core/cli/command-matrix.js +157 -0
  32. package/dist/core/cli-command-quality.js +11 -0
  33. package/dist/core/completions/command-registry.js +45 -0
  34. package/dist/core/config-schema.d.ts +31 -1
  35. package/dist/core/config-schema.js +79 -5
  36. package/dist/core/config.d.ts +1 -0
  37. package/dist/core/config.js +11 -0
  38. package/dist/core/global-config.d.ts +29 -0
  39. package/dist/core/init.d.ts +2 -2
  40. package/dist/core/init.js +13 -14
  41. package/dist/core/sdd/agent-binding.d.ts +19 -19
  42. package/dist/core/sdd/agent-runtime-contract.d.ts +204 -0
  43. package/dist/core/sdd/agent-runtime-contract.js +200 -0
  44. package/dist/core/sdd/allocator-recovery.d.ts +14 -0
  45. package/dist/core/sdd/allocator-recovery.js +30 -0
  46. package/dist/core/sdd/allocator-security.d.ts +18 -0
  47. package/dist/core/sdd/allocator-security.js +36 -0
  48. package/dist/core/sdd/api-foundation-baseline.d.ts +111 -0
  49. package/dist/core/sdd/api-foundation-baseline.js +151 -0
  50. package/dist/core/sdd/api-foundation-parity.d.ts +114 -0
  51. package/dist/core/sdd/api-foundation-parity.js +131 -0
  52. package/dist/core/sdd/api-profile-catalog.d.ts +36 -0
  53. package/dist/core/sdd/api-profile-catalog.js +132 -0
  54. package/dist/core/sdd/api-profile-dry-run-projection.d.ts +93 -0
  55. package/dist/core/sdd/api-profile-dry-run-projection.js +370 -0
  56. package/dist/core/sdd/api-profile-recipes.d.ts +82 -0
  57. package/dist/core/sdd/api-profile-recipes.js +484 -0
  58. package/dist/core/sdd/artifact-id-allocator.d.ts +368 -0
  59. package/dist/core/sdd/artifact-id-allocator.js +510 -0
  60. package/dist/core/sdd/check.d.ts +52 -1
  61. package/dist/core/sdd/check.js +326 -11
  62. package/dist/core/sdd/coordination/coordination-adapters.d.ts +15 -8
  63. package/dist/core/sdd/coordination/coordination-adapters.js +43 -15
  64. package/dist/core/sdd/coordination/index.d.ts +1 -0
  65. package/dist/core/sdd/coordination/index.js +1 -0
  66. package/dist/core/sdd/coordination/redis-runtime.d.ts +131 -0
  67. package/dist/core/sdd/coordination/redis-runtime.js +698 -0
  68. package/dist/core/sdd/deepagent-contracts.d.ts +99 -5
  69. package/dist/core/sdd/deepagent-contracts.js +62 -0
  70. package/dist/core/sdd/deepagents/reversa-subagents.d.ts +3 -3
  71. package/dist/core/sdd/default-bootstrap-files.d.ts +2 -2
  72. package/dist/core/sdd/default-bootstrap-files.js +14 -10
  73. package/dist/core/sdd/default-skills.js +115 -9
  74. package/dist/core/sdd/devtrack-api-appliance.d.ts +42 -1
  75. package/dist/core/sdd/devtrack-api-appliance.js +159 -32
  76. package/dist/core/sdd/devtrack-api-architecture.d.ts +16 -0
  77. package/dist/core/sdd/devtrack-api-architecture.js +86 -0
  78. package/dist/core/sdd/docs-sync.js +24 -18
  79. package/dist/core/sdd/domain/capability-diff.d.ts +63 -0
  80. package/dist/core/sdd/domain/capability-diff.js +200 -0
  81. package/dist/core/sdd/domain/change-safety-guardrails.d.ts +74 -0
  82. package/dist/core/sdd/domain/change-safety-guardrails.js +333 -0
  83. package/dist/core/sdd/domain/semantic-intent-classifier.d.ts +29 -0
  84. package/dist/core/sdd/domain/semantic-intent-classifier.js +117 -0
  85. package/dist/core/sdd/enterprise-mutating-command-gate.d.ts +27 -0
  86. package/dist/core/sdd/enterprise-mutating-command-gate.js +104 -0
  87. package/dist/core/sdd/enterprise-provenance-gates.d.ts +20 -0
  88. package/dist/core/sdd/enterprise-provenance-gates.js +63 -0
  89. package/dist/core/sdd/enterprise-provisioning-policy.d.ts +26 -0
  90. package/dist/core/sdd/enterprise-provisioning-policy.js +104 -0
  91. package/dist/core/sdd/foundation-artifact-map-validator.d.ts +16 -0
  92. package/dist/core/sdd/foundation-artifact-map-validator.js +71 -0
  93. package/dist/core/sdd/foundation-layer-manifest.d.ts +24 -0
  94. package/dist/core/sdd/foundation-layer-manifest.js +117 -0
  95. package/dist/core/sdd/governance-schemas.d.ts +2 -2
  96. package/dist/core/sdd/governance-schemas.js +11 -2
  97. package/dist/core/sdd/intent-guard.d.ts +22 -0
  98. package/dist/core/sdd/intent-guard.js +67 -0
  99. package/dist/core/sdd/json-schema.js +13 -1
  100. package/dist/core/sdd/legacy-operations.js +169 -5
  101. package/dist/core/sdd/migrate-workspace.js +39 -0
  102. package/dist/core/sdd/package-security-gates.d.ts +21 -0
  103. package/dist/core/sdd/package-security-gates.js +121 -0
  104. package/dist/core/sdd/package-structure-gate.d.ts +85 -3
  105. package/dist/core/sdd/package-structure-gate.js +384 -11
  106. package/dist/core/sdd/parallel-feat-automation.d.ts +185 -7
  107. package/dist/core/sdd/parallel-feat-automation.js +212 -0
  108. package/dist/core/sdd/plugin-broker.d.ts +223 -4
  109. package/dist/core/sdd/plugin-broker.js +10 -0
  110. package/dist/core/sdd/plugin-cli.d.ts +30 -0
  111. package/dist/core/sdd/plugin-cli.js +70 -3
  112. package/dist/core/sdd/plugin-evidence.d.ts +73 -0
  113. package/dist/core/sdd/plugin-manifest.d.ts +69 -1
  114. package/dist/core/sdd/plugin-manifest.js +10 -0
  115. package/dist/core/sdd/plugin-policy-pack.d.ts +1 -1
  116. package/dist/core/sdd/plugin-policy.js +6 -1
  117. package/dist/core/sdd/plugin-registry.d.ts +138 -2
  118. package/dist/core/sdd/plugin-sdk-contract.d.ts +363 -0
  119. package/dist/core/sdd/plugin-sdk-contract.js +268 -0
  120. package/dist/core/sdd/plugin-skill-binding.d.ts +1 -1
  121. package/dist/core/sdd/quality-validation.d.ts +89 -16
  122. package/dist/core/sdd/release-readiness.d.ts +68 -0
  123. package/dist/core/sdd/release-readiness.js +767 -0
  124. package/dist/core/sdd/reversa-architecture-extractor.d.ts +13 -0
  125. package/dist/core/sdd/reversa-architecture-extractor.js +89 -0
  126. package/dist/core/sdd/reversa-artifact-writer.d.ts +18 -0
  127. package/dist/core/sdd/reversa-artifact-writer.js +40 -0
  128. package/dist/core/sdd/reversa-command-policy.d.ts +136 -0
  129. package/dist/core/sdd/reversa-command-policy.js +361 -0
  130. package/dist/core/sdd/reversa-data-extractor.d.ts +11 -0
  131. package/dist/core/sdd/reversa-data-extractor.js +73 -0
  132. package/dist/core/sdd/reversa-equivalence.d.ts +20 -0
  133. package/dist/core/sdd/reversa-equivalence.js +34 -0
  134. package/dist/core/sdd/reversa-evidence.d.ts +298 -0
  135. package/dist/core/sdd/reversa-evidence.js +118 -0
  136. package/dist/core/sdd/reversa-reconstruction.d.ts +29 -0
  137. package/dist/core/sdd/reversa-reconstruction.js +32 -0
  138. package/dist/core/sdd/reversa-rules-extractor.d.ts +12 -0
  139. package/dist/core/sdd/reversa-rules-extractor.js +86 -0
  140. package/dist/core/sdd/reversa-source-safety.d.ts +19 -0
  141. package/dist/core/sdd/reversa-source-safety.js +105 -0
  142. package/dist/core/sdd/reversa-surface-scout.d.ts +13 -0
  143. package/dist/core/sdd/reversa-surface-scout.js +85 -0
  144. package/dist/core/sdd/reversa-ux-mapper.d.ts +11 -0
  145. package/dist/core/sdd/reversa-ux-mapper.js +73 -0
  146. package/dist/core/sdd/runtime-boundary-contract.d.ts +45 -0
  147. package/dist/core/sdd/runtime-boundary-contract.js +90 -0
  148. package/dist/core/sdd/sdk-agent-plugin-quality-gates.d.ts +150 -0
  149. package/dist/core/sdd/sdk-agent-plugin-quality-gates.js +258 -0
  150. package/dist/core/sdd/services/agent-run.service.d.ts +38 -6
  151. package/dist/core/sdd/services/agent-run.service.js +73 -1
  152. package/dist/core/sdd/services/archive-quality-coherence.service.d.ts +17 -0
  153. package/dist/core/sdd/services/archive-quality-coherence.service.js +141 -0
  154. package/dist/core/sdd/services/capability-diff.service.d.ts +18 -0
  155. package/dist/core/sdd/services/capability-diff.service.js +26 -0
  156. package/dist/core/sdd/services/change-safety-preflight.service.d.ts +17 -0
  157. package/dist/core/sdd/services/change-safety-preflight.service.js +17 -0
  158. package/dist/core/sdd/services/context.service.d.ts +43 -340
  159. package/dist/core/sdd/services/context.service.js +323 -9
  160. package/dist/core/sdd/services/decide.service.js +1 -1
  161. package/dist/core/sdd/services/finalize.service.d.ts +27 -0
  162. package/dist/core/sdd/services/finalize.service.js +226 -18
  163. package/dist/core/sdd/services/frontend-impact.service.d.ts +1 -1
  164. package/dist/core/sdd/services/historical-quality-regression.service.d.ts +35 -0
  165. package/dist/core/sdd/services/historical-quality-regression.service.js +228 -0
  166. package/dist/core/sdd/services/ingest-deposito.service.js +1 -1
  167. package/dist/core/sdd/services/planning-execution-coherence.service.d.ts +45 -0
  168. package/dist/core/sdd/services/planning-execution-coherence.service.js +225 -0
  169. package/dist/core/sdd/services/semantic-intent-classifier.service.d.ts +6 -0
  170. package/dist/core/sdd/services/semantic-intent-classifier.service.js +7 -0
  171. package/dist/core/sdd/state.d.ts +1 -0
  172. package/dist/core/sdd/state.js +266 -34
  173. package/dist/core/sdd/store/sdd-stores.js +2 -2
  174. package/dist/core/sdd/structural-health.d.ts +13 -13
  175. package/dist/core/sdd/types.d.ts +30 -15
  176. package/dist/core/sdd/types.js +4 -0
  177. package/dist/core/sdd/views.js +17 -0
  178. package/dist/core/sdd/workspace-schemas.d.ts +428 -7
  179. package/dist/core/sdd/workspace-schemas.js +223 -70
  180. package/dist/core/shared/skill-generation.d.ts +2 -0
  181. package/dist/core/shared/skill-generation.js +19 -2
  182. package/dist/core/shared/tool-detection.d.ts +19 -0
  183. package/dist/core/shared/tool-detection.js +89 -0
  184. package/dist/domains/sdd/index.d.ts +6 -0
  185. package/dist/domains/sdd/index.js +6 -0
  186. package/dist/infrastructures/sdd/index.d.ts +7 -0
  187. package/dist/infrastructures/sdd/index.js +6 -0
  188. package/dist/presentations/cli/sdd/index.d.ts +3 -0
  189. package/dist/presentations/cli/sdd/index.js +3 -0
  190. package/dist/shared/sdd/index.d.ts +3 -0
  191. package/dist/shared/sdd/index.js +2 -0
  192. package/package.json +14 -10
  193. package/schemas/sdd/2-plan.schema.json +207 -2
  194. package/schemas/sdd/5-quality.schema.json +324 -25
  195. package/schemas/sdd/agent-runtime-command-plan.schema.json +212 -0
  196. package/schemas/sdd/agent-runtime-opencode-run-evidence.schema.json +270 -0
  197. package/schemas/sdd/codesdd-plugin.schema.json +171 -0
  198. package/schemas/sdd/deepagent-run-request.schema.json +316 -0
  199. package/schemas/sdd/parallel-feat-automation-plan.schema.json +89 -0
  200. package/schemas/sdd/parallel-feat-scheduler-request.schema.json +116 -0
  201. package/schemas/sdd/parallel-feat-scheduler-result.schema.json +404 -0
  202. package/schemas/sdd/plugin-artifact-manifest.schema.json +109 -0
  203. package/schemas/sdd/plugin-artifact-map.schema.json +223 -0
  204. package/schemas/sdd/plugin-evidence-manifest.schema.json +109 -0
  205. package/schemas/sdd/plugin-language-runtime.schema.json +103 -0
  206. package/schemas/sdd/plugin-package-governance.schema.json +74 -0
  207. package/schemas/sdd/plugin-registry.schema.json +171 -0
  208. package/schemas/sdd/plugin-runtime-invocation-plan.schema.json +109 -0
  209. package/schemas/sdd/quality-evidence-bundle.schema.json +109 -0
  210. package/schemas/sdd/reversa-evidence-bundle.schema.json +466 -0
  211. package/schemas/sdd/sdk-agent-plugin-quality-gate-input.schema.json +168 -0
  212. package/schemas/sdd/sdk-agent-plugin-quality-gate-report.schema.json +160 -0
  213. package/schemas/sdd/workspace-catalog.schema.json +5298 -1409
@@ -0,0 +1,484 @@
1
+ import { CODESDD_API_SHARED_BASELINE_QUALITY_GATES, CODESDD_API_SHARED_BASELINE_REQUIREMENTS, } from './api-foundation-baseline.js';
2
+ export const CODESDD_API_PROFILE_RECIPE_CONTRACT = {
3
+ id: 'codesdd-api-profile-recipes',
4
+ version: 1,
5
+ foundation_reference: 'devtrack-foundation-api',
6
+ };
7
+ export const CODESDD_MINIMAL_REST_PROFILE_QUALITY_GATES = [
8
+ 'minimal-rest-recipe-required',
9
+ 'minimal-rest-openapi-docs-required',
10
+ 'minimal-rest-env-example-required',
11
+ 'minimal-rest-package-scripts-required',
12
+ 'minimal-rest-dto-usecase-boundary-required',
13
+ 'minimal-rest-structured-errors-required',
14
+ 'minimal-rest-health-root-wiring-required',
15
+ 'minimal-rest-route-usecase-tests-required',
16
+ ];
17
+ export const CODESDD_MINIMAL_REST_PROFILE_VALIDATION_COMMANDS = [
18
+ 'pnpm run build',
19
+ 'pnpm run lint',
20
+ 'pnpm test',
21
+ 'pnpm run test:e2e',
22
+ ];
23
+ export const CODESDD_REST_AUTH_RBAC_PROFILE_QUALITY_GATES = [
24
+ 'rest-auth-rbac-recipe-required',
25
+ 'rest-auth-rbac-auth-plan-required',
26
+ 'rest-auth-rbac-jwt-strategy-required',
27
+ 'rest-auth-rbac-route-guards-required',
28
+ 'rest-auth-rbac-permission-decorator-required',
29
+ 'rest-auth-rbac-current-user-boundary-required',
30
+ 'rest-auth-rbac-protected-openapi-docs-required',
31
+ 'rest-auth-rbac-allow-deny-tests-required',
32
+ ];
33
+ export const CODESDD_REST_AUTH_RBAC_PROFILE_VALIDATION_COMMANDS = [
34
+ 'pnpm run build',
35
+ 'pnpm run lint',
36
+ 'pnpm test',
37
+ 'pnpm run test:e2e',
38
+ ];
39
+ export const CODESDD_REST_CRUD_TYPEORM_PROFILE_QUALITY_GATES = [
40
+ 'rest-crud-typeorm-recipe-required',
41
+ 'rest-crud-typeorm-bo-pattern-required',
42
+ 'rest-crud-typeorm-application-repository-port-required',
43
+ 'rest-crud-typeorm-usecase-transaction-boundary-required',
44
+ 'rest-crud-typeorm-infrastructure-orm-required',
45
+ 'rest-crud-typeorm-migration-required',
46
+ 'rest-crud-typeorm-pagination-filtering-required',
47
+ 'rest-crud-typeorm-uniqueness-required',
48
+ 'rest-crud-typeorm-crud-tests-required',
49
+ 'rest-crud-typeorm-no-prisma-required',
50
+ ];
51
+ export const CODESDD_REST_CRUD_TYPEORM_PROFILE_VALIDATION_COMMANDS = [
52
+ 'pnpm run build',
53
+ 'pnpm run lint',
54
+ 'pnpm test',
55
+ 'pnpm run test:e2e',
56
+ 'pnpm run migration:show',
57
+ ];
58
+ export const CODESDD_EVENTED_API_PROFILE_QUALITY_GATES = [
59
+ 'evented-api-recipe-required',
60
+ 'evented-api-event-contract-required',
61
+ 'evented-api-application-handler-required',
62
+ 'evented-api-event-publisher-port-required',
63
+ 'evented-api-outbox-or-queue-required',
64
+ 'evented-api-idempotency-required',
65
+ 'evented-api-retry-error-policy-required',
66
+ 'evented-api-event-docs-required',
67
+ 'evented-api-event-tests-required',
68
+ ];
69
+ export const CODESDD_EVENTED_API_PROFILE_VALIDATION_COMMANDS = [
70
+ 'pnpm run build',
71
+ 'pnpm run lint',
72
+ 'pnpm test',
73
+ 'pnpm run test:e2e',
74
+ ];
75
+ export const CODESDD_AI_AGENT_API_PROFILE_QUALITY_GATES = [
76
+ 'ai-agent-api-recipe-required',
77
+ 'ai-agent-api-endpoint-contract-required',
78
+ 'ai-agent-api-tool-boundary-required',
79
+ 'ai-agent-api-provider-config-redaction-required',
80
+ 'ai-agent-api-prompt-safety-required',
81
+ 'ai-agent-api-audit-trail-required',
82
+ 'ai-agent-api-deterministic-tests-required',
83
+ 'ai-agent-api-no-live-credentials-required',
84
+ ];
85
+ export const CODESDD_AI_AGENT_API_PROFILE_VALIDATION_COMMANDS = [
86
+ 'pnpm run build',
87
+ 'pnpm run lint',
88
+ 'pnpm test',
89
+ 'pnpm run test:e2e',
90
+ ];
91
+ const CODESDD_AI_AGENT_API_FORBIDDEN_CONTENT_PATTERNS = [
92
+ {
93
+ id: 'raw-provider-api-key-env',
94
+ pattern: /\b[A-Z0-9_]*(?:API_KEY|TOKEN|SECRET)\s*=\s*(?:sk-|sk_ant_|sk-ant-|AIza|xai-|pat_)[^\s]+/i,
95
+ },
96
+ {
97
+ id: 'live-provider-call-enabled',
98
+ pattern: /\bLIVE_PROVIDER_CALL\s*=\s*true\b/i,
99
+ },
100
+ {
101
+ id: 'unsafe-secret-env-non-null',
102
+ pattern: /process\.env\.[A-Z0-9_]*(?:API_KEY|TOKEN|SECRET)!/,
103
+ },
104
+ ];
105
+ export const CODESDD_API_MANDATORY_PACKAGE_SCRIPT_MARKERS = [
106
+ '"build"',
107
+ '"start"',
108
+ '"start:dev"',
109
+ '"start:prod"',
110
+ '"lint"',
111
+ '"test"',
112
+ '"test:cov"',
113
+ '"test:e2e"',
114
+ '"cleanup"',
115
+ '"cleanup:install"',
116
+ 'node scripts/kill-port.js',
117
+ 'npm run',
118
+ 'npm install',
119
+ ];
120
+ export const CODESDD_API_MANDATORY_CLEANUP_SCRIPT_MARKERS = [
121
+ 'node_modules',
122
+ 'dist',
123
+ 'build',
124
+ 'coverage',
125
+ '.cache',
126
+ '.turbo',
127
+ '.nest',
128
+ 'package-lock.json',
129
+ 'pnpm-lock.yaml',
130
+ 'yarn.lock',
131
+ 'bun.lock',
132
+ 'tsbuildinfo',
133
+ ];
134
+ export const CODESDD_API_MANDATORY_KILL_PORT_SCRIPT_MARKERS = [
135
+ 'process.argv[2]',
136
+ 'process.env.PORT',
137
+ 'process.env.APP_PORT',
138
+ 'lsof -ti',
139
+ 'netstat -ano',
140
+ 'kill -9',
141
+ 'taskkill',
142
+ ];
143
+ export const CODESDD_MINIMAL_REST_PROFILE_RECIPE = {
144
+ id: 'minimal-rest-profile-recipe',
145
+ version: 1,
146
+ profile_id: 'minimal-rest',
147
+ title: 'Minimal REST profile recipe',
148
+ foundation_reference: 'devtrack-foundation-api',
149
+ inherits_shared_baseline: true,
150
+ required_baseline_requirements: CODESDD_API_SHARED_BASELINE_REQUIREMENTS,
151
+ required_artifacts: [
152
+ artifact('package.json', 'root', 'package-metadata', 'manifest', 'scripts', 'Operational scripts for cleanup, port-safe start/start:dev, npm/pnpm-compatible install, build, lint, unit, coverage, and e2e validation.', CODESDD_API_MANDATORY_PACKAGE_SCRIPT_MARKERS),
153
+ ...mandatoryRuntimeScriptArtifacts(),
154
+ artifact('.env.example', 'config', 'configuration', 'manifest', 'environment', 'Safe placeholder environment contract with no raw secrets.', ['PORT=', 'SWAGGER_SERVER_LOCAL=']),
155
+ artifact('src/main.ts', 'root', 'source', 'implementation', 'documentation', 'Nest bootstrap with validation pipe and Swagger/OpenAPI /docs wiring.', ['ValidationPipe', 'DocumentBuilder', 'SwaggerModule.createDocument', 'SwaggerModule.setup']),
156
+ artifact('src/presentation/rest/rest.module.ts', 'presentation', 'source', 'module', 'root-wiring', 'Root REST module that wires minimal controllers without leaking infrastructure concerns.', ['@Module', 'HealthController']),
157
+ artifact('src/presentation/rest/health/health.controller.ts', 'presentation', 'source', 'controller', 'health', 'Health/readiness REST controller documented in OpenAPI.', ['@Controller', '@Get', 'ApiOperation']),
158
+ artifact('src/application/business/health/ports/in/read-health.use-case.port.ts', 'application', 'source', 'interface', 'use-case', 'Input port for the minimal health route.', ['ReadHealthUseCasePort']),
159
+ artifact('src/application/business/health/use-cases/read-health.use-case.ts', 'application', 'source', 'use-case', 'use-case', 'Use case backing the minimal health route.', ['ReadHealthUseCase']),
160
+ artifact('src/application/business/auth/ports/in/register.use-case.port.ts', 'application', 'source', 'interface', 'use-case', 'Baseline input port proving user-facing routes delegate to application boundaries.', ['RegisterUseCasePort']),
161
+ artifact('src/application/business/auth/use-cases/register.use-case.ts', 'application', 'source', 'use-case', 'use-case', 'Baseline use case for the documented sample route.', ['RegisterUseCase']),
162
+ artifact('src/presentation/rest/auth/controllers/register.controller.ts', 'presentation', 'source', 'controller', 'documentation', 'Swagger-documented controller delegating to an application input port.', ['@Controller', 'ApiOperation']),
163
+ artifact('src/presentation/rest/auth/dtos/register-input.dto.ts', 'presentation', 'source', 'dto', 'dto', 'Request DTO with validation and Swagger metadata.', ['ApiProperty', 'Is']),
164
+ artifact('src/presentation/dtos/api-error-response.dto.ts', 'presentation', 'source', 'dto', 'structured-errors', 'Structured error response DTO that avoids leaking internal details.', ['ApiProperty']),
165
+ artifact('tests/app.e2e-spec.ts', 'tests', 'test', 'test', 'tests', 'Baseline route/use-case smoke evidence.', ['request', 'expect']),
166
+ artifact('tests/health.e2e-spec.ts', 'tests', 'test', 'test', 'tests', 'Health route and use-case evidence for the minimal profile overlay.', ['/health', 'expect']),
167
+ ],
168
+ required_quality_gates: [
169
+ ...CODESDD_API_SHARED_BASELINE_QUALITY_GATES,
170
+ ...CODESDD_MINIMAL_REST_PROFILE_QUALITY_GATES,
171
+ ],
172
+ required_validation_commands: CODESDD_MINIMAL_REST_PROFILE_VALIDATION_COMMANDS,
173
+ };
174
+ export const CODESDD_REST_AUTH_RBAC_PROFILE_RECIPE = {
175
+ id: 'rest-auth-rbac-profile-recipe',
176
+ version: 1,
177
+ profile_id: 'rest-auth-rbac',
178
+ title: 'REST Auth RBAC profile recipe',
179
+ foundation_reference: 'devtrack-foundation-api',
180
+ inherits_shared_baseline: true,
181
+ required_baseline_requirements: CODESDD_API_SHARED_BASELINE_REQUIREMENTS,
182
+ required_artifacts: [
183
+ artifact('package.json', 'root', 'package-metadata', 'manifest', 'scripts', 'Operational scripts for cleanup, port-safe start/start:dev, npm/pnpm-compatible install, build, lint, unit, coverage, and e2e validation.', CODESDD_API_MANDATORY_PACKAGE_SCRIPT_MARKERS),
184
+ ...mandatoryRuntimeScriptArtifacts(),
185
+ artifact('.env.example', 'config', 'configuration', 'manifest', 'auth-configuration', 'Safe auth/runtime placeholders for JWT and Swagger server configuration.', ['JWT_SECRET=', 'JWT_EXPIRES_IN=', 'SWAGGER_SERVER_LOCAL=']),
186
+ artifact('src/main.ts', 'root', 'source', 'implementation', 'documentation', 'Nest bootstrap with validation pipe, Swagger/OpenAPI /docs wiring, and bearer auth documentation.', ['ValidationPipe', 'DocumentBuilder', 'SwaggerModule.setup', 'addBearerAuth']),
187
+ artifact('src/presentation/rest/auth/auth.module.ts', 'presentation', 'source', 'module', 'root-wiring', 'REST auth module wiring controllers, guards, and guard tokens.', ['@Module', 'JwtAuthGuard', 'PermissionGuard']),
188
+ artifact('src/presentation/rest/auth/controllers/login.controller.ts', 'presentation', 'source', 'controller', 'auth-controller', 'Swagger-documented login route that delegates to an application input port.', ['@Controller', 'LoginUseCasePortSymbol', 'ApiOperation']),
189
+ artifact('src/presentation/rest/auth/controllers/create-role.controller.ts', 'presentation', 'source', 'controller', 'rbac-policy', 'Protected RBAC write route documented with bearer auth, permission metadata, and current-user request boundary.', ['ApiBearerAuth', 'UseGuards', 'Permission("rbac.roles.write")', 'AuthenticatedRequestType']),
190
+ artifact('src/presentation/rest/auth/controllers/list-roles.controller.ts', 'presentation', 'source', 'controller', 'rbac-policy', 'Protected RBAC read route documented with bearer auth, permission metadata, and current-user request boundary.', ['ApiBearerAuth', 'UseGuards', 'Permission("rbac.roles.read")', 'AuthenticatedRequestType']),
191
+ artifact('src/presentation/rest/auth/dtos/auth-session-output.dto.ts', 'presentation', 'source', 'dto', 'auth-session', 'Auth session output DTO documenting JWT token and permission-bearing payload shape.', ['ApiProperty', 'accessToken', 'permissions']),
192
+ artifact('src/presentation/rest/auth/guards/jwt-auth.guard.ts', 'presentation', 'source', 'implementation', 'guard', 'JWT bearer guard for protected REST routes.', ['AuthGuard("jwt")', 'CanActivate', 'JwtAuthGuard']),
193
+ artifact('src/presentation/rest/auth/guards/permission.guard.ts', 'presentation', 'source', 'implementation', 'guard', 'Permission guard that reads route metadata without embedding business policy in controllers.', ['Reflector', 'PERMISSION_METADATA_KEY', 'canActivate']),
194
+ artifact('src/presentation/rest/auth/decorators/permission.decorator.ts', 'presentation', 'source', 'policy', 'decorator', 'Permission decorator used to record route-level RBAC metadata.', ['SetMetadata', 'PERMISSION_METADATA_KEY', 'required-permission']),
195
+ artifact('src/application/business/auth/ports/in/authenticated-user.type.ts', 'application', 'source', 'type', 'current-user', 'Application-layer authenticated-user request boundary consumed by protected controllers.', ['AuthenticatedUserType', 'AuthenticatedRequestType', 'user']),
196
+ artifact('src/application/business/auth/ports/in/login.use-case.port.ts', 'application', 'source', 'interface', 'use-case', 'Application input port for login/authentication.', ['LoginUseCasePort', 'execute']),
197
+ artifact('src/application/business/auth/use-cases/login.use-case.ts', 'application', 'source', 'use-case', 'use-case', 'Login use case that coordinates password verification and JWT generation through ports.', ['LoginUseCase', 'PasswordHashServicePort', 'JwtPort']),
198
+ artifact('src/application/business/auth/ports/out/access-control.service.port.ts', 'application', 'source', 'interface', 'rbac-policy', 'Application output port for permission checks owned outside the presentation guard.', ['AccessControlServicePort', 'ensurePermission']),
199
+ artifact('src/application/business/auth/services/access-control.service.ts', 'application', 'source', 'service', 'rbac-policy', 'Application service enforcing permission allow/deny behavior.', ['AccessControlService', 'ensurePermission', 'UnauthorizedException']),
200
+ artifact('src/infrastructure/adapters/auth/jwt.strategy.ts', 'infrastructure', 'source', 'adapter', 'auth-strategy', 'Infrastructure JWT strategy that isolates bearer token extraction and validation details.', ['PassportStrategy', 'ExtractJwt.fromAuthHeaderAsBearerToken', 'secretOrKey']),
201
+ artifact('tests/auth-rbac.e2e-spec.ts', 'tests', 'test', 'test', 'auth-tests', 'Allow/deny evidence for protected routes and permission-bearing JWT requests.', ['expect(401)', 'Authorization', 'rbac.roles']),
202
+ ],
203
+ required_quality_gates: [
204
+ ...CODESDD_API_SHARED_BASELINE_QUALITY_GATES,
205
+ ...CODESDD_REST_AUTH_RBAC_PROFILE_QUALITY_GATES,
206
+ ],
207
+ required_validation_commands: CODESDD_REST_AUTH_RBAC_PROFILE_VALIDATION_COMMANDS,
208
+ };
209
+ export const CODESDD_REST_CRUD_TYPEORM_PROFILE_RECIPE = {
210
+ id: 'rest-crud-typeorm-profile-recipe',
211
+ version: 1,
212
+ profile_id: 'rest-crud-typeorm',
213
+ title: 'REST CRUD TypeORM profile recipe',
214
+ foundation_reference: 'devtrack-foundation-api',
215
+ inherits_shared_baseline: true,
216
+ required_baseline_requirements: CODESDD_API_SHARED_BASELINE_REQUIREMENTS,
217
+ required_artifacts: [
218
+ artifact('package.json', 'root', 'package-metadata', 'manifest', 'scripts', 'Package scripts and dependencies for cleanup, port-safe runtime bootstrap, TypeORM CRUD validation, and migration inspection.', [...CODESDD_API_MANDATORY_PACKAGE_SCRIPT_MARKERS, '"migration:run"', '"migration:revert"', '"migration:show"', '"typeorm"', '"@nestjs/typeorm"']),
219
+ ...mandatoryRuntimeScriptArtifacts(),
220
+ artifact('.env.example', 'config', 'configuration', 'manifest', 'persistence-configuration', 'Safe database and TypeORM placeholders required by persistent CRUD profiles.', ['DB_HOST=', 'DB_NAME=', 'TYPEORM_SYNCHRONIZE=']),
221
+ artifact('src/domain/categories/business-objects/category.bo.ts', 'domain', 'source', 'business-object', 'business-object', 'BO-pattern category aggregate for new CRUD contexts.', ['CategoryBusinessObject', 'validate', 'name']),
222
+ artifact('src/domain/categories/types/category.type.ts', 'domain', 'source', 'type', 'domain-type', 'Domain type contract for the category BO.', ['CategoryType', 'id', 'name']),
223
+ artifact('src/application/business/categories/ports/out/category-repository.port.ts', 'application', 'source', 'repository-port', 'repository-port', 'Application-owned repository output port for BO-pattern persistence.', ['CategoryRepositoryPort', 'findById', 'findByName', 'findPage', 'save']),
224
+ artifact('src/application/business/categories/ports/in/create-category.use-case.port.ts', 'application', 'source', 'interface', 'use-case', 'Input port for category creation.', ['CreateCategoryUseCasePort', 'execute']),
225
+ artifact('src/application/business/categories/use-cases/create-category.use-case.ts', 'application', 'source', 'use-case', 'use-case', 'Create use case coordinating BO validation, uniqueness, transaction boundary, and repository port persistence.', ['CreateCategoryUseCase', 'CategoryRepositoryPort', 'findByName', 'transaction']),
226
+ artifact('src/application/business/categories/ports/in/list-categories.use-case.port.ts', 'application', 'source', 'interface', 'pagination-filtering', 'Input port for paginated category listing.', ['ListCategoriesUseCasePort', 'page', 'limit']),
227
+ artifact('src/application/business/categories/use-cases/list-categories.use-case.ts', 'application', 'source', 'use-case', 'pagination-filtering', 'List use case coordinating pagination and filtering through the repository port.', ['ListCategoriesUseCase', 'findPage', 'filter']),
228
+ artifact('src/infrastructure/adapters/orm/entities/category.orm-entity.ts', 'infrastructure', 'source', 'entity', 'orm-entity', 'TypeORM entity kept in infrastructure ORM boundary.', ['@Entity', '@Column', '@Index']),
229
+ artifact('src/infrastructure/adapters/orm/repositories/category.typeorm-repository.ts', 'infrastructure', 'source', 'adapter', 'orm-repository', 'Concrete TypeORM repository implementing the application repository port.', ['InjectRepository', 'Repository<CategoryOrmEntity>', 'CategoryRepositoryPort']),
230
+ artifact('src/infrastructure/adapters/orm/mappers/category.mapper.ts', 'infrastructure', 'source', 'mapper', 'orm-mapper', 'Mapper isolating TypeORM entity shape from the domain BO.', ['CategoryMapper', 'toDomain', 'toOrm']),
231
+ artifact('src/infrastructure/adapters/orm/typeorm.module.ts', 'infrastructure', 'source', 'module', 'orm-module', 'Foundation TypeORM root module with forRootAsync and shared entity registration.', ['TypeOrmRootModule', 'TypeOrmModule.forRootAsync', 'typeOrmConfig']),
232
+ artifact('src/infrastructure/adapters/orm/categories-orm.module.ts', 'infrastructure', 'source', 'module', 'orm-module', 'Context ORM module exporting the category repository port provider.', ['@Global', 'TypeOrmModule.forFeature', 'CategoryRepositoryPortSymbol']),
233
+ artifact('src/infrastructure/adapters/orm/migrations/0000000000000-create-categories.migration.ts', 'infrastructure', 'migration', 'implementation', 'migration', 'Migration artifact for persistent category schema creation and rollback.', ['MigrationInterface', 'createTable', 'categories']),
234
+ artifact('src/presentation/rest/categories/categories.module.ts', 'presentation', 'source', 'module', 'root-wiring', 'REST categories module wiring CRUD controllers without owning business logic.', ['@Module', 'CreateCategoryController', 'ListCategoriesController']),
235
+ artifact('src/presentation/rest/categories/controllers/create-category.controller.ts', 'presentation', 'source', 'controller', 'crud-controller', 'Swagger-documented create route delegating to an application input port.', ['@Controller', '@Post', 'ApiOperation', 'CreateCategoryUseCasePortSymbol']),
236
+ artifact('src/presentation/rest/categories/controllers/list-categories.controller.ts', 'presentation', 'source', 'controller', 'pagination-filtering', 'Swagger-documented list route with pagination and filtering inputs.', ['@Controller', '@Get', 'ApiQuery', 'ListCategoriesUseCasePortSymbol']),
237
+ artifact('src/presentation/rest/categories/dtos/create-category-input.dto.ts', 'presentation', 'source', 'dto', 'dto', 'Create DTO with validation and Swagger metadata.', ['ApiProperty', 'IsString', 'MaxLength']),
238
+ artifact('src/presentation/rest/categories/dtos/category-output.dto.ts', 'presentation', 'source', 'dto', 'dto', 'Output DTO documenting category response shape.', ['ApiProperty', 'id', 'name']),
239
+ artifact('tests/categories-crud.e2e-spec.ts', 'tests', 'test', 'test', 'crud-tests', 'CRUD integration evidence for create/list, uniqueness, pagination, filtering, and persistence boundaries.', ['POST /categories', 'GET /categories', 'expect(409)', 'page=1']),
240
+ ],
241
+ required_quality_gates: [
242
+ ...CODESDD_API_SHARED_BASELINE_QUALITY_GATES,
243
+ ...CODESDD_REST_CRUD_TYPEORM_PROFILE_QUALITY_GATES,
244
+ ],
245
+ required_validation_commands: CODESDD_REST_CRUD_TYPEORM_PROFILE_VALIDATION_COMMANDS,
246
+ forbidden_artifact_patterns: [
247
+ 'prisma/**',
248
+ '**/*.prisma',
249
+ 'src/domain/categories/entities/**',
250
+ 'src/domain/categories/repository-ports/**',
251
+ 'typeorm-artifacts-outside-src/infrastructure/adapters/orm/**',
252
+ ],
253
+ forbidden_content_markers: ['PrismaClient', '@prisma/client', 'prisma.'],
254
+ };
255
+ export const CODESDD_EVENTED_API_PROFILE_RECIPE = {
256
+ id: 'evented-api-profile-recipe',
257
+ version: 1,
258
+ profile_id: 'evented-api',
259
+ title: 'Evented API profile recipe',
260
+ foundation_reference: 'devtrack-foundation-api',
261
+ inherits_shared_baseline: true,
262
+ required_baseline_requirements: CODESDD_API_SHARED_BASELINE_REQUIREMENTS,
263
+ required_artifacts: [
264
+ artifact('package.json', 'root', 'package-metadata', 'manifest', 'scripts', 'Package scripts, cleanup, port-safe bootstrap, and queue dependencies for evented API validation.', [...CODESDD_API_MANDATORY_PACKAGE_SCRIPT_MARKERS, '"@nestjs/bullmq"', '"bullmq"']),
265
+ ...mandatoryRuntimeScriptArtifacts(),
266
+ artifact('.env.example', 'config', 'configuration', 'manifest', 'event-configuration', 'Safe queue, retry, and idempotency placeholders required by evented API profiles.', ['EVENT_QUEUE_NAME=', 'EVENT_RETRY_ATTEMPTS=', 'EVENT_IDEMPOTENCY_TTL_SECONDS=']),
267
+ artifact('src/application/business/categories/events/category-created.event.ts', 'application', 'source', 'type', 'event-contract', 'Application event contract for category creation in a BO-pattern context.', ['CategoryCreatedEvent', 'eventId', 'categoryId', 'occurredAt']),
268
+ artifact('src/application/business/categories/ports/out/category-event-publisher.port.ts', 'application', 'source', 'interface', 'event-publisher-port', 'Application output port for publishing category events without leaking queue implementation details.', ['CategoryEventPublisherPort', 'publishCategoryCreated', 'idempotencyKey']),
269
+ artifact('src/application/business/categories/ports/out/event-idempotency-store.port.ts', 'application', 'source', 'interface', 'idempotency', 'Application output port for event deduplication and processed-event tracking.', ['EventIdempotencyStorePort', 'hasProcessed', 'markProcessed']),
270
+ artifact('src/application/business/categories/handlers/category-created.handler.ts', 'application', 'source', 'handler', 'event-handler', 'Application handler coordinating idempotency and event publication.', ['CategoryCreatedHandler', 'CategoryCreatedEvent', 'EventIdempotencyStorePort', 'publishCategoryCreated']),
271
+ artifact('src/application/business/categories/use-cases/create-category.use-case.ts', 'application', 'source', 'use-case', 'event-handler', 'Application use case that records the category creation event after business validation.', ['CreateCategoryUseCase', 'CategoryCreatedEvent', 'CategoryCreatedHandler']),
272
+ artifact('src/infrastructure/adapters/queue/category-event-publisher.adapter.ts', 'infrastructure', 'source', 'adapter', 'outbox-queue', 'Queue publisher adapter with idempotency key propagation and retry policy.', ['CategoryEventPublisherAdapter', 'Queue', 'idempotencyKey', 'retry']),
273
+ artifact('src/infrastructure/adapters/queue/category-events.consumer.ts', 'infrastructure', 'source', 'handler', 'event-consumer', 'Queue consumer adapter that delegates processing to the application handler and records dead-letter behavior.', ['Processor', 'Process', 'CategoryCreatedHandler', 'deadLetter']),
274
+ artifact('src/infrastructure/adapters/queue/event-idempotency-store.adapter.ts', 'infrastructure', 'source', 'adapter', 'idempotency', 'Infrastructure adapter for event deduplication with TTL-based processed-event records.', ['EventIdempotencyStoreAdapter', 'hasProcessed', 'markProcessed', 'ttl']),
275
+ artifact('docs/events/category-created.md', 'docs', 'documentation', 'documentation', 'event-docs', 'Event contract documentation with payload, idempotency, retry, and error policy.', ['category.created', 'payload', 'idempotencyKey', 'retry']),
276
+ artifact('tests/categories-events.e2e-spec.ts', 'tests', 'test', 'test', 'event-tests', 'Event integration evidence for publication, idempotency, retry, and handler dispatch.', ['category.created', 'idempotency', 'retry', 'expect']),
277
+ ],
278
+ required_quality_gates: [
279
+ ...CODESDD_API_SHARED_BASELINE_QUALITY_GATES,
280
+ ...CODESDD_EVENTED_API_PROFILE_QUALITY_GATES,
281
+ ],
282
+ required_validation_commands: CODESDD_EVENTED_API_PROFILE_VALIDATION_COMMANDS,
283
+ };
284
+ export const CODESDD_AI_AGENT_API_PROFILE_RECIPE = {
285
+ id: 'ai-agent-api-profile-recipe',
286
+ version: 1,
287
+ profile_id: 'ai-agent-api',
288
+ title: 'AI Agent API profile recipe',
289
+ foundation_reference: 'devtrack-foundation-api',
290
+ inherits_shared_baseline: true,
291
+ required_baseline_requirements: CODESDD_API_SHARED_BASELINE_REQUIREMENTS,
292
+ required_artifacts: [
293
+ artifact('package.json', 'root', 'package-metadata', 'manifest', 'scripts', 'Package scripts for cleanup, port-safe bootstrap, and deterministic agent API validation without live provider calls.', CODESDD_API_MANDATORY_PACKAGE_SCRIPT_MARKERS),
294
+ ...mandatoryRuntimeScriptArtifacts(),
295
+ artifact('.env.example', 'config', 'configuration', 'manifest', 'agent-configuration', 'Safe AI provider placeholders that document redaction-sensitive values without raw secrets.', ['AI_PROVIDER=', 'AI_MODEL=', 'AI_API_KEY=', 'AI_AUDIT_ENABLED=']),
296
+ artifact('src/presentation/rest/agents/agents.module.ts', 'presentation', 'source', 'module', 'root-wiring', 'REST agents module wiring controllers and use-case ports without provider leakage.', ['@Module', 'AgentRunsController', 'RunAgentUseCasePortSymbol']),
297
+ artifact('src/presentation/rest/agents/controllers/agent-runs.controller.ts', 'presentation', 'source', 'controller', 'agent-controller', 'Swagger-documented agent run endpoint delegating to an application input port.', ['@Controller', '@Post', 'ApiOperation', 'RunAgentUseCasePortSymbol']),
298
+ artifact('src/presentation/rest/agents/dtos/run-agent-input.dto.ts', 'presentation', 'source', 'dto', 'agent-dto', 'Agent run request DTO with prompt and tool allowlist validation metadata.', ['ApiProperty', 'IsString', 'prompt', 'allowedTools']),
299
+ artifact('src/presentation/rest/agents/dtos/agent-run-output.dto.ts', 'presentation', 'source', 'dto', 'agent-dto', 'Agent run response DTO documenting output and audit correlation.', ['ApiProperty', 'runId', 'output', 'auditId']),
300
+ artifact('src/application/intelligence/agents/ports/in/run-agent.use-case.port.ts', 'application', 'source', 'interface', 'agent-use-case', 'Application intelligence input port for agent run requests.', ['RunAgentUseCasePort', 'execute']),
301
+ artifact('src/application/intelligence/agents/use-cases/run-agent.use-case.ts', 'application', 'source', 'use-case', 'agent-use-case', 'Application intelligence use case coordinating provider, tool boundary, prompt safety, redaction, and audit ports.', ['RunAgentUseCase', 'LlmProviderPort', 'AgentToolRegistryPort', 'PromptSafetyPolicyPort', 'redact']),
302
+ artifact('src/application/intelligence/agents/ports/out/llm-provider.port.ts', 'application', 'source', 'interface', 'agent-provider-port', 'Application intelligence provider output port isolating LLM completion calls.', ['LlmProviderPort', 'complete', 'model']),
303
+ artifact('src/application/intelligence/agents/ports/out/agent-tool-registry.port.ts', 'application', 'source', 'interface', 'agent-tool-port', 'Application intelligence output port constraining tool/action execution to an allowlist.', ['AgentToolRegistryPort', 'executeTool', 'allowedTools']),
304
+ artifact('src/application/intelligence/agents/ports/out/agent-audit.port.ts', 'application', 'source', 'interface', 'agent-audit', 'Application intelligence audit output port for redacted prompts, tool calls, and safety outcomes.', ['AgentAuditPort', 'recordToolCall', 'redactedInput']),
305
+ artifact('src/application/intelligence/agents/services/prompt-safety.service.ts', 'application', 'source', 'service', 'agent-safety', 'Prompt and tool safety service that rejects blocked content before provider invocation.', ['PromptSafetyPolicy', 'validatePrompt', 'blockedPatterns']),
306
+ artifact('src/application/intelligence/agents/services/redaction.service.ts', 'application', 'source', 'service', 'agent-redaction', 'Application intelligence redaction service for secrets, tokens, provider keys, and audit-safe payloads.', ['RedactionService', 'redact', 'secret', 'token']),
307
+ artifact('src/infrastructure/adapters/llm/llm-provider.adapter.ts', 'infrastructure', 'source', 'adapter', 'agent-provider-adapter', 'LLM provider adapter that reads provider config and emits redacted diagnostics.', ['LlmProviderAdapter', 'LlmProviderPort', 'AI_API_KEY', 'redact']),
308
+ artifact('src/infrastructure/adapters/audit/agent-audit.adapter.ts', 'infrastructure', 'source', 'adapter', 'agent-audit', 'Audit adapter for agent runs, tool calls, redacted inputs, and safety results.', ['AgentAuditAdapter', 'AgentAuditPort', 'recordToolCall', 'redacted']),
309
+ artifact('docs/agents/ai-agent-api.md', 'docs', 'documentation', 'documentation', 'agent-docs', 'Agent API documentation covering endpoint contract, tool boundary, redaction, audit, and deterministic test policy.', ['tool boundary', 'redaction', 'audit trail', 'deterministic tests']),
310
+ artifact('tests/agents.e2e-spec.ts', 'tests', 'test', 'test', 'agent-tests', 'Agent run evidence using deterministic provider seams and no live credentials.', ['POST /agents/runs', 'deterministic', 'no live credentials', 'expect']),
311
+ artifact('tests/agents-safety.spec.ts', 'tests', 'test', 'test', 'agent-tests', 'Prompt safety, tool boundary, and redaction unit evidence.', ['PromptSafetyPolicy', 'RedactionService', 'blocked', 'redact']),
312
+ ],
313
+ required_quality_gates: [
314
+ ...CODESDD_API_SHARED_BASELINE_QUALITY_GATES,
315
+ ...CODESDD_AI_AGENT_API_PROFILE_QUALITY_GATES,
316
+ ],
317
+ required_validation_commands: CODESDD_AI_AGENT_API_PROFILE_VALIDATION_COMMANDS,
318
+ forbidden_content_markers: [
319
+ 'AI_API_KEY=sk-',
320
+ 'OPENAI_API_KEY=sk-',
321
+ 'ANTHROPIC_API_KEY=sk-',
322
+ 'LIVE_PROVIDER_CALL=true',
323
+ ],
324
+ };
325
+ export function validateMinimalRestProfileRecipe(input) {
326
+ return validateProfileRecipe(input, CODESDD_MINIMAL_REST_PROFILE_RECIPE, {
327
+ profileMismatch: 'MINIMAL_REST_PROFILE_MISMATCH',
328
+ artifactMissing: 'MINIMAL_REST_ARTIFACT_MISSING',
329
+ contentMarkerMissing: 'MINIMAL_REST_CONTENT_MARKER_MISSING',
330
+ qualityGateMissing: 'MINIMAL_REST_QUALITY_GATE_MISSING',
331
+ validationCommandMissing: 'MINIMAL_REST_VALIDATION_COMMAND_MISSING',
332
+ });
333
+ }
334
+ export function validateRestAuthRbacProfileRecipe(input) {
335
+ return validateProfileRecipe(input, CODESDD_REST_AUTH_RBAC_PROFILE_RECIPE, {
336
+ profileMismatch: 'REST_AUTH_RBAC_PROFILE_MISMATCH',
337
+ artifactMissing: 'REST_AUTH_RBAC_ARTIFACT_MISSING',
338
+ contentMarkerMissing: 'REST_AUTH_RBAC_CONTENT_MARKER_MISSING',
339
+ qualityGateMissing: 'REST_AUTH_RBAC_QUALITY_GATE_MISSING',
340
+ validationCommandMissing: 'REST_AUTH_RBAC_VALIDATION_COMMAND_MISSING',
341
+ });
342
+ }
343
+ export function validateRestCrudTypeormProfileRecipe(input) {
344
+ return validateProfileRecipe(input, CODESDD_REST_CRUD_TYPEORM_PROFILE_RECIPE, {
345
+ profileMismatch: 'REST_CRUD_TYPEORM_PROFILE_MISMATCH',
346
+ artifactMissing: 'REST_CRUD_TYPEORM_ARTIFACT_MISSING',
347
+ contentMarkerMissing: 'REST_CRUD_TYPEORM_CONTENT_MARKER_MISSING',
348
+ qualityGateMissing: 'REST_CRUD_TYPEORM_QUALITY_GATE_MISSING',
349
+ validationCommandMissing: 'REST_CRUD_TYPEORM_VALIDATION_COMMAND_MISSING',
350
+ });
351
+ }
352
+ export function validateEventedApiProfileRecipe(input) {
353
+ return validateProfileRecipe(input, CODESDD_EVENTED_API_PROFILE_RECIPE, {
354
+ profileMismatch: 'EVENTED_API_PROFILE_MISMATCH',
355
+ artifactMissing: 'EVENTED_API_ARTIFACT_MISSING',
356
+ contentMarkerMissing: 'EVENTED_API_CONTENT_MARKER_MISSING',
357
+ qualityGateMissing: 'EVENTED_API_QUALITY_GATE_MISSING',
358
+ validationCommandMissing: 'EVENTED_API_VALIDATION_COMMAND_MISSING',
359
+ });
360
+ }
361
+ export function validateAiAgentApiProfileRecipe(input) {
362
+ return validateProfileRecipe(input, CODESDD_AI_AGENT_API_PROFILE_RECIPE, {
363
+ profileMismatch: 'AI_AGENT_API_PROFILE_MISMATCH',
364
+ artifactMissing: 'AI_AGENT_API_ARTIFACT_MISSING',
365
+ contentMarkerMissing: 'AI_AGENT_API_CONTENT_MARKER_MISSING',
366
+ qualityGateMissing: 'AI_AGENT_API_QUALITY_GATE_MISSING',
367
+ validationCommandMissing: 'AI_AGENT_API_VALIDATION_COMMAND_MISSING',
368
+ });
369
+ }
370
+ function validateProfileRecipe(input, recipe, failureCodes) {
371
+ const artifactPaths = new Set(input.artifactPaths.map((value) => value.trim()));
372
+ const qualityGates = new Set(input.qualityGates.map((value) => value.trim()));
373
+ const validationCommands = new Set(input.validationCommands.map((value) => value.trim()));
374
+ const missingArtifacts = recipe.required_artifacts
375
+ .map((artifactDefinition) => artifactDefinition.path)
376
+ .filter((path) => !artifactPaths.has(path));
377
+ const missingContentMarkers = input.artifactContents
378
+ ? recipe.required_artifacts.flatMap((artifactDefinition) => {
379
+ const content = input.artifactContents?.[artifactDefinition.path] ?? '';
380
+ return artifactDefinition.content_markers
381
+ .filter((marker) => !content.includes(marker))
382
+ .map((marker) => `${artifactDefinition.path}::${marker}`);
383
+ })
384
+ : [];
385
+ const missingQualityGates = recipe.required_quality_gates.filter((gate) => !qualityGates.has(gate));
386
+ const missingValidationCommands = recipe.required_validation_commands.filter((command) => !validationCommands.has(command));
387
+ const forbiddenArtifacts = recipe.profile_id === 'rest-crud-typeorm' ? findForbiddenRestCrudTypeormArtifacts([...artifactPaths]) : [];
388
+ const forbiddenContentMarkers = recipe.profile_id === 'rest-crud-typeorm'
389
+ ? findForbiddenRestCrudTypeormContentMarkers(input.artifactContents)
390
+ : recipe.profile_id === 'ai-agent-api'
391
+ ? findForbiddenAiAgentApiContentMarkers(input.artifactContents)
392
+ : [];
393
+ const findings = [];
394
+ if (input.profileId !== recipe.profile_id) {
395
+ findings.push({
396
+ code: failureCodes.profileMismatch,
397
+ severity: 'error',
398
+ message: `${recipe.profile_id} recipe validator received profile ${input.profileId}.`,
399
+ expected: recipe.profile_id,
400
+ });
401
+ }
402
+ findings.push(...missingArtifacts.map((path) => finding(failureCodes.artifactMissing, `Required ${recipe.profile_id} artifact is missing.`, path)), ...missingContentMarkers.map((marker) => finding(failureCodes.contentMarkerMissing, `Required ${recipe.profile_id} content marker is missing.`, marker)), ...missingQualityGates.map((gate) => finding(failureCodes.qualityGateMissing, `Required ${recipe.profile_id} quality gate is missing.`, gate)), ...missingValidationCommands.map((command) => finding(failureCodes.validationCommandMissing, `Required ${recipe.profile_id} validation command is missing.`, command)), ...forbiddenArtifacts.map((path) => finding('REST_CRUD_TYPEORM_FORBIDDEN_ARTIFACT', 'Forbidden rest-crud-typeorm artifact violates TypeORM-only or Foundation boundary policy.', path)), ...forbiddenContentMarkers.map((marker) => recipe.profile_id === 'ai-agent-api'
403
+ ? finding('AI_AGENT_API_FORBIDDEN_CONTENT_MARKER', 'Forbidden ai-agent-api content marker violates no-live-credential policy.', marker)
404
+ : finding('REST_CRUD_TYPEORM_FORBIDDEN_CONTENT_MARKER', 'Forbidden rest-crud-typeorm content marker violates TypeORM-only policy.', marker)));
405
+ return {
406
+ profile_id: input.profileId,
407
+ recipe_id: recipe.id,
408
+ status: findings.length === 0 ? 'passed' : 'failed',
409
+ missing_artifacts: missingArtifacts,
410
+ missing_content_markers: missingContentMarkers,
411
+ missing_quality_gates: missingQualityGates,
412
+ missing_validation_commands: missingValidationCommands,
413
+ forbidden_artifacts: forbiddenArtifacts,
414
+ forbidden_content_markers: forbiddenContentMarkers,
415
+ findings,
416
+ };
417
+ }
418
+ function findForbiddenRestCrudTypeormArtifacts(artifactPaths) {
419
+ return artifactPaths.filter((path) => {
420
+ const normalized = path.trim();
421
+ const lower = normalized.toLowerCase();
422
+ if (lower.includes('prisma') || lower.endsWith('.prisma')) {
423
+ return true;
424
+ }
425
+ if (lower.startsWith('src/domain/categories/entities/') ||
426
+ lower.startsWith('src/domain/categories/repository-ports/')) {
427
+ return true;
428
+ }
429
+ const isOrmTechnicalArtifact = lower.includes('typeorm') ||
430
+ lower.includes('orm-entity') ||
431
+ lower.includes('/migrations/') ||
432
+ lower.includes('/mappers/');
433
+ return isOrmTechnicalArtifact && !lower.startsWith('src/infrastructure/adapters/orm/');
434
+ });
435
+ }
436
+ function findForbiddenRestCrudTypeormContentMarkers(artifactContents) {
437
+ if (!artifactContents) {
438
+ return [];
439
+ }
440
+ const forbiddenMarkers = CODESDD_REST_CRUD_TYPEORM_PROFILE_RECIPE.forbidden_content_markers ?? [];
441
+ return Object.entries(artifactContents).flatMap(([path, content]) => forbiddenMarkers
442
+ .filter((marker) => content.includes(marker))
443
+ .map((marker) => `${path}::${marker}`));
444
+ }
445
+ function findForbiddenAiAgentApiContentMarkers(artifactContents) {
446
+ if (!artifactContents) {
447
+ return [];
448
+ }
449
+ const forbiddenMarkers = CODESDD_AI_AGENT_API_PROFILE_RECIPE.forbidden_content_markers ?? [];
450
+ return Object.entries(artifactContents).flatMap(([path, content]) => [
451
+ ...forbiddenMarkers
452
+ .filter((marker) => content.includes(marker))
453
+ .map((marker) => `${path}::${marker}`),
454
+ ...CODESDD_AI_AGENT_API_FORBIDDEN_CONTENT_PATTERNS
455
+ .filter(({ pattern }) => pattern.test(content))
456
+ .map(({ id }) => `${path}::${id}`),
457
+ ]);
458
+ }
459
+ function mandatoryRuntimeScriptArtifacts() {
460
+ return [
461
+ artifact('scripts/cleanup.sh', 'root', 'source', 'implementation', 'scripts', 'Destructive cleanup script removing dependency installs, build outputs, caches, lockfiles, and TypeScript compilation residue before reinstall or clean validation.', CODESDD_API_MANDATORY_CLEANUP_SCRIPT_MARKERS),
462
+ artifact('scripts/kill-port.js', 'root', 'source', 'implementation', 'scripts', 'Cross-platform port preflight used by start and start:dev before Nest bootstrap continues.', CODESDD_API_MANDATORY_KILL_PORT_SCRIPT_MARKERS),
463
+ ];
464
+ }
465
+ function artifact(path, layer, artifactKind, role, category, reason, contentMarkers) {
466
+ return {
467
+ path,
468
+ layer,
469
+ artifact_kind: artifactKind,
470
+ role,
471
+ category,
472
+ reason,
473
+ content_markers: contentMarkers,
474
+ };
475
+ }
476
+ function finding(code, message, expected) {
477
+ return {
478
+ code,
479
+ severity: 'error',
480
+ message,
481
+ expected,
482
+ };
483
+ }
484
+ //# sourceMappingURL=api-profile-recipes.js.map