@aisdlc/core 2.0.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/index.cjs +787 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +211 -22
- package/dist/index.d.ts +211 -22
- package/dist/index.js +765 -100
- package/dist/index.js.map +1 -1
- package/package.json +7 -2
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
|
-
|
|
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
|
|
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
|
-
|
|
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,15 +2971,16 @@ 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';
|
|
2829
|
-
var SCHEMA_SCHEMAS_PRIVACY_DATA_ASSET_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/privacy/data-asset.schema.json",\n "title": "Personal Data Asset & PII Inventory Schema (DATA-ASSET-*)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "classification",\n "pii-categories",\n "data-subjects",\n "retention-period",\n "erasure-method"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "data-asset"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Data asset semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": ["draft", "active", "deprecated", "retired"]\n },\n "classification": {\n "type": "string",\n "enum": [\n "public",\n "internal",\n "confidential-pii",\n "special-category-sensitive"\n ],\n "description": "Data sensitivity classification aligned with privacy-policy.yaml."\n },\n "pii-categories": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "enum": [\n "identifiers",\n "contact",\n "authentication",\n "financial",\n "location",\n "behavioral",\n "biometric",\n "health",\n "telemetry-operator"\n ]\n }\n },\n "data-subjects": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Product actors (ACT-*) whose personal data is stored or processed."\n },\n "fields": {\n "type": "array",\n "items": {\n "type": "object",\n "required": ["name", "sensitivity", "masking-strategy"],\n "properties": {\n "name": {\n "type": "string",\n "minLength": 1\n },\n "sensitivity": {\n "type": "string",\n "enum": ["public", "internal", "pii", "special-category"]\n },\n "masking-strategy": {\n "type": "string",\n "enum": [\n "none",\n "redact",\n "sha256-salt",\n "tokenize",\n "aes-256-gcm",\n "truncate"\n ]\n }\n },\n "additionalProperties": false\n }\n },\n "retention-period": {\n "type": "string",\n "pattern": "^([0-9]+(d|m|y)|session-only|indefinite-anonymized)$",\n "description": "Maximum retention TTL (e.g. 30d, 12m, 5y, session-only, indefinite-anonymized)."\n },\n "erasure-method": {\n "type": "string",\n "enum": [\n "hard-delete",\n "crypto-shredding",\n "irreversible-anonymization"\n ]\n },\n "owner-bounded-context": {\n "type": "string",\n "pattern": "^(BC|CMP)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "supersedes": {\n "type": ["string", "null"],\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": ["string", "null"],\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}\n';
|
|
2830
|
-
var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-policy.schema.json",\n "title": "Privacy-by-Design as Code Governance Policy Schema",\n "type": "object",\n "required": [\n "version",\n "project",\n "regulatory_frameworks",\n "default_action",\n "classifications",\n "agent_guardrails",\n "ci_gates"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^(PRIV-POL|POL-PRIV)-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "privacy-policy"\n },\n "version": {\n "type": "string",\n "minLength": 1\n },\n "project": {\n "type": "string",\n "minLength": 1\n },\n "regulatory_frameworks": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "enum": ["GDPR", "LOPDGDD", "ISO-27701", "CCPA", "HIPAA", "LGPD"]\n }\n },\n "default_action": {\n "type": "string",\n "enum": ["DENY_UNREGISTERED_PII", "ALLOW", "REVIEW_REQUIRED"]\n },\n "classifications": {\n "type": "object",\n "required": ["public", "internal", "confidential_pii", "special_category_sensitive"],\n "additionalProperties": {\n "type": "object",\n "required": ["action", "encryption_at_rest", "encryption_in_transit", "allow_in_logs", "allow_in_ai_prompts"],\n "properties": {\n "action": {\n "type": "string",\n "enum": ["ALLOW", "STRICT_GOVERNANCE", "DPIA_APPROVAL_REQUIRED", "DENY"]\n },\n "description": { "type": "string" },\n "exception_requires": { "type": "string" },\n "require_ropa_entry": { "type": "boolean" },\n "require_dpia_artifact": { "type": "boolean" },\n "encryption_at_rest": { "type": "boolean" },\n "encryption_in_transit": { "type": "boolean" },\n "require_field_level_encryption": { "type": "boolean" },\n "allow_in_logs": { "type": "boolean" },\n "log_masking_strategy": { "type": "string" },\n "allow_in_ai_prompts": { "type": "boolean" },\n "max_retention_days": { "type": "integer", "minimum": 1 },\n "require_right_to_erasure": { "type": "boolean" }\n },\n "additionalProperties": false\n }\n },\n "cross_border_transfers": {\n "type": "object",\n "properties": {\n "allowed_regions": {\n "type": "array",\n "items": { "type": "string" }\n },\n "require_scc_for_third_countries": { "type": "boolean" },\n "approved_subprocessors": {\n "type": "array",\n "items": { "type": "string" }\n }\n },\n "additionalProperties": false\n },\n "agent_guardrails": {\n "type": "object",\n "required": [\n "forbid_real_pii_in_tests",\n "forbid_pii_in_console_or_logger",\n "require_dto_projection_for_pii"\n ],\n "properties": {\n "forbid_real_pii_in_tests": { "type": "boolean" },\n "forbid_pii_in_console_or_logger": { "type": "boolean" },\n "require_dto_projection_for_pii": { "type": "boolean" },\n "on_special_category_detected": {\n "type": "object",\n "required": ["action", "notification_tag", "message"],\n "properties": {\n "action": { "type": "string" },\n "notification_tag": { "type": "string" },\n "message": { "type": "string" }\n },\n "additionalProperties": false\n }\n },\n "additionalProperties": false\n },\n "ci_gates": {\n "type": "object",\n "required": [\n "fail_on_unregistered_pii",\n "fail_on_pii_in_logs",\n "fail_on_missing_retention_policy",\n "generate_ropa_inventory",\n "output_ropa_file",\n "output_privacy_report"\n ],\n "properties": {\n "fail_on_unregistered_pii": { "type": "boolean" },\n "fail_on_pii_in_logs": { "type": "boolean" },\n "fail_on_missing_retention_policy": { "type": "boolean" },\n "fail_on_unapproved_subprocessor": { "type": "boolean" },\n "generate_ropa_inventory": { "type": "boolean" },\n "output_ropa_file": { "type": "string" },\n "output_privacy_report": { "type": "string" }\n },\n "additionalProperties": false\n }\n },\n "additionalProperties": false\n}\n';
|
|
2831
|
-
var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-req.schema.json",\n "title": "Privacy Requirement & Technical Control Schema (PRIV-REQ-*)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "privacy-principle",\n "linddun-category",\n "governs-ropa"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "privacy-requirement"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Privacy requirement semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": ["draft", "active", "deprecated", "retired"]\n },\n "privacy-principle": {\n "type": "string",\n "enum": [\n "data-minimization",\n "purpose-limitation",\n "storage-limitation",\n "accuracy",\n "integrity-and-confidentiality",\n "transparency-and-consent",\n "data-subject-rights-arco",\n "pseudonymization-anonymization"\n ]\n },\n "linddun-category": {\n "type": "string",\n "enum": [\n "linkability",\n "identifiability",\n "non-repudiation",\n "detectability",\n "disclosure-of-information",\n "unawareness",\n "non-compliance"\n ],\n "description": "LINDDUN privacy threat category mitigated by this control."\n },\n "governs-ropa": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Upstream ROPA records (PRIV-ROPA-*) governed by this privacy requirement."\n },\n "protects-data-assets": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "enforced-in-enclave": {\n "type": "string",\n "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "compliance-references": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "acceptance-format": {\n "type": "string",\n "enum": ["gherkin", "declarative-prose"]\n },\n "cucumber-tags": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^@[a-zA-Z0-9_-]+$"\n }\n },\n "supersedes": {\n "type": ["string", "null"],\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": ["string", "null"],\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}\n';
|
|
2832
|
-
var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-ropa.schema.json",\n "title": "Record of Processing Activities Schema (PRIV-ROPA-* / GDPR Art. 30)",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "lawful-basis",\n "processing-purpose",\n "use-cases",\n "data-assets",\n "data-subjects",\n "retention-ttl"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "type": {\n "type": "string",\n "const": "privacy-ropa"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "ROPA record semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string"\n },\n "title": {\n "type": "string",\n "minLength": 3\n },\n "status": {\n "type": "string",\n "enum": ["draft", "active", "deprecated", "retired"]\n },\n "lawful-basis": {\n "type": "string",\n "enum": [\n "consent",\n "contract",\n "legal-obligation",\n "vital-interests",\n "public-task",\n "legitimate-interests"\n ],\n "description": "Lawful basis for processing under GDPR Art. 6.1."\n },\n "special-category-condition": {\n "type": ["string", "null"],\n "enum": [\n null,\n "explicit-consent",\n "employment-social-security",\n "vital-interests",\n "public-interest",\n "preventive-medicine",\n "public-health"\n ],\n "description": "GDPR Art. 9.2 condition when processing special category data."\n },\n "processing-purpose": {\n "type": "string",\n "minLength": 10\n },\n "use-cases": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Upstream Use Cases (UC-*) that trigger this data processing activity."\n },\n "data-assets": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Personal Data Assets (DATA-ASSET-*) processed in this activity."\n },\n "data-subjects": {\n "type": "array",\n "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "retention-ttl": {\n "type": "string",\n "pattern": "^([0-9]+(d|m|y)|session-only|indefinite-anonymized)$"\n },\n "cross-border-transfer": {\n "type": "boolean"\n },\n "transfer-safeguards": {\n "type": ["string", "null"],\n "enum": [null, "adequacy-decision", "scc", "bcr", "derogation"]\n },\n "subprocessors": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "dpia-required": {\n "type": "boolean"\n },\n "dpia-reference": {\n "type": ["string", "null"],\n "pattern": "^DPIA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "mitigated-by": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Privacy requirements (PRIV-REQ-*) governing and enforcing this processing activity."\n },\n "supersedes": {\n "type": ["string", "null"],\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": ["string", "null"],\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}\n';
|
|
2978
|
+
var SCHEMA_SCHEMAS_PRIVACY_DATA_ASSET_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/privacy/data-asset.schema.json",\r\n "title": "Personal Data Asset & PII Inventory Schema (DATA-ASSET-*)",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "classification",\r\n "pii-categories",\r\n "data-subjects",\r\n "retention-period",\r\n "erasure-method"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "data-asset"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Data asset semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "classification": {\r\n "type": "string",\r\n "enum": [\r\n "public",\r\n "internal",\r\n "confidential-pii",\r\n "special-category-sensitive"\r\n ],\r\n "description": "Data sensitivity classification aligned with privacy-policy.yaml."\r\n },\r\n "pii-categories": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "enum": [\r\n "identifiers",\r\n "contact",\r\n "authentication",\r\n "financial",\r\n "location",\r\n "behavioral",\r\n "biometric",\r\n "health",\r\n "telemetry-operator"\r\n ]\r\n }\r\n },\r\n "data-subjects": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Product actors (ACT-*) whose personal data is stored or processed."\r\n },\r\n "fields": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "required": ["name", "sensitivity", "masking-strategy"],\r\n "properties": {\r\n "name": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "sensitivity": {\r\n "type": "string",\r\n "enum": ["public", "internal", "pii", "special-category"]\r\n },\r\n "masking-strategy": {\r\n "type": "string",\r\n "enum": [\r\n "none",\r\n "redact",\r\n "sha256-salt",\r\n "tokenize",\r\n "aes-256-gcm",\r\n "truncate"\r\n ]\r\n }\r\n },\r\n "additionalProperties": false\r\n }\r\n },\r\n "retention-period": {\r\n "type": "string",\r\n "pattern": "^([0-9]+(d|m|y)|session-only|indefinite-anonymized)$",\r\n "description": "Maximum retention TTL (e.g. 30d, 12m, 5y, session-only, indefinite-anonymized)."\r\n },\r\n "erasure-method": {\r\n "type": "string",\r\n "enum": [\r\n "hard-delete",\r\n "crypto-shredding",\r\n "irreversible-anonymization"\r\n ]\r\n },\r\n "owner-bounded-context": {\r\n "type": "string",\r\n "pattern": "^(BC|CMP)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
2979
|
+
var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-policy.schema.json",\r\n "title": "Privacy-by-Design as Code Governance Policy Schema",\r\n "type": "object",\r\n "required": [\r\n "version",\r\n "project",\r\n "regulatory_frameworks",\r\n "default_action",\r\n "classifications",\r\n "agent_guardrails",\r\n "ci_gates"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(PRIV-POL|POL-PRIV)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "privacy-policy"\r\n },\r\n "version": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "project": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "regulatory_frameworks": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "enum": ["GDPR", "LOPDGDD", "ISO-27701", "CCPA", "HIPAA", "LGPD"]\r\n }\r\n },\r\n "default_action": {\r\n "type": "string",\r\n "enum": ["DENY_UNREGISTERED_PII", "ALLOW", "REVIEW_REQUIRED"]\r\n },\r\n "classifications": {\r\n "type": "object",\r\n "required": ["public", "internal", "confidential_pii", "special_category_sensitive"],\r\n "additionalProperties": {\r\n "type": "object",\r\n "required": ["action", "encryption_at_rest", "encryption_in_transit", "allow_in_logs", "allow_in_ai_prompts"],\r\n "properties": {\r\n "action": {\r\n "type": "string",\r\n "enum": ["ALLOW", "STRICT_GOVERNANCE", "DPIA_APPROVAL_REQUIRED", "DENY"]\r\n },\r\n "description": { "type": "string" },\r\n "exception_requires": { "type": "string" },\r\n "require_ropa_entry": { "type": "boolean" },\r\n "require_dpia_artifact": { "type": "boolean" },\r\n "encryption_at_rest": { "type": "boolean" },\r\n "encryption_in_transit": { "type": "boolean" },\r\n "require_field_level_encryption": { "type": "boolean" },\r\n "allow_in_logs": { "type": "boolean" },\r\n "log_masking_strategy": { "type": "string" },\r\n "allow_in_ai_prompts": { "type": "boolean" },\r\n "max_retention_days": { "type": "integer", "minimum": 1 },\r\n "require_right_to_erasure": { "type": "boolean" }\r\n },\r\n "additionalProperties": false\r\n }\r\n },\r\n "cross_border_transfers": {\r\n "type": "object",\r\n "properties": {\r\n "allowed_regions": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n },\r\n "require_scc_for_third_countries": { "type": "boolean" },\r\n "approved_subprocessors": {\r\n "type": "array",\r\n "items": { "type": "string" }\r\n }\r\n },\r\n "additionalProperties": false\r\n },\r\n "agent_guardrails": {\r\n "type": "object",\r\n "required": [\r\n "forbid_real_pii_in_tests",\r\n "forbid_pii_in_console_or_logger",\r\n "require_dto_projection_for_pii"\r\n ],\r\n "properties": {\r\n "forbid_real_pii_in_tests": { "type": "boolean" },\r\n "forbid_pii_in_console_or_logger": { "type": "boolean" },\r\n "require_dto_projection_for_pii": { "type": "boolean" },\r\n "on_special_category_detected": {\r\n "type": "object",\r\n "required": ["action", "notification_tag", "message"],\r\n "properties": {\r\n "action": { "type": "string" },\r\n "notification_tag": { "type": "string" },\r\n "message": { "type": "string" }\r\n },\r\n "additionalProperties": false\r\n }\r\n },\r\n "additionalProperties": false\r\n },\r\n "ci_gates": {\r\n "type": "object",\r\n "required": [\r\n "fail_on_unregistered_pii",\r\n "fail_on_pii_in_logs",\r\n "fail_on_missing_retention_policy",\r\n "generate_ropa_inventory",\r\n "output_ropa_file",\r\n "output_privacy_report"\r\n ],\r\n "properties": {\r\n "fail_on_unregistered_pii": { "type": "boolean" },\r\n "fail_on_pii_in_logs": { "type": "boolean" },\r\n "fail_on_missing_retention_policy": { "type": "boolean" },\r\n "fail_on_unapproved_subprocessor": { "type": "boolean" },\r\n "generate_ropa_inventory": { "type": "boolean" },\r\n "output_ropa_file": { "type": "string" },\r\n "output_privacy_report": { "type": "string" }\r\n },\r\n "additionalProperties": false\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
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';
|
|
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
|
|
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",
|
|
5771
|
+
["fs", "--format", "json", "--security-checks", checkTypes, rootDir],
|
|
5546
5772
|
{ encoding: "utf-8", timeout: 3e4 }
|
|
5547
5773
|
);
|
|
5548
|
-
|
|
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
|
|
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
|
|
6308
|
+
function buildSkippedVulnResult() {
|
|
6071
6309
|
return {
|
|
6072
|
-
|
|
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
|
-
|
|
6950
|
-
|
|
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
|
|
7424
|
-
|
|
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 (
|
|
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-
|
|
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")
|
|
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" },
|
|
@@ -9782,14 +10201,28 @@ function registerScannedArtifactNodes(scannedMap, nodeMap) {
|
|
|
9782
10201
|
}
|
|
9783
10202
|
}
|
|
9784
10203
|
}
|
|
10204
|
+
function ensureNodeExists(id, nodeMap, fallbackType, fallbackLayer = "product") {
|
|
10205
|
+
if (!nodeMap.has(id)) {
|
|
10206
|
+
const classification = classifyArtifactLayerAndType(id, fallbackType || "");
|
|
10207
|
+
const type = classification?.type || fallbackType || "product";
|
|
10208
|
+
const layer = classification?.layer || fallbackLayer;
|
|
10209
|
+
nodeMap.set(id, {
|
|
10210
|
+
id,
|
|
10211
|
+
label: id,
|
|
10212
|
+
title: id,
|
|
10213
|
+
type,
|
|
10214
|
+
layer,
|
|
10215
|
+
status: "COMPLIANT"
|
|
10216
|
+
});
|
|
10217
|
+
}
|
|
10218
|
+
}
|
|
9785
10219
|
function connectTargets(sourceId, rawTargets, relation, nodeMap, addEdge, defaultType, defaultLayer = "product") {
|
|
9786
10220
|
const list = Array.isArray(rawTargets) ? rawTargets : typeof rawTargets === "string" ? [rawTargets] : [];
|
|
9787
10221
|
for (const item of list) {
|
|
9788
10222
|
if (typeof item === "string" && item.trim()) {
|
|
9789
10223
|
const targetId = item.trim();
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
}
|
|
10224
|
+
ensureNodeExists(sourceId, nodeMap, defaultType, defaultLayer);
|
|
10225
|
+
ensureNodeExists(targetId, nodeMap, defaultType, defaultLayer);
|
|
9793
10226
|
addEdge({ id: `edge-${sourceId}-${targetId}`, source: sourceId, target: targetId, label: relation, relation, status: "COMPLIANT" });
|
|
9794
10227
|
}
|
|
9795
10228
|
}
|
|
@@ -9932,6 +10365,23 @@ function connectAdrRelationships(art, nodeMap, addEdge) {
|
|
|
9932
10365
|
}
|
|
9933
10366
|
}
|
|
9934
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
|
+
}
|
|
9935
10385
|
function connectEnclaveRelationships(art, nodeMap, addEdge) {
|
|
9936
10386
|
for (const sec of toList(art.frontmatter["enforced-by"])) {
|
|
9937
10387
|
const id = sec.trim();
|
|
@@ -9952,6 +10402,7 @@ var CONNECTOR_MAP = {
|
|
|
9952
10402
|
"security-requirement": connectRequirementMitigations,
|
|
9953
10403
|
"privacy-requirement": connectRequirementMitigations,
|
|
9954
10404
|
"adr": connectAdrRelationships,
|
|
10405
|
+
"bounded-context": connectBoundedContextRelationships,
|
|
9955
10406
|
"security-enclave": connectEnclaveRelationships
|
|
9956
10407
|
};
|
|
9957
10408
|
function connectArtifactRelationships(scannedMap, nodeMap, addEdge) {
|
|
@@ -9963,14 +10414,11 @@ function connectArtifactRelationships(scannedMap, nodeMap, addEdge) {
|
|
|
9963
10414
|
function updateTracesForEdge(e, nodeMap) {
|
|
9964
10415
|
const srcNode = nodeMap.get(e.source);
|
|
9965
10416
|
const tgtNode = nodeMap.get(e.target);
|
|
9966
|
-
if (srcNode)
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
if (tgtNode)
|
|
9971
|
-
tgtNode.upstream = tgtNode.upstream || [];
|
|
9972
|
-
if (!tgtNode.upstream.includes(e.source)) tgtNode.upstream.push(e.source);
|
|
9973
|
-
}
|
|
10417
|
+
if (!srcNode || !tgtNode) return;
|
|
10418
|
+
srcNode.downstream = srcNode.downstream || [];
|
|
10419
|
+
if (!srcNode.downstream.includes(e.target)) srcNode.downstream.push(e.target);
|
|
10420
|
+
tgtNode.upstream = tgtNode.upstream || [];
|
|
10421
|
+
if (!tgtNode.upstream.includes(e.source)) tgtNode.upstream.push(e.source);
|
|
9974
10422
|
}
|
|
9975
10423
|
function buildNodeElements(nodeMap, nodesByLayer) {
|
|
9976
10424
|
let conformingCount = 0;
|
|
@@ -9987,8 +10435,8 @@ function buildNodeElements(nodeMap, nodesByLayer) {
|
|
|
9987
10435
|
}
|
|
9988
10436
|
return { elements, conformingCount, issueCount };
|
|
9989
10437
|
}
|
|
9990
|
-
function buildEdgeElements(edges) {
|
|
9991
|
-
return edges.map((e) => ({
|
|
10438
|
+
function buildEdgeElements(edges, nodeMap) {
|
|
10439
|
+
return edges.filter((e) => nodeMap.has(e.source) && nodeMap.has(e.target)).map((e) => ({
|
|
9992
10440
|
group: "edges",
|
|
9993
10441
|
data: e,
|
|
9994
10442
|
classes: `relation-${e.relation} status-${e.status?.toLowerCase() || "compliant"}`
|
|
@@ -9998,12 +10446,13 @@ function assembleGraphElementsResult(nodeMap, edges, driftTargets) {
|
|
|
9998
10446
|
for (const [id, node] of nodeMap.entries()) {
|
|
9999
10447
|
if (driftTargets.has(id)) node.status = "DRIFT";
|
|
10000
10448
|
}
|
|
10001
|
-
|
|
10449
|
+
const validEdges = edges.filter((e) => nodeMap.has(e.source) && nodeMap.has(e.target));
|
|
10450
|
+
for (const e of validEdges) {
|
|
10002
10451
|
updateTracesForEdge(e, nodeMap);
|
|
10003
10452
|
}
|
|
10004
10453
|
const nodesByLayer = { product: 0, requirement: 0, architecture: 0, test: 0 };
|
|
10005
10454
|
const { elements: nodeElements, conformingCount, issueCount } = buildNodeElements(nodeMap, nodesByLayer);
|
|
10006
|
-
const edgeElements = buildEdgeElements(
|
|
10455
|
+
const edgeElements = buildEdgeElements(validEdges, nodeMap);
|
|
10007
10456
|
return {
|
|
10008
10457
|
elements: [...nodeElements, ...edgeElements],
|
|
10009
10458
|
nodesByLayer,
|
|
@@ -10464,9 +10913,24 @@ var DASHBOARD_CLIENT_SCRIPT = `
|
|
|
10464
10913
|
console.error('Cytoscape library not loaded');
|
|
10465
10914
|
return;
|
|
10466
10915
|
}
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
elements
|
|
10916
|
+
try {
|
|
10917
|
+
var validNodeIds = new Set();
|
|
10918
|
+
(elements || []).forEach(function(el) {
|
|
10919
|
+
if (el && el.group === 'nodes' && el.data && el.data.id) {
|
|
10920
|
+
validNodeIds.add(el.data.id);
|
|
10921
|
+
}
|
|
10922
|
+
});
|
|
10923
|
+
var safeElements = (elements || []).filter(function(el) {
|
|
10924
|
+
if (!el || !el.data) return false;
|
|
10925
|
+
if (el.group === 'edges') {
|
|
10926
|
+
return validNodeIds.has(el.data.source) && validNodeIds.has(el.data.target);
|
|
10927
|
+
}
|
|
10928
|
+
return true;
|
|
10929
|
+
});
|
|
10930
|
+
|
|
10931
|
+
cy = cytoscape({
|
|
10932
|
+
container: document.getElementById('cy'),
|
|
10933
|
+
elements: safeElements,
|
|
10470
10934
|
boxSelectionEnabled: false,
|
|
10471
10935
|
autoungrabify: true,
|
|
10472
10936
|
style: [
|
|
@@ -10487,6 +10951,14 @@ var DASHBOARD_CLIENT_SCRIPT = `
|
|
|
10487
10951
|
'text-max-width': '65px'
|
|
10488
10952
|
}
|
|
10489
10953
|
},
|
|
10954
|
+
{
|
|
10955
|
+
selector: 'node.layer-product',
|
|
10956
|
+
style: { 'shape': 'diamond', 'background-color': '#0e7490', 'border-color': '#38bdf8', 'width': 50, 'height': 50 }
|
|
10957
|
+
},
|
|
10958
|
+
{
|
|
10959
|
+
selector: 'node.layer-architecture',
|
|
10960
|
+
style: { 'shape': 'hexagon', 'background-color': '#4338ca', 'border-color': '#818cf8', 'width': 60, 'height': 45 }
|
|
10961
|
+
},
|
|
10490
10962
|
{
|
|
10491
10963
|
selector: 'node.type-architecture-introduction',
|
|
10492
10964
|
style: {
|
|
@@ -10592,6 +11064,19 @@ var DASHBOARD_CLIENT_SCRIPT = `
|
|
|
10592
11064
|
'height': 40
|
|
10593
11065
|
}
|
|
10594
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
|
+
},
|
|
10595
11080
|
{
|
|
10596
11081
|
selector: 'node.type-security-enclave',
|
|
10597
11082
|
style: {
|
|
@@ -10636,20 +11121,12 @@ var DASHBOARD_CLIENT_SCRIPT = `
|
|
|
10636
11121
|
'height': 32
|
|
10637
11122
|
}
|
|
10638
11123
|
},
|
|
10639
|
-
{
|
|
10640
|
-
selector: 'node.layer-product:not(.type-architecture-introduction):not(.type-journey):not(.type-actor):not(.type-use-case):not(.type-usecase):not(.type-business-rule):not(.type-rule):not(.type-abuse-case):not(.type-threat-actor):not(.type-data-asset):not(.type-privacy-ropa)',
|
|
10641
|
-
style: { 'shape': 'diamond', 'background-color': '#0e7490', 'border-color': '#38bdf8', 'width': 50, 'height': 50 }
|
|
10642
|
-
},
|
|
10643
|
-
{
|
|
10644
|
-
selector: 'node.layer-architecture:not(.type-component):not(.type-adr):not(.type-security-enclave)',
|
|
10645
|
-
style: { 'shape': 'hexagon', 'background-color': '#4338ca', 'border-color': '#818cf8', 'width': 60, 'height': 45 }
|
|
10646
|
-
},
|
|
10647
11124
|
{
|
|
10648
11125
|
selector: 'node.status-conforme, node.status-compliant',
|
|
10649
11126
|
style: { 'border-color': '#10b981' }
|
|
10650
11127
|
},
|
|
10651
11128
|
{
|
|
10652
|
-
selector: 'node.status-
|
|
11129
|
+
selector: 'node.status-orphan, node.status-drift, node.status-huerfano',
|
|
10653
11130
|
style: { 'border-color': '#ef4444', 'background-color': '#7f1d1d' }
|
|
10654
11131
|
},
|
|
10655
11132
|
{
|
|
@@ -10703,14 +11180,22 @@ var DASHBOARD_CLIENT_SCRIPT = `
|
|
|
10703
11180
|
selector: 'edge.relation-verified-by',
|
|
10704
11181
|
style: { 'line-color': '#10b981', 'target-arrow-color': '#10b981', 'width': 1.8 }
|
|
10705
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
|
+
},
|
|
10706
11191
|
{
|
|
10707
11192
|
selector: 'node.highlighted',
|
|
10708
11193
|
style: {
|
|
10709
11194
|
'border-width': 4,
|
|
10710
11195
|
'border-color': '#38bdf8',
|
|
10711
|
-
'
|
|
10712
|
-
'
|
|
10713
|
-
'
|
|
11196
|
+
'underlay-color': '#38bdf8',
|
|
11197
|
+
'underlay-padding': 4,
|
|
11198
|
+
'underlay-opacity': 0.4
|
|
10714
11199
|
}
|
|
10715
11200
|
},
|
|
10716
11201
|
{
|
|
@@ -10779,7 +11264,10 @@ var DASHBOARD_CLIENT_SCRIPT = `
|
|
|
10779
11264
|
currentHoverNodeId = null;
|
|
10780
11265
|
hideTooltip();
|
|
10781
11266
|
});
|
|
11267
|
+
} catch (err) {
|
|
11268
|
+
console.error('Error initializing Cytoscape:', err);
|
|
10782
11269
|
}
|
|
11270
|
+
}
|
|
10783
11271
|
|
|
10784
11272
|
function highlightCriticalPath(node) {
|
|
10785
11273
|
cy.elements().removeClass('highlighted dimmed');
|
|
@@ -10896,6 +11384,7 @@ var DASHBOARD_CLIENT_SCRIPT = `
|
|
|
10896
11384
|
'actor': '.type-actor, .type-threat-actor',
|
|
10897
11385
|
'use-case': '.type-use-case, .type-usecase',
|
|
10898
11386
|
'business-rule': '.type-business-rule, .type-rule',
|
|
11387
|
+
'bounded-context': '.type-bounded-context',
|
|
10899
11388
|
'abuse-case': '.type-abuse-case, .type-threat-actor',
|
|
10900
11389
|
'data-asset': '.type-data-asset',
|
|
10901
11390
|
'privacy-ropa': '.type-privacy-ropa',
|
|
@@ -11003,7 +11492,7 @@ var DASHBOARD_CLIENT_SCRIPT = `
|
|
|
11003
11492
|
nodes.connectedEdges().show();
|
|
11004
11493
|
} else {
|
|
11005
11494
|
cy.elements().hide();
|
|
11006
|
-
var nodes = cy.nodes('.status-orphan, .status-
|
|
11495
|
+
var nodes = cy.nodes('.status-orphan, .status-huerfano, .status-drift');
|
|
11007
11496
|
nodes.show();
|
|
11008
11497
|
nodes.connectedEdges().show();
|
|
11009
11498
|
}
|
|
@@ -11308,6 +11797,7 @@ var GRAPH_LEGEND_HTML = `
|
|
|
11308
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>
|
|
11309
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>
|
|
11310
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>
|
|
11311
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>
|
|
11312
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>
|
|
11313
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>
|
|
@@ -11352,7 +11842,7 @@ function renderGraphToolbarHtml() {
|
|
|
11352
11842
|
` <div class="graph-toolbar">`,
|
|
11353
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>`,
|
|
11354
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>`,
|
|
11355
|
-
` <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 & 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 & 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>`,
|
|
11356
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>`,
|
|
11357
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>`,
|
|
11358
11848
|
` <div class="tool-row"><input type="text" id="node-search" class="tool-input" placeholder="Search node ID..." oninput="searchNode(this.value)"></div>`,
|
|
@@ -12082,6 +12572,159 @@ function generateDashboardReport(options = {}) {
|
|
|
12082
12572
|
html
|
|
12083
12573
|
};
|
|
12084
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
|
+
}
|
|
12085
12728
|
|
|
12086
12729
|
// src/init/agent-templates.ts
|
|
12087
12730
|
var SPECIALIZED_AGENT_TEMPLATES = [
|
|
@@ -12187,7 +12830,7 @@ var SPECIALIZED_AGENT_TEMPLATES = [
|
|
|
12187
12830
|
- Read exclusively requirements cited in the \`handoff.yaml\` sidecar (\`HOF-*\`) and their referenced artifacts.
|
|
12188
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.
|
|
12189
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.
|
|
12190
|
-
- **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:
|
|
12191
12834
|
1. **Happy Path**: nominal user interaction with valid inputs producing the expected UI state/response.
|
|
12192
12835
|
2. **Sad Path**: error handling, invalid interactions, validation rejections, disabled/blocked states, and failure recovery.
|
|
12193
12836
|
3. **Boundary Values**: minimum/maximum lengths, numeric extremes, empty/whitespace inputs, edge selections, and rapid/repeated interactions.
|
|
@@ -14075,18 +14718,19 @@ pipelines:\r
|
|
|
14075
14718
|
- step: *build-and-verify\r
|
|
14076
14719
|
- step: *sdd-integrate\r
|
|
14077
14720
|
`;
|
|
14078
|
-
var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML = "name: CI - AI-SDLC Quality Gates & Testing\n\non:\n push:\n branches: [ main ]\n pull_request:\n branches: [ main ]\n\njobs:\n verify-and-test:\n runs-on: ubuntu-latest\n strategy:\n matrix:\n node-version: [ 18.x, 20.x, 22.x ]\n\n steps:\n - name: Checkout Code\n uses: actions/checkout@v4\n\n - name: Install pnpm\n uses: pnpm/action-setup@v4\n with:\n version: 10\n\n - name: Setup Node.js ${{ matrix.node-version }}\n uses: actions/setup-node@v4\n with:\n node-version: ${{ matrix.node-version }}\n\n - name: Install Dependencies\n run: |\n pnpm install --frozen-lockfile\n pnpm approve-builds --all\n\n - name: Build Packages\n run: pnpm run build\n\n - name: Run Vitest Unit & Integration Suites\n run: pnpm test\n\n - name: AI-SDLC Quality Gate & Full Verification\n run: npx @aisdlc/cli verify all\n";
|
|
14079
|
-
var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML = 'name: Deploy AI-SDLC Dashboard to GitHub Pages\n\non:\n push:\n branches:\n - main\n workflow_dispatch:\n\npermissions:\n contents: read\n pages: write\n id-token: write\n\nconcurrency:\n group: pages\n cancel-in-progress: false\n\njobs:\n deploy-dashboard:\n name: Build & Publish Interactive Dashboard\n runs-on: ubuntu-latest\n environment:\n name: github-pages\n url: ${{ steps.deployment.outputs.page_url }}\n\n steps:\n - name: Checkout Code\n uses: actions/checkout@v4\n with:\n fetch-depth: 0 # Full git history required for historical KPIs and telemetry\n\n - name: Setup Node.js\n uses: actions/setup-node@v4\n with:\n node-version: 20\n\n - name: Generate AI-SDLC Interactive Dashboard\n run: |\n mkdir -p reports\n npx --yes @aisdlc/cli report dashboard --output reports/index.html\n cp reports/index.html reports/dashboard.html\n touch reports/.nojekyll\n\n - name: Setup GitHub Pages\n uses: actions/configure-pages@v5\n\n - name: Upload Pages Artifact\n uses: actions/upload-pages-artifact@v3\n with:\n path: reports\n\n - name: Deploy to GitHub Pages\n id: deployment\n uses: actions/deploy-pages@v4\n\n - name: Emit Summary to GitHub Actions\n if: always() && steps.deployment.outcome == \'success\'\n run: |\n echo "### \u{1F310} AI-SDLC Interactive Dashboard Published" >> $GITHUB_STEP_SUMMARY\n echo "" >> $GITHUB_STEP_SUMMARY\n echo "The interactive PDaC / RTM graph, Quality Gate telemetry, and release metrics are live at:" >> $GITHUB_STEP_SUMMARY\n echo "" >> $GITHUB_STEP_SUMMARY\n echo "\u{1F449} **[Open Live Dashboard](${{ steps.deployment.outputs.page_url }})**" >> $GITHUB_STEP_SUMMARY\n';
|
|
14080
|
-
var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML = "name: AI-SDLC PR KPI Aggregator\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\npermissions:\n contents: read\n pull-requests: write\n\njobs:\n aggregate-kpis:\n name: Aggregate PR KPIs & Telemetry\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout Repository\n uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Install pnpm\n uses: pnpm/action-setup@v4\n with:\n version: 10\n\n - name: Setup Node.js\n uses: actions/setup-node@v4\n with:\n node-version: 20\n\n - name: Install Dependencies\n run: |\n pnpm install --frozen-lockfile\n\n - name: Calculate and Emit PR KPIs\n id: kpi\n run: |\n npx @aisdlc/cli kpi pr --base origin/${{ github.base_ref }} --head HEAD >> $GITHUB_STEP_SUMMARY\n";
|
|
14081
|
-
var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML = 'name: SDD Canonical Integration on Merge\r\n\r\non:\r\n pull_request:\r\n types: [closed]\r\n branches:\r\n - main\r\n - \'release/**\'\r\n workflow_dispatch:\r\n inputs:\r\n change_id:\r\n description: \'SDD change ID to integrate manually (e.g. chg-001-telemetry)\'\r\n required: false\r\n type: string\r\n\r\npermissions:\r\n contents: write\r\n pull-requests: read\r\n\r\nconcurrency:\r\n group: sdd-integrate-${{ github.ref }}\r\n cancel-in-progress: false\r\n\r\njobs:\r\n integrate-sdd:\r\n name: SDD Canonical Integration\r\n if: github.event.pull_request.merged == true || github.event_name == \'workflow_dispatch\'\r\n runs-on: ubuntu-latest\r\n\r\n steps:\r\n - name: Checkout Repository\r\n uses: actions/checkout@v4\r\n with:\r\n ref: ${{ github.event.pull_request.base.ref || github.ref_name }}\r\n fetch-depth: 0\r\n token: ${{ secrets.GITHUB_TOKEN }}\r\n\r\n - name: Install pnpm\r\n uses: pnpm/action-setup@v4\r\n with:\r\n version: 10\r\n\r\n - name: Setup Node.js\r\n uses: actions/setup-node@v4\r\n with:\r\n node-version: 20\r\n\r\n - name: Install Dependencies\r\n run: |\r\n pnpm install --frozen-lockfile\r\n pnpm approve-builds --all\r\n\r\n - name: Build Packages\r\n run: pnpm run build\r\n\r\n - name: Detect and Integrate SDD Change\r\n id: integrate\r\n env:\r\n PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}\r\n PR_TITLE: ${{ github.event.pull_request.title }}\r\n PR_BODY: ${{ github.event.pull_request.body }}\r\n MANUAL_CHANGE_ID: ${{ github.event.inputs.change_id }}\r\n run: |\r\n npx @aisdlc/cli sdd integrate --auto || true\r\n\r\n - name: Commit and Push Canonical Baseline Changes\r\n run: |\r\n git config user.name "github-actions[bot]"\r\n git config user.email "github-actions[bot]@users.noreply.github.com"\r\n git add -A\r\n if ! git diff --cached --quiet; then\r\n git commit -m "chore(sdd): integrate changes into canonical baseline [skip ci]"\r\n git push\r\n
|
|
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";
|
|
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';
|
|
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";
|
|
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';
|
|
14082
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';
|
|
14083
|
-
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';
|
|
14084
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';
|
|
14085
|
-
var STARTER_TEMPLATES_PRIVACY_DATA_ASSET_TEMPLATE_MD = '---\nid: DATA-ASSET-USER-PROFILE-001\ntype: data-asset\ntitle: User Profile & Identity Personal Data Asset\nstatus: draft\nversion: "1.0.0"\nschema-version: "1.0"\nclassification: confidential-pii # public, internal, confidential-pii, special-category-sensitive\npii-categories:\n - identifiers\n - contact\ndata-subjects:\n - ACT-USER-001\nfields:\n - name: email\n sensitivity: pii\n masking-strategy: sha256-salt\n - name: phone_number\n sensitivity: pii\n masking-strategy: redact\n - name: operator_callsign\n sensitivity: internal\n masking-strategy: none\nretention-period: 365d\nerasure-method: crypto-shredding\nowner-bounded-context: CMP-IDENTITY-SERVICE-001\nsupersedes: null\nsuperseded-by: null\n---\n\n# DATA-ASSET-USER-PROFILE-001: User Profile & Identity Personal Data Asset\n\n## 1. Data Asset Inventory & Purpose\nDescribes the structure, storage medium, and operational boundary of the personal data asset governed under GDPR / ISO 27701.\n\n## 2. Field-Level Sensitivity & Masking Policy\n\n| Field Name | Sensitivity | Masking / Pseudonymization Strategy | Allowed in Logs | Allowed in AI Prompts |\n| :--- | :--- | :--- | :---: | :---: |\n| `email` | `pii` | `sha256-salt` | \u274C No | \u274C No |\n| `phone_number` | `pii` | `redact` | \u274C No | \u274C No |\n| `operator_callsign` | `internal` | `none` | \u2705 Yes | \u2705 Yes |\n\n## 3. Storage Limitation & Right to Erasure (GDPR Art. 17)\n- **Maximum Retention TTL**: `365d` after account deactivation.\n- **Erasure Mechanism**: `crypto-shredding` (destruction of per-subject encryption key and PII column purge).\n\n---\n\n## 4. Revision History and Version Control\n\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\n| :--- | :--- | :--- | :--- | :--- |\n| **1.0.0** | 2026-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial personal data asset inventory | CHG-PRIV-001 |\n';
|
|
14086
|
-
var STARTER_TEMPLATES_PRIVACY_DPIA_REQUEST_TEMPLATE_MD = '---\nid: DPIA-ASSESSMENT-001\ntype: dpia-request\ntitle: Data Protection Impact Assessment (DPIA / EIPD) Request\nstatus: pending-dpo-approval # pending-dpo-approval, approved, rejected\nversion: "1.0.0"\nschema-version: "1.0"\nropa-reference: PRIV-ROPA-USER-AUTH-001\ndata-assets:\n - DATA-ASSET-USER-PROFILE-001\nspecial-category-triggers:\n - "GDPR Art. 9 Special Category Data or Automated Profiling"\nresidual-risk-level: MEDIUM # LOW, MEDIUM, HIGH\n---\n\n# Data Protection Impact Assessment (DPIA / EIPD \u2014 GDPR Art. 35)\n\n## 1. Trigger & Necessity Assessment\n- **Associated ROPA**: `PRIV-ROPA-USER-AUTH-001`\n- **Data Assets Affected**: `DATA-ASSET-USER-PROFILE-001`\n- **Why a DPIA is Mandatory**: Processing involves `special_category_sensitive` data (biometrics, health, precise geolocation) or systematic automated profiling under GDPR Art. 35.\n\n## 2. Necessity, Proportionality & LINDDUN Risk Matrix\n\n| LINDDUN Threat Category | Identified Privacy Risk | Intrinsic Risk | Technical Mitigation (`PRIV-REQ-*`) | Residual Risk |\n| :--- | :--- | :---: | :--- | :---: |\n| **Identifiability** | Re-identification of operator from telemetry streams | HIGH | `PRIV-REQ-MASKING-001` (SHA-256 salted pseudonymization) | LOW |\n| **Disclosure of Information** | Plaintext PII leakage in error logs | HIGH | `PRIV-REQ-MASKING-001` (Redaction middleware) | LOW |\n\n## 3. Mandatory Human Sovereign Signatures (DPO & Legal)\n- [ ] **Data Protection Officer (DPO)**: Necessity, proportionality, and GDPR Art. 35 validation\n- [ ] **Legal / Privacy Counsel**: Lawful basis and cross-border transfer clauses verified\n- [ ] **Security Officer (CISO) / System Architect**: Cryptographic and enclave controls verified\n';
|
|
14087
|
-
var STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD = '---\nid: PRIV-REQ-MASKING-001\ntype: privacy-requirement\ntitle: Mandatory Pseudonymization and Log Redaction of Operator PII\nstatus: draft\nversion: "1.0.0"\nschema-version: "1.0"\nprivacy-principle: data-minimization # data-minimization, purpose-limitation, storage-limitation, accuracy, integrity-and-confidentiality, transparency-and-consent, data-subject-rights-arco, pseudonymization-anonymization\nlinddun-category: identifiability # linkability, identifiability, non-repudiation, detectability, disclosure-of-information, unawareness, non-compliance\ngoverns-ropa:\n - PRIV-ROPA-USER-AUTH-001\nprotects-data-assets:\n - DATA-ASSET-USER-PROFILE-001\nenforced-in-enclave: SEC-ENC-DMZ-001\ncompliance-references:\n - "GDPR-Art-25-Privacy-by-Design"\n - "GDPR-Art-32-Pseudonymization"\n - "ISO-27701-A.7.4"\nacceptance-format: gherkin\ncucumber-tags:\n - "@PRIV-REQ-MASKING-001"\n - "@privacy"\n - "@linddun"\nsupersedes: null\nsuperseded-by: null\n---\n\n# PRIV-REQ-MASKING-001: Mandatory Pseudonymization and Log Redaction of Operator PII\n\n## 1. Technical Privacy Control Statement\nThe system MUST pseudonymize or redact all `confidential-pii` fields (`email`, `phone_number`) prior to emitting structured application logs, telemetry traces, or external AI prompts, and MUST enforce automated TTL purge after `365d`.\n\n---\n\n## 2. Upstream Privacy Traceability (PDaC)\n\n| Dimension | Link / Artifact | Relationship Type | Status |\n| :--- | :--- | :--- | :--- |\n| **Record of Processing (ROPA)** | `PRIV-ROPA-USER-AUTH-001` | Governs Processing Activity | Validated |\n| **Protected Data Asset** | `DATA-ASSET-USER-PROFILE-001` | Enforces Field Masking & TTL | Validated |\n\n---\n\n## 3. Privacy Verification Criteria in Gherkin Format (Cucumber Privacy Tests)\n\n```gherkin\n@PRIV-REQ-MASKING-001 @privacy @linddun\nFeature: Personal Data Pseudonymization and Zero-PII Telemetry Logging\n As a Data Protection Officer (DPO)\n I want all personal identifiers to be redacted or salted-hashed before logging\n So that application logs and telemetry never expose raw personal data\n\n Scenario: Structured logger redacts PII fields automatically (Nominal Privacy Control)\n Given an authenticated operator session with email "operator@example.com" and phone "+34600112233"\n When the telemetry ingestion service emits an audit log entry\n Then the serialized log payload must not contain the literal string "operator@example.com"\n And the serialized log payload must not contain the literal string "+34600112233"\n And the email field must be replaced by a deterministic SHA-256 salted pseudonym\n\n Scenario: Right to erasure purges expired or revoked subject records\n Given a personal data record for subject "ACT-USER-001" exceeding the "365d" retention TTL\n When the automated retention enforcement job executes\n Then the personal data fields must be irreversibly erased via crypto-shredding\n```\n\n---\n\n## 4. Revision History and Version Control\n\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\n| :--- | :--- | :--- | :--- | :--- |\n| **1.0.0** | 2026-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial privacy control specification | CHG-PRIV-001 |\n';
|
|
14088
|
-
var STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD = '---\nid: PRIV-ROPA-USER-AUTH-001\ntype: privacy-ropa\ntitle: Record of Processing Activity for Operator Authentication and Session Audit\nstatus: draft\nversion: "1.0.0"\nschema-version: "1.0"\nlawful-basis: contract # consent, contract, legal-obligation, vital-interests, public-task, legitimate-interests\nspecial-category-condition: null\nprocessing-purpose: "Authenticate authorized operators and maintain tamper-evident operational session audit trails."\nuse-cases:\n - UC-ACTION-001\ndata-assets:\n - DATA-ASSET-USER-PROFILE-001\ndata-subjects:\n - ACT-USER-001\nretention-ttl: 365d\ncross-border-transfer: false\ntransfer-safeguards: null\nsubprocessors: []\ndpia-required: false\ndpia-reference: null\nmitigated-by:\n - PRIV-REQ-MASKING-001\nsupersedes: null\nsuperseded-by: null\n---\n\n# PRIV-ROPA-USER-AUTH-001: Record of Processing Activity (GDPR Art. 30)\n\n## 1. Processing Activity Summary & Lawful Basis\n- **Lawful Basis (GDPR Art. 6.1)**: `contract` \u2014 Necessary for the performance of the operator service agreement.\n- **Purpose of Processing**: Authenticate authorized operators and maintain tamper-evident operational session audit trails.\n\n## 2. Linked Product & Data Artifacts\n\n| Dimension | Artifact ID | Relationship |\n| :--- | :--- | :--- |\n| **Triggering Use Cases** | `UC-ACTION-001` | Initiates personal data collection/processing |\n| **Data Assets Processed** | `DATA-ASSET-USER-PROFILE-001` | Personal data fields subject to minimization |\n| **Data Subjects** | `ACT-USER-001` | Natural persons whose data is processed |\n| **Governing Privacy Controls** | `PRIV-REQ-MASKING-001` | Technical privacy-by-design controls |\n\n## 3. International Transfers & Subprocessors\n- **Cross-Border Transfer Outside EEA**: `false`\n- **Authorized Subprocessors**: None (In-house processing within `SEC-ENC-DMZ-001`).\n\n---\n\n## 4. Revision History and Version Control\n\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\n| :--- | :--- | :--- | :--- | :--- |\n| **1.0.0** | 2026-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial GDPR Art. 30 ROPA entry | CHG-PRIV-001 |\n';
|
|
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';
|
|
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';
|
|
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';
|
|
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';
|
|
14089
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';
|
|
14090
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';
|
|
14091
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';
|
|
14092
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';
|
|
@@ -14096,10 +14740,10 @@ var STARTER_TEMPLATES_PRODUCT_USER_DESIGN_FEEDBACK_TEMPLATE_MD = '---\r\nid: UFB
|
|
|
14096
14740
|
var STARTER_TEMPLATES_SAFETY_HAZARD_TEMPLATE_MD = '---\r\nid: HAZ-NAME-001\r\ntype: hazard\r\ntitle: Descriptive Operational Hazard Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nseverity: critical # catastrophic, critical, major, minor, negligible\r\nprobability: remote # frequent, probable, occasional, remote, improbable, extremely-improbable\r\nfault-tolerance-time-ms: 250 # FTTI: Fault tolerance time interval in milliseconds\r\n\r\n# Safety requirements mitigating this hazard (Downstream)\r\nmitigated-by:\r\n - SAF-REQ-NAME-001\r\n\r\nhazardous-condition: "Description of the anomalous operational condition or failure generating the hazard."\r\npotential-effect: "Loss of operational control, structural damage, or unintended collision."\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# HAZ-NAME-001: Descriptive Operational Hazard Title\r\n\r\n## 1. Operational Hazard Definition\r\nDetailed and concise description of the unintended operational condition representing a risk to the mission, the system, or the physical environment.\r\n\r\n## 2. Severity and Probability Classification\r\n\r\n| Parameter | Classification | Technical Justification |\r\n| :--- | :--- | :--- |\r\n| **Severity** | `critical` | Potential significant damage to aircraft or mission without direct human casualty. |\r\n| **Probability** | `remote` | Estimated failure rate $< 10^{-5}$ per nominal operating hour. |\r\n| **FTTI (Fault Tolerance)** | `250 ms` | Maximum time window to transition to safe state prior to adverse effects. |\r\n\r\n## 3. Triggering Conditions and Effects\r\n\r\n### Anomalous Condition\r\nDetail the initiating event (sensor failure, link loss, CAN bus freeze, or actuator degradation).\r\n\r\n### Potential Effect\r\nDirect consequence if the failure is not detected and mitigated within the FTTI interval.\r\n\r\n---\r\n\r\n## 4. Mitigation Traceability (Downstream Safety Requirements)\r\n\r\n| Safety Requirement | Fail-Safe Action | Mitigation Status |\r\n| :--- | :--- | :--- |\r\n| `SAF-REQ-NAME-001` | Contingency maneuver or transition to safe state | Designed |\r\n\r\n---\r\n\r\n## 5. Revision History\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-23 | Safety Engineer | Initial hazard definition creation | CHG-INIT-001 |\r\n';
|
|
14097
14741
|
var STARTER_TEMPLATES_SAFETY_SAFETY_REQ_TEMPLATE_MD = '---\r\n# Valid prefixes: SAF-REQ- (Safety Requirement / Operational Safety)\r\nid: SAF-REQ-NAME-001\r\ntype: safety-requirement\r\ntitle: Concise Safety Requirement Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nsafety-domain: flight-control # flight-control, collision-avoidance, energy-management, emergency-recovery, sensor-integrity\r\nsafety-integrity-level: "DAL-B" # DO-178C (DAL-A/B/C/D), ISO 26262 (ASIL-A/B/C/D), IEC 61508 (SIL-1/2/3/4)\r\n\r\n# 1. HAZARD AND RISK ANALYSIS TRACEABILITY (Upstream)\r\nmitigates-hazard:\r\n - HAZ-DESCRIPTION-001\r\n\r\nfail-safe-action: "SAFE_STATE_ACTION" # e.g. RETURN_TO_HOME, CONTROLLED_LANDING, MOTOR_CUTOFF\r\nfault-tolerance-time-ms: 100 # Maximum fault tolerance time interval (FTTI) before entering safe state\r\n\r\n# 2. VERIFICATION METHOD AND CRITERIA\r\nacceptance-format: gherkin\r\ncucumber-tags:\r\n - "@SAF-REQ-NAME-001"\r\n - "@safety"\r\n - "@failsafe"\r\n\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# SAF-REQ-NAME-001: Concise Safety Requirement Title\r\n\r\n## 1. Normative Operational Safety Statement\r\nThe system MUST [unambiguous description of defensive behavior preventing a hazard or mitigating unintended loss of control]. If [anomalous condition or hardware/sensor failure], the system MUST transition to safe state `SAFE_STATE_ACTION` within [X] milliseconds.\r\n\r\n---\r\n\r\n## 2. Hazard Mitigation and Fault Tolerance Matrix\r\n\r\n| Dimension | Link / Artifact | Relationship Type | Status |\r\n| :--- | :--- | :--- | :--- |\r\n| **Hazard Analysis (Upstream)** | `HAZ-DESCRIPTION-001` | Loss / Accident Mitigation | Validated |\r\n| **Integrity Level (SIL/DAL)** | `DAL-B` | Critical Software Level | Compliant |\r\n| **Fail-Safe Action** | `SAFE_STATE_ACTION` | Emergency Transition | Verified |\r\n\r\n---\r\n\r\n## 3. Mitigation Criteria in Gherkin Format (Safety & Fail-Safe Tests)\r\n\r\n```gherkin\r\n@SAF-REQ-NAME-001 @safety @failsafe\r\nFeature: Operational Failure Mitigation and Safe State Transition\r\n As an Autonomous Flight Control System\r\n I want to detect critical anomalies and execute contingency maneuvers\r\n So that I prevent accidents, collisions, and safeguard physical safety\r\n\r\n Scenario: Anomalous condition detection and safe state activation\r\n Given the system is in nominal operation\r\n When an unrecoverable failure condition occurs\r\n Then the system must detect the anomaly in less than 100 milliseconds\r\n And abort the current trajectory\r\n And execute contingency maneuver "SAFE_STATE_ACTION"\r\n And emit a critical alert to the ground control station\r\n```\r\n\r\n---\r\n\r\n## 4. Revision History\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-15 | Safety Engineer | Initial safety requirement creation | CHG-INIT-001 |\r\n';
|
|
14098
14742
|
var STARTER_TEMPLATES_SDD_DESIGN_TEMPLATE_MD = '---\r\nid: DSG-CHG-NAME-001\r\ntype: spec-design\r\nchange-id: CHG-NAME-001\r\ntitle: "Technical Design: Concise Delivery Increment Title"\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nhandoff: "HOF-CHG-NAME-001"\r\narchitecture-component: "CMP-NAME-001"\r\nenclave: "SEC-ENC-DMZ"\r\nstatus: draft\r\ncontracts:\r\n - component: "CMP-NAME-001"\r\n interface: "FeatureService"\r\n methods:\r\n - "executeAction"\r\n - "validateInput"\r\ncitations:\r\n - id: "UC-ACTION-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Use case driving this increment."\r\n - id: "FR-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Associated functional requirement."\r\n---\r\n\r\n# Technical Design: CHG-NAME-001\r\n\r\n## 1. Architectural Mapping and Zero Trust Enclave\r\nDefines the associated architectural component and corresponding security enclave.\r\n\r\n## 2. Data Contracts and Interfaces\r\nDetails interfaces, DTOs, TypeScript types, or data schemas.\r\n\r\n## 3. Error Handling and Mitigation Protocols\r\nSpecifies exception handling, error codes, and failure responses.\r\n\r\n## 4. License Policy Compliance (`license-policy.yaml`)\r\nLists external libraries or dependencies and confirms compatibility with the license policy.\r\n\r\n## 5. Revision History\r\n\r\n| Version | Date | Author | Change Description | Reference |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | YYYY-MM-DD | Author Name | Initial formal technical design | CHG-NAME-001 |\r\n';
|
|
14099
|
-
var STARTER_TEMPLATES_SDD_HANDOFF_TEMPLATE_YAML = '# ==============================================================================\r\n# AI-SDLC: PDaC Handoff Sidecar Template\r\n# Identifier emitted by PDaC for SDD workspace (OpenSpec / Spec Kit)\r\n# ==============================================================================\r\n\r\nid: HOF-CHG-001-FEATURE-NAME\r\ntype: handoff\r\ntitle: "Canonical Product Handoff for Delivery Increment"\r\nchangeId: CHG-001-FEATURE-NAME\r\nversion: "1.0.0"\r\ncreatedAt: "2026-09-14T00:00:00.000Z"\r\n\r\n# Product subgraph formally delivered to the SDD increment\r\nsubgraph:\r\n useCases:\r\n - UC-STREAM-TELEMETRY\r\n requirements:\r\n - FR-TELEMETRY-STREAM-001\r\n - QR-LATENCY-REALTIME\r\n securityRequirements:\r\n - SEC-REQ-MTLS-STREAM\r\n businessRules:\r\n - BR-TELEMETRY-VALIDITY\r\n abuseCases:\r\n - ABUSE-TELEMETRY-SPOOFING\r\n actors:\r\n - ACT-AUTONOMOUS-UAV\r\n - ACT-DRONE-OPERATOR\r\n - ACT-THREAT-SPOOFER\r\n\r\n# Cryptographic citations with immutable digests for drift detection\r\ncitations:\r\n - id: UC-STREAM-TELEMETRY\r\n digest: "sha256:5e5818cf2cc6d489f5d1b23cd4b61afac715cfc57a68fd44915b4adccd569cb8"\r\n comment: "Use case defining the continuous streaming flow"\r\n - id: FR-TELEMETRY-STREAM-001\r\n digest: "sha256:ad9e72840757ec009a610093476ea485c57dbb7cacb515ea27e8c8c153352e27"\r\n comment: "Functional requirement for telemetry ingestion"\r\n - id: SEC-REQ-MTLS-STREAM\r\n digest: "sha256:57f0c2ad1059aafdb6b3c140c074abbe8ee6f6c61e9733c69454f1551ed3397d"\r\n comment: "Mandatory mutual authentication via client certificates"\r\n';
|
|
14743
|
+
var STARTER_TEMPLATES_SDD_HANDOFF_TEMPLATE_YAML = '# ==============================================================================\r\n# AI-SDLC: PDaC Handoff Sidecar Template\r\n# Identifier emitted by PDaC for SDD workspace (OpenSpec / Spec Kit)\r\n# ==============================================================================\r\n\r\nid: HOF-CHG-001-FEATURE-NAME\r\ntype: handoff\r\ntitle: "Canonical Product Handoff for Delivery Increment"\r\nchangeId: CHG-001-FEATURE-NAME\r\nversion: "1.0.0"\r\ncreatedAt: "2026-09-14T00:00:00.000Z"\r\n\r\n# Product subgraph formally delivered to the SDD increment\r\nsubgraph:\r\n useCases:\r\n - UC-STREAM-TELEMETRY\r\n requirements:\r\n - FR-TELEMETRY-STREAM-001\r\n - QR-LATENCY-REALTIME\r\n securityRequirements:\r\n - SEC-REQ-MTLS-STREAM\r\n privacyRequirements:\r\n - PRIV-REQ-MASKING-001\r\n dataAssets:\r\n - DATA-ASSET-PILOT-IDENTITY\r\n privacyRopa:\r\n - PRIV-ROPA-FLIGHT-LOGS\r\n businessRules:\r\n - BR-TELEMETRY-VALIDITY\r\n abuseCases:\r\n - ABUSE-TELEMETRY-SPOOFING\r\n actors:\r\n - ACT-AUTONOMOUS-UAV\r\n - ACT-DRONE-OPERATOR\r\n - ACT-THREAT-SPOOFER\r\n\r\n# Cryptographic citations with immutable digests for drift detection\r\ncitations:\r\n - id: UC-STREAM-TELEMETRY\r\n digest: "sha256:5e5818cf2cc6d489f5d1b23cd4b61afac715cfc57a68fd44915b4adccd569cb8"\r\n comment: "Use case defining the continuous streaming flow"\r\n - id: FR-TELEMETRY-STREAM-001\r\n digest: "sha256:ad9e72840757ec009a610093476ea485c57dbb7cacb515ea27e8c8c153352e27"\r\n comment: "Functional requirement for telemetry ingestion"\r\n - id: SEC-REQ-MTLS-STREAM\r\n digest: "sha256:57f0c2ad1059aafdb6b3c140c074abbe8ee6f6c61e9733c69454f1551ed3397d"\r\n comment: "Mandatory mutual authentication via client certificates"\r\n - id: PRIV-REQ-MASKING-001\r\n digest: "sha256:606e9ec19d675681ce265aa667367de76629ae7067d710e20f121d5c2e276f82"\r\n comment: "Personal data pseudonymization and telemetry redaction"\r\n';
|
|
14100
14744
|
var STARTER_TEMPLATES_SDD_PROPOSAL_TEMPLATE_MD = '---\r\nid: CHG-NAME-001\r\ntype: spec-change-proposal\r\ntitle: Concise Delivery Increment Title\r\nstatus: draft # draft, review, approved, applied\r\nauthor: "agent-developer / human-dev"\r\ncitations:\r\n - id: "UC-ACTION-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Use case driving this increment."\r\n - id: "SEC-REQ-CONTROL-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Mandatory security requirement to implement."\r\n - id: "CMP-NAME-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Architectural component housing the change."\r\n---\r\n\r\n# Change Proposal: CHG-NAME-001\r\n\r\n## 1. Motivation and Scope\r\nExplains the problem solved by this increment and what parts of the codebase will be modified.\r\n\r\n## 2. Evaluated External Dependencies\r\n- List of new dependencies to be added and license verification per `license-policy.yaml`.\r\n';
|
|
14101
14745
|
var STARTER_TEMPLATES_SDD_PULL_REQUEST_TEMPLATE_MD = '---\r\nid: PR-TEMPLATE-SDD-001\r\ntype: pull-request-template\r\ntitle: "Modular AI-SDLC Pull Request Template"\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nstatus: active\r\ndescription: "Institutional template for monitoring weak points and plan balance (X/O) in SDD deliveries"\r\n---\r\n\r\n# Pull Request: [TIER] - [CHANGE-ID] - Brief Title\r\n\r\n## 1. SDD Identification and Traceability\r\n\r\n- **SDD Change Specification**: `specs/changes/active/<change-id>/`\r\n- **PDaC Handoff Sidecar**: `specs/changes/active/<change-id>/handoff.yaml` (ID: `HOF-*`)\r\n- **Git Hierarchy Tier (4 Tiers)**:\r\n - [ ] Tier 4: `task/<PARENT-ID>/<TSK-ID>-<slug>` \u2794 `feat/<PARENT-ID>-<slug>`\r\n - [ ] Tier 3: `feat/<FEAT-ID>-<slug>` \u2794 `release/vX.Y.Z`\r\n - [ ] Tier 2: `release/vX.Y.Z` \u2794 `main`\r\n- **Linked Issues**: Closes #... / Refs #...\r\n\r\n---\r\n\r\n## 2. \u{1F4CB} Plan Execution Matrix and Testing Status (`X` vs `O`)\r\n\r\n> [!IMPORTANT]\r\n> **Non-Negotiable Total Exhaustiveness Rule**:\r\n> This table must include **each and every item identified for implementation** in the delivery plan (originating from `tasks.md`, the SDD specification, or issue criteria), without omitting any or creating abstract groupings.\r\n>\r\n> **Mandatory Marking Convention**:\r\n> - **`[X]` (Completed and Tested)**: Item is 100% implemented and has verifiable automated tests on disk (`tests/` or `.feature`) passing green.\r\n> - **`[O]` (Problem / Blocked)**: If there was any issue, technical limitation, failing test, or deferred scope, it must be marked with `[O]` and **full mandatory justification is required**:\r\n> 1. **Technical root cause** or encountered limitation.\r\n> 2. **Impact** on increment or system.\r\n> 3. **Mitigation** or rationale for deferral.\r\n> 4. **Formal reference** to tracking issue (GitHub Issue or `ADR-TECH-DEBT-*`).\r\n>\r\n> *Any PR with omitted planned items or unjustified `[O]` will be immediately blocked and rejected by the Tech Lead.*\r\n\r\n| Task / Item ID | Planned Description | Status (`[X]` / `[O]`) | Test Evidence on Disk or Mandatory Justification of `[O]` |\r\n| :--- | :--- | :---: | :--- |\r\n| `TSK-001` | <!-- e.g. Contract DTOs and Interfaces Definition --> | **[X]** | Covered in `tests/unit/dto.spec.ts` (100% pass) |\r\n| `TSK-002` | <!-- e.g. Network disconnection resilience --> | **[O]** | **Root cause:** TCP socket mock exhibits race conditions in CI.<br>**Impact:** Low in prod, flaky test.<br>**Mitigation:** Temporary extended timeout; tracked in issue #... |\r\n\r\n---\r\n\r\n## 3. \u{1F5FA}\uFE0F Weak Points Map and Risk Hotspots (Weak Points Hotspots)\r\n\r\n### A. Complexity Hotspots\r\n<!-- Record functions nearing quality-policy.yaml thresholds: CC > 7 (max 10), Cognitive > 10 (max 15), LOC > 30 (max 40), MI < 70 (min 50/65) -->\r\n| File | Function / Module | Metrics (CC / Cognitive / LOC / MI) | Technical Maintainability Justification |\r\n| :--- | :--- | :---: | :--- |\r\n| <!-- e.g. src/engine.ts --> | <!-- parsePayload() --> | CC: 8, Cog: 11, LOC: 32, MI: 72 | Deterministic parser without recursion; exhaustively tested. |\r\n\r\n### B. Edge Cases and Blind Spots\r\n<!-- Scenarios not covered by automated unit tests (concurrency, network timeouts, memory, jitter) -->\r\n- [ ] **Edge Case 1**: <!-- Scenario description, estimated risk, and operational mitigation -->\r\n- [ ] **Edge Case 2**: <!-- Scenario description, estimated risk, and operational mitigation -->\r\n\r\n### C. AI Assumptions\r\n<!-- Behaviors or heuristics assumed by the agent during implementation that require critical human review -->\r\n- [ ] **Assumption 1**: <!-- e.g. Assumed payload always arrives pre-parsed in UTF-8 -->\r\n- [ ] **Assumption 2**: <!-- e.g. Default timeout set to 5000ms as not stipulated in spec -->\r\n\r\n---\r\n\r\n## 4. \u{1F6E1}\uFE0F Attack Surface and Cybersecurity (STRIDE / Zero Trust)\r\n\r\n- [ ] **New External Channels**: Does it introduce HTTP endpoints, sockets, IPC channels, or brokers?\r\n- [ ] **Sanitization and Inputs**: Are all external inputs validated with strict typing schemas (Zod/JSON Schema)?\r\n- [ ] **Insecure Serialization**: Is polymorphic deserialization or dynamic code evaluation avoided?\r\n- [ ] **Secrets and Enclaves**: Are cryptographic keys, credentials, sensitive env vars, or enclaves (`SEC-ENC-*`) handled?\r\n- [ ] **Mitigated Security Requirements**: Implemented IDs (e.g. `SEC-REQ-*`) and associated tests (`SEC-TEST-*` or `.feature`).\r\n\r\n---\r\n\r\n## 5. \u{1F4E6} Dependencies and Licenses Inspection\r\n\r\n- **New Dependencies Added**:\r\n | Package | Version | License Type | `license-policy.yaml` Verification |\r\n | :--- | :---: | :---: | :---: |\r\n | <!-- e.g. zod --> | <!-- ^3.22.4 --> | <!-- MIT --> | <!-- \u2714 Compliant (Permissive) --> |\r\n- [ ] Zero dependencies with prohibited licenses (GPLv3/AGPL/unapproved commercial).\r\n- [ ] Verification executed successfully (`pnpm run verify:licenses`).\r\n\r\n---\r\n\r\n## 6. \u2705 Deterministic Pre-Flight Checklist (Release Gates)\r\n\r\n- [ ] **Strict Typing and Linter**: `pnpm run typecheck` (zero errors, zero unjustified suppressions).\r\n- [ ] **Quality Gate**: `pnpm run verify:quality` (CC $\\le 10$, Cognitive $\\le 15$, MI $\\ge 50$, LOC $\\le 40$).\r\n- [ ] **BDD / Unit Tests**: `pnpm run verify:testing` (Gherkin scenarios synchronized and 100% passing).\r\n- [ ] **360\xB0 Traceability**: `pnpm run verify:traceability` (no orphan requirements).\r\n- [ ] **Open Source Licenses**: `pnpm run verify:licenses` (strict policy compliance).\r\n- [ ] **Schema Compliance**: `pnpm run verify:schemas` (100% of artifacts conform to JSON Schema).\r\n- [ ] **Full Test Suite**: `pnpm run test:all` / `pnpm run verify:all` (general green CI approval).\r\n\r\n---\r\n\r\n## 7. \u{1F6A8} Contingency Plan, Observability, and Rollback\r\n\r\n- **Observability Metrics and Alarms**: <!-- What metrics (p99 latency, 5xx error rate, memory) or logs should be monitored post-deployment? -->\r\n- **Rollback Procedure**: <!-- Exact command or procedure to revert change without collateral impact (e.g. git revert -m 1 <sha>) -->\r\n\r\n---\r\n\r\n## 8. \u{1F4CA} AI-SDLC: Aggregated KPIs Summary\r\n\r\n<!-- AI-SDLC-KPI-SUMMARY-START -->\r\n| Metric | Human | Total PR |\r\n| :--- | :---: | :---: |\r\n| **Commits Made** | - | **-** |\r\n| **Lines Added / Modif.** | - | **-** |\r\n| **Active Development Time** | - | **-** |\r\n| **Consumed Tokens (In+Out)** | - | **-** |\r\n| **Estimated Cost (\u20AC/$)** | \u2014 (Labor) | **-** |\r\n\r\n> *This block is updated automatically via `aisdlc kpi pr` or the CI workflow.*\r\n<!-- AI-SDLC-KPI-SUMMARY-END -->\r\n';
|
|
14102
|
-
var STARTER_TEMPLATES_SDD_SPEC_TEMPLATE_MD = '---\r\nid: SPEC-CHG-NAME-001\r\ntype: delivery-spec\r\nchange-id: CHG-NAME-001\r\nprofile: standard # standard, patch, critical\r\nhandoff: HOF-CHG-NAME-001\r\nacceptance-format: gherkin\r\ncucumber-tags:\r\n - "@CHG-NAME-001"\r\n - "@automated"\r\ncitations:\r\n - id: "UC-ACTION-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Canonical use case driving or impacted by this increment."\r\n - id: "FR-NAME-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Formal functional requirement in canonical catalog."\r\n - id: "ACT-ACTOR-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Primary actor participating in the capability."\r\n - id: "CMP-NAME-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Architectural component implementing the specification."\r\n - id: "SEC-REQ-CONTROL-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Mandatory security requirement to implement."\r\n---\r\n\r\n# Delivery Specification: CHG-NAME-001\r\n\r\n## 1. Catalog Scope and Traceability (Canonical Alignment)\r\n\r\n> **MANDATORY SPECIFICATION RULE (ZERO AMBIGUITY / 360\xB0 TRACEABILITY):** \r\n> Every delivery increment (`spec.md`) MUST explicitly declare the exact boundaries of its impact across the canonical catalog (`product/`, `security/`, and `architecture/`). \r\n> An increment cannot author code or tests for unmapped behaviors. It must explicitly declare:\r\n> - **Affected Existing Catalog Items:** Existing functional requirements (`FR-*`), use cases (`UC-*`), actors (`ACT-*`), business rules (`BR-*`), security requirements (`SEC-REQ-*`), or architecture components/ADRs (`CMP-*`, `ADR-*`, `SRV-*`) whose behavior, contracts, or constraints are modified or deprecated.\r\n> - **New Catalog Items Introduced:** Any new functional requirements, use cases, actors, architecture decisions,
|
|
14746
|
+
var STARTER_TEMPLATES_SDD_SPEC_TEMPLATE_MD = '---\r\nid: SPEC-CHG-NAME-001\r\ntype: delivery-spec\r\nchange-id: CHG-NAME-001\r\nprofile: standard # standard, patch, critical\r\nhandoff: HOF-CHG-NAME-001\r\nacceptance-format: gherkin\r\ncucumber-tags:\r\n - "@CHG-NAME-001"\r\n - "@automated"\r\ncitations:\r\n - id: "UC-ACTION-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Canonical use case driving or impacted by this increment."\r\n - id: "FR-NAME-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Formal functional requirement in canonical catalog."\r\n - id: "ACT-ACTOR-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Primary actor participating in the capability."\r\n - id: "CMP-NAME-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Architectural component implementing the specification."\r\n - id: "SEC-REQ-CONTROL-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Mandatory security requirement to implement."\r\n - id: "PRIV-REQ-MASKING-001"\r\n digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"\r\n comment: "Mandatory privacy control for PII pseudonymization and data minimization."\r\n---\r\n\r\n# Delivery Specification: CHG-NAME-001\r\n\r\n## 1. Catalog Scope and Traceability (Canonical Alignment)\r\n\r\n> **MANDATORY SPECIFICATION RULE (ZERO AMBIGUITY / 360\xB0 TRACEABILITY):** \r\n> Every delivery increment (`spec.md`) MUST explicitly declare the exact boundaries of its impact across the canonical catalog (`product/`, `security/`, `privacy/`, and `architecture/`). \r\n> An increment cannot author code or tests for unmapped behaviors. It must explicitly declare:\r\n> - **Affected Existing Catalog Items:** Existing functional requirements (`FR-*`), use cases (`UC-*`), actors (`ACT-*`), business rules (`BR-*`), security requirements (`SEC-REQ-*`), privacy requirements (`PRIV-REQ-*`), data assets (`DATA-ASSET-*`), ROPA entries (`PRIV-ROPA-*`), or architecture components/ADRs (`CMP-*`, `ADR-*`, `SRV-*`) whose behavior, contracts, or constraints are modified or deprecated.\r\n> - **New Catalog Items Introduced:** Any new functional requirements, use cases, actors, architecture decisions, security rules, or privacy controls created by this increment, identifying their proposed IDs and target catalog destination.\r\n\r\n### 1.1 Affected Existing Catalog Items (Modifications / Deprecations)\r\n\r\n| Catalog Category | Catalog ID | Action (`MODIFIED` / `DEPRECATED`) | Description of Delta & Behavioral Impact |\r\n| :--- | :--- | :--- | :--- |\r\n| Functional Requirement | `FR-EXISTING-001` | `MODIFIED` | Extends validation rules to support batch payload ingestion |\r\n| Use Case | `UC-EXISTING-001` | `MODIFIED` | Adds alternative execution path for handling throttling limits |\r\n| Actor / Persona | `ACT-EXISTING-001` | `MODIFIED` | Expands authorization scope to access batch processing endpoints |\r\n| Architecture / Component | `CMP-CORE-001` | `MODIFIED` | Ingestion pipeline updated to support non-blocking asynchronous dispatch |\r\n| Privacy Requirement | `PRIV-REQ-EXISTING-001` | `MODIFIED` | Restricts telemetry retention period from 730d to 365d |\r\n\r\n### 1.2 New Catalog Items Introduced (Additions)\r\n\r\n| Catalog Category | Proposed ID | Target Catalog Location | Formal Scope & Functional Contract |\r\n| :--- | :--- | :--- | :--- |\r\n| Functional Requirement | `FR-NEW-001` | `product/requirements/` | Automated cryptographic signature verification for incoming telemetry |\r\n| Use Case | `UC-NEW-001` | `product/use-cases/` | End-to-end telemetry subscription and streaming workflow |\r\n| Actor / Persona | `ACT-NEW-001` | `product/actors/` | External third-party auditor agent role |\r\n| Architecture Decision / Component | `ADR-005` / `CMP-NEW-001` | `architecture/` | Token bucket sliding-window rate limiting engine |\r\n| Security Requirement | `SEC-REQ-NEW-001` | `security/requirements/` | Enforce mutual TLS (mTLS) with client certificate validation |\r\n| Privacy Requirement | `PRIV-REQ-NEW-001` | `privacy/requirements/` | Mandatory pseudonymization of pilot operator personal identifiers |\r\n| Personal Data Asset | `DATA-ASSET-NEW-001` | `privacy/assets/` | Inventory record for operator session tokens and geolocation |\r\n\r\n---\r\n\r\n## 2. Requirement Deltas and Formal Contracts\r\n\r\nFor each affected or new catalog item declared above, define the concrete functional delta:\r\n\r\n### [FR-NAME-001 / FR-NEW-001]: [Requirement Title]\r\n* **Operation:** `[ADDED | MODIFIED | DEPRECATED]`\r\n* **Primary Actor(s):** `ACT-ACTOR-001`\r\n* **Associated Use Case(s):** `UC-ACTION-001`\r\n* **Architectural Scope:** `CMP-NAME-001` (Security Enclave: `SEC-ENC-DMZ`)\r\n* **Behavioral Contract (Delta Specification):**\r\n * **Baseline (Before):** Describes previous behavior or states "None (New requirement)".\r\n * **Target Delta (After):** Explicit behavioral specification of the new or altered behavior.\r\n\r\n---\r\n\r\n## 3. Functional Behavior Scenarios (BDD Gherkin)\r\n\r\n```gherkin\r\n@CHG-NAME-001 @FR-NAME-001 @UC-ACTION-001 @functional @automated\r\nFeature: Delivery Specification CHG-NAME-001\r\n As a [primary actor / system role: ACT-ACTOR-001]\r\n I want [functional capability delivered by this change: FR-NAME-001]\r\n So that [expected business value or outcome]\r\n\r\n Background:\r\n Given the system is in a nominal operational state\r\n And dependent services are available\r\n\r\n Scenario: Nominal successful flow\r\n Given the client has established an authenticated session for "ACT-ACTOR-001"\r\n When valid payload is submitted according to specification\r\n Then the server responds with status 200 OK and persists state\r\n\r\n Scenario Outline: Parameter and edge case validation\r\n Given an input with parameter "<param>"\r\n When the request is processed\r\n Then the system returns status "<status>"\r\n\r\n Examples:\r\n | param | status |\r\n | nominal | 200 |\r\n | invalid | 400 |\r\n```\r\n\r\n---\r\n\r\n## 4. Cybersecurity and Mitigation Scenarios (Abuse Scenarios)\r\n\r\n```gherkin\r\n@CHG-NAME-001 @security @mitigation @SEC-REQ-CONTROL-001\r\nFeature: Threat Mitigation and Abuse Scenarios\r\n Scenario: Unauthorized access or unauthenticated payload attempt\r\n Given a malicious actor attempts to send data without valid credentials\r\n When connection attempts to reach protected enclaves "SEC-ENC-DMZ"\r\n Then handshake is aborted immediately and security alert SEC-TEST-001 is emitted\r\n```\r\n\r\n---\r\n\r\n## 5. Data Protection and Privacy Scenarios (Privacy Acceptance)\r\n\r\n```gherkin\r\n@CHG-NAME-001 @privacy @PRIV-REQ-NEW-001\r\nFeature: Privacy and Data Protection Controls\r\n Scenario: Verification of PII pseudonymization and zero-leakage telemetry\r\n Given payload containing personal data classification "confidential-pii"\r\n When event is serialized and dispatched to telemetry collector\r\n Then sensitive personal identifiers are redacted or salted-hashed\r\n And data retention TTL is enforced\r\n```\r\n\r\n';
|
|
14103
14747
|
var STARTER_TEMPLATES_SDD_TASKS_TEMPLATE_MD = '---\r\nid: TSK-PLAN-CHG-001\r\ntype: task-plan\r\nchange-id: CHG-001-FEATURE-NAME\r\ntitle: Verifiable Tasks Breakdown and Autonomy Governance\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nstatus: draft\r\ngovernance-summary:\r\n autonomous-tasks-count: 2\r\n human-review-plan-count: 1\r\n ambiguous-count: 0\r\n high-risk-manual-count: 0\r\ntasks:\r\n - id: "TSK-001"\r\n title: "Contract DTOs and Interfaces Definition"\r\n complexity: "LOW"\r\n risk-level: "LOW"\r\n autonomy-mode: "AUTONOMOUS"\r\n implements-components:\r\n - "CMP-NAME-001"\r\n satisfies-requirements:\r\n - "FR-001"\r\n verification:\r\n method: "quality-gate"\r\n command-or-criteria: "npx tsc --noEmit && node packages/cli/bin/aisdlc.js verify quality"\r\n assigned-to: "agent-developer"\r\n status: "PENDING"\r\n\r\n - id: "TSK-002"\r\n title: "Core Business Logic and Algorithm Implementation"\r\n complexity: "MEDIUM"\r\n risk-level: "MEDIUM"\r\n autonomy-mode: "HUMAN_REVIEW_PLAN"\r\n implements-components:\r\n - "CMP-NAME-001"\r\n satisfies-requirements:\r\n - "FR-001"\r\n verification:\r\n method: "automated-unit-test"\r\n command-or-criteria: "npm test -- tests/unit/feature_core.spec.ts"\r\n assigned-to: "agent-developer"\r\n status: "PENDING"\r\n\r\n - id: "TSK-003"\r\n title: "Database Schema Migration / Critical Credentials"\r\n complexity: "HIGH"\r\n risk-level: "CRITICAL"\r\n autonomy-mode: "HIGH_RISK_MANUAL"\r\n verification:\r\n method: "manual-inspection"\r\n command-or-criteria: "DBA review + manual execution with verified idempotent script"\r\n assigned-to: "human-engineer"\r\n status: "PENDING"\r\n\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# Verifiable Tasks Breakdown: CHG-001-FEATURE-NAME\r\n\r\n## 1. Autonomy Classification and Human Supervision Matrix\r\n\r\nEach task is rigorously classified according to its complexity and risk level to determine the level of delegation to AI agents:\r\n\r\n| Autonomy Mode | Traffic Light | Activation Criterion | Agent and Human Behavior |\r\n| :--- | :---: | :--- | :--- |\r\n| **`AUTONOMOUS`** | \u{1F7E2} | Low risk, isolated and well-specified task with immediate tests. | **Autonomous Plan + Execution**. Agent creates plan and writes code without interruption. Human validates final PR. |\r\n| **`HUMAN_REVIEW_PLAN`** | \u{1F7E1} | Medium risk, architectural changes, API contracts, or critical business rules. | **Mandatory Plan Review**. Agent designs detailed plan, but halts. **Human must approve plan before coding.** |\r\n| **`AMBIGUOUS`** | \u{1F7E0} | Vague requirements, incomplete criteria, or conflicting business logic. | **Blocked for Implementation**. Agent is forbidden to guess. Requires prior interview and refinement with user. |\r\n| **`HIGH_RISK_MANUAL`** | \u{1F534} | Critical risk (destructive DB migrations, cryptographic keys, production infra). | **Autonomous Execution Forbidden**. Direct human execution or assisted mode with command-by-command confirmation. |\r\n\r\n---\r\n\r\n## 2. Detailed Task Plan and Verification Criteria\r\n\r\n### Phase 1: Types and Contracts (TSK-001)\r\n- **ID**: `TSK-001`\r\n- **Description**: Create interfaces and data structures stipulated in `design.md`.\r\n- **Mode**: `AUTONOMOUS` \u{1F7E2}\r\n- **Verification**: `npx tsc --noEmit && node packages/cli/bin/aisdlc.js verify quality`\r\n\r\n### Phase 2: Implementation and BDD Tests (TSK-002)\r\n- **ID**: `TSK-002`\r\n- **Description**: Implement business logic and pass Cucumber scenarios.\r\n- **Mode**: `HUMAN_REVIEW_PLAN` \u{1F7E1}\r\n- **Verification**: `npx cucumber-js tests/features/feature.feature`\r\n\r\n### Phase 3: Critical Operations / Deployment (TSK-003)\r\n- **ID**: `TSK-003`\r\n- **Description**: Apply migrations or perimeter enclave configurations.\r\n- **Mode**: `HIGH_RISK_MANUAL` \u{1F534}\r\n- **Verification**: Manual approval checklists and smoke tests (`smoke-test`).\r\n\r\n---\r\n\r\n## 3. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-03 | Lead Engineer | Plan creation with risk classification and 360\xB0 verification | CHG-INIT-001 |\r\n';
|
|
14104
14748
|
var STARTER_TEMPLATES_SECURITY_ABUSE_CASE_TEMPLATE_MD = '---\r\nid: ABUSE-NAME-001\r\ntype: abuse-case\r\ntitle: Attack or Abuse Scenario Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nprimary-threat-actor: ACT-THREAT-NAME-001\r\ntargets-use-case: UC-ACTION-001\r\nstride-category: spoofing # spoofing, tampering, repudiation, information-disclosure, denial-of-service, elevation-of-privilege\r\nmitigated-by:\r\n - SEC-REQ-CONTROL-001\r\nasvs-controls:\r\n - "V2.1.1" # Reference to OWASP Application Security Verification Standard\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# ABUSE-NAME-001: Attack or Abuse Scenario Title\r\n\r\n## 1. Attack Vector and Exploitation Mechanics\r\nDescribes step-by-step how the malicious actor attempts to force, bypass, or abuse the legitimate use case.\r\n\r\n## 2. Attack Preconditions\r\n- What access or prior knowledge the attacker requires (expired tokens, intercepted network, payload injection).\r\n\r\n## 3. Potential Impact\r\n- Personal data exposure, telemetry corruption, denial of service, or identity spoofing.\r\n\r\n---\r\n\r\n## 4. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-03 | Security Officer / Threat Modeler | Initial abuse case threat modeling | CHG-SEC-001 |\r\n';
|
|
14105
14749
|
var STARTER_TEMPLATES_SECURITY_ENCLAVE_TEMPLATE_MD = '---\r\nid: SEC-ENC-NAME-001\r\ntype: security-enclave\r\ntitle: Zero Trust Security Enclave Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\ntrust-zone: trusted # untrusted, semi-trusted, trusted, highly-trusted, dmz, zero-trust-boundary\r\nperimeter-rules:\r\n - "Mandatory mutual authentication via TLS 1.3 (mTLS)"\r\n - "Cryptographic token validation with maximum 5-minute expiry"\r\n - "Network isolation via firewall rules and restricted namespaces"\r\nallowed-inbound:\r\n - CMP-GATEWAY-001\r\nallowed-outbound:\r\n - CMP-DATABASE-001\r\nenforced-by:\r\n - SEC-REQ-AUTH-001\r\nauthentication-mechanism: mtls # mtls, jwt, api-key, oauth2, none\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# SEC-ENC-NAME-001: Zero Trust Security Enclave Title\r\n\r\n## 1. Enclave Definition and Purpose\r\nDescription of trust boundary, assets protected inside the enclave, and applied least-privilege principle.\r\n\r\n## 2. Trust Zone and Perimeter Rules\r\n\r\n| Parameter | Value | Security Justification |\r\n| :--- | :--- | :--- |\r\n| **Trust Zone** | `trusted` | Segment with access to sensitive data and critical logic services. |\r\n| **Authentication** | `mtls` | Mandatory asymmetric cryptography at all ingress points. |\r\n\r\n### Perimeter Rules\r\n1. **Inbound Flow Control**: Only explicitly authorized components may initiate connections.\r\n2. **Outbound Flow Control**: Outbound traffic restricted exclusively to dependencies required for operation.\r\n3. **Continuous Validation**: Every incoming request is cryptographically verified regardless of network origin.\r\n\r\n---\r\n\r\n## 3. Authorized Connectivity Matrix\r\n\r\n| Direction | Entity Identifier | Type | Protocol / Channel |\r\n| :--- | :--- | :--- | :--- |\r\n| **Inbound** | `CMP-GATEWAY-001` | Component | gRPC over mTLS (secure port) |\r\n| **Outbound** | `CMP-DATABASE-001` | Component | TCP encrypted with enclave credentials |\r\n\r\n---\r\n\r\n## 4. Linked Security Requirements\r\n\r\n- `SEC-REQ-AUTH-001`: Access control and perimeter encryption.\r\n\r\n---\r\n\r\n## 5. Revision History\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-23 | Security Architect | Initial Zero Trust security enclave creation | CHG-INIT-001 |\r\n';
|
|
@@ -14157,6 +14801,7 @@ var STARTER_BASE_TEMPLATES = [
|
|
|
14157
14801
|
{ relPath: "templates/privacy/privacy-req.template.md", content: STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD },
|
|
14158
14802
|
{ relPath: "templates/privacy/privacy-ropa.template.md", content: STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD },
|
|
14159
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 },
|
|
14160
14805
|
{ relPath: "templates/product/business-rule.template.md", content: STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD },
|
|
14161
14806
|
{ relPath: "templates/product/journey.template.md", content: STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD },
|
|
14162
14807
|
{ relPath: "templates/product/requirement.template.md", content: STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD },
|
|
@@ -14767,7 +15412,7 @@ permissions:
|
|
|
14767
15412
|
pull-requests: read
|
|
14768
15413
|
|
|
14769
15414
|
concurrency:
|
|
14770
|
-
group: sdd-integrate-\${{ github.ref }}
|
|
15415
|
+
group: sdd-integrate-\${{ github.event.pull_request.base.ref || github.ref_name }}
|
|
14771
15416
|
cancel-in-progress: false
|
|
14772
15417
|
|
|
14773
15418
|
jobs:
|
|
@@ -14819,8 +15464,28 @@ jobs:
|
|
|
14819
15464
|
git add -A
|
|
14820
15465
|
if ! git diff --cached --quiet; then
|
|
14821
15466
|
git commit -m "chore(sdd): integrate changes into canonical baseline [skip ci]"
|
|
14822
|
-
|
|
14823
|
-
|
|
15467
|
+
TARGET_BRANCH="\${{ github.event.pull_request.base.ref || github.ref_name }}"
|
|
15468
|
+
MAX_RETRIES=3
|
|
15469
|
+
RETRY_COUNT=0
|
|
15470
|
+
DELAY=2
|
|
15471
|
+
|
|
15472
|
+
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
|
|
15473
|
+
echo "Synchronizing with remote branch $TARGET_BRANCH (pull --rebase)..."
|
|
15474
|
+
git pull --rebase origin "$TARGET_BRANCH"
|
|
15475
|
+
if git push origin "$TARGET_BRANCH"; then
|
|
15476
|
+
echo "\u2714 Canonical integration committed and synchronized in repository."
|
|
15477
|
+
exit 0
|
|
15478
|
+
fi
|
|
15479
|
+
RETRY_COUNT=$((RETRY_COUNT + 1))
|
|
15480
|
+
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
|
|
15481
|
+
echo "\u26A0 Push rejected (concurrency detected). Retrying in \${DELAY}s (attempt $RETRY_COUNT/$MAX_RETRIES)..."
|
|
15482
|
+
sleep $DELAY
|
|
15483
|
+
DELAY=$((DELAY * 2))
|
|
15484
|
+
fi
|
|
15485
|
+
done
|
|
15486
|
+
|
|
15487
|
+
echo "\u274C Error: Failed to push canonical integration after $MAX_RETRIES attempts."
|
|
15488
|
+
exit 1
|
|
14824
15489
|
else
|
|
14825
15490
|
echo "\u2139 No pending modifications generated in working tree."
|
|
14826
15491
|
fi
|
|
@@ -15140,6 +15805,6 @@ function initProject(options = {}) {
|
|
|
15140
15805
|
);
|
|
15141
15806
|
}
|
|
15142
15807
|
|
|
15143
|
-
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 };
|
|
15144
15809
|
//# sourceMappingURL=index.js.map
|
|
15145
15810
|
//# sourceMappingURL=index.js.map
|