@aisdlc/core 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1052 -197
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -8
- package/dist/index.d.ts +76 -8
- package/dist/index.js +1028 -198
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5087,6 +5087,256 @@ function emitCiOutput(key, value, env = process.env) {
|
|
|
5087
5087
|
writeEnvOutputFile(envOutputFile, key, value);
|
|
5088
5088
|
}
|
|
5089
5089
|
}
|
|
5090
|
+
var DEFAULT_DLP_RULES = [
|
|
5091
|
+
{
|
|
5092
|
+
id: "DLP-001-PRIVATE-KEY",
|
|
5093
|
+
description: "PEM / RSA / EC / OPENSSH Private Key Block",
|
|
5094
|
+
pattern: "-----BEGIN (?:[A-Z0-9_-]+ )?PRIVATE KEY-----[\\s\\S]*?-----END (?:[A-Z0-9_-]+ )?PRIVATE KEY-----",
|
|
5095
|
+
replacement: "[REDACTED:PRIVATE_KEY]",
|
|
5096
|
+
enabled: true
|
|
5097
|
+
},
|
|
5098
|
+
{
|
|
5099
|
+
id: "DLP-002-API-TOKEN",
|
|
5100
|
+
description: "Cloud, GitHub, Slack, OpenAI, Stripe, and AWS Access Tokens",
|
|
5101
|
+
pattern: "\\b(?:gh[pousr]_[A-Za-z0-9_]{36,255}|github_pat_[0-9a-zA-Z_]{82}|sk-(?:proj-|live-)?[a-zA-Z0-9_-]{32,}|AKIA[0-9A-Z]{16}|xox[baprs]-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*|(?:sk|rk)_(?:live|test)_[0-9a-zA-Z]{24,99})\\b",
|
|
5102
|
+
replacement: "[REDACTED:API_TOKEN]",
|
|
5103
|
+
enabled: true
|
|
5104
|
+
},
|
|
5105
|
+
{
|
|
5106
|
+
id: "DLP-003-JWT",
|
|
5107
|
+
description: "Plaintext JSON Web Token (JWT)",
|
|
5108
|
+
pattern: "\\beyJ[A-Za-z0-9_-]{10,}\\.eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\b",
|
|
5109
|
+
replacement: "[REDACTED:JWT_TOKEN]",
|
|
5110
|
+
enabled: true
|
|
5111
|
+
},
|
|
5112
|
+
{
|
|
5113
|
+
id: "DLP-004-CREDIT-CARD",
|
|
5114
|
+
description: "Payment Card Number (13-19 digits formatted)",
|
|
5115
|
+
pattern: "\\b(?:\\d{4}[- ]\\d{4}[- ]\\d{4}[- ]\\d{4}|\\d{16})\\b",
|
|
5116
|
+
replacement: "[REDACTED:CREDIT_CARD]",
|
|
5117
|
+
enabled: true
|
|
5118
|
+
},
|
|
5119
|
+
{
|
|
5120
|
+
id: "DLP-005-EMAIL",
|
|
5121
|
+
description: "Personal or Corporate Email Address",
|
|
5122
|
+
pattern: "\\b[A-Za-z0-9._%+-]+@(?!example\\.com|localhost|test\\.local)[A-Za-z0-9.-]+\\.[A-Za-z]{2,}\\b",
|
|
5123
|
+
replacement: "[REDACTED:EMAIL]",
|
|
5124
|
+
enabled: true
|
|
5125
|
+
},
|
|
5126
|
+
{
|
|
5127
|
+
id: "DLP-006-INTERNAL-URL",
|
|
5128
|
+
description: "Internal Intranet / Corp Service URL",
|
|
5129
|
+
pattern: "https?://(?:[A-Za-z0-9._-]+:[A-Za-z0-9._-]+@|[A-Za-z0-9.-]+\\.(?:internal|corp|intranet|local)\\b)[^\\s\"'`<>]*",
|
|
5130
|
+
replacement: "[REDACTED:INTERNAL_URL]",
|
|
5131
|
+
enabled: true
|
|
5132
|
+
}
|
|
5133
|
+
];
|
|
5134
|
+
function createDefaultDlpPolicy() {
|
|
5135
|
+
return {
|
|
5136
|
+
version: "1.0",
|
|
5137
|
+
enabled: true,
|
|
5138
|
+
zero_data_retention_required: true,
|
|
5139
|
+
rules: [...DEFAULT_DLP_RULES]
|
|
5140
|
+
};
|
|
5141
|
+
}
|
|
5142
|
+
function normalizeParsedRule(raw, idx) {
|
|
5143
|
+
if (typeof raw.pattern !== "string" || !raw.pattern) return null;
|
|
5144
|
+
return {
|
|
5145
|
+
id: typeof raw.id === "string" ? raw.id : `DLP-CUSTOM-${idx + 1}`,
|
|
5146
|
+
description: typeof raw.description === "string" ? raw.description : "Custom DLP rule",
|
|
5147
|
+
pattern: raw.pattern,
|
|
5148
|
+
replacement: typeof raw.replacement === "string" ? raw.replacement : "[REDACTED]",
|
|
5149
|
+
enabled: raw.enabled !== false
|
|
5150
|
+
};
|
|
5151
|
+
}
|
|
5152
|
+
function parseDlpDoc(yamlContent) {
|
|
5153
|
+
let doc;
|
|
5154
|
+
try {
|
|
5155
|
+
doc = yaml3__default.default.load(yamlContent);
|
|
5156
|
+
} catch (err) {
|
|
5157
|
+
throw new Error(`[AI-SDLC Fail-Closed] Invalid YAML in dlp-policy: ${err instanceof Error ? err.message : String(err)}`);
|
|
5158
|
+
}
|
|
5159
|
+
if (!doc || typeof doc !== "object" || Array.isArray(doc)) {
|
|
5160
|
+
throw new Error(`[AI-SDLC Fail-Closed] Invalid dlp-policy structure: root must be a YAML mapping`);
|
|
5161
|
+
}
|
|
5162
|
+
const record = doc;
|
|
5163
|
+
if (record.rules !== void 0 && !Array.isArray(record.rules)) {
|
|
5164
|
+
throw new Error(`[AI-SDLC Fail-Closed] Invalid dlp-policy: rules must be an array`);
|
|
5165
|
+
}
|
|
5166
|
+
return record;
|
|
5167
|
+
}
|
|
5168
|
+
function parseDlpPolicy(yamlContent) {
|
|
5169
|
+
const fallback = createDefaultDlpPolicy();
|
|
5170
|
+
if (!yamlContent || !yamlContent.trim()) return fallback;
|
|
5171
|
+
const record = parseDlpDoc(yamlContent);
|
|
5172
|
+
const rawRules = Array.isArray(record.rules) ? record.rules : [];
|
|
5173
|
+
const parsedRules = rawRules.map((r, i) => normalizeParsedRule(r, i)).filter((r) => r !== null);
|
|
5174
|
+
return {
|
|
5175
|
+
version: typeof record.version === "string" ? record.version : "1.0",
|
|
5176
|
+
enabled: record.enabled !== false,
|
|
5177
|
+
zero_data_retention_required: Boolean(record.zero_data_retention_required ?? true),
|
|
5178
|
+
rules: parsedRules.length > 0 ? parsedRules : fallback.rules
|
|
5179
|
+
};
|
|
5180
|
+
}
|
|
5181
|
+
function loadDlpPolicy(rootDir, customPolicyPath) {
|
|
5182
|
+
const base = rootDir || process.cwd();
|
|
5183
|
+
const filePath = customPolicyPath ? path5__namespace.isAbsolute(customPolicyPath) ? customPolicyPath : path5__namespace.join(base, customPolicyPath) : path5__namespace.join(base, "dlp-policy.yaml");
|
|
5184
|
+
if (!fs8__namespace.existsSync(filePath)) return createDefaultDlpPolicy();
|
|
5185
|
+
return parseDlpPolicy(fs8__namespace.readFileSync(filePath, "utf-8"));
|
|
5186
|
+
}
|
|
5187
|
+
function applySingleDlpRule(text, rule) {
|
|
5188
|
+
if (rule.enabled === false) return { output: text, matches: 0 };
|
|
5189
|
+
try {
|
|
5190
|
+
const regex = new RegExp(rule.pattern, "g");
|
|
5191
|
+
let matches = 0;
|
|
5192
|
+
const output = text.replace(regex, () => {
|
|
5193
|
+
matches++;
|
|
5194
|
+
return rule.replacement;
|
|
5195
|
+
});
|
|
5196
|
+
return { output, matches };
|
|
5197
|
+
} catch {
|
|
5198
|
+
return { output: text, matches: 0 };
|
|
5199
|
+
}
|
|
5200
|
+
}
|
|
5201
|
+
function sanitizeDlpText(text, policy = createDefaultDlpPolicy()) {
|
|
5202
|
+
if (!policy.enabled || !text) {
|
|
5203
|
+
return { sanitizedText: text, redactionCount: 0, triggeredRuleIds: [] };
|
|
5204
|
+
}
|
|
5205
|
+
let current = text;
|
|
5206
|
+
let totalRedactions = 0;
|
|
5207
|
+
const triggered = [];
|
|
5208
|
+
for (const rule of policy.rules) {
|
|
5209
|
+
const res = applySingleDlpRule(current, rule);
|
|
5210
|
+
if (res.matches > 0) {
|
|
5211
|
+
current = res.output;
|
|
5212
|
+
totalRedactions += res.matches;
|
|
5213
|
+
triggered.push(rule.id);
|
|
5214
|
+
}
|
|
5215
|
+
}
|
|
5216
|
+
return {
|
|
5217
|
+
sanitizedText: current,
|
|
5218
|
+
redactionCount: totalRedactions,
|
|
5219
|
+
triggeredRuleIds: triggered
|
|
5220
|
+
};
|
|
5221
|
+
}
|
|
5222
|
+
function sanitizeDlpPayload(payload, policy = createDefaultDlpPolicy()) {
|
|
5223
|
+
if (!policy.enabled || payload === null || payload === void 0) return payload;
|
|
5224
|
+
if (typeof payload === "string") {
|
|
5225
|
+
return sanitizeDlpText(payload, policy).sanitizedText;
|
|
5226
|
+
}
|
|
5227
|
+
const serialized = JSON.stringify(payload);
|
|
5228
|
+
const { sanitizedText } = sanitizeDlpText(serialized, policy);
|
|
5229
|
+
try {
|
|
5230
|
+
return JSON.parse(sanitizedText);
|
|
5231
|
+
} catch {
|
|
5232
|
+
return payload;
|
|
5233
|
+
}
|
|
5234
|
+
}
|
|
5235
|
+
|
|
5236
|
+
// src/adapters/sdd/review-report.ts
|
|
5237
|
+
var REVIEW_VERDICTS = ["COMPLIANT", "SUGGESTIONS", "BLOCKING"];
|
|
5238
|
+
var REVIEWER_ROLES = [
|
|
5239
|
+
"agent-code-reviewer",
|
|
5240
|
+
"agent-security-auditor",
|
|
5241
|
+
"agent-compliance-checker",
|
|
5242
|
+
"agent-privacy-officer",
|
|
5243
|
+
"agent-expert-user",
|
|
5244
|
+
"auditor",
|
|
5245
|
+
"reviewer"
|
|
5246
|
+
];
|
|
5247
|
+
function isReviewerRole(role) {
|
|
5248
|
+
if (!role || typeof role !== "string") return false;
|
|
5249
|
+
const normalized = role.toLowerCase().trim();
|
|
5250
|
+
return REVIEWER_ROLES.includes(normalized);
|
|
5251
|
+
}
|
|
5252
|
+
function validateChangeId(changeId, rootDir) {
|
|
5253
|
+
if (!changeId || typeof changeId !== "string") {
|
|
5254
|
+
return { ok: false, error: "Missing changeId for review report submission" };
|
|
5255
|
+
}
|
|
5256
|
+
const rawChange = changeId.trim();
|
|
5257
|
+
if (rawChange.includes("..") || rawChange.includes("/") || rawChange.includes("\\") || !/^[a-zA-Z0-9_\-.]+$/.test(rawChange)) {
|
|
5258
|
+
return { ok: false, error: `Invalid changeId: path traversal or invalid characters detected '${rawChange}'` };
|
|
5259
|
+
}
|
|
5260
|
+
const activeChangeDir = path5__namespace.join(rootDir, "specs", "changes", "active", rawChange);
|
|
5261
|
+
if (!fs8__namespace.existsSync(activeChangeDir)) {
|
|
5262
|
+
return { ok: false, error: `Active change not found in specs/changes/active: '${rawChange}'` };
|
|
5263
|
+
}
|
|
5264
|
+
return { ok: true, changeDir: activeChangeDir, rawChange };
|
|
5265
|
+
}
|
|
5266
|
+
function validateReviewer(reviewer) {
|
|
5267
|
+
if (!reviewer || typeof reviewer !== "string") {
|
|
5268
|
+
return { ok: false, error: "Reviewer role is required" };
|
|
5269
|
+
}
|
|
5270
|
+
const rawReviewer = reviewer.trim().toLowerCase();
|
|
5271
|
+
if (rawReviewer.includes("..") || rawReviewer.includes("/") || rawReviewer.includes("\\")) {
|
|
5272
|
+
return { ok: false, error: `Invalid reviewer name: path traversal detected '${rawReviewer}'` };
|
|
5273
|
+
}
|
|
5274
|
+
if (!isReviewerRole(rawReviewer)) {
|
|
5275
|
+
return {
|
|
5276
|
+
ok: false,
|
|
5277
|
+
error: `Role '${reviewer}' is not an authorized reviewer role. Authorized roles: ${REVIEWER_ROLES.join(", ")}`
|
|
5278
|
+
};
|
|
5279
|
+
}
|
|
5280
|
+
return { ok: true, rawReviewer };
|
|
5281
|
+
}
|
|
5282
|
+
function validateVerdictAndBody(verdict, body) {
|
|
5283
|
+
if (!verdict || !REVIEW_VERDICTS.includes(verdict)) {
|
|
5284
|
+
return {
|
|
5285
|
+
ok: false,
|
|
5286
|
+
error: `Invalid verdict '${verdict}'. Allowed verdicts: ${REVIEW_VERDICTS.join(", ")}`
|
|
5287
|
+
};
|
|
5288
|
+
}
|
|
5289
|
+
if (!body || typeof body !== "string" || !body.trim()) {
|
|
5290
|
+
return { ok: false, error: "Review report body cannot be empty" };
|
|
5291
|
+
}
|
|
5292
|
+
return { ok: true };
|
|
5293
|
+
}
|
|
5294
|
+
function buildReportMarkdown(change, reviewer, verdict, body, date) {
|
|
5295
|
+
return [
|
|
5296
|
+
`# Review Report: ${reviewer}`,
|
|
5297
|
+
"",
|
|
5298
|
+
`- change: ${change}`,
|
|
5299
|
+
`- reviewer: ${reviewer}`,
|
|
5300
|
+
`- verdict: ${verdict}`,
|
|
5301
|
+
`- date: ${date}`,
|
|
5302
|
+
"",
|
|
5303
|
+
"## Findings",
|
|
5304
|
+
"",
|
|
5305
|
+
body,
|
|
5306
|
+
""
|
|
5307
|
+
].join("\n");
|
|
5308
|
+
}
|
|
5309
|
+
function persistReportFile(changeDir, rawReviewer, content) {
|
|
5310
|
+
const reviewsDir = path5__namespace.join(changeDir, "reviews");
|
|
5311
|
+
if (!fs8__namespace.existsSync(reviewsDir)) {
|
|
5312
|
+
fs8__namespace.mkdirSync(reviewsDir, { recursive: true });
|
|
5313
|
+
}
|
|
5314
|
+
const reportFileName = `${rawReviewer}.md`;
|
|
5315
|
+
fs8__namespace.writeFileSync(path5__namespace.join(reviewsDir, reportFileName), content, "utf-8");
|
|
5316
|
+
return crypto3__namespace.createHash("sha256").update(content.replace(/\r\n/g, "\n")).digest("hex");
|
|
5317
|
+
}
|
|
5318
|
+
function submitReviewReport(options) {
|
|
5319
|
+
const root = options.rootDir || process.cwd();
|
|
5320
|
+
const changeCheck = validateChangeId(options.changeId, root);
|
|
5321
|
+
if (!changeCheck.ok) return { success: false, error: changeCheck.error };
|
|
5322
|
+
const reviewerCheck = validateReviewer(options.reviewer);
|
|
5323
|
+
if (!reviewerCheck.ok) return { success: false, error: reviewerCheck.error };
|
|
5324
|
+
const contentCheck = validateVerdictAndBody(options.verdict, options.body);
|
|
5325
|
+
if (!contentCheck.ok) return { success: false, error: contentCheck.error };
|
|
5326
|
+
const rawChange = changeCheck.rawChange;
|
|
5327
|
+
const rawReviewer = reviewerCheck.rawReviewer;
|
|
5328
|
+
const dlpPolicy = loadDlpPolicy(root);
|
|
5329
|
+
const sanitizedBody = sanitizeDlpText(options.body.trim(), dlpPolicy).sanitizedText;
|
|
5330
|
+
const date = options.date || (/* @__PURE__ */ new Date()).toISOString();
|
|
5331
|
+
const reportContent = buildReportMarkdown(rawChange, rawReviewer, options.verdict, sanitizedBody, date);
|
|
5332
|
+
const digest = persistReportFile(changeCheck.changeDir, rawReviewer, reportContent);
|
|
5333
|
+
return {
|
|
5334
|
+
success: true,
|
|
5335
|
+
reportPath: `specs/changes/active/${rawChange}/reviews/${rawReviewer}.md`,
|
|
5336
|
+
digest,
|
|
5337
|
+
verdict: options.verdict
|
|
5338
|
+
};
|
|
5339
|
+
}
|
|
5090
5340
|
|
|
5091
5341
|
// src/adapters/sdd/index.ts
|
|
5092
5342
|
function getSddAdapter(framework) {
|
|
@@ -7388,6 +7638,46 @@ function verifyLicenses(options = {}) {
|
|
|
7388
7638
|
const reportMarkdown = generateLicenseReportMarkdown(dependencies, violations, policy, artifacts.sbomPath);
|
|
7389
7639
|
return assembleDynamicLicenseResult(dependencies, permittedCount, violations, reportMarkdown, artifacts, vulnData);
|
|
7390
7640
|
}
|
|
7641
|
+
var IGNORED_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "bin", "obj", "dist", "build", "target", "reports", "templates"]);
|
|
7642
|
+
var MSBUILD_WEAKENING = [
|
|
7643
|
+
/<TreatWarningsAsErrors>\s*false\s*<\/TreatWarningsAsErrors>/i,
|
|
7644
|
+
/<Nullable>\s*disable\s*<\/Nullable>/i,
|
|
7645
|
+
/<RunAnalyzers>\s*false\s*<\/RunAnalyzers>/i
|
|
7646
|
+
];
|
|
7647
|
+
var TSCONFIG_WEAKENING = [/"strict"\s*:\s*false/, /"noImplicitAny"\s*:\s*false/, /"strictNullChecks"\s*:\s*false/];
|
|
7648
|
+
function walkFiles(dir, rootDir, out) {
|
|
7649
|
+
for (const entry of fs8__namespace.readdirSync(dir, { withFileTypes: true })) {
|
|
7650
|
+
if (entry.isDirectory() && !IGNORED_DIRS.has(entry.name)) walkFiles(path5__namespace.join(dir, entry.name), rootDir, out);
|
|
7651
|
+
else if (entry.isFile()) out.push(path5__namespace.relative(rootDir, path5__namespace.join(dir, entry.name)).replace(/\\/g, "/"));
|
|
7652
|
+
}
|
|
7653
|
+
return out;
|
|
7654
|
+
}
|
|
7655
|
+
function matchWeakening(rel, content, patterns) {
|
|
7656
|
+
return patterns.filter((p) => p.test(content)).map((p) => `[CODING-RULES-BYPASS] '${rel}' weakens the strict coding rules (${p.source}).`);
|
|
7657
|
+
}
|
|
7658
|
+
function checkMsBuildFile(rel, content) {
|
|
7659
|
+
const issues = matchWeakening(rel, content, MSBUILD_WEAKENING);
|
|
7660
|
+
const isNestedBuildProps = /(^|\/)Directory\.Build\.props$/.test(rel) && rel !== "Directory.Build.props";
|
|
7661
|
+
if (isNestedBuildProps && !content.includes("GetPathOfFileAbove")) {
|
|
7662
|
+
issues.push(`[CODING-RULES-BYPASS] Nested '${rel}' does not import the parent Directory.Build.props (GetPathOfFileAbove), silently dropping root rules.`);
|
|
7663
|
+
}
|
|
7664
|
+
return issues;
|
|
7665
|
+
}
|
|
7666
|
+
function checkFile(rel, content, hasDotnetRules, hasTsRules) {
|
|
7667
|
+
if (hasDotnetRules && /\.(csproj|props|targets)$/.test(rel)) return checkMsBuildFile(rel, content);
|
|
7668
|
+
if (hasTsRules && /(^|\/)tsconfig[^/]*\.json$/.test(rel) && !rel.endsWith("tsconfig.strict.json")) {
|
|
7669
|
+
return matchWeakening(rel, content, TSCONFIG_WEAKENING);
|
|
7670
|
+
}
|
|
7671
|
+
return [];
|
|
7672
|
+
}
|
|
7673
|
+
function collectCodingRulesBypassViolations(rootDir) {
|
|
7674
|
+
const hasDotnetRules = fs8__namespace.existsSync(path5__namespace.join(rootDir, "Directory.Build.props"));
|
|
7675
|
+
const hasTsRules = fs8__namespace.existsSync(path5__namespace.join(rootDir, "tsconfig.strict.json"));
|
|
7676
|
+
if (!hasDotnetRules && !hasTsRules) return [];
|
|
7677
|
+
return walkFiles(rootDir, rootDir, []).flatMap(
|
|
7678
|
+
(rel) => checkFile(rel, fs8__namespace.readFileSync(path5__namespace.join(rootDir, rel), "utf-8"), hasDotnetRules, hasTsRules)
|
|
7679
|
+
);
|
|
7680
|
+
}
|
|
7391
7681
|
var PROTECTED_BYPASS_PATTERNS = [
|
|
7392
7682
|
/^schemas[\\/]/i,
|
|
7393
7683
|
/^examples[\\/]security[\\/]/i,
|
|
@@ -7398,7 +7688,8 @@ var PROTECTED_BYPASS_PATTERNS = [
|
|
|
7398
7688
|
/license-policy\.ya?ml$/i,
|
|
7399
7689
|
/08_security_concept\.md$/i,
|
|
7400
7690
|
/09_decisions[\\/]/i,
|
|
7401
|
-
/migrations?[\\/]/i
|
|
7691
|
+
/migrations?[\\/]/i,
|
|
7692
|
+
/^\.github[\\/]CODEOWNERS$/i
|
|
7402
7693
|
];
|
|
7403
7694
|
function detectProfileFromChange(changeDir) {
|
|
7404
7695
|
if (!fs8__namespace.existsSync(changeDir)) return "standard";
|
|
@@ -7534,7 +7825,10 @@ function verifyProgressiveFriction(options = {}) {
|
|
|
7534
7825
|
const changeDir = resolveChangeDirectory(rootDir, options);
|
|
7535
7826
|
const profile = changeDir ? detectProfileFromChange(changeDir) : "standard";
|
|
7536
7827
|
const modifiedFiles = options.diffFiles || options.modifiedFiles || (profile === "patch" ? detectGitDiffFiles(rootDir) : []);
|
|
7537
|
-
const violations =
|
|
7828
|
+
const violations = [
|
|
7829
|
+
...profile === "patch" ? collectPatchViolations(rootDir, modifiedFiles) : [],
|
|
7830
|
+
...collectCodingRulesBypassViolations(rootDir)
|
|
7831
|
+
];
|
|
7538
7832
|
const bypassed = violations.length > 0;
|
|
7539
7833
|
const success = !bypassed;
|
|
7540
7834
|
return {
|
|
@@ -10520,6 +10814,24 @@ if echo "$CURRENT_BRANCH" | grep -qE "^(main|master|release/.*)$"; then
|
|
|
10520
10814
|
exit 1
|
|
10521
10815
|
fi
|
|
10522
10816
|
|
|
10817
|
+
# Immutable Coding Rules Guard: block AI agents from adding, modifying or deleting coding rules files
|
|
10818
|
+
IS_AGENT=0
|
|
10819
|
+
if [ -n "$AI_MODEL" ] || [ -n "$AI_AGENT_NAME" ] || [ -n "$ANTIGRAVITY_AGENT" ] || [ -n "$ANTIGRAVITY_AGENT_ID" ] || [ -n "$ANTIGRAVITY_CONVERSATION_ID" ] || [ -n "$CLAUDE_CODE" ] || [ -n "$CURSOR_AGENT" ] || [ -n "$WINDSURF_AGENT" ] || [ -n "$AIDER_MODEL" ] || [ -f ".ai-sdlc/session-telemetry.json" ]; then
|
|
10820
|
+
IS_AGENT=1
|
|
10821
|
+
fi
|
|
10822
|
+
|
|
10823
|
+
if [ "$IS_AGENT" = "1" ]; then
|
|
10824
|
+
TAMPERED_RULES=$(git diff --cached --diff-filter=AMDR --name-only 2>/dev/null | grep -E "(^|/)(Directory\\.Build\\.props|tsconfig\\.strict\\.json|eslint\\.config\\.mjs|gradle/init\\.d/aisdlc-strict\\.init\\.gradle\\.kts|config/pmd/aisdlc-ruleset\\.xml|config/detekt/detekt\\.yml|\\.cargo/config\\.toml|\\.clippy\\.toml|\\.golangci\\.yml|\\.clang-tidy|cmake/AisdlcStrictCompiler\\.cmake|\\.github/CODEOWNERS|templates/coding-rules/.+)$" || echo "")
|
|
10825
|
+
if [ -n "$TAMPERED_RULES" ]; then
|
|
10826
|
+
echo "" >&2
|
|
10827
|
+
echo "\u274C [AI-SDLC Immutable Coding Rules Guard] BLOCKED: AI agents are forbidden from adding, modifying or deleting coding rules files:" >&2
|
|
10828
|
+
echo "$TAMPERED_RULES" >&2
|
|
10829
|
+
echo "Fix the source or test code to comply with the compiler/linter rules instead of altering the rule configuration." >&2
|
|
10830
|
+
echo "" >&2
|
|
10831
|
+
exit 1
|
|
10832
|
+
fi
|
|
10833
|
+
fi
|
|
10834
|
+
|
|
10523
10835
|
exit 0
|
|
10524
10836
|
`;
|
|
10525
10837
|
var PREPARE_COMMIT_MSG_SCRIPT = `#!/usr/bin/env bash
|
|
@@ -10637,7 +10949,7 @@ function installGitHooks(rootDir = process.cwd()) {
|
|
|
10637
10949
|
fs8__namespace.mkdirSync(hooksDir, { recursive: true });
|
|
10638
10950
|
}
|
|
10639
10951
|
const prepareCommitMsgPath = path5__namespace.join(hooksDir, "prepare-commit-msg");
|
|
10640
|
-
const preCommitPath = path5__namespace.join(
|
|
10952
|
+
const preCommitPath = path5__namespace.join(gitDir, "hooks", "pre-commit");
|
|
10641
10953
|
try {
|
|
10642
10954
|
fs8__namespace.writeFileSync(prepareCommitMsgPath, PREPARE_COMMIT_MSG_SCRIPT, { encoding: "utf-8", mode: 493 });
|
|
10643
10955
|
fs8__namespace.writeFileSync(preCommitPath, PRE_COMMIT_SCRIPT, { encoding: "utf-8", mode: 493 });
|
|
@@ -14091,6 +14403,51 @@ Execute every implementation task following this strict sequential order:
|
|
|
14091
14403
|
- **Cross-Workflow Audit**: When fixing any CI/CD or configuration defect detected in a PR, search all \`.github/workflows/*.yml\` for the same pattern (including release, post-merge, and publishing pipelines) before declaring the fix complete.
|
|
14092
14404
|
- **Remote Verification**: Creating a PR (\`gh pr create\`) does not equal success; actively verify that remote checks pass (\`gh pr checks\`).
|
|
14093
14405
|
- If autonomy is $\\ge$ \`HUMAN_REVIEW_PLAN\`, conclude by emitting the Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) to the human Tech Lead or Release Manager, opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
|
|
14406
|
+
},
|
|
14407
|
+
{
|
|
14408
|
+
id: "agent-auditor",
|
|
14409
|
+
title: "Transversal Quality and Improvement Auditor",
|
|
14410
|
+
description: "Polymorphically inspect deliverables from any AI-SDLC specialist agent on demand, identifying structural weaknesses, overengineering, or blind spots, and proposing concrete, minimal solutions adhering strictly to YAGNI.",
|
|
14411
|
+
globs: "**/*",
|
|
14412
|
+
claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
|
|
14413
|
+
antigravityTools: ["read_file", "run_command", "call_mcp_tool", "ask_question"],
|
|
14414
|
+
body: `## Role & Mission
|
|
14415
|
+
- **Role**: Transversal Quality and Constructive Auditor Agent (\`agent-auditor\`).
|
|
14416
|
+
- **Mission**: Inspect the output deliverables of any upstream specialist agent upon demand across any phase, identifying structural weaknesses, premature abstractions, overengineering, or blind spots, and proposing concrete, minimal, and standard solutions adhering strictly to Simplicity First (YAGNI).
|
|
14417
|
+
|
|
14418
|
+
## Operational Directives & Guardrails
|
|
14419
|
+
- **Polymorphic On-Demand Scope**: May be invoked over deliverables from any role (\`agent-product-analyst\`, \`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-qa-engineer\`, \`agent-developer\`, \`agent-devops\`).
|
|
14420
|
+
- **Simplicity First (YAGNI)**: Actively challenge speculative parameters, redundant interfaces, unused design patterns, and unrequested flexibility.
|
|
14421
|
+
- **Classification of Findings**: Label every finding as:
|
|
14422
|
+
* \`[BLOCKING_DEFECT]\`: Critical omission, structural debt, or standard violation that must be resolved.
|
|
14423
|
+
* \`[SIMPLIFICATION]\`: Opportunity to remove unneeded complexity or reduce code/spec surface without loss of function.
|
|
14424
|
+
* \`[ADVISORY]\`: Non-blocking observation or suggestion.
|
|
14425
|
+
- **NON-INVASIVE GUARDRAIL**: You do NOT modify upstream files or specifications directly.
|
|
14426
|
+
- **Mandatory Return Handoff**: Emit a structured report citing canonical IDs and SHA-256 digests, concluding with the canonical Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) directed back to the audited specialist agent.
|
|
14427
|
+
- **ANTI-PING-PONG GUARDRAIL**: Enforce maximum 1 audit return round per increment unless blocking defects persist.`
|
|
14428
|
+
},
|
|
14429
|
+
{
|
|
14430
|
+
id: "agent-adversary",
|
|
14431
|
+
title: "Transversal Red Team and Chaos Adversary",
|
|
14432
|
+
description: "Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps for every discovered failure mode.",
|
|
14433
|
+
globs: "**/*",
|
|
14434
|
+
claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
|
|
14435
|
+
antigravityTools: ["read_file", "run_command", "call_mcp_tool", "ask_question"],
|
|
14436
|
+
body: `## Role & Mission
|
|
14437
|
+
- **Role**: Transversal Red Team and Stress Adversary Agent (\`agent-adversary\`).
|
|
14438
|
+
- **Mission**: Actively attempt to break, bypass, or invalidate the deliverables of any target specialist agent across any phase, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps for every discovered failure mode.
|
|
14439
|
+
|
|
14440
|
+
## Operational Directives & Guardrails
|
|
14441
|
+
- **Polymorphic On-Demand Scope**:
|
|
14442
|
+
* **Product**: Uncover contradictory requirements, unreachable business states, and logic traps.
|
|
14443
|
+
* **Architecture**: Simulate race conditions, cascading failures, resource exhaustion, and single points of failure (SPOFs).
|
|
14444
|
+
* **QA**: Perform conceptual mutation testing; demonstrate how flawed or empty implementations could falsely pass tests green.
|
|
14445
|
+
* **Development**: Attack boundary inputs, concurrency race triggers, and memory/type edge breaks.
|
|
14446
|
+
* **DevOps**: Probe pipeline isolation, credential boundaries, and cold-start/dependency outages.
|
|
14447
|
+
- **MANDATORY PROOF-OF-BREAK**: Abstract criticism without reproducible proof is strictly forbidden. Every finding must include: (1) Target Entity ID, (2) Failure Scenario / Attack Vector, (3) Concrete PoC (input vector, sequence breakdown, or mutant code), and (4) Expected Impact.
|
|
14448
|
+
- **NON-INVASIVE GUARDRAIL**: You do NOT patch the vulnerabilities or bugs yourself.
|
|
14449
|
+
- **Mandatory Return Handoff**: Emit the canonical Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) addressing the audited agent, demanding verified mitigation before downstream promotion.
|
|
14450
|
+
- **ANTI-PING-PONG GUARDRAIL**: Enforce maximum 1 adversarial return round per increment.`
|
|
14094
14451
|
}
|
|
14095
14452
|
];
|
|
14096
14453
|
function renderAntigravityAgentFile(agent) {
|
|
@@ -14160,12 +14517,20 @@ var LIFECYCLE_SKILL_TEMPLATES = [
|
|
|
14160
14517
|
{
|
|
14161
14518
|
id: "aisdlc-greenfield",
|
|
14162
14519
|
title: "Greenfield Project Inception & Delivery Playbook",
|
|
14163
|
-
description: "Orchestrate end-to-end AI-SDLC onboarding and Phase 0 Inception for brand-new (Greenfield) projects, from repository initialization (aisdlc init) and NAF v4 Vision (ARCH-INTRO-*) through ProductShape, STRIDE Threat Modeling, arc42 Architecture, and initial SDD increment delivery.",
|
|
14520
|
+
description: "Orchestrate end-to-end AI-SDLC onboarding and Phase 0 Inception for brand-new (Greenfield) projects, from repository initialization (aisdlc init) and NAF v4 Vision (ARCH-INTRO-*) through ProductShape, STRIDE Threat Modeling, arc42 Architecture, transversal auditor/adversary verification loops, and initial SDD increment delivery.",
|
|
14164
14521
|
references: "[`process/02_product_definition.md`](../../process/02_product_definition.md), [`process/04b_data_protection_and_privacy.md`](../../process/04b_data_protection_and_privacy.md), [`process/05_architecture_arc42_nafv4.md`](../../process/05_architecture_arc42_nafv4.md), [`process/06_spec_driven_development.md`](../../process/06_spec_driven_development.md), and [`process/09_agent_protocols.md`](../../process/09_agent_protocols.md).",
|
|
14165
14522
|
globs: "product/**, specs/product/**, architecture/**, templates/**",
|
|
14166
14523
|
body: `## Purpose & Trigger
|
|
14167
14524
|
Use this skill when starting a **brand-new software project from scratch (Greenfield)** or when \`specs/product/\` has no canonical baseline yet. It coordinates the sequential execution of AI-SDLC MCP/CLI tools and specialized role agents so no code is written before product vision, security enclaves, privacy-by-design controls, and architecture contracts exist.
|
|
14168
14525
|
|
|
14526
|
+
## Mandatory Transversal Quality & Adversarial Protocol
|
|
14527
|
+
Every authoring agent deliverable across Phase 0 and Inception undergoes mandatory quality auditing and adversarial stress-testing before downstream progression:
|
|
14528
|
+
- **Concurrent Inspection**: Immediately following the execution of any authoring agent (\`agent-product-analyst\`, \`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`), invoke [\`agent-auditor\`](../agent-auditor/SKILL.md) (evaluating YAGNI, structural debt, and simplification) and [\`agent-adversary\`](../agent-adversary/SKILL.md) (stress-testing logic traps, SPOFs, attack vectors, or broken invariants) **concurrently** in clean, isolated context windows.
|
|
14529
|
+
- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.
|
|
14530
|
+
- **Consolidated Remediation Re-Execution**: Consolidate findings and emit the Workflow Handoff back to the authoring agent, who is re-executed to resolve blocking defects and apply simplifications.
|
|
14531
|
+
- **Anti-Ping-Pong Guardrail (Max 2 Rounds)**: Bounded strictly to a maximum of **2 correction rounds** per phase/deliverable. If non-blocking advisories remain after round 2, proceed to the downstream phase; if blocking defects persist after round 2, escalate immediately to the Human Tech Lead.
|
|
14532
|
+
- **Exclusion of Downstream Review & Validation Roles**: Review and validation agents (\`agent-expert-user\`, \`agent-code-reviewer\`, \`agent-security-auditor\`, \`agent-compliance-checker\`) evaluate finished deliverables and are excluded from being audited by this loop.
|
|
14533
|
+
|
|
14169
14534
|
## End-to-End Execution Playbook
|
|
14170
14535
|
|
|
14171
14536
|
### Step 1: Repository Turnkey Initialization
|
|
@@ -14185,6 +14550,9 @@ Use this skill when starting a **brand-new software project from scratch (Greenf
|
|
|
14185
14550
|
- Actors (\`ACT-*\`), Use Cases (\`UC-*\`), Business Rules (\`BR-*\`), Functional Requirements (\`FR-*\` with mandatory \`@nominal\`, \`@boundary\`, \`@invalid\` Gherkin blocks), and Quality Requirements (\`QR-*\`).
|
|
14186
14551
|
5. Validate schemas and duplicates via MCP tools \`verify_schemas\` and \`verify_duplicates\` (or \`npx aisdlc check --fix\`).
|
|
14187
14552
|
6. **Mandatory Upstream UX & MVP Boundary Gate (\`agent-expert-user\`)**: Invoke [\`agent-expert-user\`](../agent-expert-user/SKILL.md) in **Design Mode** to stress-test the proposed workflows, enforce strict MVP boundaries, and separate core MVP \`UC-*\` from future roadmap backlog (\`templates/product/user-design-feedback.template.md\`).
|
|
14553
|
+
7. **Transversal Quality & Adversarial Loop (\`agent-product-analyst\`)**:
|
|
14554
|
+
- Concurrently invoke \`agent-auditor\` and \`agent-adversary\` on the draft product artifacts in isolated context windows.
|
|
14555
|
+
- Consolidate findings and hand off back to \`agent-product-analyst\` to re-execute and remediate issues (max 2 correction rounds).
|
|
14188
14556
|
|
|
14189
14557
|
### Step 3: Shift-Left Cybersecurity & Privacy-by-Design (\`agent-threat-modeler\` \u2794 \`agent-privacy-officer\`)
|
|
14190
14558
|
1. Delegate to or adopt [\`agent-threat-modeler\`](../agent-threat-modeler/SKILL.md).
|
|
@@ -14192,15 +14560,24 @@ Use this skill when starting a **brand-new software project from scratch (Greenf
|
|
|
14192
14560
|
- Threat Actors (\`ACT-THREAT-*\`)
|
|
14193
14561
|
- Abuse Cases (\`ABUSE-*\` targeting \`UC-*\`)
|
|
14194
14562
|
- Security Requirements (\`SEC-REQ-*\` with \`@security @mitigation\` negative Gherkin scenarios and \`SEC-ENC-*\` Zero Trust enclave bindings).
|
|
14195
|
-
3.
|
|
14563
|
+
3. **Transversal Quality & Adversarial Loop (\`agent-threat-modeler\`)**:
|
|
14564
|
+
- Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over the security threat models.
|
|
14565
|
+
- Consolidate findings and return handoff to \`agent-threat-modeler\` to re-execute and remediate (max 2 correction rounds).
|
|
14566
|
+
4. Hand off to [\`agent-privacy-officer\`](../agent-privacy-officer/SKILL.md) to apply LINDDUN and GDPR/LOPDGDD/ISO 27701 in \`specs/privacy/\`:
|
|
14196
14567
|
- Personal Data Assets (\`DATA-ASSET-*\`), GDPR Art. 30 Records of Processing (\`PRIV-ROPA-*\`), and Privacy Requirements (\`PRIV-REQ-*\` with \`@privacy @gdpr\` Gherkin scenarios).
|
|
14197
|
-
|
|
14568
|
+
5. **Transversal Quality & Adversarial Loop (\`agent-privacy-officer\`)**:
|
|
14569
|
+
- Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over the privacy records and requirements.
|
|
14570
|
+
- Consolidate findings and return handoff to \`agent-privacy-officer\` to re-execute and remediate (max 2 correction rounds).
|
|
14571
|
+
6. Run \`verify_schemas\` and \`verify_privacy\` (\`npx aisdlc verify privacy\`).
|
|
14198
14572
|
|
|
14199
14573
|
### Step 4: Modular Systems Architecture (\`agent-system-architect\`)
|
|
14200
14574
|
1. Delegate to or adopt [\`agent-system-architect\`](../agent-system-architect/SKILL.md).
|
|
14201
14575
|
2. Define building blocks (\`CMP-*\`) and Architectural Decision Records (\`ADR-*\`) in \`specs/architecture/\` using \`templates/architecture/\`, ensuring every \`CMP-*\` cites \`implements-use-cases\` (\`UC-*\`) and \`satisfies-requirements\` (\`FR-*\`, \`QR-*\`, \`SEC-REQ-*\`, \`PRIV-REQ-*\`).
|
|
14202
14576
|
3. Inspect third-party stack choices against \`license-policy.yaml\` via \`verify_licenses\` and subprocessors against \`privacy-policy.yaml\` via \`verify_privacy\`.
|
|
14203
14577
|
4. **Technical Security & Privacy Feedback Loop**: If new infrastructure, persistence, LLM, or auth decisions introduce attack vectors or PII flows, return to \`agent-threat-modeler\` \u2794 \`agent-privacy-officer\` to add technical \`SEC-REQ-*\` and \`PRIV-REQ-*\` mitigations before coding.
|
|
14578
|
+
5. **Transversal Quality & Adversarial Loop (\`agent-system-architect\`)**:
|
|
14579
|
+
- Concurrently invoke \`agent-auditor\` (evaluating YAGNI, architecture bloat, Ports & Adapters interfaces) and \`agent-adversary\` (simulating SPOFs, race conditions, cascading outages) in isolated context windows.
|
|
14580
|
+
- Consolidate findings and return handoff to \`agent-system-architect\` to re-execute and remediate (max 2 correction rounds).
|
|
14204
14581
|
|
|
14205
14582
|
### Step 5: Release Milestone & Topological Wave SDD Plan (\`1 UC-* = 1 CHG-*\`)
|
|
14206
14583
|
1. **Open Release Milestone (\`Tier 2: release/v1.0.0\`)**: Group the approved MVP Use Cases (\`UC-001\`, \`UC-002\`, ...) under the initial release milestone (\`release/v1.0.0\`) and visualize the branch hierarchy via \`npx aisdlc git plan\`.
|
|
@@ -14210,6 +14587,8 @@ Use this skill when starting a **brand-new software project from scratch (Greenf
|
|
|
14210
14587
|
3. **Release Consolidation (\`release/v1.0.0\` \u2794 \`main\`)**: Once all MVP \`CHG-*\` increments are integrated (\`sdd_integrate\`), run \`verify\` (\`npx aisdlc verify all\`), generate SBOM (\`npx aisdlc verify licenses --sbom reports/sbom.cdx.json --notices THIRD_PARTY_NOTICES.md\`), compute release KPIs (\`kpi_release\`), and open the Release PR into \`main\` for human Product Owner & Release Manager sign-off.
|
|
14211
14588
|
|
|
14212
14589
|
## Non-Negotiable Guardrails
|
|
14590
|
+
- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. In subagent-capable IDEs (Antigravity \`invoke_subagent\`, Claude Code \`Task\` / \`.claude/agents/\`, GitHub Copilot \`@agent-*\`), always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk (\`specs/\`, \`handoff.yaml\`, \`get_active_handoff\`). In chat-based IDEs (Cursor, Windsurf, Aider), persist all artifacts to disk, emit the Workflow Handoff block, and instruct the user to open a **New Chat** (or \`/clear\`) before running the next specialist.
|
|
14591
|
+
- **Mandatory Transversal Quality & Adversarial Loop**: Every authoring agent deliverable must undergo concurrent inspection by \`agent-auditor\` and \`agent-adversary\` in isolated context windows, followed by a re-execution of the authoring agent to remediate findings. To prevent infinite cycles, enforce the **Anti-Ping-Pong Guardrail**: maximum 2 correction rounds per phase; if unresolved blocking defects persist after round 2, escalate to the Human Tech Lead.
|
|
14213
14592
|
- **FORBIDDEN Greenfield Monolith (\`1 UC-* = 1 CHG-*\`)**: Never bundle the entire product or multiple \`UC-*\` into a single SDD change (\`CHG-001\`). Deterministic Gate 3 (\`verify_governance\`) blocks any \`handoff.yaml\` containing $> 1$ Use Case (\`Greenfield monolith detected\`). Parallelism is achieved by running **multiple bounded \`CHG-*\` concurrently** on separate branches/worktrees, never by stuffing multiple \`UC-*\` into one \`CHG-*\`.
|
|
14214
14593
|
- Never invoke \`sdd_change_new\` or write application code in \`src/\` on a Greenfield project before \`ARCH-INTRO-001\`, \`agent-expert-user\` MVP validation, and at least one \`UC-*\` and \`FR-*\` exist.
|
|
14215
14594
|
- All newly drafted specifications must start with \`status: draft\`.
|
|
@@ -14218,12 +14597,20 @@ Use this skill when starting a **brand-new software project from scratch (Greenf
|
|
|
14218
14597
|
{
|
|
14219
14598
|
id: "aisdlc-legacy-onboarding",
|
|
14220
14599
|
title: "Legacy / Brownfield Retro-Inception Playbook",
|
|
14221
|
-
description: "Orchestrate progressive AI-SDLC adoption and Brownfield retro-inception on existing or legacy repositories without breaking production code, reverse-engineering architecture (ARCH-INTRO-*, CMP-*) and establishing baseline quality, security, and license audits before new SDD increments.",
|
|
14600
|
+
description: "Orchestrate progressive AI-SDLC adoption and Brownfield retro-inception on existing or legacy repositories without breaking production code, reverse-engineering architecture (ARCH-INTRO-*, CMP-*), transversal auditor/adversary verification loops, and establishing baseline quality, security, and license audits before new SDD increments.",
|
|
14222
14601
|
references: "[`process/02_product_definition.md`](../../process/02_product_definition.md), [`process/04_open_source_license_compliance.md`](../../process/04_open_source_license_compliance.md), [`process/04b_data_protection_and_privacy.md`](../../process/04b_data_protection_and_privacy.md), [`process/05_architecture_arc42_nafv4.md`](../../process/05_architecture_arc42_nafv4.md), [`process/10_quality_management_and_release_gates.md`](../../process/10_quality_management_and_release_gates.md), and [`process/09_agent_protocols.md`](../../process/09_agent_protocols.md).",
|
|
14223
14602
|
globs: "architecture/**, specs/**, src/**, packages/**",
|
|
14224
14603
|
body: `## Purpose & Trigger
|
|
14225
14604
|
Use this skill when **adopting AI-SDLC in an existing or legacy codebase (Brownfield)** that already has production source code (\`src/\`, \`packages/\`, etc.) but lacks canonical PDaC specifications, arc42 architecture views, or deterministic quality/license/privacy gates.
|
|
14226
14605
|
|
|
14606
|
+
## Mandatory Transversal Quality & Adversarial Protocol
|
|
14607
|
+
Every authoring agent deliverable during Brownfield retro-inception undergoes mandatory quality auditing and adversarial stress-testing before downstream progression:
|
|
14608
|
+
- **Concurrent Inspection**: Immediately following the execution of any authoring agent (\`agent-product-analyst\`, \`agent-system-architect\`, \`agent-threat-modeler\`, \`agent-privacy-officer\`), invoke [\`agent-auditor\`](../agent-auditor/SKILL.md) (evaluating YAGNI, over-specification, and structural clarity) and [\`agent-adversary\`](../agent-adversary/SKILL.md) (uncovering hidden assumptions, boundary breaks, and contradictory legacy rules) **concurrently** in clean, isolated context windows.
|
|
14609
|
+
- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.
|
|
14610
|
+
- **Consolidated Remediation Re-Execution**: Consolidate findings and emit the Workflow Handoff back to the authoring agent, who is re-executed to resolve blocking defects and apply simplifications.
|
|
14611
|
+
- **Anti-Ping-Pong Guardrail (Max 2 Rounds)**: Bounded strictly to a maximum of **2 correction rounds** per phase/deliverable. If non-blocking advisories remain after round 2, proceed to the downstream phase; if blocking defects persist after round 2, escalate immediately to the Human Tech Lead.
|
|
14612
|
+
- **Exclusion of Diagnostic/Review Roles**: Read-only baseline verifiers and diagnostic review roles (\`agent-compliance-checker\`, \`agent-security-auditor\`, \`agent-code-reviewer\`) assess pre-existing code and are excluded from being audited by this loop.
|
|
14613
|
+
|
|
14227
14614
|
## End-to-End Execution Playbook
|
|
14228
14615
|
|
|
14229
14616
|
### Step 1: Non-Destructive Framework Scaffolding
|
|
@@ -14241,9 +14628,13 @@ Before modifying any code or creating SDD changes, run diagnostic verifiers to q
|
|
|
14241
14628
|
### Step 3: Brownfield Retro-Inception (\`agent-system-architect\` & \`agent-product-analyst\`)
|
|
14242
14629
|
Instead of attempting to document 100% of a legacy monolith upfront, apply **bounded retro-inception** focused on the system boundary and the domain areas under active evolution:
|
|
14243
14630
|
1. **System Vision & Context (\`ARCH-INTRO-001\`)**: Use [\`agent-product-analyst\`](../agent-product-analyst/SKILL.md) to document the current system's mission, primary actors (\`ACT-*\`), and top quality goals (\`QR-*\`) in \`specs/architecture/ARCH-INTRO-001.md\`.
|
|
14631
|
+
- **Transversal Loop**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over \`ARCH-INTRO-001\`. Consolidate findings and return handoff to \`agent-product-analyst\` to re-execute and remediate (max 2 correction rounds).
|
|
14244
14632
|
2. **As-Is Component Mapping (\`CMP-*\` & \`ADR-*\`)**: Use [\`agent-system-architect\`](../agent-system-architect/SKILL.md) to map existing core modules/services into \`specs/architecture/CMP-*.md\` and capture historical architectural constraints (\`CON-*\`, \`ADR-*\`).
|
|
14633
|
+
- **Transversal Loop**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over component models. Consolidate findings and return handoff to \`agent-system-architect\` to re-execute and remediate (max 2 correction rounds).
|
|
14245
14634
|
3. **Core Use Cases Extraction (\`UC-*\`, \`FR-*\`)**: Extract canonical \`UC-*\` and \`FR-*\` artifacts in \`specs/product/\` for the specific bounded context or module that will be modified or extended next, including Gherkin acceptance scenarios reflecting current expected behavior (characterization specs).
|
|
14635
|
+
- **Transversal Loop**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over extracted \`UC-*\`/\`FR-*\`. Consolidate findings and return handoff to \`agent-product-analyst\` to re-execute and remediate (max 2 correction rounds).
|
|
14246
14636
|
4. **Threat & Privacy Boundary Mapping (\`agent-threat-modeler\` \u2794 \`agent-privacy-officer\`)**: Map existing trust zones (\`SEC-ENC-*\`), active threat vectors (\`ACT-THREAT-*\`, \`ABUSE-*\`, \`SEC-REQ-*\`), and personal data inventories (\`DATA-ASSET-*\`, \`PRIV-ROPA-*\`, \`PRIV-REQ-*\`) on the target module.
|
|
14637
|
+
- **Transversal Loop**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over threat and privacy models. Consolidate findings and return handoff to \`agent-threat-modeler\` and \`agent-privacy-officer\` to re-execute and remediate (max 2 correction rounds).
|
|
14247
14638
|
|
|
14248
14639
|
### Step 4: Characterization Testing & Synchronization
|
|
14249
14640
|
1. Run MCP tool \`sdd_check_fix\` (\`npx aisdlc check --fix\`) to extract \`.feature\` files and compute canonical SHA-256 digests.
|
|
@@ -14253,6 +14644,8 @@ Instead of attempting to document 100% of a legacy monolith upfront, apply **bou
|
|
|
14253
14644
|
Once the target domain's baseline artifacts (\`ARCH-INTRO-*\`, \`UC-*\`, \`FR-*\`, \`CMP-*\`) are in place, execute all new features, refactorings, or bugfixes via [\`aisdlc-increment\`](../aisdlc-increment/SKILL.md).
|
|
14254
14645
|
|
|
14255
14646
|
## Non-Negotiable Guardrails
|
|
14647
|
+
- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. In subagent-capable IDEs (Antigravity \`invoke_subagent\`, Claude Code \`Task\` / \`.claude/agents/\`, GitHub Copilot \`@agent-*\`), always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk (\`specs/\`, \`handoff.yaml\`, \`get_active_handoff\`). In chat-based IDEs (Cursor, Windsurf, Aider), persist all artifacts to disk, emit the Workflow Handoff block, and instruct the user to open a **New Chat** (or \`/clear\`) before running the next specialist.
|
|
14648
|
+
- **Mandatory Transversal Quality & Adversarial Loop**: Every authoring agent deliverable must undergo concurrent inspection by \`agent-auditor\` and \`agent-adversary\` in isolated context windows, followed by a re-execution of the authoring agent to remediate findings. To prevent infinite cycles, enforce the **Anti-Ping-Pong Guardrail**: maximum 2 correction rounds per phase; if unresolved blocking defects persist after round 2, escalate to the Human Tech Lead.
|
|
14256
14649
|
- **Zero Drive-By Rewrites**: Never mass-refactor untouched legacy modules during onboarding. Apply the Strangler / Boy Scout rule: bring touched functions into compliance with \`quality-policy.yaml\` incrementally via governed SDD tasks (\`TSK-*\`).
|
|
14257
14650
|
- **Characterization First**: Never alter legacy business logic without first capturing its current behavior in an \`FR-*\` Gherkin specification and a verifiable test suite (\`agent-qa-engineer\`).
|
|
14258
14651
|
- **Immediate Secret Remediation**: If Step 2 (\`verify_security\`) uncovers leaked credentials (exit code 4), halt feature work and remediate/rotate secrets immediately.`
|
|
@@ -14260,7 +14653,7 @@ Once the target domain's baseline artifacts (\`ARCH-INTRO-*\`, \`UC-*\`, \`FR-*\
|
|
|
14260
14653
|
{
|
|
14261
14654
|
id: "aisdlc-increment",
|
|
14262
14655
|
title: "Bounded SDD Feature & Bugfix Delivery Playbook",
|
|
14263
|
-
description: "Orchestrate the complete Spec-Driven Development (SDD) lifecycle for bounded feature increments, enhancements, and bugfixes (CHG-* / TSK-*), from upstream requirement derivation and 4-tier Git branching through Red-Green-Refactor TDD, Pre-Merge Audit Triad, all 11 Quality Gates, and canonical baseline integration.",
|
|
14656
|
+
description: "Orchestrate the complete Spec-Driven Development (SDD) lifecycle for bounded feature increments, enhancements, and bugfixes (CHG-* / TSK-*), from upstream requirement derivation and 4-tier Git branching through Red-Green-Refactor TDD, transversal auditor/adversary verification loops, Pre-Merge Audit Triad, all 11 Quality Gates, and canonical baseline integration.",
|
|
14264
14657
|
references: "[`process/06_spec_driven_development.md`](../../process/06_spec_driven_development.md), [`process/08_citation_contract_and_drift.md`](../../process/08_citation_contract_and_drift.md), [`process/10_quality_management_and_release_gates.md`](../../process/10_quality_management_and_release_gates.md), [`process/11_git_branching_and_lifecycle.md`](../../process/11_git_branching_and_lifecycle.md), and [`process/09_agent_protocols.md`](../../process/09_agent_protocols.md).",
|
|
14265
14658
|
globs: "specs/changes/**, src/**, packages/**, tests/**",
|
|
14266
14659
|
body: `## Purpose & Trigger
|
|
@@ -14272,9 +14665,12 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14272
14665
|
1. Inspect active changes via MCP tool \`get_active_handoff\` and verify whether the target Use Case (\`UC-*\`) or Requirement (\`FR-*\`) already exists in \`specs/product/\`.
|
|
14273
14666
|
2. If the increment introduces new behavior or modifies business rules:
|
|
14274
14667
|
- Use [\`agent-product-analyst\`](../agent-product-analyst/SKILL.md) to create or update the \`UC-*\`, \`BR-*\`, and \`FR-*\` (with \`@nominal\`, \`@boundary\`, \`@invalid\` Gherkin scenarios).
|
|
14668
|
+
- **Transversal Loop (\`agent-product-analyst\`)**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over updated specs. Consolidate findings and return handoff to \`agent-product-analyst\` to re-execute and remediate (max 2 correction rounds).
|
|
14275
14669
|
- Run MCP tool \`verify_duplicates\` (\`npx aisdlc verify duplicates\`) to block lexical or functional collisions early.
|
|
14276
14670
|
- Use [\`agent-threat-modeler\`](../agent-threat-modeler/SKILL.md) to model any new \`ABUSE-*\` and \`SEC-REQ-*\` mitigations.
|
|
14671
|
+
- **Transversal Loop (\`agent-threat-modeler\`)**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over security models. Consolidate findings and return handoff to \`agent-threat-modeler\` to re-execute and remediate (max 2 correction rounds).
|
|
14277
14672
|
- Hand off to [\`agent-privacy-officer\`](../agent-privacy-officer/SKILL.md) to model any personal data assets (\`DATA-ASSET-*\`), GDPR Art. 30 processing activities (\`PRIV-ROPA-*\`), and privacy requirements (\`PRIV-REQ-*\`).
|
|
14673
|
+
- **Transversal Loop (\`agent-privacy-officer\`)**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over privacy models. Consolidate findings and return handoff to \`agent-privacy-officer\` to re-execute and remediate (max 2 correction rounds).
|
|
14278
14674
|
3. Run \`sdd_check_fix\` (\`npx aisdlc check --fix\`) to sync Gherkin \`.feature\` files and validate schemas.
|
|
14279
14675
|
|
|
14280
14676
|
### Step 2: SDD Change Scaffolding & Architectural Design (\`agent-system-architect\`)
|
|
@@ -14282,7 +14678,10 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14282
14678
|
2. Use [\`agent-system-architect\`](../agent-system-architect/SKILL.md) to complete \`specs/changes/active/<chg-id>/design.md\` and \`specs/architecture/CMP-*.md\`:
|
|
14283
14679
|
- Structure \`CMP-*\` and \`design.md\` around **Modular & Hexagonal Architecture (Ports & Adapters)** (Domain/Application Core + Inbound/Outbound Ports) and define **Contract-First** shared interfaces/DTOs/schemas when spanning Frontend and Backend.
|
|
14284
14680
|
- Map 100% of \`handoff.yaml\` requirements and components to atomic tasks (\`TSK-*\`) in \`tasks.md\` with explicit \`autonomy-mode\` (\`AUTONOMOUS\`, \`HUMAN_REVIEW_PLAN\`, \`HIGH_RISK_MANUAL\`, \`AMBIGUOUS\`).
|
|
14285
|
-
3.
|
|
14681
|
+
3. **Transversal Loop (\`agent-system-architect\`)**:
|
|
14682
|
+
- Concurrently invoke \`agent-auditor\` (evaluating YAGNI, interface bloat, task completeness) and \`agent-adversary\` (probing race conditions, contract drift, SPOFs) in isolated context windows.
|
|
14683
|
+
- Consolidate findings and return handoff to \`agent-system-architect\` to re-execute and remediate (max 2 correction rounds).
|
|
14684
|
+
4. Run \`verify_governance\` and \`verify_friction\` to validate task governance, 100% design/handoff scope coverage, and anti-monolith limits (\`maxUseCasesPerChange = 1\`).
|
|
14286
14685
|
|
|
14287
14686
|
### Step 3: 4-Tier Git Branch Navigation & Multi-Agent Parallelism
|
|
14288
14687
|
1. Navigate to the task branch using \`npx aisdlc git checkout <TSK-ID>\` (\`pnpm run git:checkout <TSK-ID>\`), which cascade-creates:
|
|
@@ -14295,7 +14694,10 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14295
14694
|
### Step 4: Red Phase \u2014 Failing Test Suites (\`agent-qa-engineer\`)
|
|
14296
14695
|
1. Delegate to or adopt [\`agent-qa-engineer\`](../agent-qa-engineer/SKILL.md).
|
|
14297
14696
|
2. Author FAILING (red) BDD/Gherkin step definitions, integration/contract tests, and mandatory E2E/UI tests (evaluating Happy Path, Sad Path, and Boundary Values for every interactive UI element, plus \`UC-*\` alternative/exception flows) in \`tests/\`.
|
|
14298
|
-
3.
|
|
14697
|
+
3. **Transversal Loop (\`agent-qa-engineer\`)**:
|
|
14698
|
+
- Concurrently invoke \`agent-auditor\` (checking test overengineering, brittle assertions) and \`agent-adversary\` (running conceptual mutation testing to prove whether trivial or empty implementations could falsely pass tests green) in isolated context windows.
|
|
14699
|
+
- Consolidate findings and return handoff to \`agent-qa-engineer\` to re-execute and harden test suites (max 2 correction rounds).
|
|
14700
|
+
4. Run \`verify_testing\` (\`npx aisdlc verify testing\`) to confirm requirement test coverage before writing production code.
|
|
14299
14701
|
|
|
14300
14702
|
### Step 5: Green & Refactor Phase \u2014 Surgical Implementation (\`agent-developer\`)
|
|
14301
14703
|
1. Delegate to or adopt [\`agent-developer\`](../agent-developer/SKILL.md).
|
|
@@ -14303,6 +14705,19 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14303
14705
|
- (1) Modular & Hexagonal Architecture (Ports & Adapters) boundaries, (2) Inter-module interfaces/ports first, (3) Concrete component implementation (zero fake-wiring; all 4 UI states \`Loading\`, \`Empty\`, \`Error\`, \`Nominal\`), (4) Exhaustive per-function unit tests in \`tests/unit/\` (Happy Path, Sad Path, Boundary, Null/Empty).
|
|
14304
14706
|
3. Verify any new dependency against \`license-policy.yaml\` via \`verify_licenses\` and PII handling against \`privacy-policy.yaml\` via \`verify_privacy\`.
|
|
14305
14707
|
4. Run \`sdd_check_fix\` (\`npx aisdlc check --fix\`) and \`verify_quality\` (\`npx aisdlc verify quality\`) until Cyclomatic Complexity $\\le 10$, Cognitive $\\le 15$, Maintainability $\\ge 50$, and Function Length $\\le 40$ lines pass with zero violations.
|
|
14708
|
+
5. **Transversal Loop (\`agent-developer\`)**:
|
|
14709
|
+
- Concurrently invoke \`agent-auditor\` (detecting overengineering, speculative parameters, AST complexity) and \`agent-adversary\` (attacking boundary inputs, concurrency races, type edge breaks with concrete PoCs) in isolated context windows.
|
|
14710
|
+
- Consolidate findings and return handoff to \`agent-developer\` to re-execute and remediate (max 2 correction rounds).
|
|
14711
|
+
|
|
14712
|
+
### Mandatory Transversal Quality & Adversarial Protocol
|
|
14713
|
+
- **Systematic Post-Agent Execution**: Immediately following the execution of any authoring agent (\`agent-product-analyst\`, \`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-qa-engineer\`, \`agent-developer\`, \`agent-devops\`), invoke \`agent-auditor\` and \`agent-adversary\` concurrently in clean, isolated context windows over that agent's deliverables.
|
|
14714
|
+
- **Concurrent Inspection**:
|
|
14715
|
+
* [\`agent-auditor\`](../agent-auditor/SKILL.md) inspects deliverables for structural debt, premature generalizations, or unneeded complexity (YAGNI).
|
|
14716
|
+
* [\`agent-adversary\`](../agent-adversary/SKILL.md) actively stress-tests deliverables: uncovers requirement contradictions, simulates architectural race conditions/SPOFs, conducts conceptual mutation testing on QA suites, or crafts breaking boundary payloads for code with mandatory proof-of-break.
|
|
14717
|
+
- **Non-Invasive Guardrail**: Neither auditor nor adversary edits files directly. Both emit structured findings citing canonical IDs and SHA-256 hashes.
|
|
14718
|
+
- **Consolidated Handoff & Remediation Re-Execution**: Consolidate findings and emit the Workflow Handoff back to the audited authoring agent, who is re-executed to resolve the findings.
|
|
14719
|
+
- **Anti-Ping-Pong Guardrail (Max 2 Rounds)**: Enforce a strict boundary of maximum **2 correction rounds** per phase/deliverable. If non-blocking advisories remain after round 2, proceed downstream; if blocking defects persist after round 2, escalate to the Human Tech Lead.
|
|
14720
|
+
- **Exclusion of Downstream Review & Validation Roles**: Pre-merge review agents (\`agent-code-reviewer\`, \`agent-security-auditor\`, \`agent-compliance-checker\`) and validation agents (\`agent-expert-user\`) evaluate finished deliverables and are excluded from being audited by this loop.
|
|
14306
14721
|
|
|
14307
14722
|
### Step 6: Post-Development Functional Validation & Pre-Merge Audit Triad
|
|
14308
14723
|
1. **Functional Validation (\`agent-expert-user\`)**: Validate live runtime behavior against \`UC-*\` and \`FR-*\` criteria (including \`0\` browser \`console.error\`/\`pageerror\` on UI changes).
|
|
@@ -14321,6 +14736,8 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14321
14736
|
- Open the Release PR from \`release/vX.Y.Z\` to \`main\` for final human Product Owner and Release Manager approval and semantic Git tagging (\`vX.Y.Z\`).
|
|
14322
14737
|
|
|
14323
14738
|
## Non-Negotiable Guardrails
|
|
14739
|
+
- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles (e.g., \`agent-qa-engineer\` and \`agent-developer\`, or \`agent-developer\` and \`agent-security-auditor\`) in the same conversation context window. In subagent-capable IDEs (Antigravity \`invoke_subagent\`, Claude Code \`Task\` / \`.claude/agents/\`, GitHub Copilot \`@agent-*\`), always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk (\`specs/\`, \`handoff.yaml\`, \`get_active_handoff\`). In chat-based IDEs (Cursor, Windsurf, Aider), persist all artifacts to disk, emit the Workflow Handoff block, and instruct the user to open a **New Chat** (or \`/clear\`) before running the next specialist.
|
|
14740
|
+
- **Mandatory Transversal Quality & Adversarial Loop**: Every authoring agent deliverable must undergo concurrent inspection by \`agent-auditor\` and \`agent-adversary\` in isolated context windows, followed by a re-execution of the authoring agent to remediate findings. To prevent infinite cycles, enforce the **Anti-Ping-Pong Guardrail**: maximum 2 correction rounds per phase; if unresolved blocking defects persist after round 2, escalate to the Human Tech Lead.
|
|
14324
14741
|
- **Single-Use-Case Scope (\`1 UC-* = 1 CHG-*\`)**: Each SDD change (\`CHG-*\`) must deliver at most 1 Use Case (\`UC-*\`). Bundling multiple \`UC-*\` into one \`handoff.yaml\` is blocked by \`verify_governance\` (\`Greenfield monolith detected\`). Scale throughput via parallel \`CHG-*\` branches/worktrees, not monolithic changes.
|
|
14325
14742
|
- **100% Design & Handoff Coverage in \`tasks.md\`**: Every \`CMP-*\`, \`FR-*\`, \`SEC-REQ-*\`, and \`PRIV-REQ-*\` declared in \`design.md\` and \`handoff.yaml\` must be explicitly assigned to at least one \`TSK-*\` in \`tasks.md\`.`
|
|
14326
14743
|
}
|
|
@@ -14497,6 +14914,14 @@ This file defines the operational rules and specialized role mappings for Google
|
|
|
14497
14914
|
- **Cross-Workflow Audit**: When fixing any CI/CD or configuration defect detected in a PR, search all \`.github/workflows/*.yml\` for the same pattern (including release, post-merge, and publishing pipelines) before declaring the fix complete.
|
|
14498
14915
|
- **Remote Verification**: Creating a PR (\`gh pr create\`) does not equal success; actively verify that remote checks pass (\`gh pr checks\`).
|
|
14499
14916
|
|
|
14917
|
+
### 12. \`agent-auditor\` (Transversal Quality and Improvement Auditor)
|
|
14918
|
+
- **Mission**: Polymorphically inspect deliverables from any specialist agent on demand, identifying structural weaknesses, overengineering, or blind spots, and proposing minimal solutions adhering strictly to YAGNI.
|
|
14919
|
+
- **Directives**: Constructive critique; classify findings into \`[BLOCKING_DEFECT]\`, \`[SIMPLIFICATION]\`, and \`[ADVISORY]\`; non-invasive (never edit files directly); always return handoff to the audited agent (max 1 return round).
|
|
14920
|
+
|
|
14921
|
+
### 13. \`agent-adversary\` (Transversal Red Team and Chaos Adversary)
|
|
14922
|
+
- **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps.
|
|
14923
|
+
- **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens), Code (boundary/concurrency), and DevOps (pipeline escape); mandatory proof-of-break; non-invasive; always return handoff to the audited agent (max 1 return round).
|
|
14924
|
+
|
|
14500
14925
|
---
|
|
14501
14926
|
|
|
14502
14927
|
## 3. Git 4-Tier Hierarchy and Commit Conventions
|
|
@@ -14512,10 +14937,11 @@ This file defines the operational rules and specialized role mappings for Google
|
|
|
14512
14937
|
---
|
|
14513
14938
|
|
|
14514
14939
|
## 4. Workflow Handoff Protocol and Human Action Window | Ventana de Acci\xF3n Humana
|
|
14940
|
+
- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. In subagent-capable IDEs (Antigravity \`invoke_subagent\`, Claude Code \`Task\` / \`.claude/agents/\`, GitHub Copilot \`@agent-*\`), always delegate each specialist phase to a fresh isolated subagent context that hydrates state strictly from disk (\`specs/\`, \`handoff.yaml\`, \`get_active_handoff\`). In chat-based IDEs (Cursor, Windsurf, Aider), persist all artifacts to disk, emit the Workflow Handoff block, and instruct the user to open a **New Chat** (or \`/clear\`) before running the next specialist.
|
|
14515
14941
|
- **Conditional Activation Rule by Autonomy**:
|
|
14516
14942
|
- \u{1F7E2} **\`AUTONOMOUS\`** (or exclusive final supervision in PR/CI): **OMITTED**. Do not request or emit interactive handoff to avoid interrupting unattended execution.
|
|
14517
14943
|
- \u{1F7E1} **Autonomy $\\ge$ \`HUMAN_REVIEW_PLAN\`** (\`HUMAN_REVIEW_PLAN\`, \`AMBIGUOUS\`, \`HIGH_RISK_MANUAL\`): **MANDATORY**. Emit the Workflow Handoff block compliant with [\`templates/workflow/agent-handoff.template.md\`](../../templates/workflow/agent-handoff.template.md) and **STOP**.
|
|
14518
|
-
- **Block Contents**: Declare produced deliverables, recommend the next role in workflow (\`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-qa-engineer\`, \`agent-developer\`, \`agent-expert-user\`, \`agent-code-reviewer\`, \`agent-security-auditor\`, \`agent-compliance-checker\`, \`agent-devops\`, etc.), provide suggested invocation prompt, and keep **the Human Action Window open at all times for the human user to take action** (review, edit by hand, pause/reroute, or delegate).
|
|
14944
|
+
- **Block Contents**: Declare produced deliverables, recommend the next role in workflow (\`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-qa-engineer\`, \`agent-developer\`, \`agent-expert-user\`, \`agent-code-reviewer\`, \`agent-security-auditor\`, \`agent-compliance-checker\`, \`agent-devops\`, \`agent-auditor\`, \`agent-adversary\`, etc.), provide suggested invocation prompt, and keep **the Human Action Window open at all times for the human user to take action** (review, edit by hand, pause/reroute, or delegate).
|
|
14519
14945
|
`;
|
|
14520
14946
|
var STARTER_CURSOR_CORE_RULES = `---
|
|
14521
14947
|
description: Global canonical directives, 5 unbreakable commandments, and AI-SDLC pre-flight
|
|
@@ -14562,6 +14988,8 @@ Before finalizing changes or proposing commits:
|
|
|
14562
14988
|
| \`agent-expert-user\` | Bimodal MVP evaluation (design) and functional validation against \`UC-*\` and \`FR-*\` (pre-PR). |
|
|
14563
14989
|
| \`agent-code-reviewer\` | PR audit (SOLID, DRY, YAGNI): \`[BLOCKING]\` / \`[CLEAN_CODE_SUGGESTION]\` / \`[COMPLIANT]\`. |
|
|
14564
14990
|
| \`agent-devops\` | CI/CD, Docker, IaC only \u2014 **FORBIDDEN** to touch \`src/\` or \`packages/*/src/\`. |
|
|
14991
|
+
| \`agent-auditor\` | Transversal on-demand constructive auditor; identifies overengineering, blind spots & YAGNI simplifications; returns handoff to audited agent. |
|
|
14992
|
+
| \`agent-adversary\` | Transversal on-demand Red Team adversary; breaks deliverables with reproducible PoC & mutation tests; returns handoff to audited agent. |
|
|
14565
14993
|
|
|
14566
14994
|
## 5. Task Autonomy Modes (\`tasks.md\`)
|
|
14567
14995
|
- \u{1F7E2} **\`AUTONOMOUS\`**: Low risk. Implement directly, omit handoff block.
|
|
@@ -14570,6 +14998,7 @@ Before finalizing changes or proposing commits:
|
|
|
14570
14998
|
- \u{1F534} **\`HIGH_RISK_MANUAL\`**: Critical risk. Human-only execution.
|
|
14571
14999
|
|
|
14572
15000
|
## 6. Workflow Handoff Protocol and Human Action Window | Ventana de Acci\xF3n Humana
|
|
15001
|
+
- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. In subagent-capable IDEs (Antigravity \`invoke_subagent\`, Claude Code \`Task\` / \`.claude/agents/\`, GitHub Copilot \`@agent-*\`), always delegate each specialist phase to a fresh isolated subagent context that hydrates state strictly from disk (\`specs/\`, \`handoff.yaml\`, \`get_active_handoff\`). In chat-based IDEs (Cursor, Windsurf, Aider), persist all artifacts to disk, emit the Workflow Handoff block, and instruct the user to open a **New Chat** (or \`/clear\`) before running the next specialist.
|
|
14573
15002
|
- **Conditional Activation**:
|
|
14574
15003
|
* \u{1F7E2} **\`AUTONOMOUS\`** (or PR/CI supervision): **OMITTED**. Do not request or emit interactive handoff.
|
|
14575
15004
|
* \u{1F7E1} **Autonomy $\\ge$ \`HUMAN_REVIEW_PLAN\`** (\`HUMAN_REVIEW_PLAN\`, \`AMBIGUOUS\`, \`HIGH_RISK_MANUAL\`): **MANDATORY**. Emit Workflow Handoff block compliant with [\`templates/workflow/agent-handoff.template.md\`](templates/workflow/agent-handoff.template.md) and **STOP**.
|
|
@@ -14731,6 +15160,14 @@ npx tsx packages/cli/src/index.ts sdd integrate --change <chg-id>
|
|
|
14731
15160
|
- **Mission**: Maintain, evolve, and audit automated project infrastructure: CI/CD workflows, Docker containers, IaC manifests, and support scripts.
|
|
14732
15161
|
- **NON-INVASION GUARDRAIL**: STRICTLY FORBIDDEN from modifying application source code (\`src/\`, \`packages/*/src/\`).
|
|
14733
15162
|
|
|
15163
|
+
### 12. \`agent-auditor\` (Transversal Quality and Improvement Auditor)
|
|
15164
|
+
- **Mission**: Polymorphically inspect deliverables from any specialist agent on demand, identifying structural weaknesses, overengineering, or blind spots, and proposing minimal solutions adhering strictly to YAGNI.
|
|
15165
|
+
- **Directives**: Constructive critique; classify findings into \`[BLOCKING_DEFECT]\`, \`[SIMPLIFICATION]\`, and \`[ADVISORY]\`; non-invasive (never edit files directly); always return handoff to the audited agent (max 1 return round).
|
|
15166
|
+
|
|
15167
|
+
### 13. \`agent-adversary\` (Transversal Red Team and Chaos Adversary)
|
|
15168
|
+
- **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps.
|
|
15169
|
+
- **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens), Code (boundary/concurrency), and DevOps (pipeline escape); mandatory proof-of-break; non-invasive; always return handoff to the audited agent (max 1 return round).
|
|
15170
|
+
|
|
14734
15171
|
---
|
|
14735
15172
|
|
|
14736
15173
|
## 4. Task Autonomy Modes (\`tasks.md\`)
|
|
@@ -14774,6 +15211,7 @@ Change-ID: CHG-026-AGENT-NATIVE-CONFIGS
|
|
|
14774
15211
|
---
|
|
14775
15212
|
|
|
14776
15213
|
## 7. Workflow Handoff Protocol and Human Action Window | Ventana de Acci\xF3n Humana
|
|
15214
|
+
- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. In subagent-capable IDEs (Antigravity \`invoke_subagent\`, Claude Code \`Task\` / \`.claude/agents/\`, GitHub Copilot \`@agent-*\`), always delegate each specialist phase to a fresh isolated subagent context that hydrates state strictly from disk (\`specs/\`, \`handoff.yaml\`, \`get_active_handoff\`). In chat-based IDEs (Cursor, Windsurf, Aider), persist all artifacts to disk, emit the Workflow Handoff block, and instruct the user to open a **New Chat** (or \`/clear\`) before running the next specialist.
|
|
14777
15215
|
- **Conditional Activation**:
|
|
14778
15216
|
- \u{1F7E2} **\`AUTONOMOUS\`** (or PR/CI final supervision): **OMITTED**. Uninterrupted continuous execution.
|
|
14779
15217
|
- \u{1F7E1} **Autonomy $\\ge$ \`HUMAN_REVIEW_PLAN\`** (\`HUMAN_REVIEW_PLAN\`, \`AMBIGUOUS\`, \`HIGH_RISK_MANUAL\`): **MANDATORY**. Emit Workflow Handoff block ([\`templates/workflow/agent-handoff.template.md\`](templates/workflow/agent-handoff.template.md)) and **STOP**.
|
|
@@ -14841,6 +15279,7 @@ Non-Negotiable Quality Thresholds (\`quality-policy.yaml\`):
|
|
|
14841
15279
|
---
|
|
14842
15280
|
|
|
14843
15281
|
## 5. Workflow Handoff Protocol and Human Action Window | Ventana de Acci\xF3n Humana
|
|
15282
|
+
- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. In subagent-capable IDEs (Antigravity \`invoke_subagent\`, Claude Code \`Task\` / \`.claude/agents/\`, GitHub Copilot \`@agent-*\`), always delegate each specialist phase to a fresh isolated subagent context that hydrates state strictly from disk (\`specs/\`, \`handoff.yaml\`, \`get_active_handoff\`). In chat-based IDEs (Cursor, Windsurf, Aider), persist all artifacts to disk, emit the Workflow Handoff block, and instruct the user to open a **New Chat** (or \`/clear\`) before running the next specialist.
|
|
14844
15283
|
- **Conditional Activation**:
|
|
14845
15284
|
* \u{1F7E2} **\`AUTONOMOUS\` Mode** (or PR/CI final supervision): **OMITTED**. Do not interrupt unattended execution.
|
|
14846
15285
|
* \u{1F7E1} **Autonomy $\\ge$ \`HUMAN_REVIEW_PLAN\`** (\`HUMAN_REVIEW_PLAN\`, \`AMBIGUOUS\`, \`HIGH_RISK_MANUAL\`): **MANDATORY**. Emit Workflow Handoff block compliant with [\`templates/workflow/agent-handoff.template.md\`](../templates/workflow/agent-handoff.template.md) and **STOP**.
|
|
@@ -14863,6 +15302,8 @@ Non-Negotiable Quality Thresholds (\`quality-policy.yaml\`):
|
|
|
14863
15302
|
| \`agent-expert-user\` | Bimodal MVP evaluation (design) and functional validation against \`UC-*\` and \`FR-*\` (pre-PR). |
|
|
14864
15303
|
| \`agent-code-reviewer\` | PR audit (SOLID, DRY, YAGNI): \`[BLOCKING]\` / \`[CLEAN_CODE_SUGGESTION]\` / \`[COMPLIANT]\`. |
|
|
14865
15304
|
| \`agent-devops\` | CI/CD, Docker, IaC only \u2014 **FORBIDDEN** to touch \`src/\` or \`packages/*/src/\`. |
|
|
15305
|
+
| \`agent-auditor\` | Transversal on-demand constructive auditor; identifies overengineering, blind spots & YAGNI simplifications; returns handoff to audited agent. |
|
|
15306
|
+
| \`agent-adversary\` | Transversal on-demand Red Team adversary; breaks deliverables with reproducible PoC & mutation tests; returns handoff to audited agent. |
|
|
14866
15307
|
|
|
14867
15308
|
---
|
|
14868
15309
|
|
|
@@ -15981,7 +16422,7 @@ Describes the adversary's profile, technical skill level, available resources, a
|
|
|
15981
16422
|
| :--- | :--- | :--- | :--- | :--- |\r
|
|
15982
16423
|
| **1.0.0** | 2026-09-03 | Security Officer / Threat Modeler | Initial threat profile characterization | CHG-SEC-001 |\r
|
|
15983
16424
|
`;
|
|
15984
|
-
var STARTER_TEMPLATES_WORKFLOW_AGENT_HANDOFF_TEMPLATE_MD = '# Workflow Handoff Template\r\n\r\n> **Canonical reference:** [`process/09_agent_protocols.md`](../../process/09_agent_protocols.md) and [`process/01_governance_and_roles.md`](../../process/01_governance_and_roles.md).\r\n>\r\n> **Activation Criterion by Autonomy Mode:**\r\n> - \u{1F7E2} **`AUTONOMOUS` (or exclusive supervision at the end in PR/CI):** OMITTED. The agent executes and delivers without interrupting the user with this handoff block.\r\n> - \u{1F7E1} **`HUMAN_REVIEW_PLAN` | \u{1F7E0} `AMBIGUOUS` | \u{1F534} `HIGH_RISK_MANUAL`:** MANDATORY. Upon completing the phase or proposal, the agent emits this block and **halts**, granting visibility to the user and relinquishing control.\r\n\r\n---\r\n\r\n### \u{1F504} Workflow Handoff\r\n\r\n- **Completed Phase / Activity**: `[Current phase, e.g. Product Definition / Threat Modeling / Privacy Modeling / Architecture / SDD Implementation]`\r\n- **Acting Role**: `[agent-product-analyst | agent-threat-modeler | agent-privacy-officer | agent-system-architect | agent-developer | agent-expert-user | agent-security-auditor | agent-compliance-checker]`\r\n- **Task Autonomy Mode**: `[HUMAN_REVIEW_PLAN | AMBIGUOUS | HIGH_RISK_MANUAL]`\r\n- **Produced Deliverables**:\r\n - [x] `[Path or ID of generated artifact, e.g. specs/product/uc-mission.md]`\r\n - [x] `[Path or ID of generated artifact, e.g. quality-report.md]`\r\n\r\n- **Recommended Next Role(s) in Workflow**:\r\n - `[Suggested role name, e.g. agent-threat-modeler]`: `[Technical rationale, e.g. Model STRIDE adversaries and mitigate abuse cases]`\r\n - *(Optional)* `[Alternative role, e.g. agent-expert-user]`: `[Technical rationale, e.g. Evaluate UX and MVP boundary]`\r\n\r\n- **Suggested Invocation Prompt**:\r\n > "Act as `[next-role]` and proceed with the `[next phase]` phase on the generated deliverables: `[key artifacts]`."\r\n\r\n- **Human Action Window (User Sovereignty and Priority)**:\r\n - \u270B **Review and Validate**: Inspect generated artifacts and validate alignment with project vision before proceeding.\r\n - \u270F\uFE0F **Edit Directly**: Modify requirements, code, or acceptance criteria directly at any time.\r\n - \u{1F6D1} **Pause, Divert, or Discard**: Freeze workflow, redirect toward another goal, or discard proposal.\r\n - \u25B6\uFE0F **Delegate to Next Agent**: If satisfied with output, execute suggested prompt to continue the chain.\r\n\r\n---\r\n';
|
|
16425
|
+
var STARTER_TEMPLATES_WORKFLOW_AGENT_HANDOFF_TEMPLATE_MD = '# Workflow Handoff Template\r\n\r\n> **Canonical reference:** [`process/09_agent_protocols.md`](../../process/09_agent_protocols.md) and [`process/01_governance_and_roles.md`](../../process/01_governance_and_roles.md).\r\n>\r\n> **Activation Criterion by Autonomy Mode:**\r\n> - \u{1F7E2} **`AUTONOMOUS` (or exclusive supervision at the end in PR/CI):** OMITTED. The agent executes and delivers without interrupting the user with this handoff block.\r\n> - \u{1F7E1} **`HUMAN_REVIEW_PLAN` | \u{1F7E0} `AMBIGUOUS` | \u{1F534} `HIGH_RISK_MANUAL`:** MANDATORY. Upon completing the phase or proposal, the agent emits this block and **halts**, granting visibility to the user and relinquishing control.\r\n\r\n---\r\n\r\n### \u{1F504} Workflow Handoff\r\n\r\n- **Completed Phase / Activity**: `[Current phase, e.g. Product Definition / Threat Modeling / Privacy Modeling / Architecture / SDD Implementation]`\r\n- **Acting Role**: `[agent-product-analyst | agent-threat-modeler | agent-privacy-officer | agent-system-architect | agent-developer | agent-expert-user | agent-security-auditor | agent-compliance-checker]`\r\n- **Task Autonomy Mode**: `[HUMAN_REVIEW_PLAN | AMBIGUOUS | HIGH_RISK_MANUAL]`\r\n- **Produced Deliverables**:\r\n - [x] `[Path or ID of generated artifact, e.g. specs/product/uc-mission.md]`\r\n - [x] `[Path or ID of generated artifact, e.g. quality-report.md]`\r\n\r\n- **Recommended Next Role(s) in Workflow**:\r\n - `[Suggested role name, e.g. agent-threat-modeler]`: `[Technical rationale, e.g. Model STRIDE adversaries and mitigate abuse cases]`\r\n - *(Optional)* `[Alternative role, e.g. agent-expert-user]`: `[Technical rationale, e.g. Evaluate UX and MVP boundary]`\r\n\r\n- **Suggested Invocation Prompt**:\r\n > "Act as `[next-role]` and proceed with the `[next phase]` phase on the generated deliverables: `[key artifacts]`."\r\n- **Clean Context Window Execution (Cross-IDE)**:\r\n - \u{1F9F9} **Subagent-Capable IDEs (Antigravity / Claude Code / Copilot)**: Delegate automatically via subagent tool (`invoke_subagent` / `Task` / `@agent-*`) to launch a fresh context window.\r\n - \u{1F195} **Chat-Based IDEs (Cursor / Windsurf / Aider)**: Open a **New Chat (`Cmd/Ctrl + N`)** or run `/clear` before pasting the Suggested Invocation Prompt so the next specialist starts with zero context pollution and hydrates state exclusively from `handoff.yaml` / `get_active_handoff`.\r\n\r\n- **Human Action Window (User Sovereignty and Priority)**:\r\n - \u270B **Review and Validate**: Inspect generated artifacts and validate alignment with project vision before proceeding.\r\n - \u270F\uFE0F **Edit Directly**: Modify requirements, code, or acceptance criteria directly at any time.\r\n - \u{1F6D1} **Pause, Divert, or Discard**: Freeze workflow, redirect toward another goal, or discard proposal.\r\n - \u25B6\uFE0F **Delegate to Next Agent**: If satisfied with output, execute suggested prompt to continue the chain.\r\n\r\n---\r\n';
|
|
15985
16426
|
var STARTER__GITHUB_PULL_REQUEST_TEMPLATE_MD = "## 1. SDD Identification and Traceability\r\n\r\n- **SDD Change Specification**: `specs/changes/active/<change-id>/` <!-- Link to active change directory -->\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";
|
|
15986
16427
|
var STARTER_COMPLIANCE_LICENSE_MANIFEST_YAML = '# ==============================================================================\r\n# AI-SDLC: Manifiesto de Cumplimiento de Licencias Evaluadas\r\n# ==============================================================================\r\n# Verificado contra: /license-policy.yaml\r\n# ==============================================================================\r\n\r\nevaluated_dependencies:\r\n - package: "@modelcontextprotocol/sdk"\r\n version: "1.0.4"\r\n spdx_license: "MIT"\r\n category: "permissive_free"\r\n status: "APPROVED"\r\n usage: "SDK oficial para servidor Model Context Protocol."\r\n commercial_payment_required: false\r\n\r\n - package: "commander"\r\n version: "12.1.0"\r\n spdx_license: "MIT"\r\n category: "permissive_free"\r\n status: "APPROVED"\r\n usage: "Parser de l\xEDnea de comandos para @ai-sdlc/cli."\r\n commercial_payment_required: false\r\n\r\n - package: "zod"\r\n version: "3.23.8"\r\n spdx_license: "MIT"\r\n category: "permissive_free"\r\n status: "APPROVED"\r\n usage: "Validaci\xF3n de esquemas y tipos en runtime."\r\n commercial_payment_required: false\r\n\r\n - package: "js-yaml"\r\n version: "4.1.0"\r\n spdx_license: "MIT"\r\n category: "permissive_free"\r\n status: "APPROVED"\r\n usage: "Parser y serializador YAML para especificaciones y frontmatter."\r\n commercial_payment_required: false\r\n\r\n - package: "chalk"\r\n version: "5.3.0"\r\n spdx_license: "MIT"\r\n category: "permissive_free"\r\n status: "APPROVED"\r\n usage: "Estilizado de salida en terminal para comandos CLI."\r\n commercial_payment_required: false\r\n\r\n - package: "ajv"\r\n version: "8.17.1"\r\n spdx_license: "MIT"\r\n category: "permissive_free"\r\n status: "APPROVED"\r\n usage: "Validador JSON Schema para ProductShape, arc42 y SDD."\r\n commercial_payment_required: false\r\n';
|
|
15987
16428
|
var STARTER_PROCESS_README = "# AI-SDLC: Process & Governance Framework\n\nThis directory hosts the deterministic governance, verification gates, and lifecycle protocols for AI-assisted software development.\n\n## Core Protocols & Lifecycle\n- **Phase 0 (Product Definition)**: `specs/product/` (Requirements `FR-*`, Use Cases `UC-*`, Actors `ACT-*`, Rules `BR-*`).\n- **Phase 1 (System Architecture)**: `templates/architecture/` (arc42 + NAF v4, `CMP-*`, Decisions `ADR-*`).\n- **Phase 2 (Cybersecurity Triad)**: `templates/security/` (Threat Actors `ACT-THREAT-*`, Abuse Cases `ABUSE-*`, Security Reqs `SEC-REQ-*`).\n- **Phase 2b (Privacy-by-Design as Code)**: `templates/privacy/` (Data Assets `DATA-ASSET-*`, ROPA `PRIV-ROPA-*`, Privacy Reqs `PRIV-REQ-*`).\n- **Phase 3 (Spec-Driven Delivery - SDD)**: `specs/changes/active/<change-id>/` (`proposal.md`, `spec.md`, `design.md`, `tasks.md`, `handoff.yaml`).\n- **Phase 4 (Continuous Quality Gates & Verification)**:\n - Quality Gate: `npx aisdlc verify quality` (CC $\\le 10$, MI $\\ge 50$, LOC $\\le 40$)\n - BDD Testing: `npx aisdlc verify testing`\n - Traceability: `npx aisdlc verify traceability`\n - Licenses: `npx aisdlc verify licenses`\n - Privacy & Data Protection: `npx aisdlc verify privacy`\n - Schemas: `npx aisdlc verify schemas`\n - Release Gates: `npx aisdlc check` / `npx aisdlc verify all`\n";
|
|
@@ -16024,6 +16465,522 @@ var STARTER_BASE_TEMPLATES = [
|
|
|
16024
16465
|
{ relPath: "process/README.md", content: STARTER_PROCESS_README },
|
|
16025
16466
|
{ relPath: "compliance/license-manifest.yaml", content: STARTER_COMPLIANCE_LICENSE_MANIFEST_YAML }
|
|
16026
16467
|
];
|
|
16468
|
+
var VALID_CODING_RULE_STACKS = [
|
|
16469
|
+
"dotnet",
|
|
16470
|
+
"typescript",
|
|
16471
|
+
"javascript",
|
|
16472
|
+
"angular",
|
|
16473
|
+
"java",
|
|
16474
|
+
"kotlin",
|
|
16475
|
+
"rust",
|
|
16476
|
+
"go",
|
|
16477
|
+
"c",
|
|
16478
|
+
"cpp"
|
|
16479
|
+
];
|
|
16480
|
+
var PROTECTED_CODING_RULES_FILES = [
|
|
16481
|
+
"Directory.Build.props",
|
|
16482
|
+
"tsconfig.strict.json",
|
|
16483
|
+
"eslint.config.mjs",
|
|
16484
|
+
"gradle/init.d/aisdlc-strict.init.gradle.kts",
|
|
16485
|
+
"config/pmd/aisdlc-ruleset.xml",
|
|
16486
|
+
"config/detekt/detekt.yml",
|
|
16487
|
+
".cargo/config.toml",
|
|
16488
|
+
".clippy.toml",
|
|
16489
|
+
".golangci.yml",
|
|
16490
|
+
".clang-tidy",
|
|
16491
|
+
"cmake/AisdlcStrictCompiler.cmake",
|
|
16492
|
+
".github/CODEOWNERS"
|
|
16493
|
+
];
|
|
16494
|
+
var DOTNET_DIRECTORY_BUILD_PROPS = `<Project>
|
|
16495
|
+
<!-- 1. Global strict compiler and analyzer rules for all projects (src and tests) -->
|
|
16496
|
+
<PropertyGroup>
|
|
16497
|
+
<Nullable>enable</Nullable>
|
|
16498
|
+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
|
16499
|
+
<AnalysisLevel>latest-recommended</AnalysisLevel>
|
|
16500
|
+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
|
16501
|
+
</PropertyGroup>
|
|
16502
|
+
|
|
16503
|
+
<!-- 2. Strict unit/E2E test guardrails (xUnit, MSTest, NUnit) -->
|
|
16504
|
+
<PropertyGroup Condition="'$(IsTestProject)' == 'true' or $(MSBuildProjectName.EndsWith('Tests')) or $(MSBuildProjectName.EndsWith('Test'))">
|
|
16505
|
+
<IsTestProject>true</IsTestProject>
|
|
16506
|
+
<NoWarn>$(NoWarn);CA1707;CA2007</NoWarn>
|
|
16507
|
+
<MSTestAnalysisMode>Recommended</MSTestAnalysisMode>
|
|
16508
|
+
<WarningsAsErrors>$(WarningsAsErrors);S2699;S1607;MSTEST0006;MSTEST0014;MSTEST0015;MSTEST0017;MSTEST0032;xUnit1026;xUnit1013</WarningsAsErrors>
|
|
16509
|
+
</PropertyGroup>
|
|
16510
|
+
|
|
16511
|
+
<ItemGroup Condition="'$(IsTestProject)' == 'true' or $(MSBuildProjectName.EndsWith('Tests')) or $(MSBuildProjectName.EndsWith('Test'))">
|
|
16512
|
+
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.*">
|
|
16513
|
+
<PrivateAssets>all</PrivateAssets>
|
|
16514
|
+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
16515
|
+
</PackageReference>
|
|
16516
|
+
</ItemGroup>
|
|
16517
|
+
</Project>
|
|
16518
|
+
`;
|
|
16519
|
+
var TS_STRICT_TSCONFIG = `{
|
|
16520
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
16521
|
+
"compilerOptions": {
|
|
16522
|
+
"strict": true,
|
|
16523
|
+
"allowJs": true,
|
|
16524
|
+
"checkJs": true,
|
|
16525
|
+
"noImplicitOverride": true,
|
|
16526
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
16527
|
+
"noImplicitReturns": true,
|
|
16528
|
+
"noFallthroughCasesInSwitch": true,
|
|
16529
|
+
"noUnusedLocals": true,
|
|
16530
|
+
"noUnusedParameters": true,
|
|
16531
|
+
"noUncheckedIndexedAccess": true,
|
|
16532
|
+
"exactOptionalPropertyTypes": true,
|
|
16533
|
+
"forceConsistentCasingInFileNames": true
|
|
16534
|
+
},
|
|
16535
|
+
"angularCompilerOptions": {
|
|
16536
|
+
"strictInjectionParameters": true,
|
|
16537
|
+
"strictInputAccessModifiers": true,
|
|
16538
|
+
"strictTemplates": true,
|
|
16539
|
+
"strictStandalone": true,
|
|
16540
|
+
"extendedDiagnostics": {
|
|
16541
|
+
"defaultCategory": "error"
|
|
16542
|
+
}
|
|
16543
|
+
}
|
|
16544
|
+
}
|
|
16545
|
+
`;
|
|
16546
|
+
var TS_ESLINT_CONFIG_MJS = `// AI-SDLC: Immutable Strict Coding & Test Rules for TypeScript / JavaScript / Angular
|
|
16547
|
+
import tseslint from "typescript-eslint";
|
|
16548
|
+
|
|
16549
|
+
export default tseslint.config(
|
|
16550
|
+
{
|
|
16551
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
|
16552
|
+
extends: [...tseslint.configs.strictTypeChecked],
|
|
16553
|
+
languageOptions: {
|
|
16554
|
+
parserOptions: {
|
|
16555
|
+
projectService: true,
|
|
16556
|
+
},
|
|
16557
|
+
},
|
|
16558
|
+
rules: {
|
|
16559
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
16560
|
+
"@typescript-eslint/ban-ts-comment": "error",
|
|
16561
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
16562
|
+
"@typescript-eslint/await-thenable": "error",
|
|
16563
|
+
"@typescript-eslint/no-misused-promises": "error",
|
|
16564
|
+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
|
16565
|
+
},
|
|
16566
|
+
},
|
|
16567
|
+
{
|
|
16568
|
+
files: ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.js", "**/*.test.js"],
|
|
16569
|
+
rules: {
|
|
16570
|
+
"no-restricted-globals": [
|
|
16571
|
+
"error",
|
|
16572
|
+
{ "name": "fit", "message": "Focused tests (fit) are forbidden by AI-SDLC." },
|
|
16573
|
+
{ "name": "fdescribe", "message": "Focused suites (fdescribe) are forbidden by AI-SDLC." },
|
|
16574
|
+
{ "name": "xit", "message": "Skipped tests (xit) are forbidden by AI-SDLC." },
|
|
16575
|
+
{ "name": "xdescribe", "message": "Skipped suites (xdescribe) are forbidden by AI-SDLC." }
|
|
16576
|
+
]
|
|
16577
|
+
}
|
|
16578
|
+
}
|
|
16579
|
+
);
|
|
16580
|
+
`;
|
|
16581
|
+
var GRADLE_STRICT_INIT_KTS = `// AI-SDLC: Immutable Gradle Strict Compiler & Test Guardrails (Java & Kotlin)
|
|
16582
|
+
allprojects {
|
|
16583
|
+
tasks.withType<JavaCompile>().configureEach {
|
|
16584
|
+
options.compilerArgs.addAll(listOf("-Werror", "-Xlint:all", "-Xlint:-processing"))
|
|
16585
|
+
}
|
|
16586
|
+
tasks.withType<Test>().configureEach {
|
|
16587
|
+
useJUnitPlatform()
|
|
16588
|
+
failOnNoDiscoveredTests.set(true)
|
|
16589
|
+
}
|
|
16590
|
+
}
|
|
16591
|
+
`;
|
|
16592
|
+
var JAVA_PMD_RULESET_XML = `<?xml version="1.0" encoding="UTF-8"?>
|
|
16593
|
+
<ruleset name="AI-SDLC Strict Java & JUnit Rules"
|
|
16594
|
+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
|
16595
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
16596
|
+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.github.io/schema/ruleset_2_0_0.xsd">
|
|
16597
|
+
<description>AI-SDLC Mandatory Java & Unit Test Verification Rules</description>
|
|
16598
|
+
<rule ref="category/java/bestpractices.xml/JUnitTestsShouldIncludeAssert" />
|
|
16599
|
+
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable" />
|
|
16600
|
+
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
|
|
16601
|
+
<rule ref="category/java/errorprone.xml/EmptyCatchBlock" />
|
|
16602
|
+
</ruleset>
|
|
16603
|
+
`;
|
|
16604
|
+
var KOTLIN_DETEKT_YML = `# AI-SDLC: Immutable Detekt Rules for Kotlin & Unit Tests
|
|
16605
|
+
build:
|
|
16606
|
+
maxIssues: 0
|
|
16607
|
+
|
|
16608
|
+
potential-bugs:
|
|
16609
|
+
active: true
|
|
16610
|
+
IgnoredReturnValue:
|
|
16611
|
+
active: true
|
|
16612
|
+
UnreachableCode:
|
|
16613
|
+
active: true
|
|
16614
|
+
|
|
16615
|
+
exceptions:
|
|
16616
|
+
active: true
|
|
16617
|
+
SwallowedException:
|
|
16618
|
+
active: true
|
|
16619
|
+
EmptyCatchBlock:
|
|
16620
|
+
active: true
|
|
16621
|
+
|
|
16622
|
+
style:
|
|
16623
|
+
active: true
|
|
16624
|
+
ForbiddenAnnotation:
|
|
16625
|
+
active: true
|
|
16626
|
+
annotations:
|
|
16627
|
+
- 'org.junit.jupiter.api.Disabled'
|
|
16628
|
+
- 'org.junit.Ignore'
|
|
16629
|
+
- 'kotlin.test.Ignore'
|
|
16630
|
+
`;
|
|
16631
|
+
var RUST_CARGO_CONFIG_TOML = `# AI-SDLC: Immutable Rust Compiler & Clippy Guardrails
|
|
16632
|
+
[build]
|
|
16633
|
+
rustflags = [
|
|
16634
|
+
"-D", "warnings",
|
|
16635
|
+
"-D", "unused-must-use",
|
|
16636
|
+
"-D", "dead-code",
|
|
16637
|
+
"-D", "clippy::all",
|
|
16638
|
+
"-D", "clippy::unwrap_used",
|
|
16639
|
+
"-D", "clippy::todo",
|
|
16640
|
+
"-D", "clippy::unimplemented",
|
|
16641
|
+
"-D", "clippy::ignore_without_reason",
|
|
16642
|
+
"-D", "clippy::assertions_on_constants"
|
|
16643
|
+
]
|
|
16644
|
+
`;
|
|
16645
|
+
var RUST_CLIPPY_TOML = `# AI-SDLC: Clippy configuration
|
|
16646
|
+
allow-unwrap-in-tests = true
|
|
16647
|
+
`;
|
|
16648
|
+
var GO_GOLANGCI_YML = `# AI-SDLC: Immutable Go & Testing Linter Guardrails
|
|
16649
|
+
run:
|
|
16650
|
+
tests: true
|
|
16651
|
+
|
|
16652
|
+
issues:
|
|
16653
|
+
max-issues-per-linter: 0
|
|
16654
|
+
max-same-issues: 0
|
|
16655
|
+
|
|
16656
|
+
linters:
|
|
16657
|
+
enable:
|
|
16658
|
+
- errcheck
|
|
16659
|
+
- govet
|
|
16660
|
+
- staticcheck
|
|
16661
|
+
- unused
|
|
16662
|
+
- ineffassign
|
|
16663
|
+
- testifylint
|
|
16664
|
+
- thelper
|
|
16665
|
+
- forbidigo
|
|
16666
|
+
|
|
16667
|
+
linters-settings:
|
|
16668
|
+
testifylint:
|
|
16669
|
+
enable-all: true
|
|
16670
|
+
forbidigo:
|
|
16671
|
+
analyze-types: true
|
|
16672
|
+
forbid:
|
|
16673
|
+
- p: ^testing\\.T\\.Skip.*$
|
|
16674
|
+
msg: "Skipping unit tests with t.Skip() is forbidden by AI-SDLC."
|
|
16675
|
+
`;
|
|
16676
|
+
var CPP_CLANG_TIDY = `# AI-SDLC: Immutable C/C++ Clang-Tidy Guardrails
|
|
16677
|
+
Checks: >
|
|
16678
|
+
-*,
|
|
16679
|
+
bugprone-*,
|
|
16680
|
+
cert-*,
|
|
16681
|
+
clang-analyzer-*,
|
|
16682
|
+
cppcoreguidelines-*,
|
|
16683
|
+
modernize-*,
|
|
16684
|
+
performance-*,
|
|
16685
|
+
readability-*
|
|
16686
|
+
WarningsAsErrors: '*'
|
|
16687
|
+
`;
|
|
16688
|
+
var CPP_CMAKE_STRICT = `# AI-SDLC: Immutable C/C++ Compiler & CTest Guardrails
|
|
16689
|
+
if(MSVC)
|
|
16690
|
+
add_compile_options(/W4 /WX /permissive-)
|
|
16691
|
+
else()
|
|
16692
|
+
add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wnull-dereference -Wunused-result)
|
|
16693
|
+
endif()
|
|
16694
|
+
|
|
16695
|
+
set(CMAKE_CXX_CLANG_TIDY "clang-tidy")
|
|
16696
|
+
set(CMAKE_C_CLANG_TIDY "clang-tidy")
|
|
16697
|
+
`;
|
|
16698
|
+
var STARTER_ANTIGRAVITY_HOOKS_JSON = `{
|
|
16699
|
+
"branch-guard": {
|
|
16700
|
+
"enabled": true,
|
|
16701
|
+
"PreToolUse": [
|
|
16702
|
+
{
|
|
16703
|
+
"matcher": "edit_file|write_file",
|
|
16704
|
+
"hooks": [
|
|
16705
|
+
{
|
|
16706
|
+
"type": "command",
|
|
16707
|
+
"command": "node scripts/guard-branch.cjs",
|
|
16708
|
+
"timeout": 10
|
|
16709
|
+
}
|
|
16710
|
+
]
|
|
16711
|
+
}
|
|
16712
|
+
]
|
|
16713
|
+
}
|
|
16714
|
+
}
|
|
16715
|
+
`;
|
|
16716
|
+
var STARTER_AGENT_GUARD_WRAPPER_CJS = `#!/usr/bin/env node
|
|
16717
|
+
// Forwarding wrapper or direct execution from .agent
|
|
16718
|
+
require('../../scripts/guard-branch.cjs');
|
|
16719
|
+
`;
|
|
16720
|
+
var STARTER_GUARD_BRANCH_CJS = `#!/usr/bin/env node
|
|
16721
|
+
/**
|
|
16722
|
+
* AI-SDLC: Antigravity PreToolUse Branch & Immutable Coding Rules Guard Hook
|
|
16723
|
+
* 1. Prevents AI agents from modifying or writing files directly on protected branches (main, master, release/*).
|
|
16724
|
+
* 2. Prevents AI agents from modifying or weakening deployed coding rules files once created.
|
|
16725
|
+
*/
|
|
16726
|
+
|
|
16727
|
+
const { execSync } = require('child_process');
|
|
16728
|
+
const path = require('path');
|
|
16729
|
+
|
|
16730
|
+
const PROTECTED_CODING_RULES_FILES = [
|
|
16731
|
+
'Directory.Build.props',
|
|
16732
|
+
'tsconfig.strict.json',
|
|
16733
|
+
'eslint.config.mjs',
|
|
16734
|
+
'gradle/init.d/aisdlc-strict.init.gradle.kts',
|
|
16735
|
+
'config/pmd/aisdlc-ruleset.xml',
|
|
16736
|
+
'config/detekt/detekt.yml',
|
|
16737
|
+
'.cargo/config.toml',
|
|
16738
|
+
'.clippy.toml',
|
|
16739
|
+
'.golangci.yml',
|
|
16740
|
+
'.clang-tidy',
|
|
16741
|
+
'cmake/AisdlcStrictCompiler.cmake',
|
|
16742
|
+
'.github/CODEOWNERS',
|
|
16743
|
+
];
|
|
16744
|
+
|
|
16745
|
+
function getWorkingBranch(cwd) {
|
|
16746
|
+
try {
|
|
16747
|
+
const sym = execSync('git symbolic-ref --short HEAD', {
|
|
16748
|
+
cwd,
|
|
16749
|
+
encoding: 'utf-8',
|
|
16750
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
16751
|
+
}).trim();
|
|
16752
|
+
if (sym) return sym;
|
|
16753
|
+
} catch {}
|
|
16754
|
+
|
|
16755
|
+
try {
|
|
16756
|
+
return execSync('git rev-parse --abbrev-ref HEAD', {
|
|
16757
|
+
cwd,
|
|
16758
|
+
encoding: 'utf-8',
|
|
16759
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
16760
|
+
}).trim();
|
|
16761
|
+
} catch {}
|
|
16762
|
+
|
|
16763
|
+
return '';
|
|
16764
|
+
}
|
|
16765
|
+
|
|
16766
|
+
function isProtectedCodingRulesTarget(targetPath, cwd) {
|
|
16767
|
+
if (!targetPath) return false;
|
|
16768
|
+
const resolved = path.resolve(cwd, targetPath);
|
|
16769
|
+
|
|
16770
|
+
const norm = resolved.replace(/\\\\/g, '/');
|
|
16771
|
+
const rel = path.relative(cwd, resolved).replace(/\\\\/g, '/');
|
|
16772
|
+
return PROTECTED_CODING_RULES_FILES.some(
|
|
16773
|
+
(ruleFile) => rel === ruleFile || norm.endsWith('/' + ruleFile)
|
|
16774
|
+
) || rel.startsWith('templates/coding-rules/');
|
|
16775
|
+
}
|
|
16776
|
+
|
|
16777
|
+
function evaluateGuardDecision(payload) {
|
|
16778
|
+
const targetPath = payload.toolCall?.args?.Path || '';
|
|
16779
|
+
const workspacePaths = payload.workspacePaths || [];
|
|
16780
|
+
const cwd = workspacePaths[0] || process.cwd();
|
|
16781
|
+
const resolvedPath = targetPath ? path.resolve(cwd, targetPath) : '';
|
|
16782
|
+
const normPath = resolvedPath.replace(/\\\\/g, '/');
|
|
16783
|
+
|
|
16784
|
+
if (isProtectedCodingRulesTarget(resolvedPath, cwd)) {
|
|
16785
|
+
return {
|
|
16786
|
+
decision: 'deny',
|
|
16787
|
+
reason: \`\u274C [AI-SDLC Immutable Coding Rules Guard] BLOCKED: AI agents are forbidden from modifying protected coding rules file '\${path.basename(targetPath)}'. Fix the source or test code to satisfy the compiler/linter rules instead of altering the rule configuration.\`,
|
|
16788
|
+
};
|
|
16789
|
+
}
|
|
16790
|
+
|
|
16791
|
+
if (
|
|
16792
|
+
normPath.includes('/.gemini/') ||
|
|
16793
|
+
normPath.includes('/brain/') ||
|
|
16794
|
+
normPath.includes('/scratch/')
|
|
16795
|
+
) {
|
|
16796
|
+
return { decision: 'allow' };
|
|
16797
|
+
}
|
|
16798
|
+
|
|
16799
|
+
const branch = getWorkingBranch(cwd);
|
|
16800
|
+
if (/^(main|master|release\\/.*)$/.test(branch)) {
|
|
16801
|
+
return {
|
|
16802
|
+
decision: 'deny',
|
|
16803
|
+
reason: \`\u274C [AI-SDLC Security Guard] BLOCKED: Direct file modifications on protected branch '\${branch}' are forbidden. You must create and checkout a new working branch first before editing files (e.g. 'git checkout -b feat/<CHG-ID>-<slug>' or 'git checkout -b task/<PARENT-ID>/<TSK-ID>-<slug>').\`,
|
|
16804
|
+
};
|
|
16805
|
+
}
|
|
16806
|
+
|
|
16807
|
+
return { decision: 'allow' };
|
|
16808
|
+
}
|
|
16809
|
+
|
|
16810
|
+
function main() {
|
|
16811
|
+
let input = '';
|
|
16812
|
+
process.stdin.setEncoding('utf-8');
|
|
16813
|
+
process.stdin.on('data', (chunk) => {
|
|
16814
|
+
input += chunk;
|
|
16815
|
+
});
|
|
16816
|
+
process.stdin.on('end', () => {
|
|
16817
|
+
try {
|
|
16818
|
+
const payload = input.trim() ? JSON.parse(input) : {};
|
|
16819
|
+
console.log(JSON.stringify(evaluateGuardDecision(payload)));
|
|
16820
|
+
} catch {
|
|
16821
|
+
console.log(JSON.stringify({ decision: 'allow' }));
|
|
16822
|
+
}
|
|
16823
|
+
});
|
|
16824
|
+
}
|
|
16825
|
+
|
|
16826
|
+
main();
|
|
16827
|
+
`;
|
|
16828
|
+
var STACK_FILE_MAP = {
|
|
16829
|
+
dotnet: [{ relPath: "Directory.Build.props", content: DOTNET_DIRECTORY_BUILD_PROPS }],
|
|
16830
|
+
typescript: [
|
|
16831
|
+
{ relPath: "tsconfig.strict.json", content: TS_STRICT_TSCONFIG },
|
|
16832
|
+
{ relPath: "eslint.config.mjs", content: TS_ESLINT_CONFIG_MJS }
|
|
16833
|
+
],
|
|
16834
|
+
javascript: [
|
|
16835
|
+
{ relPath: "tsconfig.strict.json", content: TS_STRICT_TSCONFIG },
|
|
16836
|
+
{ relPath: "eslint.config.mjs", content: TS_ESLINT_CONFIG_MJS }
|
|
16837
|
+
],
|
|
16838
|
+
angular: [
|
|
16839
|
+
{ relPath: "tsconfig.strict.json", content: TS_STRICT_TSCONFIG },
|
|
16840
|
+
{ relPath: "eslint.config.mjs", content: TS_ESLINT_CONFIG_MJS }
|
|
16841
|
+
],
|
|
16842
|
+
java: [
|
|
16843
|
+
{ relPath: "gradle/init.d/aisdlc-strict.init.gradle.kts", content: GRADLE_STRICT_INIT_KTS },
|
|
16844
|
+
{ relPath: "config/pmd/aisdlc-ruleset.xml", content: JAVA_PMD_RULESET_XML }
|
|
16845
|
+
],
|
|
16846
|
+
kotlin: [
|
|
16847
|
+
{ relPath: "gradle/init.d/aisdlc-strict.init.gradle.kts", content: GRADLE_STRICT_INIT_KTS },
|
|
16848
|
+
{ relPath: "config/detekt/detekt.yml", content: KOTLIN_DETEKT_YML }
|
|
16849
|
+
],
|
|
16850
|
+
rust: [
|
|
16851
|
+
{ relPath: ".cargo/config.toml", content: RUST_CARGO_CONFIG_TOML },
|
|
16852
|
+
{ relPath: ".clippy.toml", content: RUST_CLIPPY_TOML }
|
|
16853
|
+
],
|
|
16854
|
+
go: [{ relPath: ".golangci.yml", content: GO_GOLANGCI_YML }],
|
|
16855
|
+
c: [
|
|
16856
|
+
{ relPath: ".clang-tidy", content: CPP_CLANG_TIDY },
|
|
16857
|
+
{ relPath: "cmake/AisdlcStrictCompiler.cmake", content: CPP_CMAKE_STRICT }
|
|
16858
|
+
],
|
|
16859
|
+
cpp: [
|
|
16860
|
+
{ relPath: ".clang-tidy", content: CPP_CLANG_TIDY },
|
|
16861
|
+
{ relPath: "cmake/AisdlcStrictCompiler.cmake", content: CPP_CMAKE_STRICT }
|
|
16862
|
+
]
|
|
16863
|
+
};
|
|
16864
|
+
function getReferenceCodingRulesTemplates() {
|
|
16865
|
+
return [
|
|
16866
|
+
{ relPath: "templates/coding-rules/dotnet/Directory.Build.props", content: DOTNET_DIRECTORY_BUILD_PROPS },
|
|
16867
|
+
{ relPath: "templates/coding-rules/typescript/tsconfig.strict.json", content: TS_STRICT_TSCONFIG },
|
|
16868
|
+
{ relPath: "templates/coding-rules/typescript/eslint.config.mjs", content: TS_ESLINT_CONFIG_MJS },
|
|
16869
|
+
{ relPath: "templates/coding-rules/jvm/aisdlc-strict.init.gradle.kts", content: GRADLE_STRICT_INIT_KTS },
|
|
16870
|
+
{ relPath: "templates/coding-rules/java/aisdlc-ruleset.xml", content: JAVA_PMD_RULESET_XML },
|
|
16871
|
+
{ relPath: "templates/coding-rules/kotlin/detekt.yml", content: KOTLIN_DETEKT_YML },
|
|
16872
|
+
{ relPath: "templates/coding-rules/rust/config.toml", content: RUST_CARGO_CONFIG_TOML },
|
|
16873
|
+
{ relPath: "templates/coding-rules/rust/.clippy.toml", content: RUST_CLIPPY_TOML },
|
|
16874
|
+
{ relPath: "templates/coding-rules/go/.golangci.yml", content: GO_GOLANGCI_YML },
|
|
16875
|
+
{ relPath: "templates/coding-rules/cpp/.clang-tidy", content: CPP_CLANG_TIDY },
|
|
16876
|
+
{ relPath: "templates/coding-rules/cpp/AisdlcStrictCompiler.cmake", content: CPP_CMAKE_STRICT }
|
|
16877
|
+
];
|
|
16878
|
+
}
|
|
16879
|
+
function hasFileMatching(entries, suffixOrName) {
|
|
16880
|
+
return entries.some((e) => e === suffixOrName || e.endsWith(suffixOrName));
|
|
16881
|
+
}
|
|
16882
|
+
function detectJvmAndNativeStacks(entries, detected) {
|
|
16883
|
+
if (hasFileMatching(entries, "pom.xml") || hasFileMatching(entries, "build.gradle")) {
|
|
16884
|
+
detected.add("java");
|
|
16885
|
+
}
|
|
16886
|
+
if (hasFileMatching(entries, "build.gradle.kts")) {
|
|
16887
|
+
detected.add("java");
|
|
16888
|
+
detected.add("kotlin");
|
|
16889
|
+
}
|
|
16890
|
+
if (hasFileMatching(entries, "Cargo.toml")) detected.add("rust");
|
|
16891
|
+
if (hasFileMatching(entries, "go.mod")) detected.add("go");
|
|
16892
|
+
if (hasFileMatching(entries, "CMakeLists.txt") || hasFileMatching(entries, "Makefile")) {
|
|
16893
|
+
detected.add("cpp");
|
|
16894
|
+
}
|
|
16895
|
+
}
|
|
16896
|
+
function detectProjectStacks(targetDir) {
|
|
16897
|
+
if (!fs8__namespace.existsSync(targetDir)) return [];
|
|
16898
|
+
let entries = [];
|
|
16899
|
+
try {
|
|
16900
|
+
entries = fs8__namespace.readdirSync(targetDir);
|
|
16901
|
+
} catch {
|
|
16902
|
+
return [];
|
|
16903
|
+
}
|
|
16904
|
+
const detected = /* @__PURE__ */ new Set();
|
|
16905
|
+
if (hasFileMatching(entries, ".sln") || hasFileMatching(entries, ".slnx") || hasFileMatching(entries, ".csproj")) {
|
|
16906
|
+
detected.add("dotnet");
|
|
16907
|
+
}
|
|
16908
|
+
if (hasFileMatching(entries, "angular.json")) detected.add("angular");
|
|
16909
|
+
else if (hasFileMatching(entries, "tsconfig.json")) detected.add("typescript");
|
|
16910
|
+
else if (hasFileMatching(entries, "package.json")) detected.add("javascript");
|
|
16911
|
+
detectJvmAndNativeStacks(entries, detected);
|
|
16912
|
+
return Array.from(detected);
|
|
16913
|
+
}
|
|
16914
|
+
var STACK_ALIASES = {
|
|
16915
|
+
"c#": "dotnet",
|
|
16916
|
+
csharp: "dotnet",
|
|
16917
|
+
cs: "dotnet",
|
|
16918
|
+
net: "dotnet",
|
|
16919
|
+
".net": "dotnet",
|
|
16920
|
+
ts: "typescript",
|
|
16921
|
+
js: "javascript",
|
|
16922
|
+
ng: "angular",
|
|
16923
|
+
kt: "kotlin",
|
|
16924
|
+
rs: "rust",
|
|
16925
|
+
golang: "go",
|
|
16926
|
+
"c++": "cpp",
|
|
16927
|
+
cxx: "cpp"
|
|
16928
|
+
};
|
|
16929
|
+
function parseSingleStackToken(token, out) {
|
|
16930
|
+
if (token === "all") {
|
|
16931
|
+
VALID_CODING_RULE_STACKS.forEach((s) => out.add(s));
|
|
16932
|
+
return true;
|
|
16933
|
+
}
|
|
16934
|
+
const mapped = STACK_ALIASES[token] || token;
|
|
16935
|
+
if (VALID_CODING_RULE_STACKS.includes(mapped)) {
|
|
16936
|
+
out.add(mapped);
|
|
16937
|
+
return true;
|
|
16938
|
+
}
|
|
16939
|
+
return false;
|
|
16940
|
+
}
|
|
16941
|
+
function resolveCodingRuleStacks(stackOption, targetDir) {
|
|
16942
|
+
if (stackOption === void 0 || stackOption === null || stackOption === "") {
|
|
16943
|
+
return { valid: true, stacks: detectProjectStacks(targetDir) };
|
|
16944
|
+
}
|
|
16945
|
+
const rawList = Array.isArray(stackOption) ? stackOption : String(stackOption).split(",");
|
|
16946
|
+
const resolved = /* @__PURE__ */ new Set();
|
|
16947
|
+
for (const raw of rawList) {
|
|
16948
|
+
const token = raw.trim().toLowerCase();
|
|
16949
|
+
if (!token || token === "none" || token === "false") continue;
|
|
16950
|
+
if (!parseSingleStackToken(token, resolved)) {
|
|
16951
|
+
return {
|
|
16952
|
+
valid: false,
|
|
16953
|
+
stacks: [],
|
|
16954
|
+
error: `Unrecognized technology stack: '${raw.trim()}'. Valid options: ${VALID_CODING_RULE_STACKS.join(", ")}, all, none.`
|
|
16955
|
+
};
|
|
16956
|
+
}
|
|
16957
|
+
}
|
|
16958
|
+
return { valid: true, stacks: Array.from(resolved) };
|
|
16959
|
+
}
|
|
16960
|
+
function getCodingRulesFilesForStacks(stacks) {
|
|
16961
|
+
const seen = /* @__PURE__ */ new Set();
|
|
16962
|
+
const files = [];
|
|
16963
|
+
for (const stack of stacks) {
|
|
16964
|
+
const entries = STACK_FILE_MAP[stack] || [];
|
|
16965
|
+
for (const entry of entries) {
|
|
16966
|
+
if (!seen.has(entry.relPath)) {
|
|
16967
|
+
seen.add(entry.relPath);
|
|
16968
|
+
files.push(entry);
|
|
16969
|
+
}
|
|
16970
|
+
}
|
|
16971
|
+
}
|
|
16972
|
+
return files;
|
|
16973
|
+
}
|
|
16974
|
+
function isProtectedCodingRulesFile(filePath, rootDir) {
|
|
16975
|
+
const norm = filePath.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
16976
|
+
const rel = rootDir ? path5__namespace.relative(rootDir, path5__namespace.resolve(rootDir, filePath)).replace(/\\/g, "/") : norm;
|
|
16977
|
+
if (rel.startsWith("templates/coding-rules/") || norm.includes("/templates/coding-rules/")) {
|
|
16978
|
+
return true;
|
|
16979
|
+
}
|
|
16980
|
+
return PROTECTED_CODING_RULES_FILES.some(
|
|
16981
|
+
(protectedRel) => rel === protectedRel || norm === protectedRel || norm.endsWith("/" + protectedRel)
|
|
16982
|
+
);
|
|
16983
|
+
}
|
|
16027
16984
|
|
|
16028
16985
|
// src/init/index.ts
|
|
16029
16986
|
var VALID_CI_PROVIDERS = ["github", "gitlab", "azure", "bitbucket"];
|
|
@@ -16243,6 +17200,9 @@ var STARTER_WORKFLOW_HANDOFF_TEMPLATE = `# Workflow Handoff Template
|
|
|
16243
17200
|
|
|
16244
17201
|
- **Suggested Invocation Prompt**:
|
|
16245
17202
|
> "Act as \`[next-role]\` and proceed with the \`[next phase]\` phase on the generated deliverables: \`[key artifacts]\`."
|
|
17203
|
+
- **Clean Context Window Execution (Cross-IDE)**:
|
|
17204
|
+
- \u{1F9F9} **Subagent-Capable IDEs (Antigravity / Claude Code / Copilot)**: Delegate automatically via subagent tool (\`invoke_subagent\` / \`Task\` / \`@agent-*\`) to launch a fresh context window.
|
|
17205
|
+
- \u{1F195} **Chat-Based IDEs (Cursor / Windsurf / Aider)**: Open a **New Chat (\`Cmd/Ctrl + N\`)** or run \`/clear\` before pasting the Suggested Invocation Prompt so the next specialist starts with zero context pollution and hydrates state exclusively from \`handoff.yaml\` / \`get_active_handoff\`.
|
|
16246
17206
|
|
|
16247
17207
|
- **Human Action Window (User Sovereignty and Priority)**:
|
|
16248
17208
|
- \u270B **Review and Validate**: Inspect generated artifacts and validate alignment with project vision before proceeding.
|
|
@@ -16730,7 +17690,12 @@ function resolveAgentTargets(agents) {
|
|
|
16730
17690
|
}
|
|
16731
17691
|
function appendAntigravityFiles(dirs, files) {
|
|
16732
17692
|
dirs.push(".agent/rules", ".agent/agents", ".agent/skills");
|
|
16733
|
-
files.push(
|
|
17693
|
+
files.push(
|
|
17694
|
+
{ relPath: ".agent/rules/ai-sdlc.md", content: STARTER_ANTIGRAVITY_RULES },
|
|
17695
|
+
{ relPath: ".agent/hooks.json", content: STARTER_ANTIGRAVITY_HOOKS_JSON },
|
|
17696
|
+
{ relPath: ".agent/scripts/guard-branch.cjs", content: STARTER_AGENT_GUARD_WRAPPER_CJS },
|
|
17697
|
+
{ relPath: "scripts/guard-branch.cjs", content: STARTER_GUARD_BRANCH_CJS }
|
|
17698
|
+
);
|
|
16734
17699
|
for (const agent of SPECIALIZED_AGENT_TEMPLATES) {
|
|
16735
17700
|
const content = renderAntigravityAgentFile(agent);
|
|
16736
17701
|
files.push({ relPath: `.agent/agents/${agent.id}.md`, content });
|
|
@@ -16801,24 +17766,25 @@ function collectAgentFiles(targets) {
|
|
|
16801
17766
|
appendMcpFiles(dirs, files);
|
|
16802
17767
|
return { dirs, files };
|
|
16803
17768
|
}
|
|
17769
|
+
function recordDryRunFile(exists, canOverwrite, relPath, results) {
|
|
17770
|
+
if (exists && canOverwrite) results.filesUpdated.push(relPath);
|
|
17771
|
+
else if (!exists) results.filesCreated.push(relPath);
|
|
17772
|
+
}
|
|
17773
|
+
function persistFileToDisk(fullFilePath, content, exists, relPath, results) {
|
|
17774
|
+
const parentDir = path5__namespace.dirname(fullFilePath);
|
|
17775
|
+
if (!fs8__namespace.existsSync(parentDir)) fs8__namespace.mkdirSync(parentDir, { recursive: true });
|
|
17776
|
+
fs8__namespace.writeFileSync(fullFilePath, content, "utf-8");
|
|
17777
|
+
if (exists) results.filesUpdated.push(relPath);
|
|
17778
|
+
else results.filesCreated.push(relPath);
|
|
17779
|
+
}
|
|
16804
17780
|
function writeSingleFile(fullFilePath, content, relPath, opts, results) {
|
|
16805
17781
|
const exists = fs8__namespace.existsSync(fullFilePath);
|
|
17782
|
+
const canOverwrite = Boolean(opts.force && !PROTECTED_CODING_RULES_FILES.includes(relPath));
|
|
16806
17783
|
if (opts.dryRun) {
|
|
16807
|
-
|
|
16808
|
-
else if (!exists) results.filesCreated.push(relPath);
|
|
17784
|
+
recordDryRunFile(exists, canOverwrite, relPath, results);
|
|
16809
17785
|
return;
|
|
16810
17786
|
}
|
|
16811
|
-
|
|
16812
|
-
if (!fs8__namespace.existsSync(parentDir)) {
|
|
16813
|
-
fs8__namespace.mkdirSync(parentDir, { recursive: true });
|
|
16814
|
-
}
|
|
16815
|
-
if (!exists) {
|
|
16816
|
-
fs8__namespace.writeFileSync(fullFilePath, content, "utf-8");
|
|
16817
|
-
results.filesCreated.push(relPath);
|
|
16818
|
-
} else if (opts.force) {
|
|
16819
|
-
fs8__namespace.writeFileSync(fullFilePath, content, "utf-8");
|
|
16820
|
-
results.filesUpdated.push(relPath);
|
|
16821
|
-
}
|
|
17787
|
+
if (!exists || canOverwrite) persistFileToDisk(fullFilePath, content, exists, relPath, results);
|
|
16822
17788
|
}
|
|
16823
17789
|
function writeProjectFiles(destDir, files, dryRun, force) {
|
|
16824
17790
|
const results = { filesCreated: [], filesUpdated: [] };
|
|
@@ -16874,6 +17840,7 @@ var BASE_DIRECTORIES = [
|
|
|
16874
17840
|
"templates/sdd",
|
|
16875
17841
|
"templates/manuals",
|
|
16876
17842
|
"templates/ci",
|
|
17843
|
+
"templates/coding-rules",
|
|
16877
17844
|
"templates/workflow",
|
|
16878
17845
|
"specs",
|
|
16879
17846
|
"reports",
|
|
@@ -16908,25 +17875,32 @@ function createDirectoriesOnDisk(destDir, directories, dryRun) {
|
|
|
16908
17875
|
}
|
|
16909
17876
|
return created;
|
|
16910
17877
|
}
|
|
16911
|
-
function
|
|
16912
|
-
|
|
17878
|
+
function collectPolicyAndSchemaFiles() {
|
|
17879
|
+
return [
|
|
16913
17880
|
{ relPath: "quality-policy.yaml", content: STARTER_QUALITY_POLICY },
|
|
16914
17881
|
{ relPath: "license-policy.yaml", content: STARTER_LICENSE_POLICY },
|
|
16915
17882
|
{ relPath: "privacy-policy.yaml", content: STARTER_PRIVACY_POLICY },
|
|
16916
17883
|
...STARTER_BASE_TEMPLATES,
|
|
16917
17884
|
...STARTER_SCHEMAS.map((s) => ({ relPath: s.relPath, content: s.content })),
|
|
17885
|
+
...getReferenceCodingRulesTemplates()
|
|
17886
|
+
];
|
|
17887
|
+
}
|
|
17888
|
+
function collectArchitectureTemplateFiles(archGranularity) {
|
|
17889
|
+
return getArchitectureTemplates(archGranularity).map((t) => ({
|
|
17890
|
+
relPath: path5__namespace.join("templates", "architecture", t.filename).replace(/\\/g, "/"),
|
|
17891
|
+
content: t.content
|
|
17892
|
+
}));
|
|
17893
|
+
}
|
|
17894
|
+
function collectStarterFiles(ciProvider, agentFiles = [], archGranularity = "minimal", stacks = []) {
|
|
17895
|
+
const files = [
|
|
17896
|
+
...collectPolicyAndSchemaFiles(),
|
|
17897
|
+
...getCodingRulesFilesForStacks(stacks),
|
|
16918
17898
|
...getCiWorkflowFiles(ciProvider),
|
|
16919
17899
|
...agentFiles,
|
|
16920
|
-
...
|
|
16921
|
-
relPath: path5__namespace.join("templates", "architecture", t.filename).replace(/\\/g, "/"),
|
|
16922
|
-
content: t.content
|
|
16923
|
-
}))
|
|
17900
|
+
...collectArchitectureTemplateFiles(archGranularity)
|
|
16924
17901
|
];
|
|
16925
17902
|
if (ciProvider === "github" || !ciProvider) {
|
|
16926
|
-
files.push({
|
|
16927
|
-
relPath: ".github/PULL_REQUEST_TEMPLATE.md",
|
|
16928
|
-
content: STARTER_GITHUB_PULL_REQUEST_TEMPLATE
|
|
16929
|
-
});
|
|
17903
|
+
files.push({ relPath: ".github/PULL_REQUEST_TEMPLATE.md", content: STARTER_GITHUB_PULL_REQUEST_TEMPLATE });
|
|
16930
17904
|
}
|
|
16931
17905
|
return files;
|
|
16932
17906
|
}
|
|
@@ -16994,7 +17968,7 @@ function mergeDirectories(base, extra) {
|
|
|
16994
17968
|
}
|
|
16995
17969
|
return result;
|
|
16996
17970
|
}
|
|
16997
|
-
function buildInitSuccessResult(destDir, directoriesCreated, filesCreated, filesUpdated, ciProvider, agentsConfigured, architectureGranularity, gitHookInstalled) {
|
|
17971
|
+
function buildInitSuccessResult(destDir, directoriesCreated, filesCreated, filesUpdated, ciProvider, agentsConfigured, architectureGranularity, stacksConfigured, gitHookInstalled) {
|
|
16998
17972
|
return {
|
|
16999
17973
|
success: true,
|
|
17000
17974
|
targetDir: destDir,
|
|
@@ -17004,6 +17978,7 @@ function buildInitSuccessResult(destDir, directoriesCreated, filesCreated, files
|
|
|
17004
17978
|
ciProvider,
|
|
17005
17979
|
agentsConfigured,
|
|
17006
17980
|
architectureGranularity,
|
|
17981
|
+
stacksConfigured,
|
|
17007
17982
|
gitHookInstalled
|
|
17008
17983
|
};
|
|
17009
17984
|
}
|
|
@@ -17014,182 +17989,37 @@ function validateInitOptions(options) {
|
|
|
17014
17989
|
if (!archRes.valid) return { valid: false, archGranularity: "minimal", error: archRes.error };
|
|
17015
17990
|
return { valid: true, ciProvider: ciRes.provider, archGranularity: archRes.granularity };
|
|
17016
17991
|
}
|
|
17017
|
-
function assembleScaffoldingPlan(ciProvider, agents, archGranularity) {
|
|
17992
|
+
function assembleScaffoldingPlan(ciProvider, agents, archGranularity, stacks = []) {
|
|
17018
17993
|
const agentTargets = resolveAgentTargets(agents);
|
|
17019
17994
|
const { dirs: agentDirs, files: agentFiles } = collectAgentFiles(agentTargets);
|
|
17020
17995
|
const directories = mergeDirectories(getBaseDirectories(ciProvider), agentDirs);
|
|
17021
|
-
const starterFiles = collectStarterFiles(ciProvider, agentFiles, archGranularity);
|
|
17996
|
+
const starterFiles = collectStarterFiles(ciProvider, agentFiles, archGranularity, stacks);
|
|
17022
17997
|
return { agentTargets, directories, starterFiles };
|
|
17023
17998
|
}
|
|
17024
|
-
function
|
|
17025
|
-
const
|
|
17026
|
-
const validated = validateInitOptions(options);
|
|
17027
|
-
if (!validated.valid) return buildInitError(destDir, validated.error);
|
|
17028
|
-
const { agentTargets, directories, starterFiles } = assembleScaffoldingPlan(
|
|
17029
|
-
validated.ciProvider,
|
|
17030
|
-
options.agents,
|
|
17031
|
-
validated.archGranularity
|
|
17032
|
-
);
|
|
17999
|
+
function executeScaffoldingOnDisk(destDir, options, ciProvider, archGranularity, stacks) {
|
|
18000
|
+
const { agentTargets, directories, starterFiles } = assembleScaffoldingPlan(ciProvider, options.agents, archGranularity, stacks);
|
|
17033
18001
|
const dirsCreated = createDirectoriesOnDisk(destDir, directories, options.dryRun);
|
|
17034
18002
|
const { filesCreated, filesUpdated } = writeProjectFiles(destDir, starterFiles, options.dryRun, options.force);
|
|
17035
|
-
if (updateConsumerPackageJson(destDir, options.dryRun))
|
|
17036
|
-
filesCreated.push("package.json");
|
|
17037
|
-
}
|
|
18003
|
+
if (updateConsumerPackageJson(destDir, options.dryRun)) filesCreated.push("package.json");
|
|
17038
18004
|
return buildInitSuccessResult(
|
|
17039
18005
|
destDir,
|
|
17040
18006
|
dirsCreated,
|
|
17041
18007
|
filesCreated,
|
|
17042
18008
|
filesUpdated,
|
|
17043
|
-
|
|
18009
|
+
ciProvider,
|
|
17044
18010
|
formatAgentsConfigured(agentTargets),
|
|
17045
|
-
|
|
18011
|
+
archGranularity,
|
|
18012
|
+
stacks,
|
|
17046
18013
|
tryInstallGitHook(destDir, options.dryRun)
|
|
17047
18014
|
);
|
|
17048
18015
|
}
|
|
17049
|
-
|
|
17050
|
-
|
|
17051
|
-
|
|
17052
|
-
|
|
17053
|
-
|
|
17054
|
-
|
|
17055
|
-
|
|
17056
|
-
},
|
|
17057
|
-
{
|
|
17058
|
-
id: "DLP-002-API-TOKEN",
|
|
17059
|
-
description: "Cloud, GitHub, Slack, OpenAI, Stripe, and AWS Access Tokens",
|
|
17060
|
-
pattern: "\\b(?:gh[pousr]_[A-Za-z0-9_]{36,255}|github_pat_[0-9a-zA-Z_]{82}|sk-(?:proj-|live-)?[a-zA-Z0-9_-]{32,}|AKIA[0-9A-Z]{16}|xox[baprs]-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*|(?:sk|rk)_(?:live|test)_[0-9a-zA-Z]{24,99})\\b",
|
|
17061
|
-
replacement: "[REDACTED:API_TOKEN]",
|
|
17062
|
-
enabled: true
|
|
17063
|
-
},
|
|
17064
|
-
{
|
|
17065
|
-
id: "DLP-003-JWT",
|
|
17066
|
-
description: "Plaintext JSON Web Token (JWT)",
|
|
17067
|
-
pattern: "\\beyJ[A-Za-z0-9_-]{10,}\\.eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\b",
|
|
17068
|
-
replacement: "[REDACTED:JWT_TOKEN]",
|
|
17069
|
-
enabled: true
|
|
17070
|
-
},
|
|
17071
|
-
{
|
|
17072
|
-
id: "DLP-004-CREDIT-CARD",
|
|
17073
|
-
description: "Payment Card Number (13-19 digits formatted)",
|
|
17074
|
-
pattern: "\\b(?:\\d{4}[- ]\\d{4}[- ]\\d{4}[- ]\\d{4}|\\d{16})\\b",
|
|
17075
|
-
replacement: "[REDACTED:CREDIT_CARD]",
|
|
17076
|
-
enabled: true
|
|
17077
|
-
},
|
|
17078
|
-
{
|
|
17079
|
-
id: "DLP-005-EMAIL",
|
|
17080
|
-
description: "Personal or Corporate Email Address",
|
|
17081
|
-
pattern: "\\b[A-Za-z0-9._%+-]+@(?!example\\.com|localhost|test\\.local)[A-Za-z0-9.-]+\\.[A-Za-z]{2,}\\b",
|
|
17082
|
-
replacement: "[REDACTED:EMAIL]",
|
|
17083
|
-
enabled: true
|
|
17084
|
-
},
|
|
17085
|
-
{
|
|
17086
|
-
id: "DLP-006-INTERNAL-URL",
|
|
17087
|
-
description: "Internal Intranet / Corp Service URL",
|
|
17088
|
-
pattern: "https?://(?:[A-Za-z0-9._-]+:[A-Za-z0-9._-]+@|[A-Za-z0-9.-]+\\.(?:internal|corp|intranet|local)\\b)[^\\s\"'`<>]*",
|
|
17089
|
-
replacement: "[REDACTED:INTERNAL_URL]",
|
|
17090
|
-
enabled: true
|
|
17091
|
-
}
|
|
17092
|
-
];
|
|
17093
|
-
function createDefaultDlpPolicy() {
|
|
17094
|
-
return {
|
|
17095
|
-
version: "1.0",
|
|
17096
|
-
enabled: true,
|
|
17097
|
-
zero_data_retention_required: true,
|
|
17098
|
-
rules: [...DEFAULT_DLP_RULES]
|
|
17099
|
-
};
|
|
17100
|
-
}
|
|
17101
|
-
function normalizeParsedRule(raw, idx) {
|
|
17102
|
-
if (typeof raw.pattern !== "string" || !raw.pattern) return null;
|
|
17103
|
-
return {
|
|
17104
|
-
id: typeof raw.id === "string" ? raw.id : `DLP-CUSTOM-${idx + 1}`,
|
|
17105
|
-
description: typeof raw.description === "string" ? raw.description : "Custom DLP rule",
|
|
17106
|
-
pattern: raw.pattern,
|
|
17107
|
-
replacement: typeof raw.replacement === "string" ? raw.replacement : "[REDACTED]",
|
|
17108
|
-
enabled: raw.enabled !== false
|
|
17109
|
-
};
|
|
17110
|
-
}
|
|
17111
|
-
function parseDlpDoc(yamlContent) {
|
|
17112
|
-
let doc;
|
|
17113
|
-
try {
|
|
17114
|
-
doc = yaml3__default.default.load(yamlContent);
|
|
17115
|
-
} catch (err) {
|
|
17116
|
-
throw new Error(`[AI-SDLC Fail-Closed] Invalid YAML in dlp-policy: ${err instanceof Error ? err.message : String(err)}`);
|
|
17117
|
-
}
|
|
17118
|
-
if (!doc || typeof doc !== "object" || Array.isArray(doc)) {
|
|
17119
|
-
throw new Error(`[AI-SDLC Fail-Closed] Invalid dlp-policy structure: root must be a YAML mapping`);
|
|
17120
|
-
}
|
|
17121
|
-
const record = doc;
|
|
17122
|
-
if (record.rules !== void 0 && !Array.isArray(record.rules)) {
|
|
17123
|
-
throw new Error(`[AI-SDLC Fail-Closed] Invalid dlp-policy: rules must be an array`);
|
|
17124
|
-
}
|
|
17125
|
-
return record;
|
|
17126
|
-
}
|
|
17127
|
-
function parseDlpPolicy(yamlContent) {
|
|
17128
|
-
const fallback = createDefaultDlpPolicy();
|
|
17129
|
-
if (!yamlContent || !yamlContent.trim()) return fallback;
|
|
17130
|
-
const record = parseDlpDoc(yamlContent);
|
|
17131
|
-
const rawRules = Array.isArray(record.rules) ? record.rules : [];
|
|
17132
|
-
const parsedRules = rawRules.map((r, i) => normalizeParsedRule(r, i)).filter((r) => r !== null);
|
|
17133
|
-
return {
|
|
17134
|
-
version: typeof record.version === "string" ? record.version : "1.0",
|
|
17135
|
-
enabled: record.enabled !== false,
|
|
17136
|
-
zero_data_retention_required: Boolean(record.zero_data_retention_required ?? true),
|
|
17137
|
-
rules: parsedRules.length > 0 ? parsedRules : fallback.rules
|
|
17138
|
-
};
|
|
17139
|
-
}
|
|
17140
|
-
function loadDlpPolicy(rootDir, customPolicyPath) {
|
|
17141
|
-
const base = rootDir || process.cwd();
|
|
17142
|
-
const filePath = customPolicyPath ? path5__namespace.isAbsolute(customPolicyPath) ? customPolicyPath : path5__namespace.join(base, customPolicyPath) : path5__namespace.join(base, "dlp-policy.yaml");
|
|
17143
|
-
if (!fs8__namespace.existsSync(filePath)) return createDefaultDlpPolicy();
|
|
17144
|
-
return parseDlpPolicy(fs8__namespace.readFileSync(filePath, "utf-8"));
|
|
17145
|
-
}
|
|
17146
|
-
function applySingleDlpRule(text, rule) {
|
|
17147
|
-
if (rule.enabled === false) return { output: text, matches: 0 };
|
|
17148
|
-
try {
|
|
17149
|
-
const regex = new RegExp(rule.pattern, "g");
|
|
17150
|
-
let matches = 0;
|
|
17151
|
-
const output = text.replace(regex, () => {
|
|
17152
|
-
matches++;
|
|
17153
|
-
return rule.replacement;
|
|
17154
|
-
});
|
|
17155
|
-
return { output, matches };
|
|
17156
|
-
} catch {
|
|
17157
|
-
return { output: text, matches: 0 };
|
|
17158
|
-
}
|
|
17159
|
-
}
|
|
17160
|
-
function sanitizeDlpText(text, policy = createDefaultDlpPolicy()) {
|
|
17161
|
-
if (!policy.enabled || !text) {
|
|
17162
|
-
return { sanitizedText: text, redactionCount: 0, triggeredRuleIds: [] };
|
|
17163
|
-
}
|
|
17164
|
-
let current = text;
|
|
17165
|
-
let totalRedactions = 0;
|
|
17166
|
-
const triggered = [];
|
|
17167
|
-
for (const rule of policy.rules) {
|
|
17168
|
-
const res = applySingleDlpRule(current, rule);
|
|
17169
|
-
if (res.matches > 0) {
|
|
17170
|
-
current = res.output;
|
|
17171
|
-
totalRedactions += res.matches;
|
|
17172
|
-
triggered.push(rule.id);
|
|
17173
|
-
}
|
|
17174
|
-
}
|
|
17175
|
-
return {
|
|
17176
|
-
sanitizedText: current,
|
|
17177
|
-
redactionCount: totalRedactions,
|
|
17178
|
-
triggeredRuleIds: triggered
|
|
17179
|
-
};
|
|
17180
|
-
}
|
|
17181
|
-
function sanitizeDlpPayload(payload, policy = createDefaultDlpPolicy()) {
|
|
17182
|
-
if (!policy.enabled || payload === null || payload === void 0) return payload;
|
|
17183
|
-
if (typeof payload === "string") {
|
|
17184
|
-
return sanitizeDlpText(payload, policy).sanitizedText;
|
|
17185
|
-
}
|
|
17186
|
-
const serialized = JSON.stringify(payload);
|
|
17187
|
-
const { sanitizedText } = sanitizeDlpText(serialized, policy);
|
|
17188
|
-
try {
|
|
17189
|
-
return JSON.parse(sanitizedText);
|
|
17190
|
-
} catch {
|
|
17191
|
-
return payload;
|
|
17192
|
-
}
|
|
18016
|
+
function initProject(options = {}) {
|
|
18017
|
+
const destDir = path5__namespace.resolve(options.rootDir || process.cwd(), options.targetDir || ".");
|
|
18018
|
+
const validated = validateInitOptions(options);
|
|
18019
|
+
if (!validated.valid) return buildInitError(destDir, validated.error);
|
|
18020
|
+
const stackRes = resolveCodingRuleStacks(options.stack, destDir);
|
|
18021
|
+
if (!stackRes.valid) return buildInitError(destDir, stackRes.error);
|
|
18022
|
+
return executeScaffoldingOnDisk(destDir, options, validated.ciProvider, validated.archGranularity, stackRes.stacks);
|
|
17193
18023
|
}
|
|
17194
18024
|
var CITATION_REGEX = /\b(ARCH-INTRO|JRN|ACT-THREAT|ACT|UC|BR|BC|ABUSE|DATA-ASSET|PRIV-ROPA|HAZ|SEC-ENC|CMP|ADR|SEC-REQ|PRIV-REQ|FR|QR|CHG|TSK|HOF)-[A-Z0-9_-]+/g;
|
|
17195
18025
|
function parseTasksFromDir(changeDirPath, rootDir) {
|
|
@@ -17657,13 +18487,20 @@ function formatInspectResultMarkdown(result) {
|
|
|
17657
18487
|
exports.ALL_ARCHITECTURE_TEMPLATES = ALL_ARCHITECTURE_TEMPLATES;
|
|
17658
18488
|
exports.BRANCH_PATTERNS = BRANCH_PATTERNS;
|
|
17659
18489
|
exports.BddStepRegistry = BddStepRegistry;
|
|
18490
|
+
exports.CPP_CLANG_TIDY = CPP_CLANG_TIDY;
|
|
18491
|
+
exports.CPP_CMAKE_STRICT = CPP_CMAKE_STRICT;
|
|
17660
18492
|
exports.DEFAULT_DLP_RULES = DEFAULT_DLP_RULES;
|
|
17661
18493
|
exports.DEFAULT_EXCLUDED_PATTERNS = DEFAULT_EXCLUDED_PATTERNS;
|
|
17662
18494
|
exports.DEFAULT_EXCLUDES = DEFAULT_EXCLUDES;
|
|
17663
18495
|
exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
|
|
17664
18496
|
exports.DEFAULT_PRIVACY_POLICY = DEFAULT_PRIVACY_POLICY;
|
|
17665
18497
|
exports.DEFAULT_SAST_EXCLUDES = DEFAULT_SAST_EXCLUDES;
|
|
18498
|
+
exports.DOTNET_DIRECTORY_BUILD_PROPS = DOTNET_DIRECTORY_BUILD_PROPS;
|
|
17666
18499
|
exports.GENERAL_SOURCE_EXTENSIONS = GENERAL_SOURCE_EXTENSIONS;
|
|
18500
|
+
exports.GO_GOLANGCI_YML = GO_GOLANGCI_YML;
|
|
18501
|
+
exports.GRADLE_STRICT_INIT_KTS = GRADLE_STRICT_INIT_KTS;
|
|
18502
|
+
exports.JAVA_PMD_RULESET_XML = JAVA_PMD_RULESET_XML;
|
|
18503
|
+
exports.KOTLIN_DETEKT_YML = KOTLIN_DETEKT_YML;
|
|
17667
18504
|
exports.KPI_SUMMARY_END_TAG = KPI_SUMMARY_END_TAG;
|
|
17668
18505
|
exports.KPI_SUMMARY_START_TAG = KPI_SUMMARY_START_TAG;
|
|
17669
18506
|
exports.LIFECYCLE_SKILL_TEMPLATES = LIFECYCLE_SKILL_TEMPLATES;
|
|
@@ -17673,6 +18510,11 @@ exports.PREPARE_COMMIT_MSG_SCRIPT = PREPARE_COMMIT_MSG_SCRIPT;
|
|
|
17673
18510
|
exports.PRE_COMMIT_SCRIPT = PRE_COMMIT_SCRIPT;
|
|
17674
18511
|
exports.PROMPT_INJECTION_SIGNATURES = PROMPT_INJECTION_SIGNATURES;
|
|
17675
18512
|
exports.PROTECTED_BYPASS_PATTERNS = PROTECTED_BYPASS_PATTERNS;
|
|
18513
|
+
exports.PROTECTED_CODING_RULES_FILES = PROTECTED_CODING_RULES_FILES;
|
|
18514
|
+
exports.REVIEWER_ROLES = REVIEWER_ROLES;
|
|
18515
|
+
exports.REVIEW_VERDICTS = REVIEW_VERDICTS;
|
|
18516
|
+
exports.RUST_CARGO_CONFIG_TOML = RUST_CARGO_CONFIG_TOML;
|
|
18517
|
+
exports.RUST_CLIPPY_TOML = RUST_CLIPPY_TOML;
|
|
17676
18518
|
exports.SARIF_SCHEMA_2_1_0 = SARIF_SCHEMA_2_1_0;
|
|
17677
18519
|
exports.SARIF_VERSION = SARIF_VERSION;
|
|
17678
18520
|
exports.SAST_RULES = SAST_RULES;
|
|
@@ -17712,6 +18554,8 @@ exports.SCHEMA_SCHEMAS_SECURITY_THREAT_ACTOR_SCHEMA_JSON = SCHEMA_SCHEMAS_SECURI
|
|
|
17712
18554
|
exports.SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON = SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON;
|
|
17713
18555
|
exports.SECRET_RULES = SECRET_RULES;
|
|
17714
18556
|
exports.SPECIALIZED_AGENT_TEMPLATES = SPECIALIZED_AGENT_TEMPLATES;
|
|
18557
|
+
exports.STARTER_AGENT_GUARD_WRAPPER_CJS = STARTER_AGENT_GUARD_WRAPPER_CJS;
|
|
18558
|
+
exports.STARTER_ANTIGRAVITY_HOOKS_JSON = STARTER_ANTIGRAVITY_HOOKS_JSON;
|
|
17715
18559
|
exports.STARTER_ANTIGRAVITY_MCP = STARTER_ANTIGRAVITY_MCP;
|
|
17716
18560
|
exports.STARTER_ANTIGRAVITY_RULES = STARTER_ANTIGRAVITY_RULES;
|
|
17717
18561
|
exports.STARTER_ARCH_ADR = STARTER_ARCH_ADR;
|
|
@@ -17743,6 +18587,7 @@ exports.STARTER_GITHUB_PR_KPI = STARTER_GITHUB_PR_KPI;
|
|
|
17743
18587
|
exports.STARTER_GITHUB_PULL_REQUEST_TEMPLATE = STARTER_GITHUB_PULL_REQUEST_TEMPLATE;
|
|
17744
18588
|
exports.STARTER_GITHUB_SDD_INTEGRATE = STARTER_GITHUB_SDD_INTEGRATE;
|
|
17745
18589
|
exports.STARTER_GITLAB_CI = STARTER_GITLAB_CI;
|
|
18590
|
+
exports.STARTER_GUARD_BRANCH_CJS = STARTER_GUARD_BRANCH_CJS;
|
|
17746
18591
|
exports.STARTER_LICENSE_POLICY = STARTER_LICENSE_POLICY;
|
|
17747
18592
|
exports.STARTER_PRIVACY_POLICY = STARTER_PRIVACY_POLICY;
|
|
17748
18593
|
exports.STARTER_PROCESS_README = STARTER_PROCESS_README;
|
|
@@ -17791,6 +18636,8 @@ exports.STARTER_VSCODE_MCP = STARTER_VSCODE_MCP;
|
|
|
17791
18636
|
exports.STARTER_WORKFLOW_HANDOFF_TEMPLATE = STARTER_WORKFLOW_HANDOFF_TEMPLATE;
|
|
17792
18637
|
exports.STARTER__GITHUB_PULL_REQUEST_TEMPLATE_MD = STARTER__GITHUB_PULL_REQUEST_TEMPLATE_MD;
|
|
17793
18638
|
exports.SpecKitAdapter = SpecKitAdapter;
|
|
18639
|
+
exports.TS_ESLINT_CONFIG_MJS = TS_ESLINT_CONFIG_MJS;
|
|
18640
|
+
exports.TS_STRICT_TSCONFIG = TS_STRICT_TSCONFIG;
|
|
17794
18641
|
exports.TYPE_TO_SCHEMA_MAP = TYPE_TO_SCHEMA_MAP;
|
|
17795
18642
|
exports.UNIT_TEST_SUFFIXES = UNIT_TEST_SUFFIXES;
|
|
17796
18643
|
exports.VALID_AGENT_TARGETS = VALID_AGENT_TARGETS;
|
|
@@ -17798,6 +18645,7 @@ exports.VALID_ARCHITECTURE_GRANULARITIES = VALID_ARCHITECTURE_GRANULARITIES;
|
|
|
17798
18645
|
exports.VALID_AUTONOMY_MODES = VALID_AUTONOMY_MODES;
|
|
17799
18646
|
exports.VALID_CHANGE_PROFILES = VALID_CHANGE_PROFILES;
|
|
17800
18647
|
exports.VALID_CI_PROVIDERS = VALID_CI_PROVIDERS;
|
|
18648
|
+
exports.VALID_CODING_RULE_STACKS = VALID_CODING_RULE_STACKS;
|
|
17801
18649
|
exports.aggregateCommitKpiRecords = aggregateCommitKpiRecords;
|
|
17802
18650
|
exports.aggregatePrKpis = aggregatePrKpis;
|
|
17803
18651
|
exports.aggregateReleaseKpis = aggregateReleaseKpis;
|
|
@@ -17831,6 +18679,7 @@ exports.detectActiveChangeForIntegration = detectActiveChangeForIntegration;
|
|
|
17831
18679
|
exports.detectAuthorIdentity = detectAuthorIdentity;
|
|
17832
18680
|
exports.detectLanguage = detectLanguage;
|
|
17833
18681
|
exports.detectProfileFromChange = detectProfileFromChange;
|
|
18682
|
+
exports.detectProjectStacks = detectProjectStacks;
|
|
17834
18683
|
exports.detectPromptInjection = detectPromptInjection;
|
|
17835
18684
|
exports.emitCiOutput = emitCiOutput;
|
|
17836
18685
|
exports.evaluateCompoundLicense = evaluateCompoundLicense;
|
|
@@ -17879,9 +18728,11 @@ exports.generateTestingCoverageReportMarkdown = generateTestingCoverageReportMar
|
|
|
17879
18728
|
exports.generateThirdPartyNotices = generateThirdPartyNotices;
|
|
17880
18729
|
exports.generateTraceabilityReportMarkdown = generateTraceabilityReportMarkdown;
|
|
17881
18730
|
exports.getArchitectureTemplates = getArchitectureTemplates;
|
|
18731
|
+
exports.getCodingRulesFilesForStacks = getCodingRulesFilesForStacks;
|
|
17882
18732
|
exports.getCytoscapeScript = getCytoscapeScript;
|
|
17883
18733
|
exports.getGitDiffLines = getGitDiffLines;
|
|
17884
18734
|
exports.getNextCorrelativeNumber = getNextCorrelativeNumber;
|
|
18735
|
+
exports.getReferenceCodingRulesTemplates = getReferenceCodingRulesTemplates;
|
|
17885
18736
|
exports.getSddAdapter = getSddAdapter;
|
|
17886
18737
|
exports.inferArtifactTypeFromId = inferArtifactTypeFromId;
|
|
17887
18738
|
exports.inferMissingTrailers = inferMissingTrailers;
|
|
@@ -17896,8 +18747,10 @@ exports.isGitleaksInstalled = isGitleaksInstalled;
|
|
|
17896
18747
|
exports.isMetricWorsened = isMetricWorsened;
|
|
17897
18748
|
exports.isPathProtectedFromPatch = isPathProtectedFromPatch;
|
|
17898
18749
|
exports.isPlaceholderOrIgnored = isPlaceholderOrIgnored;
|
|
18750
|
+
exports.isProtectedCodingRulesFile = isProtectedCodingRulesFile;
|
|
17899
18751
|
exports.isReportContentSemanticallyEqual = isReportContentSemanticallyEqual;
|
|
17900
18752
|
exports.isRequirementArtifact = isRequirementArtifact2;
|
|
18753
|
+
exports.isReviewerRole = isReviewerRole;
|
|
17901
18754
|
exports.isSemgrepInstalled = isSemgrepInstalled;
|
|
17902
18755
|
exports.isToolAvailable = isToolAvailable;
|
|
17903
18756
|
exports.loadDlpPolicy = loadDlpPolicy;
|
|
@@ -17943,6 +18796,7 @@ exports.renderManualsTab = renderManualsTab;
|
|
|
17943
18796
|
exports.resolveAgentTargets = resolveAgentTargets;
|
|
17944
18797
|
exports.resolveBranchHierarchy = resolveBranchHierarchy;
|
|
17945
18798
|
exports.resolveCiEnvironment = resolveCiEnvironment;
|
|
18799
|
+
exports.resolveCodingRuleStacks = resolveCodingRuleStacks;
|
|
17946
18800
|
exports.resolveCytoscapePath = resolveCytoscapePath;
|
|
17947
18801
|
exports.resolveDefaultBranchBase = resolveDefaultBranchBase;
|
|
17948
18802
|
exports.resolveDeterministicDate = resolveDeterministicDate;
|
|
@@ -17979,6 +18833,7 @@ exports.scanWithTrivy = scanWithTrivy;
|
|
|
17979
18833
|
exports.serializeSarifDocument = serializeSarifDocument;
|
|
17980
18834
|
exports.slugify = slugify2;
|
|
17981
18835
|
exports.stripVolatileReportMetadata = stripVolatileReportMetadata;
|
|
18836
|
+
exports.submitReviewReport = submitReviewReport;
|
|
17982
18837
|
exports.syncPdacDigests = syncPdacDigests;
|
|
17983
18838
|
exports.tokenizeTitle = tokenizeTitle;
|
|
17984
18839
|
exports.updateCitationsInContent = updateCitationsInContent;
|