@aisdlc/core 2.0.2 → 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.js CHANGED
@@ -1,8 +1,8 @@
1
+ import * as crypto from 'crypto';
1
2
  import * as fs7 from 'fs';
2
3
  import * as path4 from 'path';
3
4
  import yaml3 from 'js-yaml';
4
5
  import { SyntaxKind, Project, Node } from 'ts-morph';
5
- import * as crypto from 'crypto';
6
6
  import * as child_process from 'child_process';
7
7
  import { execFileSync } from 'child_process';
8
8
  import { createRequire } from 'module';
@@ -167,7 +167,8 @@ function buildNodeMetrics(node, filePath) {
167
167
  const fullText = node.getFullText();
168
168
  const { loc, mi } = calculateLocAndHalstead(fullText, cyclomatic);
169
169
  const codeSmells = detectAstCodeSmells(node, fullText, filePath);
170
- return { functionName, filePath, loc, cyclomatic, cognitive, maintainability: mi, codeSmells };
170
+ const line = typeof node.getStartLineNumber === "function" ? node.getStartLineNumber() : 1;
171
+ return { functionName, filePath, loc, cyclomatic, cognitive, maintainability: mi, codeSmells, line };
171
172
  }
172
173
  function createTempSourceFile(project, content, filePath) {
173
174
  const ext = path4.extname(filePath).toLowerCase() || ".ts";
@@ -398,7 +399,7 @@ function buildMetricsFromBlocks(blocks, content, filePath) {
398
399
  }
399
400
  return [];
400
401
  }
401
- return blocks.map((b) => calculatePolyglotMetrics(b.body, b.name, filePath));
402
+ return blocks.map((b) => calculatePolyglotMetrics(b.body, b.name, filePath, b.startLine));
402
403
  }
