@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,141 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { promises as fs } from 'node:fs';
3
+ import path from 'node:path';
4
+ import { parseWorkspaceYamlDocument } from '../workspace-schemas.js';
5
+ const PLACEHOLDER_PATTERNS = [
6
+ /\(fill in/i,
7
+ /\(placeholder/i,
8
+ /\btodo\b/i,
9
+ /\btbd\b/i,
10
+ /\bpending\b/i,
11
+ /\bmust implement\b/i,
12
+ /\bto be executed\b/i,
13
+ /\bplanned\b/i,
14
+ /\bwill be\b/i,
15
+ /\bto do\b/i,
16
+ ];
17
+ const GENERIC_EVIDENCE_PATTERNS = [
18
+ /must implement and record executable evidence/i,
19
+ /planned but not yet executed/i,
20
+ /is implemented only in the planned surfaces/i,
21
+ /planned implementation surface/i,
22
+ /pending\.?$/i,
23
+ ];
24
+ const DEFAULT_GRANDFATHER_MAX_FEAT = 451;
25
+ function featNumericId(featureId) {
26
+ const match = featureId.match(/^FEAT-(\d{4,})$/);
27
+ if (!match)
28
+ return null;
29
+ return Number.parseInt(match[1] || '', 10);
30
+ }
31
+ function hasPattern(text, patterns) {
32
+ return patterns.some((pattern) => pattern.test(text));
33
+ }
34
+ function qualityHasPlaceholderOrGenericEvidence(document) {
35
+ let hasPlaceholder = false;
36
+ let hasGeneric = false;
37
+ const evidenceTexts = [
38
+ ...document.evidence_log.flatMap((entry) => [entry.kind, entry.result, entry.artifact ?? '']),
39
+ ...document.acceptance_matrix.flatMap((entry) => [entry.criterion, entry.evidence]),
40
+ ];
41
+ for (const text of evidenceTexts) {
42
+ if (!text)
43
+ continue;
44
+ if (!hasPlaceholder && hasPattern(text, PLACEHOLDER_PATTERNS)) {
45
+ hasPlaceholder = true;
46
+ }
47
+ if (!hasGeneric && hasPattern(text, GENERIC_EVIDENCE_PATTERNS)) {
48
+ hasGeneric = true;
49
+ }
50
+ if (hasPlaceholder && hasGeneric) {
51
+ break;
52
+ }
53
+ }
54
+ return { hasPlaceholder, hasGeneric };
55
+ }
56
+ export async function scanArchiveQualityCoherence(archivedDir, options = {}) {
57
+ if (!existsSync(archivedDir)) {
58
+ return {
59
+ scanned: 0,
60
+ analyzed: 0,
61
+ grandfathered: 0,
62
+ issues: [],
63
+ };
64
+ }
65
+ const grandfatherMaxFeat = options.grandfatherMaxFeat ?? DEFAULT_GRANDFATHER_MAX_FEAT;
66
+ const issues = [];
67
+ const entries = await fs.readdir(archivedDir, { withFileTypes: true });
68
+ let scanned = 0;
69
+ let analyzed = 0;
70
+ let grandfathered = 0;
71
+ for (const entry of entries) {
72
+ if (!entry.isDirectory() || !entry.name.startsWith('FEAT-'))
73
+ continue;
74
+ scanned += 1;
75
+ const featureId = entry.name;
76
+ const numericId = featNumericId(featureId);
77
+ if (numericId !== null && numericId <= grandfatherMaxFeat) {
78
+ grandfathered += 1;
79
+ continue;
80
+ }
81
+ const qualityPath = path.join(archivedDir, featureId, '5-quality.yaml');
82
+ if (!existsSync(qualityPath)) {
83
+ continue;
84
+ }
85
+ const raw = await fs.readFile(qualityPath, 'utf-8').catch(() => '');
86
+ if (!raw.trim()) {
87
+ continue;
88
+ }
89
+ let quality;
90
+ try {
91
+ quality = parseWorkspaceYamlDocument('5-quality.yaml', raw);
92
+ }
93
+ catch {
94
+ continue;
95
+ }
96
+ analyzed += 1;
97
+ if (quality.q95_ledger.status !== 'pass') {
98
+ continue;
99
+ }
100
+ if (quality.acceptance_matrix.some((entry) => entry.status === 'not_met')) {
101
+ issues.push({
102
+ featureId,
103
+ qualityPath,
104
+ issueCode: 'ACCEPTANCE_NOT_MET_WITH_Q95_PASS',
105
+ message: `${featureId} archived quality has q95_ledger.status=pass but acceptance_matrix contains not_met entries.`,
106
+ });
107
+ }
108
+ if (quality.requirement_validation_evidence_risk_matrix.some((entry) => entry.risk_status === 'open')) {
109
+ issues.push({
110
+ featureId,
111
+ qualityPath,
112
+ issueCode: 'OPEN_RISK_WITH_Q95_PASS',
113
+ message: `${featureId} archived quality has q95_ledger.status=pass but requirement risk_status=open remains unresolved.`,
114
+ });
115
+ }
116
+ const evidenceSignals = qualityHasPlaceholderOrGenericEvidence(quality);
117
+ if (evidenceSignals.hasPlaceholder) {
118
+ issues.push({
119
+ featureId,
120
+ qualityPath,
121
+ issueCode: 'PLACEHOLDER_EVIDENCE_WITH_Q95_PASS',
122
+ message: `${featureId} archived quality has q95_ledger.status=pass but placeholder/future-tense evidence markers are present.`,
123
+ });
124
+ }
125
+ if (evidenceSignals.hasGeneric) {
126
+ issues.push({
127
+ featureId,
128
+ qualityPath,
129
+ issueCode: 'GENERIC_EVIDENCE_WITH_Q95_PASS',
130
+ message: `${featureId} archived quality has q95_ledger.status=pass but generic non-executable evidence text is still present.`,
131
+ });
132
+ }
133
+ }
134
+ return {
135
+ scanned,
136
+ analyzed,
137
+ grandfathered,
138
+ issues,
139
+ };
140
+ }
141
+ //# sourceMappingURL=archive-quality-coherence.service.js.map
@@ -0,0 +1,18 @@
1
+ import { type CapabilityDiffReport, type CapabilityInventory, type CapabilityInventoryItem, type CapabilityKind, type CapabilityRiskInput, type CapabilityRiskReport } from '../domain/capability-diff.js';
2
+ export interface CapabilityDiffServiceRequest extends Omit<CapabilityRiskInput, 'diff'> {
3
+ before: CapabilityInventoryItem[] | CapabilityInventory;
4
+ after: CapabilityInventoryItem[] | CapabilityInventory;
5
+ required_kinds?: CapabilityKind[];
6
+ }
7
+ export interface CapabilityDiffServiceResult {
8
+ schema_version: 1;
9
+ contract: 'capability-diff-service-result/v1';
10
+ before: CapabilityInventory;
11
+ after: CapabilityInventory;
12
+ diff: CapabilityDiffReport;
13
+ risk: CapabilityRiskReport;
14
+ }
15
+ export declare class CapabilityDiffService {
16
+ execute(request: CapabilityDiffServiceRequest): CapabilityDiffServiceResult;
17
+ }
18
+ //# sourceMappingURL=capability-diff.service.d.ts.map
@@ -0,0 +1,26 @@
1
+ import { buildCapabilityInventory, diffCapabilityInventories, scoreCapabilityDiffRisk, } from '../domain/capability-diff.js';
2
+ export class CapabilityDiffService {
3
+ execute(request) {
4
+ const before = normalizeInventoryRequest(request.before);
5
+ const after = normalizeInventoryRequest(request.after);
6
+ const diff = diffCapabilityInventories(before, after);
7
+ const risk = scoreCapabilityDiffRisk({
8
+ diff,
9
+ change_safety: request.change_safety,
10
+ planned_changes: request.planned_changes,
11
+ required_kinds: request.required_kinds,
12
+ });
13
+ return {
14
+ schema_version: 1,
15
+ contract: 'capability-diff-service-result/v1',
16
+ before,
17
+ after,
18
+ diff,
19
+ risk,
20
+ };
21
+ }
22
+ }
23
+ function normalizeInventoryRequest(input) {
24
+ return Array.isArray(input) ? buildCapabilityInventory(input) : input;
25
+ }
26
+ //# sourceMappingURL=capability-diff.service.js.map
@@ -0,0 +1,17 @@
1
+ import { type ChangeSafetyContract, type ChangeSafetyEvaluation, type PlannedFileChange } from '../domain/change-safety-guardrails.js';
2
+ export interface ChangeSafetyPreflightRequest {
3
+ feature_id: string;
4
+ change_safety?: ChangeSafetyContract;
5
+ planned_changes?: PlannedFileChange[];
6
+ }
7
+ export interface ChangeSafetyPreflightResult extends ChangeSafetyEvaluation {
8
+ schema_version: 1;
9
+ contract: 'change-safety-preflight/v1';
10
+ feature_id: string;
11
+ fail_closed: true;
12
+ phase: 'mechanical';
13
+ }
14
+ export declare class ChangeSafetyPreflightService {
15
+ execute(request: ChangeSafetyPreflightRequest): ChangeSafetyPreflightResult;
16
+ }
17
+ //# sourceMappingURL=change-safety-preflight.service.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { evaluateChangeSafety, } from '../domain/change-safety-guardrails.js';
2
+ export class ChangeSafetyPreflightService {
3
+ execute(request) {
4
+ const evaluation = evaluateChangeSafety(request.change_safety ?? {}, request.planned_changes ?? [], {
5
+ feature_id: request.feature_id,
6
+ });
7
+ return {
8
+ schema_version: 1,
9
+ contract: 'change-safety-preflight/v1',
10
+ feature_id: request.feature_id,
11
+ fail_closed: true,
12
+ phase: 'mechanical',
13
+ ...evaluation,
14
+ };
15
+ }
16
+ }
17
+ //# sourceMappingURL=change-safety-preflight.service.js.map
@@ -1,346 +1,49 @@
1
1
  import { SddStores } from "../store/sdd-stores.js";
2
+ export declare const CONTEXT_PACK_BUDGET_MODES: readonly ["compact", "standard", "full"];
3
+ export type ContextPackBudgetMode = (typeof CONTEXT_PACK_BUDGET_MODES)[number];
4
+ export type ContextServiceOptions = {
5
+ budgetMode?: ContextPackBudgetMode;
6
+ };
7
+ type ContextPackBudgetReport = {
8
+ mode: ContextPackBudgetMode;
9
+ estimated_chars_before_budget: number;
10
+ estimated_chars_after_budget: number;
11
+ deduped_fields: Array<{
12
+ field: string;
13
+ before: number;
14
+ after: number;
15
+ removed: number;
16
+ }>;
17
+ truncated_fields: string[];
18
+ };
19
+ type ContextPackDisclosureHint = {
20
+ mode: ContextPackBudgetMode;
21
+ reveal_command: string;
22
+ omitted_fields: Array<{
23
+ field: string;
24
+ omitted_count: number;
25
+ reason: 'budget';
26
+ }>;
27
+ };
28
+ type ContextPackCacheMetadata = {
29
+ schema_version: 2;
30
+ enabled: true;
31
+ hit: boolean;
32
+ key: string;
33
+ project_fingerprint: string;
34
+ source_fingerprint: string;
35
+ cache_path: string;
36
+ refreshed_at: string;
37
+ };
38
+ type ContextPackWithBudget = Record<string, unknown> & {
39
+ context_budget: ContextPackBudgetReport;
40
+ progressive_disclosure?: ContextPackDisclosureHint;
41
+ context_cache?: ContextPackCacheMetadata;
42
+ };
2
43
  export declare class ContextService {
3
44
  private readonly stores;
4
45
  constructor(stores: SddStores);
5
- execute(projectRoot: string, ref: string): Promise<{
6
- sdd_pack_version: number;
7
- target_id: string;
8
- target_type: "FEAT";
9
- summary: string;
10
- objective: string;
11
- expected_outcome: string;
12
- system_impact: string;
13
- architectural_impact: {
14
- description: string;
15
- affected_modules: string[];
16
- } | null;
17
- workspace_frontend_impact: {
18
- status: "unknown" | "none" | "required";
19
- description: string;
20
- } | null;
21
- affected_contracts: {
22
- name: string;
23
- change_type: string;
24
- }[];
25
- quality_strategy: {
26
- unit_target: number;
27
- integration_target: number;
28
- approach: string;
29
- } | null;
30
- workspace: {
31
- path: string;
32
- state: "" | "active" | "planned" | "archived";
33
- docs: string[];
34
- schema_errors: string[];
35
- };
36
- origin: {
37
- type: "radar" | "epic" | "direct" | "fast_track" | "frontend_gap" | "tech_debt";
38
- ref: string;
39
- };
40
- related_discovery: string[];
41
- related_gaps: string[];
42
- recommended_skills: string[];
43
- recommended_bundles: string[];
44
- skill_execution_contract: {
45
- required: boolean;
46
- required_skill_ids: string[];
47
- verification_location: string;
48
- verification_rule: string;
49
- };
50
- change_name: string;
51
- blocked_by: string[];
52
- lock_domains: string[];
53
- parallel_group: string | undefined;
54
- planning_mode: "local_plan" | "direct_tasks";
55
- flow_mode: "direto" | "padrao" | "rigoroso";
56
- current_stage: "proposta" | "planejamento" | "tarefas" | "execucao" | "consolidacao";
57
- gates: {
58
- proposta: {
59
- status: "nao_exigida" | "rascunho" | "pronta" | "aprovada";
60
- approved_at?: string | undefined;
61
- approved_by?: string | undefined;
62
- note?: string | undefined;
63
- };
64
- planejamento: {
65
- status: "nao_exigida" | "rascunho" | "pronta" | "aprovada";
66
- approved_at?: string | undefined;
67
- approved_by?: string | undefined;
68
- note?: string | undefined;
69
- };
70
- tarefas: {
71
- status: "nao_exigida" | "rascunho" | "pronta" | "aprovada";
72
- approved_at?: string | undefined;
73
- approved_by?: string | undefined;
74
- note?: string | undefined;
75
- };
76
- };
77
- frontend_impact_status: "unknown" | "none" | "required";
78
- frontend_impact_reason: string;
79
- frontend_impact_declared_at: string;
80
- frontend_surface_tokens: string[];
81
- quality_contract: {
82
- version: 1;
83
- enabled: boolean;
84
- scope: string;
85
- unit_target_percent: number;
86
- integration_target_percent: number;
87
- evidence_mode: "coverage" | "equivalence" | "hybrid";
88
- enforcement: "advisory" | "blocking";
89
- stack_profile: string;
90
- required_axes: string[];
91
- required_evidence: {
92
- kind: string;
93
- required: boolean;
94
- status: "planned" | "provided" | "waived";
95
- command?: string | undefined;
96
- artifact?: string | undefined;
97
- notes?: string | undefined;
98
- }[];
99
- exceptions: {
100
- id: string;
101
- scope: string;
102
- reason: string;
103
- accepted_risk: string;
104
- compensating_control: string;
105
- review_deadline: string;
106
- approved_by: string;
107
- approved_at?: string | undefined;
108
- }[];
109
- inherited_from?: string | undefined;
110
- updated_at?: string | undefined;
111
- } | null;
112
- quality_artifact: string;
113
- start_commit_sha: string;
114
- next_action: string;
115
- execution_kind: "documentation" | "feature" | "infra" | "migration" | "frontend_coverage";
116
- produces: string[];
117
- consumes: string[];
118
- predecessor_outputs: {
119
- feature_id: string;
120
- status: "ARCHIVED" | "READY" | "IN_PROGRESS" | "DONE" | "BLOCKED" | "SYNC_REQUIRED" | "VERIFY_FAILED";
121
- produces: string[];
122
- summary: string;
123
- }[];
124
- relevant_adrs: string[];
125
- relevant_services: {
126
- id: string;
127
- name: string;
128
- contracts: string[];
129
- }[];
130
- relevant_contracts: string[];
131
- relevant_frontend_decisions: {
132
- id: string;
133
- title: string;
134
- status: "APPROVED" | "DISCARDED" | "SUPERSEDED" | "PROPOSED";
135
- route_refs: string[];
136
- }[];
137
- read_order: string[];
138
- active_path: string;
139
- unresolved_blocked_by: string[];
140
- lock_conflicts_with: string[];
141
- readiness: "READY" | "BLOCKED" | "LOCK_CONFLICT";
142
- core_docs: string[];
143
- related_features?: undefined;
144
- related_debates?: undefined;
145
- source_feature?: undefined;
146
- resolved_by_feature?: undefined;
147
- routes?: undefined;
148
- related_refs?: undefined;
149
- } | {
150
- sdd_pack_version: number;
151
- target_id: string;
152
- target_type: "RAD" | "EPIC";
153
- summary: string;
154
- quality_contract: {
155
- version: 1;
156
- enabled: boolean;
157
- scope: string;
158
- unit_target_percent: number;
159
- integration_target_percent: number;
160
- evidence_mode: "coverage" | "equivalence" | "hybrid";
161
- enforcement: "advisory" | "blocking";
162
- stack_profile: string;
163
- required_axes: string[];
164
- required_evidence: {
165
- kind: string;
166
- required: boolean;
167
- status: "planned" | "provided" | "waived";
168
- command?: string | undefined;
169
- artifact?: string | undefined;
170
- notes?: string | undefined;
171
- }[];
172
- exceptions: {
173
- id: string;
174
- scope: string;
175
- reason: string;
176
- accepted_risk: string;
177
- compensating_control: string;
178
- review_deadline: string;
179
- approved_by: string;
180
- approved_at?: string | undefined;
181
- }[];
182
- inherited_from?: string | undefined;
183
- updated_at?: string | undefined;
184
- } | null;
185
- related_features: string[];
186
- related_debates: string[];
187
- read_order: string[];
188
- core_docs: string[];
189
- objective?: undefined;
190
- expected_outcome?: undefined;
191
- system_impact?: undefined;
192
- architectural_impact?: undefined;
193
- workspace_frontend_impact?: undefined;
194
- affected_contracts?: undefined;
195
- quality_strategy?: undefined;
196
- workspace?: undefined;
197
- origin?: undefined;
198
- related_discovery?: undefined;
199
- related_gaps?: undefined;
200
- recommended_skills?: undefined;
201
- recommended_bundles?: undefined;
202
- skill_execution_contract?: undefined;
203
- change_name?: undefined;
204
- blocked_by?: undefined;
205
- lock_domains?: undefined;
206
- parallel_group?: undefined;
207
- planning_mode?: undefined;
208
- flow_mode?: undefined;
209
- current_stage?: undefined;
210
- gates?: undefined;
211
- frontend_impact_status?: undefined;
212
- frontend_impact_reason?: undefined;
213
- frontend_impact_declared_at?: undefined;
214
- frontend_surface_tokens?: undefined;
215
- quality_artifact?: undefined;
216
- start_commit_sha?: undefined;
217
- next_action?: undefined;
218
- execution_kind?: undefined;
219
- produces?: undefined;
220
- consumes?: undefined;
221
- predecessor_outputs?: undefined;
222
- relevant_adrs?: undefined;
223
- relevant_services?: undefined;
224
- relevant_contracts?: undefined;
225
- relevant_frontend_decisions?: undefined;
226
- active_path?: undefined;
227
- unresolved_blocked_by?: undefined;
228
- lock_conflicts_with?: undefined;
229
- readiness?: undefined;
230
- source_feature?: undefined;
231
- resolved_by_feature?: undefined;
232
- routes?: undefined;
233
- related_refs?: undefined;
234
- } | {
235
- sdd_pack_version: number;
236
- target_id: string;
237
- target_type: "FGAP";
238
- summary: string;
239
- source_feature: string;
240
- resolved_by_feature: string;
241
- routes: string[];
242
- read_order: string[];
243
- core_docs: string[];
244
- objective?: undefined;
245
- expected_outcome?: undefined;
246
- system_impact?: undefined;
247
- architectural_impact?: undefined;
248
- workspace_frontend_impact?: undefined;
249
- affected_contracts?: undefined;
250
- quality_strategy?: undefined;
251
- workspace?: undefined;
252
- origin?: undefined;
253
- related_discovery?: undefined;
254
- related_gaps?: undefined;
255
- recommended_skills?: undefined;
256
- recommended_bundles?: undefined;
257
- skill_execution_contract?: undefined;
258
- change_name?: undefined;
259
- blocked_by?: undefined;
260
- lock_domains?: undefined;
261
- parallel_group?: undefined;
262
- planning_mode?: undefined;
263
- flow_mode?: undefined;
264
- current_stage?: undefined;
265
- gates?: undefined;
266
- frontend_impact_status?: undefined;
267
- frontend_impact_reason?: undefined;
268
- frontend_impact_declared_at?: undefined;
269
- frontend_surface_tokens?: undefined;
270
- quality_contract?: undefined;
271
- quality_artifact?: undefined;
272
- start_commit_sha?: undefined;
273
- next_action?: undefined;
274
- execution_kind?: undefined;
275
- produces?: undefined;
276
- consumes?: undefined;
277
- predecessor_outputs?: undefined;
278
- relevant_adrs?: undefined;
279
- relevant_services?: undefined;
280
- relevant_contracts?: undefined;
281
- relevant_frontend_decisions?: undefined;
282
- active_path?: undefined;
283
- unresolved_blocked_by?: undefined;
284
- lock_conflicts_with?: undefined;
285
- readiness?: undefined;
286
- related_features?: undefined;
287
- related_debates?: undefined;
288
- related_refs?: undefined;
289
- } | {
290
- sdd_pack_version: number;
291
- target_id: string;
292
- target_type: "TD";
293
- summary: string;
294
- related_refs: string[];
295
- read_order: string[];
296
- core_docs: string[];
297
- objective?: undefined;
298
- expected_outcome?: undefined;
299
- system_impact?: undefined;
300
- architectural_impact?: undefined;
301
- workspace_frontend_impact?: undefined;
302
- affected_contracts?: undefined;
303
- quality_strategy?: undefined;
304
- workspace?: undefined;
305
- origin?: undefined;
306
- related_discovery?: undefined;
307
- related_gaps?: undefined;
308
- recommended_skills?: undefined;
309
- recommended_bundles?: undefined;
310
- skill_execution_contract?: undefined;
311
- change_name?: undefined;
312
- blocked_by?: undefined;
313
- lock_domains?: undefined;
314
- parallel_group?: undefined;
315
- planning_mode?: undefined;
316
- flow_mode?: undefined;
317
- current_stage?: undefined;
318
- gates?: undefined;
319
- frontend_impact_status?: undefined;
320
- frontend_impact_reason?: undefined;
321
- frontend_impact_declared_at?: undefined;
322
- frontend_surface_tokens?: undefined;
323
- quality_contract?: undefined;
324
- quality_artifact?: undefined;
325
- start_commit_sha?: undefined;
326
- next_action?: undefined;
327
- execution_kind?: undefined;
328
- produces?: undefined;
329
- consumes?: undefined;
330
- predecessor_outputs?: undefined;
331
- relevant_adrs?: undefined;
332
- relevant_services?: undefined;
333
- relevant_contracts?: undefined;
334
- relevant_frontend_decisions?: undefined;
335
- active_path?: undefined;
336
- unresolved_blocked_by?: undefined;
337
- lock_conflicts_with?: undefined;
338
- readiness?: undefined;
339
- related_features?: undefined;
340
- related_debates?: undefined;
341
- source_feature?: undefined;
342
- resolved_by_feature?: undefined;
343
- routes?: undefined;
344
- }>;
46
+ execute(projectRoot: string, ref: string, options?: ContextServiceOptions): Promise<ContextPackWithBudget>;
345
47
  }
48
+ export {};
346
49
  //# sourceMappingURL=context.service.d.ts.map