@aisdlc/core 2.0.1 → 2.2.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
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
+ var crypto = require('crypto');
3
4
  var fs7 = require('fs');
4
5
  var path4 = require('path');
5
6
  var yaml3 = require('js-yaml');
6
7
  var tsMorph = require('ts-morph');
7
- var crypto = require('crypto');
8
8
  var child_process = require('child_process');
9
9
  var module$1 = require('module');
10
10
 
@@ -29,10 +29,10 @@ function _interopNamespace(e) {
29
29
  return Object.freeze(n);
30
30
  }
31
31
 
32
+ var crypto__namespace = /*#__PURE__*/_interopNamespace(crypto);
32
33
  var fs7__namespace = /*#__PURE__*/_interopNamespace(fs7);
33
34
  var path4__namespace = /*#__PURE__*/_interopNamespace(path4);
34
35
  var yaml3__default = /*#__PURE__*/_interopDefault(yaml3);
35
- var crypto__namespace = /*#__PURE__*/_interopNamespace(crypto);
36
36
  var child_process__namespace = /*#__PURE__*/_interopNamespace(child_process);
37
37
 
38
38
  // src/types/index.ts
@@ -195,7 +195,8 @@ function buildNodeMetrics(node, filePath) {
195
195
  const fullText = node.getFullText();
196
196
  const { loc, mi } = calculateLocAndHalstead(fullText, cyclomatic);
197
197
  const codeSmells = detectAstCodeSmells(node, fullText, filePath);
198
- return { functionName, filePath, loc, cyclomatic, cognitive, maintainability: mi, codeSmells };
198
+ const line = typeof node.getStartLineNumber === "function" ? node.getStartLineNumber() : 1;
199
+ return { functionName, filePath, loc, cyclomatic, cognitive, maintainability: mi, codeSmells, line };
199
200
  }
200
201
  function createTempSourceFile(project, content, filePath) {
201
202
  const ext = path4__namespace.extname(filePath).toLowerCase() || ".ts";
@@ -426,7 +427,7 @@ function buildMetricsFromBlocks(blocks, content, filePath) {
426
427
  }
427
428
  return [];
428
429
  }
429
- return blocks.map((b) => calculatePolyglotMetrics(b.body, b.name, filePath));
430
+ return blocks.map((b) => calculatePolyglotMetrics(b.body, b.name, filePath, b.startLine));
430
431
  }
