@bhargavvc/sdd-cc 1.30.0 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja-JP.md +144 -110
- package/README.ko-KR.md +143 -107
- package/README.md +183 -112
- package/README.pt-BR.md +90 -52
- package/README.zh-CN.md +141 -101
- package/agents/sdd-advisor-researcher.md +23 -0
- package/agents/sdd-ai-researcher.md +133 -0
- package/agents/sdd-code-fixer.md +516 -0
- package/agents/sdd-code-reviewer.md +355 -0
- package/agents/sdd-codebase-mapper.md +3 -3
- package/agents/sdd-debugger.md +17 -5
- package/agents/sdd-doc-verifier.md +201 -0
- package/agents/sdd-doc-writer.md +602 -0
- package/agents/sdd-domain-researcher.md +153 -0
- package/agents/sdd-eval-auditor.md +164 -0
- package/agents/sdd-eval-planner.md +154 -0
- package/agents/sdd-executor.md +87 -4
- package/agents/sdd-framework-selector.md +160 -0
- package/agents/sdd-intel-updater.md +314 -0
- package/agents/sdd-nyquist-auditor.md +1 -1
- package/agents/sdd-phase-researcher.md +71 -4
- package/agents/sdd-plan-checker.md +100 -6
- package/agents/sdd-planner.md +145 -206
- package/agents/sdd-project-researcher.md +25 -2
- package/agents/sdd-research-synthesizer.md +3 -3
- package/agents/sdd-roadmapper.md +6 -6
- package/agents/sdd-security-auditor.md +128 -0
- package/agents/sdd-ui-auditor.md +43 -3
- package/agents/sdd-ui-checker.md +5 -5
- package/agents/sdd-ui-researcher.md +27 -4
- package/agents/sdd-user-profiler.md +2 -2
- package/agents/sdd-verifier.md +142 -22
- package/bin/install.js +2151 -551
- package/commands/sdd/add-backlog.md +5 -5
- package/commands/sdd/add-tests.md +2 -2
- package/commands/sdd/ai-integration-phase.md +36 -0
- package/commands/sdd/analyze-dependencies.md +34 -0
- package/commands/sdd/audit-fix.md +33 -0
- package/commands/sdd/autonomous.md +7 -2
- package/commands/sdd/cleanup.md +5 -0
- package/commands/sdd/code-review-fix.md +52 -0
- package/commands/sdd/code-review.md +55 -0
- package/commands/sdd/complete-milestone.md +6 -6
- package/commands/sdd/debug.md +22 -9
- package/commands/sdd/discuss-phase.md +7 -2
- package/commands/sdd/do.md +1 -1
- package/commands/sdd/docs-update.md +48 -0
- package/commands/sdd/eval-review.md +32 -0
- package/commands/sdd/execute-phase.md +4 -0
- package/commands/sdd/explore.md +27 -0
- package/commands/sdd/fast.md +2 -2
- package/commands/sdd/from-sdd2.md +45 -0
- package/commands/sdd/help.md +2 -0
- package/commands/sdd/import.md +36 -0
- package/commands/sdd/intel.md +179 -0
- package/commands/sdd/join-discord.md +2 -1
- package/commands/sdd/manager.md +1 -0
- package/commands/sdd/map-codebase.md +3 -3
- package/commands/sdd/new-milestone.md +1 -1
- package/commands/sdd/new-project.md +5 -1
- package/commands/sdd/new-workspace.md +1 -1
- package/commands/sdd/next.md +2 -0
- package/commands/sdd/plan-milestone-gaps.md +2 -2
- package/commands/sdd/plan-phase.md +6 -1
- package/commands/sdd/plant-seed.md +1 -1
- package/commands/sdd/profile-user.md +1 -1
- package/commands/sdd/quick.md +5 -3
- package/commands/sdd/reapply-patches.md +230 -42
- package/commands/sdd/research-phase.md +3 -3
- package/commands/sdd/review-backlog.md +1 -0
- package/commands/sdd/review.md +6 -3
- package/commands/sdd/scan.md +26 -0
- package/commands/sdd/secure-phase.md +35 -0
- package/commands/sdd/ship.md +1 -1
- package/commands/sdd/thread.md +5 -5
- package/commands/sdd/undo.md +34 -0
- package/commands/sdd/verify-work.md +1 -1
- package/commands/sdd/workstreams.md +17 -11
- package/hooks/dist/sdd-check-update.js +33 -8
- package/hooks/dist/sdd-context-monitor.js +17 -8
- package/hooks/dist/sdd-phase-boundary.sh +27 -0
- package/hooks/dist/sdd-prompt-guard.js +1 -0
- package/hooks/dist/sdd-read-guard.js +82 -0
- package/hooks/dist/sdd-session-state.sh +33 -0
- package/hooks/dist/sdd-statusline.js +137 -15
- package/hooks/dist/sdd-validate-commit.sh +47 -0
- package/hooks/dist/sdd-workflow-guard.js +4 -4
- package/hooks/sdd-check-update.js +139 -0
- package/hooks/sdd-context-monitor.js +165 -0
- package/hooks/sdd-phase-boundary.sh +27 -0
- package/hooks/sdd-prompt-guard.js +97 -0
- package/hooks/sdd-read-guard.js +82 -0
- package/hooks/sdd-session-state.sh +33 -0
- package/hooks/sdd-statusline.js +241 -0
- package/hooks/sdd-validate-commit.sh +47 -0
- package/hooks/sdd-workflow-guard.js +94 -0
- package/package.json +3 -3
- package/scripts/build-hooks.js +18 -7
- package/scripts/prompt-injection-scan.sh +1 -0
- package/scripts/rebrand-gsd-to-sdd.sh +221 -220
- package/scripts/run-tests.cjs +5 -1
- package/scripts/sync-upstream.sh +1 -1
- package/sdd/bin/lib/commands.cjs +79 -17
- package/sdd/bin/lib/config.cjs +90 -48
- package/sdd/bin/lib/core.cjs +452 -87
- package/sdd/bin/lib/docs.cjs +267 -0
- package/sdd/bin/lib/frontmatter.cjs +381 -336
- package/sdd/bin/lib/init.cjs +110 -16
- package/sdd/bin/lib/intel.cjs +660 -0
- package/sdd/bin/lib/learnings.cjs +378 -0
- package/sdd/bin/lib/milestone.cjs +42 -11
- package/sdd/bin/lib/model-profiles.cjs +17 -15
- package/sdd/bin/lib/phase.cjs +367 -288
- package/sdd/bin/lib/profile-output.cjs +106 -10
- package/sdd/bin/lib/roadmap.cjs +146 -115
- package/sdd/bin/lib/schema-detect.cjs +238 -0
- package/sdd/bin/lib/sdd2-import.cjs +511 -0
- package/sdd/bin/lib/security.cjs +124 -3
- package/sdd/bin/lib/state.cjs +648 -264
- package/sdd/bin/lib/template.cjs +8 -4
- package/sdd/bin/lib/verify.cjs +209 -28
- package/sdd/bin/lib/workstream.cjs +7 -3
- package/sdd/bin/sdd-tools.cjs +184 -12
- package/sdd/contexts/dev.md +21 -0
- package/sdd/contexts/research.md +22 -0
- package/sdd/contexts/review.md +22 -0
- package/sdd/references/agent-contracts.md +79 -0
- package/sdd/references/ai-evals.md +156 -0
- package/sdd/references/ai-frameworks.md +186 -0
- package/sdd/references/artifact-types.md +113 -0
- package/sdd/references/common-bug-patterns.md +114 -0
- package/sdd/references/context-budget.md +49 -0
- package/sdd/references/continuation-format.md +25 -25
- package/sdd/references/domain-probes.md +125 -0
- package/sdd/references/few-shot-examples/plan-checker.md +73 -0
- package/sdd/references/few-shot-examples/verifier.md +109 -0
- package/sdd/references/gate-prompts.md +100 -0
- package/sdd/references/gates.md +70 -0
- package/sdd/references/git-integration.md +1 -1
- package/sdd/references/ios-scaffold.md +123 -0
- package/sdd/references/model-profile-resolution.md +2 -0
- package/sdd/references/model-profiles.md +24 -18
- package/sdd/references/planner-gap-closure.md +62 -0
- package/sdd/references/planner-reviews.md +39 -0
- package/sdd/references/planner-revision.md +87 -0
- package/sdd/references/planning-config.md +252 -0
- package/sdd/references/revision-loop.md +97 -0
- package/sdd/references/thinking-models-debug.md +44 -0
- package/sdd/references/thinking-models-execution.md +50 -0
- package/sdd/references/thinking-models-planning.md +62 -0
- package/sdd/references/thinking-models-research.md +50 -0
- package/sdd/references/thinking-models-verification.md +55 -0
- package/sdd/references/thinking-partner.md +96 -0
- package/sdd/references/ui-brand.md +4 -4
- package/sdd/references/universal-anti-patterns.md +63 -0
- package/sdd/references/verification-overrides.md +227 -0
- package/sdd/references/workstream-flag.md +56 -3
- package/sdd/templates/AI-SPEC.md +246 -0
- package/sdd/templates/DEBUG.md +1 -1
- package/sdd/templates/SECURITY.md +61 -0
- package/sdd/templates/UAT.md +4 -4
- package/sdd/templates/VALIDATION.md +4 -4
- package/sdd/templates/claude-md.md +32 -9
- package/sdd/templates/config.json +4 -0
- package/sdd/templates/debug-subagent-prompt.md +1 -1
- package/sdd/templates/dev-preferences.md +1 -1
- package/sdd/templates/discovery.md +2 -2
- package/sdd/templates/phase-prompt.md +1 -1
- package/sdd/templates/planner-subagent-prompt.md +3 -3
- package/sdd/templates/project.md +1 -1
- package/sdd/templates/research.md +1 -1
- package/sdd/templates/state.md +2 -2
- package/sdd/workflows/add-phase.md +8 -8
- package/sdd/workflows/add-tests.md +12 -9
- package/sdd/workflows/add-todo.md +5 -3
- package/sdd/workflows/ai-integration-phase.md +284 -0
- package/sdd/workflows/analyze-dependencies.md +96 -0
- package/sdd/workflows/audit-fix.md +157 -0
- package/sdd/workflows/audit-milestone.md +11 -11
- package/sdd/workflows/audit-uat.md +2 -2
- package/sdd/workflows/autonomous.md +195 -27
- package/sdd/workflows/check-todos.md +12 -10
- package/sdd/workflows/cleanup.md +2 -0
- package/sdd/workflows/code-review-fix.md +497 -0
- package/sdd/workflows/code-review.md +515 -0
- package/sdd/workflows/complete-milestone.md +56 -22
- package/sdd/workflows/diagnose-issues.md +10 -3
- package/sdd/workflows/discovery-phase.md +5 -3
- package/sdd/workflows/discuss-phase-assumptions.md +24 -6
- package/sdd/workflows/discuss-phase-power.md +291 -0
- package/sdd/workflows/discuss-phase.md +173 -21
- package/sdd/workflows/do.md +23 -21
- package/sdd/workflows/docs-update.md +1155 -0
- package/sdd/workflows/eval-review.md +155 -0
- package/sdd/workflows/execute-phase.md +594 -38
- package/sdd/workflows/execute-plan.md +67 -96
- package/sdd/workflows/explore.md +139 -0
- package/sdd/workflows/fast.md +5 -5
- package/sdd/workflows/forensics.md +2 -2
- package/sdd/workflows/health.md +4 -4
- package/sdd/workflows/help.md +122 -119
- package/sdd/workflows/import.md +276 -0
- package/sdd/workflows/inbox.md +387 -0
- package/sdd/workflows/insert-phase.md +7 -7
- package/sdd/workflows/list-phase-assumptions.md +4 -4
- package/sdd/workflows/list-workspaces.md +2 -2
- package/sdd/workflows/manager.md +35 -32
- package/sdd/workflows/map-codebase.md +7 -5
- package/sdd/workflows/milestone-summary.md +2 -2
- package/sdd/workflows/new-milestone.md +17 -9
- package/sdd/workflows/new-project.md +50 -25
- package/sdd/workflows/new-workspace.md +7 -5
- package/sdd/workflows/next.md +67 -11
- package/sdd/workflows/note.md +9 -7
- package/sdd/workflows/pause-work.md +75 -12
- package/sdd/workflows/plan-milestone-gaps.md +8 -8
- package/sdd/workflows/plan-phase.md +294 -42
- package/sdd/workflows/plant-seed.md +6 -3
- package/sdd/workflows/pr-branch.md +42 -14
- package/sdd/workflows/profile-user.md +9 -7
- package/sdd/workflows/progress.md +45 -45
- package/sdd/workflows/quick.md +195 -47
- package/sdd/workflows/remove-phase.md +6 -6
- package/sdd/workflows/remove-workspace.md +3 -1
- package/sdd/workflows/research-phase.md +2 -2
- package/sdd/workflows/resume-project.md +12 -12
- package/sdd/workflows/review.md +109 -9
- package/sdd/workflows/scan.md +102 -0
- package/sdd/workflows/secure-phase.md +166 -0
- package/sdd/workflows/session-report.md +2 -2
- package/sdd/workflows/settings.md +38 -12
- package/sdd/workflows/ship.md +21 -9
- package/sdd/workflows/stats.md +1 -1
- package/sdd/workflows/transition.md +23 -23
- package/sdd/workflows/ui-phase.md +15 -7
- package/sdd/workflows/ui-review.md +29 -4
- package/sdd/workflows/undo.md +314 -0
- package/sdd/workflows/update.md +171 -20
- package/sdd/workflows/validate-phase.md +6 -4
- package/sdd/workflows/verify-phase.md +210 -6
- package/sdd/workflows/verify-work.md +83 -9
- package/sdd/commands/sdd/workstreams.md +0 -63
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema Drift Detection — Detects schema-relevant file changes and verifies
|
|
3
|
+
* that the appropriate database push command was executed during a phase.
|
|
4
|
+
*
|
|
5
|
+
* Prevents false-positive verification when schema files change but no push
|
|
6
|
+
* occurs — TypeScript types come from config, not the live database, so
|
|
7
|
+
* build/types pass on a broken state.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
// ─── ORM Patterns ────────────────────────────────────────────────────────────
|
|
13
|
+
//
|
|
14
|
+
// Each entry maps a glob-like pattern to an ORM name. Patterns use forward
|
|
15
|
+
// slashes internally — Windows backslash paths are normalized before matching.
|
|
16
|
+
|
|
17
|
+
const SCHEMA_PATTERNS = [
|
|
18
|
+
// Payload CMS
|
|
19
|
+
{ pattern: /^src\/collections\/.*\.ts$/, orm: 'payload' },
|
|
20
|
+
{ pattern: /^src\/globals\/.*\.ts$/, orm: 'payload' },
|
|
21
|
+
|
|
22
|
+
// Prisma
|
|
23
|
+
{ pattern: /^prisma\/schema\.prisma$/, orm: 'prisma' },
|
|
24
|
+
{ pattern: /^prisma\/schema\/.*\.prisma$/, orm: 'prisma' },
|
|
25
|
+
|
|
26
|
+
// Drizzle
|
|
27
|
+
{ pattern: /^drizzle\/schema\.ts$/, orm: 'drizzle' },
|
|
28
|
+
{ pattern: /^src\/db\/schema\.ts$/, orm: 'drizzle' },
|
|
29
|
+
{ pattern: /^drizzle\/.*\.ts$/, orm: 'drizzle' },
|
|
30
|
+
|
|
31
|
+
// Supabase
|
|
32
|
+
{ pattern: /^supabase\/migrations\/.*\.sql$/, orm: 'supabase' },
|
|
33
|
+
|
|
34
|
+
// TypeORM
|
|
35
|
+
{ pattern: /^src\/entities\/.*\.ts$/, orm: 'typeorm' },
|
|
36
|
+
{ pattern: /^src\/migrations\/.*\.ts$/, orm: 'typeorm' },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
// ─── Push Commands & Evidence Patterns ───────────────────────────────────────
|
|
40
|
+
//
|
|
41
|
+
// For each ORM, the push command that agents should run, plus regex patterns
|
|
42
|
+
// that indicate the push was actually executed (matched against execution logs,
|
|
43
|
+
// SUMMARY.md content, and git commit messages).
|
|
44
|
+
|
|
45
|
+
const ORM_INFO = {
|
|
46
|
+
payload: {
|
|
47
|
+
pushCommand: 'npx payload migrate',
|
|
48
|
+
envHint: 'CI=true PAYLOAD_MIGRATING=true npx payload migrate',
|
|
49
|
+
interactiveWarning: 'Payload migrate may require interactive prompts — use CI=true PAYLOAD_MIGRATING=true to suppress',
|
|
50
|
+
evidencePatterns: [
|
|
51
|
+
/payload\s+migrate/i,
|
|
52
|
+
/PAYLOAD_MIGRATING/,
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
prisma: {
|
|
56
|
+
pushCommand: 'npx prisma db push',
|
|
57
|
+
envHint: 'npx prisma db push --accept-data-loss (if destructive changes are intended)',
|
|
58
|
+
interactiveWarning: 'Prisma db push may prompt for confirmation on destructive changes — use --accept-data-loss to bypass',
|
|
59
|
+
evidencePatterns: [
|
|
60
|
+
/prisma\s+db\s+push/i,
|
|
61
|
+
/prisma\s+migrate\s+deploy/i,
|
|
62
|
+
/prisma\s+migrate\s+dev/i,
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
drizzle: {
|
|
66
|
+
pushCommand: 'npx drizzle-kit push',
|
|
67
|
+
envHint: 'npx drizzle-kit push',
|
|
68
|
+
interactiveWarning: null,
|
|
69
|
+
evidencePatterns: [
|
|
70
|
+
/drizzle-kit\s+push/i,
|
|
71
|
+
/drizzle-kit\s+migrate/i,
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
supabase: {
|
|
75
|
+
pushCommand: 'supabase db push',
|
|
76
|
+
envHint: 'supabase db push',
|
|
77
|
+
interactiveWarning: 'Supabase db push may require authentication — ensure SUPABASE_ACCESS_TOKEN is set',
|
|
78
|
+
evidencePatterns: [
|
|
79
|
+
/supabase\s+db\s+push/i,
|
|
80
|
+
/supabase\s+migration\s+up/i,
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
typeorm: {
|
|
84
|
+
pushCommand: 'npx typeorm migration:run',
|
|
85
|
+
envHint: 'npx typeorm migration:run -d src/data-source.ts',
|
|
86
|
+
interactiveWarning: null,
|
|
87
|
+
evidencePatterns: [
|
|
88
|
+
/typeorm\s+migration:run/i,
|
|
89
|
+
/typeorm\s+schema:sync/i,
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// ─── Public API ──────────────────────────────────────────────────────────────
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Detect schema-relevant files in a list of file paths.
|
|
98
|
+
*
|
|
99
|
+
* @param {string[]} files - List of file paths (relative to project root)
|
|
100
|
+
* @returns {{ detected: boolean, matches: string[], orms: string[] }}
|
|
101
|
+
*/
|
|
102
|
+
function detectSchemaFiles(files) {
|
|
103
|
+
const matches = [];
|
|
104
|
+
const orms = new Set();
|
|
105
|
+
|
|
106
|
+
for (const rawFile of files) {
|
|
107
|
+
// Normalize Windows backslash paths
|
|
108
|
+
const file = rawFile.replace(/\\/g, '/');
|
|
109
|
+
|
|
110
|
+
for (const { pattern, orm } of SCHEMA_PATTERNS) {
|
|
111
|
+
if (pattern.test(file)) {
|
|
112
|
+
matches.push(rawFile);
|
|
113
|
+
orms.add(orm);
|
|
114
|
+
break; // One match per file is enough
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
detected: matches.length > 0,
|
|
121
|
+
matches,
|
|
122
|
+
orms: Array.from(orms),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Get ORM-specific push command info.
|
|
128
|
+
*
|
|
129
|
+
* @param {string} ormName - ORM identifier (payload, prisma, drizzle, supabase, typeorm)
|
|
130
|
+
* @returns {{ pushCommand: string, envHint: string, interactiveWarning: string|null, evidencePatterns: RegExp[] } | null}
|
|
131
|
+
*/
|
|
132
|
+
function detectSchemaOrm(ormName) {
|
|
133
|
+
return ORM_INFO[ormName] || null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Check for schema drift: schema files changed but no push evidence found.
|
|
138
|
+
*
|
|
139
|
+
* @param {string[]} changedFiles - Files changed during the phase
|
|
140
|
+
* @param {string} executionLog - Combined text from SUMMARY.md, commit messages, and execution logs
|
|
141
|
+
* @param {{ skipCheck?: boolean }} [options] - Options
|
|
142
|
+
* @returns {{ driftDetected: boolean, blocking: boolean, schemaFiles: string[], orms: string[], unpushedOrms: string[], message: string, skipped?: boolean }}
|
|
143
|
+
*/
|
|
144
|
+
function checkSchemaDrift(changedFiles, executionLog, options = {}) {
|
|
145
|
+
const { skipCheck = false } = options;
|
|
146
|
+
|
|
147
|
+
const detection = detectSchemaFiles(changedFiles);
|
|
148
|
+
|
|
149
|
+
if (!detection.detected) {
|
|
150
|
+
return {
|
|
151
|
+
driftDetected: false,
|
|
152
|
+
blocking: false,
|
|
153
|
+
schemaFiles: [],
|
|
154
|
+
orms: [],
|
|
155
|
+
unpushedOrms: [],
|
|
156
|
+
message: '',
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Check which ORMs have push evidence in the execution log
|
|
161
|
+
const pushedOrms = new Set();
|
|
162
|
+
const unpushedOrms = [];
|
|
163
|
+
|
|
164
|
+
for (const orm of detection.orms) {
|
|
165
|
+
const info = ORM_INFO[orm];
|
|
166
|
+
if (!info) continue;
|
|
167
|
+
|
|
168
|
+
const hasPushEvidence = info.evidencePatterns.some(p => p.test(executionLog));
|
|
169
|
+
if (hasPushEvidence) {
|
|
170
|
+
pushedOrms.add(orm);
|
|
171
|
+
} else {
|
|
172
|
+
unpushedOrms.push(orm);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const driftDetected = unpushedOrms.length > 0;
|
|
177
|
+
|
|
178
|
+
if (!driftDetected) {
|
|
179
|
+
return {
|
|
180
|
+
driftDetected: false,
|
|
181
|
+
blocking: false,
|
|
182
|
+
schemaFiles: detection.matches,
|
|
183
|
+
orms: detection.orms,
|
|
184
|
+
unpushedOrms: [],
|
|
185
|
+
message: '',
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Build actionable message
|
|
190
|
+
const pushCommands = unpushedOrms
|
|
191
|
+
.map(orm => {
|
|
192
|
+
const info = ORM_INFO[orm];
|
|
193
|
+
return info ? ` ${orm}: ${info.envHint || info.pushCommand}` : null;
|
|
194
|
+
})
|
|
195
|
+
.filter(Boolean)
|
|
196
|
+
.join('\n');
|
|
197
|
+
|
|
198
|
+
const message = [
|
|
199
|
+
'Schema drift detected: schema-relevant files changed but no database push was executed.',
|
|
200
|
+
'',
|
|
201
|
+
`Schema files changed: ${detection.matches.join(', ')}`,
|
|
202
|
+
`ORMs requiring push: ${unpushedOrms.join(', ')}`,
|
|
203
|
+
'',
|
|
204
|
+
'Required push commands:',
|
|
205
|
+
pushCommands,
|
|
206
|
+
'',
|
|
207
|
+
'Run the appropriate push command, or set SDD_SKIP_SCHEMA_CHECK=true to bypass this gate.',
|
|
208
|
+
].join('\n');
|
|
209
|
+
|
|
210
|
+
if (skipCheck) {
|
|
211
|
+
return {
|
|
212
|
+
driftDetected: true,
|
|
213
|
+
blocking: false,
|
|
214
|
+
skipped: true,
|
|
215
|
+
schemaFiles: detection.matches,
|
|
216
|
+
orms: detection.orms,
|
|
217
|
+
unpushedOrms,
|
|
218
|
+
message: 'Schema drift detected but check was skipped (SDD_SKIP_SCHEMA_CHECK=true).',
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return {
|
|
223
|
+
driftDetected: true,
|
|
224
|
+
blocking: true,
|
|
225
|
+
schemaFiles: detection.matches,
|
|
226
|
+
orms: detection.orms,
|
|
227
|
+
unpushedOrms,
|
|
228
|
+
message,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
module.exports = {
|
|
233
|
+
SCHEMA_PATTERNS,
|
|
234
|
+
ORM_INFO,
|
|
235
|
+
detectSchemaFiles,
|
|
236
|
+
detectSchemaOrm,
|
|
237
|
+
checkSchemaDrift,
|
|
238
|
+
};
|