@aisdlc/core 4.3.1 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1198,6 +1198,51 @@ var DEFAULT_TEST_ARTIFACT_PATTERNS = [
1198
1198
  "**/*.feature",
1199
1199
  ...DEFAULT_UNIT_TEST_PATTERNS
1200
1200
  ];
1201
+ var DEFAULT_UI_COMPONENT_PATTERNS = [
1202
+ "**/components/**",
1203
+ "**/views/**",
1204
+ "**/pages/**",
1205
+ "**/screens/**",
1206
+ "**/windows/**",
1207
+ "**/dialogs/**",
1208
+ "**/tui/**",
1209
+ "**/widgets/**",
1210
+ "**/*.tsx",
1211
+ "**/*.jsx",
1212
+ "**/*.vue",
1213
+ "**/*.svelte",
1214
+ "**/*Window.cs",
1215
+ "**/*View.cs",
1216
+ "**/*Form.cs",
1217
+ "**/*Dialog.cs",
1218
+ "**/*Page.cs",
1219
+ "**/*UserControl.cs",
1220
+ "**/*Screen.kt",
1221
+ "**/*Activity.kt",
1222
+ "**/*Fragment.kt",
1223
+ "**/*ViewController.swift",
1224
+ "**/*Screen.dart"
1225
+ ];
1226
+ var DEFAULT_UI_TEST_PATTERNS = [
1227
+ "tests/e2e/**",
1228
+ "tests/ui/**",
1229
+ "tests/desktop/**",
1230
+ "tests/mobile/**",
1231
+ "tests/cli/**",
1232
+ "**/*.e2e.ts",
1233
+ "**/*.e2e.js",
1234
+ "**/*.ui.spec.ts",
1235
+ "**/*.ui.test.ts",
1236
+ "**/*UiTest.cs",
1237
+ "**/*UITest.cs",
1238
+ "**/*UiTests.cs",
1239
+ "**/*UITests.cs",
1240
+ "**/*FlaUI*.cs",
1241
+ "**/*E2ETest.java",
1242
+ "**/*UITest.swift",
1243
+ "**/test_ui_*.py",
1244
+ "**/*_ui_test.py"
1245
+ ];
1201
1246
  function escapeRegexChars(raw) {
1202
1247
  return raw.replace(/[.+^${}()|[\]\\]/g, "\\$&");
1203
1248
  }
@@ -1232,6 +1277,28 @@ function isPolyglotUnitTestFile(filePath, customPatterns) {
1232
1277
  function isPolyglotTestArtifact(filePath, customPatterns) {
1233
1278
  return compileTestPatterns(customPatterns, true).matches(filePath);
1234
1279
  }
1280
+ function compilePatternList(patterns) {
1281
+ const regexes = patterns.map(globToRegex);
1282
+ return {
1283
+ matches: (filePath) => {
1284
+ const norm = filePath.replace(/\\/g, "/").replace(/^\.\//, "");
1285
+ return regexes.some((re) => re.test(norm));
1286
+ }
1287
+ };
1288
+ }
1289
+ var NON_COMPONENT_UI_FILES = /(?:^|\/)(?:index|types|constants|styles|main|app|setup)\.[jt]sx?$/i;
1290
+ function isUiComponentFile(filePath, customPatterns) {
1291
+ const norm = filePath.replace(/\\/g, "/").replace(/^\.\//, "");
1292
+ if (isPolyglotUnitTestFile(norm) || norm.endsWith(".d.ts") || NON_COMPONENT_UI_FILES.test(norm)) {
1293
+ return false;
1294
+ }
1295
+ const patterns = customPatterns && customPatterns.length > 0 ? customPatterns : DEFAULT_UI_COMPONENT_PATTERNS;
1296
+ return compilePatternList(patterns).matches(norm);
1297
+ }
1298
+ function isUiTestFile(filePath, customPatterns) {
1299
+ const patterns = customPatterns && customPatterns.length > 0 ? [...DEFAULT_UI_TEST_PATTERNS, ...customPatterns] : DEFAULT_UI_TEST_PATTERNS;
1300
+ return compilePatternList(patterns).matches(filePath);
1301
+ }
1235
1302
  var BddStepRegistry = class {
1236
1303
  definitions = [];
1237
1304
  register(pattern, handler) {
@@ -1717,21 +1784,24 @@ function collectUniqueSteps(doc) {
1717
1784
  return unique;
1718
1785
  }
1719
1786
  function renderTsFallback(relFeature, steps) {
1720
- const lines = [
1787
+ const entries = steps.map((st) => ` ['${mapStepKeyword(st.keyword)}', "${escapeDoubleQuotes(st.text)}"],`);
1788
+ return [
1721
1789
  `// AUTO-GENERATED RED BDD STEP DEFINITIONS (${relFeature})`,
1722
1790
  `import { BddStepRegistry } from '@aisdlc/core';`,
1723
1791
  ``,
1724
- `export function registerSteps(registry: BddStepRegistry): void {`
1725
- ];
1726
- for (const st of steps) {
1727
- const method = mapStepKeyword(st.keyword);
1728
- const escaped = escapeDoubleQuotes(st.text);
1729
- lines.push(` registry.${method}("${escaped}", () => {`);
1730
- lines.push(` throw new Error("RED: Step not implemented: ${escaped}");`);
1731
- lines.push(` });`);
1732
- }
1733
- lines.push(`}`, ``);
1734
- return lines.join("\n");
1792
+ `const STEP_SPECS: ReadonlyArray<readonly ['given' | 'when' | 'then', string]> = [`,
1793
+ ...entries,
1794
+ `];`,
1795
+ ``,
1796
+ `export function registerSteps(registry: BddStepRegistry): void {`,
1797
+ ` for (const [method, text] of STEP_SPECS) {`,
1798
+ ` registry[method](text, () => {`,
1799
+ ` throw new Error(\`RED: Step not implemented: \${text}\`);`,
1800
+ ` });`,
1801
+ ` }`,
1802
+ `}`,
1803
+ ``
1804
+ ].join("\n");
1735
1805
  }
1736
1806
  function renderPyFallback(relFeature, steps) {
1737
1807
  const lines = [
@@ -2075,39 +2145,85 @@ function extractGherkinFeatures(options = {}) {
2075
2145
  }
2076
2146
  return { success: true, features, totalScenarios };
2077
2147
  }
2148
+ function walkFeatureFiles(dir, fileList = []) {
2149
+ if (!fs12__namespace.existsSync(dir)) return fileList;
2150
+ for (const entry of fs12__namespace.readdirSync(dir).sort(canonicalSort)) {
2151
+ const fullPath = path14__namespace.join(dir, entry);
2152
+ if (fs12__namespace.statSync(fullPath).isDirectory()) {
2153
+ walkFeatureFiles(fullPath, fileList);
2154
+ } else if (entry.endsWith(".feature")) {
2155
+ fileList.push(fullPath);
2156
+ }
2157
+ }
2158
+ return fileList;
2159
+ }
2160
+ function hasDeterministicStepFile(rootDir, featureFullPath) {
2161
+ return Object.values(GHERKIN_GENERATOR_SPECS).some((spec) => {
2162
+ const stepPath = spec.resolveOutputPath(rootDir, featureFullPath);
2163
+ return fs12__namespace.existsSync(stepPath) && fs12__namespace.statSync(stepPath).size > 0;
2164
+ });
2165
+ }
2166
+ function findOrphanFeatureFiles(rootDir, expectedRelPaths) {
2167
+ const featuresDir = path14__namespace.join(rootDir, "tests", "features");
2168
+ const orphans = [];
2169
+ for (const fp of walkFeatureFiles(featuresDir)) {
2170
+ const rel = path14__namespace.relative(rootDir, fp).replace(/\\/g, "/");
2171
+ if (!expectedRelPaths.has(rel)) {
2172
+ orphans.push(rel);
2173
+ }
2174
+ }
2175
+ return orphans;
2176
+ }
2177
+ function verifyExistingFeatureFile(rootDir, targetPath, expectedContent, relTarget, state) {
2178
+ const actualContent = fs12__namespace.readFileSync(targetPath, "utf-8");
2179
+ if (actualContent.replace(/\r\n/g, "\n") !== expectedContent.replace(/\r\n/g, "\n")) {
2180
+ state.outOfSyncFiles.push(relTarget);
2181
+ }
2182
+ if (!hasDeterministicStepFile(rootDir, targetPath)) {
2183
+ state.missingStepFiles.push(relTarget);
2184
+ }
2185
+ }
2186
+ function checkSingleMarkdownFeatureSync(rootDir, filePath, state) {
2187
+ const { frontmatter, body } = parseMarkdownFrontmatter(fs12__namespace.readFileSync(filePath, "utf-8"));
2188
+ const gherkinBlocks = extractGherkinBlock(body);
2189
+ if (gherkinBlocks.length === 0) return;
2190
+ state.totalFeatures++;
2191
+ const id = frontmatter.id || path14__namespace.basename(filePath, path14__namespace.extname(filePath));
2192
+ const targetPath = resolveFeatureFilePath(rootDir, filePath, id, frontmatter["cucumber-feature-file"]);
2193
+ const relTarget = path14__namespace.relative(rootDir, targetPath).replace(/\\/g, "/");
2194
+ state.expectedRelPaths.add(relTarget);
2195
+ if (!fs12__namespace.existsSync(targetPath)) {
2196
+ state.missingFiles.push(relTarget);
2197
+ return;
2198
+ }
2199
+ const expectedContent = buildFeatureFileContent(rootDir, filePath, id, frontmatter.version, gherkinBlocks);
2200
+ verifyExistingFeatureFile(rootDir, targetPath, expectedContent, relTarget, state);
2201
+ }
2078
2202
  function checkGherkinInSync(options = {}) {
2079
2203
  const rootDir = options.rootDir || process.cwd();
2080
2204
  const targetFiles = resolveTargetFiles(rootDir, options.targetPath);
2081
- const outOfSyncFiles = [];
2082
- const missingFiles = [];
2083
- let totalFeatures = 0;
2205
+ const state = {
2206
+ outOfSyncFiles: [],
2207
+ missingFiles: [],
2208
+ missingStepFiles: [],
2209
+ expectedRelPaths: /* @__PURE__ */ new Set(),
2210
+ totalFeatures: 0
2211
+ };
2084
2212
  for (const filePath of targetFiles) {
2085
2213
  try {
2086
- const content = fs12__namespace.readFileSync(filePath, "utf-8");
2087
- const { frontmatter, body } = parseMarkdownFrontmatter(content);
2088
- const gherkinBlocks = extractGherkinBlock(body);
2089
- if (gherkinBlocks.length === 0) continue;
2090
- totalFeatures++;
2091
- const id = frontmatter.id || path14__namespace.basename(filePath, path14__namespace.extname(filePath));
2092
- const targetPath = resolveFeatureFilePath(rootDir, filePath, id, frontmatter["cucumber-feature-file"]);
2093
- const relTarget = path14__namespace.relative(rootDir, targetPath).replace(/\\/g, "/");
2094
- if (!fs12__namespace.existsSync(targetPath)) {
2095
- missingFiles.push(relTarget);
2096
- continue;
2097
- }
2098
- const expectedContent = buildFeatureFileContent(rootDir, filePath, id, frontmatter.version, gherkinBlocks);
2099
- const actualContent = fs12__namespace.readFileSync(targetPath, "utf-8");
2100
- if (actualContent.replace(/\r\n/g, "\n") !== expectedContent.replace(/\r\n/g, "\n")) {
2101
- outOfSyncFiles.push(relTarget);
2102
- }
2214
+ checkSingleMarkdownFeatureSync(rootDir, filePath, state);
2103
2215
  } catch {
2104
2216
  }
2105
2217
  }
2218
+ const orphanFeatureFiles = options.targetPath ? [] : findOrphanFeatureFiles(rootDir, state.expectedRelPaths);
2219
+ const inSync = state.missingFiles.length === 0 && state.outOfSyncFiles.length === 0 && orphanFeatureFiles.length === 0 && state.missingStepFiles.length === 0;
2106
2220
  return {
2107
- inSync: missingFiles.length === 0 && outOfSyncFiles.length === 0,
2108
- outOfSyncFiles,
2109
- missingFiles,
2110
- totalFeatures
2221
+ inSync,
2222
+ outOfSyncFiles: state.outOfSyncFiles,
2223
+ missingFiles: state.missingFiles,
2224
+ orphanFeatureFiles,
2225
+ missingStepFiles: state.missingStepFiles,
2226
+ totalFeatures: state.totalFeatures
2111
2227
  };
2112
2228
  }
2113
2229
 
@@ -2733,21 +2849,42 @@ function applyCoverageThresholds(policy, covRaw) {
2733
2849
  policy.min_function_coverage = Number(cov.min_function_coverage_percent);
2734
2850
  }
2735
2851
  }
2852
+ function applyTestEnforcement(policy, raw) {
2853
+ if (!raw || typeof raw !== "object") return;
2854
+ const enf = raw;
2855
+ if (typeof enf.require_function_unit_tests === "boolean") {
2856
+ policy.require_function_unit_tests = enf.require_function_unit_tests;
2857
+ }
2858
+ if (typeof enf.require_ui_component_tests === "boolean") {
2859
+ policy.require_ui_component_tests = enf.require_ui_component_tests;
2860
+ }
2861
+ if (Array.isArray(enf.ui_component_patterns)) {
2862
+ policy.ui_component_patterns = enf.ui_component_patterns.map(String);
2863
+ }
2864
+ if (Array.isArray(enf.ui_test_patterns)) {
2865
+ policy.ui_test_patterns = enf.ui_test_patterns.map(String);
2866
+ }
2867
+ }
2868
+ function applySectionThresholds(policy, s) {
2869
+ const cc = s.cyclomatic_complexity?.max_per_function;
2870
+ const cog = s.cognitive_complexity?.max_per_function;
2871
+ const mi = s.maintainability_index?.min_acceptable_score;
2872
+ const loc = s.function_length?.max_function_lines;
2873
+ if (cc !== void 0) policy.max_cyclomatic = Number(cc);
2874
+ if (cog !== void 0) policy.max_cognitive = Number(cog);
2875
+ if (mi !== void 0) policy.min_maintainability = Number(mi);
2876
+ if (loc !== void 0) policy.max_function_lines = Number(loc);
2877
+ applyCoverageThresholds(policy, s.test_coverage);
2878
+ applyTestEnforcement(policy, s.test_enforcement);
2879
+ }
2736
2880
  function applyDocThresholds(policy, doc) {
2737
2881
  const sections = [doc.release_thresholds, doc.thresholds].filter(
2738
2882
  (s) => Boolean(s && typeof s === "object")
2739
2883
  );
2740
2884
  for (const s of sections) {
2741
- const cc = s.cyclomatic_complexity?.max_per_function;
2742
- const cog = s.cognitive_complexity?.max_per_function;
2743
- const mi = s.maintainability_index?.min_acceptable_score;
2744
- const loc = s.function_length?.max_function_lines;
2745
- if (cc !== void 0) policy.max_cyclomatic = Number(cc);
2746
- if (cog !== void 0) policy.max_cognitive = Number(cog);
2747
- if (mi !== void 0) policy.min_maintainability = Number(mi);
2748
- if (loc !== void 0) policy.max_function_lines = Number(loc);
2749
- applyCoverageThresholds(policy, s.test_coverage);
2885
+ applySectionThresholds(policy, s);
2750
2886
  }
2887
+ applyTestEnforcement(policy, doc.test_enforcement);
2751
2888
  const codingRules = doc.coding_rules;
2752
2889
  const rules = codingRules?.rules;
2753
2890
  if (rules?.max_function_lines !== void 0) {
@@ -3016,6 +3153,61 @@ function auditUnitTestsPerFunction(results, rootDir, testPatterns) {
3016
3153
  }
3017
3154
  return untested;
3018
3155
  }
3156
+ var UI_COMPONENT_EXTENSIONS = [
3157
+ ...DEFAULT_EXTENSIONS,
3158
+ ".vue",
3159
+ ".svelte",
3160
+ ".kt",
3161
+ ".swift",
3162
+ ".dart"
3163
+ ];
3164
+ var UI_TEST_EXTENSIONS = [
3165
+ ...UI_COMPONENT_EXTENSIONS,
3166
+ ".yaml",
3167
+ ".yml"
3168
+ ];
3169
+ function collectUiTestFiles(rootDir, customPatterns) {
3170
+ const allFiles = walkDir(rootDir, UI_TEST_EXTENSIONS, DEFAULT_EXCLUDES);
3171
+ const uiTests = [];
3172
+ for (const tf of allFiles) {
3173
+ const relPath = path14__namespace.relative(rootDir, tf).replace(/\\/g, "/");
3174
+ if (!isUiTestFile(relPath, customPatterns)) continue;
3175
+ try {
3176
+ uiTests.push({ relPath, content: fs12__namespace.readFileSync(tf, "utf-8") });
3177
+ } catch {
3178
+ }
3179
+ }
3180
+ return uiTests;
3181
+ }
3182
+ function extractUiComponentName(relPath) {
3183
+ const base = path14__namespace.basename(relPath);
3184
+ return base.replace(/\.(?:xaml\.cs|component\.ts|vue|svelte|tsx?|jsx?|py|cs|java|kt|swift|dart)$/i, "");
3185
+ }
3186
+ function buildComponentNameVariants(componentName) {
3187
+ const kebab = componentName.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3188
+ const snake = kebab.replace(/-/g, "_");
3189
+ return Array.from(/* @__PURE__ */ new Set([componentName, kebab, snake]));
3190
+ }
3191
+ function isUiComponentTested(componentName, uiTests) {
3192
+ const variants = buildComponentNameVariants(componentName);
3193
+ const patterns = variants.map((v) => new RegExp(`\\b${v.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\b`, "i"));
3194
+ return uiTests.some((t) => patterns.some((re) => re.test(t.relPath) || re.test(t.content)));
3195
+ }
3196
+ function auditUiComponents(rootDir, policy) {
3197
+ const uiPolicy = { ...policy, supported_extensions: [...UI_COMPONENT_EXTENSIONS] };
3198
+ const candidateFiles = collectFilesToScan(rootDir, uiPolicy);
3199
+ const uiTests = collectUiTestFiles(rootDir, policy.ui_test_patterns);
3200
+ const untested = [];
3201
+ for (const file of candidateFiles) {
3202
+ const relPath = path14__namespace.relative(rootDir, file).replace(/\\/g, "/");
3203
+ if (!isUiComponentFile(relPath, policy.ui_component_patterns)) continue;
3204
+ const componentName = extractUiComponentName(relPath);
3205
+ if (!isUiComponentTested(componentName, uiTests)) {
3206
+ untested.push({ file: relPath, componentName });
3207
+ }
3208
+ }
3209
+ return untested;
3210
+ }
3019
3211
  function checkCoverageThreshold(label, actual, min, out) {
3020
3212
  if (actual < min) {
3021
3213
  out.push(`${label} coverage ${actual}% is below minimum threshold of ${min}%`);
@@ -3158,27 +3350,33 @@ function evaluateRatchetIfActive(results, baselineFile, isActive) {
3158
3350
  baselineViolationsCount: baseline.totalViolations
3159
3351
  };
3160
3352
  }
3161
- function buildQualityGateResult(results, totalFiles, policy, coverageViolations, untestedFunctions, baselineMeta) {
3353
+ function computeGateSummaryCounts(results, coverageViolations, untestedUi, policy, baselineUpdated) {
3162
3354
  const failCount = results.filter((r) => r.status === "FAIL").length;
3163
3355
  const passCount = results.length - failCount;
3164
- const violationsCount = results.reduce((acc, r) => acc + r.violations.length, 0) + coverageViolations.length;
3165
- const hasFailures = failCount > 0 || coverageViolations.length > 0;
3166
- const success = baselineMeta?.baselineUpdated ? true : policy.enforce_mode === "STRICT" ? !hasFailures : true;
3356
+ const violationsCount = results.reduce((acc, r) => acc + r.violations.length, 0) + coverageViolations.length + untestedUi.length;
3357
+ const hasFailures = failCount > 0 || coverageViolations.length > 0 || untestedUi.length > 0;
3358
+ const success = baselineUpdated ? true : policy.enforce_mode === "STRICT" ? !hasFailures : true;
3359
+ return { failCount, passCount, violationsCount, success };
3360
+ }
3361
+ function buildQualityGateResult(results, totalFiles, policy, coverageViolations, untestedFunctions, baselineMeta) {
3362
+ const untestedUi = baselineMeta?.untestedUiComponents ?? [];
3363
+ const counts = computeGateSummaryCounts(
3364
+ results,
3365
+ coverageViolations,
3366
+ untestedUi,
3367
+ policy,
3368
+ baselineMeta?.baselineUpdated
3369
+ );
3167
3370
  return {
3168
- success,
3371
+ ...counts,
3169
3372
  totalFiles,
3170
3373
  totalFunctions: results.length,
3171
- passCount,
3172
- failCount,
3173
- violationsCount,
3174
3374
  results,
3175
3375
  policy,
3176
3376
  coverageViolations,
3177
3377
  untestedFunctions,
3178
- baselineUpdated: baselineMeta?.baselineUpdated,
3179
- baselineViolationsCount: baselineMeta?.baselineViolationsCount,
3180
- toleratedViolationsCount: baselineMeta?.toleratedViolationsCount,
3181
- newViolationsCount: baselineMeta?.newViolationsCount
3378
+ untestedUiComponents: untestedUi,
3379
+ ...baselineMeta
3182
3380
  };
3183
3381
  }
3184
3382
  function verifyQualityGate(options = {}) {
@@ -3192,7 +3390,10 @@ function verifyQualityGate(options = {}) {
3192
3390
  } catch {
3193
3391
  }
3194
3392
  }
3195
- const untestedFunctions = options.requireFunctionUnitTests ? auditUnitTestsPerFunction(results, rootDir, policy.test_patterns) : [];
3393
+ const requireUnitTests = Boolean(options.requireFunctionUnitTests ?? policy.require_function_unit_tests);
3394
+ const requireUiTests = Boolean(options.requireUiComponentTests ?? policy.require_ui_component_tests);
3395
+ const untestedFunctions = requireUnitTests ? auditUnitTestsPerFunction(results, rootDir, policy.test_patterns) : [];
3396
+ const untestedUiComponents = requireUiTests ? auditUiComponents(rootDir, policy) : [];
3196
3397
  const coverageViolations = evaluateCoverageThresholds(rootDir, policy, options.requireCoverageReport);
3197
3398
  const baselineFile = resolveBaselineFilePath(rootDir, options);
3198
3399
  if (options.updateBaseline) {
@@ -3200,7 +3401,8 @@ function verifyQualityGate(options = {}) {
3200
3401
  writeQualityBaseline(baselineFile, entries);
3201
3402
  return buildQualityGateResult(results, allFiles.length, policy, coverageViolations, untestedFunctions, {
3202
3403
  baselineUpdated: true,
3203
- baselineViolationsCount: entries.length
3404
+ baselineViolationsCount: entries.length,
3405
+ untestedUiComponents
3204
3406
  });
3205
3407
  }
3206
3408
  const baselineExists = fs12__namespace.existsSync(baselineFile);
@@ -3209,7 +3411,8 @@ function verifyQualityGate(options = {}) {
3209
3411
  return buildQualityGateResult(results, allFiles.length, policy, coverageViolations, untestedFunctions, {
3210
3412
  baselineViolationsCount: ratchetEval.baselineViolationsCount,
3211
3413
  toleratedViolationsCount: ratchetEval.toleratedViolationsCount,
3212
- newViolationsCount: ratchetEval.newViolationsCount
3414
+ newViolationsCount: ratchetEval.newViolationsCount,
3415
+ untestedUiComponents
3213
3416
  });
3214
3417
  }
3215
3418
  function normalizeHandoffPayload(handoff, changeId) {
@@ -4913,140 +5116,163 @@ function detectActiveChangeForIntegration(options = {}) {
4913
5116
  }
4914
5117
 
4915
5118
  // src/init/starter-schemas.ts
4916
- var SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/architecture/adr.schema.json",\r\n "title": "Architecture Decision Record Schema (Versionable)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "deciders", "decision-date"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^ADR-[0-9]{3,4}(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "architecture-decision-record"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Decision record semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["proposed", "accepted", "rejected", "deprecated", "superseded"]\r\n },\r\n "deciders": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": { "type": "string" }\r\n },\r\n "decision-date": {\r\n "type": "string",\r\n "format": "date"\r\n },\r\n "affects-components": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^ADR-[0-9]{3,4}(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^ADR-[0-9]{3,4}(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4917
- var SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/architecture/component.schema.json",\r\n "title": "NAF v4 / arc42 Architecture Component Schema (Multilevel)",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "level",\r\n "implementation-type",\r\n "implements-use-cases"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "component"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Architecture component semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["proposed", "accepted", "deprecated", "retired"]\r\n },\r\n "level": {\r\n "type": "integer",\r\n "minimum": 1,\r\n "description": "Hierarchical architecture level (1: Bounded Context / Root System, 2: Subsystem / Container, 3: Executable Unit / DLL / Function)."\r\n },\r\n "bounded-context": {\r\n "type": "string",\r\n "description": "Domain-Driven Design (DDD) Bounded Context name this component belongs to."\r\n },\r\n "parent-component": {\r\n "type": ["string", "null"],\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Parent component identifier (null if Level 1)."\r\n },\r\n "implementation-type": {\r\n "type": "string",\r\n "enum": ["service", "dll", "function", "composite"],\r\n "description": "Technical implementation paradigm: distributed service (service), dynamic/native library (dll), in-process module/function (function), or logical aggregator/Bounded Context (composite)."\r\n },\r\n "implements-use-cases": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "satisfies-requirements": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^(FR|QR|CON|SEC-REQ|SAF-REQ|PRIV-REQ)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "hosted-in-enclave": {\r\n "type": "string",\r\n "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Security enclave where the component resides (optional for DLLs or in-process functions)."\r\n },\r\n "interfaces": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "required": ["name", "protocol"],\r\n "properties": {\r\n "name": { "type": "string" },\r\n "protocol": {\r\n "type": "string",\r\n "enum": [\r\n "REST/HTTP",\r\n "gRPC",\r\n "WebSocket",\r\n "Kafka",\r\n "MQTT",\r\n "C-ABI",\r\n "Native-ABI",\r\n "FFI",\r\n "In-Process API",\r\n "Function-Call",\r\n "CLI",\r\n "GUI",\r\n "IPC"\r\n ]\r\n },\r\n "contract-spec": { "type": "string" }\r\n }\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4918
- var SCHEMA_SCHEMAS_ARCHITECTURE_INTRODUCTION_AND_GOALS_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/architecture/introduction-and-goals.schema.json",\r\n "title": "NAF v4 Enterprise & Capability / arc42 Introduction and System Goals Schema",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "naf-perspective",\r\n "cites-product-actors",\r\n "cites-quality-goals",\r\n "cites-journeys"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^ARCH-INTRO-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "architecture-introduction"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Artifact semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "proposed", "accepted", "approved", "deprecated", "superseded"]\r\n },\r\n "owner": {\r\n "type": "string"\r\n },\r\n "arc42-section": {\r\n "type": "integer",\r\n "const": 1\r\n },\r\n "naf-perspective": {\r\n "type": "string",\r\n "const": "Enterprise & Capability"\r\n },\r\n "cites-product-actors": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "cites-quality-goals": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^(QR|SEC-REQ|PRIV-REQ)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "cites-journeys": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^JRN-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Product journey identifiers (JRN-*) envisioned in this system capability scope."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^ARCH-INTRO-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^ARCH-INTRO-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4919
- var SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_MANIFEST_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/compliance/license-manifest.schema.json",\r\n "title": "Static Dependencies License Manifest Schema",\r\n "type": "object",\r\n "required": ["evaluated_dependencies"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(MAN-LIC|LIC-MAN|LIC)-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Optional canonical artifact identifier."\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "license-manifest"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+(\\\\.[0-9]+)?(-[0-9A-Za-z.-]+)?$",\r\n "description": "Manifest format version."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "description": {\r\n "type": "string"\r\n },\r\n "generated_at": {\r\n "type": "string"\r\n },\r\n "evaluated_dependencies": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "object",\r\n "required": ["package", "version", "spdx_license", "status"],\r\n "properties": {\r\n "package": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "version": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "spdx_license": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": [\r\n "APPROVED",\r\n "REJECTED",\r\n "REVIEW_REQUIRED",\r\n "COMMERCIAL_APPROVAL_REQUIRED",\r\n "PENDING"\r\n ]\r\n },\r\n "reason": {\r\n "type": "string"\r\n },\r\n "approved_by": {\r\n "type": "string"\r\n }\r\n },\r\n "additionalProperties": false\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4920
- var SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_POLICY_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/compliance/license-policy.schema.json",\r\n "title": "Open Source License Policy Schema",\r\n "type": "object",\r\n "required": ["version", "project", "default_action", "categories", "agent_guardrails", "ci_gates"],\r\n "properties": {\r\n "version": {\r\n "type": "string"\r\n },\r\n "project": {\r\n "type": "string"\r\n },\r\n "default_action": {\r\n "type": "string",\r\n "enum": ["ALLOW", "DENY", "REVIEW_REQUIRED"]\r\n },\r\n "categories": {\r\n "type": "object"\r\n },\r\n "agent_guardrails": {\r\n "type": "object",\r\n "required": ["enforce_pre_check", "reject_unknown_licenses"],\r\n "properties": {\r\n "enforce_pre_check": { "type": "boolean" },\r\n "reject_unknown_licenses": { "type": "boolean" },\r\n "auto_reject_categories": { "type": "array", "items": { "type": "string" } },\r\n "on_commercial_detected": { "type": "object" }\r\n }\r\n },\r\n "ci_gates": {\r\n "type": "object",\r\n "required": ["fail_on_denied", "generate_sbom"],\r\n "properties": {\r\n "fail_on_denied": { "type": "boolean" },\r\n "fail_on_missing_license": { "type": "boolean" },\r\n "generate_sbom": { "type": "boolean" },\r\n "sbom_format": { "type": "string" },\r\n "output_notices_file": { "type": "string" },\r\n "allowed_depth": { "type": "string", "enum": ["DIRECT", "TRANSITIVE"] }\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4921
- var SCHEMA_SCHEMAS_COMPLIANCE_QUALITY_POLICY_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/compliance/quality-policy.schema.json",\r\n "title": "Software Quality Policy Schema (Polyglot)",\r\n "type": "object",\r\n "required": ["version", "project", "enforcement_mode", "coding_rules", "release_thresholds", "agent_guardrails"],\r\n "properties": {\r\n "version": { "type": "string" },\r\n "project": { "type": "string" },\r\n "enforcement_mode": { "type": "string", "enum": ["STRICT", "PERMISSIVE"] },\r\n "ratchet_mode": { "type": "boolean" },\r\n "scope": {\r\n "type": "object",\r\n "properties": {\r\n "target_directories": { "type": "array", "items": { "type": "string" } },\r\n "supported_extensions": { "type": "array", "items": { "type": "string" } },\r\n "exclude_patterns": { "type": "array", "items": { "type": "string" } }\r\n }\r\n },\r\n "language_toolchains": {\r\n "type": "object"\r\n },\r\n "coding_rules": {\r\n "type": "object",\r\n "required": ["standards", "enforce_formatting", "rules"],\r\n "properties": {\r\n "standards": { "type": "array", "items": { "type": "string" } },\r\n "enforce_formatting": { "type": "boolean" },\r\n "formatting_engine": { "type": "string" },\r\n "linter_engine": { "type": "string" },\r\n "rules": { "type": "object" }\r\n }\r\n },\r\n "release_thresholds": {\r\n "type": "object",\r\n "required": ["cyclomatic_complexity", "cognitive_complexity", "maintainability_index", "code_duplication", "test_coverage"],\r\n "properties": {\r\n "cyclomatic_complexity": {\r\n "type": "object",\r\n "required": ["max_per_function", "action_on_breach"],\r\n "properties": {\r\n "max_per_function": { "type": "integer" },\r\n "warning_at": { "type": "integer" },\r\n "action_on_breach": { "type": "string" }\r\n }\r\n },\r\n "cognitive_complexity": {\r\n "type": "object",\r\n "required": ["max_per_function", "action_on_breach"],\r\n "properties": {\r\n "max_per_function": { "type": "integer" },\r\n "warning_at": { "type": "integer" },\r\n "action_on_breach": { "type": "string" }\r\n }\r\n },\r\n "maintainability_index": {\r\n "type": "object",\r\n "required": ["min_acceptable_score", "action_on_breach"],\r\n "properties": {\r\n "min_acceptable_score": { "type": "number" },\r\n "target_score": { "type": "number" },\r\n "action_on_breach": { "type": "string" }\r\n }\r\n },\r\n "code_duplication": {\r\n "type": "object",\r\n "required": ["max_percentage", "action_on_breach"],\r\n "properties": {\r\n "max_percentage": { "type": "number" },\r\n "action_on_breach": { "type": "string" }\r\n }\r\n },\r\n "test_coverage": {\r\n "type": "object",\r\n "required": ["min_line_coverage_percent", "action_on_breach"],\r\n "properties": {\r\n "min_line_coverage_percent": { "type": "number" },\r\n "min_branch_coverage_percent": { "type": "number" },\r\n "min_function_coverage_percent": { "type": "number" },\r\n "action_on_breach": { "type": "string" }\r\n }\r\n },\r\n "technical_debt": {\r\n "type": "object"\r\n }\r\n }\r\n },\r\n "agent_guardrails": {\r\n "type": "object",\r\n "required": ["enforce_pre_commit_linter", "prevent_suppression_comments"],\r\n "properties": {\r\n "enforce_pre_commit_linter": { "type": "boolean" },\r\n "prevent_suppression_comments": { "type": "boolean" },\r\n "auto_refactor_on_high_complexity": { "type": "boolean" }\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4922
- var SCHEMA_SCHEMAS_IDE_MCP_CONFIG_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/ide/mcp-config.schema.json",\r\n "title": "IDE MCP Configuration Schema (Cursor, Antigravity, VS Code)",\r\n "type": "object",\r\n "properties": {\r\n "$schema": {\r\n "type": "string"\r\n },\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(MCP-CFG|IDE-MCP|MCP)-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Optional identifier for MCP configuration artifact."\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "mcp-config"\r\n },\r\n "mcpServers": {\r\n "type": "object",\r\n "additionalProperties": {\r\n "type": "object",\r\n "required": ["command"],\r\n "properties": {\r\n "command": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "args": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "env": {\r\n "type": "object"\r\n },\r\n "disabled": {\r\n "type": "boolean"\r\n },\r\n "alwaysAllow": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n },\r\n "description": "MCP server registry format for Cursor and Antigravity."\r\n },\r\n "servers": {\r\n "type": "object",\r\n "additionalProperties": {\r\n "type": "object",\r\n "required": ["command"],\r\n "properties": {\r\n "command": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "args": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "env": {\r\n "type": "object"\r\n },\r\n "disabled": {\r\n "type": "boolean"\r\n },\r\n "alwaysAllow": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n },\r\n "description": "MCP server registry format for VS Code."\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4923
- var SCHEMA_SCHEMAS_MANUALS_PRODUCTION_MANUAL_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/manuals/production-manual.schema.json",\r\n "title": "AI-SDLC Production & Operations Manual Schema",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "applies-to-version",\r\n "target-audience"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^MAN-PROD-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Immutable production manual identifier (e.g. MAN-PROD-SENTINELCORE)."\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "production-manual"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Document semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string",\r\n "description": "Template schema version."\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3,\r\n "description": "Descriptive title of the production manual."\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "applies-to-version": {\r\n "type": "string",\r\n "description": "Software version or release this production manual applies to (e.g. v1.0.0)."\r\n },\r\n "target-audience": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n },\r\n "minItems": 1,\r\n "description": "Target technical profiles (e.g. DevOps, SRE, Release Manager, SecOps)."\r\n },\r\n "components-covered": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Architecture components (CMP-*) deployed and covered by the manual."\r\n },\r\n "enclaves-involved": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Security enclaves (SEC-ENC-*) in which deployment executes."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^MAN-PROD-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^MAN-PROD-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4924
- var SCHEMA_SCHEMAS_MANUALS_USER_MANUAL_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/manuals/user-manual.schema.json",\r\n "title": "AI-SDLC User Manual Schema",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "target-audience",\r\n "allowed-roles",\r\n "applies-to-version"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^MAN-USER-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Immutable user manual identifier (e.g. MAN-USER-SENTINELCORE)."\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "user-manual"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Document semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string",\r\n "description": "Template schema version."\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3,\r\n "description": "Descriptive title of the user manual."\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "applies-to-version": {\r\n "type": "string",\r\n "description": "Software version or release this manual applies to (e.g. v1.0.0)."\r\n },\r\n "target-audience": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n },\r\n "minItems": 1,\r\n "description": "Target user profiles or roles for the manual."\r\n },\r\n "allowed-roles": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n },\r\n "minItems": 1,\r\n "description": "Formal catalog of authorized roles to operate the application (linked to ACT-*)."\r\n },\r\n "journeys-covered": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^JRN-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Product journey identifiers (JRN-*) covered in the manual."\r\n },\r\n "use-cases-covered": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Use case identifiers (UC-*) implemented across journeys."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^MAN-USER-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^MAN-USER-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4925
- var SCHEMA_SCHEMAS_PRIVACY_DATA_ASSET_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/privacy/data-asset.schema.json",\r\n "title": "Personal Data Asset & PII Inventory Schema (DATA-ASSET-*)",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "classification",\r\n "pii-categories",\r\n "data-subjects",\r\n "retention-period",\r\n "erasure-method"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "data-asset"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Data asset semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "classification": {\r\n "type": "string",\r\n "enum": [\r\n "public",\r\n "internal",\r\n "confidential-pii",\r\n "special-category-sensitive"\r\n ],\r\n "description": "Data sensitivity classification aligned with privacy-policy.yaml."\r\n },\r\n "pii-categories": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "enum": [\r\n "identifiers",\r\n "contact",\r\n "authentication",\r\n "financial",\r\n "location",\r\n "behavioral",\r\n "biometric",\r\n "health",\r\n "telemetry-operator"\r\n ]\r\n }\r\n },\r\n "data-subjects": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Product actors (ACT-*) whose personal data is stored or processed."\r\n },\r\n "fields": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "required": ["name", "sensitivity", "masking-strategy"],\r\n "properties": {\r\n "name": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "sensitivity": {\r\n "type": "string",\r\n "enum": ["public", "internal", "pii", "special-category"]\r\n },\r\n "masking-strategy": {\r\n "type": "string",\r\n "enum": [\r\n "none",\r\n "redact",\r\n "sha256-salt",\r\n "tokenize",\r\n "aes-256-gcm",\r\n "truncate"\r\n ]\r\n }\r\n },\r\n "additionalProperties": false\r\n }\r\n },\r\n "retention-period": {\r\n "type": "string",\r\n "pattern": "^([0-9]+(d|m|y)|session-only|indefinite-anonymized)$",\r\n "description": "Maximum retention TTL (e.g. 30d, 12m, 5y, session-only, indefinite-anonymized)."\r\n },\r\n "erasure-method": {\r\n "type": "string",\r\n "enum": [\r\n "hard-delete",\r\n "crypto-shredding",\r\n "irreversible-anonymization"\r\n ]\r\n },\r\n "owner-bounded-context": {\r\n "type": "string",\r\n "pattern": "^(BC|CMP)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4926
- var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-policy.schema.json",\r\n "title": "Privacy-by-Design as Code Governance Policy Schema",\r\n "type": "object",\r\n "required": [\r\n "version",\r\n "project",\r\n "regulatory_frameworks",\r\n "default_action",\r\n "classifications",\r\n "agent_guardrails",\r\n "ci_gates"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(PRIV-POL|POL-PRIV)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "privacy-policy"\r\n },\r\n "version": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "project": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "regulatory_frameworks": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "enum": ["GDPR", "LOPDGDD", "ISO-27701", "CCPA", "HIPAA", "LGPD"]\r\n }\r\n },\r\n "default_action": {\r\n "type": "string",\r\n "enum": ["DENY_UNREGISTERED_PII", "ALLOW", "REVIEW_REQUIRED"]\r\n },\r\n "classifications": {\r\n "type": "object",\r\n "required": ["public", "internal", "confidential_pii", "special_category_sensitive"],\r\n "additionalProperties": {\r\n "type": "object",\r\n "required": ["action", "encryption_at_rest", "encryption_in_transit", "allow_in_logs", "allow_in_ai_prompts"],\r\n "properties": {\r\n "action": {\r\n "type": "string",\r\n "enum": ["ALLOW", "STRICT_GOVERNANCE", "DPIA_APPROVAL_REQUIRED", "DENY"]\r\n },\r\n "description": { "type": "string" },\r\n "exception_requires": { "type": "string" },\r\n "require_ropa_entry": { "type": "boolean" },\r\n "require_dpia_artifact": { "type": "boolean" },\r\n "encryption_at_rest": { "type": "boolean" },\r\n "encryption_in_transit": { "type": "boolean" },\r\n "require_field_level_encryption": { "type": "boolean" },\r\n "allow_in_logs": { "type": "boolean" },\r\n "log_masking_strategy": { "type": "string" },\r\n "allow_in_ai_prompts": { "type": "boolean" },\r\n "max_retention_days": { "type": "integer", "minimum": 1 },\r\n "require_right_to_erasure": { "type": "boolean" }\r\n },\r\n "additionalProperties": false\r\n }\r\n },\r\n "cross_border_transfers": {\r\n "type": "object",\r\n "properties": {\r\n "allowed_regions": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n },\r\n "require_scc_for_third_countries": { "type": "boolean" },\r\n "approved_subprocessors": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n }\r\n },\r\n "additionalProperties": false\r\n },\r\n "agent_guardrails": {\r\n "type": "object",\r\n "required": [\r\n "forbid_real_pii_in_tests",\r\n "forbid_pii_in_console_or_logger",\r\n "require_dto_projection_for_pii"\r\n ],\r\n "properties": {\r\n "forbid_real_pii_in_tests": { "type": "boolean" },\r\n "forbid_pii_in_console_or_logger": { "type": "boolean" },\r\n "require_dto_projection_for_pii": { "type": "boolean" },\r\n "on_special_category_detected": {\r\n "type": "object",\r\n "required": ["action", "notification_tag", "message"],\r\n "properties": {\r\n "action": { "type": "string" },\r\n "notification_tag": { "type": "string" },\r\n "message": { "type": "string" }\r\n },\r\n "additionalProperties": false\r\n }\r\n },\r\n "additionalProperties": false\r\n },\r\n "ci_gates": {\r\n "type": "object",\r\n "required": [\r\n "fail_on_unregistered_pii",\r\n "fail_on_pii_in_logs",\r\n "fail_on_missing_retention_policy",\r\n "generate_ropa_inventory",\r\n "output_ropa_file",\r\n "output_privacy_report"\r\n ],\r\n "properties": {\r\n "fail_on_unregistered_pii": { "type": "boolean" },\r\n "fail_on_pii_in_logs": { "type": "boolean" },\r\n "fail_on_missing_retention_policy": { "type": "boolean" },\r\n "fail_on_unapproved_subprocessor": { "type": "boolean" },\r\n "generate_ropa_inventory": { "type": "boolean" },\r\n "output_ropa_file": { "type": "string" },\r\n "output_privacy_report": { "type": "string" }\r\n },\r\n "additionalProperties": false\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4927
- var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-req.schema.json",\r\n "title": "Privacy Requirement & Technical Control Schema (PRIV-REQ-*)",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "privacy-principle",\r\n "linddun-category",\r\n "governs-ropa"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "privacy-requirement"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Privacy requirement semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "privacy-principle": {\r\n "type": "string",\r\n "enum": [\r\n "data-minimization",\r\n "purpose-limitation",\r\n "storage-limitation",\r\n "accuracy",\r\n "integrity-and-confidentiality",\r\n "transparency-and-consent",\r\n "data-subject-rights-arco",\r\n "pseudonymization-anonymization"\r\n ]\r\n },\r\n "linddun-category": {\r\n "type": "string",\r\n "enum": [\r\n "linkability",\r\n "identifiability",\r\n "non-repudiation",\r\n "detectability",\r\n "disclosure-of-information",\r\n "unawareness",\r\n "non-compliance"\r\n ],\r\n "description": "LINDDUN privacy threat category mitigated by this control."\r\n },\r\n "governs-ropa": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Upstream ROPA records (PRIV-ROPA-*) governed by this privacy requirement."\r\n },\r\n "protects-data-assets": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "enforced-in-enclave": {\r\n "type": "string",\r\n "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "compliance-references": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "acceptance-format": {\r\n "type": "string",\r\n "enum": ["gherkin", "declarative-prose"]\r\n },\r\n "cucumber-tags": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^@[a-zA-Z0-9_-]+$"\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4928
- var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-ropa.schema.json",\r\n "title": "Record of Processing Activities Schema (PRIV-ROPA-* / GDPR Art. 30)",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "lawful-basis",\r\n "processing-purpose",\r\n "use-cases",\r\n "data-assets",\r\n "data-subjects",\r\n "retention-ttl"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "privacy-ropa"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "ROPA record semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "lawful-basis": {\r\n "type": "string",\r\n "enum": [\r\n "consent",\r\n "contract",\r\n "legal-obligation",\r\n "vital-interests",\r\n "public-task",\r\n "legitimate-interests"\r\n ],\r\n "description": "Lawful basis for processing under GDPR Art. 6.1."\r\n },\r\n "special-category-condition": {\r\n "type": ["string", "null"],\r\n "enum": [\r\n null,\r\n "explicit-consent",\r\n "employment-social-security",\r\n "vital-interests",\r\n "public-interest",\r\n "preventive-medicine",\r\n "public-health"\r\n ],\r\n "description": "GDPR Art. 9.2 condition when processing special category data."\r\n },\r\n "processing-purpose": {\r\n "type": "string",\r\n "minLength": 10\r\n },\r\n "use-cases": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Upstream Use Cases (UC-*) that trigger this data processing activity."\r\n },\r\n "data-assets": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Personal Data Assets (DATA-ASSET-*) processed in this activity."\r\n },\r\n "data-subjects": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "retention-ttl": {\r\n "type": "string",\r\n "pattern": "^([0-9]+(d|m|y)|session-only|indefinite-anonymized)$"\r\n },\r\n "cross-border-transfer": {\r\n "type": "boolean"\r\n },\r\n "transfer-safeguards": {\r\n "type": ["string", "null"],\r\n "enum": [null, "adequacy-decision", "scc", "bcr", "derogation"]\r\n },\r\n "subprocessors": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "dpia-required": {\r\n "type": "boolean"\r\n },\r\n "dpia-reference": {\r\n "type": ["string", "null"],\r\n "pattern": "^DPIA-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "mitigated-by": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Privacy requirements (PRIV-REQ-*) governing and enforcing this processing activity."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4929
- var SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/actor.schema.json",\r\n "title": "ProductShape Actor Schema (Versionable)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "role-type"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "actor"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Artifact semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string",\r\n "description": "Schema specification version used."\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "role-type": {\r\n "type": "string",\r\n "enum": ["human-user", "ai-agent", "external-system", "sensor-iot"]\r\n },\r\n "description": {\r\n "type": "string"\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Identifier of the actor superseded by this version or artifact."\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Identifier of the new actor superseding this one upon deprecation/retirement."\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4930
- var SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/bounded-context.schema.json",\r\n "title": "Domain-Driven Design (DDD) Bounded Context Schema",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "domain-type",\r\n "responsibilities"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Immutable Bounded Context identifier (e.g. BC-AI-SDLC-GOVERNANCE)."\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "bounded-context"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Bounded context document semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string",\r\n "description": "Template schema version."\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3,\r\n "description": "Descriptive title of the Bounded Context."\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "domain-type": {\r\n "type": "string",\r\n "enum": ["core", "supporting", "generic"],\r\n "description": "DDD subdomain classification: core differentiator, supporting capability, or generic commodity."\r\n },\r\n "strategic-classification": {\r\n "type": "object",\r\n "properties": {\r\n "evolutionary-stage": {\r\n "type": "string",\r\n "enum": ["genesis", "custom-built", "product-rental", "commodity"]\r\n },\r\n "business-model-role": {\r\n "type": "string",\r\n "enum": ["differentiator", "operational", "enabler"]\r\n }\r\n },\r\n "additionalProperties": false\r\n },\r\n "responsibilities": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "minItems": 1,\r\n "description": "List of functional boundaries and core domain responsibilities encapsulated within this context."\r\n },\r\n "ubiquitous-language-terms": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Ubiquitous language terms (TERM-*) governed within this bounded context."\r\n },\r\n "context-mapping": {\r\n "type": "object",\r\n "properties": {\r\n "upstream-dependencies": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "downstream-dependents": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "integration-patterns": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "properties": {\r\n "pattern": {\r\n "type": "string"\r\n },\r\n "related-context": {\r\n "type": "string"\r\n }\r\n },\r\n "additionalProperties": false\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n },\r\n "components-involved": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Architecture components (CMP-*) implementing this bounded context."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4931
- var SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/business-rule.schema.json",\r\n "title": "ProductShape Business Rule Schema (Versionable)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "enforcement-level"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^BR-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "business-rule"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Business rule semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "enforcement-level": {\r\n "type": "string",\r\n "enum": ["strict-invariant", "override-with-approval", "guideline"]\r\n },\r\n "defined-in": {\r\n "type": "string",\r\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "uses-terms": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^BR-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^BR-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4932
- var SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/journey.schema.json",\r\n "title": "Customer / Operator Journey Schema",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "persona",\r\n "stages",\r\n "touchpoints"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^JRN-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "journey"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Journey semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "persona": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Actor (persona) starring in this journey."\r\n },\r\n "stages": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string"\r\n },\r\n "description": "Sequential journey stages (e.g. Awareness, Onboarding, Activation, Retention)."\r\n },\r\n "touchpoints": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string"\r\n },\r\n "description": "Touchpoints between persona and system at each stage."\r\n },\r\n "related-use-cases": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "System use cases related to this journey."\r\n },\r\n "pain-points": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n },\r\n "description": "Frictions or issues detected along the user journey."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"]\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"]\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4933
- var SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/requirement.schema.json",\r\n "title": "ProductShape Requirement Schema (Strict Test Validation Enforced)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "category", "derives-from", "verifiable-by"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(FR|QR|CON)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "requirement"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Requirement semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "category": {\r\n "type": "string",\r\n "enum": ["functional", "quality", "constraint"]\r\n },\r\n "derives-from": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^(UC|BR|CON|CAP|GOAL)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Product Traceability: Origin Use Cases, Rules, Constraints, or Capabilities."\r\n },\r\n "verifiable-by": {\r\n "type": "string",\r\n "enum": ["cucumber-bdd", "automated-unit-test", "integration-test", "performance-benchmark", "security-audit", "inspection"],\r\n "description": "Mandatory formal verification method."\r\n },\r\n "acceptance-format": {\r\n "type": "string",\r\n "enum": ["gherkin", "declarative-prose"],\r\n "description": "Acceptance criteria format."\r\n },\r\n "cucumber-tags": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^@[a-zA-Z0-9_-]+$"\r\n },\r\n "description": "Cucumber tags for filtering and executing BDD tests."\r\n },\r\n "enforce-bdd-variants": {\r\n "type": "boolean",\r\n "description": "When true, enforces all 3 BDD scenario categories (@nominal, @boundary, @invalid)."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^(FR|QR|CON)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^(FR|QR|CON)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4934
- var SCHEMA_SCHEMAS_PRODUCT_TERM_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/term.schema.json",\r\n "title": "Domain Glossary Term Schema (Ubiquitous Language)",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "definition",\r\n "bounded-context"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "term"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Term semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 2,\r\n "description": "Canonical name of the term in the domain ubiquitous language."\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "definition": {\r\n "type": "string",\r\n "minLength": 10,\r\n "description": "Precise and unambiguous definition of the term in the domain context."\r\n },\r\n "bounded-context": {\r\n "type": "string",\r\n "description": "DDD Bounded Context this term belongs to (e.g. FlightControl, Telemetry, Billing)."\r\n },\r\n "synonyms": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n },\r\n "description": "Synonyms or alternative terms used colloquially that map to this canonical term."\r\n },\r\n "anti-terms": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n },\r\n "description": "Incorrect or ambiguous terms that MUST NOT be used for this concept."\r\n },\r\n "related-terms": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Glossary terms semantically related."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"]\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"]\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4935
- var SCHEMA_SCHEMAS_PRODUCT_USE_CASE_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/use-case.schema.json",\r\n "title": "ProductShape Use Case Schema (Versionable)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "primary-actor"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "use-case"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Use case semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string",\r\n "description": "Template schema version."\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "primary-actor": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "supporting-actors": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "governed-by": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^BR-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "uses-terms": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "in-context": {\r\n "type": "string",\r\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "alternative-flows": {\r\n "type": "array",\r\n "items": {\r\n "oneOf": [\r\n { "type": "string", "minLength": 1 },\r\n {\r\n "type": "object",\r\n "properties": {\r\n "id": { "type": "string" },\r\n "name": { "type": "string" },\r\n "description": { "type": "string" }\r\n },\r\n "additionalProperties": false\r\n }\r\n ]\r\n },\r\n "description": "Declared alternative flows that must be covered by tests."\r\n },\r\n "exception-flows": {\r\n "type": "array",\r\n "items": {\r\n "oneOf": [\r\n { "type": "string", "minLength": 1 },\r\n {\r\n "type": "object",\r\n "properties": {\r\n "id": { "type": "string" },\r\n "name": { "type": "string" },\r\n "description": { "type": "string" }\r\n },\r\n "additionalProperties": false\r\n }\r\n ]\r\n },\r\n "description": "Declared exception flows that must be covered by tests."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4936
- var SCHEMA_SCHEMAS_SAFETY_HAZARD_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/safety/hazard.schema.json",\r\n "title": "Hazard Schema (Operational Hazard & Safety Risk Analysis)",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "severity",\r\n "probability",\r\n "fault-tolerance-time-ms",\r\n "mitigated-by"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^HAZ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "hazard"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Hazard semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "severity": {\r\n "type": "string",\r\n "enum": ["catastrophic", "critical", "major", "minor", "negligible"],\r\n "description": "Hazard severity per functional safety classification (DO-178C / ISO 26262)."\r\n },\r\n "probability": {\r\n "type": "string",\r\n "enum": ["frequent", "probable", "occasional", "remote", "improbable", "extremely-improbable"],\r\n "description": "Probability of operational hazard occurrence."\r\n },\r\n "fault-tolerance-time-ms": {\r\n "type": "number",\r\n "minimum": 0,\r\n "description": "Fault tolerance time interval (FTTI) limit in milliseconds before entering safe state."\r\n },\r\n "mitigated-by": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^SAF-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Safety requirements mitigating this hazard."\r\n },\r\n "hazardous-condition": {\r\n "type": "string",\r\n "description": "Description of the dangerous operational condition."\r\n },\r\n "potential-effect": {\r\n "type": "string",\r\n "description": "Potential effect on people, aircraft, or environment if hazard materializes."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"]\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"]\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4937
- var SCHEMA_SCHEMAS_SAFETY_SAFETY_REQ_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/safety/safety-req.schema.json",\r\n "title": "Safety Requirement Schema (Functional Safety & Hazard Mitigation)",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "safety-domain",\r\n "safety-integrity-level",\r\n "mitigates-hazard",\r\n "fail-safe-action"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^SAF-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "safety-requirement"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Safety requirement semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "safety-domain": {\r\n "type": "string",\r\n "enum": [\r\n "flight-control",\r\n "collision-avoidance",\r\n "energy-management",\r\n "emergency-recovery",\r\n "sensor-integrity",\r\n "propulsion",\r\n "telemetry"\r\n ],\r\n "description": "Operational safety domain."\r\n },\r\n "safety-integrity-level": {\r\n "type": "string",\r\n "description": "Safety integrity level (e.g. DAL-A..D, ASIL-A..D, SIL-1..4)."\r\n },\r\n "mitigates-hazard": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^HAZ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Operational hazards mitigated by safety control."\r\n },\r\n "fail-safe-action": {\r\n "type": "string",\r\n "description": "Automatic action or contingency maneuver to enter safe state."\r\n },\r\n "fault-tolerance-time-ms": {\r\n "type": "number",\r\n "description": "Fault tolerance time interval limit in milliseconds (FTTI)."\r\n },\r\n "acceptance-format": {\r\n "type": "string",\r\n "enum": ["gherkin", "declarative-prose"]\r\n },\r\n "cucumber-tags": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"]\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"]\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4938
- var SCHEMA_SCHEMAS_SDD_DESIGN_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/sdd/design.schema.json",\r\n "title": "Spec-Driven Development Technical Design Schema (DSG-*)",\r\n "type": "object",\r\n "required": ["id", "type", "title"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(DSG-[A-Z0-9]+(-[A-Z0-9]+)*|CHG-[A-Z0-9]+-DESIGN|[A-Z0-9]+(-[A-Z0-9]+)*)$",\r\n "description": "Unique identifier of the technical design specification."\r\n },\r\n "type": {\r\n "type": "string",\r\n "enum": ["spec-design", "spec-change-design", "design"]\r\n },\r\n "change-id": {\r\n "type": "string",\r\n "pattern": "^(CHG|FEAT|PATCH)-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Parent change identifier associated with this design."\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Semantic versioning (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "handoff": {\r\n "type": "string",\r\n "pattern": "^HOF-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Reference to the HOF-* sidecar."\r\n },\r\n "architecture-component": {\r\n "type": "string",\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Associated architecture component."\r\n },\r\n "architecture-components": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "List of architecture components covered by this technical design."\r\n },\r\n "enclave": {\r\n "type": "string",\r\n "pattern": "^(SEC-ENC-)?[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Zero trust security enclave."\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": [\r\n "draft",\r\n "proposed",\r\n "review",\r\n "approved",\r\n "active",\r\n "completed",\r\n "deprecated"\r\n ]\r\n },\r\n "author": {\r\n "type": "string"\r\n },\r\n "date": {\r\n "type": "string"\r\n },\r\n "contracts": {\r\n "type": "array",\r\n "description": "Explicit contract interfaces and methods designed for implementation and unit testing.",\r\n "items": {\r\n "oneOf": [\r\n { "type": "string", "minLength": 1 },\r\n {\r\n "type": "object",\r\n "required": ["methods"],\r\n "properties": {\r\n "component": { "type": "string" },\r\n "interface": { "type": "string" },\r\n "methods": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": { "type": "string", "minLength": 1 }\r\n }\r\n },\r\n "additionalProperties": false\r\n }\r\n ]\r\n }\r\n },\r\n "citations": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "required": ["id"],\r\n "properties": {\r\n "id": { "type": "string" },\r\n "digest": { "type": "string" },\r\n "comment": { "type": "string" },\r\n "anchor": { "type": "string" }\r\n },\r\n "additionalProperties": false\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4939
- var SCHEMA_SCHEMAS_SDD_HANDOFF_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/sdd/handoff.schema.json",\r\n "title": "PDaC Product Handoff Sidecar Schema (HOF-*)",\r\n "type": "object",\r\n "required": ["id", "type", "changeId", "subgraph"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^HOF-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Immutable identifier emitted by PDaC handoff."\r\n },\r\n "type": {\r\n "type": "string",\r\n "enum": ["handoff", "product-handoff"]\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "changeId": {\r\n "type": "string",\r\n "pattern": "^(CHG|FEAT)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$"\r\n },\r\n "createdAt": {\r\n "type": "string"\r\n },\r\n "subgraph": {\r\n "type": "object",\r\n "required": ["requirements"],\r\n "properties": {\r\n "requirements": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": { "type": "string" }\r\n },\r\n "useCases": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n },\r\n "businessRules": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n },\r\n "securityRequirements": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n },\r\n "abuseCases": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n },\r\n "privacyRequirements": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n },\r\n "dataAssets": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n },\r\n "privacyRopa": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n },\r\n "actors": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n }\r\n },\r\n "additionalProperties": true\r\n },\r\n "citations": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "required": ["id"],\r\n "properties": {\r\n "id": { "type": "string" },\r\n "digest": { "type": "string" },\r\n "anchor": { "type": "string" },\r\n "comment": { "type": "string" }\r\n }\r\n }\r\n }\r\n },\r\n "additionalProperties": true\r\n}\r\n';
4940
- var SCHEMA_SCHEMAS_SDD_PROPOSAL_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/sdd/proposal.schema.json",\r\n "title": "Spec-Driven Development Change Proposal Schema (CHG-*)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(CHG|FEAT|PATCH)-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Unique identifier of the change proposal."\r\n },\r\n "type": {\r\n "type": "string",\r\n "enum": ["spec-change-proposal", "proposal"]\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": [\r\n "draft",\r\n "proposed",\r\n "review",\r\n "approved",\r\n "applied",\r\n "active",\r\n "completed",\r\n "rejected"\r\n ]\r\n },\r\n "author": {\r\n "type": "string"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Semantic versioning (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "date": {\r\n "type": "string"\r\n },\r\n "handoff": {\r\n "type": "string",\r\n "description": "Associated handoff sidecar reference."\r\n },\r\n "sdd-framework-compat": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n },\r\n "description": "Supported SDD framework adapters."\r\n },\r\n "citations": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "required": ["id"],\r\n "properties": {\r\n "id": { "type": "string" },\r\n "digest": { "type": "string" },\r\n "comment": { "type": "string" },\r\n "anchor": { "type": "string" }\r\n },\r\n "additionalProperties": false\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4941
- var SCHEMA_SCHEMAS_SDD_RELEASE_KPIS_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/sdd/release-kpis.schema.json",\r\n "title": "Release Consolidated KPIs & Attribution Telemetry Schema",\r\n "type": "object",\r\n "required": [\r\n "releaseBranch",\r\n "baseBranch",\r\n "generatedAt",\r\n "totalCommits",\r\n "totalLinesAdded",\r\n "totalLinesDeleted",\r\n "totalKloc",\r\n "totalBugs",\r\n "globalDefectDensity",\r\n "totalTimeSeconds",\r\n "totalTokens",\r\n "totalCostUsd",\r\n "authorStats",\r\n "bugList"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(KPI-REL|REL-KPI)-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Optional artifact identifier."\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "release-kpis"\r\n },\r\n "releaseBranch": {\r\n "type": "string"\r\n },\r\n "baseBranch": {\r\n "type": "string"\r\n },\r\n "generatedAt": {\r\n "type": "string"\r\n },\r\n "totalCommits": {\r\n "type": "integer",\r\n "minimum": 0\r\n },\r\n "totalLinesAdded": {\r\n "type": "integer",\r\n "minimum": 0\r\n },\r\n "totalLinesDeleted": {\r\n "type": "integer",\r\n "minimum": 0\r\n },\r\n "totalKloc": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "totalBugs": {\r\n "type": "integer",\r\n "minimum": 0\r\n },\r\n "globalDefectDensity": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "totalTimeSeconds": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "totalTokens": {\r\n "type": "integer",\r\n "minimum": 0\r\n },\r\n "totalCostUsd": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "reworkTimeSeconds": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "reworkTokens": {\r\n "type": "integer",\r\n "minimum": 0\r\n },\r\n "reworkCostUsd": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "reworkTimePercent": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "reworkTokensPercent": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "reworkCostPercent": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "authorStats": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "required": [\r\n "authorOrModel",\r\n "isAgent",\r\n "commits",\r\n "linesAdded",\r\n "linesDeleted",\r\n "klocProduced",\r\n "bugsInjected",\r\n "defectInjectionRate",\r\n "totalTimeSeconds",\r\n "totalTokens",\r\n "estimatedCostUsd"\r\n ],\r\n "properties": {\r\n "authorOrModel": {\r\n "type": "string"\r\n },\r\n "isAgent": {\r\n "type": "boolean"\r\n },\r\n "commits": {\r\n "type": "integer",\r\n "minimum": 0\r\n },\r\n "linesAdded": {\r\n "type": "integer",\r\n "minimum": 0\r\n },\r\n "linesDeleted": {\r\n "type": "integer",\r\n "minimum": 0\r\n },\r\n "klocProduced": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "bugsInjected": {\r\n "type": "integer",\r\n "minimum": 0\r\n },\r\n "defectInjectionRate": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "totalTimeSeconds": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "totalTokens": {\r\n "type": "integer",\r\n "minimum": 0\r\n },\r\n "estimatedCostUsd": {\r\n "type": "number",\r\n "minimum": 0\r\n }\r\n },\r\n "additionalProperties": false\r\n }\r\n },\r\n "bugList": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "required": ["sha", "subject", "author", "timeSeconds", "tokens"],\r\n "properties": {\r\n "sha": {\r\n "type": "string"\r\n },\r\n "subject": {\r\n "type": "string"\r\n },\r\n "author": {\r\n "type": "string"\r\n },\r\n "parentRef": {\r\n "type": "string"\r\n },\r\n "timeSeconds": {\r\n "type": "number",\r\n "minimum": 0\r\n },\r\n "tokens": {\r\n "type": "integer",\r\n "minimum": 0\r\n }\r\n },\r\n "additionalProperties": false\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4942
- var SCHEMA_SCHEMAS_SDD_SESSION_TELEMETRY_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/sdd/session-telemetry.schema.json",\r\n "title": "Agent Session Telemetry Schema (.ai-sdlc/session-telemetry.json)",\r\n "type": "object",\r\n "required": [\r\n "model",\r\n "promptTokens",\r\n "completionTokens",\r\n "activeTimeSeconds"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(TEL-SES|SES-TEL|TEL)-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Optional telemetry session identifier."\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "session-telemetry"\r\n },\r\n "model": {\r\n "type": "string",\r\n "minLength": 1,\r\n "description": "AI model name or identifier."\r\n },\r\n "promptTokens": {\r\n "type": "integer",\r\n "minimum": 0,\r\n "description": "Total prompt tokens consumed."\r\n },\r\n "completionTokens": {\r\n "type": "integer",\r\n "minimum": 0,\r\n "description": "Total completion tokens generated."\r\n },\r\n "activeTimeSeconds": {\r\n "type": "number",\r\n "minimum": 0,\r\n "description": "Active session development duration in seconds."\r\n },\r\n "author": {\r\n "type": "string"\r\n },\r\n "authorType": {\r\n "type": "string",\r\n "enum": ["agent", "human"]\r\n },\r\n "sessionId": {\r\n "type": "string"\r\n },\r\n "timestamp": {\r\n "type": "string"\r\n },\r\n "provider": {\r\n "type": "string"\r\n },\r\n "confidence": {\r\n "type": "string",\r\n "enum": ["HIGH", "MEDIUM", "LOW"]\r\n },\r\n "source": {\r\n "type": "string"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4943
- var SCHEMA_SCHEMAS_SDD_SPEC_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/sdd/spec.schema.json",\r\n "title": "Spec-Driven Development Delivery Specification Schema (SPEC-*)",\r\n "type": "object",\r\n "required": ["id", "type", "change-id"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^SPEC-(CHG|FEAT|PATCH)-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Unique identifier of the delivery specification."\r\n },\r\n "type": {\r\n "type": "string",\r\n "enum": ["delivery-spec", "spec"]\r\n },\r\n "change-id": {\r\n "type": "string",\r\n "pattern": "^(CHG|FEAT|PATCH)-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Parent change identifier associated with this specification."\r\n },\r\n "profile": {\r\n "type": "string",\r\n "enum": ["patch", "standard", "critical"],\r\n "description": "Risk and governance profile of the change."\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Semantic versioning (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "handoff": {\r\n "type": "string",\r\n "description": "Associated handoff sidecar reference."\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": [\r\n "draft",\r\n "proposed",\r\n "review",\r\n "approved",\r\n "active",\r\n "completed",\r\n "deprecated"\r\n ]\r\n },\r\n "verification": {\r\n "type": "object",\r\n "properties": {\r\n "method": {\r\n "type": "string"\r\n },\r\n "command": {\r\n "type": "string"\r\n },\r\n "target": {\r\n "type": "string"\r\n }\r\n },\r\n "additionalProperties": true\r\n },\r\n "citations": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "required": ["id"],\r\n "properties": {\r\n "id": { "type": "string" },\r\n "digest": { "type": "string" },\r\n "comment": { "type": "string" },\r\n "anchor": { "type": "string" }\r\n },\r\n "additionalProperties": false\r\n }\r\n },\r\n "acceptance-format": {\r\n "type": "string",\r\n "enum": ["gherkin"],\r\n "description": "Formato de aceptaci\xF3n BDD obligatorio para especificaciones de entrega SDD."\r\n },\r\n "cucumber-tags": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^@[a-zA-Z0-9_-]+$"\r\n },\r\n "description": "Etiquetas de trazabilidad BDD para ejecuci\xF3n con Cucumber."\r\n },\r\n "cucumber-feature-file": {\r\n "type": "string",\r\n "description": "Ruta personalizada de extracci\xF3n del archivo .feature para Cucumber."\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4944
- var SCHEMA_SCHEMAS_SDD_TASKS_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/sdd/tasks.schema.json",\r\n "title": "Verifiable Tasks & Human Autonomy Governance Schema",\r\n "type": "object",\r\n "required": ["id", "type", "change-id", "version", "tasks"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^TSK-PLAN-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "task-plan"\r\n },\r\n "change-id": {\r\n "type": "string",\r\n "pattern": "^(CHG|FEAT)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$"\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 5\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "approved", "in-progress", "completed", "blocked"]\r\n },\r\n "governance-summary": {\r\n "type": "object",\r\n "properties": {\r\n "autonomous-tasks-count": { "type": "integer", "minimum": 0 },\r\n "human-review-plan-count": { "type": "integer", "minimum": 0 },\r\n "ambiguous-count": { "type": "integer", "minimum": 0 },\r\n "high-risk-manual-count": { "type": "integer", "minimum": 0 }\r\n }\r\n },\r\n "tasks": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "object",\r\n "required": ["id", "title", "complexity", "risk-level", "autonomy-mode", "verification", "assigned-to", "status"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^TSK-[0-9]{3,}$"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 5\r\n },\r\n "complexity": {\r\n "type": "string",\r\n "enum": ["LOW", "MEDIUM", "HIGH"]\r\n },\r\n "risk-level": {\r\n "type": "string",\r\n "enum": ["LOW", "MEDIUM", "HIGH", "CRITICAL"]\r\n },\r\n "autonomy-mode": {\r\n "type": "string",\r\n "enum": [\r\n "AUTONOMOUS",\r\n "HUMAN_REVIEW_PLAN",\r\n "AMBIGUOUS",\r\n "HIGH_RISK_MANUAL"\r\n ],\r\n "description": "AI agent human governance and supervision mode."\r\n },\r\n "verification": {\r\n "type": "object",\r\n "required": ["method", "command-or-criteria"],\r\n "properties": {\r\n "method": {\r\n "type": "string",\r\n "enum": ["automated-unit-test", "cucumber-bdd", "quality-gate", "license-audit", "sast-scan", "privacy-audit", "manual-inspection", "smoke-test"]\r\n },\r\n "command-or-criteria": {\r\n "type": "string",\r\n "minLength": 5\r\n }\r\n }\r\n },\r\n "assigned-to": {\r\n "type": "string",\r\n "enum": [\r\n "agent-developer",\r\n "agent-security-auditor",\r\n "agent-compliance-checker",\r\n "agent-privacy-officer",\r\n "agent-qa",\r\n "human-engineer",\r\n "human-architect",\r\n "pair-human-agent"\r\n ]\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["PENDING", "IN_PROGRESS", "COMPLETED", "BLOCKED"]\r\n },\r\n "blocking-reason": {\r\n "type": "string"\r\n },\r\n "implements-components": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Architecture components (CMP-*) implemented by this atomic task."\r\n },\r\n "satisfies-requirements": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^(FR|QR|CON|SEC-REQ|SAF-REQ|PRIV-REQ)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Requirements satisfied by this atomic task."\r\n },\r\n "implements-contracts": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "description": "Explicit interface or method contracts from design.md implemented by this task."\r\n }\r\n },\r\n "additionalProperties": false\r\n }\r\n },\r\n "supersedes": { "type": ["string", "null"] },\r\n "superseded-by": { "type": ["string", "null"] }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4945
- var SCHEMA_SCHEMAS_SECURITY_ABUSE_CASE_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/security/abuse-case.schema.json",\r\n "title": "Abuse Case Schema (Versionable)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "primary-threat-actor", "targets-use-case", "stride-category", "mitigated-by"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^ABUSE-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "abuse-case"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Abuse case semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "primary-threat-actor": {\r\n "type": "string",\r\n "pattern": "^ACT-THREAT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "targets-use-case": {\r\n "type": "string",\r\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "stride-category": {\r\n "type": "string",\r\n "enum": ["spoofing", "tampering", "repudiation", "information-disclosure", "denial-of-service", "elevation-of-privilege"]\r\n },\r\n "mitigated-by": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^SEC-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "asvs-controls": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^ABUSE-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^ABUSE-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
4946
- var SCHEMA_SCHEMAS_SECURITY_ENCLAVE_SCHEMA_JSON = `{\r
4947
- "$schema": "https://json-schema.org/draft/2020-12/schema",\r
4948
- "$id": "https://ai-sdlc.org/schemas/security/enclave.schema.json",\r
4949
- "title": "Security Enclave Schema (Zero Trust Architecture Boundary)",\r
4950
- "type": "object",\r
4951
- "required": [\r
4952
- "id",\r
4953
- "type",\r
4954
- "title",\r
4955
- "status",\r
4956
- "version",\r
4957
- "trust-zone",\r
4958
- "perimeter-rules",\r
4959
- "allowed-inbound",\r
4960
- "allowed-outbound"\r
4961
- ],\r
4962
- "properties": {\r
4963
- "id": {\r
4964
- "type": "string",\r
4965
- "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r
4966
- },\r
4967
- "type": {\r
4968
- "type": "string",\r
4969
- "const": "security-enclave"\r
4970
- },\r
4971
- "version": {\r
4972
- "type": "string",\r
4973
- "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r
4974
- "description": "Security enclave semantic version (SemVer)."\r
4975
- },\r
4976
- "schema-version": {\r
4977
- "type": "string"\r
4978
- },\r
4979
- "title": {\r
4980
- "type": "string",\r
4981
- "minLength": 3\r
4982
- },\r
4983
- "status": {\r
4984
- "type": "string",\r
4985
- "enum": ["draft", "active", "deprecated", "retired"]\r
4986
- },\r
4987
- "trust-zone": {\r
4988
- "type": "string",\r
4989
- "enum": ["untrusted", "semi-trusted", "trusted", "highly-trusted", "dmz", "zero-trust-boundary"],\r
4990
- "description": "Zero Trust confidence zone assigned to enclave."\r
4991
- },\r
4992
- "trust-level": {\r
4993
- "type": "string",\r
4994
- "description": "Descriptive Zero Trust confidence level."\r
4995
- },\r
4996
- "isolation": {\r
4997
- "type": "string",\r
4998
- "description": "Technical perimeter isolation mechanism."\r
4999
- },\r
5000
- "perimeter-rules": {\r
5001
- "type": "array",\r
5002
- "minItems": 1,\r
5003
- "items": {\r
5004
- "type": "string"\r
5005
- },\r
5006
- "description": "Perimeter rules defining enclave security boundary (e.g. mTLS, IP allowlist)."\r
5007
- },\r
5008
- "allowed-inbound": {\r
5009
- "type": "array",\r
5010
- "items": {\r
5011
- "type": "string",\r
5012
- "pattern": "^(CMP|SEC-ENC)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r
5013
- },\r
5014
- "description": "Components or enclaves authorized to initiate inbound connections."\r
5015
- },\r
5016
- "allowed-outbound": {\r
5017
- "type": "array",\r
5018
- "items": {\r
5019
- "type": "string",\r
5020
- "pattern": "^(CMP|SEC-ENC)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r
5021
- },\r
5022
- "description": "Components or enclaves this enclave can connect to."\r
5023
- },\r
5024
- "enforced-by": {\r
5025
- "type": "array",\r
5026
- "items": {\r
5027
- "type": "string",\r
5028
- "pattern": "^SEC-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r
5029
- },\r
5030
- "description": "Security requirements enforcing this enclave's rules."\r
5031
- },\r
5032
- "authentication-mechanism": {\r
5033
- "type": "string",\r
5034
- "enum": ["mtls", "jwt", "api-key", "oauth2", "none"],\r
5035
- "description": "Authentication mechanism required at enclave perimeter."\r
5036
- },\r
5037
- "supersedes": {\r
5038
- "type": ["string", "null"]\r
5039
- },\r
5040
- "superseded-by": {\r
5041
- "type": ["string", "null"]\r
5042
- }\r
5043
- },\r
5044
- "additionalProperties": false\r
5045
- }\r
5046
- `;
5047
- var SCHEMA_SCHEMAS_SECURITY_SECURITY_REQ_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/security/security-req.schema.json",\r\n "title": "Security Requirement Schema (Strict Test Validation Enforced)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "security-domain", "mitigates-abuse-case"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^SEC-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "security-requirement"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Security requirement semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "security-domain": {\r\n "type": "string",\r\n "enum": ["authentication", "authorization", "cryptography", "input-validation", "audit-logging", "communication-security", "data-protection"]\r\n },\r\n "mitigates-abuse-case": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^ABUSE-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Product/Security Traceability: Abuse case or threat this control neutralizes."\r\n },\r\n "enforced-in-enclave": {\r\n "type": "string",\r\n "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Architecture Traceability: Perimeter or internal security enclave."\r\n },\r\n "compliance-references": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "acceptance-format": {\r\n "type": "string",\r\n "enum": ["gherkin", "declarative-prose"],\r\n "description": "Mitigation criteria format."\r\n },\r\n "cucumber-tags": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^@[a-zA-Z0-9_-]+$"\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^SEC-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^SEC-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
5048
- var SCHEMA_SCHEMAS_SECURITY_THREAT_ACTOR_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/security/threat-actor.schema.json",\r\n "title": "Threat Actor Schema (Versionable)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "threat-capability", "motivation"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^ACT-THREAT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "threat-actor"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Threat profile semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "threat-capability": {\r\n "type": "string",\r\n "enum": ["script-kiddie", "advanced-persistent-threat", "insider-threat", "automated-botnet", "supply-chain-attacker"]\r\n },\r\n "motivation": {\r\n "type": "string",\r\n "enum": ["financial-gain", "espionage", "sabotage", "data-theft", "reputational-damage"]\r\n },\r\n "attack-surfaces": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^ACT-THREAT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^ACT-THREAT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
5049
- var SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/workflow/agent-handoff.schema.json",\r\n "title": "Agent Workflow Handoff Block Schema",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "completed-phase",\r\n "acting-role",\r\n "autonomy-mode",\r\n "deliverables",\r\n "suggested-prompt"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(AHOF|HOF-WORKFLOW|HOF)-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Unique workflow handoff identifier."\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "agent-handoff"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Semantic versioning (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "completed", "transferred"]\r\n },\r\n "completed-phase": {\r\n "type": "string",\r\n "minLength": 2,\r\n "description": "Name of the completed lifecycle phase or activity."\r\n },\r\n "acting-role": {\r\n "type": "string",\r\n "enum": [\r\n "agent-product-analyst",\r\n "agent-threat-modeler",\r\n "agent-privacy-officer",\r\n "agent-system-architect",\r\n "agent-qa-engineer",\r\n "agent-developer",\r\n "agent-expert-user",\r\n "agent-security-auditor",\r\n "agent-compliance-checker",\r\n "agent-code-reviewer",\r\n "agent-devops",\r\n "human-dev",\r\n "tech-lead",\r\n "release-manager",\r\n "dpo"\r\n ],\r\n "description": "Specialized role executing the handoff."\r\n },\r\n "autonomy-mode": {\r\n "type": "string",\r\n "enum": ["AUTONOMOUS", "HUMAN_REVIEW_PLAN", "AMBIGUOUS", "HIGH_RISK_MANUAL"],\r\n "description": "Autonomy level under which the task was executed."\r\n },\r\n "deliverables": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string"\r\n },\r\n "description": "Paths or IDs of artifacts produced during the phase."\r\n },\r\n "recommended-next-roles": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "required": ["role", "rationale"],\r\n "properties": {\r\n "role": {\r\n "type": "string"\r\n },\r\n "rationale": {\r\n "type": "string"\r\n }\r\n },\r\n "additionalProperties": false\r\n },\r\n "description": "Recommended downstream specialist roles and technical justifications."\r\n },\r\n "suggested-prompt": {\r\n "type": "string",\r\n "minLength": 5,\r\n "description": "Suggested invocation prompt to initiate the next agent."\r\n },\r\n "human-action-window": {\r\n "type": "object",\r\n "properties": {\r\n "review-and-validate": {\r\n "type": "boolean"\r\n },\r\n "edit-directly": {\r\n "type": "boolean"\r\n },\r\n "pause-or-divert": {\r\n "type": "boolean"\r\n },\r\n "delegate": {\r\n "type": "boolean"\r\n }\r\n },\r\n "additionalProperties": false,\r\n "description": "Actions available to the human engineer within the sovereign action window."\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
5119
+ var SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/architecture/adr.schema.json",\n "title": "Architecture Decision Record Schema (Versionable)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "deciders",\n "decision-date"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^ADR-[0-9]{3,4}(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "architecture-decision-record"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Decision record semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "proposed",\n "accepted",\n "rejected",\n "deprecated",\n "superseded"\n ]\n },\n "deciders": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string"\n }\n },\n "decision-date": {\n "type": "string",\n "format": "date"\n },\n "affects-components": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^ADR-[0-9]{3,4}(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^ADR-[0-9]{3,4}(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5120
+ var SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/architecture/component.schema.json",\n "title": "NAF v4 / arc42 Architecture Component Schema (Multilevel)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "level",\n "implementation-type",\n "implements-use-cases"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "component"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Architecture component semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "proposed",\n "accepted",\n "deprecated",\n "retired"\n ]\n },\n "level": {\n "type": "integer",\n "minimum": 1,\n "description": "Hierarchical architecture level (1: Bounded Context / Root System, 2: Subsystem / Container, 3: Executable Unit / DLL / Function)."\n },\n "bounded-context": {\n "type": "string",\n "description": "Domain-Driven Design (DDD) Bounded Context name this component belongs to."\n },\n "parent-component": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Parent component identifier (null if Level 1)."\n },\n "implementation-type": {\n "type": "string",\n "enum": [\n "service",\n "dll",\n "function",\n "composite"\n ],\n "description": "Technical implementation paradigm: distributed service (service), dynamic/native library (dll), in-process module/function (function), or logical aggregator/Bounded Context (composite)."\n },\n "implements-use-cases": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "satisfies-requirements": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^(FR|QR|CON|SEC-REQ|SAF-REQ|PRIV-REQ)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "hosted-in-enclave": {\n "type": "string",\n "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Security enclave where the component resides (optional for DLLs or in-process functions)."\n },\n "interfaces": {\n "type": "array",\n "items": {\n "type": "object",\n "required": [\n "name",\n "protocol"\n ],\n "properties": {\n "name": {\n "type": "string"\n },\n "protocol": {\n "type": "string",\n "enum": [\n "REST/HTTP",\n "gRPC",\n "WebSocket",\n "Kafka",\n "MQTT",\n "C-ABI",\n "Native-ABI",\n "FFI",\n "In-Process API",\n "Function-Call",\n "CLI",\n "GUI",\n "IPC"\n ]\n },\n "contract-spec": {\n "type": "string"\n }\n }\n }\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5121
+ var SCHEMA_SCHEMAS_ARCHITECTURE_INTRODUCTION_AND_GOALS_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/architecture/introduction-and-goals.schema.json",\n "title": "NAF v4 Enterprise & Capability / arc42 Introduction and System Goals Schema",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "naf-perspective",\n "cites-product-actors",\n "cites-quality-goals",\n "cites-journeys"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^ARCH-INTRO-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "architecture-introduction"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Artifact semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "proposed",\n "accepted",\n "approved",\n "deprecated",\n "superseded"\n ]\n },\n "owner": {\n "type": "string"\n },\n "arc42-section": {\n "type": "integer",\n "const": 1\n },\n "naf-perspective": {\n "type": "string",\n "const": "Enterprise & Capability"\n },\n "cites-product-actors": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "cites-quality-goals": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^(QR|SEC-REQ|PRIV-REQ)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "cites-journeys": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^JRN-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Product journey identifiers (JRN-*) envisioned in this system capability scope."\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^ARCH-INTRO-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^ARCH-INTRO-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5122
+ var SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_MANIFEST_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/compliance/license-manifest.schema.json",\n "title": "Static Dependencies License Manifest Schema",\n "type": "object",\n "required": [\n "evaluated_dependencies"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^(MAN-LIC|LIC-MAN|LIC)-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Optional canonical artifact identifier."\n },\n "type": {\n "type": "string",\n "const": "license-manifest"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+(\\\\.[0-9]+)?(-[0-9A-Za-z.-]+)?$",\n "description": "Manifest format version."\n },\n "schema-version": {\n "type": "string"\n },\n "description": {\n "type": "string"\n },\n "generated_at": {\n "type": "string"\n },\n "evaluated_dependencies": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "object",\n "required": [\n "package",\n "version",\n "spdx_license",\n "status"\n ],\n "properties": {\n "package": {\n "type": "string",\n "minLength": 1\n },\n "version": {\n "type": "string",\n "minLength": 1\n },\n "spdx_license": {\n "type": "string",\n "minLength": 1\n },\n "status": {\n "type": "string",\n "enum": [\n "APPROVED",\n "REJECTED",\n "REVIEW_REQUIRED",\n "COMMERCIAL_APPROVAL_REQUIRED",\n "PENDING"\n ]\n },\n "reason": {\n "type": "string"\n },\n "approved_by": {\n "type": "string"\n }\n },\n "additionalProperties": false\n }\n }\n },\n "additionalProperties": false\n}';
5123
+ var SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_POLICY_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/compliance/license-policy.schema.json",\n "title": "Open Source License Policy Schema",\n "type": "object",\n "required": [\n "version",\n "project",\n "default_action",\n "categories",\n "agent_guardrails",\n "ci_gates"\n ],\n "properties": {\n "version": {\n "type": "string"\n },\n "project": {\n "type": "string"\n },\n "default_action": {\n "type": "string",\n "enum": [\n "ALLOW",\n "DENY",\n "REVIEW_REQUIRED"\n ]\n },\n "categories": {\n "type": "object"\n },\n "agent_guardrails": {\n "type": "object",\n "required": [\n "enforce_pre_check",\n "reject_unknown_licenses"\n ],\n "properties": {\n "enforce_pre_check": {\n "type": "boolean"\n },\n "reject_unknown_licenses": {\n "type": "boolean"\n },\n "auto_reject_categories": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "on_commercial_detected": {\n "type": "object"\n }\n }\n },\n "ci_gates": {\n "type": "object",\n "required": [\n "fail_on_denied",\n "generate_sbom"\n ],\n "properties": {\n "fail_on_denied": {\n "type": "boolean"\n },\n "fail_on_missing_license": {\n "type": "boolean"\n },\n "generate_sbom": {\n "type": "boolean"\n },\n "sbom_format": {\n "type": "string"\n },\n "output_notices_file": {\n "type": "string"\n },\n "allowed_depth": {\n "type": "string",\n "enum": [\n "DIRECT",\n "TRANSITIVE"\n ]\n }\n }\n }\n },\n "additionalProperties": false\n}';
5124
+ var SCHEMA_SCHEMAS_COMPLIANCE_QUALITY_POLICY_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/compliance/quality-policy.schema.json",\n "title": "Software Quality Policy Schema (Polyglot)",\n "type": "object",\n "required": [\n "version",\n "project",\n "enforcement_mode",\n "coding_rules",\n "release_thresholds",\n "agent_guardrails"\n ],\n "properties": {\n "version": {\n "type": "string"\n },\n "project": {\n "type": "string"\n },\n "enforcement_mode": {\n "type": "string",\n "enum": [\n "STRICT",\n "PERMISSIVE"\n ]\n },\n "ratchet_mode": {\n "type": "boolean"\n },\n "scope": {\n "type": "object",\n "properties": {\n "target_directories": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "supported_extensions": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "exclude_patterns": {\n "type": "array",\n "items": {\n "type": "string"\n }\n }\n }\n },\n "language_toolchains": {\n "type": "object"\n },\n "coding_rules": {\n "type": "object",\n "required": [\n "standards",\n "enforce_formatting",\n "rules"\n ],\n "properties": {\n "standards": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "enforce_formatting": {\n "type": "boolean"\n },\n "formatting_engine": {\n "type": "string"\n },\n "linter_engine": {\n "type": "string"\n },\n "rules": {\n "type": "object"\n }\n }\n },\n "release_thresholds": {\n "type": "object",\n "required": [\n "cyclomatic_complexity",\n "cognitive_complexity",\n "maintainability_index",\n "code_duplication",\n "test_coverage"\n ],\n "properties": {\n "cyclomatic_complexity": {\n "type": "object",\n "required": [\n "max_per_function",\n "action_on_breach"\n ],\n "properties": {\n "max_per_function": {\n "type": "integer"\n },\n "warning_at": {\n "type": "integer"\n },\n "action_on_breach": {\n "type": "string"\n }\n }\n },\n "cognitive_complexity": {\n "type": "object",\n "required": [\n "max_per_function",\n "action_on_breach"\n ],\n "properties": {\n "max_per_function": {\n "type": "integer"\n },\n "warning_at": {\n "type": "integer"\n },\n "action_on_breach": {\n "type": "string"\n }\n }\n },\n "maintainability_index": {\n "type": "object",\n "required": [\n "min_acceptable_score",\n "action_on_breach"\n ],\n "properties": {\n "min_acceptable_score": {\n "type": "number"\n },\n "target_score": {\n "type": "number"\n },\n "action_on_breach": {\n "type": "string"\n }\n }\n },\n "code_duplication": {\n "type": "object",\n "required": [\n "max_percentage",\n "action_on_breach"\n ],\n "properties": {\n "max_percentage": {\n "type": "number"\n },\n "action_on_breach": {\n "type": "string"\n }\n }\n },\n "test_coverage": {\n "type": "object",\n "required": [\n "min_line_coverage_percent",\n "action_on_breach"\n ],\n "properties": {\n "min_line_coverage_percent": {\n "type": "number"\n },\n "min_branch_coverage_percent": {\n "type": "number"\n },\n "min_function_coverage_percent": {\n "type": "number"\n },\n "action_on_breach": {\n "type": "string"\n }\n }\n },\n "technical_debt": {\n "type": "object"\n }\n }\n },\n "agent_guardrails": {\n "type": "object",\n "required": [\n "enforce_pre_commit_linter",\n "prevent_suppression_comments"\n ],\n "properties": {\n "enforce_pre_commit_linter": {\n "type": "boolean"\n },\n "prevent_suppression_comments": {\n "type": "boolean"\n },\n "auto_refactor_on_high_complexity": {\n "type": "boolean"\n }\n }\n }\n },\n "additionalProperties": false\n}';
5125
+ var SCHEMA_SCHEMAS_IDE_MCP_CONFIG_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/ide/mcp-config.schema.json",\n "title": "IDE MCP Configuration Schema (Cursor, Antigravity, VS Code)",\n "type": "object",\n "properties": {\n "$schema": {\n "type": "string"\n },\n "id": {\n "type": "string",\n "pattern": "^(MCP-CFG|IDE-MCP|MCP)-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Optional identifier for MCP configuration artifact."\n },\n "type": {\n "type": "string",\n "const": "mcp-config"\n },\n "mcpServers": {\n "type": "object",\n "additionalProperties": {\n "type": "object",\n "required": [\n "command"\n ],\n "properties": {\n "command": {\n "type": "string",\n "minLength": 1\n },\n "args": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "env": {\n "type": "object"\n },\n "disabled": {\n "type": "boolean"\n },\n "alwaysAllow": {\n "type": "array",\n "items": {\n "type": "string"\n }\n }\n },\n "additionalProperties": false\n },\n "description": "MCP server registry format for Cursor and Antigravity."\n },\n "servers": {\n "type": "object",\n "additionalProperties": {\n "type": "object",\n "required": [\n "command"\n ],\n "properties": {\n "command": {\n "type": "string",\n "minLength": 1\n },\n "args": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "env": {\n "type": "object"\n },\n "disabled": {\n "type": "boolean"\n },\n "alwaysAllow": {\n "type": "array",\n "items": {\n "type": "string"\n }\n }\n },\n "additionalProperties": false\n },\n "description": "MCP server registry format for VS Code."\n }\n },\n "additionalProperties": false\n}';
5126
+ var SCHEMA_SCHEMAS_MANUALS_PRODUCTION_MANUAL_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/manuals/production-manual.schema.json",\n "title": "AI-SDLC Production & Operations Manual Schema",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "applies-to-version",\n "target-audience"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^MAN-PROD-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Immutable production manual identifier (e.g. MAN-PROD-SENTINELCORE)."\n },\n "type": {\n "type": "string",\n "const": "production-manual"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Document semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string",\n "description": "Template schema version."\n },\n "title": {\n "type": "string",\n "minLength": 3,\n "description": "Descriptive title of the production manual."\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "applies-to-version": {\n "type": "string",\n "description": "Software version or release this production manual applies to (e.g. v1.0.0)."\n },\n "target-audience": {\n "type": "array",\n "items": {\n "type": "string"\n },\n "minItems": 1,\n "description": "Target technical profiles (e.g. DevOps, SRE, Release Manager, SecOps)."\n },\n "components-covered": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Architecture components (CMP-*) deployed and covered by the manual."\n },\n "enclaves-involved": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Security enclaves (SEC-ENC-*) in which deployment executes."\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^MAN-PROD-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^MAN-PROD-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5127
+ var SCHEMA_SCHEMAS_MANUALS_USER_MANUAL_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/manuals/user-manual.schema.json",\n "title": "AI-SDLC User Manual Schema",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "target-audience",\n "allowed-roles",\n "applies-to-version"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^MAN-USER-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Immutable user manual identifier (e.g. MAN-USER-SENTINELCORE)."\n },\n "type": {\n "type": "string",\n "const": "user-manual"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Document semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string",\n "description": "Template schema version."\n },\n "title": {\n "type": "string",\n "minLength": 3,\n "description": "Descriptive title of the user manual."\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "applies-to-version": {\n "type": "string",\n "description": "Software version or release this manual applies to (e.g. v1.0.0)."\n },\n "target-audience": {\n "type": "array",\n "items": {\n "type": "string"\n },\n "minItems": 1,\n "description": "Target user profiles or roles for the manual."\n },\n "allowed-roles": {\n "type": "array",\n "items": {\n "type": "string"\n },\n "minItems": 1,\n "description": "Formal catalog of authorized roles to operate the application (linked to ACT-*)."\n },\n "journeys-covered": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^JRN-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Product journey identifiers (JRN-*) covered in the manual."\n },\n "use-cases-covered": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Use case identifiers (UC-*) implemented across journeys."\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^MAN-USER-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^MAN-USER-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5128
+ var SCHEMA_SCHEMAS_PRIVACY_DATA_ASSET_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/privacy/data-asset.schema.json",\n "title": "Personal Data Asset & PII Inventory Schema (DATA-ASSET-*)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "classification",\n "pii-categories",\n "data-subjects",\n "retention-period",\n "erasure-method"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "data-asset"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Data asset semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "classification": {\n "type": "string",\n "enum": [\n "public",\n "internal",\n "confidential-pii",\n "special-category-sensitive"\n ],\n "description": "Data sensitivity classification aligned with privacy-policy.yaml."\n },\n "pii-categories": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "enum": [\n "identifiers",\n "contact",\n "authentication",\n "financial",\n "location",\n "behavioral",\n "biometric",\n "health",\n "telemetry-operator"\n ]\n }\n },\n "data-subjects": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Product actors (ACT-*) whose personal data is stored or processed."\n },\n "fields": {\n "type": "array",\n "items": {\n "type": "object",\n "required": [\n "name",\n "sensitivity",\n "masking-strategy"\n ],\n "properties": {\n "name": {\n "type": "string",\n "minLength": 1\n },\n "sensitivity": {\n "type": "string",\n "enum": [\n "public",\n "internal",\n "pii",\n "special-category"\n ]\n },\n "masking-strategy": {\n "type": "string",\n "enum": [\n "none",\n "redact",\n "sha256-salt",\n "tokenize",\n "aes-256-gcm",\n "truncate"\n ]\n }\n },\n "additionalProperties": false\n }\n },\n "retention-period": {\n "type": "string",\n "pattern": "^([0-9]+(d|m|y)|session-only|indefinite-anonymized)$",\n "description": "Maximum retention TTL (e.g. 30d, 12m, 5y, session-only, indefinite-anonymized)."\n },\n "erasure-method": {\n "type": "string",\n "enum": [\n "hard-delete",\n "crypto-shredding",\n "irreversible-anonymization"\n ]\n },\n "owner-bounded-context": {\n "type": "string",\n "pattern": "^(BC|CMP)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5129
+ var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-policy.schema.json",\n "title": "Privacy-by-Design as Code Governance Policy Schema",\n "type": "object",\n "required": [\n "version",\n "project",\n "regulatory_frameworks",\n "default_action",\n "classifications",\n "agent_guardrails",\n "ci_gates"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^(PRIV-POL|POL-PRIV)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "privacy-policy"\n },\n "version": {\n "type": "string",\n "minLength": 1\n },\n "project": {\n "type": "string",\n "minLength": 1\n },\n "regulatory_frameworks": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "enum": [\n "GDPR",\n "LOPDGDD",\n "ISO-27701",\n "CCPA",\n "HIPAA",\n "LGPD"\n ]\n }\n },\n "default_action": {\n "type": "string",\n "enum": [\n "DENY_UNREGISTERED_PII",\n "ALLOW",\n "REVIEW_REQUIRED"\n ]\n },\n "classifications": {\n "type": "object",\n "required": [\n "public",\n "internal",\n "confidential_pii",\n "special_category_sensitive"\n ],\n "additionalProperties": {\n "type": "object",\n "required": [\n "action",\n "encryption_at_rest",\n "encryption_in_transit",\n "allow_in_logs",\n "allow_in_ai_prompts"\n ],\n "properties": {\n "action": {\n "type": "string",\n "enum": [\n "ALLOW",\n "STRICT_GOVERNANCE",\n "DPIA_APPROVAL_REQUIRED",\n "DENY"\n ]\n },\n "description": {\n "type": "string"\n },\n "exception_requires": {\n "type": "string"\n },\n "require_ropa_entry": {\n "type": "boolean"\n },\n "require_dpia_artifact": {\n "type": "boolean"\n },\n "encryption_at_rest": {\n "type": "boolean"\n },\n "encryption_in_transit": {\n "type": "boolean"\n },\n "require_field_level_encryption": {\n "type": "boolean"\n },\n "allow_in_logs": {\n "type": "boolean"\n },\n "log_masking_strategy": {\n "type": "string"\n },\n "allow_in_ai_prompts": {\n "type": "boolean"\n },\n "max_retention_days": {\n "type": "integer",\n "minimum": 1\n },\n "require_right_to_erasure": {\n "type": "boolean"\n }\n },\n "additionalProperties": false\n }\n },\n "cross_border_transfers": {\n "type": "object",\n "properties": {\n "allowed_regions": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "require_scc_for_third_countries": {\n "type": "boolean"\n },\n "approved_subprocessors": {\n "type": "array",\n "items": {\n "type": "string"\n }\n }\n },\n "additionalProperties": false\n },\n "agent_guardrails": {\n "type": "object",\n "required": [\n "forbid_real_pii_in_tests",\n "forbid_pii_in_console_or_logger",\n "require_dto_projection_for_pii"\n ],\n "properties": {\n "forbid_real_pii_in_tests": {\n "type": "boolean"\n },\n "forbid_pii_in_console_or_logger": {\n "type": "boolean"\n },\n "require_dto_projection_for_pii": {\n "type": "boolean"\n },\n "on_special_category_detected": {\n "type": "object",\n "required": [\n "action",\n "notification_tag",\n "message"\n ],\n "properties": {\n "action": {\n "type": "string"\n },\n "notification_tag": {\n "type": "string"\n },\n "message": {\n "type": "string"\n }\n },\n "additionalProperties": false\n }\n },\n "additionalProperties": false\n },\n "ci_gates": {\n "type": "object",\n "required": [\n "fail_on_unregistered_pii",\n "fail_on_pii_in_logs",\n "fail_on_missing_retention_policy",\n "generate_ropa_inventory",\n "output_ropa_file",\n "output_privacy_report"\n ],\n "properties": {\n "fail_on_unregistered_pii": {\n "type": "boolean"\n },\n "fail_on_pii_in_logs": {\n "type": "boolean"\n },\n "fail_on_missing_retention_policy": {\n "type": "boolean"\n },\n "fail_on_unapproved_subprocessor": {\n "type": "boolean"\n },\n "generate_ropa_inventory": {\n "type": "boolean"\n },\n "output_ropa_file": {\n "type": "string"\n },\n "output_privacy_report": {\n "type": "string"\n }\n },\n "additionalProperties": false\n }\n },\n "additionalProperties": false\n}';
5130
+ var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-req.schema.json",\n "title": "Privacy Requirement & Technical Control Schema (PRIV-REQ-*)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "privacy-principle",\n "linddun-category",\n "governs-ropa"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "privacy-requirement"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Privacy requirement semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "privacy-principle": {\n "type": "string",\n "enum": [\n "data-minimization",\n "purpose-limitation",\n "storage-limitation",\n "accuracy",\n "integrity-and-confidentiality",\n "transparency-and-consent",\n "data-subject-rights-arco",\n "pseudonymization-anonymization"\n ]\n },\n "linddun-category": {\n "type": "string",\n "enum": [\n "linkability",\n "identifiability",\n "non-repudiation",\n "detectability",\n "disclosure-of-information",\n "unawareness",\n "non-compliance"\n ],\n "description": "LINDDUN privacy threat category mitigated by this control."\n },\n "governs-ropa": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Upstream ROPA records (PRIV-ROPA-*) governed by this privacy requirement."\n },\n "protects-data-assets": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "enforced-in-enclave": {\n "type": "string",\n "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "compliance-references": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "acceptance-format": {\n "type": "string",\n "enum": [\n "gherkin",\n "declarative-prose"\n ]\n },\n "cucumber-tags": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^@[a-zA-Z0-9_-]+$"\n }\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5131
+ var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-ropa.schema.json",\n "title": "Record of Processing Activities Schema (PRIV-ROPA-* / GDPR Art. 30)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "lawful-basis",\n "processing-purpose",\n "use-cases",\n "data-assets",\n "data-subjects",\n "retention-ttl"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "privacy-ropa"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "ROPA record semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "lawful-basis": {\n "type": "string",\n "enum": [\n "consent",\n "contract",\n "legal-obligation",\n "vital-interests",\n "public-task",\n "legitimate-interests"\n ],\n "description": "Lawful basis for processing under GDPR Art. 6.1."\n },\n "special-category-condition": {\n "type": [\n "string",\n "null"\n ],\n "enum": [\n null,\n "explicit-consent",\n "employment-social-security",\n "vital-interests",\n "public-interest",\n "preventive-medicine",\n "public-health"\n ],\n "description": "GDPR Art. 9.2 condition when processing special category data."\n },\n "processing-purpose": {\n "type": "string",\n "minLength": 10\n },\n "use-cases": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Upstream Use Cases (UC-*) that trigger this data processing activity."\n },\n "data-assets": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Personal Data Assets (DATA-ASSET-*) processed in this activity."\n },\n "data-subjects": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "retention-ttl": {\n "type": "string",\n "pattern": "^([0-9]+(d|m|y)|session-only|indefinite-anonymized)$"\n },\n "cross-border-transfer": {\n "type": "boolean"\n },\n "transfer-safeguards": {\n "type": [\n "string",\n "null"\n ],\n "enum": [\n null,\n "adequacy-decision",\n "scc",\n "bcr",\n "derogation"\n ]\n },\n "subprocessors": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "dpia-required": {\n "type": "boolean"\n },\n "dpia-reference": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^DPIA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "mitigated-by": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Privacy requirements (PRIV-REQ-*) governing and enforcing this processing activity."\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5132
+ var SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/product/actor.schema.json",\n "title": "ProductShape Actor Schema (Versionable)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "role-type"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "actor"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Artifact semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string",\n "description": "Schema specification version used."\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "role-type": {\n "type": "string",\n "enum": [\n "human-user",\n "ai-agent",\n "external-system",\n "sensor-iot"\n ]\n },\n "description": {\n "type": "string"\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Identifier of the actor superseded by this version or artifact."\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Identifier of the new actor superseding this one upon deprecation/retirement."\n }\n },\n "additionalProperties": false\n}';
5133
+ var SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/product/bounded-context.schema.json",\n "title": "Domain-Driven Design (DDD) Bounded Context Schema",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "domain-type",\n "responsibilities"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Immutable Bounded Context identifier (e.g. BC-AI-SDLC-GOVERNANCE)."\n },\n "type": {\n "type": "string",\n "const": "bounded-context"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Bounded context document semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string",\n "description": "Template schema version."\n },\n "title": {\n "type": "string",\n "minLength": 3,\n "description": "Descriptive title of the Bounded Context."\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "domain-type": {\n "type": "string",\n "enum": [\n "core",\n "supporting",\n "generic"\n ],\n "description": "DDD subdomain classification: core differentiator, supporting capability, or generic commodity."\n },\n "strategic-classification": {\n "type": "object",\n "properties": {\n "evolutionary-stage": {\n "type": "string",\n "enum": [\n "genesis",\n "custom-built",\n "product-rental",\n "commodity"\n ]\n },\n "business-model-role": {\n "type": "string",\n "enum": [\n "differentiator",\n "operational",\n "enabler"\n ]\n }\n },\n "additionalProperties": false\n },\n "responsibilities": {\n "type": "array",\n "items": {\n "type": "string",\n "minLength": 3\n },\n "minItems": 1,\n "description": "List of functional boundaries and core domain responsibilities encapsulated within this context."\n },\n "ubiquitous-language-terms": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Ubiquitous language terms (TERM-*) governed within this bounded context."\n },\n "context-mapping": {\n "type": "object",\n "properties": {\n "upstream-dependencies": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "downstream-dependents": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "integration-patterns": {\n "type": "array",\n "items": {\n "type": "object",\n "properties": {\n "pattern": {\n "type": "string"\n },\n "related-context": {\n "type": "string"\n }\n },\n "additionalProperties": false\n }\n }\n },\n "additionalProperties": false\n },\n "components-involved": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Architecture components (CMP-*) implementing this bounded context."\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5134
+ var SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/product/business-rule.schema.json",\n "title": "ProductShape Business Rule Schema (Versionable)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "enforcement-level"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^BR-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "business-rule"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Business rule semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "enforcement-level": {\n "type": "string",\n "enum": [\n "strict-invariant",\n "override-with-approval",\n "guideline"\n ]\n },\n "defined-in": {\n "type": "string",\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "uses-terms": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^BR-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^BR-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5135
+ var SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/product/journey.schema.json",\n "title": "Customer / Operator Journey Schema",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "persona",\n "stages",\n "touchpoints"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^JRN-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "journey"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Journey semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "persona": {\n "type": "string",\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Actor (persona) starring in this journey."\n },\n "stages": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string"\n },\n "description": "Sequential journey stages (e.g. Awareness, Onboarding, Activation, Retention)."\n },\n "touchpoints": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string"\n },\n "description": "Touchpoints between persona and system at each stage."\n },\n "related-use-cases": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "System use cases related to this journey."\n },\n "pain-points": {\n "type": "array",\n "items": {\n "type": "string"\n },\n "description": "Frictions or issues detected along the user journey."\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ]\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ]\n }\n },\n "additionalProperties": false\n}';
5136
+ var SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/product/requirement.schema.json",\n "title": "ProductShape Requirement Schema (Strict Test Validation Enforced)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "category",\n "derives-from",\n "verifiable-by"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^(FR|QR|CON)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "requirement"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Requirement semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "category": {\n "type": "string",\n "enum": [\n "functional",\n "quality",\n "constraint"\n ]\n },\n "derives-from": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^(UC|BR|CON|CAP|GOAL)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Product Traceability: Origin Use Cases, Rules, Constraints, or Capabilities."\n },\n "verifiable-by": {\n "type": "string",\n "enum": [\n "cucumber-bdd",\n "automated-unit-test",\n "integration-test",\n "performance-benchmark",\n "security-audit",\n "inspection"\n ],\n "description": "Mandatory formal verification method."\n },\n "acceptance-format": {\n "type": "string",\n "enum": [\n "gherkin",\n "declarative-prose"\n ],\n "description": "Acceptance criteria format."\n },\n "cucumber-tags": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^@[a-zA-Z0-9_-]+$"\n },\n "description": "Cucumber tags for filtering and executing BDD tests."\n },\n "enforce-bdd-variants": {\n "type": "boolean",\n "description": "When true, enforces all 3 BDD scenario categories (@nominal, @boundary, @invalid)."\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^(FR|QR|CON)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^(FR|QR|CON)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5137
+ var SCHEMA_SCHEMAS_PRODUCT_TERM_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/product/term.schema.json",\n "title": "Domain Glossary Term Schema (Ubiquitous Language)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "definition",\n "bounded-context"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "term"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Term semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 2,\n "description": "Canonical name of the term in the domain ubiquitous language."\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "definition": {\n "type": "string",\n "minLength": 10,\n "description": "Precise and unambiguous definition of the term in the domain context."\n },\n "bounded-context": {\n "type": "string",\n "description": "DDD Bounded Context this term belongs to (e.g. FlightControl, Telemetry, Billing)."\n },\n "synonyms": {\n "type": "array",\n "items": {\n "type": "string"\n },\n "description": "Synonyms or alternative terms used colloquially that map to this canonical term."\n },\n "anti-terms": {\n "type": "array",\n "items": {\n "type": "string"\n },\n "description": "Incorrect or ambiguous terms that MUST NOT be used for this concept."\n },\n "related-terms": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Glossary terms semantically related."\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ]\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ]\n }\n },\n "additionalProperties": false\n}';
5138
+ var SCHEMA_SCHEMAS_PRODUCT_USE_CASE_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/product/use-case.schema.json",\n "title": "ProductShape Use Case Schema (Versionable)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "primary-actor"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "use-case"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Use case semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string",\n "description": "Template schema version."\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "primary-actor": {\n "type": "string",\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "supporting-actors": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "governed-by": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^BR-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "uses-terms": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "in-context": {\n "type": "string",\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "alternative-flows": {\n "type": "array",\n "items": {\n "oneOf": [\n {\n "type": "string",\n "minLength": 1\n },\n {\n "type": "object",\n "properties": {\n "id": {\n "type": "string"\n },\n "name": {\n "type": "string"\n },\n "description": {\n "type": "string"\n }\n },\n "additionalProperties": false\n }\n ]\n },\n "description": "Declared alternative flows that must be covered by tests."\n },\n "exception-flows": {\n "type": "array",\n "items": {\n "oneOf": [\n {\n "type": "string",\n "minLength": 1\n },\n {\n "type": "object",\n "properties": {\n "id": {\n "type": "string"\n },\n "name": {\n "type": "string"\n },\n "description": {\n "type": "string"\n }\n },\n "additionalProperties": false\n }\n ]\n },\n "description": "Declared exception flows that must be covered by tests."\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5139
+ var SCHEMA_SCHEMAS_SAFETY_HAZARD_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/safety/hazard.schema.json",\n "title": "Hazard Schema (Operational Hazard & Safety Risk Analysis)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "severity",\n "probability",\n "fault-tolerance-time-ms",\n "mitigated-by"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^HAZ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "hazard"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Hazard semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "severity": {\n "type": "string",\n "enum": [\n "catastrophic",\n "critical",\n "major",\n "minor",\n "negligible"\n ],\n "description": "Hazard severity per functional safety classification (DO-178C / ISO 26262)."\n },\n "probability": {\n "type": "string",\n "enum": [\n "frequent",\n "probable",\n "occasional",\n "remote",\n "improbable",\n "extremely-improbable"\n ],\n "description": "Probability of operational hazard occurrence."\n },\n "fault-tolerance-time-ms": {\n "type": "number",\n "minimum": 0,\n "description": "Fault tolerance time interval (FTTI) limit in milliseconds before entering safe state."\n },\n "mitigated-by": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^SAF-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Safety requirements mitigating this hazard."\n },\n "hazardous-condition": {\n "type": "string",\n "description": "Description of the dangerous operational condition."\n },\n "potential-effect": {\n "type": "string",\n "description": "Potential effect on people, aircraft, or environment if hazard materializes."\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ]\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ]\n }\n },\n "additionalProperties": false\n}';
5140
+ var SCHEMA_SCHEMAS_SAFETY_SAFETY_REQ_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/safety/safety-req.schema.json",\n "title": "Safety Requirement Schema (Functional Safety & Hazard Mitigation)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "safety-domain",\n "safety-integrity-level",\n "mitigates-hazard",\n "fail-safe-action"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^SAF-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "safety-requirement"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Safety requirement semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "safety-domain": {\n "type": "string",\n "enum": [\n "flight-control",\n "collision-avoidance",\n "energy-management",\n "emergency-recovery",\n "sensor-integrity",\n "propulsion",\n "telemetry"\n ],\n "description": "Operational safety domain."\n },\n "safety-integrity-level": {\n "type": "string",\n "description": "Safety integrity level (e.g. DAL-A..D, ASIL-A..D, SIL-1..4)."\n },\n "mitigates-hazard": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^HAZ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Operational hazards mitigated by safety control."\n },\n "fail-safe-action": {\n "type": "string",\n "description": "Automatic action or contingency maneuver to enter safe state."\n },\n "fault-tolerance-time-ms": {\n "type": "number",\n "description": "Fault tolerance time interval limit in milliseconds (FTTI)."\n },\n "acceptance-format": {\n "type": "string",\n "enum": [\n "gherkin",\n "declarative-prose"\n ]\n },\n "cucumber-tags": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ]\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ]\n }\n },\n "additionalProperties": false\n}';
5141
+ var SCHEMA_SCHEMAS_SDD_DESIGN_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/sdd/design.schema.json",\n "title": "Spec-Driven Development Technical Design Schema (DSG-*)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^(DSG-[A-Z0-9]+(-[A-Z0-9]+)*|CHG-[A-Z0-9]+-DESIGN|[A-Z0-9]+(-[A-Z0-9]+)*)$",\n "description": "Unique identifier of the technical design specification."\n },\n "type": {\n "type": "string",\n "enum": [\n "spec-design",\n "spec-change-design",\n "design"\n ]\n },\n "change-id": {\n "type": "string",\n "pattern": "^(CHG|FEAT|PATCH)-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Parent change identifier associated with this design."\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Semantic versioning (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "handoff": {\n "type": "string",\n "pattern": "^HOF-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Reference to the HOF-* sidecar."\n },\n "architecture-component": {\n "type": "string",\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Associated architecture component."\n },\n "architecture-components": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "List of architecture components covered by this technical design."\n },\n "enclave": {\n "type": "string",\n "pattern": "^(SEC-ENC-)?[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Zero trust security enclave."\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "proposed",\n "review",\n "approved",\n "active",\n "completed",\n "deprecated"\n ]\n },\n "author": {\n "type": "string"\n },\n "date": {\n "type": "string"\n },\n "contracts": {\n "type": "array",\n "description": "Explicit contract interfaces and methods designed for implementation and unit testing.",\n "items": {\n "oneOf": [\n {\n "type": "string",\n "minLength": 1\n },\n {\n "type": "object",\n "required": [\n "methods"\n ],\n "properties": {\n "component": {\n "type": "string"\n },\n "interface": {\n "type": "string"\n },\n "methods": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "minLength": 1\n }\n }\n },\n "additionalProperties": false\n }\n ]\n }\n },\n "citations": {\n "type": "array",\n "items": {\n "type": "object",\n "required": [\n "id"\n ],\n "properties": {\n "id": {\n "type": "string"\n },\n "digest": {\n "type": "string"\n },\n "comment": {\n "type": "string"\n },\n "anchor": {\n "type": "string"\n }\n },\n "additionalProperties": false\n }\n }\n },\n "additionalProperties": false\n}';
5142
+ var SCHEMA_SCHEMAS_SDD_HANDOFF_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/sdd/handoff.schema.json",\n "title": "PDaC Product Handoff Sidecar Schema (HOF-*)",\n "type": "object",\n "required": [\n "id",\n "type",\n "changeId",\n "subgraph"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^HOF-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Immutable identifier emitted by PDaC handoff."\n },\n "type": {\n "type": "string",\n "enum": [\n "handoff",\n "product-handoff"\n ]\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "changeId": {\n "type": "string",\n "pattern": "^(CHG|FEAT)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$"\n },\n "createdAt": {\n "type": "string"\n },\n "subgraph": {\n "type": "object",\n "required": [\n "requirements"\n ],\n "properties": {\n "requirements": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string"\n }\n },\n "useCases": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "businessRules": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "securityRequirements": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "abuseCases": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "privacyRequirements": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "dataAssets": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "privacyRopa": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "actors": {\n "type": "array",\n "items": {\n "type": "string"\n }\n }\n },\n "additionalProperties": true\n },\n "citations": {\n "type": "array",\n "items": {\n "type": "object",\n "required": [\n "id"\n ],\n "properties": {\n "id": {\n "type": "string"\n },\n "digest": {\n "type": "string"\n },\n "anchor": {\n "type": "string"\n },\n "comment": {\n "type": "string"\n }\n }\n }\n }\n },\n "additionalProperties": true\n}';
5143
+ var SCHEMA_SCHEMAS_SDD_PROPOSAL_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/sdd/proposal.schema.json",\n "title": "Spec-Driven Development Change Proposal Schema (CHG-*)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^(CHG|FEAT|PATCH)-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Unique identifier of the change proposal."\n },\n "type": {\n "type": "string",\n "enum": [\n "spec-change-proposal",\n "proposal"\n ]\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "proposed",\n "review",\n "approved",\n "applied",\n "active",\n "completed",\n "rejected"\n ]\n },\n "author": {\n "type": "string"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Semantic versioning (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "date": {\n "type": "string"\n },\n "handoff": {\n "type": "string",\n "description": "Associated handoff sidecar reference."\n },\n "sdd-framework-compat": {\n "type": "array",\n "items": {\n "type": "string"\n },\n "description": "Supported SDD framework adapters."\n },\n "citations": {\n "type": "array",\n "items": {\n "type": "object",\n "required": [\n "id"\n ],\n "properties": {\n "id": {\n "type": "string"\n },\n "digest": {\n "type": "string"\n },\n "comment": {\n "type": "string"\n },\n "anchor": {\n "type": "string"\n }\n },\n "additionalProperties": false\n }\n }\n },\n "additionalProperties": false\n}';
5144
+ var SCHEMA_SCHEMAS_SDD_RELEASE_KPIS_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/sdd/release-kpis.schema.json",\n "title": "Release Consolidated KPIs & Attribution Telemetry Schema",\n "type": "object",\n "required": [\n "releaseBranch",\n "baseBranch",\n "generatedAt",\n "totalCommits",\n "totalLinesAdded",\n "totalLinesDeleted",\n "totalKloc",\n "totalBugs",\n "globalDefectDensity",\n "totalTimeSeconds",\n "totalTokens",\n "totalCostUsd",\n "authorStats",\n "bugList"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^(KPI-REL|REL-KPI)-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Optional artifact identifier."\n },\n "type": {\n "type": "string",\n "const": "release-kpis"\n },\n "releaseBranch": {\n "type": "string"\n },\n "baseBranch": {\n "type": "string"\n },\n "generatedAt": {\n "type": "string"\n },\n "totalCommits": {\n "type": "integer",\n "minimum": 0\n },\n "totalLinesAdded": {\n "type": "integer",\n "minimum": 0\n },\n "totalLinesDeleted": {\n "type": "integer",\n "minimum": 0\n },\n "totalKloc": {\n "type": "number",\n "minimum": 0\n },\n "totalBugs": {\n "type": "integer",\n "minimum": 0\n },\n "globalDefectDensity": {\n "type": "number",\n "minimum": 0\n },\n "totalTimeSeconds": {\n "type": "number",\n "minimum": 0\n },\n "totalTokens": {\n "type": "integer",\n "minimum": 0\n },\n "totalCostUsd": {\n "type": "number",\n "minimum": 0\n },\n "reworkTimeSeconds": {\n "type": "number",\n "minimum": 0\n },\n "reworkTokens": {\n "type": "integer",\n "minimum": 0\n },\n "reworkCostUsd": {\n "type": "number",\n "minimum": 0\n },\n "reworkTimePercent": {\n "type": "number",\n "minimum": 0\n },\n "reworkTokensPercent": {\n "type": "number",\n "minimum": 0\n },\n "reworkCostPercent": {\n "type": "number",\n "minimum": 0\n },\n "authorStats": {\n "type": "array",\n "items": {\n "type": "object",\n "required": [\n "authorOrModel",\n "isAgent",\n "commits",\n "linesAdded",\n "linesDeleted",\n "klocProduced",\n "bugsInjected",\n "defectInjectionRate",\n "totalTimeSeconds",\n "totalTokens",\n "estimatedCostUsd"\n ],\n "properties": {\n "authorOrModel": {\n "type": "string"\n },\n "isAgent": {\n "type": "boolean"\n },\n "commits": {\n "type": "integer",\n "minimum": 0\n },\n "linesAdded": {\n "type": "integer",\n "minimum": 0\n },\n "linesDeleted": {\n "type": "integer",\n "minimum": 0\n },\n "klocProduced": {\n "type": "number",\n "minimum": 0\n },\n "bugsInjected": {\n "type": "integer",\n "minimum": 0\n },\n "defectInjectionRate": {\n "type": "number",\n "minimum": 0\n },\n "totalTimeSeconds": {\n "type": "number",\n "minimum": 0\n },\n "totalTokens": {\n "type": "integer",\n "minimum": 0\n },\n "estimatedCostUsd": {\n "type": "number",\n "minimum": 0\n }\n },\n "additionalProperties": false\n }\n },\n "bugList": {\n "type": "array",\n "items": {\n "type": "object",\n "required": [\n "sha",\n "subject",\n "author",\n "timeSeconds",\n "tokens"\n ],\n "properties": {\n "sha": {\n "type": "string"\n },\n "subject": {\n "type": "string"\n },\n "author": {\n "type": "string"\n },\n "parentRef": {\n "type": "string"\n },\n "timeSeconds": {\n "type": "number",\n "minimum": 0\n },\n "tokens": {\n "type": "integer",\n "minimum": 0\n }\n },\n "additionalProperties": false\n }\n }\n },\n "additionalProperties": false\n}';
5145
+ var SCHEMA_SCHEMAS_SDD_SESSION_TELEMETRY_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/sdd/session-telemetry.schema.json",\n "title": "Agent Session Telemetry Schema (.ai-sdlc/session-telemetry.json)",\n "type": "object",\n "required": [\n "model",\n "promptTokens",\n "completionTokens",\n "activeTimeSeconds"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^(TEL-SES|SES-TEL|TEL)-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Optional telemetry session identifier."\n },\n "type": {\n "type": "string",\n "const": "session-telemetry"\n },\n "model": {\n "type": "string",\n "minLength": 1,\n "description": "AI model name or identifier."\n },\n "promptTokens": {\n "type": "integer",\n "minimum": 0,\n "description": "Total prompt tokens consumed."\n },\n "completionTokens": {\n "type": "integer",\n "minimum": 0,\n "description": "Total completion tokens generated."\n },\n "activeTimeSeconds": {\n "type": "number",\n "minimum": 0,\n "description": "Active session development duration in seconds."\n },\n "author": {\n "type": "string"\n },\n "authorType": {\n "type": "string",\n "enum": [\n "agent",\n "human"\n ]\n },\n "sessionId": {\n "type": "string"\n },\n "timestamp": {\n "type": "string"\n },\n "provider": {\n "type": "string"\n },\n "confidence": {\n "type": "string",\n "enum": [\n "HIGH",\n "MEDIUM",\n "LOW"\n ]\n },\n "source": {\n "type": "string"\n }\n },\n "additionalProperties": false\n}';
5146
+ var SCHEMA_SCHEMAS_SDD_SPEC_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/sdd/spec.schema.json",\n "title": "Spec-Driven Development Delivery Specification Schema (SPEC-*)",\n "type": "object",\n "required": [\n "id",\n "type",\n "change-id"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^SPEC-(CHG|FEAT|PATCH)-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Unique identifier of the delivery specification."\n },\n "type": {\n "type": "string",\n "enum": [\n "delivery-spec",\n "spec"\n ]\n },\n "change-id": {\n "type": "string",\n "pattern": "^(CHG|FEAT|PATCH)-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Parent change identifier associated with this specification."\n },\n "profile": {\n "type": "string",\n "enum": [\n "patch",\n "standard",\n "critical"\n ],\n "description": "Risk and governance profile of the change."\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Semantic versioning (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "handoff": {\n "type": "string",\n "description": "Associated handoff sidecar reference."\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "proposed",\n "review",\n "approved",\n "active",\n "completed",\n "deprecated"\n ]\n },\n "verification": {\n "type": "object",\n "properties": {\n "method": {\n "type": "string"\n },\n "command": {\n "type": "string"\n },\n "target": {\n "type": "string"\n }\n },\n "additionalProperties": true\n },\n "citations": {\n "type": "array",\n "items": {\n "type": "object",\n "required": [\n "id"\n ],\n "properties": {\n "id": {\n "type": "string"\n },\n "digest": {\n "type": "string"\n },\n "comment": {\n "type": "string"\n },\n "anchor": {\n "type": "string"\n }\n },\n "additionalProperties": false\n }\n },\n "acceptance-format": {\n "type": "string",\n "enum": [\n "gherkin"\n ],\n "description": "Formato de aceptaci\xF3n BDD obligatorio para especificaciones de entrega SDD."\n },\n "cucumber-tags": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^@[a-zA-Z0-9_-]+$"\n },\n "description": "Etiquetas de trazabilidad BDD para ejecuci\xF3n con Cucumber."\n },\n "cucumber-feature-file": {\n "type": "string",\n "description": "Ruta personalizada de extracci\xF3n del archivo .feature para Cucumber."\n }\n },\n "additionalProperties": false\n}';
5147
+ var SCHEMA_SCHEMAS_SDD_TASKS_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/sdd/tasks.schema.json",\n "title": "Verifiable Tasks & Human Autonomy Governance Schema",\n "type": "object",\n "required": [\n "id",\n "type",\n "change-id",\n "version",\n "tasks"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^TSK-PLAN-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "task-plan"\n },\n "change-id": {\n "type": "string",\n "pattern": "^(CHG|FEAT)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$"\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 5\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "approved",\n "in-progress",\n "completed",\n "blocked"\n ]\n },\n "governance-summary": {\n "type": "object",\n "properties": {\n "autonomous-tasks-count": {\n "type": "integer",\n "minimum": 0\n },\n "human-review-plan-count": {\n "type": "integer",\n "minimum": 0\n },\n "ambiguous-count": {\n "type": "integer",\n "minimum": 0\n },\n "high-risk-manual-count": {\n "type": "integer",\n "minimum": 0\n }\n }\n },\n "tasks": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "object",\n "required": [\n "id",\n "title",\n "complexity",\n "risk-level",\n "autonomy-mode",\n "verification",\n "assigned-to",\n "status"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^TSK-[0-9]{3,}$"\n },\n "title": {\n "type": "string",\n "minLength": 5\n },\n "complexity": {\n "type": "string",\n "enum": [\n "LOW",\n "MEDIUM",\n "HIGH"\n ]\n },\n "risk-level": {\n "type": "string",\n "enum": [\n "LOW",\n "MEDIUM",\n "HIGH",\n "CRITICAL"\n ]\n },\n "autonomy-mode": {\n "type": "string",\n "enum": [\n "AUTONOMOUS",\n "HUMAN_REVIEW_PLAN",\n "AMBIGUOUS",\n "HIGH_RISK_MANUAL"\n ],\n "description": "AI agent human governance and supervision mode."\n },\n "verification": {\n "type": "object",\n "required": [\n "method",\n "command-or-criteria"\n ],\n "properties": {\n "method": {\n "type": "string",\n "enum": [\n "automated-unit-test",\n "cucumber-bdd",\n "quality-gate",\n "license-audit",\n "sast-scan",\n "privacy-audit",\n "manual-inspection",\n "smoke-test"\n ]\n },\n "command-or-criteria": {\n "type": "string",\n "minLength": 5\n }\n }\n },\n "assigned-to": {\n "type": "string",\n "enum": [\n "agent-developer",\n "agent-security-auditor",\n "agent-compliance-checker",\n "agent-privacy-officer",\n "agent-qa",\n "human-engineer",\n "human-architect",\n "pair-human-agent"\n ]\n },\n "status": {\n "type": "string",\n "enum": [\n "PENDING",\n "IN_PROGRESS",\n "COMPLETED",\n "BLOCKED"\n ]\n },\n "blocking-reason": {\n "type": "string"\n },\n "implements-components": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Architecture components (CMP-*) implemented by this atomic task."\n },\n "satisfies-requirements": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^(FR|QR|CON|SEC-REQ|SAF-REQ|PRIV-REQ)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Requirements satisfied by this atomic task."\n },\n "implements-contracts": {\n "type": "array",\n "items": {\n "type": "string",\n "minLength": 1\n },\n "description": "Explicit interface or method contracts from design.md implemented by this task."\n }\n },\n "additionalProperties": false\n }\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ]\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ]\n }\n },\n "additionalProperties": false\n}';
5148
+ var SCHEMA_SCHEMAS_SECURITY_ABUSE_CASE_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/security/abuse-case.schema.json",\n "title": "Abuse Case Schema (Versionable)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "primary-threat-actor",\n "targets-use-case",\n "stride-category",\n "mitigated-by"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^ABUSE-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "abuse-case"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Abuse case semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "primary-threat-actor": {\n "type": "string",\n "pattern": "^ACT-THREAT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "targets-use-case": {\n "type": "string",\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "stride-category": {\n "type": "string",\n "enum": [\n "spoofing",\n "tampering",\n "repudiation",\n "information-disclosure",\n "denial-of-service",\n "elevation-of-privilege"\n ]\n },\n "mitigated-by": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^SEC-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "asvs-controls": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^ABUSE-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^ABUSE-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5149
+ var SCHEMA_SCHEMAS_SECURITY_ENCLAVE_SCHEMA_JSON = `{
5150
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
5151
+ "$id": "https://ai-sdlc.org/schemas/security/enclave.schema.json",
5152
+ "title": "Security Enclave Schema (Zero Trust Architecture Boundary)",
5153
+ "type": "object",
5154
+ "required": [
5155
+ "id",
5156
+ "type",
5157
+ "title",
5158
+ "status",
5159
+ "version",
5160
+ "trust-zone",
5161
+ "perimeter-rules",
5162
+ "allowed-inbound",
5163
+ "allowed-outbound"
5164
+ ],
5165
+ "properties": {
5166
+ "id": {
5167
+ "type": "string",
5168
+ "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$"
5169
+ },
5170
+ "type": {
5171
+ "type": "string",
5172
+ "const": "security-enclave"
5173
+ },
5174
+ "version": {
5175
+ "type": "string",
5176
+ "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",
5177
+ "description": "Security enclave semantic version (SemVer)."
5178
+ },
5179
+ "schema-version": {
5180
+ "type": "string"
5181
+ },
5182
+ "title": {
5183
+ "type": "string",
5184
+ "minLength": 3
5185
+ },
5186
+ "status": {
5187
+ "type": "string",
5188
+ "enum": [
5189
+ "draft",
5190
+ "active",
5191
+ "deprecated",
5192
+ "retired"
5193
+ ]
5194
+ },
5195
+ "trust-zone": {
5196
+ "type": "string",
5197
+ "enum": [
5198
+ "untrusted",
5199
+ "semi-trusted",
5200
+ "trusted",
5201
+ "highly-trusted",
5202
+ "dmz",
5203
+ "zero-trust-boundary"
5204
+ ],
5205
+ "description": "Zero Trust confidence zone assigned to enclave."
5206
+ },
5207
+ "trust-level": {
5208
+ "type": "string",
5209
+ "description": "Descriptive Zero Trust confidence level."
5210
+ },
5211
+ "isolation": {
5212
+ "type": "string",
5213
+ "description": "Technical perimeter isolation mechanism."
5214
+ },
5215
+ "perimeter-rules": {
5216
+ "type": "array",
5217
+ "minItems": 1,
5218
+ "items": {
5219
+ "type": "string"
5220
+ },
5221
+ "description": "Perimeter rules defining enclave security boundary (e.g. mTLS, IP allowlist)."
5222
+ },
5223
+ "allowed-inbound": {
5224
+ "type": "array",
5225
+ "items": {
5226
+ "type": "string",
5227
+ "pattern": "^(CMP|SEC-ENC)-[A-Z0-9]+(-[A-Z0-9]+)*$"
5228
+ },
5229
+ "description": "Components or enclaves authorized to initiate inbound connections."
5230
+ },
5231
+ "allowed-outbound": {
5232
+ "type": "array",
5233
+ "items": {
5234
+ "type": "string",
5235
+ "pattern": "^(CMP|SEC-ENC)-[A-Z0-9]+(-[A-Z0-9]+)*$"
5236
+ },
5237
+ "description": "Components or enclaves this enclave can connect to."
5238
+ },
5239
+ "enforced-by": {
5240
+ "type": "array",
5241
+ "items": {
5242
+ "type": "string",
5243
+ "pattern": "^SEC-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"
5244
+ },
5245
+ "description": "Security requirements enforcing this enclave's rules."
5246
+ },
5247
+ "authentication-mechanism": {
5248
+ "type": "string",
5249
+ "enum": [
5250
+ "mtls",
5251
+ "jwt",
5252
+ "api-key",
5253
+ "oauth2",
5254
+ "none"
5255
+ ],
5256
+ "description": "Authentication mechanism required at enclave perimeter."
5257
+ },
5258
+ "supersedes": {
5259
+ "type": [
5260
+ "string",
5261
+ "null"
5262
+ ]
5263
+ },
5264
+ "superseded-by": {
5265
+ "type": [
5266
+ "string",
5267
+ "null"
5268
+ ]
5269
+ }
5270
+ },
5271
+ "additionalProperties": false
5272
+ }`;
5273
+ var SCHEMA_SCHEMAS_SECURITY_SECURITY_REQ_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/security/security-req.schema.json",\n "title": "Security Requirement Schema (Strict Test Validation Enforced)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "security-domain",\n "mitigates-abuse-case"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^SEC-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "security-requirement"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Security requirement semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "security-domain": {\n "type": "string",\n "enum": [\n "authentication",\n "authorization",\n "cryptography",\n "input-validation",\n "audit-logging",\n "communication-security",\n "data-protection"\n ]\n },\n "mitigates-abuse-case": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^ABUSE-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Product/Security Traceability: Abuse case or threat this control neutralizes."\n },\n "enforced-in-enclave": {\n "type": "string",\n "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Architecture Traceability: Perimeter or internal security enclave."\n },\n "compliance-references": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "acceptance-format": {\n "type": "string",\n "enum": [\n "gherkin",\n "declarative-prose"\n ],\n "description": "Mitigation criteria format."\n },\n "cucumber-tags": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^@[a-zA-Z0-9_-]+$"\n }\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^SEC-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^SEC-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5274
+ var SCHEMA_SCHEMAS_SECURITY_THREAT_ACTOR_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/security/threat-actor.schema.json",\n "title": "Threat Actor Schema (Versionable)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "threat-capability",\n "motivation"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^ACT-THREAT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "threat-actor"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Threat profile semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "deprecated",\n "retired"\n ]\n },\n "threat-capability": {\n "type": "string",\n "enum": [\n "script-kiddie",\n "advanced-persistent-threat",\n "insider-threat",\n "automated-botnet",\n "supply-chain-attacker"\n ]\n },\n "motivation": {\n "type": "string",\n "enum": [\n "financial-gain",\n "espionage",\n "sabotage",\n "data-theft",\n "reputational-damage"\n ]\n },\n "attack-surfaces": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "supersedes": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^ACT-THREAT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": [\n "string",\n "null"\n ],\n "pattern": "^ACT-THREAT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}';
5275
+ var SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/workflow/agent-handoff.schema.json",\n "title": "Agent Workflow Handoff Block Schema",\n "type": "object",\n "required": [\n "id",\n "type",\n "completed-phase",\n "acting-role",\n "autonomy-mode",\n "deliverables",\n "suggested-prompt"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^(AHOF|HOF-WORKFLOW|HOF)-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Unique workflow handoff identifier."\n },\n "type": {\n "type": "string",\n "const": "agent-handoff"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Semantic versioning (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "status": {\n "type": "string",\n "enum": [\n "draft",\n "active",\n "completed",\n "transferred"\n ]\n },\n "completed-phase": {\n "type": "string",\n "minLength": 2,\n "description": "Name of the completed lifecycle phase or activity."\n },\n "acting-role": {\n "type": "string",\n "enum": [\n "agent-product-analyst",\n "agent-threat-modeler",\n "agent-privacy-officer",\n "agent-system-architect",\n "agent-qa-engineer",\n "agent-developer",\n "agent-expert-user",\n "agent-security-auditor",\n "agent-compliance-checker",\n "agent-code-reviewer",\n "agent-devops",\n "human-dev",\n "tech-lead",\n "release-manager",\n "dpo"\n ],\n "description": "Specialized role executing the handoff."\n },\n "autonomy-mode": {\n "type": "string",\n "enum": [\n "AUTONOMOUS",\n "HUMAN_REVIEW_PLAN",\n "AMBIGUOUS",\n "HIGH_RISK_MANUAL"\n ],\n "description": "Autonomy level under which the task was executed."\n },\n "deliverables": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string"\n },\n "description": "Paths or IDs of artifacts produced during the phase."\n },\n "recommended-next-roles": {\n "type": "array",\n "items": {\n "type": "object",\n "required": [\n "role",\n "rationale"\n ],\n "properties": {\n "role": {\n "type": "string"\n },\n "rationale": {\n "type": "string"\n }\n },\n "additionalProperties": false\n },\n "description": "Recommended downstream specialist roles and technical justifications."\n },\n "suggested-prompt": {\n "type": "string",\n "minLength": 5,\n "description": "Suggested invocation prompt to initiate the next agent."\n },\n "human-action-window": {\n "type": "object",\n "properties": {\n "review-and-validate": {\n "type": "boolean"\n },\n "edit-directly": {\n "type": "boolean"\n },\n "pause-or-divert": {\n "type": "boolean"\n },\n "delegate": {\n "type": "boolean"\n }\n },\n "additionalProperties": false,\n "description": "Actions available to the human engineer within the sovereign action window."\n }\n },\n "additionalProperties": false\n}';
5050
5276
  var STARTER_SCHEMAS_MAP = {
5051
5277
  "schemas/architecture/adr.schema.json": JSON.parse(SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON),
5052
5278
  "schemas/architecture/component.schema.json": JSON.parse(SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON),
@@ -6601,11 +6827,13 @@ function sanitizeDlpPayload(payload, policy = createDefaultDlpPolicy()) {
6601
6827
  // src/adapters/sdd/review-report.ts
6602
6828
  var REVIEW_VERDICTS = ["COMPLIANT", "SUGGESTIONS", "BLOCKING"];
6603
6829
  var REVIEWER_ROLES = [
6830
+ "agent-auditor",
6831
+ "agent-adversary",
6832
+ "agent-privacy-officer",
6833
+ "agent-expert-user",
6604
6834
  "agent-code-reviewer",
6605
6835
  "agent-security-auditor",
6606
6836
  "agent-compliance-checker",
6607
- "agent-privacy-officer",
6608
- "agent-expert-user",
6609
6837
  "auditor",
6610
6838
  "reviewer"
6611
6839
  ];
@@ -18572,7 +18800,7 @@ var SPECIALIZED_AGENT_TEMPLATES = [
18572
18800
 
18573
18801
  ## Phase 0: Greenfield Product Inception (New Product Intent)
18574
18802
  - **Trigger**: When the user expresses intent to create a new product from scratch with the framework (or when \`specs/product/\` has no baseline product model yet), initiate **Phase 0** before any SDD change (\`change:new\`) or implementation:
18575
- 1. **Iterative Discovery Interview (Up to 15 Questions or Until Product is Crystal Clear)**: Conduct an iterative discovery interview (up to 15 questions, grouped logically in conversational rounds until zero product ambiguities remain) before drafting specs, clarifying: (a) core problem and mission statement, (b) primary actors/stakeholders (\`ACT-*\`), authentication/role model, and **target user interface modality** (e.g., Web UI, Desktop GUI, Console/TUI/CLI, Mobile app, or headless API/SDK), (c) **modern visual aesthetic & styling standard** (Bootstrap 5-style clean responsive web design with cards/tables/badges, Fluent/modern desktop aesthetic with rounded corners/elevated panels, or colorized rich terminal console with ANSI palettes/status badges), (d) **User Journeys (\`JRN-*\`) to generate** \u2014 asking in plain, non-technical language which end-to-end user workflows to model and explicitly guiding the user on the 5 pieces of information needed to build each journey properly: *(1) Who is the protagonist user (\`persona\` / \`ACT-*\`) and their main goal, (2) What are the step-by-step stages from start to finish (\`stages\`), (3) Which screens, channels, or interfaces the user interacts with at each step (\`touchpoints\`), (4) What current obstacles, frustrations, or risks they face (\`pain-points\`), and (5) Which concrete actions or capabilities the system must provide along the journey (\`related-use-cases\` / \`UC-*\`)*, (e) foundational master entities/catalogs and CRUD flows required to operate the system, (f) essential MVP capabilities/use cases (\`UC-*\`) and business rules/invariants (\`BR-*\`) vs. future roadmap, and (g) top 3\u20135 priority quality goals and constraints (\`QR-*\`, \`CON-*\`). Do not proceed to draft artifacts until the product scope is completely clear.
18803
+ 1. **Iterative Discovery Interview (Up to 15 Questions or Until Product is Crystal Clear)**: Conduct an iterative discovery interview (up to 15 questions, grouped logically in conversational rounds until zero product ambiguities remain) before drafting specs, clarifying: (a) core problem and mission statement, (b) primary actors/stakeholders (\`ACT-*\`), authentication/role model, and **target user interface modality** (e.g., Web UI, Desktop GUI, Console/TUI/CLI, Mobile app, or headless API/SDK), (c) **modern visual aesthetic & styling standard** (Bootstrap 5-style clean responsive web design with cards/tables/badges, Fluent/modern desktop aesthetic with rounded corners/elevated panels, or colorized rich terminal console with ANSI palettes/status badges), (d) **delivery & operation model** (in plain business terms: Cloud SaaS, Self-Hosted/On-Premise, Local Desktop/CLI binary, or Library/SDK package, plus any data-residency or SLA constraints), (e) **User Journeys (\`JRN-*\`) to generate** \u2014 asking in plain, non-technical language which end-to-end user workflows to model and explicitly guiding the user on the 5 pieces of information needed to build each journey properly: *(1) Who is the protagonist user (\`persona\` / \`ACT-*\`) and their main goal, (2) What are the step-by-step stages from start to finish (\`stages\`), (3) Which screens, channels, or interfaces the user interacts with at each step (\`touchpoints\`), (4) What current obstacles, frustrations, or risks they face (\`pain-points\`), and (5) Which concrete actions or capabilities the system must provide along the journey (\`related-use-cases\` / \`UC-*\`)*, (f) foundational master entities/catalogs and CRUD flows required to operate the system, (g) essential MVP capabilities/use cases (\`UC-*\`) and business rules/invariants (\`BR-*\`) vs. future roadmap, and (h) top 3\u20135 priority quality goals and constraints (\`QR-*\`, \`CON-*\`). Do not proceed to draft artifacts until the product scope is completely clear.
18576
18804
  2. **Enterprise & Capability Vision (\`ARCH-INTRO-001\`)**: Draft the root vision artifact (\`type: architecture-introduction\`, \`naf-perspective: "Enterprise & Capability"\`, \`status: draft\`) using \`templates/architecture/introduction-and-goals.template.md\` (\`schemas/architecture/introduction-and-goals.schema.json\`), explicitly recording the agreed UI/interaction modality.
18577
18805
  3. **ProductShape Derivation**: Derive the initial draft artifacts (\`ACT-*\`, \`JRN-*\`, \`UC-*\`, \`BR-*\`, \`FR-*\`, \`QR-*\` with \`status: draft\`) in \`specs/product/\` linked to \`ARCH-INTRO-001\` for human Product Owner review.
18578
18806
  4. **Mandatory End-to-End Presentation Interface & Master Data Prerequisite Rule (ANTI-LIBRARY-ONLY MVP)**: Whenever primary actors (\`ACT-*\`) are human users, the MVP ProductShape baseline MUST include: (a) an explicit presentation/interaction requirement (\`FR-*\`) or vertical UI/CLI acceptance criteria matching the modality agreed in Step 1 (Web UI, Desktop GUI, or Console/TUI/CLI \u2014 never proposing a library-only/in-memory MVP without a runnable entry point), (b) user authentication/session access when multi-role actors exist, and (c) CRUD/configuration flows for foundational master entities (e.g., rooms, staff, students, catalogs) required to operate the core business flows without manual database intervention.
@@ -18660,10 +18888,11 @@ var SPECIALIZED_AGENT_TEMPLATES = [
18660
18888
  - **Contract-First Full-Stack Integration**: Whenever a feature or change spans Frontend (UI) and Backend (API/services), define an explicit shared typed contract (Zod schemas, shared TypeScript DTOs, or OpenAPI specification) in \`design.md\` before implementation so both layers compile against a single source of truth.
18661
18889
  - **No Orphan Presentation Components (\`CMP-WEB-*\` / \`CMP-UI-*\` / \`CMP-CLI-*\`)**: When modeling architecture for a system with human actors (\`ACT-*\`), never leave the agreed presentation/driving adapter (Web UI, Desktop GUI, or Console/CLI) as an unmapped \`proposed\` spec while scheduling only backend class-library tasks in \`tasks.md\`. Wave 0 (\`CHG-001\`) MUST bootstrap the runnable presentation host shell matching the modality defined in Inception, and every subsequent \`CHG-*\` for a human-facing \`UC-*\` must include tasks (\`TSK-*\`) implementing its corresponding views/screens/commands and E2E tests as a complete vertical slice.
18662
18890
  - Generate interaction and sequence diagrams in native Mermaid syntax.
18891
+ - **Deployment Topology (\`ARCH-DEP-001\`)**: Translate the product delivery and operation model recorded in \`ARCH-INTRO-001\` / \`CON-*\` into an arc42 Section 7 Deployment View (\`templates/architecture/deployment-view.template.md\`) mapping components (\`CMP-*\`) to execution nodes (\`RES-*\`) and network enclaves (\`SEC-ENC-*\`).
18663
18892
  - Document critical technological decisions using immutable \`ADR-*\` records conforming to \`schemas/architecture/adr.schema.json\`.
18664
18893
  - Validate that architectural choices comply with legal constraints in \`license-policy.yaml\` and data protection constraints in \`privacy-policy.yaml\`.
18665
18894
  - **Technical Security & Privacy Feedback Loop**: If architectural decisions (databases, queues, distributed caching, third-party APIs, LLM providers, authentication schemes) introduce new attack vectors or PII data flows, emit a return handoff to \`agent-threat-modeler\` (which chains to \`agent-privacy-officer\`) for technical modeling prior to the testing phase.
18666
- - **Mandatory Observability Component (\`CMP-OBSERVABILITY\`)**: In every system architecture modeled under arc42/NAF v4, the system architect MUST define an explicit building block \`CMP-OBSERVABILITY\` (Level 2/3) in Section 5 alongside Section 8 Cross-Cutting Concepts (\`ARCH-CROSS-*\`) and an immutable ADR for Runtime Observability, standardizing on: (1) Structured JSON logging with configurable granularity (\`LOG_LEVEL\`), (2) Distributed tracing via OpenTelemetry with W3C Trace Context (\`traceparent\`), and (3) Operational metrics (RED: Rate, Errors, Duration) in Prometheus / OpenMetrics format for Grafana scraping, satisfying \`QR-OBS-*\`.
18895
+ - **Mandatory Observability Component (\`CMP-OBSERVABILITY\`)**: In every system architecture modeled under arc42/NAF v4, the system architect MUST define an explicit building block \`CMP-OBSERVABILITY\` (Level 2/3) in Section 5 alongside Section 8 Cross-Cutting Concepts (\`ARCH-CROSS-*\`) and an immutable ADR for Runtime Observability, standardizing on: (1) Structured JSON logging with configurable granularity (\`LOG_LEVEL\`), (2) Distributed tracing via OpenTelemetry with W3C Trace Context (\`traceparent\`), (3) Operational metrics (RED: Rate, Errors, Duration) in Prometheus / OpenMetrics format, (4) Persistent local telemetry storage (\`OBS_STORAGE_PATH\`, default \`.observability/\` JSONL/OTLP/SQLite) with guaranteed shutdown \`flush()\`, and (5) An offline query/export port (\`ITelemetryExporter\`) plus optional Prometheus & Grafana stack (\`docker-compose.observability.yml\`) for deferred post-mortem or live visualization, satisfying \`QR-OBS-*\`.
18667
18896
  - If autonomy is $\\ge$ \`HUMAN_REVIEW_PLAN\`, conclude by emitting the Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) suggesting \`agent-qa-engineer\` (or \`agent-threat-modeler\` if technical security/privacy loop is required) and opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
18668
18897
  },
18669
18898
  {
@@ -18694,7 +18923,11 @@ var SPECIALIZED_AGENT_TEMPLATES = [
18694
18923
  - **Zero-Mock Integration Rule**: When an \`FR-*\` spans UI and Backend, unit tests mocking \`fetch\`/HTTP in isolation are insufficient; include integration/contract or E2E test scenarios verifying real request/response wiring and UI state transitions (\`Loading\`, \`Empty\`, \`Error\`, \`Nominal\`).
18695
18924
  - Tag all scenarios with \`@<FR-ID> @automated @regression\`.
18696
18925
  - **STRICTLY FORBIDDEN**: Including production code, suggesting implementation, or anticipating technical solutions.
18697
- - Run \`pnpm run verify:testing\` before emitting handoff.
18926
+ - **MANDATORY DETERMINISTIC GHERKIN ENGINES**:
18927
+ 1. **NEVER** author or edit \`.feature\` files in \`tests/features/\` manually, and **NEVER** write boilerplate BDD step definition files in \`tests/steps/\` from scratch.
18928
+ 2. Always author Gherkin scenarios inside the \`\`\`gherkin blocks of the specification Markdown (\`FR-*\`, \`SEC-REQ-*\`, \`PRIV-REQ-*\`, \`spec.md\`) and run \`npx aisdlc gherkin extract\` (or \`npx aisdlc check --fix\`) to deterministically generate \`.feature\` files.
18929
+ 3. Always run \`npx aisdlc gherkin scaffold <feature-file> --lang <ts|py|go|rs|cs> --fallback\` (or without \`--fallback\` when native generator is installed and approved) to deterministically scaffold RED step definition skeletons in \`tests/steps/\`. Implement assertions inside those generated step files and add any extra unit/integration/E2E/UI suites in \`tests/unit/\`, \`tests/e2e/\`, etc.
18930
+ - Run \`npx aisdlc verify gherkin\` and \`pnpm run verify:testing\` before emitting handoff.
18698
18931
  - If autonomy is $\\ge$ \`HUMAN_REVIEW_PLAN\`, conclude by emitting the Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) suggesting \`agent-developer\` and opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
18699
18932
  },
18700
18933
  {
@@ -18708,16 +18941,17 @@ var SPECIALIZED_AGENT_TEMPLATES = [
18708
18941
  - **Role**: High-Precision Software Developer / Coder Agent (\`agent-developer\`).
18709
18942
  - **Mission**: Implement atomic tasks from SDD specifications (\`tasks.md\`) delivering clean, strictly typed, and tested code.
18710
18943
 
18711
- ## Mandatory 4-Step Implementation Order
18944
+ ## Mandatory 5-Step Implementation Order
18712
18945
  Execute every implementation task following this strict sequential order:
18713
18946
  1. **Modular & Hexagonal Architecture (Ports & Adapters) Definition / Redefinition**: Define or refine the module structure organized by Bounded Context (\`BC-*\`) or Vertical Slice (\`UC-*\`) adhering to Hexagonal Architecture (Ports & Adapters \u2014 isolating the pure Domain/Application Core from Inbound/Outbound Adapters and Frameworks/Drivers), strictly enforcing the Dependency Rule (dependencies point inward toward the Core; avoid speculative empty layers per YAGNI).
18714
18947
  2. **Inter-Module Interfaces First**: Define explicit interfaces/ports (contracts, DTOs, types) for all interactions across module boundaries before writing concrete logic, avoiding direct coupling between modules.
18715
18948
  3. **Component Implementation**: Implement the concrete components, use cases, and adapters that implement and consume the defined interfaces.
18716
- 4. **Exhaustive Per-Function Unit Testing**: Write unit tests for every function in \`tests/unit/\`, always verifying:
18949
+ 4. **Exhaustive Per-Method & Per-Function Unit Testing**: Write direct unit tests in \`tests/unit/\` for **every** method and function implemented in \`src/\` (domain, application, adapter, and helper methods \u2014 zero exceptions), always verifying:
18717
18950
  - **Happy Path**: nominal execution with valid inputs.
18718
18951
  - **Sad Path**: controlled error paths, rejections, and business exceptions.
18719
18952
  - **Boundary Values**: minimum, maximum, exact limits, and off-by-one edges.
18720
18953
  - **Unexpected, Null & Empty Values**: \`null\`, \`undefined\`, empty strings/arrays/objects, and malformed inputs.
18954
+ 5. **Exhaustive Per-Component UI / Driving-Adapter Testing (Web, Desktop, Console/TUI & Mobile)**: For **every** UI component, view, window, screen, dialog, or interactive console/TUI command created or modified in \`src/\`, write or update a dedicated automated UI/E2E test in \`tests/e2e/\`, \`tests/ui/\`, \`tests/desktop/\`, \`tests/mobile/\`, or \`tests/cli/\` using the agreed platform runner (Playwright/Cypress for Web; FlaUI/Avalonia.Headless/pytest-qt for Desktop; Spectre.Console.Testing/node-pty/CliRunner/teatest for Console/TUI; Maestro/Appium/Detox/Espresso/XCUITest for Mobile), verifying all 4 UI states (\`Loading\`, \`Empty\`, \`Error\`, \`Nominal\`) and every interactive control (Happy Path, Sad Path, Boundary Values).
18721
18955
 
18722
18956
  ## Operational Directives & Guardrails
18723
18957
  - Respect the autonomy mode assigned to each task in \`tasks.md\` (\`AUTONOMOUS\`, \`HUMAN_REVIEW_PLAN\`, \`AMBIGUOUS\`, \`HIGH_RISK_MANUAL\`).
@@ -18732,49 +18966,14 @@ Execute every implementation task following this strict sequential order:
18732
18966
  - **Console / TUI**: Produce rich, modern terminal output with ANSI colors, status badges, formatted tables, and progress indicators (e.g., Spectre.Console, Rich, Ink, or Chalk/Picocolors) instead of plain uncolored text dumps.
18733
18967
  - **Skills-First Implementation Directive**: When authoring or refactoring code (especially frontend, UI, styling, accessibility, or framework-specific logic), proactively inspect and leverage available specialized agent skills (e.g., modern web guidance, accessibility a11y, DevTools, framework skills) to produce standard-compliant, modern implementations rather than guessing ad-hoc patterns.
18734
18968
  - **Live Runtime Smoke Verification**: For tasks touching UI or UI-to-Backend integration, unit tests alone are insufficient. Before emitting handoff, boot the real Backend and Frontend servers and verify (via Playwright E2E or Chrome DevTools MCP) that browser \`console.error\` and \`pageerror\` counts are \`0\` and API calls return real \`2xx\` responses without CORS or schema mismatches.
18735
- - **Mandatory Structured Logging & Observability**: Never emit unstructured console logs (\`console.log\`) in production code (\`no_console_logs_in_prod\`). Integrate the structured logger (\`ILogger\`) with configurable \`LOG_LEVEL\`, propagate W3C distributed trace context (\`trace_id\`), and record RED operational metrics compatible with Prometheus and Grafana.
18969
+ - **Mandatory Structured Logging & Persistent Observability**: Never emit unstructured console logs (\`console.log\`) in production code (\`no_console_logs_in_prod\`). Integrate \`ILogger\` (configurable \`LOG_LEVEL\`), \`ITracer\` (W3C \`trace_id\`/\`traceparent\`), and \`IMetricsRegistry\` (Prometheus RED metrics) backed by persistent local sinks (\`OBS_STORAGE_PATH\`, default \`.observability/\`) with PII redaction (\`[REDACTED]\`) before persistence, guaranteed shutdown \`flush()\`, and offline export via \`ITelemetryExporter\`.
18736
18970
  - Before adding any external dependency, verify its SPDX license is permitted in \`license-policy.yaml\`.
18737
18971
  - Respect non-negotiable \`quality-policy.yaml\` thresholds: Cyclomatic Complexity $\\le 10$, Cognitive Complexity $\\le 15$, Maintainability Index $\\ge 50$, Function Length $\\le 40$ lines.
18738
18972
  - Run unified pre-flight with auto-fix (\`pnpm run check:fix\`) and full verification (\`pnpm run verify:all\`).
18739
18973
  - **Mandatory Regression Verification**: Never declare build, typecheck, or bug fixes complete without executing the relevant automated test suite (\`pnpm test\`, \`dotnet test\`) and confirming zero regressions.
18740
18974
  - **Global Styles Protection**: When touching or refactoring frontend views, verify that global stylesheet/asset imports remain intact and that layouts suffer no visual disruption.
18741
18975
  - **Skills-First Implementation Directive**: When authoring or refactoring code (especially frontend, UI, styling, accessibility, or framework-specific logic), proactively inspect and leverage available specialized agent skills (e.g., modern web guidance, accessibility a11y, DevTools, framework skills) to produce standard-compliant, modern implementations rather than guessing ad-hoc patterns.
18742
- - Upon completing green implementation, suggest handoff to \`agent-expert-user\` for Post-Development Functional Validation prior to security and privacy audit.`
18743
- },
18744
- {
18745
- id: "agent-security-auditor",
18746
- title: "Adversarial Code Auditor",
18747
- description: "Examine Pull Requests and source code with an attacker mindset for business logic vulnerabilities, injection vectors, secret leaks, and authorization flaws.",
18748
- globs: "src/**, packages/**, security/**",
18749
- claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
18750
- antigravityTools: ["read_file", "run_command", "call_mcp_tool"],
18751
- body: `## Role & Mission
18752
- - **Role**: Adversarial Security Auditor Agent (\`agent-security-auditor\`).
18753
- - **Mission**: Rigorously examine Pull Requests and code diffs for business logic vulnerabilities, injection vectors, secret leaks, and authorization flaws as part of the Pre-Merge Audit Triad.
18754
-
18755
- ## Operational Directives & Guardrails
18756
- - Analyze code diffs with an attacker mindset: How can an unauthenticated user bypass this check? Are there info leaks in exceptions? Is command, SQL, path traversal, or prompt injection possible?
18757
- - Run deterministic security verification: \`pnpm run verify:security\` (secrets + shift-left SAST).
18758
- - Issue a formal audit report with CVSS v3.1 severity scoring and concrete remediation proposals.
18759
- - Immediately block any PR introducing CRITICAL or HIGH security risks.
18760
- - If autonomy is $\\ge$ \`HUMAN_REVIEW_PLAN\`, conclude by emitting the Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) to the human Tech Lead, opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
18761
- },
18762
- {
18763
- id: "agent-compliance-checker",
18764
- title: "Open Source License Compliance Auditor",
18765
- description: "Audit dependency manifests and SBOMs against license-policy.yaml to block viral copyleft licenses and flag commercial license requirements.",
18766
- globs: "package.json, pnpm-lock.yaml, license-policy.yaml, compliance/**",
18767
- claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
18768
- antigravityTools: ["read_file", "run_command", "call_mcp_tool"],
18769
- body: `## Role & Mission
18770
- - **Role**: Open Source License and Intellectual Property Compliance Auditor Agent (\`agent-compliance-checker\`).
18771
- - **Mission**: Audit dependency manifests and ensure every direct and transitive third-party package complies with \`license-policy.yaml\` as part of the Pre-Merge Audit Triad.
18772
-
18773
- ## Operational Directives & Guardrails
18774
- - Verify SPDX identifiers for every direct and transitive dependency via \`pnpm run verify:licenses\`.
18775
- - Immediately block viral copyleft licenses (\`GPL-*\`, \`AGPL-*\`) and unknown/unlicensed packages.
18776
- - If source-available or commercial licenses (\`BSL-1.1\`, \`SSPL-1.0\`) are detected, flag with \`COMMERCIAL_APPROVAL_REQUIRED\` and draft a request using \`templates/compliance/commercial-acquisition-request.template.md\`.
18777
- - If autonomy is $\\ge$ \`HUMAN_REVIEW_PLAN\`, conclude by emitting the Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) to the human Tech Lead or Legal counsel, opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
18976
+ - Upon completing green implementation, suggest handoff to \`agent-expert-user\` for Post-Development Functional Validation prior to Checkpoint 2 (\`agent-auditor\` $\\parallel$ \`agent-adversary\` + \`agent-privacy-officer\`).`
18778
18977
  },
18779
18978
  {
18780
18979
  id: "agent-expert-user",
@@ -18793,28 +18992,7 @@ Execute every implementation task following this strict sequential order:
18793
18992
  - **FORBIDDEN Library-Only MVP for Human Actors**: Whenever primary actors (\`ACT-*\`) are human users, verify that the target interaction modality (Web UI, Desktop GUI, Console/TUI/CLI, or Mobile) was explicitly defined in \`ARCH-INTRO-*\` / \`specs/product/\`, and reject as \`[BLOCKING_DEFECT]\` any MVP proposal that defers the agreed presentation layer, role authentication (when applicable), or foundational master-entity CRUDs (e.g., creating rooms, teachers, students, schedules) to post-MVP or leaves the system operable only via unit tests/in-memory calls. An MVP for human operators must be end-to-end usable from day one via its agreed interface.
18794
18993
  2. **Functional Validation Mode (Downstream / Pre-PR / Post-Development Functional Validation)**: Inspect \`agent-developer\` deliverables once unit tests pass green by executing the real application (via Playwright or Chrome DevTools MCP when UI is present). Contrast actual UI, CLI, and API behavior against approved \`UC-*\` and \`FR-*\` criteria, verifying real Backend connectivity, the 4 UI usability states (\`Loading\`, \`Empty\`, \`Error\`, \`Nominal\`), keyboard/ARIA accessibility, modern visual appearance (Bootstrap 5-style clean layouts for Web, modern styled panels for Desktop, or colorized rich terminal formatting for Console), and \`0\` browser \`console.error\` / network failures.
18795
18994
  - Formulate decisive questions under \`open-questions\` for the human Product Owner.
18796
- - Emit handoff block suggesting the Pre-Merge Audit Triad (\`agent-code-reviewer\`, \`agent-security-auditor\`, \`agent-privacy-officer\`, \`agent-compliance-checker\`) if compliant, or return to \`agent-developer\` on functional drift, unstyled interfaces, or fake-wiring.`
18797
- },
18798
- {
18799
- id: "agent-code-reviewer",
18800
- title: "Technical and Architectural Code Reviewer",
18801
- description: "Audit Pull Requests for Clean Code, SOLID, DRY, YAGNI, design patterns, and compliance with quality-policy.yaml complexity and maintainability thresholds.",
18802
- globs: "src/**, packages/**, tests/**",
18803
- claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
18804
- antigravityTools: ["read_file", "run_command", "call_mcp_tool"],
18805
- body: `## Role & Mission
18806
- - **Role**: Technical and Architectural Code Reviewer Agent (\`agent-code-reviewer\`).
18807
- - **Mission**: Audit Pull Requests evaluating code cleanliness, adherence to SOLID, DRY, YAGNI principles, design patterns, and compliance with complexity and maintainability thresholds (\`quality-policy.yaml\`), forming part of the Pre-Merge Audit Triad.
18808
-
18809
- ## Operational Directives & Guardrails
18810
- - Analyze code diffs against \`quality-policy.yaml\` standards: Cyclomatic Complexity $\\le 10$, Cognitive Complexity $\\le 15$, Maintainability Index $\\ge 50$, Lines per Function $\\le 40$.
18811
- - Detect improper coupling, code smells, magic numbers, ambiguous identifiers, and encapsulation breaches.
18812
- - Flag premature abstractions and speculative code violating YAGNI.
18813
- - **Block Fake-Wiring & Disconnected UI**: Flag as \`[BLOCKING]\` any production UI component containing hardcoded mock data (\`mockData\`), empty event handlers (\`onClick={() => {}}\`), missing error/loading state handling, or API calls bypassing shared contracts.
18814
- - **Block Unstyled & Non-Compliant Interfaces**: Flag as \`[BLOCKING]\` any web view lacking responsive grid and standard styling classes (such as Bootstrap 5 or project design tokens), any desktop window using raw unstyled legacy controls, or any interactive console tool emitting raw monochrome dumps without colorized badges or structured formatting. Also verify that inline manual styles (\`style="..."\`) are not used to bypass design systems.
18815
- - Coordinate Pre-Merge Audit Triad with \`agent-security-auditor\`, \`agent-privacy-officer\`, and \`agent-compliance-checker\`.
18816
- - Categorize findings into: \`[BLOCKING]\` (quality violation or broken pattern), \`[CLEAN_CODE_SUGGESTION]\` (non-blocking improvement), and \`[COMPLIANT]\`.
18817
- - If autonomy is $\\ge$ \`HUMAN_REVIEW_PLAN\`, conclude by emitting the Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) to the human Tech Lead for final approval and merge, opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
18995
+ - Emit handoff block suggesting Checkpoint 2 (\`agent-auditor\` $\\parallel$ \`agent-adversary\` + \`agent-privacy-officer\`) if compliant, or return to \`agent-developer\` on functional drift, unstyled interfaces, or fake-wiring.`
18818
18996
  },
18819
18997
  {
18820
18998
  id: "agent-devops",
@@ -18822,7 +19000,7 @@ Execute every implementation task following this strict sequential order:
18822
19000
  description: "Maintain, evolve, and audit CI/CD workflows, Dockerfiles, IaC manifests, and support scripts under strict non-invasion guardrails on src/.",
18823
19001
  globs: ".github/workflows/**, templates/ci/**, scripts/**, Dockerfile*",
18824
19002
  claudeTools: ["View", "Edit", "Replace", "GlobTool", "GrepTool", "LS", "Bash"],
18825
- antigravityTools: ["read_file", "edit_file", "write_file", "run_command", "call_mcp_tool"],
19003
+ antigravityTools: ["read_file", "edit_file", "write_file", "run_command", "call_mcp_tool", "ask_question"],
18826
19004
  body: `## Role & Mission
18827
19005
  - **Role**: DevOps and Infrastructure as Code (IaC) Engineer Agent (\`agent-devops\`).
18828
19006
  - **Mission**: Maintain, evolve, and audit automated project infrastructure: CI/CD workflows, Docker containers, deployment manifests, and infrastructure scripts.
@@ -18830,7 +19008,9 @@ Execute every implementation task following this strict sequential order:
18830
19008
  ## Operational Directives & Guardrails
18831
19009
  - **Strict Infrastructure Domain**: Operate exclusively on workflows (\`.github/workflows/\`, \`templates/ci/\`), container files (\`Dockerfile*\`, \`docker-compose*.yml\`), IaC manifests, and support scripts (\`scripts/\`).
18832
19010
  - **NON-INVASION GUARDRAIL**: STRICTLY FORBIDDEN from modifying or refactoring application source code files (\`src/\`, \`packages/*/src/\`). Your responsibility is pipelines and scaffolding, never business logic.
19011
+ - **Deployment & CI/CD Strategy Discovery**: Before scaffolding new pipelines or deployment manifests (e.g., Wave 0 Greenfield or Legacy CI integration), read \`ARCH-INTRO-001\` / \`ARCH-DEP-001\` and clarify with the human Tech Lead: (1) target packaging & CD destination (CI-only Quality Gates, Docker/OCI image to GHCR, package registry \`npm\`/\`NuGet\`/\`PyPI\`/GitHub Releases, or PaaS/Cloud/K8s), (2) CI/CD platform (GitHub Actions, GitLab CI, Azure Pipelines), and (3) release trigger policy (on push to \`main\` vs. manual SemVer tag \`vX.Y.Z\`).
18833
19012
  - **Infrastructure Dependency Policy**: Verify licenses of dependencies, Docker base images, and third-party CI actions against \`license-policy.yaml\`.
19013
+ - **Optional Observability Stack (Prometheus & Grafana)**: When scaffolding project infrastructure, provide an optional \`docker-compose.observability.yml\` (from \`templates/ci/docker-compose.observability.yml\`) with Prometheus (\`Apache-2.0\`) and Grafana (isolated as an optional visualization container with zero application code coupling per \`license-policy.yaml\`) mounting \`.observability/\` for both live scraping and offline/post-mortem visualization.
18834
19014
  - **Gate Preservation**: Ensure any pipeline optimization keeps all existing deterministic Quality Gates intact.
18835
19015
  - **Cross-Workflow Audit**: When fixing any CI/CD or configuration defect detected in a PR, search all \`.github/workflows/*.yml\` for the same pattern (including release, post-merge, and publishing pipelines) before declaring the fix complete.
18836
19016
  - **Remote Verification**: Creating a PR (\`gh pr create\`) does not equal success; actively verify that remote checks pass (\`gh pr checks\`).
@@ -18839,18 +19019,23 @@ Execute every implementation task following this strict sequential order:
18839
19019
  {
18840
19020
  id: "agent-auditor",
18841
19021
  title: "Transversal Quality and Improvement Auditor",
18842
- description: "Polymorphically inspect deliverables from any AI-SDLC specialist agent on demand, identifying structural weaknesses, overengineering, or blind spots, and proposing concrete, minimal solutions adhering strictly to YAGNI.",
19022
+ description: "Polymorphically inspect deliverables from any AI-SDLC specialist agent on demand, enforcing Clean Code, SOLID, DRY, YAGNI, AST thresholds, UI design standards, and SPDX license compliance.",
18843
19023
  globs: "**/*",
18844
19024
  claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
18845
19025
  antigravityTools: ["read_file", "run_command", "call_mcp_tool", "ask_question"],
18846
19026
  body: `## Role & Mission
18847
19027
  - **Role**: Transversal Quality and Constructive Auditor Agent (\`agent-auditor\`).
18848
- - **Mission**: Inspect the output deliverables of any upstream specialist agent upon demand across any phase, identifying structural weaknesses, premature abstractions, overengineering, or blind spots, and proposing concrete, minimal, and standard solutions adhering strictly to Simplicity First (YAGNI).
19028
+ - **Mission**: Inspect the output deliverables of any upstream specialist agent upon demand across any phase, identifying structural weaknesses, premature abstractions, overengineering, or blind spots, and enforcing Clean Code, SOLID, DRY, Simplicity First (YAGNI), \`quality-policy.yaml\` AST thresholds, and \`license-policy.yaml\` SPDX compliance.
18849
19029
 
18850
19030
  ## Operational Directives & Guardrails
18851
19031
  - **Polymorphic On-Demand Scope**: May be invoked over deliverables from any role (\`agent-product-analyst\`, \`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-qa-engineer\`, \`agent-developer\`, \`agent-devops\`).
18852
- - **Simplicity First (YAGNI)**: Actively challenge speculative parameters, redundant interfaces, unused design patterns, and unrequested flexibility.
19032
+ - **Simplicity First (YAGNI) & Code Quality**: Actively challenge speculative parameters, redundant interfaces, unused design patterns, and unrequested flexibility. In code reviews (Checkpoint 2 / Legacy), enforce \`quality-policy.yaml\` thresholds (Cyclomatic Complexity $\\le 10$, Cognitive Complexity $\\le 15$, Maintainability Index $\\ge 50$, Lines per Function $\\le 40$) and Clean Code / SOLID / DRY principles.
19033
+ - **Block Fake-Wiring & Unstyled Interfaces**: Flag as \`[BLOCKING_DEFECT]\` any production UI component containing hardcoded mock data (\`mockData\`), empty event handlers (\`onClick={() => {}}\`), missing \`Loading\`/\`Empty\`/\`Error\` states, or API calls bypassing shared contracts. Also **Block Unstyled & Non-Compliant Interfaces**: flag as \`[BLOCKING_DEFECT]\` any web view lacking responsive grid and standard styling classes (such as Bootstrap 5 or project design tokens), any desktop window using raw unstyled legacy controls, any interactive console tool emitting raw monochrome dumps, or inline \`style="..."\` bypassing design systems.
19034
+ - **1:1 Method Unit Test & UI Component Test Enforcement**: Flag as \`[BLOCKING_DEFECT]\` any method or function in \`src/\` lacking a corresponding unit test in \`tests/unit/\`, and any Web, Desktop, Console/TUI, or Mobile UI component lacking a dedicated automated UI/E2E test in \`tests/e2e/\` or \`tests/ui/\` (using Playwright, FlaUI, Maestro/Appium/Detox, Spectre.Console.Testing/node-pty, or equivalent agreed platform runner).
18853
19035
  - **End-to-End MVP Completeness Check (Anti-Library-Only Drift)**: When auditing Product (\`specs/product/\`), Architecture (\`specs/architecture/\`), or SDD change plans (\`design.md\`, \`tasks.md\`) involving human actors (\`ACT-*\`), flag as \`[BLOCKING_DEFECT]\` any scope cut that fails to define the target user interface modality at Inception or omits the runnable driving adapter (Web UI, Desktop GUI, or Console/CLI), role access/auth (when applicable), or master-data CRUD flows required to operate the use case end-to-end without manual database manipulation.
19036
+ - **Deterministic Gherkin Engine Enforcement**: Flag as \`[BLOCKING_DEFECT]\` any \`.feature\` file in \`tests/features/\` authored manually outside \`aisdlc gherkin extract\` or any missing step definition file in \`tests/steps/\` not scaffolded via \`aisdlc gherkin scaffold\`.
19037
+ - **Persistent Observability Verification**: Flag as \`[BLOCKING_DEFECT]\` any \`CMP-OBSERVABILITY\` implementation that emits only ephemeral \`stdout\`/RAM telemetry without persistent local storage (\`OBS_STORAGE_PATH\`), shutdown \`flush()\`, or offline export (\`ITelemetryExporter\`).
19038
+ - **License & Dependency Compliance**: Verify dependency manifests via \`pnpm run verify:licenses\` (\`npx aisdlc verify licenses\`), blocking viral copyleft licenses (\`GPL-*\`, \`AGPL-*\`) or unapproved commercial licenses (\`BSL-*\`, \`SSPL-*\`) against \`license-policy.yaml\`.
18854
19039
  - **Classification of Findings**: Label every finding as:
18855
19040
  * \`[BLOCKING_DEFECT]\`: Critical omission, structural debt, or standard violation that must be resolved.
18856
19041
  * \`[SIMPLIFICATION]\`: Opportunity to remove unneeded complexity or reduce code/spec surface without loss of function.
@@ -18862,20 +19047,20 @@ Execute every implementation task following this strict sequential order:
18862
19047
  {
18863
19048
  id: "agent-adversary",
18864
19049
  title: "Transversal Red Team and Chaos Adversary",
18865
- description: "Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps for every discovered failure mode.",
19050
+ description: "Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, auditing diffs for security vulnerabilities (CVSS v3.1) and providing concrete proofs-of-concept (PoC).",
18866
19051
  globs: "**/*",
18867
19052
  claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
18868
19053
  antigravityTools: ["read_file", "run_command", "call_mcp_tool", "ask_question"],
18869
19054
  body: `## Role & Mission
18870
19055
  - **Role**: Transversal Red Team and Stress Adversary Agent (\`agent-adversary\`).
18871
- - **Mission**: Actively attempt to break, bypass, or invalidate the deliverables of any target specialist agent across any phase, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps for every discovered failure mode.
19056
+ - **Mission**: Actively attempt to break, bypass, or invalidate the deliverables of any target specialist agent across any phase (including Pre-Merge / Checkpoint 2 security diff audits), providing concrete proofs-of-concept (PoC), counterexamples, CVSS v3.1 severity scoring, and reproduction steps for every discovered failure mode.
18872
19057
 
18873
19058
  ## Operational Directives & Guardrails
18874
19059
  - **Polymorphic On-Demand Scope**:
18875
19060
  * **Product**: Uncover contradictory requirements, unreachable business states, and logic traps.
18876
19061
  * **Architecture**: Simulate race conditions, cascading failures, resource exhaustion, and single points of failure (SPOFs).
18877
19062
  * **QA**: Perform conceptual mutation testing; demonstrate how flawed or empty implementations could falsely pass tests green.
18878
- * **Development**: Attack boundary inputs, concurrency race triggers, and memory/type edge breaks.
19063
+ * **Development & Pre-Merge Security Audit**: Attack boundary inputs, concurrency race triggers, memory/type edge breaks, injection vectors (SQL, XSS, command, path traversal, prompt injection), secret leaks, and authorization bypasses. Run \`pnpm run verify:security\` (\`npx aisdlc verify security\`), score findings with **CVSS v3.1**, and block any PR introducing \`CRITICAL\` or \`HIGH\` security risks.
18879
19064
  * **DevOps**: Probe pipeline isolation, credential boundaries, and cold-start/dependency outages.
18880
19065
  - **MANDATORY PROOF-OF-BREAK**: Abstract criticism without reproducible proof is strictly forbidden. Every finding must include: (1) Target Entity ID, (2) Failure Scenario / Attack Vector, (3) Concrete PoC (input vector, sequence breakdown, or mutant code), and (4) Expected Impact.
18881
19066
  - **NON-INVASIVE GUARDRAIL**: You do NOT patch the vulnerabilities or bugs yourself.
@@ -18953,7 +19138,7 @@ var LIFECYCLE_SKILL_TEMPLATES = [
18953
19138
  description: "Orchestrate end-to-end AI-SDLC onboarding and Phase 0 Inception for brand-new (Greenfield) projects, from repository initialization (aisdlc init) and NAF v4 Vision (ARCH-INTRO-*) through ProductShape, STRIDE Threat Modeling, arc42 Architecture, 2-checkpoint transversal auditor/adversary verification, and topological wave SDD delivery.",
18954
19139
  references: "[`process/02_product_definition.md`](../../process/02_product_definition.md), [`process/04b_data_protection_and_privacy.md`](../../process/04b_data_protection_and_privacy.md), [`process/05_architecture_arc42_nafv4.md`](../../process/05_architecture_arc42_nafv4.md), [`process/06_spec_driven_development.md`](../../process/06_spec_driven_development.md), and [`process/09_agent_protocols.md`](../../process/09_agent_protocols.md).",
18955
19140
  globs: "product/**, specs/product/**, architecture/**, templates/**",
18956
- body: '## Purpose & Trigger\nUse this skill when starting a **brand-new software project from scratch (Greenfield)** or when `specs/product/` has no canonical baseline yet. It coordinates the sequential execution of AI-SDLC MCP/CLI tools and specialized role agents so no code is written before product vision, security enclaves, privacy-by-design controls, and architecture contracts exist.\n\n## Consolidated Inception Quality & Adversarial Checkpoint\nAcross Phase 0 and Inception, quality auditing and adversarial stress-testing are concentrated at the completion of Inception design (or after product shaping):\n- **Concurrent Inspection**: Concurrently invoke [`agent-auditor`](../agent-auditor/SKILL.md) (evaluating YAGNI, structural debt, and simplification) and [`agent-adversary`](../agent-adversary/SKILL.md) (stress-testing logic traps, SPOFs, attack vectors, or broken invariants) in clean, isolated context windows.\n- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.\n- **Consolidated Remediation**: Consolidate findings and emit the Workflow Handoff back to authoring agents to resolve blocking defects and apply simplifications (max 2 correction rounds).\n- **Anti-Ping-Pong Guardrail**: Bounded strictly to maximum **1 correction round**. If non-blocking advisories remain, proceed to the downstream phase; if blocking defects persist, escalate immediately to the Human Tech Lead.\n\n## End-to-End Execution Playbook\n\n### Step 1: Repository Turnkey Initialization\n1. If the workspace has not been initialized with AI-SDLC schemas, policies, and templates, run MCP tool `new` (or CLI `npx @aisdlc/cli init`).\n2. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n3. Verify `quality-policy.yaml`, `license-policy.yaml`, and `privacy-policy.yaml` are present in the repository root.\n\n### Step 2: Phase 0 Product Inception (`agent-product-analyst`)\n1. Delegate to or adopt [`agent-product-analyst`](../agent-product-analyst/SKILL.md).\n2. **Iterative Discovery Interview (Up to 15 Questions or Until Product Scope is 100% Clear)**: Before generating artifacts, clarify with the human Product Owner in rounds of 3\u20135 questions:\n - Core mission statement and business problem.\n - Primary actors (`ACT-*`) and external systems.\n - **Target Interaction & Presentation Modality (`CON-*` / `ARCH-INTRO-001`)**: Explicitly define at inception how human actors will interact with the MVP (e.g., **Web UI**, **Desktop GUI**, **Interactive Console/TUI/CLI**, **Mobile App**, or **Headless API/SDK** if actors are exclusively external systems). Never assume a headless class library when human actors exist.\n - **Modern Aesthetic & Design System Standard (`CON-UI-*` / `ARCH-INTRO-001`)**: Explicitly define a modern, visually attractive styling standard adapted to the chosen presentation modality: (1) **Web UI**: modern responsive layouts using Bootstrap 5 utility classes and components (`card`, `table table-hover`, `badge`, `alert alert-*`, responsive grid) or modern equivalents, (2) **Desktop GUI**: modern clean design (rounded corners, elevated panels, padding, consistent typography) avoiding raw legacy unstyled windows, (3) **Console / TUI**: rich terminal interface with ANSI colors, status badges, formatted tables, and progress indicators (e.g., Spectre.Console, Rich, Ink, or Chalk/Picocolors).\n - **User Journeys (`JRN-*`) to Generate (Plain-Language Elicitation)**: Ask in simple, everyday language which end-to-end user journeys to model, explicitly indicating the 5 pieces of information needed to build each journey properly: (1) protagonist user (`persona` / `ACT-*`) and their main goal, (2) step-by-step stages from start to finish (`stages`), (3) interaction screens/channels at each stage (`touchpoints`), (4) current obstacles or pain points (`pain-points`), and (5) concrete system capabilities/use cases (`related-use-cases` / `UC-*`).\n - Essential MVP capabilities (`UC-*`) vs. future roadmap, ensuring **foundational entity CRUD / master data workflows** are explicitly included in the MVP.\n - Top 3\u20135 quality goals (`QR-*`) and regulatory/technical constraints (`CON-*`).\n3. **Enterprise & Capability Vision**: Create `specs/architecture/ARCH-INTRO-001.md` (`status: draft`, `naf-perspective: "Enterprise & Capability"`) using `templates/architecture/introduction-and-goals.template.md`, explicitly recording the chosen presentation/UI modality.\n4. **ProductShape Baseline**: Derive initial draft artifacts in `specs/product/`:\n - Actors (`ACT-*`), User Journeys (`JRN-*`), Use Cases (`UC-*`), Business Rules (`BR-*`), Functional Requirements (`FR-*` with mandatory `@nominal`, `@boundary`, `@invalid` Gherkin blocks), and Quality Requirements (`QR-*`).\n - **Vertical Slice Completeness Rule**: Every human-triggered `UC-*` in the MVP must specify observable user interaction through the agreed presentation modality and state persistence.\n5. Validate schemas and duplicates via MCP tools `verify_schemas` and `verify_duplicates` (or `npx aisdlc check --fix`).\n6. **Mandatory Upstream UX & MVP Boundary Gate (`agent-expert-user`)**: Invoke [`agent-expert-user`](../agent-expert-user/SKILL.md) in **Design Mode** to stress-test the proposed workflows, enforce strict MVP boundaries, reject any headless/library-only MVP when human actors exist, verify master-data CRUD prerequisites, and separate core MVP `UC-*` from future roadmap backlog.\n\n### Step 3: Shift-Left Cybersecurity & Privacy-by-Design (`agent-threat-modeler` \u2794 `agent-privacy-officer`)\n1. Delegate to or adopt [`agent-threat-modeler`](../agent-threat-modeler/SKILL.md).\n2. Analyze every `UC-*` and `FR-*` using STRIDE and OWASP ASVS to create in `specs/security/`:\n - Threat Actors (`ACT-THREAT-*`), Abuse Cases (`ABUSE-*` targeting `UC-*`), and Security Requirements (`SEC-REQ-*` with `@security @mitigation` negative Gherkin scenarios and `SEC-ENC-*` Zero Trust enclave bindings).\n3. Hand off to [`agent-privacy-officer`](../agent-privacy-officer/SKILL.md) to apply LINDDUN and GDPR/LOPDGDD/ISO 27701 in `specs/privacy/`:\n - Personal Data Assets (`DATA-ASSET-*`), GDPR Art. 30 Records of Processing (`PRIV-ROPA-*`), and Privacy Requirements (`PRIV-REQ-*` with `@privacy @gdpr` Gherkin scenarios).\n4. Run `verify_schemas` and `verify_privacy` (`npx aisdlc verify privacy`).\n\n### Step 4: Modular Systems Architecture (`agent-system-architect`)\n1. Delegate to or adopt [`agent-system-architect`](../agent-system-architect/SKILL.md).\n2. Define building blocks (`CMP-*`) and Architectural Decision Records (`ADR-*`) in `specs/architecture/` using `templates/architecture/`, ensuring every `CMP-*` cites `implements-use-cases` (`UC-*`) and `satisfies-requirements` (`FR-*`, `QR-*`, `SEC-REQ-*`, `PRIV-REQ-*`).\n3. Inspect third-party stack choices against `license-policy.yaml` via `verify_licenses` and subprocessors against `privacy-policy.yaml` via `verify_privacy`.\n4. **Technical Security & Privacy Feedback Loop**: If new infrastructure, persistence, LLM, or auth decisions introduce attack vectors or PII flows, return to `agent-threat-modeler` \u2794 `agent-privacy-officer` to add technical mitigations before coding.\n\n### Checkpoint 1 (Inception Design Checkpoint): `agent-auditor` $\\parallel$ `agent-adversary`\n1. Concurrently invoke `agent-auditor` (evaluating YAGNI, architecture bloat, interface contracts) and `agent-adversary` (simulating SPOFs, race conditions, unhandled threat scenarios) in isolated context windows over all Phase 0 deliverables.\n2. Consolidate findings and remediate in authoring agents (max 2 correction rounds).\n3. **Human Approval Gate**: Present the comprehensive Inception model for Human PO & Tech Lead sign-off.\n\n### Step 5: Release Milestone & Topological Wave SDD Plan (`1 UC-* = 1 CHG-*`)\n1. **Open Release Milestone (`Tier 2: release/v1.0.0` or Streamlined `main`)**: Group approved MVP Use Cases (`UC-001`, `UC-002`, ...) and visualize execution plan.\n2. **Decompose into Topological Waves (DAG Parallelism)**:\n - **Wave 0 \u2014 Foundational Core & Executable Presentation Host (Sequential)**: Scaffold `CHG-001` via [`aisdlc-increment`](../aisdlc-increment/SKILL.md) to establish domain core, shared contracts, auth/config, and the runnable presentation host.\n - **Waves 1..N \u2014 Orthogonal End-to-End Vertical Slices (Parallel Multi-Agent)**: Once Wave 0 contracts are merged, execute independent `CHG-*` increments (`1 UC-* = 1 CHG-*`) in parallel across isolated branches/worktrees (`feat/CHG-002`, `feat/CHG-003`, ...).\n3. **Release Consolidation**: Once all MVP increments are integrated (`sdd_integrate`), run `verify` (`npx aisdlc verify all`), generate SBOM, compute release KPIs (`kpi_release`), and open the Release PR for final human approval and SemVer tagging (`v1.0.0`).\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. Always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk.\n- **2-Checkpoint Quality & Adversarial Protocol**: Quality auditing and adversarial testing are concentrated at the completion of Inception design and Pre-PR implementation, avoiding micro-step overhead.\n- **FORBIDDEN Library-Only MVP for Human-Facing Products**: Whenever a product defines human actors (`ACT-*`), no agent may scope the MVP as headless class libraries without an executable presentation host.\n- **FORBIDDEN Greenfield Monolith (`1 UC-* = 1 CHG-*`)**: Never bundle the entire product or multiple `UC-*` into a single SDD change (`CHG-001`). Parallelism is achieved by running **multiple bounded `CHG-*` concurrently** on separate branches/worktrees.\n- Never invoke `sdd_change_new` or write application code in `src/` on a Greenfield project before `ARCH-INTRO-001`, `agent-expert-user` MVP validation, and at least one `UC-*` and `FR-*` exist.\n- All newly drafted specifications must start with `status: draft`.'
19141
+ body: '## Purpose & Trigger\nUse this skill when starting a **brand-new software project from scratch (Greenfield)** or when `specs/product/` has no canonical baseline yet. It coordinates the sequential execution of AI-SDLC MCP/CLI tools and specialized role agents so no code is written before product vision, security enclaves, privacy-by-design controls, and architecture contracts exist.\n\n## Consolidated Inception Quality & Adversarial Checkpoint\nAcross Phase 0 and Inception, quality auditing and adversarial stress-testing are concentrated at the completion of Inception design (or after product shaping):\n- **Concurrent Inspection**: Concurrently invoke [`agent-auditor`](../agent-auditor/SKILL.md) (evaluating YAGNI, structural debt, and simplification) and [`agent-adversary`](../agent-adversary/SKILL.md) (stress-testing logic traps, SPOFs, attack vectors, or broken invariants) in clean, isolated context windows.\n- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.\n- **Consolidated Remediation**: Consolidate findings and emit the Workflow Handoff back to authoring agents to resolve blocking defects and apply simplifications (max 2 correction rounds).\n- **Anti-Ping-Pong Guardrail**: Bounded strictly to maximum **1 correction round**. If non-blocking advisories remain, proceed to the downstream phase; if blocking defects persist, escalate immediately to the Human Tech Lead.\n\n## End-to-End Execution Playbook\n\n### Step 1: Branch-Before-Change & Repository Turnkey Initialization\n1. **Branch-Before-Change**: Verify the active branch (`git branch --show-current`). If currently on a protected branch (`main`, `master`, `release/*`), create and switch to an inception branch (e.g., `feat/inception-baseline` or `chore/aisdlc-inception`) **before** modifying or creating any files.\n2. If the workspace has not been initialized with AI-SDLC schemas, policies, and templates, run MCP tool `new` (or CLI `npx @aisdlc/cli init`).\n3. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n4. Verify `quality-policy.yaml`, `license-policy.yaml`, and `privacy-policy.yaml` are present in the repository root.\n5. Commit initial scaffolding, push (`git push -u origin <branch>`), and open a **Draft PR** (`gh pr create --draft`, with graceful fallback if no remote or CLI auth exists) so all Phase 0 Inception artifacts (`ARCH-INTRO-001`, ProductShape, Threat/Privacy, Architecture) are pushed incrementally to the Draft PR.\n\n### Step 2: Phase 0 Product Inception (`agent-product-analyst`)\n1. Delegate to or adopt [`agent-product-analyst`](../agent-product-analyst/SKILL.md).\n2. **Iterative Discovery Interview (Up to 15 Questions or Until Product Scope is 100% Clear)**: Before generating artifacts, clarify with the human Product Owner in rounds of 3\u20135 questions:\n - Core mission statement and business problem.\n - Primary actors (`ACT-*`) and external systems.\n - **Target Interaction & Presentation Modality (`CON-*` / `ARCH-INTRO-001`)**: Explicitly define at inception how human actors will interact with the MVP (e.g., **Web UI**, **Desktop GUI**, **Interactive Console/TUI/CLI**, **Mobile App**, or **Headless API/SDK** if actors are exclusively external systems). Never assume a headless class library when human actors exist.\n - **Delivery & Deployment Model (`ARCH-INTRO-001` / `CON-*` / `QR-*`)**: Clarify in business terms how the product will be delivered and operated (Cloud SaaS, Self-Hosted/On-Premise, Local Desktop/CLI binary, or Library/SDK package) along with any data-residency or availability requirements.\n - **Modern Aesthetic & Design System Standard (`CON-UI-*` / `ARCH-INTRO-001`)**: Explicitly define a modern, visually attractive styling standard adapted to the chosen presentation modality: (1) **Web UI**: modern responsive layouts using Bootstrap 5 utility classes and components (`card`, `table table-hover`, `badge`, `alert alert-*`, responsive grid) or modern equivalents, (2) **Desktop GUI**: modern clean design (rounded corners, elevated panels, padding, consistent typography) avoiding raw legacy unstyled windows, (3) **Console / TUI**: rich terminal interface with ANSI colors, status badges, formatted tables, and progress indicators (e.g., Spectre.Console, Rich, Ink, or Chalk/Picocolors).\n - **User Journeys (`JRN-*`) to Generate (Plain-Language Elicitation)**: Ask in simple, everyday language which end-to-end user journeys to model, explicitly indicating the 5 pieces of information needed to build each journey properly: (1) protagonist user (`persona` / `ACT-*`) and their main goal, (2) step-by-step stages from start to finish (`stages`), (3) interaction screens/channels at each stage (`touchpoints`), (4) current obstacles or pain points (`pain-points`), and (5) concrete system capabilities/use cases (`related-use-cases` / `UC-*`).\n - Essential MVP capabilities (`UC-*`) vs. future roadmap, ensuring **foundational entity CRUD / master data workflows** are explicitly included in the MVP.\n - Top 3\u20135 quality goals (`QR-*`) and regulatory/technical constraints (`CON-*`).\n3. **Enterprise & Capability Vision**: Create `specs/architecture/ARCH-INTRO-001.md` (`status: draft`, `naf-perspective: "Enterprise & Capability"`) using `templates/architecture/introduction-and-goals.template.md`, explicitly recording the chosen presentation/UI modality.\n4. **ProductShape Baseline**: Derive initial draft artifacts in `specs/product/`:\n - Actors (`ACT-*`), User Journeys (`JRN-*`), Use Cases (`UC-*`), Business Rules (`BR-*`), Functional Requirements (`FR-*` with mandatory `@nominal`, `@boundary`, `@invalid` Gherkin blocks), and Quality Requirements (`QR-*`).\n - **Vertical Slice Completeness Rule**: Every human-triggered `UC-*` in the MVP must specify observable user interaction through the agreed presentation modality and state persistence.\n5. Validate schemas and duplicates via MCP tools `verify_schemas` and `verify_duplicates` (or `npx aisdlc check --fix`).\n6. **Mandatory Upstream UX & MVP Boundary Gate (`agent-expert-user`)**: Invoke [`agent-expert-user`](../agent-expert-user/SKILL.md) in **Design Mode** to stress-test the proposed workflows, enforce strict MVP boundaries, reject any headless/library-only MVP when human actors exist, verify master-data CRUD prerequisites, and separate core MVP `UC-*` from future roadmap backlog.\n\n### Step 3: Shift-Left Cybersecurity & Privacy-by-Design (`agent-threat-modeler` \u2794 `agent-privacy-officer`)\n1. Delegate to or adopt [`agent-threat-modeler`](../agent-threat-modeler/SKILL.md).\n2. Analyze every `UC-*` and `FR-*` using STRIDE and OWASP ASVS to create in `specs/security/`:\n - Threat Actors (`ACT-THREAT-*`), Abuse Cases (`ABUSE-*` targeting `UC-*`), and Security Requirements (`SEC-REQ-*` with `@security @mitigation` negative Gherkin scenarios and `SEC-ENC-*` Zero Trust enclave bindings).\n3. Hand off to [`agent-privacy-officer`](../agent-privacy-officer/SKILL.md) to apply LINDDUN and GDPR/LOPDGDD/ISO 27701 in `specs/privacy/`:\n - Personal Data Assets (`DATA-ASSET-*`), GDPR Art. 30 Records of Processing (`PRIV-ROPA-*`), and Privacy Requirements (`PRIV-REQ-*` with `@privacy @gdpr` Gherkin scenarios).\n4. Run `verify_schemas` and `verify_privacy` (`npx aisdlc verify privacy`).\n\n### Step 4: Modular Systems Architecture (`agent-system-architect`)\n1. Delegate to or adopt [`agent-system-architect`](../agent-system-architect/SKILL.md).\n2. Define building blocks (`CMP-*`), Deployment Topology (`ARCH-DEP-001` translating the delivery model into execution nodes `RES-*` and enclaves `SEC-ENC-*`), and Architectural Decision Records (`ADR-*`) in `specs/architecture/` using `templates/architecture/`, ensuring every `CMP-*` cites `implements-use-cases` (`UC-*`) and `satisfies-requirements` (`FR-*`, `QR-*`, `SEC-REQ-*`, `PRIV-REQ-*`).\n3. Inspect third-party stack choices against `license-policy.yaml` via `verify_licenses` and subprocessors against `privacy-policy.yaml` via `verify_privacy`.\n4. **Technical Security & Privacy Feedback Loop**: If new infrastructure, persistence, LLM, or auth decisions introduce attack vectors or PII flows, return to `agent-threat-modeler` \u2794 `agent-privacy-officer` to add technical mitigations before coding.\n\n### Checkpoint 1 (Inception Design Checkpoint): `agent-auditor` $\\parallel$ `agent-adversary`\n1. Concurrently invoke `agent-auditor` (evaluating YAGNI, architecture bloat, interface contracts) and `agent-adversary` (simulating SPOFs, race conditions, unhandled threat scenarios) in isolated context windows over all Phase 0 deliverables.\n2. Consolidate findings and remediate in authoring agents (max 2 correction rounds), committing and pushing (`git push`) updates to the Draft PR.\n3. **Human Approval Gate**: Mark the Inception Draft PR ready (`gh pr ready`) and present the comprehensive Inception model for Human PO & Tech Lead sign-off.\n\n### Step 5: Release Milestone & Topological Wave SDD Plan (`1 UC-* = 1 CHG-*`)\n1. **Open Release Milestone (`Tier 2: release/v1.0.0` or Streamlined `main`)**: Group approved MVP Use Cases (`UC-001`, `UC-002`, ...) and visualize execution plan.\n2. **Decompose into Topological Waves (DAG Parallelism)**:\n - **Wave 0 \u2014 Foundational Core, Executable Presentation Host & CI/CD (`agent-devops`) (Sequential)**: Scaffold `CHG-001` via [`aisdlc-increment`](../aisdlc-increment/SKILL.md) to establish domain core, shared contracts, auth/config, and the runnable presentation host. Invoke [`agent-devops`](../agent-devops/SKILL.md) to clarify the technical CI/CD & packaging strategy (CI Quality Gates, Docker/GHCR, package registry, or PaaS/Cloud) and scaffold `.github/workflows/` and container manifests without modifying `src/`.\n - **Waves 1..N \u2014 Orthogonal End-to-End Vertical Slices (Parallel Multi-Agent)**: Once Wave 0 contracts are merged, execute independent `CHG-*` increments (`1 UC-* = 1 CHG-*`) in parallel across isolated branches/worktrees (`feat/CHG-002`, `feat/CHG-003`, ...).\n3. **Release Consolidation (`agent-devops`)**: Once all MVP increments are integrated (`sdd_integrate`), run `verify` (`npx aisdlc verify all`), generate SBOM, compute release KPIs (`kpi_release`), regenerate canonical reports and dashboard (`report_quality`, `report_dashboard`), verify release/publishing workflows via `agent-devops`, and open the Release PR for final human approval and SemVer tagging (`v1.0.0`). Individual `feat/CHG-*` PRs must compute reports locally without committing global `reports/` files to avoid merge conflicts.\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. Always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk.\n- **2-Checkpoint Quality & Adversarial Protocol**: Quality auditing and adversarial testing are concentrated at the completion of Inception design and Pre-PR implementation, avoiding micro-step overhead.\n- **FORBIDDEN Library-Only MVP for Human-Facing Products**: Whenever a product defines human actors (`ACT-*`), no agent may scope the MVP as headless class libraries without an executable presentation host.\n- **FORBIDDEN Greenfield Monolith (`1 UC-* = 1 CHG-*`)**: Never bundle the entire product or multiple `UC-*` into a single SDD change (`CHG-001`). Parallelism is achieved by running **multiple bounded `CHG-*` concurrently** on separate branches/worktrees.\n- Never invoke `sdd_change_new` or write application code in `src/` on a Greenfield project before `ARCH-INTRO-001`, `agent-expert-user` MVP validation, and at least one `UC-*` and `FR-*` exist.\n- All newly drafted specifications must start with `status: draft`.'
18957
19142
  },
18958
19143
  {
18959
19144
  id: "aisdlc-legacy-onboarding",
@@ -18961,7 +19146,7 @@ var LIFECYCLE_SKILL_TEMPLATES = [
18961
19146
  description: "Orchestrate progressive AI-SDLC adoption and Brownfield retro-inception on existing or legacy repositories without breaking production code, reverse-engineering architecture (ARCH-INTRO-*, CMP-*), 2-checkpoint auditor/adversary verification, and establishing baseline quality, security, and license audits before new SDD increments.",
18962
19147
  references: "[`process/02_product_definition.md`](../../process/02_product_definition.md), [`process/05_architecture_arc42_nafv4.md`](../../process/05_architecture_arc42_nafv4.md), [`process/06_spec_driven_development.md`](../../process/06_spec_driven_development.md), [`process/10_quality_management_and_release_gates.md`](../../process/10_quality_management_and_release_gates.md), and [`process/09_agent_protocols.md`](../../process/09_agent_protocols.md).",
18963
19148
  globs: "architecture/**, specs/**, src/**, packages/**",
18964
- body: "## Purpose & Trigger\nUse this skill when onboarding an **existing codebase (Brownfield / Legacy)** that was not built with AI-SDLC. It establishes non-disruptive governance, maps existing code into canonical specifications, inventories debt across all 12 Quality Gates, and creates baseline specifications (`specs/product/`, `specs/architecture/`) before new features or refactorings are introduced.\n\n## Retro-Inception Quality & Adversarial Checkpoint\nAcross Brownfield retro-inception, quality auditing and adversarial stress-testing are concentrated at the completion of retro-inception mapping:\n- **Concurrent Inspection**: Concurrently invoke [`agent-auditor`](../agent-auditor/SKILL.md) (evaluating YAGNI, over-modeling, and debt priorities) and [`agent-adversary`](../agent-adversary/SKILL.md) (uncovering undocumented invariants, hidden failure modes, and security gaps) in clean, isolated context windows.\n- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.\n- **Consolidated Remediation**: Consolidate findings and emit the Workflow Handoff back to authoring agents to resolve blocking defects and apply simplifications (max 2 correction rounds).\n- **Anti-Ping-Pong Guardrail**: Bounded strictly to maximum **1 correction round**. If non-blocking advisories remain, proceed to characterization; if blocking defects persist, escalate to the Human Tech Lead.\n\n## End-to-End Execution Playbook\n\n### Step 1: Turnkey Repository Scaffolding (Non-Destructive)\n1. Initialize AI-SDLC configuration without overwriting existing application files using `npx @aisdlc/cli init` (or MCP tool `new`).\n2. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n3. Commit initial AI-SDLC schemas and policies (`.github/`, `schemas/`, `templates/`, `*-policy.yaml`).\n\n### Step 2: Automated Baseline Audit & Debt Inventory (Read-Only)\nBefore modifying any code or creating SDD changes, run diagnostic verifiers to quantify existing technical, legal, privacy, and security debt:\n1. **License & Dependency Audit (`agent-compliance-checker`)**: Run MCP tool `verify_licenses` (`npx aisdlc verify licenses`). Identify any viral (`GPL`/`AGPL`) or commercial (`BSL`/`SSPL`) dependencies already present in the lockfile and document exceptions or remediation plans.\n2. **Shift-Left Security Scan (`agent-security-auditor`)**: Run MCP tool `verify_security` (`npx aisdlc verify security`) to detect hardcoded secrets (Gate 11) or OWASP SAST vulnerabilities in legacy files.\n3. **Privacy & PII Scan (`agent-privacy-officer`)**: Run MCP tool `verify_privacy` (`npx aisdlc verify privacy`) to detect PII in logs/telemetry or hardcoded real PII in legacy tests/seeds.\n4. **AST Code Quality Baseline (`agent-code-reviewer`)**: Run MCP tool `report_quality` (`npx aisdlc report quality`) to generate `reports/QUALITY_REPORT.md` and identify legacy hotspots exceeding Cyclomatic Complexity ($\\le 10$), Cognitive Complexity ($\\le 15$), or Maintainability Index ($\\ge 50$).\n\n### Step 3: Brownfield Retro-Inception (`agent-system-architect` & `agent-product-analyst`)\nInstead of attempting to document 100% of a legacy monolith upfront, apply **bounded retro-inception** focused on the system boundary and the domain areas under active evolution:\n1. **System Vision & Context (`ARCH-INTRO-001`)**: Use [`agent-product-analyst`](../agent-product-analyst/SKILL.md) to document the current system's mission, primary actors (`ACT-*`), and top quality goals (`QR-*`) in `specs/architecture/ARCH-INTRO-001.md`.\n2. **As-Is Component Mapping (`CMP-*` & `ADR-*`)**: Use [`agent-system-architect`](../agent-system-architect/SKILL.md) to map existing core modules/services into `specs/architecture/CMP-*.md` and capture historical architectural constraints (`CON-*`, `ADR-*`).\n3. **Core Use Cases Extraction (`UC-*`, `FR-*`)**: Extract canonical `UC-*` and `FR-*` artifacts in `specs/product/` for the specific bounded context or module that will be modified or extended next, including Gherkin acceptance scenarios reflecting current expected behavior (characterization specs).\n4. **Threat & Privacy Boundary Mapping (`agent-threat-modeler` \u2794 `agent-privacy-officer`)**: Map existing trust zones (`SEC-ENC-*`), active threat vectors (`ACT-THREAT-*`, `ABUSE-*`, `SEC-REQ-*`), and personal data inventories (`DATA-ASSET-*`, `PRIV-ROPA-*`, `PRIV-REQ-*`) on the target module.\n5. **Retro-Inception Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)**: Concurrently inspect reverse-engineered artifacts, evaluate fidelity vs. unnecessary modeling overhead, and consolidate fixes.\n\n### Step 4: Characterization Testing & Synchronization\n1. Run MCP tool `sdd_check_fix` (`npx aisdlc check --fix`) to extract `.feature` files and compute canonical SHA-256 digests.\n2. Run `verify_schemas` and `verify_pdac` to confirm the reverse-engineered baseline graph is structurally valid and drift-free.\n\n### Step 5: Transition to Governed SDD Increments (Boy Scout / Strangler Rule)\nOnce the target domain's baseline artifacts (`ARCH-INTRO-*`, `UC-*`, `FR-*`, `CMP-*`) are in place, execute all new features, refactorings, or bugfixes via [`aisdlc-increment`](../aisdlc-increment/SKILL.md).\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. Always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk.\n- **2-Checkpoint Quality & Adversarial Protocol**: Concentrated review at the retro-inception boundary and before PR delivery prevents process friction while maintaining rigorous defect interception.\n- **Zero Drive-By Rewrites**: Never mass-refactor untouched legacy modules during onboarding. Apply the Strangler / Boy Scout rule: bring touched functions into compliance with `quality-policy.yaml` incrementally via governed SDD tasks (`TSK-*`).\n- **Characterization First**: Never alter legacy business logic without first capturing its current behavior in an `FR-*` Gherkin specification and a verifiable test suite (`agent-qa-engineer`).\n- **Immediate Secret Remediation**: If Step 2 (`verify_security`) uncovers leaked credentials (exit code 4), halt feature work and remediate/rotate secrets immediately."
19149
+ body: "## Purpose & Trigger\nUse this skill when onboarding an **existing codebase (Brownfield / Legacy)** that was not built with AI-SDLC. It establishes non-disruptive governance, maps existing code into canonical specifications, inventories debt across all 12 Quality Gates, and creates baseline specifications (`specs/product/`, `specs/architecture/`) before new features or refactorings are introduced.\n\n## Retro-Inception Quality & Adversarial Checkpoint\nAcross Brownfield retro-inception, quality auditing and adversarial stress-testing are concentrated at the completion of retro-inception mapping:\n- **Concurrent Inspection**: Concurrently invoke [`agent-auditor`](../agent-auditor/SKILL.md) (evaluating YAGNI, over-modeling, and debt priorities) and [`agent-adversary`](../agent-adversary/SKILL.md) (uncovering undocumented invariants, hidden failure modes, and security gaps) in clean, isolated context windows.\n- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.\n- **Consolidated Remediation**: Consolidate findings and emit the Workflow Handoff back to authoring agents to resolve blocking defects and apply simplifications (max 2 correction rounds).\n- **Anti-Ping-Pong Guardrail**: Bounded strictly to maximum **1 correction round**. If non-blocking advisories remain, proceed to characterization; if blocking defects persist, escalate to the Human Tech Lead.\n\n## End-to-End Execution Playbook\n\n### Step 1: Branch-Before-Change & Turnkey Repository Scaffolding (Non-Destructive)\n1. **Branch-Before-Change**: Verify the active branch (`git branch --show-current`). If currently on a protected branch (`main`, `master`, `release/*`), create and switch to an onboarding branch (e.g., `chore/aisdlc-onboarding`) **before** modifying or creating any files.\n2. Initialize AI-SDLC configuration without overwriting existing application files using `npx @aisdlc/cli init` (or MCP tool `new`).\n3. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n4. Invoke [`agent-devops`](../agent-devops/SKILL.md) to audit existing CI/CD workflows and container manifests and integrate `aisdlc verify all` into the pipeline without breaking legacy deployments.\n5. Commit initial AI-SDLC schemas and policies (`.github/`, `schemas/`, `templates/`, `*-policy.yaml`), push (`git push -u origin <branch>`), and open a **Draft PR** (`gh pr create --draft`, with graceful fallback if no remote or CLI auth exists) so subsequent retro-inception and characterization commits are pushed incrementally.\n\n### Step 2: Automated Baseline Audit & Debt Inventory (Read-Only)\nBefore modifying any code or creating SDD changes, run diagnostic verifiers to quantify existing technical, legal, privacy, and security debt:\n1. **License & AST Code Quality Baseline (`agent-auditor`)**: Run MCP tools `verify_licenses` (`npx aisdlc verify licenses`) and `report_quality` (`npx aisdlc report quality`) to identify viral (`GPL`/`AGPL`) or commercial (`BSL`/`SSPL`) dependencies and legacy hotspots exceeding Cyclomatic Complexity ($\\le 10$), Cognitive Complexity ($\\le 15$), or Maintainability Index ($\\ge 50$).\n2. **Shift-Left Security Scan (`agent-adversary`)**: Run MCP tool `verify_security` (`npx aisdlc verify security`) to detect hardcoded secrets (Gate 11) or OWASP SAST vulnerabilities in legacy files.\n3. **Privacy & PII Scan (`agent-privacy-officer`)**: Run MCP tool `verify_privacy` (`npx aisdlc verify privacy`) to detect PII in logs/telemetry or hardcoded real PII in legacy tests/seeds.\n\n### Step 3: Brownfield Retro-Inception (`agent-system-architect` & `agent-product-analyst`)\nInstead of attempting to document 100% of a legacy monolith upfront, apply **bounded retro-inception** focused on the system boundary and the domain areas under active evolution:\n1. **System Vision & Context (`ARCH-INTRO-001`)**: Use [`agent-product-analyst`](../agent-product-analyst/SKILL.md) to document the current system's mission, primary actors (`ACT-*`), and top quality goals (`QR-*`) in `specs/architecture/ARCH-INTRO-001.md`.\n2. **As-Is Component Mapping (`CMP-*` & `ADR-*`)**: Use [`agent-system-architect`](../agent-system-architect/SKILL.md) to map existing core modules/services into `specs/architecture/CMP-*.md` and capture historical architectural constraints (`CON-*`, `ADR-*`).\n3. **Core Use Cases Extraction (`UC-*`, `FR-*`)**: Extract canonical `UC-*` and `FR-*` artifacts in `specs/product/` for the specific bounded context or module that will be modified or extended next, including Gherkin acceptance scenarios reflecting current expected behavior (characterization specs).\n4. **Threat & Privacy Boundary Mapping (`agent-threat-modeler` \u2794 `agent-privacy-officer`)**: Map existing trust zones (`SEC-ENC-*`), active threat vectors (`ACT-THREAT-*`, `ABUSE-*`, `SEC-REQ-*`), and personal data inventories (`DATA-ASSET-*`, `PRIV-ROPA-*`, `PRIV-REQ-*`) on the target module.\n5. **Retro-Inception Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)**: Concurrently inspect reverse-engineered artifacts, evaluate fidelity vs. unnecessary modeling overhead, and consolidate fixes.\n\n### Step 4: Characterization Testing & Synchronization\n1. Run MCP tool `sdd_check_fix` (`npx aisdlc check --fix`) to extract `.feature` files and compute canonical SHA-256 digests.\n2. Run `verify_schemas` and `verify_pdac` to confirm the reverse-engineered baseline graph is structurally valid and drift-free.\n3. Run `report_quality` (`npx aisdlc report quality`) and `report_dashboard` (`npx aisdlc report dashboard`) to generate the local baseline quality report and interactive dashboard for inspection (commit global `reports/` only on the onboarding baseline or post-merge on `main`, never on parallel feature PRs).\n4. Push final baseline commits (`git push`) and mark the onboarding Draft PR ready (`gh pr ready`) for human Tech Lead review before merging to `main`.\n\n### Step 5: Transition to Governed SDD Increments (Boy Scout / Strangler Rule)\nOnce the target domain's baseline artifacts (`ARCH-INTRO-*`, `UC-*`, `FR-*`, `CMP-*`) are in place, execute all new features, refactorings, or bugfixes via [`aisdlc-increment`](../aisdlc-increment/SKILL.md).\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. Always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk.\n- **2-Checkpoint Quality & Adversarial Protocol**: Concentrated review at the retro-inception boundary and before PR delivery prevents process friction while maintaining rigorous defect interception.\n- **Zero Drive-By Rewrites**: Never mass-refactor untouched legacy modules during onboarding. Apply the Strangler / Boy Scout rule: bring touched functions into compliance with `quality-policy.yaml` incrementally via governed SDD tasks (`TSK-*`).\n- **Characterization First**: Never alter legacy business logic without first capturing its current behavior in an `FR-*` Gherkin specification and a verifiable test suite (`agent-qa-engineer`).\n- **Immediate Secret Remediation**: If Step 2 (`verify_security`) uncovers leaked credentials (exit code 4), halt feature work and remediate/rotate secrets immediately."
18965
19150
  },
18966
19151
  {
18967
19152
  id: "aisdlc-increment",
@@ -18969,7 +19154,7 @@ var LIFECYCLE_SKILL_TEMPLATES = [
18969
19154
  description: "Orchestrate the complete Spec-Driven Development (SDD) lifecycle for bounded feature increments, enhancements, and bugfixes (CHG-* / TSK-*), from upstream requirement derivation and streamlined Git branching through Red-Green-Refactor TDD, 2-checkpoint transversal auditor/adversary verification, all 12 Quality Gates, and canonical baseline integration.",
18970
19155
  references: "[`process/06_spec_driven_development.md`](../../process/06_spec_driven_development.md), [`process/08_citation_contract_and_drift.md`](../../process/08_citation_contract_and_drift.md), [`process/10_quality_management_and_release_gates.md`](../../process/10_quality_management_and_release_gates.md), [`process/11_git_branching_and_lifecycle.md`](../../process/11_git_branching_and_lifecycle.md), and [`process/09_agent_protocols.md`](../../process/09_agent_protocols.md).",
18971
19156
  globs: "specs/changes/**, src/**, packages/**, tests/**",
18972
- body: '## Purpose & Trigger\nUse this skill for **every evolutionary increment (new feature, enhancement, refactoring, or bugfix)** on a project that already has an AI-SDLC baseline. It enforces strict 360\xB0 traceability from upstream ProductShape (`UC-*`, `FR-*`) through SDD (`CHG-*`, `HOF-*`, `TSK-*`), TDD implementation, the 12 Quality Gates, and baseline promotion under the **streamlined 2-checkpoint architecture**.\n\n## End-to-End Execution Playbook\n\n### Step 1: Upstream Product, Security & Privacy Delta (`agent-product-analyst`, `agent-threat-modeler` & `agent-privacy-officer`)\n1. Inspect active changes via MCP tool `get_active_handoff` and verify whether the target Use Case (`UC-*`) or Requirement (`FR-*`) already exists in `specs/product/`.\n2. If the increment introduces new behavior or modifies business rules:\n - Use [`agent-product-analyst`](../agent-product-analyst/SKILL.md) to create or update the `UC-*`, `BR-*`, and `FR-*` (with `@nominal`, `@boundary`, `@invalid` Gherkin scenarios).\n - Run MCP tool `verify_duplicates` (`npx aisdlc verify duplicates`) to block lexical or functional collisions early.\n - Use [`agent-threat-modeler`](../agent-threat-modeler/SKILL.md) to model any new `ABUSE-*` and `SEC-REQ-*` mitigations.\n - Hand off to [`agent-privacy-officer`](../agent-privacy-officer/SKILL.md) to model any personal data assets (`DATA-ASSET-*`), GDPR Art. 30 processing activities (`PRIV-ROPA-*`), and privacy requirements (`PRIV-REQ-*`).\n3. Run `sdd_check_fix` (`npx aisdlc check --fix`) to sync Gherkin `.feature` files and validate schemas.\n\n### Step 2: SDD Change Scaffolding & Architectural Design (`agent-system-architect`)\n1. Scaffold the bounded change package and its cryptographic `handoff.yaml` sidecar (`HOF-*`) targeting **a single Use Case (`1 UC-* = 1 CHG-*`)** using MCP tool `sdd_change_new` (or CLI `npx aisdlc change new "<Title>" --from <UC-ID> --profile <patch|standard|critical>`).\n2. Use [`agent-system-architect`](../agent-system-architect/SKILL.md) to complete `specs/changes/active/<chg-id>/design.md` and `specs/architecture/CMP-*.md`:\n - Structure `CMP-*` and `design.md` around **Modular & Hexagonal Architecture (Ports & Adapters)** (Domain/Application Core + Inbound/Outbound Ports) and define **Contract-First** shared interfaces/DTOs/schemas when spanning Frontend and Backend.\n - Map 100% of `handoff.yaml` requirements and components to atomic tasks (`TSK-*`) in `tasks.md` with explicit `autonomy-mode` (`AUTONOMOUS`, `HUMAN_REVIEW_PLAN`, `HIGH_RISK_MANUAL`, `AMBIGUOUS`).\n3. Run `verify_governance` and `verify_friction` to validate task governance, 100% design/handoff scope coverage, and anti-monolith limits (`maxUseCasesPerChange = 1`).\n\n### Checkpoint 1: Specification & Design Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)\n1. Concurrently invoke `agent-auditor` (evaluating YAGNI, interface bloat, and task completeness) and `agent-adversary` (probing contradictions, race conditions, and architecture SPOFs) in clean, isolated context windows over the combined upstream deliverables.\n2. Consolidate findings and remediate any blocking defects (max 2 correction rounds).\n3. **Human Approval Gate 1**: Present the specification and architectural design for Human Tech Lead / PO sign-off before proceeding to code.\n\n### Step 3: Streamlined Git Branch Navigation & Multi-Agent Parallelism\n1. Navigate to the working branch using `npx aisdlc git checkout <TSK-ID>` (`pnpm run git:checkout <TSK-ID>`).\n - **Default Streamlined Mode**: Switches to the working branch `feat/<CHG-ID>-<slug>` (created from `main`).\n - Granular task traceability is maintained via commit trailers (`Task-ID: TSK-*`, `Parent-Ref: CHG-*`) and commit scopes (`feat(TSK-001): ...`), enabling per-task rework KPIs without branch explosion.\n2. **Parallel Agent Execution Rules (`--parallel`)**:\n - When concurrent multi-agent implementation is configured (e.g. Backend adapter $\\parallel$ Frontend UI), `aisdlc git checkout <TSK-ID> --parallel` creates isolated worktrees (`task/<PARENT-ID>/<TSK-ID>-<slug>`).\n\n### Step 4: Red Phase \u2014 Failing Test Suites (`agent-qa-engineer`)\n1. Delegate to or adopt [`agent-qa-engineer`](../agent-qa-engineer/SKILL.md).\n2. Author FAILING (red) BDD/Gherkin step definitions, integration/contract tests, and mandatory E2E/UI tests (evaluating Happy Path, Sad Path, and Boundary Values for every interactive UI element, plus `UC-*` alternative/exception flows) in `tests/`.\n3. Commit failing test suites with trailer `Task-ID: TSK-YYY`.\n4. Run `verify_testing` (`npx aisdlc verify testing`) to confirm requirement test coverage before writing production code.\n\n### Step 5: Green & Refactor Phase \u2014 Surgical Implementation (`agent-developer`)\n1. Delegate to or adopt [`agent-developer`](../agent-developer/SKILL.md).\n2. Execute the **Mandatory 4-Step Implementation Order**:\n - (1) Modular & Hexagonal Architecture (Ports & Adapters) boundaries, (2) Inter-module interfaces/ports first, (3) Concrete component implementation (zero fake-wiring; all 4 UI states `Loading`, `Empty`, `Error`, `Nominal`), (4) Exhaustive per-function unit tests in `tests/unit/` (Happy Path, Sad Path, Boundary, Null/Empty).\n3. Commit implementations with trailer `Task-ID: TSK-YYY`.\n4. Verify any new dependency against `license-policy.yaml` via `verify_licenses` and PII handling against `privacy-policy.yaml` via `verify_privacy`.\n5. Run `sdd_check_fix` (`npx aisdlc check --fix`) and `verify_quality` (`npx aisdlc verify quality`) until Cyclomatic Complexity $\\le 10$, Cognitive $\\le 15$, Maintainability $\\ge 50$, and Function Length $\\le 40$ lines pass with zero violations.\n6. Run `verify` (`npx aisdlc verify all`) confirming all **12 Quality Gates** pass green.\n\n### Checkpoint 2: Implementation & Pre-PR Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)\n1. **Functional Validation (`agent-expert-user`)**: Validate live runtime behavior against `UC-*` and `FR-*` criteria (including `0` browser `console.error`/`pageerror` on UI changes).\n2. Concurrently invoke `agent-auditor` (verifying Clean Code, SOLID, DRY, AST thresholds, and eliminating unnecessary abstractions) and `agent-adversary` (performing conceptual test mutation to verify QA tests catch defects, and attacking boundary inputs with concrete PoC breaks).\n3. Consolidate findings and remediate in `agent-developer` (max 2 correction rounds).\n4. Run `npx aisdlc verify all` to confirm final green status.\n\n### Step 6: Human PR Sign-Off, Baseline Integration & Release Closure\n1. **Feature Merge (`feat/CHG-*` \u2794 `main` or `release/vX.Y.Z`)**:\n - Present the PR, KPI summary (`kpi_pr` including per-task rework metrics), and autogenerated reports (`reports/QUALITY_REPORT.md`, `reports/TRACEABILITY_MATRIX.md`, `reports/ROPA_INVENTORY.md`) to the human Tech Lead for review and approval (never auto-approve or auto-merge).\n2. **Canonical Baseline Promotion**: Once tasks in `tasks.md` are marked `COMPLETED` and approved, promote the change into the canonical baseline via MCP tool `sdd_integrate` (`npx aisdlc sdd integrate --auto`), which synchronizes the normative text and BDD Gherkin scenarios into `FR-*` / `UC-*` / `SEC-REQ-*` / `PRIV-REQ-*`, bumps minor SemVer when updating active specs, resyncs PDaC SHA-256 digests, promotes `FR-*` to `active`, links `CMP-*`, and archives the change under `specs/changes/completed/` (or `npx aisdlc sdd integrate --all` to consolidate all completed changes).\n3. **Semantic Versioning Promotion**: Tag the merge with the computed SemVer bump (`patch`, `minor`, `major`) and refresh the interactive dashboard (`report_dashboard`).\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles (e.g., `agent-qa-engineer` and `agent-developer`, or `agent-developer` and `agent-security-auditor`) in the same conversation context window. In subagent-capable IDEs (Antigravity `invoke_subagent`, Claude Code `Task` / `.claude/agents/`, GitHub Copilot `@agent-*`), always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk (`specs/`, `handoff.yaml`, `get_active_handoff`). In chat-based IDEs (Cursor, Windsurf, Aider), persist all artifacts to disk, emit the Workflow Handoff block, and instruct the user to open a **New Chat** (or `/clear`) before running the next specialist.\n- **2-Checkpoint Quality & Adversarial Protocol**: Enforce transversal quality and red-team checks exclusively at **Checkpoint 1 (Specification & Design)** and **Checkpoint 2 (Implementation & Pre-PR)**. Enforce the **Anti-Ping-Pong Guardrail**: maximum 2 correction rounds per checkpoint; if unresolved blocking defects persist, escalate to the Human Tech Lead.\n- **Single-Use-Case Scope (`1 UC-* = 1 CHG-*`)**: Each SDD change (`CHG-*`) must deliver at most 1 Use Case (`UC-*`). Bundling multiple `UC-*` into one `handoff.yaml` is blocked by `verify_governance` (`Greenfield monolith detected`). Scale throughput via parallel `CHG-*` branches/worktrees, not monolithic changes.\n- **100% Design & Handoff Coverage in `tasks.md`**: Every `CMP-*`, `FR-*`, `SEC-REQ-*`, and `PRIV-REQ-*` declared in `design.md` and `handoff.yaml` must be explicitly assigned to at least one `TSK-*` in `tasks.md`.'
19157
+ body: '## Purpose & Trigger\nUse this skill for **every evolutionary increment (new feature, enhancement, refactoring, or bugfix)** on a project that already has an AI-SDLC baseline. It enforces strict 360\xB0 traceability from upstream ProductShape (`UC-*`, `FR-*`) through SDD (`CHG-*`, `HOF-*`, `TSK-*`), TDD implementation, the 12 Quality Gates, and baseline promotion under the **streamlined 2-checkpoint architecture**.\n\n## End-to-End Execution Playbook\n\n### Step 0: Branch-Before-Change, Friction Profile Selection & Scope Triage (`patch | standard | critical`)\n1. **Branch-Before-Change**: Verify the active branch (`git branch --show-current`). If currently on a protected branch (`main`, `master`, `release/*`), create and switch to a dedicated working branch (`feat/<CHG-ID>-<slug>` or `fix/<CHG-ID>-<slug>`) **before** modifying or creating any files.\n2. Before editing any files or running `sdd_change_new`, inspect if the user explicitly specified the friction profile (`patch`, `standard`, or `critical`). If not, analyze the requested scope and ask the user via interactive question (`ask_question`) with the recommended option first (`(Recommended)`):\n - **`patch`**: low-risk isolated bugfixes ($\\le 2$ source files, zero Anti-Bypass paths), typos, or linter fixes on `patch/*` or `fix/*` branches (`npx aisdlc change new "<Title>" --id <chg-id> --profile patch` generates `spec.md` with `profile: patch` and `verification` block only, omitting `design.md`, `tasks.md`, and `handoff.yaml`; fast-track directly to Step 3 -> Step 4 -> Step 5 -> Step 6).\n - **`standard`**: functional increments, new/updated `UC-*` or `FR-*`, or contract changes (`proposal.md`, `spec.md`, `design.md`, `tasks.md`, and `handoff.yaml`).\n - **`critical`**: changes touching security enclaves (`SEC-ENC-*`), sensitive PII (`SPECIAL_CATEGORY` / `DPIA-*`), schemas, or migrations (full `standard` artifacts + `ADR-*` + mandatory STRIDE modeling and dual human approval).\n2. **Anti-Bypass Rule**: Never recommend or allow `patch` when the change touches protected paths (`schemas/`, `specs/security/`, `specs/privacy/`, `packages/security/`, `SEC-ENC-*`, `09_decisions/`, `migrations/`, or `*-policy.yaml`).\n\n### Step 1: Upstream Product, Security & Privacy Delta (`agent-product-analyst`, `agent-threat-modeler` & `agent-privacy-officer`)\n1. Inspect active changes via MCP tool `get_active_handoff` and verify whether the target Use Case (`UC-*`) or Requirement (`FR-*`) already exists in `specs/product/`.\n2. If the increment introduces new behavior or modifies business rules:\n - Use [`agent-product-analyst`](../agent-product-analyst/SKILL.md) to create or update the `UC-*`, `BR-*`, and `FR-*` (with `@nominal`, `@boundary`, `@invalid` Gherkin scenarios).\n - Run MCP tool `verify_duplicates` (`npx aisdlc verify duplicates`) to block lexical or functional collisions early.\n - Use [`agent-threat-modeler`](../agent-threat-modeler/SKILL.md) to model any new `ABUSE-*` and `SEC-REQ-*` mitigations.\n - Hand off to [`agent-privacy-officer`](../agent-privacy-officer/SKILL.md) to model any personal data assets (`DATA-ASSET-*`), GDPR Art. 30 processing activities (`PRIV-ROPA-*`), and privacy requirements (`PRIV-REQ-*`).\n3. Run `sdd_check_fix` (`npx aisdlc check --fix`) to sync Gherkin `.feature` files and validate schemas.\n\n### Step 2: SDD Change Scaffolding & Architectural Design (`agent-system-architect`)\n1. Scaffold the bounded change package and its cryptographic `handoff.yaml` sidecar (`HOF-*`) targeting **a single Use Case (`1 UC-* = 1 CHG-*`)** using MCP tool `sdd_change_new` (or CLI `npx aisdlc change new "<Title>" --from <UC-ID> --profile <patch|standard|critical>`).\n2. Use [`agent-system-architect`](../agent-system-architect/SKILL.md) to complete `specs/changes/active/<chg-id>/design.md` and `specs/architecture/CMP-*.md`:\n - Structure `CMP-*` and `design.md` around **Modular & Hexagonal Architecture (Ports & Adapters)** (Domain/Application Core + Inbound/Outbound Ports) and define **Contract-First** shared interfaces/DTOs/schemas when spanning Frontend and Backend.\n - Map 100% of `handoff.yaml` requirements and components to atomic tasks (`TSK-*`) in `tasks.md` with explicit `autonomy-mode` (`AUTONOMOUS`, `HUMAN_REVIEW_PLAN`, `HIGH_RISK_MANUAL`, `AMBIGUOUS`).\n3. Run `verify_governance` and `verify_friction` to validate task governance, 100% design/handoff scope coverage, and anti-monolith limits (`maxUseCasesPerChange = 1`).\n4. **Open Draft PR from Spec/Scaffolding (Option A)**: Commit the initial SDD scaffolding and specification/design artifacts on the working branch, push to remote (`git push -u origin <branch>`), and open a **Draft PR** (`gh pr create --draft --title "<type>(<CHG-ID>): <Title>" --body "..."`; graceful fallback to local-only commits if no remote or CLI auth exists). For `patch` profile increments, open the Draft PR right after scaffolding `spec.md`.\n\n### Checkpoint 1: Specification & Design Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)\n1. Concurrently invoke `agent-auditor` (evaluating YAGNI, interface bloat, and task completeness) and `agent-adversary` (probing contradictions, race conditions, and architecture SPOFs) in clean, isolated context windows over the combined upstream deliverables.\n2. Consolidate findings and remediate any blocking defects (max 2 correction rounds), committing and pushing updates (`git push`) to the open Draft PR.\n3. **Human Approval Gate 1**: Present the specification and architectural design (reviewable directly in the Draft PR) for Human Tech Lead / PO sign-off before proceeding to code.\n\n### Step 3: Streamlined Git Branch Navigation & Multi-Agent Parallelism\n1. Confirm you are on the working branch via `npx aisdlc git checkout <TSK-ID>` (`pnpm run git:checkout <TSK-ID>`).\n - **Default Streamlined Mode**: Ensures the agent is on `feat/<CHG-ID>-<slug>` (already created in Step 0).\n - Granular task traceability is maintained via commit trailers (`Task-ID: TSK-*`, `Parent-Ref: CHG-*`) and commit scopes (`feat(TSK-001): ...`), enabling per-task rework KPIs without branch explosion.\n2. **Parallel Agent Execution Rules (`--parallel`)**:\n - When concurrent multi-agent implementation is configured (e.g. Backend adapter $\\parallel$ Frontend UI), `aisdlc git checkout <TSK-ID> --parallel` creates isolated worktrees (`task/<PARENT-ID>/<TSK-ID>-<slug>`).\n\n### Step 4: Red Phase \u2014 Failing Test Suites (`agent-qa-engineer`)\n1. Delegate to or adopt [`agent-qa-engineer`](../agent-qa-engineer/SKILL.md).\n2. Run `npx aisdlc gherkin extract` (`sdd_check_fix`) to deterministically extract `.feature` files from Markdown specifications, and run `npx aisdlc gherkin scaffold <feature-file> --lang <lang> --fallback` to scaffold RED step definitions in `tests/steps/` (never hand-author `.feature` or step skeletons).\n3. Author FAILING (red) assertions inside the scaffolded step definitions, plus integration/contract tests and mandatory E2E/UI tests (evaluating Happy Path, Sad Path, and Boundary Values for every interactive UI element, plus `UC-*` alternative/exception flows) in `tests/`.\n4. Commit failing test suites with trailer `Task-ID: TSK-YYY` and push (`git push`) to the Draft PR (CI workflows skip heavy checks while the PR is in `draft` state).\n5. Run `npx aisdlc verify gherkin` and `verify_testing` (`npx aisdlc verify testing`) to confirm deterministic Gherkin/step sync and requirement test coverage before writing production code.\n\n### Step 5: Green & Refactor Phase \u2014 Surgical Implementation (`agent-developer` / `agent-devops`)\n1. Delegate application tasks (`src/`, `tests/`) to [`agent-developer`](../agent-developer/SKILL.md). For tasks (`TSK-*`) targeting CI/CD workflows (`.github/workflows/`), `Dockerfile*`, IaC manifests, or support scripts (`scripts/`), delegate to [`agent-devops`](../agent-devops/SKILL.md) under its strict non-invasion guardrail on `src/`.\n2. Execute the **Mandatory 4-Step Implementation Order**:\n - (1) Modular & Hexagonal Architecture (Ports & Adapters) boundaries, (2) Inter-module interfaces/ports first, (3) Concrete component implementation (zero fake-wiring; all 4 UI states `Loading`, `Empty`, `Error`, `Nominal`), (4) Exhaustive per-function unit tests in `tests/unit/` (Happy Path, Sad Path, Boundary, Null/Empty).\n3. Commit implementations with trailer `Task-ID: TSK-YYY` and push (`git push`) incrementally to the Draft PR.\n4. Verify any new dependency against `license-policy.yaml` via `verify_licenses` and PII handling against `privacy-policy.yaml` via `verify_privacy`.\n5. Run `sdd_check_fix` (`npx aisdlc check --fix`) and `verify_quality` (`npx aisdlc verify quality`) until Cyclomatic Complexity $\\le 10$, Cognitive $\\le 15$, Maintainability $\\ge 50$, and Function Length $\\le 40$ lines pass with zero violations.\n6. Run `verify` (`npx aisdlc verify all`) confirming all **12 Quality Gates** pass green.\n\n### Checkpoint 2: Implementation & Pre-PR Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)\n1. **Functional Validation (`agent-expert-user`)**: Validate live runtime behavior against `UC-*` and `FR-*` criteria (including `0` browser `console.error`/`pageerror` on UI changes).\n2. Concurrently invoke `agent-auditor` (verifying Clean Code, SOLID, DRY, AST thresholds, and eliminating unnecessary abstractions) and `agent-adversary` (performing conceptual test mutation to verify QA tests catch defects, and attacking boundary inputs with concrete PoC breaks).\n3. Consolidate findings and remediate in `agent-developer` (max 2 correction rounds), committing and pushing (`git push`) fixes to the Draft PR.\n4. Run `npx aisdlc verify all` to confirm final green status, then run `report_quality` (`npx aisdlc report quality`) and `report_dashboard` (`npx aisdlc report dashboard`) to compute local reports and the interactive dashboard for review (**do NOT stage or commit global `reports/*` files on `feat/CHG-*` branches** to prevent merge conflicts across parallel PRs).\n\n### Step 6: Human PR Sign-Off, Baseline Integration & Release Closure\n1. **Ready for Review & Feature Merge (`feat/CHG-*` \u2794 `main` or `release/vX.Y.Z`)**:\n - Update the Draft PR body with the Plan Execution Matrix (`[X]` vs `[O]`), KPI summary (`kpi_pr` including per-task rework metrics), and local verification/report summary (`reports/QUALITY_REPORT.md`, `reports/TRACEABILITY_MATRIX.md`, `reports/dashboard.html` inspected locally, without committing global `reports/*` to the feature PR), then run `gh pr ready` to mark the PR **Ready for Review** (triggering full CI verification) and present it to the human Tech Lead for review and approval (never auto-approve or auto-merge).\n2. **Canonical Baseline Promotion**: Once tasks in `tasks.md` are marked `COMPLETED` and approved, promote the change into the canonical baseline via MCP tool `sdd_integrate` (`npx aisdlc sdd integrate --auto`), which synchronizes the normative text and BDD Gherkin scenarios into `FR-*` / `UC-*` / `SEC-REQ-*` / `PRIV-REQ-*`, bumps minor SemVer when updating active specs, resyncs PDaC SHA-256 digests, promotes `FR-*` to `active`, links `CMP-*`, and archives the change under `specs/changes/completed/` (or `npx aisdlc sdd integrate --all` to consolidate all completed changes).\n3. **Semantic Versioning Promotion**:\n - **Profile-Driven SemVer Mapping**: Bump the version of the software under development according to the increment\'s friction profile:\n - `patch` -> bump **Patch** digit (`x.y.Z`)\n - `standard` -> bump **Minor** digit (`x.Y.0`)\n - `critical` -> bump **Major** digit (`X.0.0`)\n - **Highest-Precedence Consolidation (Multiple Pending Increments)**: When multiple pending increments exist in the active branch or release batch being integrated, apply **ONLY a single version bump corresponding to the highest rank** (`critical` / Major > `standard` / Minor > `patch` / Patch), ignoring unrelated historical directories.\n - Tag the merge with the computed SemVer bump (`patch`, `minor`, `major`) and refresh the interactive dashboard (`report_dashboard`).\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles (e.g., `agent-qa-engineer` and `agent-developer`, or `agent-developer` and `agent-adversary`) in the same conversation context window. In subagent-capable IDEs (Antigravity `invoke_subagent`, Claude Code `Task` / `.claude/agents/`, GitHub Copilot `@agent-*`), always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk (`specs/`, `handoff.yaml`, `get_active_handoff`). In chat-based IDEs (Cursor, Windsurf, Aider), persist all artifacts to disk, emit the Workflow Handoff block, and instruct the user to open a **New Chat** (or `/clear`) before running the next specialist.\n- **2-Checkpoint Quality & Adversarial Protocol**: Enforce transversal quality and red-team checks exclusively at **Checkpoint 1 (Specification & Design)** and **Checkpoint 2 (Implementation & Pre-PR)**. Enforce the **Anti-Ping-Pong Guardrail**: maximum 2 correction rounds per checkpoint; if unresolved blocking defects persist, escalate to the Human Tech Lead.\n- **Single-Use-Case Scope (`1 UC-* = 1 CHG-*`)**: Each SDD change (`CHG-*`) must deliver at most 1 Use Case (`UC-*`). Bundling multiple `UC-*` into one `handoff.yaml` is blocked by `verify_governance` (`Greenfield monolith detected`). Scale throughput via parallel `CHG-*` branches/worktrees, not monolithic changes.\n- **100% Design & Handoff Coverage in `tasks.md`**: Every `CMP-*`, `FR-*`, `SEC-REQ-*`, and `PRIV-REQ-*` declared in `design.md` and `handoff.yaml` must be explicitly assigned to at least one `TSK-*` in `tasks.md`.'
18973
19158
  }
18974
19159
  ];
18975
19160
  function renderAntigravitySkillFile(skill) {
@@ -19108,52 +19293,33 @@ This file defines the operational rules and specialized role mappings for Google
19108
19293
  - **Mandatory Regression Verification**: Never declare build, typecheck, or bug fixes complete without executing the relevant automated test suite (\`pnpm test\`, \`dotnet test\`) and confirming zero regressions.
19109
19294
  - **Global Styles Protection**: When touching or refactoring frontend views, verify that global stylesheet/asset imports remain intact and that layouts suffer no visual disruption.
19110
19295
  - **Skills-First Implementation Directive**: When authoring or refactoring code (especially frontend, UI, styling, accessibility, or framework-specific logic), proactively inspect and leverage available specialized agent skills (e.g., modern web guidance, accessibility a11y, DevTools, framework skills) to produce standard-compliant, modern implementations rather than guessing ad-hoc patterns.
19111
- - Upon completing green implementation, suggest handoff to \`agent-expert-user\` for post-development functional validation prior to security and privacy audit.
19112
-
19113
- ### 7. \`agent-security-auditor\` (Adversarial Code Auditor)
19114
- - **Mission**: Rigorously examine Pull Requests for business logic vulnerabilities, injection vectors, secret leaks, and authorization flaws as part of the Pre-Merge Audit Triad.
19115
- - **Directives**:
19116
- - Analyze code diffs with an attacker mindset and run \`pnpm run verify:security\`.
19117
- - Issue findings with CVSS v3.1 severity scoring and block any PR introducing CRITICAL or HIGH security risks.
19118
-
19119
- ### 8. \`agent-compliance-checker\` (Open Source License Compliance Auditor)
19120
- - **Mission**: Audit dependency manifests and ensure every direct and transitive third-party package complies with \`license-policy.yaml\` as part of the Pre-Merge Audit Triad.
19121
- - **Directives**:
19122
- - Verify SPDX identifiers via \`pnpm run verify:licenses\`, immediately blocking viral (\`GPL\`, \`AGPL\`) or unapproved commercial (\`BSL\`, \`SSPL\`) licenses.
19296
+ - Upon completing green implementation, suggest handoff to \`agent-expert-user\` for post-development functional validation prior to Checkpoint 2 (\`agent-auditor\` $\\parallel$ \`agent-adversary\` + \`agent-privacy-officer\`).
19123
19297
 
19124
- ### 9. \`agent-expert-user\` (Expert User and Domain Evaluator)
19298
+ ### 7. \`agent-expert-user\` (Expert User and Domain Evaluator)
19125
19299
  - **Mission**: Contrast design and specifications (design phase) and functionally validate finished software against \`UC-*\` and \`FR-*\` (post-development phase).
19126
19300
  - **Directives**:
19127
19301
  - Design mode (upstream): Adopt the primary actor's profile under stressful field conditions, applying bimodal discrimination (strict MVP core vs. roadmap suggestion backlog in \`templates/product/user-design-feedback.template.md\`). Reject as \`[BLOCKING_DEFECT]\` any library-only MVP proposal for human actors that fails to define or omits the runnable presentation layer (Web, Desktop, or Console/CLI), role access, or master-data CRUD flows.
19128
- - Functional validation mode (downstream / pre-PR / post-development functional validation): Thoroughly contrast interface and actual CLI execution against \`UC-*\` and \`FR-*\` acceptance criteria before pre-merge security audit.
19129
- - Emit handoff block suggesting \`agent-code-reviewer\` / \`agent-security-auditor\` / \`agent-privacy-officer\` if compliant, or return to \`agent-developer\` on functional drift.
19302
+ - Functional validation mode (downstream / pre-PR / post-development functional validation): Thoroughly contrast interface and actual CLI execution against \`UC-*\` and \`FR-*\` acceptance criteria before Checkpoint 2 audit.
19303
+ - Emit handoff block suggesting Checkpoint 2 (\`agent-auditor\` $\\parallel$ \`agent-adversary\` + \`agent-privacy-officer\`) if compliant, or return to \`agent-developer\` on functional drift.
19130
19304
 
19131
- ### 10. \`agent-code-reviewer\` (Technical and Architectural Code Reviewer)
19132
- - **Mission**: Audit Pull Requests evaluating code cleanliness, adherence to SOLID, DRY, YAGNI principles, design patterns, and respect for complexity and maintainability thresholds (\`quality-policy.yaml\`), forming part of the Pre-Merge Audit Triad.
19133
- - **Directives**:
19134
- - Respect \`quality-policy.yaml\` thresholds: CC $\\le 10$, Cognitive $\\le 15$, MI $\\ge 50$, LOC $\\le 40$.
19135
- - Detect improper coupling, code smells, magic numbers, ambiguous names, and encapsulation violations.
19136
- - Flag premature abstractions and speculative code violating YAGNI.
19137
- - Coordinate Pre-Merge Audit Triad with \`agent-security-auditor\`, \`agent-privacy-officer\`, and \`agent-compliance-checker\`.
19138
- - Classify findings into: \`[BLOCKING]\` (quality violation or broken pattern), \`[CLEAN_CODE_SUGGESTION]\` (non-blocking improvement), and \`[COMPLIANT]\`.
19139
-
19140
- ### 11. \`agent-devops\` (Automation and Infrastructure Engineer)
19305
+ ### 8. \`agent-devops\` (Automation and Infrastructure Engineer)
19141
19306
  - **Mission**: Maintain, evolve, and audit automated project infrastructure: CI/CD workflows, Docker containers, IaC manifests, and support scripts.
19142
19307
  - **Directives**:
19143
19308
  - Strict infrastructure domain: Operates exclusively in \`.github/workflows/\`, \`Dockerfile*\`, \`docker-compose*.yml\`, IaC manifests, and \`scripts/\`.
19144
19309
  - **NON-INVASION GUARDRAIL**: STRICTLY FORBIDDEN from modifying or refactoring application source code files (\`src/\`, \`packages/*/src/\`). Your responsibility is the pipeline and scaffolding, never application business logic.
19310
+ - **Deployment & CI/CD Strategy Discovery**: Before scaffolding new pipelines or containers, read \`ARCH-INTRO-001\` / \`ARCH-DEP-001\` and clarify packaging/CD destination, CI platform, and release trigger policy with the Tech Lead.
19145
19311
  - Infrastructure dependency policy: Verify licenses of dependencies, base images, and third-party actions according to \`license-policy.yaml\`.
19146
19312
  - Gate preservation: Ensure pipeline optimizations preserve all existing deterministic Quality Gates intact.
19147
19313
  - **Cross-Workflow Audit**: When fixing any CI/CD or configuration defect detected in a PR, search all \`.github/workflows/*.yml\` for the same pattern (including release, post-merge, and publishing pipelines) before declaring the fix complete.
19148
19314
  - **Remote Verification**: Creating a PR (\`gh pr create\`) does not equal success; actively verify that remote checks pass (\`gh pr checks\`).
19149
19315
 
19150
- ### 12. \`agent-auditor\` (Transversal Quality and Improvement Auditor)
19151
- - **Mission**: Polymorphically inspect deliverables from any specialist agent on demand, identifying structural weaknesses, overengineering, or blind spots, and proposing minimal solutions adhering strictly to YAGNI.
19152
- - **Directives**: Constructive critique; classify findings into \`[BLOCKING_DEFECT]\`, \`[SIMPLIFICATION]\`, and \`[ADVISORY]\`; non-invasive (never edit files directly); always return handoff to the audited agent (max 1 return round).
19316
+ ### 9. \`agent-auditor\` (Transversal Quality and Improvement Auditor)
19317
+ - **Mission**: Polymorphically inspect deliverables from any specialist agent on demand, enforcing Clean Code, SOLID, DRY, Simplicity First (YAGNI), \`quality-policy.yaml\` AST thresholds, UI design standards, and \`license-policy.yaml\` SPDX compliance.
19318
+ - **Directives**: Constructive critique; block fake-wiring, unstyled interfaces, and manual \`.feature\` files; verify licenses via \`pnpm run verify:licenses\`; classify findings into \`[BLOCKING_DEFECT]\`, \`[SIMPLIFICATION]\`, and \`[ADVISORY]\`; non-invasive (never edit files directly); always return handoff to the audited agent (max 1 return round).
19153
19319
 
19154
- ### 13. \`agent-adversary\` (Transversal Red Team and Chaos Adversary)
19155
- - **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps.
19156
- - **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens), Code (boundary/concurrency), and DevOps (pipeline escape); mandatory proof-of-break; non-invasive; always return handoff to the audited agent (max 1 return round).
19320
+ ### 10. \`agent-adversary\` (Transversal Red Team and Chaos Adversary)
19321
+ - **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, including Pre-Merge / Checkpoint 2 security diff audits with CVSS v3.1 scoring and concrete proofs-of-concept (PoC).
19322
+ - **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens), Development & Pre-Merge Security (boundary/concurrency, SAST/secrets via \`pnpm run verify:security\`, CVSS v3.1 blocking CRITICAL/HIGH), and DevOps (pipeline escape); mandatory proof-of-break; non-invasive; always return handoff to the audited agent (max 1 return round).
19157
19323
 
19158
19324
  ---
19159
19325
 
@@ -19174,7 +19340,7 @@ This file defines the operational rules and specialized role mappings for Google
19174
19340
  - **Conditional Activation Rule by Autonomy**:
19175
19341
  - \u{1F7E2} **\`AUTONOMOUS\`** (or exclusive final supervision in PR/CI): **OMITTED**. Do not request or emit interactive handoff to avoid interrupting unattended execution.
19176
19342
  - \u{1F7E1} **Autonomy $\\ge$ \`HUMAN_REVIEW_PLAN\`** (\`HUMAN_REVIEW_PLAN\`, \`AMBIGUOUS\`, \`HIGH_RISK_MANUAL\`): **MANDATORY**. Emit the Workflow Handoff block compliant with [\`templates/workflow/agent-handoff.template.md\`](../../templates/workflow/agent-handoff.template.md) and **STOP**.
19177
- - **Block Contents**: Declare produced deliverables, recommend the next role in workflow (\`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-qa-engineer\`, \`agent-developer\`, \`agent-expert-user\`, \`agent-code-reviewer\`, \`agent-security-auditor\`, \`agent-compliance-checker\`, \`agent-devops\`, \`agent-auditor\`, \`agent-adversary\`, etc.), provide suggested invocation prompt, and keep **the Human Action Window open at all times for the human user to take action** (review, edit by hand, pause/reroute, or delegate).
19343
+ - **Block Contents**: Declare produced deliverables, recommend the next role in workflow (\`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-qa-engineer\`, \`agent-developer\`, \`agent-expert-user\`, \`agent-devops\`, \`agent-auditor\`, \`agent-adversary\`, etc.), provide suggested invocation prompt, and keep **the Human Action Window open at all times for the human user to take action** (review, edit by hand, pause/reroute, or delegate).
19178
19344
  `;
19179
19345
  var STARTER_CURSOR_CORE_RULES = `---
19180
19346
  description: Global canonical directives, 5 unbreakable commandments, and AI-SDLC pre-flight
@@ -19216,13 +19382,10 @@ Before finalizing changes or proposing commits:
19216
19382
  | \`agent-system-architect\` | Modular arc42 + NAF v4 architecture (\`CMP-*\`, Mermaid diagrams, \`ADR-*\`). |
19217
19383
  | \`agent-qa-engineer\` | FAILING BDD/Gherkin, E2E, and UI suites (using agreed project tech; Happy Path, Sad Path & Boundary Values per interactive UI element) before \`agent-developer\` writes code. |
19218
19384
  | \`agent-developer\` | Atomic tasks from \`tasks.md\`; respects autonomy mode; runs \`pnpm run check:fix\` + \`pnpm run verify:all\`. |
19219
- | \`agent-security-auditor\` | Adversarial PR security audit, SAST, secrets, and CVSS v3.1 evaluation. |
19220
- | \`agent-compliance-checker\` | SPDX license compliance audit against \`license-policy.yaml\`. |
19221
19385
  | \`agent-expert-user\` | Bimodal MVP evaluation (design) and functional validation against \`UC-*\` and \`FR-*\` (pre-PR). |
19222
- | \`agent-code-reviewer\` | PR audit (SOLID, DRY, YAGNI): \`[BLOCKING]\` / \`[CLEAN_CODE_SUGGESTION]\` / \`[COMPLIANT]\`. |
19223
- | \`agent-devops\` | CI/CD, Docker, IaC only \u2014 **FORBIDDEN** to touch \`src/\` or \`packages/*/src/\`. |
19224
- | \`agent-auditor\` | Transversal on-demand constructive auditor; identifies overengineering, blind spots & YAGNI simplifications; returns handoff to audited agent. |
19225
- | \`agent-adversary\` | Transversal on-demand Red Team adversary; breaks deliverables with reproducible PoC & mutation tests; returns handoff to audited agent. |
19386
+ | \`agent-devops\` | CI/CD, Docker, IaC only \u2014 clarifies deployment/CI strategy; **FORBIDDEN** to touch \`src/\` or \`packages/*/src/\`. |
19387
+ | \`agent-auditor\` | Transversal auditor: YAGNI, Clean Code/SOLID/AST thresholds, UI standards, SPDX licenses (\`verify:licenses\`); returns handoff to audited agent. |
19388
+ | \`agent-adversary\` | Transversal Red Team adversary: PoC breaks, mutation testing & Pre-Merge security diff audit (\`verify:security\`, CVSS v3.1); returns handoff to audited agent. |
19226
19389
 
19227
19390
  ## 5. Task Autonomy Modes (\`tasks.md\`)
19228
19391
  - \u{1F7E2} **\`AUTONOMOUS\`**: Low risk. Implement directly, omit handoff block.
@@ -19375,32 +19538,20 @@ npx tsx packages/cli/src/index.ts sdd integrate --change <chg-id>
19375
19538
  - **Mission**: Implement atomic tasks from SDD specifications (\`tasks.md\`) with clean, strictly typed code and thorough tests.
19376
19539
  - **Directives**: Execute the mandatory 4-step order: (1) Modular & Hexagonal Architecture (Ports & Adapters) definition/redefinition, (2) Inter-module interfaces first, (3) Component implementation, (4) Per-function unit tests (Happy Path, Sad Path, Boundary Values, Unexpected/Null/Empty values). Respect the autonomy mode. Make tests delivered by \`agent-qa-engineer\` pass green. Run \`pnpm run check:fix\` and \`pnpm run verify:all\`. Enforce Mandatory Regression Verification (\`pnpm test\`) with zero regressions before declaring completion, and enforce Global Styles Protection on frontend views.
19377
19540
 
19378
- ### 7. \`agent-security-auditor\` (Adversarial Code Auditor)
19379
- - **Mission**: Examine Pull Requests for business logic vulnerabilities, injection vectors, secret leaks, and authorization flaws as part of the Pre-Merge Audit Triad.
19380
- - **Directives**: Run \`pnpm run verify:security\`, evaluate CVSS v3.1 severity, and block CRITICAL/HIGH risks.
19381
-
19382
- ### 8. \`agent-compliance-checker\` (Open Source License Compliance Auditor)
19383
- - **Mission**: Audit dependency manifests against \`license-policy.yaml\` as part of the Pre-Merge Audit Triad.
19384
- - **Directives**: Run \`pnpm run verify:licenses\`, blocking viral (\`GPL\`, \`AGPL\`) or unapproved commercial (\`BSL\`, \`SSPL\`) packages.
19385
-
19386
- ### 9. \`agent-expert-user\` (Expert User and Domain Evaluator)
19541
+ ### 7. \`agent-expert-user\` (Expert User and Domain Evaluator)
19387
19542
  - **Mission**: Contrast design and specifications (design phase) and functionally validate finished software against \`UC-*\` and \`FR-*\` (post-development functional validation phase).
19388
19543
 
19389
- ### 10. \`agent-code-reviewer\` (Technical and Architectural Code Reviewer)
19390
- - **Mission**: Audit Pull Requests evaluating code cleanliness, adherence to SOLID, DRY, YAGNI principles, and respect for \`quality-policy.yaml\` thresholds, forming part of the Pre-Merge Audit Triad.
19391
- - **Findings classification**: \`[BLOCKING]\`, \`[CLEAN_CODE_SUGGESTION]\`, \`[COMPLIANT]\`.
19392
-
19393
- ### 11. \`agent-devops\` (Automation and Infrastructure Engineer)
19394
- - **Mission**: Maintain, evolve, and audit automated project infrastructure: CI/CD workflows, Docker containers, IaC manifests, and support scripts.
19544
+ ### 8. \`agent-devops\` (Automation and Infrastructure Engineer)
19545
+ - **Mission**: Maintain, evolve, and audit automated project infrastructure: CI/CD workflows, Docker containers, IaC manifests, and support scripts. Clarifies packaging/CD strategy against \`ARCH-INTRO-001\` / \`ARCH-DEP-001\`.
19395
19546
  - **NON-INVASION GUARDRAIL**: STRICTLY FORBIDDEN from modifying application source code (\`src/\`, \`packages/*/src/\`).
19396
19547
 
19397
- ### 12. \`agent-auditor\` (Transversal Quality and Improvement Auditor)
19398
- - **Mission**: Polymorphically inspect deliverables from any specialist agent on demand, identifying structural weaknesses, overengineering, or blind spots, and proposing minimal solutions adhering strictly to YAGNI.
19548
+ ### 9. \`agent-auditor\` (Transversal Quality and Improvement Auditor)
19549
+ - **Mission**: Polymorphically inspect deliverables from any specialist agent on demand, enforcing Clean Code, SOLID, DRY, YAGNI, \`quality-policy.yaml\` AST thresholds, UI design standards, and \`license-policy.yaml\` SPDX compliance (\`pnpm run verify:licenses\`).
19399
19550
  - **Directives**: Constructive critique; classify findings into \`[BLOCKING_DEFECT]\`, \`[SIMPLIFICATION]\`, and \`[ADVISORY]\`; non-invasive (never edit files directly); always return handoff to the audited agent (max 1 return round).
19400
19551
 
19401
- ### 13. \`agent-adversary\` (Transversal Red Team and Chaos Adversary)
19402
- - **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps.
19403
- - **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens), Code (boundary/concurrency), and DevOps (pipeline escape); mandatory proof-of-break; non-invasive; always return handoff to the audited agent (max 1 return round).
19552
+ ### 10. \`agent-adversary\` (Transversal Red Team and Chaos Adversary)
19553
+ - **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, including Pre-Merge / Checkpoint 2 security diff audits (\`pnpm run verify:security\`, CVSS v3.1), providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps.
19554
+ - **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens), Development & Pre-Merge Security (boundary/concurrency, CVSS v3.1), and DevOps (pipeline escape); mandatory proof-of-break; non-invasive; always return handoff to the audited agent (max 1 return round).
19404
19555
 
19405
19556
  ---
19406
19557
 
@@ -19517,7 +19668,7 @@ Non-Negotiable Quality Thresholds (\`quality-policy.yaml\`):
19517
19668
  - **Conditional Activation**:
19518
19669
  * \u{1F7E2} **\`AUTONOMOUS\` Mode** (or PR/CI final supervision): **OMITTED**. Do not interrupt unattended execution.
19519
19670
  * \u{1F7E1} **Autonomy $\\ge$ \`HUMAN_REVIEW_PLAN\`** (\`HUMAN_REVIEW_PLAN\`, \`AMBIGUOUS\`, \`HIGH_RISK_MANUAL\`): **MANDATORY**. Emit Workflow Handoff block compliant with [\`templates/workflow/agent-handoff.template.md\`](../templates/workflow/agent-handoff.template.md) and **STOP**.
19520
- - **Components**: Declare completed deliverables, recommend next roles (\`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-developer\`, \`agent-security-auditor\`), provide suggested invocation prompt, and **keep the Human Action Window open at all times for the user to take action** (review, edit by hand, pause/reroute, or delegate).
19671
+ - **Components**: Declare completed deliverables, recommend next roles (\`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-developer\`, \`agent-devops\`, \`agent-auditor\`, \`agent-adversary\`), provide suggested invocation prompt, and **keep the Human Action Window open at all times for the user to take action** (review, edit by hand, pause/reroute, or delegate).
19521
19672
 
19522
19673
  ---
19523
19674
 
@@ -19525,19 +19676,16 @@ Non-Negotiable Quality Thresholds (\`quality-policy.yaml\`):
19525
19676
 
19526
19677
  | Role | Mission (summary) |
19527
19678
  | :--- | :--- |
19528
- | \`agent-product-analyst\` | Phase 0 NAF v4 Enterprise & Capability Vision (\`ARCH-INTRO-*\`, up to 15-question discovery interview defining UI modality & CRUD prerequisites) + ProductShape artifacts (\`ACT-*\`, \`UC-*\`, \`FR-*\`, \`QR-*\`, \`BR-*\`); \`status\` starts \`draft\`. |
19679
+ | \`agent-product-analyst\` | Phase 0 NAF v4 Enterprise & Capability Vision (\`ARCH-INTRO-*\`, up to 15-question discovery interview defining UI modality, delivery model & CRUD prerequisites) + ProductShape artifacts (\`ACT-*\`, \`UC-*\`, \`FR-*\`, \`QR-*\`, \`BR-*\`); \`status\` starts \`draft\`. |
19529
19680
  | \`agent-threat-modeler\` | STRIDE/OWASP threat triad (\`ACT-THREAT-*\`, \`ABUSE-*\`, \`SEC-REQ-*\`); hands off to \`agent-privacy-officer\`. |
19530
19681
  | \`agent-privacy-officer\` | LINDDUN & GDPR/LOPDGDD privacy triad (\`DATA-ASSET-*\`, \`PRIV-ROPA-*\`, \`PRIV-REQ-*\`) + Pre-Merge \`verify:privacy\`. |
19531
- | \`agent-system-architect\` | Modular arc42 + NAF v4 architecture (\`CMP-*\`, Mermaid diagrams, \`ADR-*\`). |
19682
+ | \`agent-system-architect\` | Modular arc42 + NAF v4 architecture (\`CMP-*\`, \`ARCH-DEP-001\`, Mermaid diagrams, \`ADR-*\`). |
19532
19683
  | \`agent-qa-engineer\` | FAILING BDD/Gherkin, E2E, and UI suites (using agreed project tech; Happy Path, Sad Path & Boundary Values per interactive UI element) before \`agent-developer\` writes production code. |
19533
19684
  | \`agent-developer\` | Atomic tasks from \`tasks.md\`; autonomy mode must be respected; runs \`pnpm run check:fix\` + \`pnpm run verify:all\`. |
19534
- | \`agent-security-auditor\` | Adversarial PR security audit, SAST, secrets, and CVSS v3.1 evaluation. |
19535
- | \`agent-compliance-checker\` | SPDX license compliance audit against \`license-policy.yaml\`. |
19536
19685
  | \`agent-expert-user\` | Bimodal MVP evaluation (design) and functional validation against \`UC-*\` and \`FR-*\` (pre-PR). |
19537
- | \`agent-code-reviewer\` | PR audit (SOLID, DRY, YAGNI): \`[BLOCKING]\` / \`[CLEAN_CODE_SUGGESTION]\` / \`[COMPLIANT]\`. |
19538
- | \`agent-devops\` | CI/CD, Docker, IaC only \u2014 **FORBIDDEN** to touch \`src/\` or \`packages/*/src/\`. |
19539
- | \`agent-auditor\` | Transversal on-demand constructive auditor; identifies overengineering, blind spots & YAGNI simplifications; returns handoff to audited agent. |
19540
- | \`agent-adversary\` | Transversal on-demand Red Team adversary; breaks deliverables with reproducible PoC & mutation tests; returns handoff to audited agent. |
19686
+ | \`agent-devops\` | CI/CD, Docker, IaC only \u2014 clarifies deployment/CI strategy; **FORBIDDEN** to touch \`src/\` or \`packages/*/src/\`. |
19687
+ | \`agent-auditor\` | Transversal auditor: YAGNI, Clean Code/SOLID/AST thresholds, UI standards, SPDX licenses (\`verify:licenses\`); returns handoff to audited agent. |
19688
+ | \`agent-adversary\` | Transversal Red Team adversary: PoC breaks, mutation testing & Pre-Merge security diff audit (\`verify:security\`, CVSS v3.1); returns handoff to audited agent. |
19541
19689
 
19542
19690
  ---
19543
19691
 
@@ -19842,10 +19990,11 @@ Specifies exchange schemas and canonical interfaces:
19842
19990
 
19843
19991
  ---
19844
19992
 
19845
- ## 3. Observability, Metrics, and Immutable Auditing
19846
- - **Distributed Tracing**: W3C Trace Context (\`traceparent\`) injection via OpenTelemetry.
19847
- - **Operational Metrics**: Prometheus RED metrics exposition (Rate, Errors, Duration).
19848
- - **Structured Logging**: Deterministic JSON format with mandatory fields (\`timestamp\`, \`level\`, \`trace_id\`, \`component_id\`).
19993
+ ## 3. Observability, Persistent Telemetry, and Immutable Auditing
19994
+ - **Distributed Tracing**: W3C Trace Context (\`traceparent\`) injection via OpenTelemetry with persistent span export (\`.observability/traces/traces.otlp.jsonl\`).
19995
+ - **Operational Metrics**: Prometheus RED metrics exposition (Rate, Errors, Duration) with periodic local snapshots (\`.observability/metrics/metrics.prom\`) for offline backfill and optional Grafana dashboards.
19996
+ - **Structured Logging**: Deterministic JSONL format with mandatory fields (\`timestamp\`, \`level\`, \`trace_id\`, \`component_id\`), PII redaction, and rolling local persistence (\`OBS_STORAGE_PATH\`).
19997
+ - **Offline Export & Shutdown Flush**: Guaranteed \`ITelemetryStore.flush()\` on process exit and \`ITelemetryExporter\` supporting JSONL, CSV, OpenMetrics, and OTLP exports without requiring a live collector.
19849
19998
 
19850
19999
  ---
19851
20000
 
@@ -20593,10 +20742,15 @@ pipelines:\r
20593
20742
  - step: *build-and-verify\r
20594
20743
  - step: *sdd-integrate\r
20595
20744
  `;
20596
- var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML = "name: CI - AI-SDLC Quality Gates & Testing\r\n\r\non:\r\n push:\r\n branches: [ main ]\r\n pull_request:\r\n branches: [ main ]\r\n\r\njobs:\r\n verify-and-test:\r\n runs-on: ubuntu-latest\r\n strategy:\r\n matrix:\r\n node-version: [ 20.x, 22.x ]\r\n\r\n steps:\r\n - name: Checkout Code\r\n uses: actions/checkout@v4\r\n\r\n - name: Install pnpm\r\n uses: pnpm/action-setup@v4\r\n with:\r\n version: 10\r\n\r\n - name: Setup Node.js ${{ matrix.node-version }}\r\n uses: actions/setup-node@v4\r\n with:\r\n node-version: ${{ matrix.node-version }}\r\n\r\n - name: Install Dependencies\r\n run: |\r\n pnpm install --frozen-lockfile\r\n pnpm approve-builds --all\r\n\r\n - name: Build Packages\r\n run: pnpm run build\r\n\r\n - name: Run Vitest Unit & Integration Suites\r\n run: pnpm test\r\n\r\n - name: AI-SDLC Quality Gate & Full Verification\r\n run: npx @aisdlc/cli verify all\r\n";
20745
+ var STARTER_TEMPLATES_CI_DOCKER_COMPOSE_OBSERVABILITY_YML = '# ==============================================================================\n# AI-SDLC: Optional Local & Post-Mortem Observability Stack\n# Provides Prometheus (Apache-2.0) and Grafana (isolated optional UI container)\n# mounting local persistent telemetry stored under ./.observability/\n#\n# Usage:\n# docker compose -f templates/ci/docker-compose.observability.yml up -d\n# ==============================================================================\nservices:\n prometheus:\n image: prom/prometheus:v2.54.1\n container_name: aisdlc-prometheus\n command:\n - "--config.file=/etc/prometheus/prometheus.yml"\n - "--storage.tsdb.path=/prometheus"\n - "--storage.tsdb.retention.time=30d"\n - "--web.enable-admin-api"\n ports:\n - "9090:9090"\n volumes:\n - ./observability/prometheus.yml:/etc/prometheus/prometheus.yml:ro\n - ../../.observability:/observability:ro\n - prometheus_data:/prometheus\n extra_hosts:\n - "host.docker.internal:host-gateway"\n restart: unless-stopped\n\n grafana:\n image: grafana/grafana:11.2.2\n container_name: aisdlc-grafana\n ports:\n - "3000:3000"\n environment:\n - GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER:-admin}\n - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin}\n - GF_USERS_ALLOW_SIGN_UP=false\n volumes:\n - ./observability/grafana-datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml:ro\n - ../../.observability:/observability:ro\n - grafana_data:/var/lib/grafana\n depends_on:\n - prometheus\n restart: unless-stopped\n\nvolumes:\n prometheus_data:\n grafana_data:\n';
20746
+ var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML = "name: CI - AI-SDLC Quality Gates & Testing\r\n\r\non:\r\n push:\r\n branches: [ main ]\r\n pull_request:\r\n branches: [ main ]\r\n types: [ opened, synchronize, reopened, ready_for_review ]\r\n\r\njobs:\r\n verify-and-test:\r\n if: github.event_name != 'pull_request' || github.event.pull_request.draft == false\r\n runs-on: ubuntu-latest\r\n strategy:\r\n matrix:\r\n node-version: [ 20.x, 22.x ]\r\n\r\n steps:\r\n - name: Checkout Code\r\n uses: actions/checkout@v4\r\n\r\n - name: Install pnpm\r\n uses: pnpm/action-setup@v4\r\n with:\r\n version: 10\r\n\r\n - name: Setup Node.js ${{ matrix.node-version }}\r\n uses: actions/setup-node@v4\r\n with:\r\n node-version: ${{ matrix.node-version }}\r\n\r\n - name: Install Dependencies\r\n run: |\r\n pnpm install --frozen-lockfile\r\n pnpm approve-builds --all\r\n\r\n - name: Build Packages\r\n run: pnpm run build\r\n\r\n - name: Run Vitest Unit & Integration Suites\r\n run: pnpm test\r\n\r\n - name: AI-SDLC Quality Gate & Full Verification\r\n run: npx @aisdlc/cli verify all\r\n";
20597
20747
  var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML = 'name: Deploy AI-SDLC Dashboard to GitHub Pages\r\n\r\non:\r\n push:\r\n branches:\r\n - main\r\n workflow_dispatch:\r\n\r\npermissions:\r\n contents: read\r\n pages: write\r\n id-token: write\r\n\r\nconcurrency:\r\n group: pages\r\n cancel-in-progress: false\r\n\r\njobs:\r\n deploy-dashboard:\r\n name: Build & Publish Interactive Dashboard\r\n runs-on: ubuntu-latest\r\n environment:\r\n name: github-pages\r\n url: ${{ steps.deployment.outputs.page_url }}\r\n\r\n steps:\r\n - name: Checkout Code\r\n uses: actions/checkout@v4\r\n with:\r\n fetch-depth: 0 # Full git history required for historical KPIs and telemetry\r\n\r\n - name: Setup Node.js\r\n uses: actions/setup-node@v4\r\n with:\r\n node-version: 20\r\n\r\n - name: Generate AI-SDLC Interactive Dashboard\r\n run: |\r\n mkdir -p reports\r\n npx --yes @aisdlc/cli report dashboard --output reports/index.html\r\n cp reports/index.html reports/dashboard.html\r\n touch reports/.nojekyll\r\n\r\n - name: Setup GitHub Pages\r\n uses: actions/configure-pages@v5\r\n\r\n - name: Upload Pages Artifact\r\n uses: actions/upload-pages-artifact@v3\r\n with:\r\n path: reports\r\n\r\n - name: Deploy to GitHub Pages\r\n id: deployment\r\n uses: actions/deploy-pages@v4\r\n\r\n - name: Emit Summary to GitHub Actions\r\n if: always() && steps.deployment.outcome == \'success\'\r\n run: |\r\n echo "### \u{1F310} AI-SDLC Interactive Dashboard Published" >> $GITHUB_STEP_SUMMARY\r\n echo "" >> $GITHUB_STEP_SUMMARY\r\n echo "The interactive PDaC / RTM graph, Quality Gate telemetry, and release metrics are live at:" >> $GITHUB_STEP_SUMMARY\r\n echo "" >> $GITHUB_STEP_SUMMARY\r\n echo "\u{1F449} **[Open Live Dashboard](${{ steps.deployment.outputs.page_url }})**" >> $GITHUB_STEP_SUMMARY\r\n';
20598
- var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML = "name: AI-SDLC PR KPI Aggregator\r\n\r\non:\r\n pull_request:\r\n types: [opened, synchronize, reopened]\r\n\r\npermissions:\r\n contents: read\r\n pull-requests: write\r\n\r\njobs:\r\n aggregate-kpis:\r\n name: Aggregate PR KPIs & Telemetry\r\n runs-on: ubuntu-latest\r\n\r\n steps:\r\n - name: Checkout Repository\r\n uses: actions/checkout@v4\r\n with:\r\n fetch-depth: 0\r\n\r\n - name: Install pnpm\r\n uses: pnpm/action-setup@v4\r\n with:\r\n version: 10\r\n\r\n - name: Setup Node.js\r\n uses: actions/setup-node@v4\r\n with:\r\n node-version: 20\r\n\r\n - name: Install Dependencies\r\n run: |\r\n pnpm install --frozen-lockfile\r\n\r\n - name: Calculate and Emit PR KPIs\r\n id: kpi\r\n run: |\r\n npx @aisdlc/cli kpi pr --base origin/${{ github.base_ref }} --head HEAD >> $GITHUB_STEP_SUMMARY\r\n";
20748
+ var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML = "name: AI-SDLC PR KPI Aggregator\r\n\r\non:\r\n pull_request:\r\n types: [opened, synchronize, reopened, ready_for_review]\r\n\r\npermissions:\r\n contents: read\r\n pull-requests: write\r\n\r\njobs:\r\n aggregate-kpis:\r\n if: github.event.pull_request.draft == false\r\n name: Aggregate PR KPIs & Telemetry\r\n runs-on: ubuntu-latest\r\n\r\n steps:\r\n - name: Checkout Repository\r\n uses: actions/checkout@v4\r\n with:\r\n fetch-depth: 0\r\n\r\n - name: Install pnpm\r\n uses: pnpm/action-setup@v4\r\n with:\r\n version: 10\r\n\r\n - name: Setup Node.js\r\n uses: actions/setup-node@v4\r\n with:\r\n node-version: 20\r\n\r\n - name: Install Dependencies\r\n run: |\r\n pnpm install --frozen-lockfile\r\n\r\n - name: Calculate and Emit PR KPIs\r\n id: kpi\r\n run: |\r\n npx @aisdlc/cli kpi pr --base origin/${{ github.base_ref }} --head HEAD >> $GITHUB_STEP_SUMMARY\r\n";
20599
20749
  var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML = 'name: SDD Canonical Integration on Merge\r\n\r\non:\r\n pull_request:\r\n types: [closed]\r\n branches:\r\n - main\r\n - \'release/**\'\r\n workflow_dispatch:\r\n inputs:\r\n change_id:\r\n description: \'SDD change ID to integrate manually (e.g. chg-001-telemetry)\'\r\n required: false\r\n type: string\r\n\r\npermissions:\r\n contents: write\r\n pull-requests: read\r\n\r\nconcurrency:\r\n group: sdd-integrate-${{ github.event.pull_request.base.ref || github.ref_name }}\r\n cancel-in-progress: false\r\n\r\njobs:\r\n integrate-sdd:\r\n name: SDD Canonical Integration\r\n if: github.event.pull_request.merged == true || github.event_name == \'workflow_dispatch\'\r\n runs-on: ubuntu-latest\r\n\r\n steps:\r\n - name: Checkout Repository\r\n uses: actions/checkout@v4\r\n with:\r\n ref: ${{ github.event.pull_request.base.ref || github.ref_name }}\r\n fetch-depth: 0\r\n token: ${{ secrets.GITHUB_TOKEN }}\r\n\r\n - name: Install pnpm\r\n uses: pnpm/action-setup@v4\r\n with:\r\n version: 10\r\n\r\n - name: Setup Node.js\r\n uses: actions/setup-node@v4\r\n with:\r\n node-version: 20\r\n\r\n - name: Install Dependencies\r\n run: |\r\n pnpm install --frozen-lockfile\r\n pnpm approve-builds --all\r\n\r\n - name: Build Packages\r\n run: pnpm run build\r\n\r\n - name: Detect and Integrate SDD Change\r\n id: integrate\r\n env:\r\n PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}\r\n PR_TITLE: ${{ github.event.pull_request.title }}\r\n PR_BODY: ${{ github.event.pull_request.body }}\r\n MANUAL_CHANGE_ID: ${{ github.event.inputs.change_id }}\r\n run: |\r\n npx @aisdlc/cli sdd integrate --auto || true\r\n\r\n - name: Commit and Push Canonical Baseline Changes\r\n run: |\r\n git config user.name "github-actions[bot]"\r\n git config user.email "github-actions[bot]@users.noreply.github.com"\r\n git add -A\r\n if ! git diff --cached --quiet; then\r\n git commit -m "chore(sdd): integrate changes into canonical baseline [skip ci]"\r\n TARGET_BRANCH="${{ github.event.pull_request.base.ref || github.ref_name }}"\r\n MAX_RETRIES=3\r\n RETRY_COUNT=0\r\n DELAY=2\r\n\r\n while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do\r\n echo "Synchronizing with remote branch $TARGET_BRANCH (pull --rebase)..."\r\n git pull --rebase origin "$TARGET_BRANCH"\r\n if git push origin "$TARGET_BRANCH"; then\r\n echo "\u2714 Canonical integration committed and synchronized to repository."\r\n exit 0\r\n fi\r\n RETRY_COUNT=$((RETRY_COUNT + 1))\r\n if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then\r\n echo "\u26A0 Push rejected (concurrency detected). Retrying in ${DELAY}s (attempt $RETRY_COUNT/$MAX_RETRIES)..."\r\n sleep $DELAY\r\n DELAY=$((DELAY * 2))\r\n fi\r\n done\r\n\r\n echo "\u274C Error: Failed to push canonical integration after $MAX_RETRIES attempts."\r\n exit 1\r\n else\r\n echo "\u2139 No pending changes generated in working tree."\r\n fi\r\n';
20750
+ var STARTER_TEMPLATES_CI_OBSERVABILITY_GRAFANA_DATASOURCES_YML = "# ==============================================================================\n# AI-SDLC: Grafana Pre-Provisioned Datasources\n# ==============================================================================\napiVersion: 1\n\ndatasources:\n - name: Prometheus\n type: prometheus\n access: proxy\n url: http://prometheus:9090\n isDefault: true\n editable: true\n";
20751
+ var STARTER_TEMPLATES_CI_OBSERVABILITY_PROMETHEUS_YML = '# ==============================================================================\n# AI-SDLC: Prometheus Configuration (Live Scraping + Persistent TSDB)\n# For offline/post-mortem backfill from OpenMetrics snapshots:\n# docker exec aisdlc-prometheus promtool tsdb create-blocks-from openmetrics /observability/metrics/metrics.prom /prometheus\n# ==============================================================================\nglobal:\n scrape_interval: 15s\n evaluation_interval: 15s\n\nscrape_configs:\n - job_name: "prometheus"\n static_configs:\n - targets: ["localhost:9090"]\n\n - job_name: "app-runtime"\n metrics_path: "/metrics"\n static_configs:\n - targets: ["host.docker.internal:9464"]\n';
20752
+ var STARTER_TEMPLATES_CODING_RULES_GO__GOLANGCI_YML = '# AI-SDLC: Immutable Go & Testing Linter Guardrails\nrun:\n tests: true\n\nissues:\n max-issues-per-linter: 0\n max-same-issues: 0\n\nlinters:\n enable:\n - errcheck\n - govet\n - staticcheck\n - unused\n - ineffassign\n - testifylint\n - thelper\n - forbidigo\n\nlinters-settings:\n testifylint:\n enable-all: true\n forbidigo:\n analyze-types: true\n forbid:\n - p: ^testing\\.T\\.Skip.*$\n msg: "Skipping unit tests with t.Skip() is forbidden by AI-SDLC."\n';
20753
+ var STARTER_TEMPLATES_CODING_RULES_KOTLIN_DETEKT_YML = "# AI-SDLC: Immutable Detekt Rules for Kotlin & Unit Tests\nbuild:\n maxIssues: 0\n\npotential-bugs:\n active: true\n IgnoredReturnValue:\n active: true\n UnreachableCode:\n active: true\n\nexceptions:\n active: true\n SwallowedException:\n active: true\n EmptyCatchBlock:\n active: true\n\nstyle:\n active: true\n ForbiddenAnnotation:\n active: true\n annotations:\n - 'org.junit.jupiter.api.Disabled'\n - 'org.junit.Ignore'\n - 'kotlin.test.Ignore'\n";
20600
20754
  var STARTER_TEMPLATES_COMPLIANCE_COMMERCIAL_ACQUISITION_REQUEST_TEMPLATE_MD = '---\r\nid: REQ-LIC-ACQUISITION-001\r\ntype: license-acquisition-request\r\ntitle: Commercial License Acquisition Request for [Library]\r\nstatus: pending-approval # pending-approval, approved, rejected\r\nrequested-package: "@vendor/commercial-package"\r\nspdx-license: "BSL-1.1" # or Commercial, SSPL-1.0\r\nlicense-category: commercial_acquisition_required\r\nestimated-cost: "$1,200 / year"\r\nbusiness-justification: "Accelerates critical telemetry module development avoiding 4 months of in-house implementation."\r\n---\r\n\r\n# Commercial License Acquisition Request\r\n\r\n## 1. Package and Vendor\r\n- **Package**: `@vendor/commercial-package`\r\n- **Version**: `2.4.0`\r\n- **License Type**: BSL 1.1 / Commercial\r\n- **Official Website**: `https://vendor.example.com`\r\n\r\n## 2. Technical Justification and Evaluated Alternatives\r\n- **Why a permissive alternative (MIT/Apache 2.0) is not used**:\r\n - Open-source alternatives lack required hardware encryption protocol support.\r\n- **Impact of not acquiring the license**:\r\n - 4-month delay on product delivery milestone.\r\n\r\n## 3. Human Authorization Signatures\r\n- [ ] Tech Lead: Technical approval\r\n- [ ] Legal / IP Counsel: EULA clauses validation\r\n- [ ] Procurement / Budget Owner: Payment authorization\r\n';
20601
20755
  var STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD = '---\r\nid: MAN-PROD-001\r\ntype: production-manual\r\ntitle: "Production & Operations Manual: Application Name"\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\napplies-to-version: "v1.0.0"\r\ntarget-audience:\r\n - devops-engineer\r\n - sre-engineer\r\n - release-manager\r\n - secops\r\ncomponents-covered:\r\n - CMP-NAME-001\r\nenclaves-involved:\r\n - SEC-ENC-DMZ-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# MAN-PROD-001: Production & Operations Manual - Application Name\r\n\r\n## 1. Deterministic Release Regeneration (Reproducible Builds)\r\n\r\nThis section contains the specifications and directives required to deterministically reproduce identical bit-by-bit application artifacts or releases from their Git tag.\r\n\r\n### 1.1 Source Code Baseline\r\n\r\n- **Canonical Repository**: `https://github.com/organization/repo-name.git`\r\n- **Immutable Git Release Tag**: `v1.0.0`\r\n- **Commit SHA-256 / SHA-1**: `[VERIFIED_HEXADECIMAL_COMMIT_SHA]`\r\n- **Clean Checkout Command**:\r\n ```bash\r\n git clone --recurse-submodules https://github.com/organization/repo-name.git\r\n cd repo-name\r\n git checkout tags/v1.0.0\r\n git submodule update --init --recursive\r\n ```\r\n\r\n### 1.2 Frozen Toolchains and Build Tool Matrix\r\n\r\nTo prevent discrepancies in binary or package generation, strict usage of pinned versions of the following utilities is enforced:\r\n\r\n| Tool / Runtime | Exact Version | Toolchain Checksum / Digest | Purpose |\r\n| :--- | :--- | :--- | :--- |\r\n| **Node.js LTS** | `v22.12.0` | `sha256:node-v22.12.0-linux-x64.tar.xz` | Execution and transpilation runtime |\r\n| **pnpm** | `9.15.0` | `sha256:pnpm-v9.15.0` | Deterministic monorepo package manager |\r\n| **TypeScript (tsc)** | `5.7.2` | Pinned in `devDependencies` | Strict ECMAScript compiler |\r\n| **Docker BuildKit** | `v0.18.0` | `moby/buildkit:v0.18.0` | Hermetic OCI packaging engine |\r\n\r\n### 1.3 Libraries, Dependencies, and Vertex Graph\r\n\r\n- **Immutable Lockfile**: `pnpm-lock.yaml` (or `Cargo.lock`, `go.sum`, `requirements.lock`). Installations with open resolution are forbidden (`pnpm install --frozen-lockfile` mandatory).\r\n- **SBOM (Software Bill of Materials) Inventory**:\r\n - Format: CycloneDX JSON v1.5 / SPDX v2.3.\r\n - Compiled SBOM path: `reports/sbom-cyclonedx.json`.\r\n- **OSS License Governance**:\r\n - Binding policy: `license-policy.yaml`.\r\n - Library vertex pre-verification:\r\n ```bash\r\n pnpm verify:licenses\r\n ```\r\n\r\n### 1.4 Step-by-Step Deterministic Build Procedure\r\n\r\n1. **Step 1: Hermetic Dependency Installation**\r\n ```bash\r\n pnpm install --frozen-lockfile --ignore-scripts\r\n ```\r\n\r\n2. **Step 2: Integrity and Strict Type Checking**\r\n ```bash\r\n pnpm typecheck\r\n ```\r\n\r\n3. **Step 3: Artifact Compilation**\r\n ```bash\r\n export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)\r\n pnpm build\r\n ```\r\n\r\n4. **Step 4: Cryptographic Verification of Generated Artifact**\r\n ```bash\r\n sha256sum dist/app.bundle.js\r\n # Compare against the canonical checksum registered in official release:\r\n # Expected: [CANONICAL_SHA256_CHECKSUM]\r\n ```\r\n\r\n\r\n\r\n5. **Step 5: Sigstore / Cosign Signature and SLSA Provenance Verification**\r\n ```bash\r\n # Verify npm package provenance from registry\r\n npm audit signatures\r\n\r\n # Verify package tarball with Sigstore / Cosign (Keyless via OIDC identity)\r\n cosign verify-blob \\\r\n --bundle release-artifacts/package.tgz.bundle \\\r\n --certificate-identity-regexp "^https://github.com/organization/repo-name/.*$" \\\r\n --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \\\r\n release-artifacts/package.tgz\r\n\r\n # Verify SLSA Build Provenance Attestation using GitHub CLI\r\n gh attestation verify release-artifacts/package.tgz --repo organization/repo-name\r\n ```\r\n\r\n---\r\n\r\n## 2. Version, Infrastructure, and Migration Compatibility Matrix\r\n\r\nThis section defines technical interoperability boundaries between the release version and the deployment ecosystem, ensuring safe Zero-Downtime transitions.\r\n\r\n### 2.1 Platform and Execution Runtime Compatibility\r\n\r\n| Infrastructure Component | Approved Version Range | Recommended Version | Support Status |\r\n| :--- | :--- | :--- | :---: |\r\n| **Kubernetes Cluster (K8s)** | `>= 1.28` and `<= 1.31` | `1.30.2` | \u2705 Certified |\r\n| **Container Runtime (CRI)** | containerd `>= 1.7` / CRI-O `>= 1.28` | containerd `1.7.15` | \u2705 Certified |\r\n| **Base Operating System (Host)** | Ubuntu 22.04 LTS / RHEL 9.2+ | Ubuntu 22.04 LTS (Kernel 6.x) | \u2705 Homologated |\r\n| **Language Runtime (Production)** | Node.js `>= 20.x` and `<= 22.x` | `v22.12.0 LTS` | \u2705 Hermetic |\r\n\r\n### 2.2 Data Schema and Migration Compatibility (N-1 Support)\r\n\r\nTo enable Canary or Blue-Green continuous deployments without transaction loss:\r\n\r\n| Release Version | DB Schema Version | Compatible with $N-1$ Code | Schema Migration Status |\r\n| :---: | :---: | :---: | :--- |\r\n| **`v1.0.0`** (Current) | `SCHEMA-v1.0` | \u2705 Yes (supports `v0.9.x` code) | Non-destructive additive migration (no column renaming). |\r\n| **`v0.9.x`** | `SCHEMA-v0.9` | \u2705 Previous baseline | Fully compatible during Canary drain period. |\r\n\r\n### 2.3 Interoperability Between Architecture Components (`CMP-*`)\r\n\r\n| Dependent Component | Consumed Component | Minimum Compatible Versions | Binding Protocol / Contract |\r\n| :--- | :--- | :---: | :--- |\r\n| `CMP-NAME-001` (Gateway) | `CMP-NAME-002` (Backend) | `>= v1.0.0` | gRPC / Protobuf v3 (`contract_spec.proto`) |\r\n| `CMP-NAME-001` (Gateway) | Messaging Bus / Kafka | `>= 3.5.0` | Kafka v2 Protocol with TLS mTLS |\r\n\r\n### 2.4 Homologated Upgrade & Rollback Paths\r\n\r\n| Source Version | Direct Jump to `v1.0.0` | Intermediate Migration Required | Direct Rollback Procedure |\r\n| :---: | :---: | :---: | :---: |\r\n| **`v0.9.1`** | \u2705 Allowed | \u274C Not required | `kubectl rollout undo` without data loss. |\r\n| **`v0.9.0`** | \u2705 Allowed | \u274C Not required | `kubectl rollout undo` without data loss. |\r\n| **`< v0.9.0`** | \u274C Blocked | \u2705 Must upgrade to `v0.9.1` first | Requires restore from backup snapshot. |\r\n\r\n---\r\n\r\n## 3. CI/CD Architecture and Pipelines\r\n\r\n### 3.1 Hierarchical Branching Model and Integration Triggers\r\n\r\nFollowing the AI-SDLC 4-tier standard:\r\n\r\n```text\r\nTIER 1: main (Production)\r\n \u25B2\r\n \u2514\u2500\u2500 PR Release Gate (Manual Tech Lead / Release Manager Approval)\r\n \u2502\r\nTIER 2: release/v1.0.0 (Open Version Branch)\r\n \u25B2\r\n \u2514\u2500\u2500 PR Feature Gate (Lint + Tests + Quality Gate + SAST + SBOM)\r\n \u2502\r\nTIER 3: feat/CHG-001-* (Feature / Bug)\r\n```\r\n\r\n- **Pull Request Trigger**: Executes linters, full test battery, and governance verifications without deployment.\r\n- **Release Tag Trigger (`v*.*.*`)**: Executes the full hermetic build pipeline, image signing, and continuous deployment.\r\n\r\n### 3.2 CI/CD Pipeline Flowchart\r\n\r\n```mermaid\r\nflowchart LR\r\n A["Git Push / Tag v1.0.0"] --> B["Hermetic Checkout"]\r\n B --> C["Linters & Typecheck"]\r\n C --> D["Vitest: Unit & BDD"]\r\n D --> E["Quality Gate: CC & MI"]\r\n E --> F["SAST & Secret Scan"]\r\n F --> G["SBOM & License Gate"]\r\n G --> H["Deterministic Build"]\r\n H --> I["Cosign / SLSA Signing"]\r\n I --> J["Push to OCI Registry"]\r\n J --> K["Deploy to DMZ Enclave"]\r\n```\r\n\r\n### 3.3 Release Gate Contracts and Thresholds\r\n\r\n| Quality Gate | Tool / Command | Required Threshold | Action on Non-Compliance |\r\n| :--- | :--- | :--- | :--- |\r\n| **Lint & Typecheck** | `pnpm typecheck` | Zero errors, zero `any` | **Immediate failure** |\r\n| **Automated Tests** | `pnpm test:all` | 100% passed, Coverage >= 85% | **Immediate failure** |\r\n| **Cyclomatic Complexity** | `aisdlc verify quality` | CC <= 10 per function | **Release blocked** |\r\n| **Maintainability Index** | `aisdlc verify quality` | MI >= 50.0 / 100 | **Release blocked** |\r\n| **360\xB0 Traceability** | `aisdlc verify traceability` | 100% of requirements linked | **Release blocked** |\r\n| **OSS Licenses** | `aisdlc verify licenses` | Zero forbidden/viral licenses | **Release blocked** |\r\n| **Cryptographic Signature & SLSA** | `cosign verify-blob` / `gh attestation verify` | Valid signature and SLSA provenance from GitHub Actions OIDC | **Deployment rejected** |\r\n\r\n---\r\n\r\n## 4. Production Deployment Strategy and Procedure\r\n\r\n### 4.1 Infrastructure Prerequisites and Network Enclaves\r\n\r\n- **Target Enclave**: `SEC-ENC-DMZ-001` (Strict segmentation without direct uncontrolled outbound internet access).\r\n- **Enabled Network Ports**:\r\n - Port `8443/TCP`: Secure WebSocket ingestion with mutual TLS (mTLS) authentication.\r\n - Port `9090/TCP`: Prometheus metrics (internal management network only).\r\n- **Secrets and Certificate Management**:\r\n - Server TLS and client root CA certificates mounted via immutable secret at `/etc/pki/tls/`.\r\n - Embedding cryptographic keys in environment variables or images is strictly forbidden.\r\n\r\n### 4.2 Rollout Strategy\r\n\r\nA **Canary strategy with progressive telemetry metrics analysis** is utilized:\r\n1. 10% of traffic is routed to the new version for 15 minutes.\r\n2. If the 5xx error rate is `<= 0.01%` and p99 latency is `<= 50ms`, traffic is promoted to 100%.\r\n\r\n### 4.3 Step-by-Step Deployment Procedure\r\n\r\n1. **Step 1: Pre-deployment and State Snapshot**\r\n ```bash\r\n # Check cluster health and record baseline\r\n kubectl get pods -n production -l app=system\r\n kubectl exec -it system-db-0 -- /backup/create-snapshot.sh\r\n ```\r\n\r\n2. **Step 2: Deployment Manifest Application**\r\n ```bash\r\n kubectl apply -f deploy/production/canary-deployment.yaml\r\n kubectl rollout status deployment/system-service -n production --timeout=180s\r\n ```\r\n\r\n3. **Step 3: Health Verification and Smoke Tests**\r\n ```bash\r\n curl -f --cacert /etc/pki/tls/ca.crt https://127.0.0.1:8443/healthz\r\n curl -f --cacert /etc/pki/tls/ca.crt https://127.0.0.1:8443/readyz\r\n pnpm test:example\r\n ```\r\n\r\n### 4.4 Rollback Plan (Immediate Rollback)\r\n\r\n- **Objective Rollback Activation Criteria**:\r\n - mTLS handshake failure rate `> 1.0%`.\r\n - Ingestion p99 latency `> 100ms` for 2 continuous minutes.\r\n - Critical `CrashLoopBackOff` alert on more than 20% of instances.\r\n- **Rollback Execution Command**:\r\n ```bash\r\n kubectl rollout undo deployment/system-service -n production\r\n kubectl rollout status deployment/system-service -n production\r\n ```\r\n\r\n---\r\n\r\n## 5. Likely Errors Resolution and Troubleshooting (Runbooks)\r\n\r\nThis section documents the most frequent runtime and deployment failures along with diagnosis and immediate mitigation procedures.\r\n\r\n### 5.1 Frequent Incidents and Solutions Matrix\r\n\r\n#### Incident 1: Dependency Vertex Inconsistency or Drift (Build Failure)\r\n- **Symptom**: `pnpm install --frozen-lockfile` command fails in CI with error `ERR_PNPM_LOCKFILE_OUTDATED`.\r\n- **Root Cause**: `package.json` was modified without updating `pnpm-lock.yaml`.\r\n- **Diagnosis**:\r\n ```bash\r\n git diff HEAD^ package.json pnpm-lock.yaml\r\n ```\r\n- **Mitigation**:\r\n 1. On the feature branch, run `pnpm install` locally to regenerate the deterministic lockfile.\r\n 2. Verify no restricted-license dependencies were introduced via `pnpm verify:licenses`.\r\n 3. Commit both files together in an atomic commit.\r\n\r\n---\r\n\r\n#### Incident 2: mTLS Handshake Failure or Enclave Certificate Rejected\r\n- **Symptom**: Clients receive error `ERR_TLS_CERT_ALTNAME_INVALID` or connection closed with TLS alert `certificate_unknown (46)`.\r\n- **Root Cause**: Internal root CA mounted on server does not match the client certificate issuer CA, or certificate expired.\r\n- **Diagnosis**:\r\n ```bash\r\n openssl s_client -connect 127.0.0.1:8443 -CAfile /etc/pki/tls/ca.crt -cert /etc/pki/tls/client.crt -key /etc/pki/tls/client.key\r\n openssl x509 -in /etc/pki/tls/ca.crt -noout -dates -issuer -subject\r\n ```\r\n- **Mitigation**:\r\n 1. Verify expiration date of certificate mounted in cluster Secret.\r\n 2. If expired, rotate the certificate by injecting the new pair from HSM / Vault storage.\r\n 3. Orderly restart pods with `kubectl rollout restart deployment/system-service`.\r\n\r\n---\r\n\r\n#### Incident 3: Release Gate Rejection in CI/CD Due to Quality Metrics\r\n- **Symptom**: Pipeline aborts with verdict `Quality Gate REJECTED` (Cyclomatic Complexity > 10 or Maintainability < 50).\r\n- **Root Cause**: Introduction of complex nested logic (multiple `if/else`, extensive `switch`, or branching loops).\r\n- **Diagnosis**:\r\n ```bash\r\n pnpm verify:quality\r\n ```\r\n- **Mitigation**:\r\n 1. Inspect the violation report in `reports/QUALITY_GATE_REPORT.md` to identify the offending function.\r\n 2. Decompose function into cohesive private helper methods following the rule of maximum 40 lines per function.\r\n 3. Re-run `pnpm verify:quality` until green verdict is confirmed. Adding suppression comments (`// @ts-ignore`) is forbidden.\r\n\r\n---\r\n\r\n#### Incident 4: CrashLoopBackOff Due to Memory Leak or Connection Limit\r\n- **Symptom**: Pod is terminated with exit code `ExitCode: 137` (`OOMKilled`) after a load spike.\r\n- **Root Cause**: Undrained socket buffer accumulation during high-frequency bursts.\r\n- **Diagnosis**:\r\n ```bash\r\n kubectl describe pod system-service-xxx -n production | grep -i oom\r\n kubectl logs system-service-xxx -n production --previous\r\n ```\r\n- **Mitigation**:\r\n 1. Temporarily adjust memory limits in Kubernetes manifest (`resources.limits.memory`) if the load burst is legitimate.\r\n 2. Apply backpressure or discard expired packets in accordance with business rules (`BR-*`).\r\n 3. Run local benchmark with `pnpm test:all` to audit memory consumption.\r\n\r\n---\r\n\r\n### 5.2 Escalation Protocol and Critical Incident Management\r\n\r\n| Severity Level | Impact Criterion | Maximum Response Time | Roles Involved |\r\n| :--- | :--- | :---: | :--- |\r\n| **SEV-1 (Critical)** | Complete service outage or security breach in enclave. | 15 minutes | On-call SRE + Lead Architect + SecOps |\r\n| **SEV-2 (Major)** | Severe service degradation, massive retries without outage. | 1 hour | On-call SRE + Tech Lead |\r\n| **SEV-3 (Minor)** | Isolated node incident without global SLA impact. | 4 hours | Support Engineer / DevOps |\r\n\r\n---\r\n\r\n## 6. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-15 | Operations & DevOps Team | Initial Production Manual generation | CHG-009 |\r\n';
20602
20756
  var STARTER_TEMPLATES_MANUALS_USER_MANUAL_TEMPLATE_MD = '---\r\nid: MAN-USER-001\r\ntype: user-manual\r\ntitle: "User Manual: Application Name"\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\napplies-to-version: "v1.0.0"\r\ntarget-audience:\r\n - ACT-ROLE-USER-001\r\n - ACT-OPERATOR-002\r\nallowed-roles:\r\n - ACT-ROLE-USER-001\r\n - ACT-OPERATOR-002\r\njourneys-covered:\r\n - JRN-JOURNEY-001\r\nuse-cases-covered:\r\n - UC-ACTION-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# MAN-USER-001: User Manual - Application Name\r\n\r\n## 1. System Purpose and Audience\r\n\r\nConcisely describes the software\'s purpose, the operational value it delivers to end users, and the general context in which it operates.\r\n\r\n- **Application / System**: `[System Name or Bounded Context]`\r\n- **Software Version**: `v1.0.0`\r\n- **Target Audience**: `[Functional roles and user profiles addressed]`\r\n\r\n---\r\n\r\n## 2. User Role Catalog and Permissions Matrix (RBAC)\r\n\r\nThis section formally defines the roles authorized to access and operate the application, as well as the privileges assigned to each.\r\n\r\n### 2.1 Authorized Role Catalog\r\n\r\n| Role Identifier | Role Name | Associated Actor | Description & Responsibility | Enclave / Access Level |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **`ROLE_USER`** | Standard User | `ACT-ROLE-USER-001` | Data queries and nominal business flow execution. | Corporate Network / Web UI |\r\n| **`ROLE_OPERATOR`** | System Operator | `ACT-OPERATOR-002` | Streaming supervision, alert management, and command control. | DMZ Enclave / Operational Console |\r\n\r\n### 2.2 Access and Capabilities Matrix by Role\r\n\r\n| Application Capability / Module | `ROLE_USER` | `ROLE_OPERATOR` | Authentication Mode |\r\n| :--- | :---: | :---: | :--- |\r\n| Status Query and Dashboard Visualizations | \u2705 Allowed | \u2705 Allowed | Bearer Token (OIDC/JWT) |\r\n| Business Journey Execution (`JRN-JOURNEY-001`) | \u2705 Allowed | \u2705 Allowed | Bearer Token (OIDC/JWT) |\r\n| Real-Time Streaming and Operational Control | \u274C Denied | \u2705 Allowed | mTLS + Device X.509 Certificate |\r\n| Global Parameters Configuration & Connectivity | \u274C Denied | \u2705 Allowed | Administrator Credential |\r\n\r\n---\r\n\r\n## 3. Version and User Platform Compatibility Matrix\r\n\r\nThis section specifies cross-compatibility between the current application version and user environments, clients, and formats.\r\n\r\n### 3.1 Client-Server Compatibility (APIs and SDKs)\r\n\r\n| Application Version (Backend) | Compatible CLI Version | Compatible SDK Version | Compatibility Status | Migration Notes |\r\n| :---: | :---: | :---: | :---: | :--- |\r\n| **`v1.0.0`** (Current) | `>= v1.0.0` | `>= v1.0.0` | \u2705 Fully Supported | Active canonical version. |\r\n| **`v1.0.0`** (Current) | `v0.9.x` | `v0.9.x` | \u26A0\uFE0F Degraded Mode | Requires upgrade before next minor. |\r\n| **`v1.0.0`** (Current) | `< v0.9.0` | `< v0.9.0` | \u274C Incompatible / Deprecated | Legacy endpoints decommissioned. |\r\n\r\n### 3.2 Homologated Browsers and Client Platforms\r\n\r\n| Platform / Environment | Minimum Supported Versions | Support Level | Known Constraints |\r\n| :--- | :--- | :---: | :--- |\r\n| **Google Chrome / Chromium** | Version `>= 120` | Tier 1 (Official) | Optimal WebSockets and WebGL performance. |\r\n| **Mozilla Firefox** | Version `>= 115 ESR` | Tier 1 (Official) | Full client certificate support. |\r\n| **Safari / WebKit** | Version `>= 17.0` | Tier 2 (Functional) | Requires explicit mTLS enablement in macOS Keychain. |\r\n| **Terminal / CLI (Linux / macOS / Windows)** | Node.js `>= 18` or Bash `>= 5.0` | Tier 1 (Official) | Full support on PowerShell 7+ and bash. |\r\n\r\n### 3.3 Configuration Files and Data Formats Compatibility\r\n\r\n| Format / Artifact | Source Version Supported | Automatic Conversion | User Action Required |\r\n| :--- | :---: | :---: | :--- |\r\n| **`config.yaml`** | `v0.9.x` | \u2705 Yes | None. Application migrates deprecated keys on startup. |\r\n| **Export Profiles (`.json`)** | `v0.9.x` | \u2705 Yes | 100% backward compatible. |\r\n\r\n---\r\n\r\n## 4. Application Installation, Access, and Configuration\r\n\r\n### 4.1 Access Channels and Prerequisites\r\n\r\n- **Web Portal / UI**: Access URL (e.g., `https://app.system.internal`).\r\n- **Command Line (CLI)**: Executable binary or package (e.g., `npx system-cli` or `./system-client`).\r\n- **Supported Browsers or Platforms**: Chrome >= 120, Firefox >= 120, Linux/macOS/Windows terminal.\r\n\r\n### 4.2 Client Configuration and Environment Variables\r\n\r\nThe application allows parameterizing its behavior via environment variables or local configuration files:\r\n\r\n| Parameter / Variable | Type | Default Value | Required | Description |\r\n| :--- | :--- | :--- | :---: | :--- |\r\n| `API_ENDPOINT` | URL | `https://api.system.internal/v1` | Yes | Base backend API endpoint. |\r\n| `WS_STREAM_URL` | WSS URL | `wss://stream.system.internal/telemetry` | No | Real-time telemetry or notifications socket. |\r\n| `CLIENT_TIMEOUT_MS` | Integer | `5000` | No | Network response timeout in milliseconds. |\r\n| `AUTH_PROFILE` | String | `production` | No | Active authentication profile (`development`, `staging`, `production`). |\r\n\r\n### 4.3 Local Configuration File (`config.yaml` / `.env`)\r\n\r\nExample recommended configuration for operator workstations:\r\n\r\n```yaml\r\n# Client configuration file: config.yaml\r\nprofile: production\r\nnetwork:\r\n api_endpoint: "https://api.system.internal/v1"\r\n stream_url: "wss://stream.system.internal/telemetry"\r\n timeout_ms: 5000\r\n retry_attempts: 3\r\n\r\nsecurity:\r\n tls_verify: true\r\n client_cert_path: "/etc/pki/client/operator.crt"\r\n client_key_path: "/etc/pki/client/operator.key"\r\n\r\nui:\r\n theme: "dark"\r\n refresh_interval_sec: 1\r\n```\r\n\r\n---\r\n\r\n## 5. Step-by-Step Journey Execution Guide (`JRN-*`)\r\n\r\nEach subsection documents an end-to-end Journey, specifying authorized execution roles, starting conditions, and the step-by-step operating procedure.\r\n\r\n### 5.1 `JRN-JOURNEY-001`: User Journey Name\r\n\r\n- **Linked Use Case**: `UC-ACTION-001`\r\n- **Primary Actor**: `ACT-ROLE-USER-001`\r\n- **Authorized Roles**: `ROLE_USER`, `ROLE_OPERATOR`\r\n- **Required Execution Enclave**: Corporate Intranet or VPN access\r\n\r\n#### A. Preconditions\r\n1. User must have an active and authenticated session with their authorized role.\r\n2. The base entity or resource must be in `ACTIVE` state.\r\n\r\n#### B. Step-by-Step Procedure\r\n\r\n1. **Step 1: Operation Initiation**\r\n - **Action**: User navigates to the execution section or invokes the corresponding command:\r\n ```bash\r\n system-cli execute --journey JRN-JOURNEY-001 --input payload.json\r\n ```\r\n - **Required Input**: Resource identifier and validated parameters.\r\n - **Expected On-Screen Response**: System displays confirmation dialog with operation summary.\r\n\r\n2. **Step 2: Validation and Submission**\r\n - **Action**: User reviews parameters and confirms execution.\r\n - **System Behavior**: Client locally validates data schema and transmits signed request.\r\n\r\n3. **Step 3: Observable Outcome Verification**\r\n - **Success Outcome**: Console / interface displays success message `MSG-SUCCESS-001` with generated unique transaction ID.\r\n - **Final State**: Resource transitions to `PROCESSED` state.\r\n\r\n#### C. Alternative Flows and Exception Handling\r\n- **Unauthorized Access**: If an unauthorized role attempts to invoke the journey, the system blocks the action, outputs code `MSG-ERR-AUTH-403`, and records the access attempt in the audit trail.\r\n- **Connection Loss in Transit**: If connection is lost during step 2, client retries with exponential backoff up to 3 times before notifying user.\r\n\r\n---\r\n\r\n## 6. System Messages Catalog and Response Codes\r\n\r\nStructured matrix of key informational, warning, and error messages emitted by the application during its operational lifecycle:\r\n\r\n| Code | Severity | Literal Screen Message | Trigger / Context | Meaning for User | Recommended Corrective Action |\r\n| :--- | :--- | :--- | :--- | :--- | :--- |\r\n| **`MSG-SYS-100`** | `INFO` | `"Connection established successfully with server"` | Successful network handshake upon initializing session. | Application is online and ready to process commands. | None. Normal operation. |\r\n| **`MSG-SYS-200`** | `INFO` | `"Operation completed successfully. Transaction ID: [TX-ID]"` | Successful completion of a Journey or Use Case. | Transaction was persisted and acknowledged by backend. | Save `TX-ID` for tracking if required. |\r\n| **`MSG-WARN-301`** | `WARN` | `"High link latency (>500ms). Degraded mode active"` | Response metric exceeds real-time threshold. | Screen data may experience slight refresh delays. | Check network connection quality or bandwidth. |\r\n| **`MSG-WARN-302`** | `WARN` | `"Session expiring in 5 minutes"` | Authentication token approaching TTL expiry. | User will be logged out unless credential is refreshed. | Renew session by clicking alert or re-authenticating. |\r\n| **`MSG-ERR-401`** | `ERR-USER` | `"Invalid credentials or expired token. Access denied"` | Login authentication failure or expired token. | User identity could not be validated. | Re-enter credentials or request a new token. |\r\n| **`MSG-ERR-403`** | `ERR-USER` | `"Unauthorized action for assigned role [ROLE]"` | Attempted execution of Journey or command outside RBAC. | User role lacks permissions for this resource. | Contact administrator to request permission expansion. |\r\n| **`MSG-ERR-422`** | `ERR-USER` | `"Invalid payload: field [FIELD] does not match schema"` | Syntactic validation or business rule (`BR-*`) failure. | User-supplied data is invalid. | Correct indicated fields according to business rule. |\r\n| **`MSG-ERR-503`** | `ERR-SYS` | `"Service temporarily unavailable. Retrying..."` | Backend gateway unreachable or under scheduled maintenance. | Central server is not responding to requests. | Await automatic retries or check system status page. |\r\n\r\n---\r\n\r\n## 7. Frequently Asked Questions (FAQ) and Support\r\n\r\n- **What should I do if I lose connectivity while executing a Journey?** \r\n The application implements idempotency mechanisms. Once network connectivity is restored, verify resource status before retrying to prevent duplicate transactions.\r\n- **How do I request a user role change?** \r\n Contact the Security Administrator (`SecOps`) referencing your user ID and operational justification for the role change.\r\n\r\n---\r\n\r\n## 8. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-15 | Documentation & Product Team | Initial User Manual generation | CHG-009 |\r\n';
@@ -20664,10 +20818,15 @@ var STARTER_BASE_TEMPLATES = [
20664
20818
  { relPath: "templates/ci/.gitlab-ci.yml", content: STARTER_TEMPLATES_CI__GITLAB_CI_YML },
20665
20819
  { relPath: "templates/ci/azure-pipelines.yml", content: STARTER_TEMPLATES_CI_AZURE_PIPELINES_YML },
20666
20820
  { relPath: "templates/ci/bitbucket-pipelines.yml", content: STARTER_TEMPLATES_CI_BITBUCKET_PIPELINES_YML },
20821
+ { relPath: "templates/ci/docker-compose.observability.yml", content: STARTER_TEMPLATES_CI_DOCKER_COMPOSE_OBSERVABILITY_YML },
20667
20822
  { relPath: "templates/ci/github-workflows/ci.yml", content: STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML },
20668
20823
  { relPath: "templates/ci/github-workflows/deploy-dashboard.yml", content: STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML },
20669
20824
  { relPath: "templates/ci/github-workflows/pr-kpi-summary.yml", content: STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML },
20670
20825
  { relPath: "templates/ci/github-workflows/sdd-integrate-on-merge.yml", content: STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML },
20826
+ { relPath: "templates/ci/observability/grafana-datasources.yml", content: STARTER_TEMPLATES_CI_OBSERVABILITY_GRAFANA_DATASOURCES_YML },
20827
+ { relPath: "templates/ci/observability/prometheus.yml", content: STARTER_TEMPLATES_CI_OBSERVABILITY_PROMETHEUS_YML },
20828
+ { relPath: "templates/coding-rules/go/.golangci.yml", content: STARTER_TEMPLATES_CODING_RULES_GO__GOLANGCI_YML },
20829
+ { relPath: "templates/coding-rules/kotlin/detekt.yml", content: STARTER_TEMPLATES_CODING_RULES_KOTLIN_DETEKT_YML },
20671
20830
  { relPath: "templates/compliance/commercial-acquisition-request.template.md", content: STARTER_TEMPLATES_COMPLIANCE_COMMERCIAL_ACQUISITION_REQUEST_TEMPLATE_MD },
20672
20831
  { relPath: "templates/manuals/production-manual.template.md", content: STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD },
20673
20832
  { relPath: "templates/manuals/user-manual.template.md", content: STARTER_TEMPLATES_MANUALS_USER_MANUAL_TEMPLATE_MD },
@@ -20953,12 +21112,14 @@ require('../../scripts/guard-branch.cjs');
20953
21112
  `;
20954
21113
  var STARTER_GUARD_BRANCH_CJS = `#!/usr/bin/env node
20955
21114
  /**
20956
- * AI-SDLC: Antigravity PreToolUse Branch & Immutable Coding Rules Guard Hook
21115
+ * AI-SDLC: Antigravity PreToolUse Branch, Coding Rules & SDD Increment Guard Hook
20957
21116
  * 1. Prevents AI agents from modifying or writing files directly on protected branches (main, master, release/*).
20958
21117
  * 2. Prevents AI agents from modifying or weakening deployed coding rules files once created.
21118
+ * 3. Enforces an active SDD increment in specs/changes/active/ before modifying source, test, or Anti-Bypass paths.
20959
21119
  */
20960
21120
 
20961
21121
  const { execSync } = require('child_process');
21122
+ const fs = require('fs');
20962
21123
  const path = require('path');
20963
21124
 
20964
21125
  const PROTECTED_CODING_RULES_FILES = [
@@ -20976,6 +21137,25 @@ const PROTECTED_CODING_RULES_FILES = [
20976
21137
  '.github/CODEOWNERS',
20977
21138
  ];
20978
21139
 
21140
+ const PROTECTED_BYPASS_PATTERNS = [
21141
+ /^schemas\\//i,
21142
+ /^examples\\/security\\//i,
21143
+ /^specs\\/security\\//i,
21144
+ /^specs\\/privacy\\//i,
21145
+ /^packages\\/security\\//i,
21146
+ /enclaves?\\//i,
21147
+ /SEC-ENC-/,
21148
+ /quality-policy\\.ya?ml$/i,
21149
+ /license-policy\\.ya?ml$/i,
21150
+ /privacy-policy\\.ya?ml$/i,
21151
+ /08_security_concept\\.md$/i,
21152
+ /09_decisions\\//i,
21153
+ /migrations?\\//i,
21154
+ /^\\.github\\/CODEOWNERS$/,
21155
+ ];
21156
+
21157
+ const STANDARD_SDD_ARTIFACTS = ['spec.md', 'design.md', 'tasks.md', 'handoff.yaml'];
21158
+
20979
21159
  function getWorkingBranch(cwd) {
20980
21160
  try {
20981
21161
  const sym = execSync('git symbolic-ref --short HEAD', {
@@ -21000,18 +21180,134 @@ function getWorkingBranch(cwd) {
21000
21180
  function isProtectedCodingRulesTarget(targetPath, cwd) {
21001
21181
  if (!targetPath) return false;
21002
21182
  const resolved = path.resolve(cwd, targetPath);
21003
-
21004
21183
  const norm = resolved.replace(/\\\\/g, '/');
21005
21184
  const rel = path.relative(cwd, resolved).replace(/\\\\/g, '/');
21006
- return PROTECTED_CODING_RULES_FILES.some(
21007
- (ruleFile) => rel === ruleFile || norm.endsWith('/' + ruleFile)
21008
- ) || rel.startsWith('templates/coding-rules/');
21185
+ return (
21186
+ PROTECTED_CODING_RULES_FILES.some(
21187
+ (ruleFile) => rel === ruleFile || norm.endsWith('/' + ruleFile)
21188
+ ) || rel.startsWith('templates/coding-rules/')
21189
+ );
21190
+ }
21191
+
21192
+ function isSourceOrTestTarget(relPath) {
21193
+ if (!relPath) return false;
21194
+ return /^(src|lib|packages|tests)\\//.test(relPath.replace(/\\\\/g, '/'));
21195
+ }
21196
+
21197
+ function isProtectedBypassPath(relPath) {
21198
+ if (!relPath) return false;
21199
+ const norm = relPath.replace(/\\\\/g, '/');
21200
+ return PROTECTED_BYPASS_PATTERNS.some((re) => re.test(norm));
21201
+ }
21202
+
21203
+ function detectChangeDirProfile(changeDir) {
21204
+ for (const fileName of ['spec.md', 'proposal.md', 'handoff.yaml']) {
21205
+ const fullPath = path.join(changeDir, fileName);
21206
+ if (!fs.existsSync(fullPath)) continue;
21207
+ try {
21208
+ const content = fs.readFileSync(fullPath, 'utf-8');
21209
+ const match = content.match(/^\\s*profile:\\s*['"]?(patch|standard|critical)['"]?\\s*$/m);
21210
+ if (match) return match[1];
21211
+ } catch {}
21212
+ }
21213
+ return 'standard';
21214
+ }
21215
+
21216
+ function extractBranchChangePrefix(branch) {
21217
+ if (!branch) return '';
21218
+ const match = String(branch).match(/((?:chg|patch)-\\d+)/i);
21219
+ return match ? match[1].toLowerCase() : '';
21220
+ }
21221
+
21222
+ function matchesBranchPrefix(dirName, branchPrefix) {
21223
+ if (!branchPrefix) return true;
21224
+ const lower = dirName.toLowerCase();
21225
+ return lower === branchPrefix || lower.startsWith(branchPrefix + '-');
21226
+ }
21227
+
21228
+ function listActiveChangeDirs(activeRoot, branchPrefix) {
21229
+ if (!fs.existsSync(activeRoot)) return [];
21230
+ try {
21231
+ return fs
21232
+ .readdirSync(activeRoot, { withFileTypes: true })
21233
+ .filter((entry) => entry.isDirectory() && matchesBranchPrefix(entry.name, branchPrefix))
21234
+ .map((entry) => path.join(activeRoot, entry.name));
21235
+ } catch {
21236
+ return [];
21237
+ }
21238
+ }
21239
+
21240
+ function isSatisfiedChangeDir(changeDir, requiresFullSdd) {
21241
+ const profile = detectChangeDirProfile(changeDir);
21242
+ if (profile === 'patch') {
21243
+ return !requiresFullSdd && fs.existsSync(path.join(changeDir, 'spec.md'));
21244
+ }
21245
+ return STANDARD_SDD_ARTIFACTS.every((f) => fs.existsSync(path.join(changeDir, f)));
21246
+ }
21247
+
21248
+ function validateProtectedBypassOnly(candidateDirs, relTargetPath) {
21249
+ const hasPatchCandidate = candidateDirs.some(
21250
+ (dir) => detectChangeDirProfile(dir) === 'patch'
21251
+ );
21252
+ if (hasPatchCandidate) {
21253
+ return {
21254
+ valid: false,
21255
+ reason: \`\u274C [AI-SDLC Anti-Bypass Guard] BLOCKED: Active SDD increment uses 'patch' profile, but '\${relTargetPath}' is a protected Anti-Bypass path. Protected paths require a 'standard' or 'critical' SDD increment in specs/changes/active/ (run aisdlc-increment).\`,
21256
+ };
21257
+ }
21258
+ return { valid: true };
21259
+ }
21260
+
21261
+ function validateSourceOrTestEdit(candidateDirs, branchPrefix, relTargetPath, isBypass) {
21262
+ if (candidateDirs.length === 0) {
21263
+ const prefixHint = branchPrefix ? \` matching '\${branchPrefix}'\` : '';
21264
+ return {
21265
+ valid: false,
21266
+ reason: \`\u274C [AI-SDLC SDD Increment Guard] BLOCKED: Cannot modify '\${relTargetPath}' without an active SDD increment\${prefixHint} in specs/changes/active/. Run the 'aisdlc-increment' skill (Step 0 -> sdd_change_new) first.\`,
21267
+ };
21268
+ }
21269
+ if (candidateDirs.some((dir) => isSatisfiedChangeDir(dir, isBypass))) {
21270
+ return { valid: true };
21271
+ }
21272
+ if (isBypass) {
21273
+ return {
21274
+ valid: false,
21275
+ reason: \`\u274C [AI-SDLC Anti-Bypass Guard] BLOCKED: Protected Anti-Bypass path '\${relTargetPath}' cannot be modified under a 'patch' increment. A 'standard' or 'critical' SDD increment with spec.md, design.md, tasks.md, and handoff.yaml in specs/changes/active/ is required (aisdlc-increment).\`,
21276
+ };
21277
+ }
21278
+ return {
21279
+ valid: false,
21280
+ reason: \`\u274C [AI-SDLC SDD Increment Guard] BLOCKED: Active SDD increment in specs/changes/active/ is incomplete for standard/critical profile (requires spec.md, design.md, tasks.md, and handoff.yaml) before editing '\${relTargetPath}'. Complete SDD scaffolding via aisdlc-increment first.\`,
21281
+ };
21282
+ }
21283
+
21284
+ function hasValidActiveSddIncrement(cwd, branch = '', relTargetPath = 'src/') {
21285
+ if (!relTargetPath || relTargetPath.startsWith('..')) return { valid: true };
21286
+ if (!fs.existsSync(path.join(cwd, 'specs', 'changes'))) return { valid: true };
21287
+
21288
+ const isSourceOrTest = isSourceOrTestTarget(relTargetPath);
21289
+ const isBypass = isProtectedBypassPath(relTargetPath);
21290
+ if (!isSourceOrTest && !isBypass) return { valid: true };
21291
+
21292
+ const branchPrefix = extractBranchChangePrefix(branch);
21293
+ const activeRoot = path.join(cwd, 'specs', 'changes', 'active');
21294
+ const candidateDirs = listActiveChangeDirs(activeRoot, branchPrefix);
21295
+
21296
+ if (!isSourceOrTest) return validateProtectedBypassOnly(candidateDirs, relTargetPath);
21297
+ return validateSourceOrTestEdit(candidateDirs, branchPrefix, relTargetPath, isBypass);
21298
+ }
21299
+
21300
+ function isEphemeralPath(normPath) {
21301
+ return (
21302
+ normPath.includes('/.gemini/') ||
21303
+ normPath.includes('/brain/') ||
21304
+ normPath.includes('/scratch/')
21305
+ );
21009
21306
  }
21010
21307
 
21011
21308
  function evaluateGuardDecision(payload) {
21012
21309
  const targetPath = payload.toolCall?.args?.Path || '';
21013
- const workspacePaths = payload.workspacePaths || [];
21014
- const cwd = workspacePaths[0] || process.cwd();
21310
+ const cwd = (payload.workspacePaths || [])[0] || process.cwd();
21015
21311
  const resolvedPath = targetPath ? path.resolve(cwd, targetPath) : '';
21016
21312
  const normPath = resolvedPath.replace(/\\\\/g, '/');
21017
21313
 
@@ -21021,14 +21317,7 @@ function evaluateGuardDecision(payload) {
21021
21317
  reason: \`\u274C [AI-SDLC Immutable Coding Rules Guard] BLOCKED: AI agents are forbidden from modifying protected coding rules file '\${path.basename(targetPath)}'. Fix the source or test code to satisfy the compiler/linter rules instead of altering the rule configuration.\`,
21022
21318
  };
21023
21319
  }
21024
-
21025
- if (
21026
- normPath.includes('/.gemini/') ||
21027
- normPath.includes('/brain/') ||
21028
- normPath.includes('/scratch/')
21029
- ) {
21030
- return { decision: 'allow' };
21031
- }
21320
+ if (isEphemeralPath(normPath)) return { decision: 'allow' };
21032
21321
 
21033
21322
  const branch = getWorkingBranch(cwd);
21034
21323
  if (/^(main|master|release\\/.*)$/.test(branch)) {
@@ -21038,6 +21327,10 @@ function evaluateGuardDecision(payload) {
21038
21327
  };
21039
21328
  }
21040
21329
 
21330
+ const relPath = resolvedPath ? path.relative(cwd, resolvedPath).replace(/\\\\/g, '/') : '';
21331
+ const sddCheck = hasValidActiveSddIncrement(cwd, branch, relPath);
21332
+ if (!sddCheck.valid) return { decision: 'deny', reason: sddCheck.reason };
21333
+
21041
21334
  return { decision: 'allow' };
21042
21335
  }
21043
21336
 
@@ -21057,7 +21350,18 @@ function main() {
21057
21350
  });
21058
21351
  }
21059
21352
 
21060
- main();
21353
+ if (require.main === module) {
21354
+ main();
21355
+ }
21356
+
21357
+ module.exports = {
21358
+ evaluateGuardDecision,
21359
+ hasValidActiveSddIncrement,
21360
+ detectChangeDirProfile,
21361
+ isSourceOrTestTarget,
21362
+ isProtectedBypassPath,
21363
+ isProtectedCodingRulesTarget,
21364
+ };
21061
21365
  `;
21062
21366
  var STACK_FILE_MAP = {
21063
21367
  dotnet: [{ relPath: "Directory.Build.props", content: DOTNET_DIRECTORY_BUILD_PROPS }],
@@ -21263,6 +21567,9 @@ thresholds:
21263
21567
  min_acceptable_score: 50.0
21264
21568
  function_length:
21265
21569
  max_function_lines: 40
21570
+ test_enforcement:
21571
+ require_function_unit_tests: true
21572
+ require_ui_component_tests: true
21266
21573
  `;
21267
21574
  var STARTER_LICENSE_POLICY = `# ==============================================================================
21268
21575
  # AI-SDLC: Open Source License Compliance & Governance Policy
@@ -23980,23 +24287,8 @@ var TimestampedBackupManagerAdapter = class {
23980
24287
  fs12__namespace.mkdirSync(targetBackupDir, { recursive: true, mode: 448 });
23981
24288
  const manifestEntries = [];
23982
24289
  for (const relPath of filesToBackup) {
23983
- const srcFile = path14__namespace.resolve(resolvedRoot, relPath);
23984
- if (fs12__namespace.existsSync(srcFile)) {
23985
- const destFile = path14__namespace.resolve(targetBackupDir, relPath);
23986
- const destDir = path14__namespace.dirname(destFile);
23987
- if (!fs12__namespace.existsSync(destDir)) {
23988
- fs12__namespace.mkdirSync(destDir, { recursive: true });
23989
- }
23990
- const content = fs12__namespace.readFileSync(srcFile, "utf-8");
23991
- fs12__namespace.writeFileSync(destFile, content, "utf-8");
23992
- const digest = this.diffDetector.computeDigest(content);
23993
- const stats = fs12__namespace.statSync(destFile);
23994
- manifestEntries.push({
23995
- path: relPath,
23996
- sha256: digest,
23997
- bytes: stats.size
23998
- });
23999
- }
24290
+ const entry = this.backupSingleFile(resolvedRoot, targetBackupDir, relPath);
24291
+ if (entry) manifestEntries.push(entry);
24000
24292
  }
24001
24293
  const manifest = {
24002
24294
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
@@ -24009,6 +24301,18 @@ var TimestampedBackupManagerAdapter = class {
24009
24301
  );
24010
24302
  return targetBackupDir;
24011
24303
  }
24304
+ backupSingleFile(resolvedRoot, targetBackupDir, relPath) {
24305
+ const srcFile = path14__namespace.resolve(resolvedRoot, relPath);
24306
+ if (!fs12__namespace.existsSync(srcFile)) return null;
24307
+ const destFile = path14__namespace.resolve(targetBackupDir, relPath);
24308
+ const destDir = path14__namespace.dirname(destFile);
24309
+ if (!fs12__namespace.existsSync(destDir)) fs12__namespace.mkdirSync(destDir, { recursive: true });
24310
+ const content = fs12__namespace.readFileSync(srcFile, "utf-8");
24311
+ fs12__namespace.writeFileSync(destFile, content, "utf-8");
24312
+ const digest = this.diffDetector.computeDigest(content);
24313
+ const stats = fs12__namespace.statSync(destFile);
24314
+ return { path: relPath, sha256: digest, bytes: stats.size };
24315
+ }
24012
24316
  async restoreBackup(repoRoot, backupPath) {
24013
24317
  const resolvedRoot = path14__namespace.resolve(repoRoot);
24014
24318
  const manifestPath = path14__namespace.join(backupPath, "manifest.json");
@@ -24449,6 +24753,8 @@ exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
24449
24753
  exports.DEFAULT_PRIVACY_POLICY = DEFAULT_PRIVACY_POLICY;
24450
24754
  exports.DEFAULT_SAST_EXCLUDES = DEFAULT_SAST_EXCLUDES;
24451
24755
  exports.DEFAULT_TEST_ARTIFACT_PATTERNS = DEFAULT_TEST_ARTIFACT_PATTERNS;
24756
+ exports.DEFAULT_UI_COMPONENT_PATTERNS = DEFAULT_UI_COMPONENT_PATTERNS;
24757
+ exports.DEFAULT_UI_TEST_PATTERNS = DEFAULT_UI_TEST_PATTERNS;
24452
24758
  exports.DEFAULT_UNIT_TEST_PATTERNS = DEFAULT_UNIT_TEST_PATTERNS;
24453
24759
  exports.DOTNET_DIRECTORY_BUILD_PROPS = DOTNET_DIRECTORY_BUILD_PROPS;
24454
24760
  exports.DiffDetector = DiffDetector;
@@ -24575,11 +24881,16 @@ exports.STARTER_SCHEMAS_MAP = STARTER_SCHEMAS_MAP;
24575
24881
  exports.STARTER_TASK_TEMPLATE = STARTER_TASK_TEMPLATE;
24576
24882
  exports.STARTER_TEMPLATES_CI_AZURE_PIPELINES_YML = STARTER_TEMPLATES_CI_AZURE_PIPELINES_YML;
24577
24883
  exports.STARTER_TEMPLATES_CI_BITBUCKET_PIPELINES_YML = STARTER_TEMPLATES_CI_BITBUCKET_PIPELINES_YML;
24884
+ exports.STARTER_TEMPLATES_CI_DOCKER_COMPOSE_OBSERVABILITY_YML = STARTER_TEMPLATES_CI_DOCKER_COMPOSE_OBSERVABILITY_YML;
24578
24885
  exports.STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML = STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML;
24579
24886
  exports.STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML = STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML;
24580
24887
  exports.STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML = STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML;
24581
24888
  exports.STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML = STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML;
24889
+ exports.STARTER_TEMPLATES_CI_OBSERVABILITY_GRAFANA_DATASOURCES_YML = STARTER_TEMPLATES_CI_OBSERVABILITY_GRAFANA_DATASOURCES_YML;
24890
+ exports.STARTER_TEMPLATES_CI_OBSERVABILITY_PROMETHEUS_YML = STARTER_TEMPLATES_CI_OBSERVABILITY_PROMETHEUS_YML;
24582
24891
  exports.STARTER_TEMPLATES_CI__GITLAB_CI_YML = STARTER_TEMPLATES_CI__GITLAB_CI_YML;
24892
+ exports.STARTER_TEMPLATES_CODING_RULES_GO__GOLANGCI_YML = STARTER_TEMPLATES_CODING_RULES_GO__GOLANGCI_YML;
24893
+ exports.STARTER_TEMPLATES_CODING_RULES_KOTLIN_DETEKT_YML = STARTER_TEMPLATES_CODING_RULES_KOTLIN_DETEKT_YML;
24583
24894
  exports.STARTER_TEMPLATES_COMPLIANCE_COMMERCIAL_ACQUISITION_REQUEST_TEMPLATE_MD = STARTER_TEMPLATES_COMPLIANCE_COMMERCIAL_ACQUISITION_REQUEST_TEMPLATE_MD;
24584
24895
  exports.STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD = STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD;
24585
24896
  exports.STARTER_TEMPLATES_MANUALS_USER_MANUAL_TEMPLATE_MD = STARTER_TEMPLATES_MANUALS_USER_MANUAL_TEMPLATE_MD;
@@ -24659,6 +24970,7 @@ exports.classifyMetricFromMessage = classifyMetricFromMessage;
24659
24970
  exports.collectAgentFiles = collectAgentFiles;
24660
24971
  exports.collectDashboardMetrics = collectDashboardMetrics;
24661
24972
  exports.collectHistoricalKpis = collectHistoricalKpis;
24973
+ exports.compilePatternList = compilePatternList;
24662
24974
  exports.compileTestPatterns = compileTestPatterns;
24663
24975
  exports.computeAgentPerformanceKpis = computeAgentPerformanceKpis;
24664
24976
  exports.computeCanonicalSha256 = computeCanonicalSha256;
@@ -24767,6 +25079,8 @@ exports.isReviewerRole = isReviewerRole;
24767
25079
  exports.isSemgrepInstalled = isSemgrepInstalled;
24768
25080
  exports.isToolAvailable = isToolAvailable;
24769
25081
  exports.isToolInstalled = isToolInstalled;
25082
+ exports.isUiComponentFile = isUiComponentFile;
25083
+ exports.isUiTestFile = isUiTestFile;
24770
25084
  exports.isUncOrEmptyPath = isUncOrEmptyPath;
24771
25085
  exports.loadDlpPolicy = loadDlpPolicy;
24772
25086
  exports.loadPrivacyPolicy = loadPrivacyPolicy;