431
432
  function detectPolyglotSmells(body) {
432
433
  const smells = [];
@@ -456,7 +457,7 @@ function countCommentsAndLoc(rawLines, isPy) {
456
457
  const cleanLines = rawLines.filter((l) => !isCommentLine(l, isPy));
457
458
  return { loc, commentCount, cleanLines };
458
459
  }
459
- function calculatePolyglotMetrics(body, name, filePath) {
460
+ function calculatePolyglotMetrics(body, name, filePath, startLine) {
460
461
  const ext = path4__namespace.extname(filePath).toLowerCase();
461
462
  const rawLines = body.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
462
463
  const { loc, commentCount, cleanLines } = countCommentsAndLoc(rawLines, ext === ".py");
@@ -470,7 +471,8 @@ function calculatePolyglotMetrics(body, name, filePath) {
470
471
  cyclomatic,
471
472
  cognitive,
472
473
  maintainability,
473
- codeSmells: detectPolyglotSmells(body)
474
+ codeSmells: detectPolyglotSmells(body),
475
+ line: startLine ? startLine + 1 : 1
474
476
  };
475
477
  }
476
478
  function computePolyglotCyclomatic(body, ext) {
@@ -1206,6 +1208,7 @@ function createDefaultQualityPolicy() {
1206
1208
  }
1207
1209
  function applyDocScope(policy, doc) {
1208
1210
  if (typeof doc.enforcement_mode === "string") policy.enforce_mode = doc.enforcement_mode;
1211
+ if (typeof doc.ratchet_mode === "boolean") policy.ratchet_mode = doc.ratchet_mode;
1209
1212
  if (!doc.scope || typeof doc.scope !== "object") return;
1210
1213
  const scope = doc.scope;
1211
1214
  if (Array.isArray(scope.target_directories)) {
@@ -1496,12 +1499,138 @@ function evaluateCoverageThresholds(rootDir, policy, requireReport) {
1496
1499
  checkCoverageThreshold("Function", cov.functionsPct, policy.min_function_coverage, violations);
1497
1500
  return violations;
1498
1501
  }
1499
- function buildQualityGateResult(results, totalFiles, policy, coverageViolations, untestedFunctions) {
1502
+ function computeViolationSignature(relPath, fnName, metric) {
1503
+ const normPath = relPath.replace(/\\/g, "/");
1504
+ return crypto__namespace.createHash("sha256").update(normPath + ":" + fnName + ":" + metric).digest("hex");
1505
+ }
1506
+ function classifyMetricFromMessage(msg, fn) {
1507
+ if (msg.startsWith("Cyclomatic Complexity")) {
1508
+ return { metric: "cyclomatic", value: fn?.cyclomatic, threshold: 10 };
1509
+ }
1510
+ if (msg.startsWith("Cognitive Complexity")) {
1511
+ return { metric: "cognitive", value: fn?.cognitive, threshold: 15 };
1512
+ }
1513
+ if (msg.startsWith("Maintainability Index")) {
1514
+ return { metric: "maintainability", value: fn?.maintainability, threshold: 50 };
1515
+ }
1516
+ if (msg.startsWith("Function lines")) {
1517
+ return { metric: "loc", value: fn?.loc, threshold: 40 };
1518
+ }
1519
+ if (msg.includes("Missing unit test")) {
1520
+ return { metric: "unit-test" };
1521
+ }
1522
+ return { metric: "codeSmell" };
1523
+ }
1524
+ function isMetricWorsened(baselineEntry, current) {
1525
+ if (baselineEntry.value === void 0 || current.value === void 0) return false;
1526
+ if (baselineEntry.metric === "maintainability") {
1527
+ return current.value < baselineEntry.value;
1528
+ }
1529
+ return current.value > baselineEntry.value;
1530
+ }
1531
+ function loadQualityBaseline(baselineFile) {
1532
+ try {
1533
+ if (!fs7__namespace.existsSync(baselineFile)) return null;
1534
+ const content = fs7__namespace.readFileSync(baselineFile, "utf-8");
1535
+ return JSON.parse(content);
1536
+ } catch {
1537
+ return null;
1538
+ }
1539
+ }
1540
+ function writeQualityBaseline(baselineFile, entries) {
1541
+ const baseline = {
1542
+ version: "1.0",
1543
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
1544
+ totalViolations: entries.length,
1545
+ violations: entries
1546
+ };
1547
+ fs7__namespace.writeFileSync(baselineFile, JSON.stringify(baseline, null, 2) + "\n", "utf-8");
1548
+ return baseline;
1549
+ }
1550
+ function extractBaselineEntriesFromResults(results) {
1551
+ const entries = [];
1552
+ for (const r of results) {
1553
+ for (const v of r.violations) {
1554
+ const { metric, value, threshold } = classifyMetricFromMessage(v, r);
1555
+ const signature = computeViolationSignature(r.relPath, r.functionName, metric);
1556
+ entries.push({
1557
+ signature,
1558
+ file: r.relPath,
1559
+ functionName: r.functionName,
1560
+ line: r.line || 1,
1561
+ metric,
1562
+ value,
1563
+ threshold,
1564
+ message: v
1565
+ });
1566
+ }
1567
+ }
1568
+ return entries;
1569
+ }
1570
+ function applyRatchetToFunctionResult(r, baselineMap) {
1571
+ const activeViolations = [];
1572
+ const tolerated = [];
1573
+ for (const v of r.violations) {
1574
+ const classified = classifyMetricFromMessage(v, r);
1575
+ const sig = computeViolationSignature(r.relPath, r.functionName, classified.metric);
1576
+ const baseEntry = baselineMap.get(sig);
1577
+ if (baseEntry && !isMetricWorsened(baseEntry, classified)) {
1578
+ tolerated.push(v);
1579
+ } else {
1580
+ activeViolations.push(v);
1581
+ }
1582
+ }
1583
+ r.violations = activeViolations;
1584
+ r.toleratedViolations = tolerated;
1585
+ r.status = activeViolations.length === 0 ? "PASS" : "FAIL";
1586
+ return { tolerated: tolerated.length, newViolations: activeViolations.length };
1587
+ }
1588
+ function applyRatchetMode(results, baseline) {
1589
+ const baselineMap = /* @__PURE__ */ new Map();
1590
+ for (const entry of baseline.violations) {
1591
+ baselineMap.set(entry.signature, entry);
1592
+ }
1593
+ let toleratedCount = 0;
1594
+ let newViolationsCount = 0;
1595
+ for (const r of results) {
1596
+ if (r.violations.length === 0) continue;
1597
+ const res = applyRatchetToFunctionResult(r, baselineMap);
1598
+ toleratedCount += res.tolerated;
1599
+ newViolationsCount += res.newViolations;
1600
+ }
1601
+ return { toleratedCount, newViolationsCount };
1602
+ }
1603
+ function resolveBaselineFilePath(rootDir, options) {
1604
+ if (options.baselinePath) return options.baselinePath;
1605
+ if (typeof options.baseline === "string") return options.baseline;
1606
+ return path4__namespace.join(rootDir, "quality-baseline.json");
1607
+ }
1608
+ function isRatchetModeActive(policy, options, baselineExists) {
1609
+ if (options.ratchet !== void 0) return options.ratchet;
1610
+ if (options.baseline === false) return false;
1611
+ return Boolean(policy.ratchet_mode || options.baseline && baselineExists);
1612
+ }
1613
+ function evaluateRatchetIfActive(results, baselineFile, isActive) {
1614
+ if (!isActive || !fs7__namespace.existsSync(baselineFile)) {
1615
+ return { toleratedViolationsCount: 0, newViolationsCount: 0, baselineViolationsCount: 0 };
1616
+ }
1617
+ const baseline = loadQualityBaseline(baselineFile);
1618
+ if (!baseline) {
1619
+ return { toleratedViolationsCount: 0, newViolationsCount: 0, baselineViolationsCount: 0 };
1620
+ }
1621
+ const counts = applyRatchetMode(results, baseline);
1622
+ return {
1623
+ toleratedViolationsCount: counts.toleratedCount,
1624
+ newViolationsCount: counts.newViolationsCount,
1625
+ baselineViolationsCount: baseline.totalViolations
1626
+ };
1627
+ }
1628
+ function buildQualityGateResult(results, totalFiles, policy, coverageViolations, untestedFunctions, baselineMeta) {
1500
1629
  const failCount = results.filter((r) => r.status === "FAIL").length;
1501
1630
  const passCount = results.length - failCount;
1502
1631
  const violationsCount = results.reduce((acc, r) => acc + r.violations.length, 0) + coverageViolations.length;
1503
1632
  const hasFailures = failCount > 0 || coverageViolations.length > 0;
1504
- const success = policy.enforce_mode === "STRICT" ? !hasFailures : true;
1633
+ const success = baselineMeta?.baselineUpdated ? true : policy.enforce_mode === "STRICT" ? !hasFailures : true;
1505
1634
  return {
1506
1635
  success,
1507
1636
  totalFiles,
@@ -1512,7 +1641,11 @@ function buildQualityGateResult(results, totalFiles, policy, coverageViolations,
1512
1641
  results,
1513
1642
  policy,
1514
1643
  coverageViolations,
1515
- untestedFunctions
1644
+ untestedFunctions,
1645
+ baselineUpdated: baselineMeta?.baselineUpdated,
1646
+ baselineViolationsCount: baselineMeta?.baselineViolationsCount,
1647
+ toleratedViolationsCount: baselineMeta?.toleratedViolationsCount,
1648
+ newViolationsCount: baselineMeta?.newViolationsCount
1516
1649
  };
1517
1650
  }
1518
1651
  function verifyQualityGate(options = {}) {
@@ -1528,7 +1661,23 @@ function verifyQualityGate(options = {}) {
1528
1661
  }
1529
1662
  const untestedFunctions = options.requireFunctionUnitTests ? auditUnitTestsPerFunction(results, rootDir) : [];
1530
1663
  const coverageViolations = evaluateCoverageThresholds(rootDir, policy, options.requireCoverageReport);
1531
- return buildQualityGateResult(results, allFiles.length, policy, coverageViolations, untestedFunctions);
1664
+ const baselineFile = resolveBaselineFilePath(rootDir, options);
1665
+ if (options.updateBaseline) {
1666
+ const entries = extractBaselineEntriesFromResults(results);
1667
+ writeQualityBaseline(baselineFile, entries);
1668
+ return buildQualityGateResult(results, allFiles.length, policy, coverageViolations, untestedFunctions, {
1669
+ baselineUpdated: true,
1670
+ baselineViolationsCount: entries.length
1671
+ });
1672
+ }
1673
+ const baselineExists = fs7__namespace.existsSync(baselineFile);
1674
+ const isRatchet = isRatchetModeActive(policy, options, baselineExists);
1675
+ const ratchetEval = evaluateRatchetIfActive(results, baselineFile, isRatchet);
1676
+ return buildQualityGateResult(results, allFiles.length, policy, coverageViolations, untestedFunctions, {
1677
+ baselineViolationsCount: ratchetEval.baselineViolationsCount,
1678
+ toleratedViolationsCount: ratchetEval.toleratedViolationsCount,
1679
+ newViolationsCount: ratchetEval.newViolationsCount
1680
+ });
1532
1681
  }
1533
1682
  function normalizeHandoffPayload(handoff, changeId) {
1534
1683
  return {
@@ -2850,15 +2999,16 @@ var SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON = '{\r\n "$schema": "http
2850
2999
  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-use-cases"\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-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 "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';
2851
3000
  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';
2852
3001
  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';
2853
- 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 "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';
3002
+ 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';
2854
3003
  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';
2855
3004
  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';
2856
3005
  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';
2857
- 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": ["draft", "active", "deprecated", "retired"]\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": ["name", "sensitivity", "masking-strategy"],\n "properties": {\n "name": {\n "type": "string",\n "minLength": 1\n },\n "sensitivity": {\n "type": "string",\n "enum": ["public", "internal", "pii", "special-category"]\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": ["string", "null"],\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": ["string", "null"],\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}\n';
2858
- 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": ["GDPR", "LOPDGDD", "ISO-27701", "CCPA", "HIPAA", "LGPD"]\n }\n },\n "default_action": {\n "type": "string",\n "enum": ["DENY_UNREGISTERED_PII", "ALLOW", "REVIEW_REQUIRED"]\n },\n "classifications": {\n "type": "object",\n "required": ["public", "internal", "confidential_pii", "special_category_sensitive"],\n "additionalProperties": {\n "type": "object",\n "required": ["action", "encryption_at_rest", "encryption_in_transit", "allow_in_logs", "allow_in_ai_prompts"],\n "properties": {\n "action": {\n "type": "string",\n "enum": ["ALLOW", "STRICT_GOVERNANCE", "DPIA_APPROVAL_REQUIRED", "DENY"]\n },\n "description": { "type": "string" },\n "exception_requires": { "type": "string" },\n "require_ropa_entry": { "type": "boolean" },\n "require_dpia_artifact": { "type": "boolean" },\n "encryption_at_rest": { "type": "boolean" },\n "encryption_in_transit": { "type": "boolean" },\n "require_field_level_encryption": { "type": "boolean" },\n "allow_in_logs": { "type": "boolean" },\n "log_masking_strategy": { "type": "string" },\n "allow_in_ai_prompts": { "type": "boolean" },\n "max_retention_days": { "type": "integer", "minimum": 1 },\n "require_right_to_erasure": { "type": "boolean" }\n },\n "additionalProperties": false\n }\n },\n "cross_border_transfers": {\n "type": "object",\n "properties": {\n "allowed_regions": {\n "type": "array",\n "items": { "type": "string" }\n },\n "require_scc_for_third_countries": { "type": "boolean" },\n "approved_subprocessors": {\n "type": "array",\n "items": { "type": "string" }\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": { "type": "boolean" },\n "forbid_pii_in_console_or_logger": { "type": "boolean" },\n "require_dto_projection_for_pii": { "type": "boolean" },\n "on_special_category_detected": {\n "type": "object",\n "required": ["action", "notification_tag", "message"],\n "properties": {\n "action": { "type": "string" },\n "notification_tag": { "type": "string" },\n "message": { "type": "string" }\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": { "type": "boolean" },\n "fail_on_pii_in_logs": { "type": "boolean" },\n "fail_on_missing_retention_policy": { "type": "boolean" },\n "fail_on_unapproved_subprocessor": { "type": "boolean" },\n "generate_ropa_inventory": { "type": "boolean" },\n "output_ropa_file": { "type": "string" },\n "output_privacy_report": { "type": "string" }\n },\n "additionalProperties": false\n }\n },\n "additionalProperties": false\n}\n';
2859
- 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": ["draft", "active", "deprecated", "retired"]\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": ["gherkin", "declarative-prose"]\n },\n "cucumber-tags": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^@[a-zA-Z0-9_-]+$"\n }\n },\n "supersedes": {\n "type": ["string", "null"],\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": ["string", "null"],\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}\n';
2860
- 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": ["draft", "active", "deprecated", "retired"]\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": ["string", "null"],\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": ["string", "null"],\n "enum": [null, "adequacy-decision", "scc", "bcr", "derogation"]\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": ["string", "null"],\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": ["string", "null"],\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": ["string", "null"],\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}\n';
3006
+ 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';
3007
+ 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';
3008
+ 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';
3009
+ 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';
2861
3010
  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';
3011
+ 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": ["draft", "active", "deprecated", "retired"]\n },\n "domain-type": {\n "type": "string",\n "enum": ["core", "supporting", "generic"],\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": ["genesis", "custom-built", "product-rental", "commodity"]\n },\n "business-model-role": {\n "type": "string",\n "enum": ["differentiator", "operational", "enabler"]\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": ["string", "null"],\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": ["string", "null"],\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}\n';
2862
3012
  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';
2863
3013
  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';
2864
3014
  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';
@@ -2993,6 +3143,7 @@ var STARTER_SCHEMAS_MAP = {
2993
3143
  "schemas/privacy/privacy-req.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON),
2994
3144
  "schemas/privacy/privacy-ropa.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON),
2995
3145
  "schemas/product/actor.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON),
3146
+ "schemas/product/bounded-context.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON),
2996
3147
  "schemas/product/business-rule.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON),
2997
3148
  "schemas/product/journey.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON),
2998
3149
  "schemas/product/requirement.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON),
@@ -3027,6 +3178,7 @@ var TYPE_TO_SCHEMA_MAP = {
3027
3178
  journey: "schemas/product/journey.schema.json",
3028
3179
  requirement: "schemas/product/requirement.schema.json",
3029
3180
  term: "schemas/product/term.schema.json",
3181
+ "bounded-context": "schemas/product/bounded-context.schema.json",
3030
3182
  "use-case": "schemas/product/use-case.schema.json",
3031
3183
  // Security
3032
3184
  "abuse-case": "schemas/security/abuse-case.schema.json",
@@ -3077,6 +3229,7 @@ var PREFIX_TAXONOMY = [
3077
3229
  ["CON-", "requirement"],
3078
3230
  ["JRN-", "journey"],
3079
3231
  ["TERM-", "term"],
3232
+ ["BC-", "bounded-context"],
3080
3233
  ["ABUSE-", "abuse-case"],
3081
3234
  ["SEC-ENC-", "security-enclave"],
3082
3235
  ["SEC-REQ-", "security-requirement"],
@@ -5548,6 +5701,82 @@ function scanWithNativeFs(rootDir, options = {}) {
5548
5701
  }
5549
5702
  return allDeps.sort((a, b) => a.name.localeCompare(b.name));
5550
5703
  }
5704
+ function extractCvssV3Score(cvss) {
5705
+ if (!cvss || typeof cvss !== "object") return void 0;
5706
+ const dict = cvss;
5707
+ for (const source of ["nvd", "ghsa", "redhat"]) {
5708
+ if (dict[source]?.V3Score !== void 0) {
5709
+ return Number(dict[source].V3Score);
5710
+ }
5711
+ }
5712
+ return void 0;
5713
+ }
5714
+ function extractCvssV3Vector(cvss) {
5715
+ if (!cvss || typeof cvss !== "object") return void 0;
5716
+ const dict = cvss;
5717
+ for (const source of ["nvd", "ghsa", "redhat"]) {
5718
+ if (dict[source]?.V3Vector) {
5719
+ return String(dict[source].V3Vector);
5720
+ }
5721
+ }
5722
+ return void 0;
5723
+ }
5724
+ function normalizeVulnerabilitySeverity(raw) {
5725
+ if (!raw) return "UNKNOWN";
5726
+ const upper = raw.toUpperCase().trim();
5727
+ if (upper === "CRITICAL" || upper === "HIGH" || upper === "MEDIUM" || upper === "LOW") {
5728
+ return upper;
5729
+ }
5730
+ return "UNKNOWN";
5731
+ }
5732
+ function parseSingleVulnerability(v) {
5733
+ return {
5734
+ id: v.VulnerabilityID || "UNKNOWN",
5735
+ packageName: v.PkgName || "UNKNOWN",
5736
+ installedVersion: v.InstalledVersion || "unknown",
5737
+ fixedVersion: v.FixedVersion || void 0,
5738
+ severity: normalizeVulnerabilitySeverity(v.Severity),
5739
+ cvssV3Score: extractCvssV3Score(v.CVSS),
5740
+ cvssV3Vector: extractCvssV3Vector(v.CVSS),
5741
+ title: v.Title || void 0,
5742
+ description: v.Description || void 0,
5743
+ primaryUrl: v.PrimaryURL || void 0
5744
+ };
5745
+ }
5746
+ function parseTrivyVulnerabilities(stdout) {
5747
+ try {
5748
+ const data = JSON.parse(stdout);
5749
+ const vulns = [];
5750
+ for (const r of data.Results || []) {
5751
+ for (const v of r.Vulnerabilities || []) {
5752
+ vulns.push(parseSingleVulnerability(v));
5753
+ }
5754
+ }
5755
+ return vulns;
5756
+ } catch {
5757
+ return [];
5758
+ }
5759
+ }
5760
+ var SEVERITY_RANK = {
5761
+ CRITICAL: 4,
5762
+ HIGH: 3,
5763
+ MEDIUM: 2,
5764
+ LOW: 1,
5765
+ UNKNOWN: 0
5766
+ };
5767
+ function evaluateVulnerabilityThresholds(vulnerabilities, options) {
5768
+ const minRank = options?.failOnSeverity ? SEVERITY_RANK[options.failOnSeverity] ?? 3 : void 0;
5769
+ const maxScore = options?.maxCvssScore;
5770
+ const failing = vulnerabilities.filter((v) => {
5771
+ const rankMatch = minRank !== void 0 && SEVERITY_RANK[v.severity] >= minRank;
5772
+ const scoreMatch = maxScore !== void 0 && v.cvssV3Score !== void 0 && v.cvssV3Score >= maxScore;
5773
+ return rankMatch || scoreMatch;
5774
+ });
5775
+ return {
5776
+ blocked: failing.length > 0,
5777
+ failingVulnerabilities: failing
5778
+ };
5779
+ }
5551
5780
  function parseTrivyOutput(stdout) {
5552
5781
  const data = JSON.parse(stdout);
5553
5782
  const deps = [];
@@ -5563,24 +5792,33 @@ function parseTrivyOutput(stdout) {
5563
5792
  }
5564
5793
  return deps;
5565
5794
  }
5566
- function scanWithTrivy(rootDir) {
5567
- if (!isToolAvailable("trivy")) {
5568
- return { dependencies: [], executed: false };
5569
- }
5795
+ function execTrivyCli(rootDir, checkTypes) {
5570
5796
  try {
5571
5797
  const res = child_process__namespace.spawnSync(
5572
5798
  "trivy",
5573
- ["fs", "--format", "json", "--security-checks", "license", rootDir],
5799
+ ["fs", "--format", "json", "--security-checks", checkTypes, rootDir],
5574
5800
  { encoding: "utf-8", timeout: 3e4 }
5575
5801
  );
5576
- if (res.status !== 0 || !res.stdout) {
5577
- return { dependencies: [], executed: false };
5578
- }
5579
- return { dependencies: parseTrivyOutput(res.stdout), executed: true };
5802
+ return res.status === 0 && res.stdout ? res.stdout : null;
5580
5803
  } catch {
5581
- return { dependencies: [], executed: false };
5804
+ return null;
5582
5805
  }
5583
5806
  }
5807
+ function scanWithTrivy(rootDir, options) {
5808
+ if (!isToolAvailable("trivy")) {
5809
+ return { dependencies: [], vulnerabilities: [], executed: false };
5810
+ }
5811
+ const checkTypes = options?.scanVulnerabilities !== false ? "vuln,license" : "license";
5812
+ const stdout = execTrivyCli(rootDir, checkTypes);
5813
+ if (!stdout) {
5814
+ return { dependencies: [], vulnerabilities: [], executed: false };
5815
+ }
5816
+ return {
5817
+ dependencies: parseTrivyOutput(stdout),
5818
+ vulnerabilities: parseTrivyVulnerabilities(stdout),
5819
+ executed: true
5820
+ };
5821
+ }
5584
5822
  function parseSyftOutput(stdout) {
5585
5823
  const data = JSON.parse(stdout);
5586
5824
  const deps = [];
@@ -6095,12 +6333,34 @@ function evaluateDependencyList(dependencies, policy) {
6095
6333
  }
6096
6334
  return { violations, permittedCount };
6097
6335
  }
6098
- function assembleDynamicLicenseResult(dependencies, permittedCount, violations, reportMarkdown, artifacts) {
6336
+ function buildSkippedVulnResult() {
6099
6337
  return {
6100
- success: violations.length === 0,
6338
+ vulnerabilities: [],
6339
+ blocked: false,
6340
+ skipped: true,
6341
+ skipReason: "Trivy scanner is not installed on host environment. Vulnerability check gracefully skipped."
6342
+ };
6343
+ }
6344
+ function checkVulnerabilities(rootDir, options) {
6345
+ if (options.scanVulnerabilities === false) {
6346
+ return { vulnerabilities: [], blocked: false };
6347
+ }
6348
+ const res = scanWithTrivy(rootDir, { scanVulnerabilities: true });
6349
+ if (!res.executed) {
6350
+ return buildSkippedVulnResult();
6351
+ }
6352
+ const evalResult = evaluateVulnerabilityThresholds(res.vulnerabilities, options.vulnerabilityThresholds);
6353
+ return { vulnerabilities: res.vulnerabilities, blocked: evalResult.blocked };
6354
+ }
6355
+ function assembleDynamicLicenseResult(dependencies, permittedCount, violations, reportMarkdown, artifacts, vulnData) {
6356
+ return {
6357
+ success: violations.length === 0 && !vulnData.blocked,
6101
6358
  totalEvaluated: dependencies.length,
6102
6359
  permittedCount,
6103
6360
  violations,
6361
+ vulnerabilities: vulnData.vulnerabilities,
6362
+ vulnerabilitiesSkipped: vulnData.skipped,
6363
+ vulnerabilitiesSkipReason: vulnData.skipReason,
6104
6364
  reportMarkdown,
6105
6365
  sbomPath: artifacts.sbomPath,
6106
6366
  noticesPath: artifacts.noticesPath,
@@ -6134,8 +6394,9 @@ function verifyLicenses(options = {}) {
6134
6394
  const dependencies = scanDependenciesForVerification(options, rootDir, policyWithRaw.rawPolicy);
6135
6395
  const { violations, permittedCount } = evaluateDependencyList(dependencies, policy);
6136
6396
  const artifacts = handleDynamicScaArtifacts(options, rootDir, policyWithRaw.rawPolicy, dependencies);
6397
+ const vulnData = checkVulnerabilities(rootDir, options);
6137
6398
  const reportMarkdown = generateLicenseReportMarkdown(dependencies, violations, policy, artifacts.sbomPath);
6138
- return assembleDynamicLicenseResult(dependencies, permittedCount, violations, reportMarkdown, artifacts);
6399
+ return assembleDynamicLicenseResult(dependencies, permittedCount, violations, reportMarkdown, artifacts, vulnData);
6139
6400
  }
6140
6401
  var PROTECTED_BYPASS_PATTERNS = [
6141
6402
  /^schemas[\\/]/i,
@@ -6171,11 +6432,27 @@ function isPathProtectedFromPatch(filePath) {
6171
6432
  const normalized = filePath.replace(/\\/g, "/");
6172
6433
  return PROTECTED_BYPASS_PATTERNS.some((pattern) => pattern.test(normalized));
6173
6434
  }
6435
+ function detectBranchChangeMatch(rootDir, dirs) {
6436
+ if (!fs7__namespace.existsSync(path4__namespace.join(rootDir, ".git"))) return void 0;
6437
+ try {
6438
+ const branch = child_process.execFileSync("git", ["branch", "--show-current"], {
6439
+ cwd: rootDir,
6440
+ encoding: "utf-8",
6441
+ stdio: ["pipe", "pipe", "ignore"]
6442
+ }).trim().toLowerCase();
6443
+ if (!branch) return void 0;
6444
+ return dirs.find((d) => branch.includes(path4__namespace.basename(d).toLowerCase()));
6445
+ } catch {
6446
+ return void 0;
6447
+ }
6448
+ }
6174
6449
  function resolveActiveChangeDir(rootDir) {
6175
6450
  const activeRoot = path4__namespace.join(rootDir, "specs", "changes", "active");
6176
6451
  if (!fs7__namespace.existsSync(activeRoot)) return void 0;
6177
6452
  try {
6178
6453
  const dirs = fs7__namespace.readdirSync(activeRoot, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => path4__namespace.join(activeRoot, d.name));
6454
+ const branchMatch = detectBranchChangeMatch(rootDir, dirs);
6455
+ if (branchMatch) return branchMatch;
6179
6456
  return dirs.find((d) => detectProfileFromChange(d) === "patch") || dirs[0];
6180
6457
  } catch {
6181
6458
  return void 0;
@@ -6848,6 +7125,133 @@ function generateDuplicatesReportMarkdown(result) {
6848
7125
  }
6849
7126
  return lines.join("\n");
6850
7127
  }
7128
+
7129
+ // src/verifiers/security-suppressions.ts
7130
+ var SUPPRESSION_TRIGGER_REGEX = /(?:\/\/|#|--|\/\*)\s*(?:ai-sdlc:allow-sast|ai-sdlc:allow-secret|ai-sdlc:allow-prompt-injection|gitleaks:allow|pragma:\s*allowlist\s*secret|\bnosec\b)/i;
7131
+ function extractAttribute(text, attrName) {
7132
+ const pattern = new RegExp(`${attrName}\\s*=\\s*["']([^"']+)["']`, "i");
7133
+ const match = text.match(pattern);
7134
+ return match ? match[1].trim() : void 0;
7135
+ }
7136
+ function determineSuppressionKind(line) {
7137
+ if (line.includes("ai-sdlc:allow-secret") || line.includes("gitleaks:allow") || line.includes("allowlist secret")) {
7138
+ return "secret";
7139
+ }
7140
+ return "sast";
7141
+ }
7142
+ function isInformalSuppression(line) {
7143
+ return line.includes("nosec") || line.includes("pragma: allowlist secret") || line.includes("gitleaks:allow");
7144
+ }
7145
+ function checkMissingFields(reason, expires, approvedBy) {
7146
+ const missing = [];
7147
+ if (!reason) missing.push("reason");
7148
+ if (!expires) missing.push("expires");
7149
+ if (!approvedBy) missing.push("approved-by");
7150
+ return missing;
7151
+ }
7152
+ function checkExpiration(expires, referenceDate) {
7153
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(expires)) {
7154
+ return { status: "invalid", invalidReason: "Formato de fecha expires inv\xE1lido (se requiere YYYY-MM-DD)" };
7155
+ }
7156
+ const expDate = /* @__PURE__ */ new Date(`${expires}T23:59:59.999Z`);
7157
+ if (isNaN(expDate.getTime())) {
7158
+ return { status: "invalid", invalidReason: "Fecha expires no es una fecha v\xE1lida" };
7159
+ }
7160
+ const now = referenceDate || /* @__PURE__ */ new Date();
7161
+ if (expDate.getTime() < now.getTime()) {
7162
+ return { status: "expired", invalidReason: `Excepci\xF3n caducada en fecha ${expires}` };
7163
+ }
7164
+ return { status: "active" };
7165
+ }
7166
+ function evaluateSuppressionStatus(reason, expires, approvedBy, isInformal, referenceDate) {
7167
+ if (isInformal) {
7168
+ return { status: "invalid", invalidReason: "Formato informal (nosec/allowlist no estructurado) no permitido" };
7169
+ }
7170
+ const missing = checkMissingFields(reason, expires, approvedBy);
7171
+ if (missing.length > 0) {
7172
+ return { status: "invalid", invalidReason: `Faltan campos obligatorios: ${missing.join(", ")}` };
7173
+ }
7174
+ return checkExpiration(expires, referenceDate);
7175
+ }
7176
+ function extractSuppressionAttrs(line) {
7177
+ return {
7178
+ ruleId: extractAttribute(line, "rule"),
7179
+ reason: extractAttribute(line, "reason"),
7180
+ expires: extractAttribute(line, "expires"),
7181
+ approvedBy: extractAttribute(line, "approved-by") || extractAttribute(line, "approvedBy")
7182
+ };
7183
+ }
7184
+ function parseSecuritySuppression(line, filePath, lineNumber, referenceDate) {
7185
+ if (!SUPPRESSION_TRIGGER_REGEX.test(line)) return null;
7186
+ const kind = determineSuppressionKind(line);
7187
+ const isInformal = isInformalSuppression(line);
7188
+ const attrs = extractSuppressionAttrs(line);
7189
+ const evalResult = evaluateSuppressionStatus(attrs.reason, attrs.expires, attrs.approvedBy, isInformal, referenceDate);
7190
+ return {
7191
+ kind,
7192
+ ruleId: attrs.ruleId,
7193
+ reason: attrs.reason,
7194
+ expires: attrs.expires,
7195
+ approvedBy: attrs.approvedBy,
7196
+ status: evalResult.status,
7197
+ filePath,
7198
+ lineNumber,
7199
+ rawComment: line.trim(),
7200
+ invalidReason: evalResult.invalidReason
7201
+ };
7202
+ }
7203
+ function formatSuppressionRow(s) {
7204
+ const rule = s.ruleId ? `\`${s.ruleId}\`` : "*(all)*";
7205
+ const fileRef = `\`${s.filePath}:${s.lineNumber}\``;
7206
+ const reason = s.reason ? s.reason.replace(/\|/g, "\\|") : s.invalidReason || "*(Sin justificaci\xF3n)*";
7207
+ const expires = s.expires || "N/A";
7208
+ const approver = s.approvedBy || "*(Sin aprobador)*";
7209
+ return `| ${s.kind.toUpperCase()} | ${rule} | ${fileRef} | ${reason} | ${expires} | ${approver} |`;
7210
+ }
7211
+ function buildAuditHeader(total, active, expired, invalid) {
7212
+ return [
7213
+ "# \u{1F4CB} Security Suppressions and Audit Exceptions Inventory",
7214
+ "",
7215
+ `> **Generated at:** ${(/* @__PURE__ */ new Date()).toISOString()}`,
7216
+ `> **Total Audited Suppressions:** ${total} | **Active:** ${active} | **Expired:** ${expired} | **Invalid:** ${invalid}`,
7217
+ "",
7218
+ "## 1. Executive Summary",
7219
+ "",
7220
+ "| Category | Count | Status | Policy Compliance |",
7221
+ "| :--- | :---: | :---: | :--- |",
7222
+ `| **Active Suppressions** | ${active} | \u{1F7E2} PASS | Permitted until expiration date |`,
7223
+ `| **Expired Suppressions** | ${expired} | ${expired > 0 ? "\u{1F534} BLOCKED" : "\u{1F7E2} PASS"} | Must be renewed or remediated immediately |`,
7224
+ `| **Invalid Suppressions** | ${invalid} | ${invalid > 0 ? "\u26A0\uFE0F REJECTED" : "\u{1F7E2} PASS"} | Missing mandatory metadata fields |`,
7225
+ ""
7226
+ ];
7227
+ }
7228
+ function buildTableSection(title, items, emptyMsg) {
7229
+ const lines = [
7230
+ title,
7231
+ "",
7232
+ "| Engine | Rule / ID | Location | Details / Justification | Expires | Approved By |",
7233
+ "| :--- | :--- | :--- | :--- | :--- | :--- |"
7234
+ ];
7235
+ if (items.length === 0) {
7236
+ lines.push(`| - | - | - | ${emptyMsg} | - | - |`);
7237
+ } else {
7238
+ for (const item of items) lines.push(formatSuppressionRow(item));
7239
+ }
7240
+ lines.push("");
7241
+ return lines;
7242
+ }
7243
+ function generateSuppressionsAuditReport(suppressions) {
7244
+ const active = suppressions.filter((s) => s.status === "active");
7245
+ const expired = suppressions.filter((s) => s.status === "expired");
7246
+ const invalid = suppressions.filter((s) => s.status === "invalid");
7247
+ return [
7248
+ ...buildAuditHeader(suppressions.length, active.length, expired.length, invalid.length),
7249
+ ...buildTableSection("## 2. Active Security Exceptions", active, "*(No active suppressions recorded)*"),
7250
+ ...buildTableSection("## 3. Expired or Invalid Exceptions (Blocking/Rejected)", [...expired, ...invalid], "*(No expired or invalid suppressions)*")
7251
+ ].join("\n");
7252
+ }
7253
+
7254
+ // src/verifiers/secrets.ts
6851
7255
  var SECRET_RULES = [
6852
7256
  {
6853
7257
  id: "SEC-001-PRIVATE-KEY",
@@ -6969,13 +7373,15 @@ function maskSecret(secret) {
6969
7373
  const suffix = secret.slice(-suffixLen);
6970
7374
  return `${prefix}****${suffix}`;
6971
7375
  }
6972
- function isPlaceholderOrIgnored(secret, line) {
7376
+ function isPlaceholderOrIgnored(secret, line, filePath = "", lineNumber = 0, collectedSuppressions) {
6973
7377
  const lowerSecret = secret.toLowerCase();
6974
7378
  for (const placeholder of PLACEHOLDER_KEYWORDS) {
6975
7379
  if (lowerSecret.includes(placeholder)) return true;
6976
7380
  }
6977
- if (line.includes("ai-sdlc:allow-secret") || line.includes("gitleaks:allow") || line.includes("pragma: allowlist secret")) {
6978
- return true;
7381
+ const suppression = parseSecuritySuppression(line, filePath, lineNumber);
7382
+ if (suppression) {
7383
+ if (collectedSuppressions) collectedSuppressions.push(suppression);
7384
+ return suppression.status === "active";
6979
7385
  }
6980
7386
  return false;
6981
7387
  }
@@ -7116,14 +7522,14 @@ function buildSecretViolation(rule, rawMatch, entropy, filePath, relPath, lineNu
7116
7522
  message: `${rule.description} (Entrop\xEDa: ${entropy})`
7117
7523
  };
7118
7524
  }
7119
- function checkRuleOnLine(rule, line, lineNumber, filePath, relPath, entropyThreshold) {
7525
+ function checkRuleOnLine(rule, line, lineNumber, filePath, relPath, entropyThreshold, collectedSuppressions) {
7120
7526
  const violations = [];
7121
7527
  rule.regex.lastIndex = 0;
7122
7528
  let match;
7123
7529
  while ((match = rule.regex.exec(line)) !== null) {
7124
7530
  const rawMatch = rule.captureIndex ? match[rule.captureIndex] : match[0];
7125
7531
  if (!rawMatch || rawMatch.length < 8) continue;
7126
- if (isPlaceholderOrIgnored(rawMatch, line)) continue;
7532
+ if (isPlaceholderOrIgnored(rawMatch, line, filePath, lineNumber, collectedSuppressions)) continue;
7127
7533
  const entropy = calculateShannonEntropy(rawMatch);
7128
7534
  if (rule.minEntropy && entropy < (entropyThreshold || rule.minEntropy)) {
7129
7535
  continue;
@@ -7132,20 +7538,20 @@ function checkRuleOnLine(rule, line, lineNumber, filePath, relPath, entropyThres
7132
7538
  }
7133
7539
  return violations;
7134
7540
  }
7135
- function scanLineForSecrets(line, lineNumber, filePath, relPath, entropyThreshold) {
7541
+ function scanLineForSecrets(line, lineNumber, filePath, relPath, entropyThreshold, collectedSuppressions) {
7136
7542
  if (!line || line.trim().length === 0) return [];
7137
7543
  const lineViolations = [];
7138
7544
  for (const rule of SECRET_RULES) {
7139
- lineViolations.push(...checkRuleOnLine(rule, line, lineNumber, filePath, relPath, entropyThreshold));
7545
+ lineViolations.push(...checkRuleOnLine(rule, line, lineNumber, filePath, relPath, entropyThreshold, collectedSuppressions));
7140
7546
  }
7141
7547
  return lineViolations;
7142
7548
  }
7143
- function scanContentForSecrets(content, filePath, rootDir, entropyThreshold = 4.3) {
7549
+ function scanContentForSecrets(content, filePath, rootDir, entropyThreshold = 4.3, collectedSuppressions) {
7144
7550
  const violations = [];
7145
7551
  const lines = content.split(/\r?\n/);
7146
7552
  const relPath = path4__namespace.relative(rootDir, filePath).replace(/\\/g, "/");
7147
7553
  for (let i = 0; i < lines.length; i++) {
7148
- violations.push(...scanLineForSecrets(lines[i], i + 1, filePath, relPath, entropyThreshold));
7554
+ violations.push(...scanLineForSecrets(lines[i], i + 1, filePath, relPath, entropyThreshold, collectedSuppressions));
7149
7555
  }
7150
7556
  return violations;
7151
7557
  }
@@ -7161,29 +7567,31 @@ function groupDiffLinesByFile(diffLines) {
7161
7567
  function scanDiffItems(diffLines, rootDir, excludePatterns, entropyThreshold) {
7162
7568
  const fileGroups = groupDiffLinesByFile(diffLines);
7163
7569
  const findings = [];
7570
+ const suppressions = [];
7164
7571
  for (const [relFile, items] of fileGroups) {
7165
7572
  if (isPathExcluded2(relFile, excludePatterns)) continue;
7166
7573
  const absPath = path4__namespace.resolve(rootDir, relFile);
7167
7574
  for (const item of items) {
7168
- const lineViolations = scanLineForSecrets(item.content, item.lineNumber, absPath, relFile, entropyThreshold);
7575
+ const lineViolations = scanLineForSecrets(item.content, item.lineNumber, absPath, relFile, entropyThreshold, suppressions);
7169
7576
  for (const v of lineViolations) {
7170
7577
  findings.push({ ...v, message: `[DIFF] ${v.message}` });
7171
7578
  }
7172
7579
  }
7173
7580
  }
7174
- return { findings, filesScannedCount: fileGroups.size };
7581
+ return { findings, filesScannedCount: fileGroups.size, suppressions };
7175
7582
  }
7176
7583
  function scanAllProjectFiles(rootDir, excludePatterns, entropyThreshold) {
7177
7584
  const allFiles = walkProjectFiles(rootDir, rootDir, excludePatterns);
7178
7585
  const findings = [];
7586
+ const suppressions = [];
7179
7587
  for (const file of allFiles) {
7180
7588
  try {
7181
7589
  const content = fs7__namespace.readFileSync(file, "utf-8");
7182
- findings.push(...scanContentForSecrets(content, file, rootDir, entropyThreshold));
7590
+ findings.push(...scanContentForSecrets(content, file, rootDir, entropyThreshold, suppressions));
7183
7591
  } catch {
7184
7592
  }
7185
7593
  }
7186
- return { findings, filesScannedCount: allFiles.length };
7594
+ return { findings, filesScannedCount: allFiles.length, suppressions };
7187
7595
  }
7188
7596
  function appendNonDuplicateFindings(target, incoming) {
7189
7597
  for (const item of incoming) {
@@ -7216,14 +7624,16 @@ function verifySecrets(options = {}) {
7216
7624
  const rootDir = options.rootDir || process.cwd();
7217
7625
  const entropyThreshold = options.entropyThreshold ?? 4.3;
7218
7626
  const excludePatterns = options.excludePatterns || DEFAULT_EXCLUDED_PATTERNS;
7219
- const { findings, filesScannedCount } = options.diff ? scanDiffItems(getGitDiffLines(rootDir, options.baseBranch), rootDir, excludePatterns, entropyThreshold) : scanAllProjectFiles(rootDir, excludePatterns, entropyThreshold);
7627
+ const { findings, filesScannedCount, suppressions } = options.diff ? scanDiffItems(getGitDiffLines(rootDir, options.baseBranch), rootDir, excludePatterns, entropyThreshold) : scanAllProjectFiles(rootDir, excludePatterns, entropyThreshold);
7220
7628
  const merged = mergeGitleaksFindings(findings, rootDir, options.gitleaks);
7629
+ const hasExpired = (suppressions || []).some((s) => s.status === "expired");
7221
7630
  const result = {
7222
- success: merged.findings.length === 0,
7631
+ success: merged.findings.length === 0 && !hasExpired,
7223
7632
  totalFilesScanned: filesScannedCount,
7224
7633
  findingsCount: merged.findings.length,
7225
7634
  findings: merged.findings,
7226
- scannedWithGitleaks: merged.scannedWithGitleaks
7635
+ scannedWithGitleaks: merged.scannedWithGitleaks,
7636
+ suppressions
7227
7637
  };
7228
7638
  result.reportMarkdown = generateSecretsReportMarkdown(result);
7229
7639
  return result;
@@ -7448,8 +7858,12 @@ function walkSourceFiles(dir, rootDir, excludes = DEFAULT_SAST_EXCLUDES) {
7448
7858
  }
7449
7859
  return files;
7450
7860
  }
7451
- function isLineExemptFromSast(line) {
7452
- return line.includes("ai-sdlc:allow-sast") || line.includes("ai-sdlc:allow-prompt-injection") || line.includes("nosec");
7861
+ function checkLineSuppression(line, relPath, lineNumber, collected) {
7862
+ if (line.includes("ai-sdlc:allow-prompt-injection")) return true;
7863
+ const supp = parseSecuritySuppression(line, relPath, lineNumber);
7864
+ if (!supp) return false;
7865
+ if (collected) collected.push(supp);
7866
+ return supp.status === "active";
7453
7867
  }
7454
7868
  function checkRuleMatch(rule, line, ext, minSeverity) {
7455
7869
  if (rule.fileExtensions && !rule.fileExtensions.includes(ext)) return false;
@@ -7457,7 +7871,7 @@ function checkRuleMatch(rule, line, ext, minSeverity) {
7457
7871
  rule.pattern.lastIndex = 0;
7458
7872
  return rule.pattern.test(line);
7459
7873
  }
7460
- function scanFileForSast(filePath, rootDir, minSeverity = "HIGH") {
7874
+ function scanFileForSast(filePath, rootDir, minSeverity = "HIGH", collectedSuppressions) {
7461
7875
  const violations = [];
7462
7876
  const ext = path4__namespace.extname(filePath).toLowerCase();
7463
7877
  try {
@@ -7466,7 +7880,7 @@ function scanFileForSast(filePath, rootDir, minSeverity = "HIGH") {
7466
7880
  const relPath = path4__namespace.relative(rootDir, filePath).replace(/\\/g, "/");
7467
7881
  for (let i = 0; i < lines.length; i++) {
7468
7882
  const line = lines[i];
7469
- if (isLineExemptFromSast(line)) continue;
7883
+ if (checkLineSuppression(line, relPath, i + 1, collectedSuppressions)) continue;
7470
7884
  for (const rule of SAST_RULES) {
7471
7885
  if (checkRuleMatch(rule, line, ext, minSeverity)) {
7472
7886
  violations.push({
@@ -7506,8 +7920,9 @@ function verifySast(options = {}) {
7506
7920
  const targetDirs = options.targetDirectories || ["src", "packages", "prompts"];
7507
7921
  const filesToScan = collectSastFiles(rootDir, targetDirs);
7508
7922
  const violations = [];
7923
+ const suppressions = [];
7509
7924
  for (const file of filesToScan) {
7510
- violations.push(...scanFileForSast(file, rootDir, minSeverity));
7925
+ violations.push(...scanFileForSast(file, rootDir, minSeverity, suppressions));
7511
7926
  }
7512
7927
  if (shouldRunSemgrep(options)) {
7513
7928
  try {
@@ -7515,11 +7930,13 @@ function verifySast(options = {}) {
7515
7930
  } catch {
7516
7931
  }
7517
7932
  }
7933
+ const hasExpired = suppressions.some((s) => s.status === "expired");
7518
7934
  const result = {
7519
- success: violations.length === 0,
7935
+ success: violations.length === 0 && !hasExpired,
7520
7936
  totalFilesScanned: filesToScan.length,
7521
7937
  violationsCount: violations.length,
7522
- violations
7938
+ violations,
7939
+ suppressions
7523
7940
  };
7524
7941
  result.reportMarkdown = generateSastReportMarkdown(result);
7525
7942
  return result;
@@ -7572,7 +7989,7 @@ var PROMPT_INJECTION_SIGNATURES = [
7572
7989
  severity: "CRITICAL",
7573
7990
  regex: /(?:\b(?:system\s+(?:prompt\s+)?override|override\s+system\s+prompt|developer\s+mode\s+enabled|dan\s+mode(?:\s+enabled)?|unfiltered\s+(?:ai\s+)?mode)\b)/i,
7574
7991
  message: "Attempted system prompt override, developer mode, or unrestricted mode activation"
7575
- // ai-sdlc:allow-prompt-injection
7992
+ // ai-sdlc:allow-sast rule="PROMPT-INJ-MODE-OVERRIDE" reason="Regla interna de deteccion" expires="2099-12-31" approved-by="security@ai-sdlc.dev"
7576
7993
  },
7577
7994
  {
7578
7995
  ruleId: "PROMPT-INJ-LEAK",
@@ -7596,7 +8013,7 @@ var PROMPT_INJECTION_SIGNATURES = [
7596
8013
  function scanLinesForPromptInjection(lines, findings) {
7597
8014
  for (let i = 0; i < lines.length; i++) {
7598
8015
  const line = lines[i];
7599
- if (line.includes("ai-sdlc:allow-prompt-injection") || line.includes("nosec")) continue;
8016
+ if (line.includes("ai-sdlc:allow-prompt-injection")) continue;
7600
8017
  for (const sig of PROMPT_INJECTION_SIGNATURES) {
7601
8018
  sig.regex.lastIndex = 0;
7602
8019
  if (sig.regex.test(line)) {
@@ -9585,6 +10002,7 @@ var PREFIX_MAP = {
9585
10002
  "ACT": { type: "actor", layer: "product" },
9586
10003
  "UC": { type: "use-case", layer: "product" },
9587
10004
  "BR": { type: "business-rule", layer: "product" },
10005
+ "BC": { type: "bounded-context", layer: "product" },
9588
10006
  "ABUSE": { type: "abuse-case", layer: "product" },
9589
10007
  "DATA-ASSET": { type: "data-asset", layer: "product" },
9590
10008
  "PRIV-ROPA": { type: "privacy-ropa", layer: "product" },
@@ -9603,6 +10021,7 @@ var TYPE_LOOKUP = {
9603
10021
  "use-case": { type: "use-case", layer: "product" },
9604
10022
  "usecase": { type: "use-case", layer: "product" },
9605
10023
  "business-rule": { type: "business-rule", layer: "product" },
10024
+ "bounded-context": { type: "bounded-context", layer: "product" },
9606
10025
  "rule": { type: "business-rule", layer: "product" },
9607
10026
  "abuse-case": { type: "abuse-case", layer: "product" },
9608
10027
  "data-asset": { type: "data-asset", layer: "product" },
@@ -9810,14 +10229,28 @@ function registerScannedArtifactNodes(scannedMap, nodeMap) {
9810
10229
  }
9811
10230
  }
9812
10231
  }
10232
+ function ensureNodeExists(id, nodeMap, fallbackType, fallbackLayer = "product") {
10233
+ if (!nodeMap.has(id)) {
10234
+ const classification = classifyArtifactLayerAndType(id, fallbackType || "");
10235
+ const type = classification?.type || fallbackType || "product";
10236
+ const layer = classification?.layer || fallbackLayer;
10237
+ nodeMap.set(id, {
10238
+ id,
10239
+ label: id,
10240
+ title: id,
10241
+ type,
10242
+ layer,
10243
+ status: "COMPLIANT"
10244
+ });
10245
+ }
10246
+ }
9813
10247
  function connectTargets(sourceId, rawTargets, relation, nodeMap, addEdge, defaultType, defaultLayer = "product") {
9814
10248
  const list = Array.isArray(rawTargets) ? rawTargets : typeof rawTargets === "string" ? [rawTargets] : [];
9815
10249
  for (const item of list) {
9816
10250
  if (typeof item === "string" && item.trim()) {
9817
10251
  const targetId = item.trim();
9818
- if (defaultType && !nodeMap.has(targetId)) {
9819
- nodeMap.set(targetId, { id: targetId, label: targetId, title: targetId, type: defaultType, layer: defaultLayer, status: "COMPLIANT" });
9820
- }
10252
+ ensureNodeExists(sourceId, nodeMap, defaultType, defaultLayer);
10253
+ ensureNodeExists(targetId, nodeMap, defaultType, defaultLayer);
9821
10254
  addEdge({ id: `edge-${sourceId}-${targetId}`, source: sourceId, target: targetId, label: relation, relation, status: "COMPLIANT" });
9822
10255
  }
9823
10256
  }
@@ -9960,6 +10393,23 @@ function connectAdrRelationships(art, nodeMap, addEdge) {
9960
10393
  }
9961
10394
  }
9962
10395
  }
10396
+ function connectBoundedContextRelationships(art, nodeMap, addEdge) {
10397
+ for (const cmp of toList(art.frontmatter["components-involved"] || art.frontmatter.components)) {
10398
+ const id = cmp.trim();
10399
+ if (id) {
10400
+ connectTargets(art.id, [id], "encompasses", nodeMap, addEdge, "component", "architecture");
10401
+ }
10402
+ }
10403
+ const cm = art.frontmatter["context-mapping"];
10404
+ if (cm && typeof cm === "object") {
10405
+ for (const up of toList(cm["upstream-dependencies"])) {
10406
+ const id = up.trim();
10407
+ if (id) {
10408
+ connectTargets(art.id, [id], "depends-on", nodeMap, addEdge, "bounded-context", "product");
10409
+ }
10410
+ }
10411
+ }
10412
+ }
9963
10413
  function connectEnclaveRelationships(art, nodeMap, addEdge) {
9964
10414
  for (const sec of toList(art.frontmatter["enforced-by"])) {
9965
10415
  const id = sec.trim();
@@ -9980,6 +10430,7 @@ var CONNECTOR_MAP = {
9980
10430
  "security-requirement": connectRequirementMitigations,
9981
10431
  "privacy-requirement": connectRequirementMitigations,
9982
10432
  "adr": connectAdrRelationships,
10433
+ "bounded-context": connectBoundedContextRelationships,
9983
10434
  "security-enclave": connectEnclaveRelationships
9984
10435
  };
9985
10436
  function connectArtifactRelationships(scannedMap, nodeMap, addEdge) {
@@ -9991,14 +10442,11 @@ function connectArtifactRelationships(scannedMap, nodeMap, addEdge) {
9991
10442
  function updateTracesForEdge(e, nodeMap) {
9992
10443
  const srcNode = nodeMap.get(e.source);
9993
10444
  const tgtNode = nodeMap.get(e.target);
9994
- if (srcNode) {
9995
- srcNode.downstream = srcNode.downstream || [];
9996
- if (!srcNode.downstream.includes(e.target)) srcNode.downstream.push(e.target);
9997
- }
9998
- if (tgtNode) {
9999
- tgtNode.upstream = tgtNode.upstream || [];
10000
- if (!tgtNode.upstream.includes(e.source)) tgtNode.upstream.push(e.source);
10001
- }
10445
+ if (!srcNode || !tgtNode) return;
10446
+ srcNode.downstream = srcNode.downstream || [];
10447
+ if (!srcNode.downstream.includes(e.target)) srcNode.downstream.push(e.target);
10448
+ tgtNode.upstream = tgtNode.upstream || [];
10449
+ if (!tgtNode.upstream.includes(e.source)) tgtNode.upstream.push(e.source);
10002
10450
  }
10003
10451
  function buildNodeElements(nodeMap, nodesByLayer) {
10004
10452
  let conformingCount = 0;
@@ -10015,8 +10463,8 @@ function buildNodeElements(nodeMap, nodesByLayer) {
10015
10463
  }
10016
10464
  return { elements, conformingCount, issueCount };
10017
10465
  }
10018
- function buildEdgeElements(edges) {
10019
- return edges.map((e) => ({
10466
+ function buildEdgeElements(edges, nodeMap) {
10467
+ return edges.filter((e) => nodeMap.has(e.source) && nodeMap.has(e.target)).map((e) => ({
10020
10468
  group: "edges",
10021
10469
  data: e,
10022
10470
  classes: `relation-${e.relation} status-${e.status?.toLowerCase() || "compliant"}`
@@ -10026,12 +10474,13 @@ function assembleGraphElementsResult(nodeMap, edges, driftTargets) {
10026
10474
  for (const [id, node] of nodeMap.entries()) {
10027
10475
  if (driftTargets.has(id)) node.status = "DRIFT";
10028
10476
  }
10029
- for (const e of edges) {
10477
+ const validEdges = edges.filter((e) => nodeMap.has(e.source) && nodeMap.has(e.target));
10478
+ for (const e of validEdges) {
10030
10479
  updateTracesForEdge(e, nodeMap);
10031
10480
  }
10032
10481
  const nodesByLayer = { product: 0, requirement: 0, architecture: 0, test: 0 };
10033
10482
  const { elements: nodeElements, conformingCount, issueCount } = buildNodeElements(nodeMap, nodesByLayer);
10034
- const edgeElements = buildEdgeElements(edges);
10483
+ const edgeElements = buildEdgeElements(validEdges, nodeMap);
10035
10484
  return {
10036
10485
  elements: [...nodeElements, ...edgeElements],
10037
10486
  nodesByLayer,
@@ -10492,9 +10941,24 @@ var DASHBOARD_CLIENT_SCRIPT = `
10492
10941
  console.error('Cytoscape library not loaded');
10493
10942
  return;
10494
10943
  }
10495
- cy = cytoscape({
10496
- container: document.getElementById('cy'),
10497
- elements: elements,
10944
+ try {
10945
+ var validNodeIds = new Set();
10946
+ (elements || []).forEach(function(el) {
10947
+ if (el && el.group === 'nodes' && el.data && el.data.id) {
10948
+ validNodeIds.add(el.data.id);
10949
+ }
10950
+ });
10951
+ var safeElements = (elements || []).filter(function(el) {
10952
+ if (!el || !el.data) return false;
10953
+ if (el.group === 'edges') {
10954
+ return validNodeIds.has(el.data.source) && validNodeIds.has(el.data.target);
10955
+ }
10956
+ return true;
10957
+ });
10958
+
10959
+ cy = cytoscape({
10960
+ container: document.getElementById('cy'),
10961
+ elements: safeElements,
10498
10962
  boxSelectionEnabled: false,
10499
10963
  autoungrabify: true,
10500
10964
  style: [
@@ -10515,6 +10979,14 @@ var DASHBOARD_CLIENT_SCRIPT = `
10515
10979
  'text-max-width': '65px'
10516
10980
  }
10517
10981
  },
10982
+ {
10983
+ selector: 'node.layer-product',
10984
+ style: { 'shape': 'diamond', 'background-color': '#0e7490', 'border-color': '#38bdf8', 'width': 50, 'height': 50 }
10985
+ },
10986
+ {
10987
+ selector: 'node.layer-architecture',
10988
+ style: { 'shape': 'hexagon', 'background-color': '#4338ca', 'border-color': '#818cf8', 'width': 60, 'height': 45 }
10989
+ },
10518
10990
  {
10519
10991
  selector: 'node.type-architecture-introduction',
10520
10992
  style: {
@@ -10620,6 +11092,19 @@ var DASHBOARD_CLIENT_SCRIPT = `
10620
11092
  'height': 40
10621
11093
  }
10622
11094
  },
11095
+ {
11096
+ selector: 'node.type-bounded-context',
11097
+ style: {
11098
+ 'shape': 'round-rectangle',
11099
+ 'background-color': '#4338ca',
11100
+ 'border-color': '#a5b4fc',
11101
+ 'border-width': 2.5,
11102
+ 'width': 75,
11103
+ 'height': 42,
11104
+ 'font-weight': 'bold',
11105
+ 'text-max-width': '70px'
11106
+ }
11107
+ },
10623
11108
  {
10624
11109
  selector: 'node.type-security-enclave',
10625
11110
  style: {
@@ -10664,20 +11149,12 @@ var DASHBOARD_CLIENT_SCRIPT = `
10664
11149
  'height': 32
10665
11150
  }
10666
11151
  },
10667
- {
10668
- selector: 'node.layer-product:not(.type-architecture-introduction):not(.type-journey):not(.type-actor):not(.type-use-case):not(.type-usecase):not(.type-business-rule):not(.type-rule):not(.type-abuse-case):not(.type-threat-actor):not(.type-data-asset):not(.type-privacy-ropa)',
10669
- style: { 'shape': 'diamond', 'background-color': '#0e7490', 'border-color': '#38bdf8', 'width': 50, 'height': 50 }
10670
- },
10671
- {
10672
- selector: 'node.layer-architecture:not(.type-component):not(.type-adr):not(.type-security-enclave)',
10673
- style: { 'shape': 'hexagon', 'background-color': '#4338ca', 'border-color': '#818cf8', 'width': 60, 'height': 45 }
10674
- },
10675
11152
  {
10676
11153
  selector: 'node.status-conforme, node.status-compliant',
10677
11154
  style: { 'border-color': '#10b981' }
10678
11155
  },
10679
11156
  {
10680
- selector: 'node.status-hu\xE9rfano, node.status-orphan, node.status-drift',
11157
+ selector: 'node.status-orphan, node.status-drift, node.status-huerfano',
10681
11158
  style: { 'border-color': '#ef4444', 'background-color': '#7f1d1d' }
10682
11159
  },
10683
11160
  {
@@ -10731,14 +11208,22 @@ var DASHBOARD_CLIENT_SCRIPT = `
10731
11208
  selector: 'edge.relation-verified-by',
10732
11209
  style: { 'line-color': '#10b981', 'target-arrow-color': '#10b981', 'width': 1.8 }
10733
11210
  },
11211
+ {
11212
+ selector: 'edge.relation-encompasses',
11213
+ style: { 'line-color': '#a5b4fc', 'target-arrow-color': '#a5b4fc', 'width': 2 }
11214
+ },
11215
+ {
11216
+ selector: 'edge.relation-depends-on',
11217
+ style: { 'line-color': '#c084fc', 'target-arrow-color': '#c084fc', 'line-style': 'dashed', 'width': 1.8 }
11218
+ },
10734
11219
  {
10735
11220
  selector: 'node.highlighted',
10736
11221
  style: {
10737
11222
  'border-width': 4,
10738
11223
  'border-color': '#38bdf8',
10739
- 'shadow-blur': 15,
10740
- 'shadow-color': '#38bdf8',
10741
- 'shadow-opacity': 0.8
11224
+ 'underlay-color': '#38bdf8',
11225
+ 'underlay-padding': 4,
11226
+ 'underlay-opacity': 0.4
10742
11227
  }
10743
11228
  },
10744
11229
  {
@@ -10807,7 +11292,10 @@ var DASHBOARD_CLIENT_SCRIPT = `
10807
11292
  currentHoverNodeId = null;
10808
11293
  hideTooltip();
10809
11294
  });
11295
+ } catch (err) {
11296
+ console.error('Error initializing Cytoscape:', err);
10810
11297
  }
11298
+ }
10811
11299
 
10812
11300
  function highlightCriticalPath(node) {
10813
11301
  cy.elements().removeClass('highlighted dimmed');
@@ -10924,6 +11412,7 @@ var DASHBOARD_CLIENT_SCRIPT = `
10924
11412
  'actor': '.type-actor, .type-threat-actor',
10925
11413
  'use-case': '.type-use-case, .type-usecase',
10926
11414
  'business-rule': '.type-business-rule, .type-rule',
11415
+ 'bounded-context': '.type-bounded-context',
10927
11416
  'abuse-case': '.type-abuse-case, .type-threat-actor',
10928
11417
  'data-asset': '.type-data-asset',
10929
11418
  'privacy-ropa': '.type-privacy-ropa',
@@ -11031,7 +11520,7 @@ var DASHBOARD_CLIENT_SCRIPT = `
11031
11520
  nodes.connectedEdges().show();
11032
11521
  } else {
11033
11522
  cy.elements().hide();
11034
- var nodes = cy.nodes('.status-orphan, .status-hu\xE9rfano, .status-drift');
11523
+ var nodes = cy.nodes('.status-orphan, .status-huerfano, .status-drift');
11035
11524
  nodes.show();
11036
11525
  nodes.connectedEdges().show();
11037
11526
  }
@@ -11336,6 +11825,7 @@ var GRAPH_LEGEND_HTML = `
11336
11825
  <div class="legend-item" data-type="actor" onclick="handleTypologyClick(event, 'actor')" title="Filter Actor"><span class="legend-dot" style="background:#065f46; border:2px solid #34d399; border-radius:50%;"></span><strong>Actor</strong> (ACT)</div>
11337
11826
  <div class="legend-item" data-type="use-case" onclick="handleTypologyClick(event, 'use-case')" title="Filter Use Case"><span class="legend-dot" style="background:#0369a1; border:2px solid #38bdf8;"></span><strong>Use Case</strong> (UC)</div>
11338
11827
  <div class="legend-item" data-type="business-rule" onclick="handleTypologyClick(event, 'business-rule')" title="Filter Business Rule"><span class="legend-dot" style="background:#b45309; border:2px solid #fbbf24; transform:rotate(45deg);"></span><strong>Business Rule</strong> (BR)</div>
11828
+ <div class="legend-item" data-type="bounded-context" onclick="handleTypologyClick(event, 'bounded-context')" title="Filter Bounded Context"><span class="legend-dot" style="background:#4338ca; border:2px solid #a5b4fc;"></span><strong>Bounded Context</strong> (BC)</div>
11339
11829
  <div class="legend-item" data-type="abuse-case" onclick="handleTypologyClick(event, 'abuse-case')" title="Filter Abuse Case"><span class="legend-dot" style="background:#881337; border:2px solid #f43f5e;"></span><strong>Abuse Case</strong> (ABUSE)</div>
11340
11830
  <div class="legend-item" data-type="data-asset" onclick="handleTypologyClick(event, 'data-asset')" title="Filter Data Asset"><span class="legend-dot" style="background:#134e4a; border:2px solid #5eead4;"></span><strong>Data Asset</strong> (DATA-ASSET)</div>
11341
11831
  <div class="legend-item" data-type="privacy-ropa" onclick="handleTypologyClick(event, 'privacy-ropa')" title="Filter Privacy ROPA"><span class="legend-dot" style="background:#1e3a8a; border:2px solid #60a5fa;"></span><strong>Privacy ROPA</strong> (PRIV-ROPA)</div>
@@ -11380,7 +11870,7 @@ function renderGraphToolbarHtml() {
11380
11870
  ` <div class="graph-toolbar">`,
11381
11871
  ` <div class="tool-row"><button class="tool-btn" onclick="cyZoom(0.2)">Zoom +</button><button class="tool-btn" onclick="cyZoom(-0.2)">Zoom -</button><button class="tool-btn" onclick="cy.fit(30)">Center</button><button class="tool-btn" onclick="resetHighlight()">Reset</button></div>`,
11382
11872
  ` <div class="tool-row"><select id="layout-select" class="tool-select" onchange="applyLayout(this.value)"><option value="breadthfirst">Hierarchical (Layers)</option><option value="cose">Force-directed (COSE)</option><option value="concentric">Concentric</option><option value="circle">Circular</option></select></div>`,
11383
- ` <div class="tool-row"><select id="type-filter" class="tool-select" onchange="filterType(this.value)"><option value="all">All Typologies</option><option value="architecture-introduction">Vision &amp; Goals (ARCH-INTRO)</option><option value="journey">Journeys (JRN)</option><option value="actor">Actors (ACT)</option><option value="use-case">Use Cases (UC)</option><option value="business-rule">Business Rules (BR)</option><option value="abuse-case">Abuse Cases (ABUSE)</option><option value="data-asset">Data Assets (DATA-ASSET)</option><option value="privacy-ropa">Privacy ROPA (PRIV-ROPA)</option><option value="requirement">Requirements (FR/QR/SEC/PRIV)</option><option value="architecture">Architecture (CMP/ADR)</option><option value="test">Testing (BDD/Test)</option></select></div>`,
11873
+ ` <div class="tool-row"><select id="type-filter" class="tool-select" onchange="filterType(this.value)"><option value="all">All Typologies</option><option value="architecture-introduction">Vision &amp; Goals (ARCH-INTRO)</option><option value="journey">Journeys (JRN)</option><option value="actor">Actors (ACT)</option><option value="use-case">Use Cases (UC)</option><option value="business-rule">Business Rules (BR)</option><option value="bounded-context">Bounded Contexts (BC)</option><option value="abuse-case">Abuse Cases (ABUSE)</option><option value="data-asset">Data Assets (DATA-ASSET)</option><option value="privacy-ropa">Privacy ROPA (PRIV-ROPA)</option><option value="requirement">Requirements (FR/QR/SEC/PRIV)</option><option value="architecture">Architecture (CMP/ADR)</option><option value="test">Testing (BDD/Test)</option></select></div>`,
11384
11874
  ` <div class="tool-row"><select id="layer-filter" class="tool-select" onchange="filterLayer(this.value)"><option value="all">All Layers</option><option value="product">Layer 1: Product (Upstream)</option><option value="requirement">Layer 2: Requirements</option><option value="architecture">Layer 3: Architecture (Midstream)</option><option value="test">Layer 4: Testing (Downstream)</option></select></div>`,
11385
11875
  ` <div class="tool-row"><select id="status-filter" class="tool-select" onchange="filterStatus(this.value)"><option value="all">All Statuses</option><option value="COMPLIANT">Only Compliant (Green)</option><option value="issues">Only Orphans / Drift (Red)</option></select></div>`,
11386
11876
  ` <div class="tool-row"><input type="text" id="node-search" class="tool-input" placeholder="Search node ID..." oninput="searchNode(this.value)"></div>`,
@@ -12110,6 +12600,159 @@ function generateDashboardReport(options = {}) {
12110
12600
  html
12111
12601
  };
12112
12602
  }
12603
+ var SARIF_SCHEMA_2_1_0 = "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json";
12604
+ var SARIF_VERSION = "2.1.0";
12605
+ function normalizeUri(filePath) {
12606
+ return filePath.replace(/\\/g, "/");
12607
+ }
12608
+ function mapSastSeverityToSarifLevel(severity) {
12609
+ switch (severity) {
12610
+ case "CRITICAL":
12611
+ case "HIGH":
12612
+ return "error";
12613
+ case "MEDIUM":
12614
+ return "warning";
12615
+ case "LOW":
12616
+ default:
12617
+ return "note";
12618
+ }
12619
+ }
12620
+ var SAST_CWE_MAP = {
12621
+ "SAST-001": "CWE-89",
12622
+ "SAST-002": "CWE-78",
12623
+ "SAST-003": "CWE-95",
12624
+ "SAST-004": "CWE-918",
12625
+ "SAST-005": "CWE-22",
12626
+ "SAST-006": "CWE-77",
12627
+ "SAST-007": "CWE-77"
12628
+ };
12629
+ var SAST_OWASP_MAP = {
12630
+ "SAST-001": "A03:2021-Injection",
12631
+ "SAST-002": "A03:2021-Injection",
12632
+ "SAST-003": "A03:2021-Injection",
12633
+ "SAST-004": "A10:2021-Server-Side Request Forgery (SSRF)",
12634
+ "SAST-005": "A01:2021-Broken Access Control",
12635
+ "SAST-006": "LLM01:2023-Prompt Injection",
12636
+ "SAST-007": "LLM01:2023-Prompt Injection"
12637
+ };
12638
+ function resolveSastCwe(ruleId) {
12639
+ const prefix = ruleId.slice(0, 8);
12640
+ const cwe = SAST_CWE_MAP[prefix];
12641
+ return cwe ? [cwe] : ["CWE-200"];
12642
+ }
12643
+ function resolveSastOwasp(ruleId) {
12644
+ const prefix = ruleId.slice(0, 8);
12645
+ const owasp = SAST_OWASP_MAP[prefix];
12646
+ return owasp ? [owasp] : ["A04:2021-Insecure Design"];
12647
+ }
12648
+ function buildSastRuleDescriptors() {
12649
+ return SAST_RULES.map((rule) => ({
12650
+ id: rule.id,
12651
+ name: rule.type,
12652
+ shortDescription: { text: rule.description },
12653
+ fullDescription: { text: rule.description },
12654
+ defaultConfiguration: { level: mapSastSeverityToSarifLevel(rule.severity) },
12655
+ properties: {
12656
+ tags: ["security", "sast"],
12657
+ cwe: resolveSastCwe(rule.id),
12658
+ owasp: resolveSastOwasp(rule.id)
12659
+ }
12660
+ }));
12661
+ }
12662
+ function buildSecretRuleDescriptors() {
12663
+ return SECRET_RULES.map((rule) => ({
12664
+ id: rule.id,
12665
+ name: rule.type,
12666
+ shortDescription: { text: rule.description },
12667
+ fullDescription: { text: rule.description },
12668
+ defaultConfiguration: { level: "error" },
12669
+ properties: {
12670
+ tags: ["security", "secrets", "credentials"],
12671
+ cwe: ["CWE-798"],
12672
+ owasp: ["A07:2021-Identification and Authentication Failures"]
12673
+ }
12674
+ }));
12675
+ }
12676
+ function buildSastResults(sastResult) {
12677
+ if (!sastResult || !sastResult.violations) return [];
12678
+ return sastResult.violations.map((v) => ({
12679
+ ruleId: v.ruleId,
12680
+ level: mapSastSeverityToSarifLevel(v.severity),
12681
+ message: { text: v.message },
12682
+ locations: [
12683
+ {
12684
+ physicalLocation: {
12685
+ artifactLocation: { uri: normalizeUri(v.relPath) },
12686
+ region: { startLine: v.lineNumber, startColumn: 1 }
12687
+ }
12688
+ }
12689
+ ]
12690
+ }));
12691
+ }
12692
+ function buildSecretResults(secretsResult) {
12693
+ if (!secretsResult || !secretsResult.findings) return [];
12694
+ return secretsResult.findings.map((f) => ({
12695
+ ruleId: f.ruleId,
12696
+ level: "error",
12697
+ message: {
12698
+ text: `Potential hardcoded secret or credential leak detected: ${f.type} (${f.maskedMatch})`
12699
+ },
12700
+ locations: [
12701
+ {
12702
+ physicalLocation: {
12703
+ artifactLocation: { uri: normalizeUri(f.relPath) },
12704
+ region: { startLine: f.lineNumber, startColumn: 1 }
12705
+ }
12706
+ }
12707
+ ]
12708
+ }));
12709
+ }
12710
+ function collectAllRules() {
12711
+ const sastRules = buildSastRuleDescriptors();
12712
+ const secretRules = buildSecretRuleDescriptors();
12713
+ const ruleMap = /* @__PURE__ */ new Map();
12714
+ for (const r of [...sastRules, ...secretRules]) {
12715
+ if (!ruleMap.has(r.id)) {
12716
+ ruleMap.set(r.id, r);
12717
+ }
12718
+ }
12719
+ return Array.from(ruleMap.values());
12720
+ }
12721
+ function generateSecuritySarifReport(options = {}) {
12722
+ const toolName = options.toolName || "aisdlc-security";
12723
+ const toolVersion = options.toolVersion || "2.2.0";
12724
+ const informationUri = options.informationUri || "https://github.com/altromon/AI-SDLC";
12725
+ const sastResults = buildSastResults(options.sastResult);
12726
+ const secretResults = buildSecretResults(options.secretsResult);
12727
+ const allResults = [...sastResults, ...secretResults];
12728
+ return {
12729
+ $schema: SARIF_SCHEMA_2_1_0,
12730
+ version: SARIF_VERSION,
12731
+ runs: [
12732
+ {
12733
+ tool: {
12734
+ driver: {
12735
+ name: toolName,
12736
+ version: toolVersion,
12737
+ informationUri,
12738
+ rules: collectAllRules()
12739
+ }
12740
+ },
12741
+ results: allResults
12742
+ }
12743
+ ]
12744
+ };
12745
+ }
12746
+ function serializeSarifDocument(doc, pretty = true) {
12747
+ return JSON.stringify(doc, null, pretty ? 2 : 0);
12748
+ }
12749
+ function writeSecuritySarifReport(outputPath, doc, pretty = true) {
12750
+ const dir = path4__namespace.dirname(outputPath);
12751
+ if (!fs7__namespace.existsSync(dir)) {
12752
+ fs7__namespace.mkdirSync(dir, { recursive: true });
12753
+ }
12754
+ fs7__namespace.writeFileSync(outputPath, serializeSarifDocument(doc, pretty), "utf-8");
12755
+ }
12113
12756
 
12114
12757
  // src/init/agent-templates.ts
12115
12758
  var SPECIALIZED_AGENT_TEMPLATES = [
@@ -12215,7 +12858,7 @@ var SPECIALIZED_AGENT_TEMPLATES = [
12215
12858
  - Read exclusively requirements cited in the \`handoff.yaml\` sidecar (\`HOF-*\`) and their referenced artifacts.
12216
12859
  - **Agreed Project Technology**: Always use the testing frameworks, E2E/UI runners, and technology stack agreed upon for the project (as defined in \`ADR-*\`, \`design.md\`, \`package.json\`, or project configuration) if present, without requiring the user to specify it in the prompt.
12217
12860
  - **Mandatory End-to-End (E2E) & User Interface (UI) Testing**: Never forget or omit End-to-End (E2E) and User Interface (UI) tests. Automatically include E2E and UI test suites alongside BDD/integration tests whenever requirements involve user-facing flows or interfaces, so the user never has to remind you in the prompt.
12218
- - **Per-Interactive-Element Exhaustive Testing**: Create specific tests for **every** UI element with which the user can interact (buttons, inputs, selects, forms, modals, links, toggles, tabs, etc.), explicitly evaluating for each element:
12861
+ - **Per-Interactive-Element Exhaustive Testing**: Create specific tests for **every** UI element with which the user can interact (buttons, inputs, selects, forms, modals, links, toggles, tabs, etc.), using external tools such as Playwright or FlatUI (or the agreed project testing technology), explicitly evaluating for each element:
12219
12862
  1. **Happy Path**: nominal user interaction with valid inputs producing the expected UI state/response.
12220
12863
  2. **Sad Path**: error handling, invalid interactions, validation rejections, disabled/blocked states, and failure recovery.
12221
12864
  3. **Boundary Values**: minimum/maximum lengths, numeric extremes, empty/whitespace inputs, edge selections, and rapid/repeated interactions.
@@ -14103,18 +14746,19 @@ pipelines:\r
14103
14746
  - step: *build-and-verify\r
14104
14747
  - step: *sdd-integrate\r
14105
14748
  `;
14106
- var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML = "name: CI - AI-SDLC Quality Gates & Testing\n\non:\n push:\n branches: [ main ]\n pull_request:\n branches: [ main ]\n\njobs:\n verify-and-test:\n runs-on: ubuntu-latest\n strategy:\n matrix:\n node-version: [ 18.x, 20.x, 22.x ]\n\n steps:\n - name: Checkout Code\n uses: actions/checkout@v4\n\n - name: Install pnpm\n uses: pnpm/action-setup@v4\n with:\n version: 10\n\n - name: Setup Node.js ${{ matrix.node-version }}\n uses: actions/setup-node@v4\n with:\n node-version: ${{ matrix.node-version }}\n\n - name: Install Dependencies\n run: |\n pnpm install --frozen-lockfile\n pnpm approve-builds --all\n\n - name: Build Packages\n run: pnpm run build\n\n - name: Run Vitest Unit & Integration Suites\n run: pnpm test\n\n - name: AI-SDLC Quality Gate & Full Verification\n run: npx @aisdlc/cli verify all\n";
14107
- var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML = 'name: Deploy AI-SDLC Dashboard to GitHub Pages\n\non:\n push:\n branches:\n - main\n workflow_dispatch:\n\npermissions:\n contents: read\n pages: write\n id-token: write\n\nconcurrency:\n group: pages\n cancel-in-progress: false\n\njobs:\n deploy-dashboard:\n name: Build & Publish Interactive Dashboard\n runs-on: ubuntu-latest\n environment:\n name: github-pages\n url: ${{ steps.deployment.outputs.page_url }}\n\n steps:\n - name: Checkout Code\n uses: actions/checkout@v4\n with:\n fetch-depth: 0 # Full git history required for historical KPIs and telemetry\n\n - name: Setup Node.js\n uses: actions/setup-node@v4\n with:\n node-version: 20\n\n - name: Generate AI-SDLC Interactive Dashboard\n run: |\n mkdir -p reports\n npx --yes @aisdlc/cli report dashboard --output reports/index.html\n cp reports/index.html reports/dashboard.html\n touch reports/.nojekyll\n\n - name: Setup GitHub Pages\n uses: actions/configure-pages@v5\n\n - name: Upload Pages Artifact\n uses: actions/upload-pages-artifact@v3\n with:\n path: reports\n\n - name: Deploy to GitHub Pages\n id: deployment\n uses: actions/deploy-pages@v4\n\n - name: Emit Summary to GitHub Actions\n if: always() && steps.deployment.outcome == \'success\'\n run: |\n echo "### \u{1F310} AI-SDLC Interactive Dashboard Published" >> $GITHUB_STEP_SUMMARY\n echo "" >> $GITHUB_STEP_SUMMARY\n echo "The interactive PDaC / RTM graph, Quality Gate telemetry, and release metrics are live at:" >> $GITHUB_STEP_SUMMARY\n echo "" >> $GITHUB_STEP_SUMMARY\n echo "\u{1F449} **[Open Live Dashboard](${{ steps.deployment.outputs.page_url }})**" >> $GITHUB_STEP_SUMMARY\n';
14108
- var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML = "name: AI-SDLC PR KPI Aggregator\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\npermissions:\n contents: read\n pull-requests: write\n\njobs:\n aggregate-kpis:\n name: Aggregate PR KPIs & Telemetry\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout Repository\n uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Install pnpm\n uses: pnpm/action-setup@v4\n with:\n version: 10\n\n - name: Setup Node.js\n uses: actions/setup-node@v4\n with:\n node-version: 20\n\n - name: Install Dependencies\n run: |\n pnpm install --frozen-lockfile\n\n - name: Calculate and Emit PR KPIs\n id: kpi\n run: |\n npx @aisdlc/cli kpi pr --base origin/${{ github.base_ref }} --head HEAD >> $GITHUB_STEP_SUMMARY\n";
14109
- 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.ref }}\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 git push\r\n echo "\u2714 Canonical integration committed and synchronized to repository."\r\n else\r\n echo "\u2139 No pending changes generated in working tree."\r\n fi\r\n';
14749
+ 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: [ 18.x, 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";
14750
+ 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';
14751
+ 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";
14752
+ 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';
14110
14753
  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';
14111
- 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\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** | `cosign verify` | Valid signature from Corporate CA | **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';
14754
+ 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\n\n5. **Step 5: Sigstore / Cosign Signature and SLSA Provenance Verification**\n ```bash\n # Verify npm package provenance from registry\n npm audit signatures\n\n # Verify package tarball with Sigstore / Cosign (Keyless via OIDC identity)\n cosign verify-blob \\\n --bundle release-artifacts/package.tgz.bundle \\\n --certificate-identity-regexp "^https://github.com/organization/repo-name/.*$" \\\n --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \\\n release-artifacts/package.tgz\n\n # Verify SLSA Build Provenance Attestation using GitHub CLI\n gh attestation verify release-artifacts/package.tgz --repo organization/repo-name\n ```\n\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';
14112
14755
  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';
14113
- var STARTER_TEMPLATES_PRIVACY_DATA_ASSET_TEMPLATE_MD = '---\nid: DATA-ASSET-USER-PROFILE-001\ntype: data-asset\ntitle: User Profile & Identity Personal Data Asset\nstatus: draft\nversion: "1.0.0"\nschema-version: "1.0"\nclassification: confidential-pii # public, internal, confidential-pii, special-category-sensitive\npii-categories:\n - identifiers\n - contact\ndata-subjects:\n - ACT-USER-001\nfields:\n - name: email\n sensitivity: pii\n masking-strategy: sha256-salt\n - name: phone_number\n sensitivity: pii\n masking-strategy: redact\n - name: operator_callsign\n sensitivity: internal\n masking-strategy: none\nretention-period: 365d\nerasure-method: crypto-shredding\nowner-bounded-context: CMP-IDENTITY-SERVICE-001\nsupersedes: null\nsuperseded-by: null\n---\n\n# DATA-ASSET-USER-PROFILE-001: User Profile & Identity Personal Data Asset\n\n## 1. Data Asset Inventory & Purpose\nDescribes the structure, storage medium, and operational boundary of the personal data asset governed under GDPR / ISO 27701.\n\n## 2. Field-Level Sensitivity & Masking Policy\n\n| Field Name | Sensitivity | Masking / Pseudonymization Strategy | Allowed in Logs | Allowed in AI Prompts |\n| :--- | :--- | :--- | :---: | :---: |\n| `email` | `pii` | `sha256-salt` | \u274C No | \u274C No |\n| `phone_number` | `pii` | `redact` | \u274C No | \u274C No |\n| `operator_callsign` | `internal` | `none` | \u2705 Yes | \u2705 Yes |\n\n## 3. Storage Limitation & Right to Erasure (GDPR Art. 17)\n- **Maximum Retention TTL**: `365d` after account deactivation.\n- **Erasure Mechanism**: `crypto-shredding` (destruction of per-subject encryption key and PII column purge).\n\n---\n\n## 4. Revision History and Version Control\n\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\n| :--- | :--- | :--- | :--- | :--- |\n| **1.0.0** | 2026-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial personal data asset inventory | CHG-PRIV-001 |\n';
14114
- var STARTER_TEMPLATES_PRIVACY_DPIA_REQUEST_TEMPLATE_MD = '---\nid: DPIA-ASSESSMENT-001\ntype: dpia-request\ntitle: Data Protection Impact Assessment (DPIA / EIPD) Request\nstatus: pending-dpo-approval # pending-dpo-approval, approved, rejected\nversion: "1.0.0"\nschema-version: "1.0"\nropa-reference: PRIV-ROPA-USER-AUTH-001\ndata-assets:\n - DATA-ASSET-USER-PROFILE-001\nspecial-category-triggers:\n - "GDPR Art. 9 Special Category Data or Automated Profiling"\nresidual-risk-level: MEDIUM # LOW, MEDIUM, HIGH\n---\n\n# Data Protection Impact Assessment (DPIA / EIPD \u2014 GDPR Art. 35)\n\n## 1. Trigger & Necessity Assessment\n- **Associated ROPA**: `PRIV-ROPA-USER-AUTH-001`\n- **Data Assets Affected**: `DATA-ASSET-USER-PROFILE-001`\n- **Why a DPIA is Mandatory**: Processing involves `special_category_sensitive` data (biometrics, health, precise geolocation) or systematic automated profiling under GDPR Art. 35.\n\n## 2. Necessity, Proportionality & LINDDUN Risk Matrix\n\n| LINDDUN Threat Category | Identified Privacy Risk | Intrinsic Risk | Technical Mitigation (`PRIV-REQ-*`) | Residual Risk |\n| :--- | :--- | :---: | :--- | :---: |\n| **Identifiability** | Re-identification of operator from telemetry streams | HIGH | `PRIV-REQ-MASKING-001` (SHA-256 salted pseudonymization) | LOW |\n| **Disclosure of Information** | Plaintext PII leakage in error logs | HIGH | `PRIV-REQ-MASKING-001` (Redaction middleware) | LOW |\n\n## 3. Mandatory Human Sovereign Signatures (DPO & Legal)\n- [ ] **Data Protection Officer (DPO)**: Necessity, proportionality, and GDPR Art. 35 validation\n- [ ] **Legal / Privacy Counsel**: Lawful basis and cross-border transfer clauses verified\n- [ ] **Security Officer (CISO) / System Architect**: Cryptographic and enclave controls verified\n';
14115
- var STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD = '---\nid: PRIV-REQ-MASKING-001\ntype: privacy-requirement\ntitle: Mandatory Pseudonymization and Log Redaction of Operator PII\nstatus: draft\nversion: "1.0.0"\nschema-version: "1.0"\nprivacy-principle: data-minimization # data-minimization, purpose-limitation, storage-limitation, accuracy, integrity-and-confidentiality, transparency-and-consent, data-subject-rights-arco, pseudonymization-anonymization\nlinddun-category: identifiability # linkability, identifiability, non-repudiation, detectability, disclosure-of-information, unawareness, non-compliance\ngoverns-ropa:\n - PRIV-ROPA-USER-AUTH-001\nprotects-data-assets:\n - DATA-ASSET-USER-PROFILE-001\nenforced-in-enclave: SEC-ENC-DMZ-001\ncompliance-references:\n - "GDPR-Art-25-Privacy-by-Design"\n - "GDPR-Art-32-Pseudonymization"\n - "ISO-27701-A.7.4"\nacceptance-format: gherkin\ncucumber-tags:\n - "@PRIV-REQ-MASKING-001"\n - "@privacy"\n - "@linddun"\nsupersedes: null\nsuperseded-by: null\n---\n\n# PRIV-REQ-MASKING-001: Mandatory Pseudonymization and Log Redaction of Operator PII\n\n## 1. Technical Privacy Control Statement\nThe system MUST pseudonymize or redact all `confidential-pii` fields (`email`, `phone_number`) prior to emitting structured application logs, telemetry traces, or external AI prompts, and MUST enforce automated TTL purge after `365d`.\n\n---\n\n## 2. Upstream Privacy Traceability (PDaC)\n\n| Dimension | Link / Artifact | Relationship Type | Status |\n| :--- | :--- | :--- | :--- |\n| **Record of Processing (ROPA)** | `PRIV-ROPA-USER-AUTH-001` | Governs Processing Activity | Validated |\n| **Protected Data Asset** | `DATA-ASSET-USER-PROFILE-001` | Enforces Field Masking & TTL | Validated |\n\n---\n\n## 3. Privacy Verification Criteria in Gherkin Format (Cucumber Privacy Tests)\n\n```gherkin\n@PRIV-REQ-MASKING-001 @privacy @linddun\nFeature: Personal Data Pseudonymization and Zero-PII Telemetry Logging\n As a Data Protection Officer (DPO)\n I want all personal identifiers to be redacted or salted-hashed before logging\n So that application logs and telemetry never expose raw personal data\n\n Scenario: Structured logger redacts PII fields automatically (Nominal Privacy Control)\n Given an authenticated operator session with email "operator@example.com" and phone "+34600112233"\n When the telemetry ingestion service emits an audit log entry\n Then the serialized log payload must not contain the literal string "operator@example.com"\n And the serialized log payload must not contain the literal string "+34600112233"\n And the email field must be replaced by a deterministic SHA-256 salted pseudonym\n\n Scenario: Right to erasure purges expired or revoked subject records\n Given a personal data record for subject "ACT-USER-001" exceeding the "365d" retention TTL\n When the automated retention enforcement job executes\n Then the personal data fields must be irreversibly erased via crypto-shredding\n```\n\n---\n\n## 4. Revision History and Version Control\n\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\n| :--- | :--- | :--- | :--- | :--- |\n| **1.0.0** | 2026-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial privacy control specification | CHG-PRIV-001 |\n';
14116
- var STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD = '---\nid: PRIV-ROPA-USER-AUTH-001\ntype: privacy-ropa\ntitle: Record of Processing Activity for Operator Authentication and Session Audit\nstatus: draft\nversion: "1.0.0"\nschema-version: "1.0"\nlawful-basis: contract # consent, contract, legal-obligation, vital-interests, public-task, legitimate-interests\nspecial-category-condition: null\nprocessing-purpose: "Authenticate authorized operators and maintain tamper-evident operational session audit trails."\nuse-cases:\n - UC-ACTION-001\ndata-assets:\n - DATA-ASSET-USER-PROFILE-001\ndata-subjects:\n - ACT-USER-001\nretention-ttl: 365d\ncross-border-transfer: false\ntransfer-safeguards: null\nsubprocessors: []\ndpia-required: false\ndpia-reference: null\nmitigated-by:\n - PRIV-REQ-MASKING-001\nsupersedes: null\nsuperseded-by: null\n---\n\n# PRIV-ROPA-USER-AUTH-001: Record of Processing Activity (GDPR Art. 30)\n\n## 1. Processing Activity Summary & Lawful Basis\n- **Lawful Basis (GDPR Art. 6.1)**: `contract` \u2014 Necessary for the performance of the operator service agreement.\n- **Purpose of Processing**: Authenticate authorized operators and maintain tamper-evident operational session audit trails.\n\n## 2. Linked Product & Data Artifacts\n\n| Dimension | Artifact ID | Relationship |\n| :--- | :--- | :--- |\n| **Triggering Use Cases** | `UC-ACTION-001` | Initiates personal data collection/processing |\n| **Data Assets Processed** | `DATA-ASSET-USER-PROFILE-001` | Personal data fields subject to minimization |\n| **Data Subjects** | `ACT-USER-001` | Natural persons whose data is processed |\n| **Governing Privacy Controls** | `PRIV-REQ-MASKING-001` | Technical privacy-by-design controls |\n\n## 3. International Transfers & Subprocessors\n- **Cross-Border Transfer Outside EEA**: `false`\n- **Authorized Subprocessors**: None (In-house processing within `SEC-ENC-DMZ-001`).\n\n---\n\n## 4. Revision History and Version Control\n\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\n| :--- | :--- | :--- | :--- | :--- |\n| **1.0.0** | 2026-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial GDPR Art. 30 ROPA entry | CHG-PRIV-001 |\n';
14756
+ var STARTER_TEMPLATES_PRIVACY_DATA_ASSET_TEMPLATE_MD = '---\r\nid: DATA-ASSET-USER-PROFILE-001\r\ntype: data-asset\r\ntitle: User Profile & Identity Personal Data Asset\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nclassification: confidential-pii # public, internal, confidential-pii, special-category-sensitive\r\npii-categories:\r\n - identifiers\r\n - contact\r\ndata-subjects:\r\n - ACT-USER-001\r\nfields:\r\n - name: email\r\n sensitivity: pii\r\n masking-strategy: sha256-salt\r\n - name: phone_number\r\n sensitivity: pii\r\n masking-strategy: redact\r\n - name: operator_callsign\r\n sensitivity: internal\r\n masking-strategy: none\r\nretention-period: 365d\r\nerasure-method: crypto-shredding\r\nowner-bounded-context: CMP-IDENTITY-SERVICE-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# DATA-ASSET-USER-PROFILE-001: User Profile & Identity Personal Data Asset\r\n\r\n## 1. Data Asset Inventory & Purpose\r\nDescribes the structure, storage medium, and operational boundary of the personal data asset governed under GDPR / ISO 27701.\r\n\r\n## 2. Field-Level Sensitivity & Masking Policy\r\n\r\n| Field Name | Sensitivity | Masking / Pseudonymization Strategy | Allowed in Logs | Allowed in AI Prompts |\r\n| :--- | :--- | :--- | :---: | :---: |\r\n| `email` | `pii` | `sha256-salt` | \u274C No | \u274C No |\r\n| `phone_number` | `pii` | `redact` | \u274C No | \u274C No |\r\n| `operator_callsign` | `internal` | `none` | \u2705 Yes | \u2705 Yes |\r\n\r\n## 3. Storage Limitation & Right to Erasure (GDPR Art. 17)\r\n- **Maximum Retention TTL**: `365d` after account deactivation.\r\n- **Erasure Mechanism**: `crypto-shredding` (destruction of per-subject encryption key and PII column purge).\r\n\r\n---\r\n\r\n## 4. 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-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial personal data asset inventory | CHG-PRIV-001 |\r\n';
14757
+ var STARTER_TEMPLATES_PRIVACY_DPIA_REQUEST_TEMPLATE_MD = '---\r\nid: DPIA-ASSESSMENT-001\r\ntype: dpia-request\r\ntitle: Data Protection Impact Assessment (DPIA / EIPD) Request\r\nstatus: pending-dpo-approval # pending-dpo-approval, approved, rejected\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nropa-reference: PRIV-ROPA-USER-AUTH-001\r\ndata-assets:\r\n - DATA-ASSET-USER-PROFILE-001\r\nspecial-category-triggers:\r\n - "GDPR Art. 9 Special Category Data or Automated Profiling"\r\nresidual-risk-level: MEDIUM # LOW, MEDIUM, HIGH\r\n---\r\n\r\n# Data Protection Impact Assessment (DPIA / EIPD \u2014 GDPR Art. 35)\r\n\r\n## 1. Trigger & Necessity Assessment\r\n- **Associated ROPA**: `PRIV-ROPA-USER-AUTH-001`\r\n- **Data Assets Affected**: `DATA-ASSET-USER-PROFILE-001`\r\n- **Why a DPIA is Mandatory**: Processing involves `special_category_sensitive` data (biometrics, health, precise geolocation) or systematic automated profiling under GDPR Art. 35.\r\n\r\n## 2. Necessity, Proportionality & LINDDUN Risk Matrix\r\n\r\n| LINDDUN Threat Category | Identified Privacy Risk | Intrinsic Risk | Technical Mitigation (`PRIV-REQ-*`) | Residual Risk |\r\n| :--- | :--- | :---: | :--- | :---: |\r\n| **Identifiability** | Re-identification of operator from telemetry streams | HIGH | `PRIV-REQ-MASKING-001` (SHA-256 salted pseudonymization) | LOW |\r\n| **Disclosure of Information** | Plaintext PII leakage in error logs | HIGH | `PRIV-REQ-MASKING-001` (Redaction middleware) | LOW |\r\n\r\n## 3. Mandatory Human Sovereign Signatures (DPO & Legal)\r\n- [ ] **Data Protection Officer (DPO)**: Necessity, proportionality, and GDPR Art. 35 validation\r\n- [ ] **Legal / Privacy Counsel**: Lawful basis and cross-border transfer clauses verified\r\n- [ ] **Security Officer (CISO) / System Architect**: Cryptographic and enclave controls verified\r\n';
14758
+ var STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD = '---\r\nid: PRIV-REQ-MASKING-001\r\ntype: privacy-requirement\r\ntitle: Mandatory Pseudonymization and Log Redaction of Operator PII\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nprivacy-principle: data-minimization # data-minimization, purpose-limitation, storage-limitation, accuracy, integrity-and-confidentiality, transparency-and-consent, data-subject-rights-arco, pseudonymization-anonymization\r\nlinddun-category: identifiability # linkability, identifiability, non-repudiation, detectability, disclosure-of-information, unawareness, non-compliance\r\ngoverns-ropa:\r\n - PRIV-ROPA-USER-AUTH-001\r\nprotects-data-assets:\r\n - DATA-ASSET-USER-PROFILE-001\r\nenforced-in-enclave: SEC-ENC-DMZ-001\r\ncompliance-references:\r\n - "GDPR-Art-25-Privacy-by-Design"\r\n - "GDPR-Art-32-Pseudonymization"\r\n - "ISO-27701-A.7.4"\r\nacceptance-format: gherkin\r\ncucumber-tags:\r\n - "@PRIV-REQ-MASKING-001"\r\n - "@privacy"\r\n - "@linddun"\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# PRIV-REQ-MASKING-001: Mandatory Pseudonymization and Log Redaction of Operator PII\r\n\r\n## 1. Technical Privacy Control Statement\r\nThe system MUST pseudonymize or redact all `confidential-pii` fields (`email`, `phone_number`) prior to emitting structured application logs, telemetry traces, or external AI prompts, and MUST enforce automated TTL purge after `365d`.\r\n\r\n---\r\n\r\n## 2. Upstream Privacy Traceability (PDaC)\r\n\r\n| Dimension | Link / Artifact | Relationship Type | Status |\r\n| :--- | :--- | :--- | :--- |\r\n| **Record of Processing (ROPA)** | `PRIV-ROPA-USER-AUTH-001` | Governs Processing Activity | Validated |\r\n| **Protected Data Asset** | `DATA-ASSET-USER-PROFILE-001` | Enforces Field Masking & TTL | Validated |\r\n\r\n---\r\n\r\n## 3. Privacy Verification Criteria in Gherkin Format (Cucumber Privacy Tests)\r\n\r\n```gherkin\r\n@PRIV-REQ-MASKING-001 @privacy @linddun\r\nFeature: Personal Data Pseudonymization and Zero-PII Telemetry Logging\r\n As a Data Protection Officer (DPO)\r\n I want all personal identifiers to be redacted or salted-hashed before logging\r\n So that application logs and telemetry never expose raw personal data\r\n\r\n Scenario: Structured logger redacts PII fields automatically (Nominal Privacy Control)\r\n Given an authenticated operator session with email "operator@example.com" and phone "+34600112233"\r\n When the telemetry ingestion service emits an audit log entry\r\n Then the serialized log payload must not contain the literal string "operator@example.com"\r\n And the serialized log payload must not contain the literal string "+34600112233"\r\n And the email field must be replaced by a deterministic SHA-256 salted pseudonym\r\n\r\n Scenario: Right to erasure purges expired or revoked subject records\r\n Given a personal data record for subject "ACT-USER-001" exceeding the "365d" retention TTL\r\n When the automated retention enforcement job executes\r\n Then the personal data fields must be irreversibly erased via crypto-shredding\r\n```\r\n\r\n---\r\n\r\n## 4. 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-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial privacy control specification | CHG-PRIV-001 |\r\n';
14759
+ var STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD = '---\r\nid: PRIV-ROPA-USER-AUTH-001\r\ntype: privacy-ropa\r\ntitle: Record of Processing Activity for Operator Authentication and Session Audit\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nlawful-basis: contract # consent, contract, legal-obligation, vital-interests, public-task, legitimate-interests\r\nspecial-category-condition: null\r\nprocessing-purpose: "Authenticate authorized operators and maintain tamper-evident operational session audit trails."\r\nuse-cases:\r\n - UC-ACTION-001\r\ndata-assets:\r\n - DATA-ASSET-USER-PROFILE-001\r\ndata-subjects:\r\n - ACT-USER-001\r\nretention-ttl: 365d\r\ncross-border-transfer: false\r\ntransfer-safeguards: null\r\nsubprocessors: []\r\ndpia-required: false\r\ndpia-reference: null\r\nmitigated-by:\r\n - PRIV-REQ-MASKING-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# PRIV-ROPA-USER-AUTH-001: Record of Processing Activity (GDPR Art. 30)\r\n\r\n## 1. Processing Activity Summary & Lawful Basis\r\n- **Lawful Basis (GDPR Art. 6.1)**: `contract` \u2014 Necessary for the performance of the operator service agreement.\r\n- **Purpose of Processing**: Authenticate authorized operators and maintain tamper-evident operational session audit trails.\r\n\r\n## 2. Linked Product & Data Artifacts\r\n\r\n| Dimension | Artifact ID | Relationship |\r\n| :--- | :--- | :--- |\r\n| **Triggering Use Cases** | `UC-ACTION-001` | Initiates personal data collection/processing |\r\n| **Data Assets Processed** | `DATA-ASSET-USER-PROFILE-001` | Personal data fields subject to minimization |\r\n| **Data Subjects** | `ACT-USER-001` | Natural persons whose data is processed |\r\n| **Governing Privacy Controls** | `PRIV-REQ-MASKING-001` | Technical privacy-by-design controls |\r\n\r\n## 3. International Transfers & Subprocessors\r\n- **Cross-Border Transfer Outside EEA**: `false`\r\n- **Authorized Subprocessors**: None (In-house processing within `SEC-ENC-DMZ-001`).\r\n\r\n---\r\n\r\n## 4. 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-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial GDPR Art. 30 ROPA entry | CHG-PRIV-001 |\r\n';
14117
14760
  var STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD = '---\r\nid: ACT-NAME-001\r\ntype: actor\r\ntitle: Descriptive Actor Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nrole-type: human-user # human-user, ai-agent, external-system, sensor-iot\r\ndescription: One-sentence summary of the role this actor performs in the system.\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# ACT-NAME-001: Descriptive Actor Title\r\n\r\n## 1. Profile and Responsibility\r\nDescribes who this actor is, their operational context, and what goals they pursue when interacting with the product.\r\n\r\n## 2. System Touchpoints\r\n- Interaction channels (Web UI, REST API, WebSocket, Messaging).\r\n- Privilege level and latency/availability expectations.\r\n\r\n---\r\n\r\n## 3. 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-03 | Product Owner / Analyst | Initial actor profile creation | CHG-INIT-001 |\r\n';
14761
+ var STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD = '---\nid: BC-NAME-001\ntype: bounded-context\ntitle: "Bounded Context Name"\nstatus: draft\nversion: "1.0.0"\nschema-version: "1.0"\ndomain-type: core\nstrategic-classification:\n evolutionary-stage: custom-built\n business-model-role: differentiator\nresponsibilities:\n - "Primary domain capability or boundary responsibility"\nubiquitous-language-terms:\n - TERM-NAME-001\ncontext-mapping:\n upstream-dependencies: []\n downstream-dependents: []\n integration-patterns:\n - pattern: Open Host Service / Published Language\n related-context: BC-ANOTHER-001\ncomponents-involved:\n - CMP-NAME-001\nsupersedes: null\nsuperseded-by: null\n---\n\n# BC-NAME-001: Bounded Context Name\n\n## 1. Context Purpose and Scope\nExecutive summary and clear linguistic boundary defining what is inside vs. outside this Bounded Context according to Domain-Driven Design (DDD).\n\n### 1.1 Strategic Domain Classification\n- **Domain Type**: `core` (Core Domain / Supporting Subdomain / Generic Subdomain)\n- **Evolutionary Stage**: `custom-built` (Genesis / Custom-Built / Product / Commodity - Wardley Mapping)\n- **Business Role**: Key differentiator creating competitive advantage for the product.\n\n---\n\n## 2. Ubiquitous Language & Domain Invariants\n- **Core Entities & Aggregates**: High-level domain concepts encapsulated within this boundary.\n- **Glossary References**:\n - `TERM-NAME-001`: Primary ubiquitous term definition.\n- **Domain Invariants**: Critical business rules (`BR-*`) enforced exclusively within this boundary.\n\n---\n\n## 3. Context Mapping & Integration Relationships\nRelationships with adjacent Bounded Contexts:\n- **Upstream Contexts**: Contexts providing domain events, APIs, or contracts.\n- **Downstream Contexts**: Contexts consuming models from this boundary.\n- **Anti-Corruption Layers (ACL)**: Translations safeguarding ubiquitous language from external contamination.\n\n---\n\n## 4. Architecture Mapping\n- **Physical Components (`CMP-*`)**: Components implementing aggregates, services, or adapters within this context.\n- **Security Enclaves (`SEC-ENC-*`)**: Execution boundary or isolation tier.\n\n---\n\n## 5. Revision History\n\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\n| :--- | :--- | :--- | :--- | :--- |\n| **1.0.0** | YYYY-MM-DD | Product Analyst / Architect | Initial Bounded Context definition | CHG-INIT-001 |\n';
14118
14762
  var STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD = '---\r\nid: BR-DOMAIN-001\r\ntype: business-rule\r\ntitle: Business Rule Name\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nenforcement-level: strict-invariant # strict-invariant, override-with-approval, guideline\r\ndefined-in: BC-CONTEXT-001\r\nuses-terms:\r\n - TERM-TERM-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# BR-DOMAIN-001: Business Rule Name\r\n\r\n## 1. Rule Definition\r\nFormally establishes the business invariant that must not be violated under any circumstance.\r\n\r\n## 2. Business Rationale and Consequences\r\n- **Why it exists**: Economic, regulatory, or technical justification for the constraint.\r\n- **Action upon violation**: Immediate transaction rejection with a formal error code.\r\n\r\n---\r\n\r\n## 3. 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-03 | Product Owner / Analyst | Initial business rule definition | CHG-INIT-001 |\r\n';
14119
14763
  var STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD = '---\r\nid: JRN-NAME-001\r\ntype: journey\r\ntitle: Descriptive User or Operator Journey Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\npersona: ACT-OPERATOR-001\r\nstages:\r\n - "Discovery and Planning"\r\n - "Configuration and Pre-flight"\r\n - "Mission Execution"\r\n - "Post-Analysis and Wrap-up"\r\ntouchpoints:\r\n - "Mission planning web portal"\r\n - "Ground control station (GCS)"\r\n - "Real-time telemetry dashboard"\r\n - "Flight report exporter"\r\nrelated-use-cases:\r\n - UC-PLAN-MISSION-001\r\n - UC-MONITOR-FLIGHT-001\r\npain-points:\r\n - "Latency when loading offline navigation maps"\r\n - "Complexity in manual flight plan reconciliation"\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# JRN-NAME-001: Descriptive User or Operator Journey Title\r\n\r\n## 1. Actor / Primary Persona Profile\r\n- **Protagonist Actor**: `ACT-OPERATOR-001`\r\n- **Main Goal**: Complete operational workflow with high efficiency, safety, and real-time visibility.\r\n\r\n---\r\n\r\n## 2. Journey Stages Map\r\n\r\n| Stage | User Goal | Touchpoints | Frictions / Pain Points |\r\n| :--- | :--- | :--- | :--- |\r\n| **1. Discovery and Planning** | Design route and validate operational constraints | Mission planning web portal | Complexity in manual flight plan reconciliation |\r\n| **2. Configuration and Pre-flight** | Verify subsystem health and link integrity | Ground control station (GCS) | Latency when loading offline navigation maps |\r\n| **3. Mission Execution** | Supervise telemetry and respond to alerts | Real-time telemetry dashboard | None detected in nominal flow |\r\n| **4. Post-Analysis and Wrap-up** | Export mission logs and performance metrics | Flight report exporter | Telemetry consolidation latency |\r\n\r\n---\r\n\r\n## 3. Traceability to Use Cases and Product\r\n\r\n- `UC-PLAN-MISSION-001`: Planning and validation of safe corridors.\r\n- `UC-MONITOR-FLIGHT-001`: Ingestion and visualization of real-time telemetry.\r\n\r\n---\r\n\r\n## 4. Revision History\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-23 | Product Manager / UX Lead | Initial operator journey definition | CHG-INIT-001 |\r\n';
14120
14764
  var STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD = '---\r\n# Valid prefixes: FR- (Functional), QR- (Quality), CON- (Constraint)\r\nid: FR-FEATURE-001\r\ntype: requirement\r\ntitle: Concise Requirement Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\ncategory: functional # functional, quality, constraint\r\n\r\n# 1. PRODUCT TRACEABILITY (Upstream)\r\nderives-from:\r\n - UC-ACTION-001\r\n\r\n# 2. METHOD AND ACCEPTANCE CRITERIA\r\nverifiable-by: cucumber-bdd # cucumber-bdd, automated-unit-test, integration-test, performance-benchmark\r\nacceptance-format: gherkin # gherkin, declarative-prose\r\ncucumber-tags:\r\n - "@FR-FEATURE-001"\r\n - "@automated"\r\n - "@regression"\r\n\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# FR-FEATURE-001: Concise Requirement Title\r\n\r\n## 1. Normative Statement\r\nThe system MUST [unambiguous and atomic description of expected behavior under specific conditions].\r\n\r\n---\r\n\r\n## 2. Upstream Traceability\r\n\r\n| Dimension | Link / Artifact | Relationship Type | Status |\r\n| :--- | :--- | :--- | :--- |\r\n| **Product (Upstream)** | `UC-ACTION-001` | Derived from Use Case | Validated |\r\n\r\n> *Note: Traceability toward Architecture and Testing is maintained inversely; services declare `satisfies-requirements` and test suites tag or reference this requirement.*\r\n\r\n---\r\n\r\n## 3. Acceptance Criteria in Gherkin (Cucumber) Format\r\n\r\n```gherkin\r\n@FR-FEATURE-001 @automated @regression\r\nFeature: Concise Requirement Title\r\n As a [primary actor / user role]\r\n I want [functional system capability]\r\n So that [obtain expected business benefit or value]\r\n\r\n Background:\r\n Given the system is in operational state\r\n And the actor is authenticated with valid permissions\r\n\r\n Scenario: Successful nominal flow\r\n Given the system has initial precondition configured\r\n When the actor submits a request with valid parameters\r\n Then the system processes the operation successfully\r\n And the resource status updates to "ACTIVE"\r\n And the corresponding domain event is emitted\r\n\r\n Scenario Outline: Business rule validation and edge cases\r\n Given data input with value "<input>"\r\n When requirement validation is processed\r\n Then the response must return status code "<status_code>"\r\n And the descriptive message must be "<message>"\r\n\r\n Examples:\r\n | input | status_code | message |\r\n | correct_value | 200 | SUCCESSFUL_OPERATION |\r\n | invalid_value | 400 | ERROR_INVALID_PARAMETER |\r\n | limit_exceeded | 422 | ERROR_LIMIT_EXCEEDED |\r\n```\r\n\r\n---\r\n\r\n## 4. 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-03 | Product Owner / QA | Initial specification with complete 360\xB0 traceability | CHG-INIT-001 |\r\n';
@@ -14124,10 +14768,10 @@ var STARTER_TEMPLATES_PRODUCT_USER_DESIGN_FEEDBACK_TEMPLATE_MD = '---\r\nid: UFB
14124
14768
  var STARTER_TEMPLATES_SAFETY_HAZARD_TEMPLATE_MD = '---\r\nid: HAZ-NAME-001\r\ntype: hazard\r\ntitle: Descriptive Operational Hazard Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nseverity: critical # catastrophic, critical, major, minor, negligible\r\nprobability: remote # frequent, probable, occasional, remote, improbable, extremely-improbable\r\nfault-tolerance-time-ms: 250 # FTTI: Fault tolerance time interval in milliseconds\r\n\r\n# Safety requirements mitigating this hazard (Downstream)\r\nmitigated-by:\r\n - SAF-REQ-NAME-001\r\n\r\nhazardous-condition: "Description of the anomalous operational condition or failure generating the hazard."\r\npotential-effect: "Loss of operational control, structural damage, or unintended collision."\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# HAZ-NAME-001: Descriptive Operational Hazard Title\r\n\r\n## 1. Operational Hazard Definition\r\nDetailed and concise description of the unintended operational condition representing a risk to the mission, the system, or the physical environment.\r\n\r\n## 2. Severity and Probability Classification\r\n\r\n| Parameter | Classification | Technical Justification |\r\n| :--- | :--- | :--- |\r\n| **Severity** | `critical` | Potential significant damage to aircraft or mission without direct human casualty. |\r\n| **Probability** | `remote` | Estimated failure rate $< 10^{-5}$ per nominal operating hour. |\r\n| **FTTI (Fault Tolerance)** | `250 ms` | Maximum time window to transition to safe state prior to adverse effects. |\r\n\r\n## 3. Triggering Conditions and Effects\r\n\r\n### Anomalous Condition\r\nDetail the initiating event (sensor failure, link loss, CAN bus freeze, or actuator degradation).\r\n\r\n### Potential Effect\r\nDirect consequence if the failure is not detected and mitigated within the FTTI interval.\r\n\r\n---\r\n\r\n## 4. Mitigation Traceability (Downstream Safety Requirements)\r\n\r\n| Safety Requirement | Fail-Safe Action | Mitigation Status |\r\n| :--- | :--- | :--- |\r\n| `SAF-REQ-NAME-001` | Contingency maneuver or transition to safe state | Designed |\r\n\r\n---\r\n\r\n## 5. Revision History\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-23 | Safety Engineer | Initial hazard definition creation | CHG-INIT-001 |\r\n';
14125
14769
  var STARTER_TEMPLATES_SAFETY_SAFETY_REQ_TEMPLATE_MD = '---\r\n# Valid prefixes: SAF-REQ- (Safety Requirement / Operational Safety)\r\nid: SAF-REQ-NAME-001\r\ntype: safety-requirement\r\ntitle: Concise Safety Requirement Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nsafety-domain: flight-control # flight-control, collision-avoidance, energy-management, emergency-recovery, sensor-integrity\r\nsafety-integrity-level: "DAL-B" # DO-178C (DAL-A/B/C/D), ISO 26262 (ASIL-A/B/C/D), IEC 61508 (SIL-1/2/3/4)\r\n\r\n# 1. HAZARD AND RISK ANALYSIS TRACEABILITY (Upstream)\r\nmitigates-hazard:\r\n - HAZ-DESCRIPTION-001\r\n\r\nfail-safe-action: "SAFE_STATE_ACTION" # e.g. RETURN_TO_HOME, CONTROLLED_LANDING, MOTOR_CUTOFF\r\nfault-tolerance-time-ms: 100 # Maximum fault tolerance time interval (FTTI) before entering safe state\r\n\r\n# 2. VERIFICATION METHOD AND CRITERIA\r\nacceptance-format: gherkin\r\ncucumber-tags:\r\n - "@SAF-REQ-NAME-001"\r\n - "@safety"\r\n - "@failsafe"\r\n\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# SAF-REQ-NAME-001: Concise Safety Requirement Title\r\n\r\n## 1. Normative Operational Safety Statement\r\nThe system MUST [unambiguous description of defensive behavior preventing a hazard or mitigating unintended loss of control]. If [anomalous condition or hardware/sensor failure], the system MUST transition to safe state `SAFE_STATE_ACTION` within [X] milliseconds.\r\n\r\n---\r\n\r\n## 2. Hazard Mitigation and Fault Tolerance Matrix\r\n\r\n| Dimension | Link / Artifact | Relationship Type | Status |\r\n| :--- | :--- | :--- | :--- |\r\n| **Hazard Analysis (Upstream)** | `HAZ-DESCRIPTION-001` | Loss / Accident Mitigation | Validated |\r\n| **Integrity Level (SIL/DAL)** | `DAL-B` | Critical Software Level | Compliant |\r\n| **Fail-Safe Action** | `SAFE_STATE_ACTION` | Emergency Transition | Verified |\r\n\r\n---\r\n\r\n## 3. Mitigation Criteria in Gherkin Format (Safety & Fail-Safe Tests)\r\n\r\n```gherkin\r\n@SAF-REQ-NAME-001 @safety @failsafe\r\nFeature: Operational Failure Mitigation and Safe State Transition\r\n As an Autonomous Flight Control System\r\n I want to detect critical anomalies and execute contingency maneuvers\r\n So that I prevent accidents, collisions, and safeguard physical safety\r\n\r\n Scenario: Anomalous condition detection and safe state activation\r\n Given the system is in nominal operation\r\n When an unrecoverable failure condition occurs\r\n Then the system must detect the anomaly in less than 100 milliseconds\r\n And abort the current trajectory\r\n And execute contingency maneuver "SAFE_STATE_ACTION"\r\n And emit a critical alert to the ground control station\r\n```\r\n\r\n---\r\n\r\n## 4. Revision History\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-15 | Safety Engineer | Initial safety requirement creation | CHG-INIT-001 |\r\n';
14126
14770
  var STARTER_TEMPLATES_SDD_DESIGN_TEMPLATE_MD = '---\r\nid: DSG-CHG-NAME-001\r\ntype: spec-design\r\nchange-id: CHG-NAME-001\r\ntitle: "Technical Design: Concise Delivery Increment Title"\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nhandoff: "HOF-CHG-NAME-001"\r\narchitecture-component: "CMP-NAME-001"\r\nenclave: "SEC-ENC-DMZ"\r\nstatus: draft\r\ncontracts:\r\n - component: "CMP-NAME-001"\r\n interface: "FeatureService"\r\n methods:\r\n - "executeAction"\r\n - "validateInput"\r\ncitations:\r\n - id: "UC-ACTION-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Use case driving this increment."\r\n - id: "FR-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Associated functional requirement."\r\n---\r\n\r\n# Technical Design: CHG-NAME-001\r\n\r\n## 1. Architectural Mapping and Zero Trust Enclave\r\nDefines the associated architectural component and corresponding security enclave.\r\n\r\n## 2. Data Contracts and Interfaces\r\nDetails interfaces, DTOs, TypeScript types, or data schemas.\r\n\r\n## 3. Error Handling and Mitigation Protocols\r\nSpecifies exception handling, error codes, and failure responses.\r\n\r\n## 4. License Policy Compliance (`license-policy.yaml`)\r\nLists external libraries or dependencies and confirms compatibility with the license policy.\r\n\r\n## 5. Revision History\r\n\r\n| Version | Date | Author | Change Description | Reference |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | YYYY-MM-DD | Author Name | Initial formal technical design | CHG-NAME-001 |\r\n';
14127
- var STARTER_TEMPLATES_SDD_HANDOFF_TEMPLATE_YAML = '# ==============================================================================\r\n# AI-SDLC: PDaC Handoff Sidecar Template\r\n# Identifier emitted by PDaC for SDD workspace (OpenSpec / Spec Kit)\r\n# ==============================================================================\r\n\r\nid: HOF-CHG-001-FEATURE-NAME\r\ntype: handoff\r\ntitle: "Canonical Product Handoff for Delivery Increment"\r\nchangeId: CHG-001-FEATURE-NAME\r\nversion: "1.0.0"\r\ncreatedAt: "2026-09-14T00:00:00.000Z"\r\n\r\n# Product subgraph formally delivered to the SDD increment\r\nsubgraph:\r\n useCases:\r\n - UC-STREAM-TELEMETRY\r\n requirements:\r\n - FR-TELEMETRY-STREAM-001\r\n - QR-LATENCY-REALTIME\r\n securityRequirements:\r\n - SEC-REQ-MTLS-STREAM\r\n businessRules:\r\n - BR-TELEMETRY-VALIDITY\r\n abuseCases:\r\n - ABUSE-TELEMETRY-SPOOFING\r\n actors:\r\n - ACT-AUTONOMOUS-UAV\r\n - ACT-DRONE-OPERATOR\r\n - ACT-THREAT-SPOOFER\r\n\r\n# Cryptographic citations with immutable digests for drift detection\r\ncitations:\r\n - id: UC-STREAM-TELEMETRY\r\n digest: "sha256:5e5818cf2cc6d489f5d1b23cd4b61afac715cfc57a68fd44915b4adccd569cb8"\r\n comment: "Use case defining the continuous streaming flow"\r\n - id: FR-TELEMETRY-STREAM-001\r\n digest: "sha256:ad9e72840757ec009a610093476ea485c57dbb7cacb515ea27e8c8c153352e27"\r\n comment: "Functional requirement for telemetry ingestion"\r\n - id: SEC-REQ-MTLS-STREAM\r\n digest: "sha256:57f0c2ad1059aafdb6b3c140c074abbe8ee6f6c61e9733c69454f1551ed3397d"\r\n comment: "Mandatory mutual authentication via client certificates"\r\n';
14771
+ var STARTER_TEMPLATES_SDD_HANDOFF_TEMPLATE_YAML = '# ==============================================================================\r\n# AI-SDLC: PDaC Handoff Sidecar Template\r\n# Identifier emitted by PDaC for SDD workspace (OpenSpec / Spec Kit)\r\n# ==============================================================================\r\n\r\nid: HOF-CHG-001-FEATURE-NAME\r\ntype: handoff\r\ntitle: "Canonical Product Handoff for Delivery Increment"\r\nchangeId: CHG-001-FEATURE-NAME\r\nversion: "1.0.0"\r\ncreatedAt: "2026-09-14T00:00:00.000Z"\r\n\r\n# Product subgraph formally delivered to the SDD increment\r\nsubgraph:\r\n useCases:\r\n - UC-STREAM-TELEMETRY\r\n requirements:\r\n - FR-TELEMETRY-STREAM-001\r\n - QR-LATENCY-REALTIME\r\n securityRequirements:\r\n - SEC-REQ-MTLS-STREAM\r\n privacyRequirements:\r\n - PRIV-REQ-MASKING-001\r\n dataAssets:\r\n - DATA-ASSET-PILOT-IDENTITY\r\n privacyRopa:\r\n - PRIV-ROPA-FLIGHT-LOGS\r\n businessRules:\r\n - BR-TELEMETRY-VALIDITY\r\n abuseCases:\r\n - ABUSE-TELEMETRY-SPOOFING\r\n actors:\r\n - ACT-AUTONOMOUS-UAV\r\n - ACT-DRONE-OPERATOR\r\n - ACT-THREAT-SPOOFER\r\n\r\n# Cryptographic citations with immutable digests for drift detection\r\ncitations:\r\n - id: UC-STREAM-TELEMETRY\r\n digest: "sha256:5e5818cf2cc6d489f5d1b23cd4b61afac715cfc57a68fd44915b4adccd569cb8"\r\n comment: "Use case defining the continuous streaming flow"\r\n - id: FR-TELEMETRY-STREAM-001\r\n digest: "sha256:ad9e72840757ec009a610093476ea485c57dbb7cacb515ea27e8c8c153352e27"\r\n comment: "Functional requirement for telemetry ingestion"\r\n - id: SEC-REQ-MTLS-STREAM\r\n digest: "sha256:57f0c2ad1059aafdb6b3c140c074abbe8ee6f6c61e9733c69454f1551ed3397d"\r\n comment: "Mandatory mutual authentication via client certificates"\r\n - id: PRIV-REQ-MASKING-001\r\n digest: "sha256:606e9ec19d675681ce265aa667367de76629ae7067d710e20f121d5c2e276f82"\r\n comment: "Personal data pseudonymization and telemetry redaction"\r\n';
14128
14772
  var STARTER_TEMPLATES_SDD_PROPOSAL_TEMPLATE_MD = '---\r\nid: CHG-NAME-001\r\ntype: spec-change-proposal\r\ntitle: Concise Delivery Increment Title\r\nstatus: draft # draft, review, approved, applied\r\nauthor: "agent-developer / human-dev"\r\ncitations:\r\n - id: "UC-ACTION-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Use case driving this increment."\r\n - id: "SEC-REQ-CONTROL-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Mandatory security requirement to implement."\r\n - id: "CMP-NAME-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Architectural component housing the change."\r\n---\r\n\r\n# Change Proposal: CHG-NAME-001\r\n\r\n## 1. Motivation and Scope\r\nExplains the problem solved by this increment and what parts of the codebase will be modified.\r\n\r\n## 2. Evaluated External Dependencies\r\n- List of new dependencies to be added and license verification per `license-policy.yaml`.\r\n';
14129
14773
  var STARTER_TEMPLATES_SDD_PULL_REQUEST_TEMPLATE_MD = '---\r\nid: PR-TEMPLATE-SDD-001\r\ntype: pull-request-template\r\ntitle: "Modular AI-SDLC Pull Request Template"\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nstatus: active\r\ndescription: "Institutional template for monitoring weak points and plan balance (X/O) in SDD deliveries"\r\n---\r\n\r\n# Pull Request: [TIER] - [CHANGE-ID] - Brief Title\r\n\r\n## 1. SDD Identification and Traceability\r\n\r\n- **SDD Change Specification**: `specs/changes/active/<change-id>/`\r\n- **PDaC Handoff Sidecar**: `specs/changes/active/<change-id>/handoff.yaml` (ID: `HOF-*`)\r\n- **Git Hierarchy Tier (4 Tiers)**:\r\n - [ ] Tier 4: `task/<PARENT-ID>/<TSK-ID>-<slug>` \u2794 `feat/<PARENT-ID>-<slug>`\r\n - [ ] Tier 3: `feat/<FEAT-ID>-<slug>` \u2794 `release/vX.Y.Z`\r\n - [ ] Tier 2: `release/vX.Y.Z` \u2794 `main`\r\n- **Linked Issues**: Closes #... / Refs #...\r\n\r\n---\r\n\r\n## 2. \u{1F4CB} Plan Execution Matrix and Testing Status (`X` vs `O`)\r\n\r\n> [!IMPORTANT]\r\n> **Non-Negotiable Total Exhaustiveness Rule**:\r\n> This table must include **each and every item identified for implementation** in the delivery plan (originating from `tasks.md`, the SDD specification, or issue criteria), without omitting any or creating abstract groupings.\r\n>\r\n> **Mandatory Marking Convention**:\r\n> - **`[X]` (Completed and Tested)**: Item is 100% implemented and has verifiable automated tests on disk (`tests/` or `.feature`) passing green.\r\n> - **`[O]` (Problem / Blocked)**: If there was any issue, technical limitation, failing test, or deferred scope, it must be marked with `[O]` and **full mandatory justification is required**:\r\n> 1. **Technical root cause** or encountered limitation.\r\n> 2. **Impact** on increment or system.\r\n> 3. **Mitigation** or rationale for deferral.\r\n> 4. **Formal reference** to tracking issue (GitHub Issue or `ADR-TECH-DEBT-*`).\r\n>\r\n> *Any PR with omitted planned items or unjustified `[O]` will be immediately blocked and rejected by the Tech Lead.*\r\n\r\n| Task / Item ID | Planned Description | Status (`[X]` / `[O]`) | Test Evidence on Disk or Mandatory Justification of `[O]` |\r\n| :--- | :--- | :---: | :--- |\r\n| `TSK-001` | <!-- e.g. Contract DTOs and Interfaces Definition --> | **[X]** | Covered in `tests/unit/dto.spec.ts` (100% pass) |\r\n| `TSK-002` | <!-- e.g. Network disconnection resilience --> | **[O]** | **Root cause:** TCP socket mock exhibits race conditions in CI.<br>**Impact:** Low in prod, flaky test.<br>**Mitigation:** Temporary extended timeout; tracked in issue #... |\r\n\r\n---\r\n\r\n## 3. \u{1F5FA}\uFE0F Weak Points Map and Risk Hotspots (Weak Points Hotspots)\r\n\r\n### A. Complexity Hotspots\r\n<!-- Record functions nearing quality-policy.yaml thresholds: CC > 7 (max 10), Cognitive > 10 (max 15), LOC > 30 (max 40), MI < 70 (min 50/65) -->\r\n| File | Function / Module | Metrics (CC / Cognitive / LOC / MI) | Technical Maintainability Justification |\r\n| :--- | :--- | :---: | :--- |\r\n| <!-- e.g. src/engine.ts --> | <!-- parsePayload() --> | CC: 8, Cog: 11, LOC: 32, MI: 72 | Deterministic parser without recursion; exhaustively tested. |\r\n\r\n### B. Edge Cases and Blind Spots\r\n<!-- Scenarios not covered by automated unit tests (concurrency, network timeouts, memory, jitter) -->\r\n- [ ] **Edge Case 1**: <!-- Scenario description, estimated risk, and operational mitigation -->\r\n- [ ] **Edge Case 2**: <!-- Scenario description, estimated risk, and operational mitigation -->\r\n\r\n### C. AI Assumptions\r\n<!-- Behaviors or heuristics assumed by the agent during implementation that require critical human review -->\r\n- [ ] **Assumption 1**: <!-- e.g. Assumed payload always arrives pre-parsed in UTF-8 -->\r\n- [ ] **Assumption 2**: <!-- e.g. Default timeout set to 5000ms as not stipulated in spec -->\r\n\r\n---\r\n\r\n## 4. \u{1F6E1}\uFE0F Attack Surface and Cybersecurity (STRIDE / Zero Trust)\r\n\r\n- [ ] **New External Channels**: Does it introduce HTTP endpoints, sockets, IPC channels, or brokers?\r\n- [ ] **Sanitization and Inputs**: Are all external inputs validated with strict typing schemas (Zod/JSON Schema)?\r\n- [ ] **Insecure Serialization**: Is polymorphic deserialization or dynamic code evaluation avoided?\r\n- [ ] **Secrets and Enclaves**: Are cryptographic keys, credentials, sensitive env vars, or enclaves (`SEC-ENC-*`) handled?\r\n- [ ] **Mitigated Security Requirements**: Implemented IDs (e.g. `SEC-REQ-*`) and associated tests (`SEC-TEST-*` or `.feature`).\r\n\r\n---\r\n\r\n## 5. \u{1F4E6} Dependencies and Licenses Inspection\r\n\r\n- **New Dependencies Added**:\r\n | Package | Version | License Type | `license-policy.yaml` Verification |\r\n | :--- | :---: | :---: | :---: |\r\n | <!-- e.g. zod --> | <!-- ^3.22.4 --> | <!-- MIT --> | <!-- \u2714 Compliant (Permissive) --> |\r\n- [ ] Zero dependencies with prohibited licenses (GPLv3/AGPL/unapproved commercial).\r\n- [ ] Verification executed successfully (`pnpm run verify:licenses`).\r\n\r\n---\r\n\r\n## 6. \u2705 Deterministic Pre-Flight Checklist (Release Gates)\r\n\r\n- [ ] **Strict Typing and Linter**: `pnpm run typecheck` (zero errors, zero unjustified suppressions).\r\n- [ ] **Quality Gate**: `pnpm run verify:quality` (CC $\\le 10$, Cognitive $\\le 15$, MI $\\ge 50$, LOC $\\le 40$).\r\n- [ ] **BDD / Unit Tests**: `pnpm run verify:testing` (Gherkin scenarios synchronized and 100% passing).\r\n- [ ] **360\xB0 Traceability**: `pnpm run verify:traceability` (no orphan requirements).\r\n- [ ] **Open Source Licenses**: `pnpm run verify:licenses` (strict policy compliance).\r\n- [ ] **Schema Compliance**: `pnpm run verify:schemas` (100% of artifacts conform to JSON Schema).\r\n- [ ] **Full Test Suite**: `pnpm run test:all` / `pnpm run verify:all` (general green CI approval).\r\n\r\n---\r\n\r\n## 7. \u{1F6A8} Contingency Plan, Observability, and Rollback\r\n\r\n- **Observability Metrics and Alarms**: <!-- What metrics (p99 latency, 5xx error rate, memory) or logs should be monitored post-deployment? -->\r\n- **Rollback Procedure**: <!-- Exact command or procedure to revert change without collateral impact (e.g. git revert -m 1 <sha>) -->\r\n\r\n---\r\n\r\n## 8. \u{1F4CA} AI-SDLC: Aggregated KPIs Summary\r\n\r\n<!-- AI-SDLC-KPI-SUMMARY-START -->\r\n| Metric | Human | Total PR |\r\n| :--- | :---: | :---: |\r\n| **Commits Made** | - | **-** |\r\n| **Lines Added / Modif.** | - | **-** |\r\n| **Active Development Time** | - | **-** |\r\n| **Consumed Tokens (In+Out)** | - | **-** |\r\n| **Estimated Cost (\u20AC/$)** | \u2014 (Labor) | **-** |\r\n\r\n> *This block is updated automatically via `aisdlc kpi pr` or the CI workflow.*\r\n<!-- AI-SDLC-KPI-SUMMARY-END -->\r\n';
14130
- var STARTER_TEMPLATES_SDD_SPEC_TEMPLATE_MD = '---\r\nid: SPEC-CHG-NAME-001\r\ntype: delivery-spec\r\nchange-id: CHG-NAME-001\r\nprofile: standard # standard, patch, critical\r\nhandoff: HOF-CHG-NAME-001\r\nacceptance-format: gherkin\r\ncucumber-tags:\r\n - "@CHG-NAME-001"\r\n - "@automated"\r\ncitations:\r\n - id: "UC-ACTION-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Canonical use case driving or impacted by this increment."\r\n - id: "FR-NAME-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Formal functional requirement in canonical catalog."\r\n - id: "ACT-ACTOR-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Primary actor participating in the capability."\r\n - id: "CMP-NAME-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Architectural component implementing the specification."\r\n - id: "SEC-REQ-CONTROL-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Mandatory security requirement to implement."\r\n---\r\n\r\n# Delivery Specification: CHG-NAME-001\r\n\r\n## 1. Catalog Scope and Traceability (Canonical Alignment)\r\n\r\n> **MANDATORY SPECIFICATION RULE (ZERO AMBIGUITY / 360\xB0 TRACEABILITY):** \r\n> Every delivery increment (`spec.md`) MUST explicitly declare the exact boundaries of its impact across the canonical catalog (`product/`, `security/`, and `architecture/`). \r\n> An increment cannot author code or tests for unmapped behaviors. It must explicitly declare:\r\n> - **Affected Existing Catalog Items:** Existing functional requirements (`FR-*`), use cases (`UC-*`), actors (`ACT-*`), business rules (`BR-*`), security requirements (`SEC-REQ-*`), or architecture components/ADRs (`CMP-*`, `ADR-*`, `SRV-*`) whose behavior, contracts, or constraints are modified or deprecated.\r\n> - **New Catalog Items Introduced:** Any new functional requirements, use cases, actors, architecture decisions, or security rules created by this increment, identifying their proposed IDs and target catalog destination.\r\n\r\n### 1.1 Affected Existing Catalog Items (Modifications / Deprecations)\r\n\r\n| Catalog Category | Catalog ID | Action (`MODIFIED` / `DEPRECATED`) | Description of Delta & Behavioral Impact |\r\n| :--- | :--- | :--- | :--- |\r\n| Functional Requirement | `FR-EXISTING-001` | `MODIFIED` | Extends validation rules to support batch payload ingestion |\r\n| Use Case | `UC-EXISTING-001` | `MODIFIED` | Adds alternative execution path for handling throttling limits |\r\n| Actor / Persona | `ACT-EXISTING-001` | `MODIFIED` | Expands authorization scope to access batch processing endpoints |\r\n| Architecture / Component | `CMP-CORE-001` | `MODIFIED` | Ingestion pipeline updated to support non-blocking asynchronous dispatch |\r\n\r\n### 1.2 New Catalog Items Introduced (Additions)\r\n\r\n| Catalog Category | Proposed ID | Target Catalog Location | Formal Scope & Functional Contract |\r\n| :--- | :--- | :--- | :--- |\r\n| Functional Requirement | `FR-NEW-001` | `product/requirements/` | Automated cryptographic signature verification for incoming telemetry |\r\n| Use Case | `UC-NEW-001` | `product/use-cases/` | End-to-end telemetry subscription and streaming workflow |\r\n| Actor / Persona | `ACT-NEW-001` | `product/actors/` | External third-party auditor agent role |\r\n| Architecture Decision / Component | `ADR-005` / `CMP-NEW-001` | `architecture/` | Token bucket sliding-window rate limiting engine |\r\n| Security Requirement | `SEC-REQ-NEW-001` | `security/requirements/` | Enforce mutual TLS (mTLS) with client certificate validation |\r\n\r\n---\r\n\r\n## 2. Requirement Deltas and Formal Contracts\r\n\r\nFor each affected or new catalog item declared above, define the concrete functional delta:\r\n\r\n### [FR-NAME-001 / FR-NEW-001]: [Requirement Title]\r\n* **Operation:** `[ADDED | MODIFIED | DEPRECATED]`\r\n* **Primary Actor(s):** `ACT-ACTOR-001`\r\n* **Associated Use Case(s):** `UC-ACTION-001`\r\n* **Architectural Scope:** `CMP-NAME-001` (Security Enclave: `SEC-ENC-DMZ`)\r\n* **Behavioral Contract (Delta Specification):**\r\n * **Baseline (Before):** Describes previous behavior or states "None (New requirement)".\r\n * **Target Delta (After):** Explicit behavioral specification of the new or altered behavior.\r\n\r\n---\r\n\r\n## 3. Functional Behavior Scenarios (BDD Gherkin)\r\n\r\n```gherkin\r\n@CHG-NAME-001 @FR-NAME-001 @UC-ACTION-001 @functional @automated\r\nFeature: Delivery Specification CHG-NAME-001\r\n As a [primary actor / system role: ACT-ACTOR-001]\r\n I want [functional capability delivered by this change: FR-NAME-001]\r\n So that [expected business value or outcome]\r\n\r\n Background:\r\n Given the system is in a nominal operational state\r\n And dependent services are available\r\n\r\n Scenario: Nominal successful flow\r\n Given the client has established an authenticated session for "ACT-ACTOR-001"\r\n When valid payload is submitted according to specification\r\n Then the server responds with status 200 OK and persists state\r\n\r\n Scenario Outline: Parameter and edge case validation\r\n Given an input with parameter "<param>"\r\n When the request is processed\r\n Then the system returns status "<status>"\r\n\r\n Examples:\r\n | param | status |\r\n | nominal | 200 |\r\n | invalid | 400 |\r\n```\r\n\r\n---\r\n\r\n## 4. Cybersecurity and Mitigation Scenarios (Abuse Scenarios)\r\n\r\n```gherkin\r\n@CHG-NAME-001 @security @mitigation @SEC-REQ-CONTROL-001\r\nFeature: Threat Mitigation and Abuse Scenarios\r\n Scenario: Unauthorized access or unauthenticated payload attempt\r\n Given a malicious actor attempts to send data without valid credentials\r\n When connection attempts to reach protected enclaves "SEC-ENC-DMZ"\r\n Then handshake is aborted immediately and security alert SEC-TEST-001 is emitted\r\n```\r\n';
14774
+ var STARTER_TEMPLATES_SDD_SPEC_TEMPLATE_MD = '---\r\nid: SPEC-CHG-NAME-001\r\ntype: delivery-spec\r\nchange-id: CHG-NAME-001\r\nprofile: standard # standard, patch, critical\r\nhandoff: HOF-CHG-NAME-001\r\nacceptance-format: gherkin\r\ncucumber-tags:\r\n - "@CHG-NAME-001"\r\n - "@automated"\r\ncitations:\r\n - id: "UC-ACTION-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Canonical use case driving or impacted by this increment."\r\n - id: "FR-NAME-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Formal functional requirement in canonical catalog."\r\n - id: "ACT-ACTOR-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Primary actor participating in the capability."\r\n - id: "CMP-NAME-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Architectural component implementing the specification."\r\n - id: "SEC-REQ-CONTROL-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Mandatory security requirement to implement."\r\n - id: "PRIV-REQ-MASKING-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Mandatory privacy control for PII pseudonymization and data minimization."\r\n---\r\n\r\n# Delivery Specification: CHG-NAME-001\r\n\r\n## 1. Catalog Scope and Traceability (Canonical Alignment)\r\n\r\n> **MANDATORY SPECIFICATION RULE (ZERO AMBIGUITY / 360\xB0 TRACEABILITY):** \r\n> Every delivery increment (`spec.md`) MUST explicitly declare the exact boundaries of its impact across the canonical catalog (`product/`, `security/`, `privacy/`, and `architecture/`). \r\n> An increment cannot author code or tests for unmapped behaviors. It must explicitly declare:\r\n> - **Affected Existing Catalog Items:** Existing functional requirements (`FR-*`), use cases (`UC-*`), actors (`ACT-*`), business rules (`BR-*`), security requirements (`SEC-REQ-*`), privacy requirements (`PRIV-REQ-*`), data assets (`DATA-ASSET-*`), ROPA entries (`PRIV-ROPA-*`), or architecture components/ADRs (`CMP-*`, `ADR-*`, `SRV-*`) whose behavior, contracts, or constraints are modified or deprecated.\r\n> - **New Catalog Items Introduced:** Any new functional requirements, use cases, actors, architecture decisions, security rules, or privacy controls created by this increment, identifying their proposed IDs and target catalog destination.\r\n\r\n### 1.1 Affected Existing Catalog Items (Modifications / Deprecations)\r\n\r\n| Catalog Category | Catalog ID | Action (`MODIFIED` / `DEPRECATED`) | Description of Delta & Behavioral Impact |\r\n| :--- | :--- | :--- | :--- |\r\n| Functional Requirement | `FR-EXISTING-001` | `MODIFIED` | Extends validation rules to support batch payload ingestion |\r\n| Use Case | `UC-EXISTING-001` | `MODIFIED` | Adds alternative execution path for handling throttling limits |\r\n| Actor / Persona | `ACT-EXISTING-001` | `MODIFIED` | Expands authorization scope to access batch processing endpoints |\r\n| Architecture / Component | `CMP-CORE-001` | `MODIFIED` | Ingestion pipeline updated to support non-blocking asynchronous dispatch |\r\n| Privacy Requirement | `PRIV-REQ-EXISTING-001` | `MODIFIED` | Restricts telemetry retention period from 730d to 365d |\r\n\r\n### 1.2 New Catalog Items Introduced (Additions)\r\n\r\n| Catalog Category | Proposed ID | Target Catalog Location | Formal Scope & Functional Contract |\r\n| :--- | :--- | :--- | :--- |\r\n| Functional Requirement | `FR-NEW-001` | `product/requirements/` | Automated cryptographic signature verification for incoming telemetry |\r\n| Use Case | `UC-NEW-001` | `product/use-cases/` | End-to-end telemetry subscription and streaming workflow |\r\n| Actor / Persona | `ACT-NEW-001` | `product/actors/` | External third-party auditor agent role |\r\n| Architecture Decision / Component | `ADR-005` / `CMP-NEW-001` | `architecture/` | Token bucket sliding-window rate limiting engine |\r\n| Security Requirement | `SEC-REQ-NEW-001` | `security/requirements/` | Enforce mutual TLS (mTLS) with client certificate validation |\r\n| Privacy Requirement | `PRIV-REQ-NEW-001` | `privacy/requirements/` | Mandatory pseudonymization of pilot operator personal identifiers |\r\n| Personal Data Asset | `DATA-ASSET-NEW-001` | `privacy/assets/` | Inventory record for operator session tokens and geolocation |\r\n\r\n---\r\n\r\n## 2. Requirement Deltas and Formal Contracts\r\n\r\nFor each affected or new catalog item declared above, define the concrete functional delta:\r\n\r\n### [FR-NAME-001 / FR-NEW-001]: [Requirement Title]\r\n* **Operation:** `[ADDED | MODIFIED | DEPRECATED]`\r\n* **Primary Actor(s):** `ACT-ACTOR-001`\r\n* **Associated Use Case(s):** `UC-ACTION-001`\r\n* **Architectural Scope:** `CMP-NAME-001` (Security Enclave: `SEC-ENC-DMZ`)\r\n* **Behavioral Contract (Delta Specification):**\r\n * **Baseline (Before):** Describes previous behavior or states "None (New requirement)".\r\n * **Target Delta (After):** Explicit behavioral specification of the new or altered behavior.\r\n\r\n---\r\n\r\n## 3. Functional Behavior Scenarios (BDD Gherkin)\r\n\r\n```gherkin\r\n@CHG-NAME-001 @FR-NAME-001 @UC-ACTION-001 @functional @automated\r\nFeature: Delivery Specification CHG-NAME-001\r\n As a [primary actor / system role: ACT-ACTOR-001]\r\n I want [functional capability delivered by this change: FR-NAME-001]\r\n So that [expected business value or outcome]\r\n\r\n Background:\r\n Given the system is in a nominal operational state\r\n And dependent services are available\r\n\r\n Scenario: Nominal successful flow\r\n Given the client has established an authenticated session for "ACT-ACTOR-001"\r\n When valid payload is submitted according to specification\r\n Then the server responds with status 200 OK and persists state\r\n\r\n Scenario Outline: Parameter and edge case validation\r\n Given an input with parameter "<param>"\r\n When the request is processed\r\n Then the system returns status "<status>"\r\n\r\n Examples:\r\n | param | status |\r\n | nominal | 200 |\r\n | invalid | 400 |\r\n```\r\n\r\n---\r\n\r\n## 4. Cybersecurity and Mitigation Scenarios (Abuse Scenarios)\r\n\r\n```gherkin\r\n@CHG-NAME-001 @security @mitigation @SEC-REQ-CONTROL-001\r\nFeature: Threat Mitigation and Abuse Scenarios\r\n Scenario: Unauthorized access or unauthenticated payload attempt\r\n Given a malicious actor attempts to send data without valid credentials\r\n When connection attempts to reach protected enclaves "SEC-ENC-DMZ"\r\n Then handshake is aborted immediately and security alert SEC-TEST-001 is emitted\r\n```\r\n\r\n---\r\n\r\n## 5. Data Protection and Privacy Scenarios (Privacy Acceptance)\r\n\r\n```gherkin\r\n@CHG-NAME-001 @privacy @PRIV-REQ-NEW-001\r\nFeature: Privacy and Data Protection Controls\r\n Scenario: Verification of PII pseudonymization and zero-leakage telemetry\r\n Given payload containing personal data classification "confidential-pii"\r\n When event is serialized and dispatched to telemetry collector\r\n Then sensitive personal identifiers are redacted or salted-hashed\r\n And data retention TTL is enforced\r\n```\r\n\r\n';
14131
14775
  var STARTER_TEMPLATES_SDD_TASKS_TEMPLATE_MD = '---\r\nid: TSK-PLAN-CHG-001\r\ntype: task-plan\r\nchange-id: CHG-001-FEATURE-NAME\r\ntitle: Verifiable Tasks Breakdown and Autonomy Governance\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nstatus: draft\r\ngovernance-summary:\r\n autonomous-tasks-count: 2\r\n human-review-plan-count: 1\r\n ambiguous-count: 0\r\n high-risk-manual-count: 0\r\ntasks:\r\n - id: "TSK-001"\r\n title: "Contract DTOs and Interfaces Definition"\r\n complexity: "LOW"\r\n risk-level: "LOW"\r\n autonomy-mode: "AUTONOMOUS"\r\n implements-components:\r\n - "CMP-NAME-001"\r\n satisfies-requirements:\r\n - "FR-001"\r\n verification:\r\n method: "quality-gate"\r\n command-or-criteria: "npx tsc --noEmit && node packages/cli/bin/aisdlc.js verify quality"\r\n assigned-to: "agent-developer"\r\n status: "PENDING"\r\n\r\n - id: "TSK-002"\r\n title: "Core Business Logic and Algorithm Implementation"\r\n complexity: "MEDIUM"\r\n risk-level: "MEDIUM"\r\n autonomy-mode: "HUMAN_REVIEW_PLAN"\r\n implements-components:\r\n - "CMP-NAME-001"\r\n satisfies-requirements:\r\n - "FR-001"\r\n verification:\r\n method: "automated-unit-test"\r\n command-or-criteria: "npm test -- tests/unit/feature_core.spec.ts"\r\n assigned-to: "agent-developer"\r\n status: "PENDING"\r\n\r\n - id: "TSK-003"\r\n title: "Database Schema Migration / Critical Credentials"\r\n complexity: "HIGH"\r\n risk-level: "CRITICAL"\r\n autonomy-mode: "HIGH_RISK_MANUAL"\r\n verification:\r\n method: "manual-inspection"\r\n command-or-criteria: "DBA review + manual execution with verified idempotent script"\r\n assigned-to: "human-engineer"\r\n status: "PENDING"\r\n\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# Verifiable Tasks Breakdown: CHG-001-FEATURE-NAME\r\n\r\n## 1. Autonomy Classification and Human Supervision Matrix\r\n\r\nEach task is rigorously classified according to its complexity and risk level to determine the level of delegation to AI agents:\r\n\r\n| Autonomy Mode | Traffic Light | Activation Criterion | Agent and Human Behavior |\r\n| :--- | :---: | :--- | :--- |\r\n| **`AUTONOMOUS`** | \u{1F7E2} | Low risk, isolated and well-specified task with immediate tests. | **Autonomous Plan + Execution**. Agent creates plan and writes code without interruption. Human validates final PR. |\r\n| **`HUMAN_REVIEW_PLAN`** | \u{1F7E1} | Medium risk, architectural changes, API contracts, or critical business rules. | **Mandatory Plan Review**. Agent designs detailed plan, but halts. **Human must approve plan before coding.** |\r\n| **`AMBIGUOUS`** | \u{1F7E0} | Vague requirements, incomplete criteria, or conflicting business logic. | **Blocked for Implementation**. Agent is forbidden to guess. Requires prior interview and refinement with user. |\r\n| **`HIGH_RISK_MANUAL`** | \u{1F534} | Critical risk (destructive DB migrations, cryptographic keys, production infra). | **Autonomous Execution Forbidden**. Direct human execution or assisted mode with command-by-command confirmation. |\r\n\r\n---\r\n\r\n## 2. Detailed Task Plan and Verification Criteria\r\n\r\n### Phase 1: Types and Contracts (TSK-001)\r\n- **ID**: `TSK-001`\r\n- **Description**: Create interfaces and data structures stipulated in `design.md`.\r\n- **Mode**: `AUTONOMOUS` \u{1F7E2}\r\n- **Verification**: `npx tsc --noEmit && node packages/cli/bin/aisdlc.js verify quality`\r\n\r\n### Phase 2: Implementation and BDD Tests (TSK-002)\r\n- **ID**: `TSK-002`\r\n- **Description**: Implement business logic and pass Cucumber scenarios.\r\n- **Mode**: `HUMAN_REVIEW_PLAN` \u{1F7E1}\r\n- **Verification**: `npx cucumber-js tests/features/feature.feature`\r\n\r\n### Phase 3: Critical Operations / Deployment (TSK-003)\r\n- **ID**: `TSK-003`\r\n- **Description**: Apply migrations or perimeter enclave configurations.\r\n- **Mode**: `HIGH_RISK_MANUAL` \u{1F534}\r\n- **Verification**: Manual approval checklists and smoke tests (`smoke-test`).\r\n\r\n---\r\n\r\n## 3. 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-03 | Lead Engineer | Plan creation with risk classification and 360\xB0 verification | CHG-INIT-001 |\r\n';
14132
14776
  var STARTER_TEMPLATES_SECURITY_ABUSE_CASE_TEMPLATE_MD = '---\r\nid: ABUSE-NAME-001\r\ntype: abuse-case\r\ntitle: Attack or Abuse Scenario Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nprimary-threat-actor: ACT-THREAT-NAME-001\r\ntargets-use-case: UC-ACTION-001\r\nstride-category: spoofing # spoofing, tampering, repudiation, information-disclosure, denial-of-service, elevation-of-privilege\r\nmitigated-by:\r\n - SEC-REQ-CONTROL-001\r\nasvs-controls:\r\n - "V2.1.1" # Reference to OWASP Application Security Verification Standard\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# ABUSE-NAME-001: Attack or Abuse Scenario Title\r\n\r\n## 1. Attack Vector and Exploitation Mechanics\r\nDescribes step-by-step how the malicious actor attempts to force, bypass, or abuse the legitimate use case.\r\n\r\n## 2. Attack Preconditions\r\n- What access or prior knowledge the attacker requires (expired tokens, intercepted network, payload injection).\r\n\r\n## 3. Potential Impact\r\n- Personal data exposure, telemetry corruption, denial of service, or identity spoofing.\r\n\r\n---\r\n\r\n## 4. 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-03 | Security Officer / Threat Modeler | Initial abuse case threat modeling | CHG-SEC-001 |\r\n';
14133
14777
  var STARTER_TEMPLATES_SECURITY_ENCLAVE_TEMPLATE_MD = '---\r\nid: SEC-ENC-NAME-001\r\ntype: security-enclave\r\ntitle: Zero Trust Security Enclave Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\ntrust-zone: trusted # untrusted, semi-trusted, trusted, highly-trusted, dmz, zero-trust-boundary\r\nperimeter-rules:\r\n - "Mandatory mutual authentication via TLS 1.3 (mTLS)"\r\n - "Cryptographic token validation with maximum 5-minute expiry"\r\n - "Network isolation via firewall rules and restricted namespaces"\r\nallowed-inbound:\r\n - CMP-GATEWAY-001\r\nallowed-outbound:\r\n - CMP-DATABASE-001\r\nenforced-by:\r\n - SEC-REQ-AUTH-001\r\nauthentication-mechanism: mtls # mtls, jwt, api-key, oauth2, none\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# SEC-ENC-NAME-001: Zero Trust Security Enclave Title\r\n\r\n## 1. Enclave Definition and Purpose\r\nDescription of trust boundary, assets protected inside the enclave, and applied least-privilege principle.\r\n\r\n## 2. Trust Zone and Perimeter Rules\r\n\r\n| Parameter | Value | Security Justification |\r\n| :--- | :--- | :--- |\r\n| **Trust Zone** | `trusted` | Segment with access to sensitive data and critical logic services. |\r\n| **Authentication** | `mtls` | Mandatory asymmetric cryptography at all ingress points. |\r\n\r\n### Perimeter Rules\r\n1. **Inbound Flow Control**: Only explicitly authorized components may initiate connections.\r\n2. **Outbound Flow Control**: Outbound traffic restricted exclusively to dependencies required for operation.\r\n3. **Continuous Validation**: Every incoming request is cryptographically verified regardless of network origin.\r\n\r\n---\r\n\r\n## 3. Authorized Connectivity Matrix\r\n\r\n| Direction | Entity Identifier | Type | Protocol / Channel |\r\n| :--- | :--- | :--- | :--- |\r\n| **Inbound** | `CMP-GATEWAY-001` | Component | gRPC over mTLS (secure port) |\r\n| **Outbound** | `CMP-DATABASE-001` | Component | TCP encrypted with enclave credentials |\r\n\r\n---\r\n\r\n## 4. Linked Security Requirements\r\n\r\n- `SEC-REQ-AUTH-001`: Access control and perimeter encryption.\r\n\r\n---\r\n\r\n## 5. Revision History\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-23 | Security Architect | Initial Zero Trust security enclave creation | CHG-INIT-001 |\r\n';
@@ -14185,6 +14829,7 @@ var STARTER_BASE_TEMPLATES = [
14185
14829
  { relPath: "templates/privacy/privacy-req.template.md", content: STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD },
14186
14830
  { relPath: "templates/privacy/privacy-ropa.template.md", content: STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD },
14187
14831
  { relPath: "templates/product/actor.template.md", content: STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD },
14832
+ { relPath: "templates/product/bounded-context.template.md", content: STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD },
14188
14833
  { relPath: "templates/product/business-rule.template.md", content: STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD },
14189
14834
  { relPath: "templates/product/journey.template.md", content: STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD },
14190
14835
  { relPath: "templates/product/requirement.template.md", content: STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD },
@@ -14795,7 +15440,7 @@ permissions:
14795
15440
  pull-requests: read
14796
15441
 
14797
15442
  concurrency:
14798
- group: sdd-integrate-\${{ github.ref }}
15443
+ group: sdd-integrate-\${{ github.event.pull_request.base.ref || github.ref_name }}
14799
15444
  cancel-in-progress: false
14800
15445
 
14801
15446
  jobs:
@@ -14847,8 +15492,28 @@ jobs:
14847
15492
  git add -A
14848
15493
  if ! git diff --cached --quiet; then
14849
15494
  git commit -m "chore(sdd): integrate changes into canonical baseline [skip ci]"
14850
- git push
14851
- echo "\u2714 Canonical integration committed and synchronized in repository."
15495
+ TARGET_BRANCH="\${{ github.event.pull_request.base.ref || github.ref_name }}"
15496
+ MAX_RETRIES=3
15497
+ RETRY_COUNT=0
15498
+ DELAY=2
15499
+
15500
+ while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
15501
+ echo "Synchronizing with remote branch $TARGET_BRANCH (pull --rebase)..."
15502
+ git pull --rebase origin "$TARGET_BRANCH"
15503
+ if git push origin "$TARGET_BRANCH"; then
15504
+ echo "\u2714 Canonical integration committed and synchronized in repository."
15505
+ exit 0
15506
+ fi
15507
+ RETRY_COUNT=$((RETRY_COUNT + 1))
15508
+ if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
15509
+ echo "\u26A0 Push rejected (concurrency detected). Retrying in \${DELAY}s (attempt $RETRY_COUNT/$MAX_RETRIES)..."
15510
+ sleep $DELAY
15511
+ DELAY=$((DELAY * 2))
15512
+ fi
15513
+ done
15514
+
15515
+ echo "\u274C Error: Failed to push canonical integration after $MAX_RETRIES attempts."
15516
+ exit 1
14852
15517
  else
14853
15518
  echo "\u2139 No pending modifications generated in working tree."
14854
15519
  fi
@@ -15184,6 +15849,8 @@ exports.PII_SAST_RULES = PII_SAST_RULES;
15184
15849
  exports.PREPARE_COMMIT_MSG_SCRIPT = PREPARE_COMMIT_MSG_SCRIPT;
15185
15850
  exports.PROMPT_INJECTION_SIGNATURES = PROMPT_INJECTION_SIGNATURES;
15186
15851
  exports.PROTECTED_BYPASS_PATTERNS = PROTECTED_BYPASS_PATTERNS;
15852
+ exports.SARIF_SCHEMA_2_1_0 = SARIF_SCHEMA_2_1_0;
15853
+ exports.SARIF_VERSION = SARIF_VERSION;
15187
15854
  exports.SAST_RULES = SAST_RULES;
15188
15855
  exports.SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON = SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON;
15189
15856
  exports.SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON = SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON;
@@ -15199,6 +15866,7 @@ exports.SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON = SCHEMA_SCHEMAS_PRIVA
15199
15866
  exports.SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON = SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON;
15200
15867
  exports.SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON = SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON;
15201
15868
  exports.SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON = SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON;
15869
+ exports.SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON = SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON;
15202
15870
  exports.SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON = SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON;
15203
15871
  exports.SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON = SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON;
15204
15872
  exports.SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON = SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON;
@@ -15275,6 +15943,7 @@ exports.STARTER_TEMPLATES_PRIVACY_DPIA_REQUEST_TEMPLATE_MD = STARTER_TEMPLATES_P
15275
15943
  exports.STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD = STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD;
15276
15944
  exports.STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD = STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD;
15277
15945
  exports.STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD = STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD;
15946
+ exports.STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD = STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD;
15278
15947
  exports.STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD = STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD;
15279
15948
  exports.STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD = STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD;
15280
15949
  exports.STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD = STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD;
@@ -15309,6 +15978,7 @@ exports.aggregatePrKpis = aggregatePrKpis;
15309
15978
  exports.aggregateReleaseKpis = aggregateReleaseKpis;
15310
15979
  exports.analyzeBddVariantsForRequirement = analyzeBddVariantsForRequirement;
15311
15980
  exports.appendRevisionHistoryRow = appendRevisionHistoryRow;
15981
+ exports.applyRatchetMode = applyRatchetMode;
15312
15982
  exports.buildCycloneDxComponent = buildCycloneDxComponent;
15313
15983
  exports.buildFeatureFileContent = buildFeatureFileContent;
15314
15984
  exports.buildGraphElements = buildGraphElements;
@@ -15319,11 +15989,13 @@ exports.calculateShannonEntropy = calculateShannonEntropy;
15319
15989
  exports.checkGherkinInSync = checkGherkinInSync;
15320
15990
  exports.checkoutTaskBranch = checkoutTaskBranch;
15321
15991
  exports.classifyBranch = classifyBranch;
15992
+ exports.classifyMetricFromMessage = classifyMetricFromMessage;
15322
15993
  exports.collectAgentFiles = collectAgentFiles;
15323
15994
  exports.collectDashboardMetrics = collectDashboardMetrics;
15324
15995
  exports.collectHistoricalKpis = collectHistoricalKpis;
15325
15996
  exports.computeCanonicalSha256 = computeCanonicalSha256;
15326
15997
  exports.computeSha256 = computeSha256;
15998
+ exports.computeViolationSignature = computeViolationSignature;
15327
15999
  exports.createDefaultQualityPolicy = createDefaultQualityPolicy;
15328
16000
  exports.depositProductHandoffSidecar = depositProductHandoffSidecar;
15329
16001
  exports.detectActiveChangeForIntegration = detectActiveChangeForIntegration;
@@ -15334,6 +16006,8 @@ exports.detectPromptInjection = detectPromptInjection;
15334
16006
  exports.emitCiOutput = emitCiOutput;
15335
16007
  exports.evaluateCompoundLicense = evaluateCompoundLicense;
15336
16008
  exports.evaluateSingleDependency = evaluateSingleDependency;
16009
+ exports.evaluateVulnerabilityThresholds = evaluateVulnerabilityThresholds;
16010
+ exports.extractBaselineEntriesFromResults = extractBaselineEntriesFromResults;
15337
16011
  exports.extractCitations = extractCitations;
15338
16012
  exports.extractCommitKpisFromRange = extractCommitKpisFromRange;
15339
16013
  exports.extractDirectDepNames = extractDirectDepNames;
@@ -15364,6 +16038,8 @@ exports.generateQualityReport = generateQualityReport;
15364
16038
  exports.generateRopaInventoryMarkdown = generateRopaInventoryMarkdown;
15365
16039
  exports.generateSastReportMarkdown = generateSastReportMarkdown;
15366
16040
  exports.generateSecretsReportMarkdown = generateSecretsReportMarkdown;
16041
+ exports.generateSecuritySarifReport = generateSecuritySarifReport;
16042
+ exports.generateSuppressionsAuditReport = generateSuppressionsAuditReport;
15367
16043
  exports.generateTestingCoverageReportMarkdown = generateTestingCoverageReportMarkdown;
15368
16044
  exports.generateThirdPartyNotices = generateThirdPartyNotices;
15369
16045
  exports.generateTraceabilityReportMarkdown = generateTraceabilityReportMarkdown;
@@ -15379,6 +16055,7 @@ exports.injectKpisIntoPrBody = injectKpisIntoPrBody;
15379
16055
  exports.installGitHooks = installGitHooks;
15380
16056
  exports.integrateSddChange = integrateSddChange;
15381
16057
  exports.isGitleaksInstalled = isGitleaksInstalled;
16058
+ exports.isMetricWorsened = isMetricWorsened;
15382
16059
  exports.isPathProtectedFromPatch = isPathProtectedFromPatch;
15383
16060
  exports.isPlaceholderOrIgnored = isPlaceholderOrIgnored;
15384
16061
  exports.isRequirementArtifact = isRequirementArtifact2;
@@ -15386,9 +16063,12 @@ exports.isSemgrepInstalled = isSemgrepInstalled;
15386
16063
  exports.isToolAvailable = isToolAvailable;
15387
16064
  exports.loadPrivacyPolicy = loadPrivacyPolicy;
15388
16065
  exports.loadProductHandoffSidecar = loadProductHandoffSidecar;
16066
+ exports.loadQualityBaseline = loadQualityBaseline;
15389
16067
  exports.locateTaskInActiveChanges = locateTaskInActiveChanges;
16068
+ exports.mapSastSeverityToSarifLevel = mapSastSeverityToSarifLevel;
15390
16069
  exports.maskSecret = maskSecret;
15391
16070
  exports.normalizeSpdxLicense = normalizeSpdxLicense;
16071
+ exports.normalizeUri = normalizeUri;
15392
16072
  exports.parseCommitTrailers = parseCommitTrailers;
15393
16073
  exports.parseFrontmatter = parseFrontmatter;
15394
16074
  exports.parseFrontmatterId = parseFrontmatterId;
@@ -15397,9 +16077,11 @@ exports.parseLicensePolicy = parseLicensePolicy;
15397
16077
  exports.parseMarkdownFrontmatter = parseMarkdownFrontmatter;
15398
16078
  exports.parseQualityPolicy = parseQualityPolicy;
15399
16079
  exports.parseRequirementFile = parseRequirementFile;
16080
+ exports.parseSecuritySuppression = parseSecuritySuppression;
15400
16081
  exports.parseSpecCatalogScope = parseSpecCatalogScope;
15401
16082
  exports.parseTasksDoc = parseTasksDoc;
15402
16083
  exports.parseTasksFromContent = parseTasksFromContent;
16084
+ exports.parseTrivyVulnerabilities = parseTrivyVulnerabilities;
15403
16085
  exports.processPackageDir = processPackageDir;
15404
16086
  exports.readCodeCoverageSummary = readCodeCoverageSummary;
15405
16087
  exports.readPackageJson = readPackageJson;
@@ -15418,6 +16100,8 @@ exports.resolveCytoscapePath = resolveCytoscapePath;
15418
16100
  exports.resolveFeatureFilePath = resolveFeatureFilePath;
15419
16101
  exports.resolveGitRef = resolveGitRef;
15420
16102
  exports.resolveLicenseFromFile = resolveLicenseFromFile;
16103
+ exports.resolveSastCwe = resolveSastCwe;
16104
+ exports.resolveSastOwasp = resolveSastOwasp;
15421
16105
  exports.resolveSchemaForArtifact = resolveSchemaForArtifact;
15422
16106
  exports.resolveTargetFiles = resolveTargetFiles;
15423
16107
  exports.runGitleaksCli = runGitleaksCli;
@@ -15435,6 +16119,7 @@ exports.scanSubdirectories = scanSubdirectories;
15435
16119
  exports.scanWithNativeFs = scanWithNativeFs;
15436
16120
  exports.scanWithSyft = scanWithSyft;
15437
16121
  exports.scanWithTrivy = scanWithTrivy;
16122
+ exports.serializeSarifDocument = serializeSarifDocument;
15438
16123
  exports.slugify = slugify;
15439
16124
  exports.syncPdacDigests = syncPdacDigests;
15440
16125
  exports.tokenizeTitle = tokenizeTitle;
@@ -15461,7 +16146,9 @@ exports.walkProjectFiles = walkProjectFiles;
15461
16146
  exports.walkSourceFiles = walkSourceFiles;
15462
16147
  exports.walkTaskFiles = walkTaskFiles;
15463
16148
  exports.writeCycloneDxSbom = writeCycloneDxSbom;
16149
+ exports.writeQualityBaseline = writeQualityBaseline;
15464
16150
  exports.writeReleaseKpiReport = writeReleaseKpiReport;
16151
+ exports.writeSecuritySarifReport = writeSecuritySarifReport;
15465
16152
  exports.writeThirdPartyNotices = writeThirdPartyNotices;
15466
16153
  //# sourceMappingURL=index.cjs.map
15467
16154
  //# sourceMappingURL=index.cjs.map