403
404
  function detectPolyglotSmells(body) {
404
405
  const smells = [];
@@ -428,7 +429,7 @@ function countCommentsAndLoc(rawLines, isPy) {
428
429
  const cleanLines = rawLines.filter((l) => !isCommentLine(l, isPy));
429
430
  return { loc, commentCount, cleanLines };
430
431
  }
431
- function calculatePolyglotMetrics(body, name, filePath) {
432
+ function calculatePolyglotMetrics(body, name, filePath, startLine) {
432
433
  const ext = path4.extname(filePath).toLowerCase();
433
434
  const rawLines = body.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
434
435
  const { loc, commentCount, cleanLines } = countCommentsAndLoc(rawLines, ext === ".py");
@@ -442,7 +443,8 @@ function calculatePolyglotMetrics(body, name, filePath) {
442
443
  cyclomatic,
443
444
  cognitive,
444
445
  maintainability,
445
- codeSmells: detectPolyglotSmells(body)
446
+ codeSmells: detectPolyglotSmells(body),
447
+ line: startLine ? startLine + 1 : 1
446
448
  };
447
449
  }
448
450
  function computePolyglotCyclomatic(body, ext) {
@@ -1178,6 +1180,7 @@ function createDefaultQualityPolicy() {
1178
1180
  }
1179
1181
  function applyDocScope(policy, doc) {
1180
1182
  if (typeof doc.enforcement_mode === "string") policy.enforce_mode = doc.enforcement_mode;
1183
+ if (typeof doc.ratchet_mode === "boolean") policy.ratchet_mode = doc.ratchet_mode;
1181
1184
  if (!doc.scope || typeof doc.scope !== "object") return;
1182
1185
  const scope = doc.scope;
1183
1186
  if (Array.isArray(scope.target_directories)) {
@@ -1468,12 +1471,138 @@ function evaluateCoverageThresholds(rootDir, policy, requireReport) {
1468
1471
  checkCoverageThreshold("Function", cov.functionsPct, policy.min_function_coverage, violations);
1469
1472
  return violations;
1470
1473
  }
1471
- function buildQualityGateResult(results, totalFiles, policy, coverageViolations, untestedFunctions) {
1474
+ function computeViolationSignature(relPath, fnName, metric) {
1475
+ const normPath = relPath.replace(/\\/g, "/");
1476
+ return crypto.createHash("sha256").update(normPath + ":" + fnName + ":" + metric).digest("hex");
1477
+ }
1478
+ function classifyMetricFromMessage(msg, fn) {
1479
+ if (msg.startsWith("Cyclomatic Complexity")) {
1480
+ return { metric: "cyclomatic", value: fn?.cyclomatic, threshold: 10 };
1481
+ }
1482
+ if (msg.startsWith("Cognitive Complexity")) {
1483
+ return { metric: "cognitive", value: fn?.cognitive, threshold: 15 };
1484
+ }
1485
+ if (msg.startsWith("Maintainability Index")) {
1486
+ return { metric: "maintainability", value: fn?.maintainability, threshold: 50 };
1487
+ }
1488
+ if (msg.startsWith("Function lines")) {
1489
+ return { metric: "loc", value: fn?.loc, threshold: 40 };
1490
+ }
1491
+ if (msg.includes("Missing unit test")) {
1492
+ return { metric: "unit-test" };
1493
+ }
1494
+ return { metric: "codeSmell" };
1495
+ }
1496
+ function isMetricWorsened(baselineEntry, current) {
1497
+ if (baselineEntry.value === void 0 || current.value === void 0) return false;
1498
+ if (baselineEntry.metric === "maintainability") {
1499
+ return current.value < baselineEntry.value;
1500
+ }
1501
+ return current.value > baselineEntry.value;
1502
+ }
1503
+ function loadQualityBaseline(baselineFile) {
1504
+ try {
1505
+ if (!fs7.existsSync(baselineFile)) return null;
1506
+ const content = fs7.readFileSync(baselineFile, "utf-8");
1507
+ return JSON.parse(content);
1508
+ } catch {
1509
+ return null;
1510
+ }
1511
+ }
1512
+ function writeQualityBaseline(baselineFile, entries) {
1513
+ const baseline = {
1514
+ version: "1.0",
1515
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
1516
+ totalViolations: entries.length,
1517
+ violations: entries
1518
+ };
1519
+ fs7.writeFileSync(baselineFile, JSON.stringify(baseline, null, 2) + "\n", "utf-8");
1520
+ return baseline;
1521
+ }
1522
+ function extractBaselineEntriesFromResults(results) {
1523
+ const entries = [];
1524
+ for (const r of results) {
1525
+ for (const v of r.violations) {
1526
+ const { metric, value, threshold } = classifyMetricFromMessage(v, r);
1527
+ const signature = computeViolationSignature(r.relPath, r.functionName, metric);
1528
+ entries.push({
1529
+ signature,
1530
+ file: r.relPath,
1531
+ functionName: r.functionName,
1532
+ line: r.line || 1,
1533
+ metric,
1534
+ value,
1535
+ threshold,
1536
+ message: v
1537
+ });
1538
+ }
1539
+ }
1540
+ return entries;
1541
+ }
1542
+ function applyRatchetToFunctionResult(r, baselineMap) {
1543
+ const activeViolations = [];
1544
+ const tolerated = [];
1545
+ for (const v of r.violations) {
1546
+ const classified = classifyMetricFromMessage(v, r);
1547
+ const sig = computeViolationSignature(r.relPath, r.functionName, classified.metric);
1548
+ const baseEntry = baselineMap.get(sig);
1549
+ if (baseEntry && !isMetricWorsened(baseEntry, classified)) {
1550
+ tolerated.push(v);
1551
+ } else {
1552
+ activeViolations.push(v);
1553
+ }
1554
+ }
1555
+ r.violations = activeViolations;
1556
+ r.toleratedViolations = tolerated;
1557
+ r.status = activeViolations.length === 0 ? "PASS" : "FAIL";
1558
+ return { tolerated: tolerated.length, newViolations: activeViolations.length };
1559
+ }
1560
+ function applyRatchetMode(results, baseline) {
1561
+ const baselineMap = /* @__PURE__ */ new Map();
1562
+ for (const entry of baseline.violations) {
1563
+ baselineMap.set(entry.signature, entry);
1564
+ }
1565
+ let toleratedCount = 0;
1566
+ let newViolationsCount = 0;
1567
+ for (const r of results) {
1568
+ if (r.violations.length === 0) continue;
1569
+ const res = applyRatchetToFunctionResult(r, baselineMap);
1570
+ toleratedCount += res.tolerated;
1571
+ newViolationsCount += res.newViolations;
1572
+ }
1573
+ return { toleratedCount, newViolationsCount };
1574
+ }
1575
+ function resolveBaselineFilePath(rootDir, options) {
1576
+ if (options.baselinePath) return options.baselinePath;
1577
+ if (typeof options.baseline === "string") return options.baseline;
1578
+ return path4.join(rootDir, "quality-baseline.json");
1579
+ }
1580
+ function isRatchetModeActive(policy, options, baselineExists) {
1581
+ if (options.ratchet !== void 0) return options.ratchet;
1582
+ if (options.baseline === false) return false;
1583
+ return Boolean(policy.ratchet_mode || options.baseline && baselineExists);
1584
+ }
1585
+ function evaluateRatchetIfActive(results, baselineFile, isActive) {
1586
+ if (!isActive || !fs7.existsSync(baselineFile)) {
1587
+ return { toleratedViolationsCount: 0, newViolationsCount: 0, baselineViolationsCount: 0 };
1588
+ }
1589
+ const baseline = loadQualityBaseline(baselineFile);
1590
+ if (!baseline) {
1591
+ return { toleratedViolationsCount: 0, newViolationsCount: 0, baselineViolationsCount: 0 };
1592
+ }
1593
+ const counts = applyRatchetMode(results, baseline);
1594
+ return {
1595
+ toleratedViolationsCount: counts.toleratedCount,
1596
+ newViolationsCount: counts.newViolationsCount,
1597
+ baselineViolationsCount: baseline.totalViolations
1598
+ };
1599
+ }
1600
+ function buildQualityGateResult(results, totalFiles, policy, coverageViolations, untestedFunctions, baselineMeta) {
1472
1601
  const failCount = results.filter((r) => r.status === "FAIL").length;
1473
1602
  const passCount = results.length - failCount;
1474
1603
  const violationsCount = results.reduce((acc, r) => acc + r.violations.length, 0) + coverageViolations.length;
1475
1604
  const hasFailures = failCount > 0 || coverageViolations.length > 0;
1476
- const success = policy.enforce_mode === "STRICT" ? !hasFailures : true;
1605
+ const success = baselineMeta?.baselineUpdated ? true : policy.enforce_mode === "STRICT" ? !hasFailures : true;
1477
1606
  return {
1478
1607
  success,
1479
1608
  totalFiles,
@@ -1484,7 +1613,11 @@ function buildQualityGateResult(results, totalFiles, policy, coverageViolations,
1484
1613
  results,
1485
1614
  policy,
1486
1615
  coverageViolations,
1487
- untestedFunctions
1616
+ untestedFunctions,
1617
+ baselineUpdated: baselineMeta?.baselineUpdated,
1618
+ baselineViolationsCount: baselineMeta?.baselineViolationsCount,
1619
+ toleratedViolationsCount: baselineMeta?.toleratedViolationsCount,
1620
+ newViolationsCount: baselineMeta?.newViolationsCount
1488
1621
  };
1489
1622
  }
1490
1623
  function verifyQualityGate(options = {}) {
@@ -1500,7 +1633,23 @@ function verifyQualityGate(options = {}) {
1500
1633
  }
1501
1634
  const untestedFunctions = options.requireFunctionUnitTests ? auditUnitTestsPerFunction(results, rootDir) : [];
1502
1635
  const coverageViolations = evaluateCoverageThresholds(rootDir, policy, options.requireCoverageReport);
1503
- return buildQualityGateResult(results, allFiles.length, policy, coverageViolations, untestedFunctions);
1636
+ const baselineFile = resolveBaselineFilePath(rootDir, options);
1637
+ if (options.updateBaseline) {
1638
+ const entries = extractBaselineEntriesFromResults(results);
1639
+ writeQualityBaseline(baselineFile, entries);
1640
+ return buildQualityGateResult(results, allFiles.length, policy, coverageViolations, untestedFunctions, {
1641
+ baselineUpdated: true,
1642
+ baselineViolationsCount: entries.length
1643
+ });
1644
+ }
1645
+ const baselineExists = fs7.existsSync(baselineFile);
1646
+ const isRatchet = isRatchetModeActive(policy, options, baselineExists);
1647
+ const ratchetEval = evaluateRatchetIfActive(results, baselineFile, isRatchet);
1648
+ return buildQualityGateResult(results, allFiles.length, policy, coverageViolations, untestedFunctions, {
1649
+ baselineViolationsCount: ratchetEval.baselineViolationsCount,
1650
+ toleratedViolationsCount: ratchetEval.toleratedViolationsCount,
1651
+ newViolationsCount: ratchetEval.newViolationsCount
1652
+ });
1504
1653
  }
1505
1654
  function normalizeHandoffPayload(handoff, changeId) {
1506
1655
  return {
@@ -2822,7 +2971,7 @@ var SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON = '{\r\n "$schema": "http
2822
2971
  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';
2823
2972
  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';
2824
2973
  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';
2825
- 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';
2974
+ 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';
2826
2975
  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';
2827
2976
  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';
2828
2977
  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';
@@ -2831,6 +2980,7 @@ var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON = '{\r\n "$schema": "http
2831
2980
  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';
2832
2981
  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';
2833
2982
  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';
2983
+ 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';
2834
2984
  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';
2835
2985
  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';
2836
2986
  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';
@@ -2965,6 +3115,7 @@ var STARTER_SCHEMAS_MAP = {
2965
3115
  "schemas/privacy/privacy-req.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON),
2966
3116
  "schemas/privacy/privacy-ropa.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON),
2967
3117
  "schemas/product/actor.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON),
3118
+ "schemas/product/bounded-context.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON),
2968
3119
  "schemas/product/business-rule.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON),
2969
3120
  "schemas/product/journey.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON),
2970
3121
  "schemas/product/requirement.schema.json": JSON.parse(SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON),
@@ -2999,6 +3150,7 @@ var TYPE_TO_SCHEMA_MAP = {
2999
3150
  journey: "schemas/product/journey.schema.json",
3000
3151
  requirement: "schemas/product/requirement.schema.json",
3001
3152
  term: "schemas/product/term.schema.json",
3153
+ "bounded-context": "schemas/product/bounded-context.schema.json",
3002
3154
  "use-case": "schemas/product/use-case.schema.json",
3003
3155
  // Security
3004
3156
  "abuse-case": "schemas/security/abuse-case.schema.json",
@@ -3049,6 +3201,7 @@ var PREFIX_TAXONOMY = [
3049
3201
  ["CON-", "requirement"],
3050
3202
  ["JRN-", "journey"],
3051
3203
  ["TERM-", "term"],
3204
+ ["BC-", "bounded-context"],
3052
3205
  ["ABUSE-", "abuse-case"],
3053
3206
  ["SEC-ENC-", "security-enclave"],
3054
3207
  ["SEC-REQ-", "security-requirement"],
@@ -5520,6 +5673,82 @@ function scanWithNativeFs(rootDir, options = {}) {
5520
5673
  }
5521
5674
  return allDeps.sort((a, b) => a.name.localeCompare(b.name));
5522
5675
  }
5676
+ function extractCvssV3Score(cvss) {
5677
+ if (!cvss || typeof cvss !== "object") return void 0;
5678
+ const dict = cvss;
5679
+ for (const source of ["nvd", "ghsa", "redhat"]) {
5680
+ if (dict[source]?.V3Score !== void 0) {
5681
+ return Number(dict[source].V3Score);
5682
+ }
5683
+ }
5684
+ return void 0;
5685
+ }
5686
+ function extractCvssV3Vector(cvss) {
5687
+ if (!cvss || typeof cvss !== "object") return void 0;
5688
+ const dict = cvss;
5689
+ for (const source of ["nvd", "ghsa", "redhat"]) {
5690
+ if (dict[source]?.V3Vector) {
5691
+ return String(dict[source].V3Vector);
5692
+ }
5693
+ }
5694
+ return void 0;
5695
+ }
5696
+ function normalizeVulnerabilitySeverity(raw) {
5697
+ if (!raw) return "UNKNOWN";
5698
+ const upper = raw.toUpperCase().trim();
5699
+ if (upper === "CRITICAL" || upper === "HIGH" || upper === "MEDIUM" || upper === "LOW") {
5700
+ return upper;
5701
+ }
5702
+ return "UNKNOWN";
5703
+ }
5704
+ function parseSingleVulnerability(v) {
5705
+ return {
5706
+ id: v.VulnerabilityID || "UNKNOWN",
5707
+ packageName: v.PkgName || "UNKNOWN",
5708
+ installedVersion: v.InstalledVersion || "unknown",
5709
+ fixedVersion: v.FixedVersion || void 0,
5710
+ severity: normalizeVulnerabilitySeverity(v.Severity),
5711
+ cvssV3Score: extractCvssV3Score(v.CVSS),
5712
+ cvssV3Vector: extractCvssV3Vector(v.CVSS),
5713
+ title: v.Title || void 0,
5714
+ description: v.Description || void 0,
5715
+ primaryUrl: v.PrimaryURL || void 0
5716
+ };
5717
+ }
5718
+ function parseTrivyVulnerabilities(stdout) {
5719
+ try {
5720
+ const data = JSON.parse(stdout);
5721
+ const vulns = [];
5722
+ for (const r of data.Results || []) {
5723
+ for (const v of r.Vulnerabilities || []) {
5724
+ vulns.push(parseSingleVulnerability(v));
5725
+ }
5726
+ }
5727
+ return vulns;
5728
+ } catch {
5729
+ return [];
5730
+ }
5731
+ }
5732
+ var SEVERITY_RANK = {
5733
+ CRITICAL: 4,
5734
+ HIGH: 3,
5735
+ MEDIUM: 2,
5736
+ LOW: 1,
5737
+ UNKNOWN: 0
5738
+ };
5739
+ function evaluateVulnerabilityThresholds(vulnerabilities, options) {
5740
+ const minRank = options?.failOnSeverity ? SEVERITY_RANK[options.failOnSeverity] ?? 3 : void 0;
5741
+ const maxScore = options?.maxCvssScore;
5742
+ const failing = vulnerabilities.filter((v) => {
5743
+ const rankMatch = minRank !== void 0 && SEVERITY_RANK[v.severity] >= minRank;
5744
+ const scoreMatch = maxScore !== void 0 && v.cvssV3Score !== void 0 && v.cvssV3Score >= maxScore;
5745
+ return rankMatch || scoreMatch;
5746
+ });
5747
+ return {
5748
+ blocked: failing.length > 0,
5749
+ failingVulnerabilities: failing
5750
+ };
5751
+ }
5523
5752
  function parseTrivyOutput(stdout) {
5524
5753
  const data = JSON.parse(stdout);
5525
5754
  const deps = [];
@@ -5535,24 +5764,33 @@ function parseTrivyOutput(stdout) {
5535
5764
  }
5536
5765
  return deps;
5537
5766
  }
5538
- function scanWithTrivy(rootDir) {
5539
- if (!isToolAvailable("trivy")) {
5540
- return { dependencies: [], executed: false };
5541
- }
5767
+ function execTrivyCli(rootDir, checkTypes) {
5542
5768
  try {
5543
5769
  const res = child_process.spawnSync(
5544
5770
  "trivy",
5545
- ["fs", "--format", "json", "--security-checks", "license", rootDir],
5771
+ ["fs", "--format", "json", "--security-checks", checkTypes, rootDir],
5546
5772
  { encoding: "utf-8", timeout: 3e4 }
5547
5773
  );
5548
- if (res.status !== 0 || !res.stdout) {
5549
- return { dependencies: [], executed: false };
5550
- }
5551
- return { dependencies: parseTrivyOutput(res.stdout), executed: true };
5774
+ return res.status === 0 && res.stdout ? res.stdout : null;
5552
5775
  } catch {
5553
- return { dependencies: [], executed: false };
5776
+ return null;
5554
5777
  }
5555
5778
  }
5779
+ function scanWithTrivy(rootDir, options) {
5780
+ if (!isToolAvailable("trivy")) {
5781
+ return { dependencies: [], vulnerabilities: [], executed: false };
5782
+ }
5783
+ const checkTypes = options?.scanVulnerabilities !== false ? "vuln,license" : "license";
5784
+ const stdout = execTrivyCli(rootDir, checkTypes);
5785
+ if (!stdout) {
5786
+ return { dependencies: [], vulnerabilities: [], executed: false };
5787
+ }
5788
+ return {
5789
+ dependencies: parseTrivyOutput(stdout),
5790
+ vulnerabilities: parseTrivyVulnerabilities(stdout),
5791
+ executed: true
5792
+ };
5793
+ }
5556
5794
  function parseSyftOutput(stdout) {
5557
5795
  const data = JSON.parse(stdout);
5558
5796
  const deps = [];
@@ -6067,12 +6305,34 @@ function evaluateDependencyList(dependencies, policy) {
6067
6305
  }
6068
6306
  return { violations, permittedCount };
6069
6307
  }
6070
- function assembleDynamicLicenseResult(dependencies, permittedCount, violations, reportMarkdown, artifacts) {
6308
+ function buildSkippedVulnResult() {
6071
6309
  return {
6072
- success: violations.length === 0,
6310
+ vulnerabilities: [],
6311
+ blocked: false,
6312
+ skipped: true,
6313
+ skipReason: "Trivy scanner is not installed on host environment. Vulnerability check gracefully skipped."
6314
+ };
6315
+ }
6316
+ function checkVulnerabilities(rootDir, options) {
6317
+ if (options.scanVulnerabilities === false) {
6318
+ return { vulnerabilities: [], blocked: false };
6319
+ }
6320
+ const res = scanWithTrivy(rootDir, { scanVulnerabilities: true });
6321
+ if (!res.executed) {
6322
+ return buildSkippedVulnResult();
6323
+ }
6324
+ const evalResult = evaluateVulnerabilityThresholds(res.vulnerabilities, options.vulnerabilityThresholds);
6325
+ return { vulnerabilities: res.vulnerabilities, blocked: evalResult.blocked };
6326
+ }
6327
+ function assembleDynamicLicenseResult(dependencies, permittedCount, violations, reportMarkdown, artifacts, vulnData) {
6328
+ return {
6329
+ success: violations.length === 0 && !vulnData.blocked,
6073
6330
  totalEvaluated: dependencies.length,
6074
6331
  permittedCount,
6075
6332
  violations,
6333
+ vulnerabilities: vulnData.vulnerabilities,
6334
+ vulnerabilitiesSkipped: vulnData.skipped,
6335
+ vulnerabilitiesSkipReason: vulnData.skipReason,
6076
6336
  reportMarkdown,
6077
6337
  sbomPath: artifacts.sbomPath,
6078
6338
  noticesPath: artifacts.noticesPath,
@@ -6106,8 +6366,9 @@ function verifyLicenses(options = {}) {
6106
6366
  const dependencies = scanDependenciesForVerification(options, rootDir, policyWithRaw.rawPolicy);
6107
6367
  const { violations, permittedCount } = evaluateDependencyList(dependencies, policy);
6108
6368
  const artifacts = handleDynamicScaArtifacts(options, rootDir, policyWithRaw.rawPolicy, dependencies);
6369
+ const vulnData = checkVulnerabilities(rootDir, options);
6109
6370
  const reportMarkdown = generateLicenseReportMarkdown(dependencies, violations, policy, artifacts.sbomPath);
6110
- return assembleDynamicLicenseResult(dependencies, permittedCount, violations, reportMarkdown, artifacts);
6371
+ return assembleDynamicLicenseResult(dependencies, permittedCount, violations, reportMarkdown, artifacts, vulnData);
6111
6372
  }
6112
6373
  var PROTECTED_BYPASS_PATTERNS = [
6113
6374
  /^schemas[\\/]/i,
@@ -6143,11 +6404,27 @@ function isPathProtectedFromPatch(filePath) {
6143
6404
  const normalized = filePath.replace(/\\/g, "/");
6144
6405
  return PROTECTED_BYPASS_PATTERNS.some((pattern) => pattern.test(normalized));
6145
6406
  }
6407
+ function detectBranchChangeMatch(rootDir, dirs) {
6408
+ if (!fs7.existsSync(path4.join(rootDir, ".git"))) return void 0;
6409
+ try {
6410
+ const branch = execFileSync("git", ["branch", "--show-current"], {
6411
+ cwd: rootDir,
6412
+ encoding: "utf-8",
6413
+ stdio: ["pipe", "pipe", "ignore"]
6414
+ }).trim().toLowerCase();
6415
+ if (!branch) return void 0;
6416
+ return dirs.find((d) => branch.includes(path4.basename(d).toLowerCase()));
6417
+ } catch {
6418
+ return void 0;
6419
+ }
6420
+ }
6146
6421
  function resolveActiveChangeDir(rootDir) {
6147
6422
  const activeRoot = path4.join(rootDir, "specs", "changes", "active");
6148
6423
  if (!fs7.existsSync(activeRoot)) return void 0;
6149
6424
  try {
6150
6425
  const dirs = fs7.readdirSync(activeRoot, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => path4.join(activeRoot, d.name));
6426
+ const branchMatch = detectBranchChangeMatch(rootDir, dirs);
6427
+ if (branchMatch) return branchMatch;
6151
6428
  return dirs.find((d) => detectProfileFromChange(d) === "patch") || dirs[0];
6152
6429
  } catch {
6153
6430
  return void 0;
@@ -6820,6 +7097,133 @@ function generateDuplicatesReportMarkdown(result) {
6820
7097
  }
6821
7098
  return lines.join("\n");
6822
7099
  }
7100
+
7101
+ // src/verifiers/security-suppressions.ts
7102
+ 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;
7103
+ function extractAttribute(text, attrName) {
7104
+ const pattern = new RegExp(`${attrName}\\s*=\\s*["']([^"']+)["']`, "i");
7105
+ const match = text.match(pattern);
7106
+ return match ? match[1].trim() : void 0;
7107
+ }
7108
+ function determineSuppressionKind(line) {
7109
+ if (line.includes("ai-sdlc:allow-secret") || line.includes("gitleaks:allow") || line.includes("allowlist secret")) {
7110
+ return "secret";
7111
+ }
7112
+ return "sast";
7113
+ }
7114
+ function isInformalSuppression(line) {
7115
+ return line.includes("nosec") || line.includes("pragma: allowlist secret") || line.includes("gitleaks:allow");
7116
+ }
7117
+ function checkMissingFields(reason, expires, approvedBy) {
7118
+ const missing = [];
7119
+ if (!reason) missing.push("reason");
7120
+ if (!expires) missing.push("expires");
7121
+ if (!approvedBy) missing.push("approved-by");
7122
+ return missing;
7123
+ }
7124
+ function checkExpiration(expires, referenceDate) {
7125
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(expires)) {
7126
+ return { status: "invalid", invalidReason: "Formato de fecha expires inv\xE1lido (se requiere YYYY-MM-DD)" };
7127
+ }
7128
+ const expDate = /* @__PURE__ */ new Date(`${expires}T23:59:59.999Z`);
7129
+ if (isNaN(expDate.getTime())) {
7130
+ return { status: "invalid", invalidReason: "Fecha expires no es una fecha v\xE1lida" };
7131
+ }
7132
+ const now = referenceDate || /* @__PURE__ */ new Date();
7133
+ if (expDate.getTime() < now.getTime()) {
7134
+ return { status: "expired", invalidReason: `Excepci\xF3n caducada en fecha ${expires}` };
7135
+ }
7136
+ return { status: "active" };
7137
+ }
7138
+ function evaluateSuppressionStatus(reason, expires, approvedBy, isInformal, referenceDate) {
7139
+ if (isInformal) {
7140
+ return { status: "invalid", invalidReason: "Formato informal (nosec/allowlist no estructurado) no permitido" };
7141
+ }
7142
+ const missing = checkMissingFields(reason, expires, approvedBy);
7143
+ if (missing.length > 0) {
7144
+ return { status: "invalid", invalidReason: `Faltan campos obligatorios: ${missing.join(", ")}` };
7145
+ }
7146
+ return checkExpiration(expires, referenceDate);
7147
+ }
7148
+ function extractSuppressionAttrs(line) {
7149
+ return {
7150
+ ruleId: extractAttribute(line, "rule"),
7151
+ reason: extractAttribute(line, "reason"),
7152
+ expires: extractAttribute(line, "expires"),
7153
+ approvedBy: extractAttribute(line, "approved-by") || extractAttribute(line, "approvedBy")
7154
+ };
7155
+ }
7156
+ function parseSecuritySuppression(line, filePath, lineNumber, referenceDate) {
7157
+ if (!SUPPRESSION_TRIGGER_REGEX.test(line)) return null;
7158
+ const kind = determineSuppressionKind(line);
7159
+ const isInformal = isInformalSuppression(line);
7160
+ const attrs = extractSuppressionAttrs(line);
7161
+ const evalResult = evaluateSuppressionStatus(attrs.reason, attrs.expires, attrs.approvedBy, isInformal, referenceDate);
7162
+ return {
7163
+ kind,
7164
+ ruleId: attrs.ruleId,
7165
+ reason: attrs.reason,
7166
+ expires: attrs.expires,
7167
+ approvedBy: attrs.approvedBy,
7168
+ status: evalResult.status,
7169
+ filePath,
7170
+ lineNumber,
7171
+ rawComment: line.trim(),
7172
+ invalidReason: evalResult.invalidReason
7173
+ };
7174
+ }
7175
+ function formatSuppressionRow(s) {
7176
+ const rule = s.ruleId ? `\`${s.ruleId}\`` : "*(all)*";
7177
+ const fileRef = `\`${s.filePath}:${s.lineNumber}\``;
7178
+ const reason = s.reason ? s.reason.replace(/\|/g, "\\|") : s.invalidReason || "*(Sin justificaci\xF3n)*";
7179
+ const expires = s.expires || "N/A";
7180
+ const approver = s.approvedBy || "*(Sin aprobador)*";
7181
+ return `| ${s.kind.toUpperCase()} | ${rule} | ${fileRef} | ${reason} | ${expires} | ${approver} |`;
7182
+ }
7183
+ function buildAuditHeader(total, active, expired, invalid) {
7184
+ return [
7185
+ "# \u{1F4CB} Security Suppressions and Audit Exceptions Inventory",
7186
+ "",
7187
+ `> **Generated at:** ${(/* @__PURE__ */ new Date()).toISOString()}`,
7188
+ `> **Total Audited Suppressions:** ${total} | **Active:** ${active} | **Expired:** ${expired} | **Invalid:** ${invalid}`,
7189
+ "",
7190
+ "## 1. Executive Summary",
7191
+ "",
7192
+ "| Category | Count | Status | Policy Compliance |",
7193
+ "| :--- | :---: | :---: | :--- |",
7194
+ `| **Active Suppressions** | ${active} | \u{1F7E2} PASS | Permitted until expiration date |`,
7195
+ `| **Expired Suppressions** | ${expired} | ${expired > 0 ? "\u{1F534} BLOCKED" : "\u{1F7E2} PASS"} | Must be renewed or remediated immediately |`,
7196
+ `| **Invalid Suppressions** | ${invalid} | ${invalid > 0 ? "\u26A0\uFE0F REJECTED" : "\u{1F7E2} PASS"} | Missing mandatory metadata fields |`,
7197
+ ""
7198
+ ];
7199
+ }
7200
+ function buildTableSection(title, items, emptyMsg) {
7201
+ const lines = [
7202
+ title,
7203
+ "",
7204
+ "| Engine | Rule / ID | Location | Details / Justification | Expires | Approved By |",
7205
+ "| :--- | :--- | :--- | :--- | :--- | :--- |"
7206
+ ];
7207
+ if (items.length === 0) {
7208
+ lines.push(`| - | - | - | ${emptyMsg} | - | - |`);
7209
+ } else {
7210
+ for (const item of items) lines.push(formatSuppressionRow(item));
7211
+ }
7212
+ lines.push("");
7213
+ return lines;
7214
+ }
7215
+ function generateSuppressionsAuditReport(suppressions) {
7216
+ const active = suppressions.filter((s) => s.status === "active");
7217
+ const expired = suppressions.filter((s) => s.status === "expired");
7218
+ const invalid = suppressions.filter((s) => s.status === "invalid");
7219
+ return [
7220
+ ...buildAuditHeader(suppressions.length, active.length, expired.length, invalid.length),
7221
+ ...buildTableSection("## 2. Active Security Exceptions", active, "*(No active suppressions recorded)*"),
7222
+ ...buildTableSection("## 3. Expired or Invalid Exceptions (Blocking/Rejected)", [...expired, ...invalid], "*(No expired or invalid suppressions)*")
7223
+ ].join("\n");
7224
+ }
7225
+
7226
+ // src/verifiers/secrets.ts
6823
7227
  var SECRET_RULES = [
6824
7228
  {
6825
7229
  id: "SEC-001-PRIVATE-KEY",
@@ -6941,13 +7345,15 @@ function maskSecret(secret) {
6941
7345
  const suffix = secret.slice(-suffixLen);
6942
7346
  return `${prefix}****${suffix}`;
6943
7347
  }
6944
- function isPlaceholderOrIgnored(secret, line) {
7348
+ function isPlaceholderOrIgnored(secret, line, filePath = "", lineNumber = 0, collectedSuppressions) {
6945
7349
  const lowerSecret = secret.toLowerCase();
6946
7350
  for (const placeholder of PLACEHOLDER_KEYWORDS) {
6947
7351
  if (lowerSecret.includes(placeholder)) return true;
6948
7352
  }
6949
- if (line.includes("ai-sdlc:allow-secret") || line.includes("gitleaks:allow") || line.includes("pragma: allowlist secret")) {
6950
- return true;
7353
+ const suppression = parseSecuritySuppression(line, filePath, lineNumber);
7354
+ if (suppression) {
7355
+ if (collectedSuppressions) collectedSuppressions.push(suppression);
7356
+ return suppression.status === "active";
6951
7357
  }
6952
7358
  return false;
6953
7359
  }
@@ -7088,14 +7494,14 @@ function buildSecretViolation(rule, rawMatch, entropy, filePath, relPath, lineNu
7088
7494
  message: `${rule.description} (Entrop\xEDa: ${entropy})`
7089
7495
  };
7090
7496
  }
7091
- function checkRuleOnLine(rule, line, lineNumber, filePath, relPath, entropyThreshold) {
7497
+ function checkRuleOnLine(rule, line, lineNumber, filePath, relPath, entropyThreshold, collectedSuppressions) {
7092
7498
  const violations = [];
7093
7499
  rule.regex.lastIndex = 0;
7094
7500
  let match;
7095
7501
  while ((match = rule.regex.exec(line)) !== null) {
7096
7502
  const rawMatch = rule.captureIndex ? match[rule.captureIndex] : match[0];
7097
7503
  if (!rawMatch || rawMatch.length < 8) continue;
7098
- if (isPlaceholderOrIgnored(rawMatch, line)) continue;
7504
+ if (isPlaceholderOrIgnored(rawMatch, line, filePath, lineNumber, collectedSuppressions)) continue;
7099
7505
  const entropy = calculateShannonEntropy(rawMatch);
7100
7506
  if (rule.minEntropy && entropy < (entropyThreshold || rule.minEntropy)) {
7101
7507
  continue;
@@ -7104,20 +7510,20 @@ function checkRuleOnLine(rule, line, lineNumber, filePath, relPath, entropyThres
7104
7510
  }
7105
7511
  return violations;
7106
7512
  }
7107
- function scanLineForSecrets(line, lineNumber, filePath, relPath, entropyThreshold) {
7513
+ function scanLineForSecrets(line, lineNumber, filePath, relPath, entropyThreshold, collectedSuppressions) {
7108
7514
  if (!line || line.trim().length === 0) return [];
7109
7515
  const lineViolations = [];
7110
7516
  for (const rule of SECRET_RULES) {
7111
- lineViolations.push(...checkRuleOnLine(rule, line, lineNumber, filePath, relPath, entropyThreshold));
7517
+ lineViolations.push(...checkRuleOnLine(rule, line, lineNumber, filePath, relPath, entropyThreshold, collectedSuppressions));
7112
7518
  }
7113
7519
  return lineViolations;
7114
7520
  }
7115
- function scanContentForSecrets(content, filePath, rootDir, entropyThreshold = 4.3) {
7521
+ function scanContentForSecrets(content, filePath, rootDir, entropyThreshold = 4.3, collectedSuppressions) {
7116
7522
  const violations = [];
7117
7523
  const lines = content.split(/\r?\n/);
7118
7524
  const relPath = path4.relative(rootDir, filePath).replace(/\\/g, "/");
7119
7525
  for (let i = 0; i < lines.length; i++) {
7120
- violations.push(...scanLineForSecrets(lines[i], i + 1, filePath, relPath, entropyThreshold));
7526
+ violations.push(...scanLineForSecrets(lines[i], i + 1, filePath, relPath, entropyThreshold, collectedSuppressions));
7121
7527
  }
7122
7528
  return violations;
7123
7529
  }
@@ -7133,29 +7539,31 @@ function groupDiffLinesByFile(diffLines) {
7133
7539
  function scanDiffItems(diffLines, rootDir, excludePatterns, entropyThreshold) {
7134
7540
  const fileGroups = groupDiffLinesByFile(diffLines);
7135
7541
  const findings = [];
7542
+ const suppressions = [];
7136
7543
  for (const [relFile, items] of fileGroups) {
7137
7544
  if (isPathExcluded2(relFile, excludePatterns)) continue;
7138
7545
  const absPath = path4.resolve(rootDir, relFile);
7139
7546
  for (const item of items) {
7140
- const lineViolations = scanLineForSecrets(item.content, item.lineNumber, absPath, relFile, entropyThreshold);
7547
+ const lineViolations = scanLineForSecrets(item.content, item.lineNumber, absPath, relFile, entropyThreshold, suppressions);
7141
7548
  for (const v of lineViolations) {
7142
7549
  findings.push({ ...v, message: `[DIFF] ${v.message}` });
7143
7550
  }
7144
7551
  }
7145
7552
  }
7146
- return { findings, filesScannedCount: fileGroups.size };
7553
+ return { findings, filesScannedCount: fileGroups.size, suppressions };
7147
7554
  }
7148
7555
  function scanAllProjectFiles(rootDir, excludePatterns, entropyThreshold) {
7149
7556
  const allFiles = walkProjectFiles(rootDir, rootDir, excludePatterns);
7150
7557
  const findings = [];
7558
+ const suppressions = [];
7151
7559
  for (const file of allFiles) {
7152
7560
  try {
7153
7561
  const content = fs7.readFileSync(file, "utf-8");
7154
- findings.push(...scanContentForSecrets(content, file, rootDir, entropyThreshold));
7562
+ findings.push(...scanContentForSecrets(content, file, rootDir, entropyThreshold, suppressions));
7155
7563
  } catch {
7156
7564
  }
7157
7565
  }
7158
- return { findings, filesScannedCount: allFiles.length };
7566
+ return { findings, filesScannedCount: allFiles.length, suppressions };
7159
7567
  }
7160
7568
  function appendNonDuplicateFindings(target, incoming) {
7161
7569
  for (const item of incoming) {
@@ -7188,14 +7596,16 @@ function verifySecrets(options = {}) {
7188
7596
  const rootDir = options.rootDir || process.cwd();
7189
7597
  const entropyThreshold = options.entropyThreshold ?? 4.3;
7190
7598
  const excludePatterns = options.excludePatterns || DEFAULT_EXCLUDED_PATTERNS;
7191
- const { findings, filesScannedCount } = options.diff ? scanDiffItems(getGitDiffLines(rootDir, options.baseBranch), rootDir, excludePatterns, entropyThreshold) : scanAllProjectFiles(rootDir, excludePatterns, entropyThreshold);
7599
+ const { findings, filesScannedCount, suppressions } = options.diff ? scanDiffItems(getGitDiffLines(rootDir, options.baseBranch), rootDir, excludePatterns, entropyThreshold) : scanAllProjectFiles(rootDir, excludePatterns, entropyThreshold);
7192
7600
  const merged = mergeGitleaksFindings(findings, rootDir, options.gitleaks);
7601
+ const hasExpired = (suppressions || []).some((s) => s.status === "expired");
7193
7602
  const result = {
7194
- success: merged.findings.length === 0,
7603
+ success: merged.findings.length === 0 && !hasExpired,
7195
7604
  totalFilesScanned: filesScannedCount,
7196
7605
  findingsCount: merged.findings.length,
7197
7606
  findings: merged.findings,
7198
- scannedWithGitleaks: merged.scannedWithGitleaks
7607
+ scannedWithGitleaks: merged.scannedWithGitleaks,
7608
+ suppressions
7199
7609
  };
7200
7610
  result.reportMarkdown = generateSecretsReportMarkdown(result);
7201
7611
  return result;
@@ -7420,8 +7830,12 @@ function walkSourceFiles(dir, rootDir, excludes = DEFAULT_SAST_EXCLUDES) {
7420
7830
  }
7421
7831
  return files;
7422
7832
  }
7423
- function isLineExemptFromSast(line) {
7424
- return line.includes("ai-sdlc:allow-sast") || line.includes("ai-sdlc:allow-prompt-injection") || line.includes("nosec");
7833
+ function checkLineSuppression(line, relPath, lineNumber, collected) {
7834
+ if (line.includes("ai-sdlc:allow-prompt-injection")) return true;
7835
+ const supp = parseSecuritySuppression(line, relPath, lineNumber);
7836
+ if (!supp) return false;
7837
+ if (collected) collected.push(supp);
7838
+ return supp.status === "active";
7425
7839
  }
7426
7840
  function checkRuleMatch(rule, line, ext, minSeverity) {
7427
7841
  if (rule.fileExtensions && !rule.fileExtensions.includes(ext)) return false;
@@ -7429,7 +7843,7 @@ function checkRuleMatch(rule, line, ext, minSeverity) {
7429
7843
  rule.pattern.lastIndex = 0;
7430
7844
  return rule.pattern.test(line);
7431
7845
  }
7432
- function scanFileForSast(filePath, rootDir, minSeverity = "HIGH") {
7846
+ function scanFileForSast(filePath, rootDir, minSeverity = "HIGH", collectedSuppressions) {
7433
7847
  const violations = [];
7434
7848
  const ext = path4.extname(filePath).toLowerCase();
7435
7849
  try {
@@ -7438,7 +7852,7 @@ function scanFileForSast(filePath, rootDir, minSeverity = "HIGH") {
7438
7852
  const relPath = path4.relative(rootDir, filePath).replace(/\\/g, "/");
7439
7853
  for (let i = 0; i < lines.length; i++) {
7440
7854
  const line = lines[i];
7441
- if (isLineExemptFromSast(line)) continue;
7855
+ if (checkLineSuppression(line, relPath, i + 1, collectedSuppressions)) continue;
7442
7856
  for (const rule of SAST_RULES) {
7443
7857
  if (checkRuleMatch(rule, line, ext, minSeverity)) {
7444
7858
  violations.push({
@@ -7478,8 +7892,9 @@ function verifySast(options = {}) {
7478
7892
  const targetDirs = options.targetDirectories || ["src", "packages", "prompts"];
7479
7893
  const filesToScan = collectSastFiles(rootDir, targetDirs);
7480
7894
  const violations = [];
7895
+ const suppressions = [];
7481
7896
  for (const file of filesToScan) {
7482
- violations.push(...scanFileForSast(file, rootDir, minSeverity));
7897
+ violations.push(...scanFileForSast(file, rootDir, minSeverity, suppressions));
7483
7898
  }
7484
7899
  if (shouldRunSemgrep(options)) {
7485
7900
  try {
@@ -7487,11 +7902,13 @@ function verifySast(options = {}) {
7487
7902
  } catch {
7488
7903
  }
7489
7904
  }
7905
+ const hasExpired = suppressions.some((s) => s.status === "expired");
7490
7906
  const result = {
7491
- success: violations.length === 0,
7907
+ success: violations.length === 0 && !hasExpired,
7492
7908
  totalFilesScanned: filesToScan.length,
7493
7909
  violationsCount: violations.length,
7494
- violations
7910
+ violations,
7911
+ suppressions
7495
7912
  };
7496
7913
  result.reportMarkdown = generateSastReportMarkdown(result);
7497
7914
  return result;
@@ -7544,7 +7961,7 @@ var PROMPT_INJECTION_SIGNATURES = [
7544
7961
  severity: "CRITICAL",
7545
7962
  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,
7546
7963
  message: "Attempted system prompt override, developer mode, or unrestricted mode activation"
7547
- // ai-sdlc:allow-prompt-injection
7964
+ // ai-sdlc:allow-sast rule="PROMPT-INJ-MODE-OVERRIDE" reason="Regla interna de deteccion" expires="2099-12-31" approved-by="security@ai-sdlc.dev"
7548
7965
  },
7549
7966
  {
7550
7967
  ruleId: "PROMPT-INJ-LEAK",
@@ -7568,7 +7985,7 @@ var PROMPT_INJECTION_SIGNATURES = [
7568
7985
  function scanLinesForPromptInjection(lines, findings) {
7569
7986
  for (let i = 0; i < lines.length; i++) {
7570
7987
  const line = lines[i];
7571
- if (line.includes("ai-sdlc:allow-prompt-injection") || line.includes("nosec")) continue;
7988
+ if (line.includes("ai-sdlc:allow-prompt-injection")) continue;
7572
7989
  for (const sig of PROMPT_INJECTION_SIGNATURES) {
7573
7990
  sig.regex.lastIndex = 0;
7574
7991
  if (sig.regex.test(line)) {
@@ -9557,6 +9974,7 @@ var PREFIX_MAP = {
9557
9974
  "ACT": { type: "actor", layer: "product" },
9558
9975
  "UC": { type: "use-case", layer: "product" },
9559
9976
  "BR": { type: "business-rule", layer: "product" },
9977
+ "BC": { type: "bounded-context", layer: "product" },
9560
9978
  "ABUSE": { type: "abuse-case", layer: "product" },
9561
9979
  "DATA-ASSET": { type: "data-asset", layer: "product" },
9562
9980
  "PRIV-ROPA": { type: "privacy-ropa", layer: "product" },
@@ -9575,6 +9993,7 @@ var TYPE_LOOKUP = {
9575
9993
  "use-case": { type: "use-case", layer: "product" },
9576
9994
  "usecase": { type: "use-case", layer: "product" },
9577
9995
  "business-rule": { type: "business-rule", layer: "product" },
9996
+ "bounded-context": { type: "bounded-context", layer: "product" },
9578
9997
  "rule": { type: "business-rule", layer: "product" },
9579
9998
  "abuse-case": { type: "abuse-case", layer: "product" },
9580
9999
  "data-asset": { type: "data-asset", layer: "product" },
@@ -9946,6 +10365,23 @@ function connectAdrRelationships(art, nodeMap, addEdge) {
9946
10365
  }
9947
10366
  }
9948
10367
  }
10368
+ function connectBoundedContextRelationships(art, nodeMap, addEdge) {
10369
+ for (const cmp of toList(art.frontmatter["components-involved"] || art.frontmatter.components)) {
10370
+ const id = cmp.trim();
10371
+ if (id) {
10372
+ connectTargets(art.id, [id], "encompasses", nodeMap, addEdge, "component", "architecture");
10373
+ }
10374
+ }
10375
+ const cm = art.frontmatter["context-mapping"];
10376
+ if (cm && typeof cm === "object") {
10377
+ for (const up of toList(cm["upstream-dependencies"])) {
10378
+ const id = up.trim();
10379
+ if (id) {
10380
+ connectTargets(art.id, [id], "depends-on", nodeMap, addEdge, "bounded-context", "product");
10381
+ }
10382
+ }
10383
+ }
10384
+ }
9949
10385
  function connectEnclaveRelationships(art, nodeMap, addEdge) {
9950
10386
  for (const sec of toList(art.frontmatter["enforced-by"])) {
9951
10387
  const id = sec.trim();
@@ -9966,6 +10402,7 @@ var CONNECTOR_MAP = {
9966
10402
  "security-requirement": connectRequirementMitigations,
9967
10403
  "privacy-requirement": connectRequirementMitigations,
9968
10404
  "adr": connectAdrRelationships,
10405
+ "bounded-context": connectBoundedContextRelationships,
9969
10406
  "security-enclave": connectEnclaveRelationships
9970
10407
  };
9971
10408
  function connectArtifactRelationships(scannedMap, nodeMap, addEdge) {
@@ -10627,6 +11064,19 @@ var DASHBOARD_CLIENT_SCRIPT = `
10627
11064
  'height': 40
10628
11065
  }
10629
11066
  },
11067
+ {
11068
+ selector: 'node.type-bounded-context',
11069
+ style: {
11070
+ 'shape': 'round-rectangle',
11071
+ 'background-color': '#4338ca',
11072
+ 'border-color': '#a5b4fc',
11073
+ 'border-width': 2.5,
11074
+ 'width': 75,
11075
+ 'height': 42,
11076
+ 'font-weight': 'bold',
11077
+ 'text-max-width': '70px'
11078
+ }
11079
+ },
10630
11080
  {
10631
11081
  selector: 'node.type-security-enclave',
10632
11082
  style: {
@@ -10730,6 +11180,14 @@ var DASHBOARD_CLIENT_SCRIPT = `
10730
11180
  selector: 'edge.relation-verified-by',
10731
11181
  style: { 'line-color': '#10b981', 'target-arrow-color': '#10b981', 'width': 1.8 }
10732
11182
  },
11183
+ {
11184
+ selector: 'edge.relation-encompasses',
11185
+ style: { 'line-color': '#a5b4fc', 'target-arrow-color': '#a5b4fc', 'width': 2 }
11186
+ },
11187
+ {
11188
+ selector: 'edge.relation-depends-on',
11189
+ style: { 'line-color': '#c084fc', 'target-arrow-color': '#c084fc', 'line-style': 'dashed', 'width': 1.8 }
11190
+ },
10733
11191
  {
10734
11192
  selector: 'node.highlighted',
10735
11193
  style: {
@@ -10926,6 +11384,7 @@ var DASHBOARD_CLIENT_SCRIPT = `
10926
11384
  'actor': '.type-actor, .type-threat-actor',
10927
11385
  'use-case': '.type-use-case, .type-usecase',
10928
11386
  'business-rule': '.type-business-rule, .type-rule',
11387
+ 'bounded-context': '.type-bounded-context',
10929
11388
  'abuse-case': '.type-abuse-case, .type-threat-actor',
10930
11389
  'data-asset': '.type-data-asset',
10931
11390
  'privacy-ropa': '.type-privacy-ropa',
@@ -11338,6 +11797,7 @@ var GRAPH_LEGEND_HTML = `
11338
11797
  <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>
11339
11798
  <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>
11340
11799
  <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>
11800
+ <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>
11341
11801
  <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>
11342
11802
  <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>
11343
11803
  <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>
@@ -11382,7 +11842,7 @@ function renderGraphToolbarHtml() {
11382
11842
  ` <div class="graph-toolbar">`,
11383
11843
  ` <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>`,
11384
11844
  ` <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>`,
11385
- ` <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>`,
11845
+ ` <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>`,
11386
11846
  ` <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>`,
11387
11847
  ` <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>`,
11388
11848
  ` <div class="tool-row"><input type="text" id="node-search" class="tool-input" placeholder="Search node ID..." oninput="searchNode(this.value)"></div>`,
@@ -12112,6 +12572,159 @@ function generateDashboardReport(options = {}) {
12112
12572
  html
12113
12573
  };
12114
12574
  }
12575
+ var SARIF_SCHEMA_2_1_0 = "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json";
12576
+ var SARIF_VERSION = "2.1.0";
12577
+ function normalizeUri(filePath) {
12578
+ return filePath.replace(/\\/g, "/");
12579
+ }
12580
+ function mapSastSeverityToSarifLevel(severity) {
12581
+ switch (severity) {
12582
+ case "CRITICAL":
12583
+ case "HIGH":
12584
+ return "error";
12585
+ case "MEDIUM":
12586
+ return "warning";
12587
+ case "LOW":
12588
+ default:
12589
+ return "note";
12590
+ }
12591
+ }
12592
+ var SAST_CWE_MAP = {
12593
+ "SAST-001": "CWE-89",
12594
+ "SAST-002": "CWE-78",
12595
+ "SAST-003": "CWE-95",
12596
+ "SAST-004": "CWE-918",
12597
+ "SAST-005": "CWE-22",
12598
+ "SAST-006": "CWE-77",
12599
+ "SAST-007": "CWE-77"
12600
+ };
12601
+ var SAST_OWASP_MAP = {
12602
+ "SAST-001": "A03:2021-Injection",
12603
+ "SAST-002": "A03:2021-Injection",
12604
+ "SAST-003": "A03:2021-Injection",
12605
+ "SAST-004": "A10:2021-Server-Side Request Forgery (SSRF)",
12606
+ "SAST-005": "A01:2021-Broken Access Control",
12607
+ "SAST-006": "LLM01:2023-Prompt Injection",
12608
+ "SAST-007": "LLM01:2023-Prompt Injection"
12609
+ };
12610
+ function resolveSastCwe(ruleId) {
12611
+ const prefix = ruleId.slice(0, 8);
12612
+ const cwe = SAST_CWE_MAP[prefix];
12613
+ return cwe ? [cwe] : ["CWE-200"];
12614
+ }
12615
+ function resolveSastOwasp(ruleId) {
12616
+ const prefix = ruleId.slice(0, 8);
12617
+ const owasp = SAST_OWASP_MAP[prefix];
12618
+ return owasp ? [owasp] : ["A04:2021-Insecure Design"];
12619
+ }
12620
+ function buildSastRuleDescriptors() {
12621
+ return SAST_RULES.map((rule) => ({
12622
+ id: rule.id,
12623
+ name: rule.type,
12624
+ shortDescription: { text: rule.description },
12625
+ fullDescription: { text: rule.description },
12626
+ defaultConfiguration: { level: mapSastSeverityToSarifLevel(rule.severity) },
12627
+ properties: {
12628
+ tags: ["security", "sast"],
12629
+ cwe: resolveSastCwe(rule.id),
12630
+ owasp: resolveSastOwasp(rule.id)
12631
+ }
12632
+ }));
12633
+ }
12634
+ function buildSecretRuleDescriptors() {
12635
+ return SECRET_RULES.map((rule) => ({
12636
+ id: rule.id,
12637
+ name: rule.type,
12638
+ shortDescription: { text: rule.description },
12639
+ fullDescription: { text: rule.description },
12640
+ defaultConfiguration: { level: "error" },
12641
+ properties: {
12642
+ tags: ["security", "secrets", "credentials"],
12643
+ cwe: ["CWE-798"],
12644
+ owasp: ["A07:2021-Identification and Authentication Failures"]
12645
+ }
12646
+ }));
12647
+ }
12648
+ function buildSastResults(sastResult) {
12649
+ if (!sastResult || !sastResult.violations) return [];
12650
+ return sastResult.violations.map((v) => ({
12651
+ ruleId: v.ruleId,
12652
+ level: mapSastSeverityToSarifLevel(v.severity),
12653
+ message: { text: v.message },
12654
+ locations: [
12655
+ {
12656
+ physicalLocation: {
12657
+ artifactLocation: { uri: normalizeUri(v.relPath) },
12658
+ region: { startLine: v.lineNumber, startColumn: 1 }
12659
+ }
12660
+ }
12661
+ ]
12662
+ }));
12663
+ }
12664
+ function buildSecretResults(secretsResult) {
12665
+ if (!secretsResult || !secretsResult.findings) return [];
12666
+ return secretsResult.findings.map((f) => ({
12667
+ ruleId: f.ruleId,
12668
+ level: "error",
12669
+ message: {
12670
+ text: `Potential hardcoded secret or credential leak detected: ${f.type} (${f.maskedMatch})`
12671
+ },
12672
+ locations: [
12673
+ {
12674
+ physicalLocation: {
12675
+ artifactLocation: { uri: normalizeUri(f.relPath) },
12676
+ region: { startLine: f.lineNumber, startColumn: 1 }
12677
+ }
12678
+ }
12679
+ ]
12680
+ }));
12681
+ }
12682
+ function collectAllRules() {
12683
+ const sastRules = buildSastRuleDescriptors();
12684
+ const secretRules = buildSecretRuleDescriptors();
12685
+ const ruleMap = /* @__PURE__ */ new Map();
12686
+ for (const r of [...sastRules, ...secretRules]) {
12687
+ if (!ruleMap.has(r.id)) {
12688
+ ruleMap.set(r.id, r);
12689
+ }
12690
+ }
12691
+ return Array.from(ruleMap.values());
12692
+ }
12693
+ function generateSecuritySarifReport(options = {}) {
12694
+ const toolName = options.toolName || "aisdlc-security";
12695
+ const toolVersion = options.toolVersion || "2.2.0";
12696
+ const informationUri = options.informationUri || "https://github.com/altromon/AI-SDLC";
12697
+ const sastResults = buildSastResults(options.sastResult);
12698
+ const secretResults = buildSecretResults(options.secretsResult);
12699
+ const allResults = [...sastResults, ...secretResults];
12700
+ return {
12701
+ $schema: SARIF_SCHEMA_2_1_0,
12702
+ version: SARIF_VERSION,
12703
+ runs: [
12704
+ {
12705
+ tool: {
12706
+ driver: {
12707
+ name: toolName,
12708
+ version: toolVersion,
12709
+ informationUri,
12710
+ rules: collectAllRules()
12711
+ }
12712
+ },
12713
+ results: allResults
12714
+ }
12715
+ ]
12716
+ };
12717
+ }
12718
+ function serializeSarifDocument(doc, pretty = true) {
12719
+ return JSON.stringify(doc, null, pretty ? 2 : 0);
12720
+ }
12721
+ function writeSecuritySarifReport(outputPath, doc, pretty = true) {
12722
+ const dir = path4.dirname(outputPath);
12723
+ if (!fs7.existsSync(dir)) {
12724
+ fs7.mkdirSync(dir, { recursive: true });
12725
+ }
12726
+ fs7.writeFileSync(outputPath, serializeSarifDocument(doc, pretty), "utf-8");
12727
+ }
12115
12728
 
12116
12729
  // src/init/agent-templates.ts
12117
12730
  var SPECIALIZED_AGENT_TEMPLATES = [
@@ -12217,7 +12830,7 @@ var SPECIALIZED_AGENT_TEMPLATES = [
12217
12830
  - Read exclusively requirements cited in the \`handoff.yaml\` sidecar (\`HOF-*\`) and their referenced artifacts.
12218
12831
  - **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.
12219
12832
  - **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.
12220
- - **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:
12833
+ - **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:
12221
12834
  1. **Happy Path**: nominal user interaction with valid inputs producing the expected UI state/response.
12222
12835
  2. **Sad Path**: error handling, invalid interactions, validation rejections, disabled/blocked states, and failure recovery.
12223
12836
  3. **Boundary Values**: minimum/maximum lengths, numeric extremes, empty/whitespace inputs, edge selections, and rapid/repeated interactions.
@@ -14108,15 +14721,16 @@ pipelines:\r
14108
14721
  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";
14109
14722
  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';
14110
14723
  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";
14111
- var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML = 'name: SDD Canonical Integration on Merge\n\non:\n pull_request:\n types: [closed]\n branches:\n - main\n - \'release/**\'\n workflow_dispatch:\n inputs:\n change_id:\n description: \'SDD change ID to integrate manually (e.g. chg-001-telemetry)\'\n required: false\n type: string\n\npermissions:\n contents: write\n pull-requests: read\n\nconcurrency:\n group: sdd-integrate-${{ github.event.pull_request.base.ref || github.ref_name }}\n cancel-in-progress: false\n\njobs:\n integrate-sdd:\n name: SDD Canonical Integration\n if: github.event.pull_request.merged == true || github.event_name == \'workflow_dispatch\'\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout Repository\n uses: actions/checkout@v4\n with:\n ref: ${{ github.event.pull_request.base.ref || github.ref_name }}\n fetch-depth: 0\n token: ${{ secrets.GITHUB_TOKEN }}\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 pnpm approve-builds --all\n\n - name: Build Packages\n run: pnpm run build\n\n - name: Detect and Integrate SDD Change\n id: integrate\n env:\n PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}\n PR_TITLE: ${{ github.event.pull_request.title }}\n PR_BODY: ${{ github.event.pull_request.body }}\n MANUAL_CHANGE_ID: ${{ github.event.inputs.change_id }}\n run: |\n npx @aisdlc/cli sdd integrate --auto || true\n\n - name: Commit and Push Canonical Baseline Changes\n run: |\n git config user.name "github-actions[bot]"\n git config user.email "github-actions[bot]@users.noreply.github.com"\n git add -A\n if ! git diff --cached --quiet; then\n git commit -m "chore(sdd): integrate changes into canonical baseline [skip ci]"\n TARGET_BRANCH="${{ github.event.pull_request.base.ref || github.ref_name }}"\n MAX_RETRIES=3\n RETRY_COUNT=0\n DELAY=2\n\n while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do\n echo "Synchronizing with remote branch $TARGET_BRANCH (pull --rebase)..."\n git pull --rebase origin "$TARGET_BRANCH"\n if git push origin "$TARGET_BRANCH"; then\n echo "\u2714 Canonical integration committed and synchronized to repository."\n exit 0\n fi\n RETRY_COUNT=$((RETRY_COUNT + 1))\n if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then\n echo "\u26A0 Push rejected (concurrency detected). Retrying in ${DELAY}s (attempt $RETRY_COUNT/$MAX_RETRIES)..."\n sleep $DELAY\n DELAY=$((DELAY * 2))\n fi\n done\n\n echo "\u274C Error: Failed to push canonical integration after $MAX_RETRIES attempts."\n exit 1\n else\n echo "\u2139 No pending changes generated in working tree."\n fi\n';
14724
+ 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';
14112
14725
  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';
14113
- 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';
14726
+ 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';
14114
14727
  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';
14115
14728
  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';
14116
14729
  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';
14117
14730
  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';
14118
14731
  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';
14119
14732
  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';
14733
+ 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';
14120
14734
  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';
14121
14735
  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';
14122
14736
  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';
@@ -14187,6 +14801,7 @@ var STARTER_BASE_TEMPLATES = [
14187
14801
  { relPath: "templates/privacy/privacy-req.template.md", content: STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD },
14188
14802
  { relPath: "templates/privacy/privacy-ropa.template.md", content: STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD },
14189
14803
  { relPath: "templates/product/actor.template.md", content: STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD },
14804
+ { relPath: "templates/product/bounded-context.template.md", content: STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD },
14190
14805
  { relPath: "templates/product/business-rule.template.md", content: STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD },
14191
14806
  { relPath: "templates/product/journey.template.md", content: STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD },
14192
14807
  { relPath: "templates/product/requirement.template.md", content: STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD },
@@ -15190,6 +15805,6 @@ function initProject(options = {}) {
15190
15805
  );
15191
15806
  }
15192
15807
 
15193
- export { ALL_ARCHITECTURE_TEMPLATES, BRANCH_PATTERNS, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_PRIVACY_POLICY, DEFAULT_SAST_EXCLUDES, GENERAL_SOURCE_EXTENSIONS, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, LIFECYCLE_SKILL_TEMPLATES, OpenSpecAdapter, PII_SAST_RULES, PREPARE_COMMIT_MSG_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, SAST_RULES, SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_INTRODUCTION_AND_GOALS_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_MANIFEST_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_QUALITY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_IDE_MCP_CONFIG_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_PRODUCTION_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_USER_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_DATA_ASSET_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_TERM_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_USE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_HAZARD_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_SAFETY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_DESIGN_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_HANDOFF_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_PROPOSAL_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_RELEASE_KPIS_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SESSION_TELEMETRY_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SPEC_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_TASKS_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ABUSE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ENCLAVE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_SECURITY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_THREAT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BASE_TEMPLATES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COMPLIANCE_LICENSE_MANIFEST_YAML, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_DEPLOY_DASHBOARD, STARTER_GITHUB_PR_KPI, STARTER_GITHUB_PULL_REQUEST_TEMPLATE, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_LICENSE_POLICY, STARTER_PRIVACY_POLICY, STARTER_PROCESS_README, STARTER_PULL_REQUEST_TEMPLATE, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_SCHEMAS, STARTER_SCHEMAS_MAP, STARTER_TASK_TEMPLATE, STARTER_TEMPLATES_CI_AZURE_PIPELINES_YML, STARTER_TEMPLATES_CI_BITBUCKET_PIPELINES_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML, STARTER_TEMPLATES_CI__GITLAB_CI_YML, STARTER_TEMPLATES_COMPLIANCE_COMMERCIAL_ACQUISITION_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_USER_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DATA_ASSET_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DPIA_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_TERM_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USER_DESIGN_FEEDBACK_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_HAZARD_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_SAFETY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SDD_DESIGN_TEMPLATE_MD, STARTER_TEMPLATES_SDD_HANDOFF_TEMPLATE_YAML, STARTER_TEMPLATES_SDD_PROPOSAL_TEMPLATE_MD, STARTER_TEMPLATES_SDD_PULL_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_SDD_SPEC_TEMPLATE_MD, STARTER_TEMPLATES_SDD_TASKS_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ABUSE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ENCLAVE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_SECURITY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_THREAT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_WORKFLOW_AGENT_HANDOFF_TEMPLATE_MD, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, STARTER__GITHUB_PULL_REQUEST_TEMPLATE_MD, SpecKitAdapter, TYPE_TO_SCHEMA_MAP, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, aggregateCommitKpiRecords, aggregatePrKpis, aggregateReleaseKpis, analyzeBddVariantsForRequirement, appendRevisionHistoryRow, buildCycloneDxComponent, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, checkGherkinInSync, checkoutTaskBranch, classifyBranch, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeSha256, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generatePrivacyReportMarkdown, generateQualityReport, generateRopaInventoryMarkdown, generateSastReportMarkdown, generateSecretsReportMarkdown, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, installGitHooks, integrateSddChange, isGitleaksInstalled, isPathProtectedFromPatch, isPlaceholderOrIgnored, isRequirementArtifact2 as isRequirementArtifact, isSemgrepInstalled, isToolAvailable, loadPrivacyPolicy, loadProductHandoffSidecar, locateTaskInActiveChanges, maskSecret, normalizeSpdxLicense, parseCommitTrailers, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, processPackageDir, readCodeCoverageSummary, readPackageJson, renderAntigravityAgentFile, renderAntigravitySkillFile, renderAutonomyModeSection, renderClaudeAgentFile, renderCopilotAgentFile, renderCursorAgentFile, renderDashboardHtml, renderManualsTab, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCytoscapePath, resolveFeatureFilePath, resolveGitRef, resolveLicenseFromFile, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForPrivacyViolations, scanFileForSast, scanInstalledLicenses, scanManualsInWorkspace, scanPnpmStore, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, slugify, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyManuals, verifyPdacGraph, verifyPrivacy, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCycloneDxSbom, writeReleaseKpiReport, writeThirdPartyNotices };
15808
+ export { ALL_ARCHITECTURE_TEMPLATES, BRANCH_PATTERNS, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_PRIVACY_POLICY, DEFAULT_SAST_EXCLUDES, GENERAL_SOURCE_EXTENSIONS, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, LIFECYCLE_SKILL_TEMPLATES, OpenSpecAdapter, PII_SAST_RULES, PREPARE_COMMIT_MSG_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, SARIF_SCHEMA_2_1_0, SARIF_VERSION, SAST_RULES, SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_INTRODUCTION_AND_GOALS_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_MANIFEST_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_QUALITY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_IDE_MCP_CONFIG_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_PRODUCTION_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_USER_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_DATA_ASSET_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_TERM_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_USE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_HAZARD_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_SAFETY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_DESIGN_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_HANDOFF_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_PROPOSAL_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_RELEASE_KPIS_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SESSION_TELEMETRY_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SPEC_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_TASKS_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ABUSE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ENCLAVE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_SECURITY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_THREAT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BASE_TEMPLATES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COMPLIANCE_LICENSE_MANIFEST_YAML, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_DEPLOY_DASHBOARD, STARTER_GITHUB_PR_KPI, STARTER_GITHUB_PULL_REQUEST_TEMPLATE, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_LICENSE_POLICY, STARTER_PRIVACY_POLICY, STARTER_PROCESS_README, STARTER_PULL_REQUEST_TEMPLATE, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_SCHEMAS, STARTER_SCHEMAS_MAP, STARTER_TASK_TEMPLATE, STARTER_TEMPLATES_CI_AZURE_PIPELINES_YML, STARTER_TEMPLATES_CI_BITBUCKET_PIPELINES_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML, STARTER_TEMPLATES_CI__GITLAB_CI_YML, STARTER_TEMPLATES_COMPLIANCE_COMMERCIAL_ACQUISITION_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_USER_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DATA_ASSET_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DPIA_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_TERM_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USER_DESIGN_FEEDBACK_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_HAZARD_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_SAFETY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SDD_DESIGN_TEMPLATE_MD, STARTER_TEMPLATES_SDD_HANDOFF_TEMPLATE_YAML, STARTER_TEMPLATES_SDD_PROPOSAL_TEMPLATE_MD, STARTER_TEMPLATES_SDD_PULL_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_SDD_SPEC_TEMPLATE_MD, STARTER_TEMPLATES_SDD_TASKS_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ABUSE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ENCLAVE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_SECURITY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_THREAT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_WORKFLOW_AGENT_HANDOFF_TEMPLATE_MD, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, STARTER__GITHUB_PULL_REQUEST_TEMPLATE_MD, SpecKitAdapter, TYPE_TO_SCHEMA_MAP, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, aggregateCommitKpiRecords, aggregatePrKpis, aggregateReleaseKpis, analyzeBddVariantsForRequirement, appendRevisionHistoryRow, applyRatchetMode, buildCycloneDxComponent, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, checkGherkinInSync, checkoutTaskBranch, classifyBranch, classifyMetricFromMessage, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeSha256, computeViolationSignature, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, evaluateVulnerabilityThresholds, extractBaselineEntriesFromResults, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generatePrivacyReportMarkdown, generateQualityReport, generateRopaInventoryMarkdown, generateSastReportMarkdown, generateSecretsReportMarkdown, generateSecuritySarifReport, generateSuppressionsAuditReport, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, installGitHooks, integrateSddChange, isGitleaksInstalled, isMetricWorsened, isPathProtectedFromPatch, isPlaceholderOrIgnored, isRequirementArtifact2 as isRequirementArtifact, isSemgrepInstalled, isToolAvailable, loadPrivacyPolicy, loadProductHandoffSidecar, loadQualityBaseline, locateTaskInActiveChanges, mapSastSeverityToSarifLevel, maskSecret, normalizeSpdxLicense, normalizeUri, parseCommitTrailers, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSecuritySuppression, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, parseTrivyVulnerabilities, processPackageDir, readCodeCoverageSummary, readPackageJson, renderAntigravityAgentFile, renderAntigravitySkillFile, renderAutonomyModeSection, renderClaudeAgentFile, renderCopilotAgentFile, renderCursorAgentFile, renderDashboardHtml, renderManualsTab, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCytoscapePath, resolveFeatureFilePath, resolveGitRef, resolveLicenseFromFile, resolveSastCwe, resolveSastOwasp, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForPrivacyViolations, scanFileForSast, scanInstalledLicenses, scanManualsInWorkspace, scanPnpmStore, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, serializeSarifDocument, slugify, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyManuals, verifyPdacGraph, verifyPrivacy, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCycloneDxSbom, writeQualityBaseline, writeReleaseKpiReport, writeSecuritySarifReport, writeThirdPartyNotices };
15194
15809
  //# sourceMappingURL=index.js.map
15195
15810
  //# sourceMappingURL=index.js.map