@aisdlc/core 3.2.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 +1041 -196
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -6
- package/dist/index.d.ts +74 -6
- package/dist/index.js +1017 -197
- 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\`.
|
|
@@ -14211,6 +14588,7 @@ Use this skill when starting a **brand-new software project from scratch (Greenf
|
|
|
14211
14588
|
|
|
14212
14589
|
## Non-Negotiable Guardrails
|
|
14213
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.
|
|
14214
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-*\`.
|
|
14215
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.
|
|
14216
14594
|
- All newly drafted specifications must start with \`status: draft\`.
|
|
@@ -14219,12 +14597,20 @@ Use this skill when starting a **brand-new software project from scratch (Greenf
|
|
|
14219
14597
|
{
|
|
14220
14598
|
id: "aisdlc-legacy-onboarding",
|
|
14221
14599
|
title: "Legacy / Brownfield Retro-Inception Playbook",
|
|
14222
|
-
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.",
|
|
14223
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).",
|
|
14224
14602
|
globs: "architecture/**, specs/**, src/**, packages/**",
|
|
14225
14603
|
body: `## Purpose & Trigger
|
|
14226
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.
|
|
14227
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
|
+
|
|
14228
14614
|
## End-to-End Execution Playbook
|
|
14229
14615
|
|
|
14230
14616
|
### Step 1: Non-Destructive Framework Scaffolding
|
|
@@ -14242,9 +14628,13 @@ Before modifying any code or creating SDD changes, run diagnostic verifiers to q
|
|
|
14242
14628
|
### Step 3: Brownfield Retro-Inception (\`agent-system-architect\` & \`agent-product-analyst\`)
|
|
14243
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:
|
|
14244
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).
|
|
14245
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).
|
|
14246
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).
|
|
14247
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).
|
|
14248
14638
|
|
|
14249
14639
|
### Step 4: Characterization Testing & Synchronization
|
|
14250
14640
|
1. Run MCP tool \`sdd_check_fix\` (\`npx aisdlc check --fix\`) to extract \`.feature\` files and compute canonical SHA-256 digests.
|
|
@@ -14255,6 +14645,7 @@ Once the target domain's baseline artifacts (\`ARCH-INTRO-*\`, \`UC-*\`, \`FR-*\
|
|
|
14255
14645
|
|
|
14256
14646
|
## Non-Negotiable Guardrails
|
|
14257
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.
|
|
14258
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-*\`).
|
|
14259
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\`).
|
|
14260
14651
|
- **Immediate Secret Remediation**: If Step 2 (\`verify_security\`) uncovers leaked credentials (exit code 4), halt feature work and remediate/rotate secrets immediately.`
|
|
@@ -14262,7 +14653,7 @@ Once the target domain's baseline artifacts (\`ARCH-INTRO-*\`, \`UC-*\`, \`FR-*\
|
|
|
14262
14653
|
{
|
|
14263
14654
|
id: "aisdlc-increment",
|
|
14264
14655
|
title: "Bounded SDD Feature & Bugfix Delivery Playbook",
|
|
14265
|
-
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.",
|
|
14266
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).",
|
|
14267
14658
|
globs: "specs/changes/**, src/**, packages/**, tests/**",
|
|
14268
14659
|
body: `## Purpose & Trigger
|
|
@@ -14274,9 +14665,12 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14274
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/\`.
|
|
14275
14666
|
2. If the increment introduces new behavior or modifies business rules:
|
|
14276
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).
|
|
14277
14669
|
- Run MCP tool \`verify_duplicates\` (\`npx aisdlc verify duplicates\`) to block lexical or functional collisions early.
|
|
14278
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).
|
|
14279
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).
|
|
14280
14674
|
3. Run \`sdd_check_fix\` (\`npx aisdlc check --fix\`) to sync Gherkin \`.feature\` files and validate schemas.
|
|
14281
14675
|
|
|
14282
14676
|
### Step 2: SDD Change Scaffolding & Architectural Design (\`agent-system-architect\`)
|
|
@@ -14284,7 +14678,10 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14284
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\`:
|
|
14285
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.
|
|
14286
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\`).
|
|
14287
|
-
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\`).
|
|
14288
14685
|
|
|
14289
14686
|
### Step 3: 4-Tier Git Branch Navigation & Multi-Agent Parallelism
|
|
14290
14687
|
1. Navigate to the task branch using \`npx aisdlc git checkout <TSK-ID>\` (\`pnpm run git:checkout <TSK-ID>\`), which cascade-creates:
|
|
@@ -14297,7 +14694,10 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14297
14694
|
### Step 4: Red Phase \u2014 Failing Test Suites (\`agent-qa-engineer\`)
|
|
14298
14695
|
1. Delegate to or adopt [\`agent-qa-engineer\`](../agent-qa-engineer/SKILL.md).
|
|
14299
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/\`.
|
|
14300
|
-
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.
|
|
14301
14701
|
|
|
14302
14702
|
### Step 5: Green & Refactor Phase \u2014 Surgical Implementation (\`agent-developer\`)
|
|
14303
14703
|
1. Delegate to or adopt [\`agent-developer\`](../agent-developer/SKILL.md).
|
|
@@ -14305,6 +14705,19 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14305
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).
|
|
14306
14706
|
3. Verify any new dependency against \`license-policy.yaml\` via \`verify_licenses\` and PII handling against \`privacy-policy.yaml\` via \`verify_privacy\`.
|
|
14307
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.
|
|
14308
14721
|
|
|
14309
14722
|
### Step 6: Post-Development Functional Validation & Pre-Merge Audit Triad
|
|
14310
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).
|
|
@@ -14324,6 +14737,7 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14324
14737
|
|
|
14325
14738
|
## Non-Negotiable Guardrails
|
|
14326
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.
|
|
14327
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.
|
|
14328
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\`.`
|
|
14329
14743
|
}
|
|
@@ -14500,6 +14914,14 @@ This file defines the operational rules and specialized role mappings for Google
|
|
|
14500
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.
|
|
14501
14915
|
- **Remote Verification**: Creating a PR (\`gh pr create\`) does not equal success; actively verify that remote checks pass (\`gh pr checks\`).
|
|
14502
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
|
+
|
|
14503
14925
|
---
|
|
14504
14926
|
|
|
14505
14927
|
## 3. Git 4-Tier Hierarchy and Commit Conventions
|
|
@@ -14519,7 +14941,7 @@ This file defines the operational rules and specialized role mappings for Google
|
|
|
14519
14941
|
- **Conditional Activation Rule by Autonomy**:
|
|
14520
14942
|
- \u{1F7E2} **\`AUTONOMOUS\`** (or exclusive final supervision in PR/CI): **OMITTED**. Do not request or emit interactive handoff to avoid interrupting unattended execution.
|
|
14521
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**.
|
|
14522
|
-
- **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).
|
|
14523
14945
|
`;
|
|
14524
14946
|
var STARTER_CURSOR_CORE_RULES = `---
|
|
14525
14947
|
description: Global canonical directives, 5 unbreakable commandments, and AI-SDLC pre-flight
|
|
@@ -14566,6 +14988,8 @@ Before finalizing changes or proposing commits:
|
|
|
14566
14988
|
| \`agent-expert-user\` | Bimodal MVP evaluation (design) and functional validation against \`UC-*\` and \`FR-*\` (pre-PR). |
|
|
14567
14989
|
| \`agent-code-reviewer\` | PR audit (SOLID, DRY, YAGNI): \`[BLOCKING]\` / \`[CLEAN_CODE_SUGGESTION]\` / \`[COMPLIANT]\`. |
|
|
14568
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. |
|
|
14569
14993
|
|
|
14570
14994
|
## 5. Task Autonomy Modes (\`tasks.md\`)
|
|
14571
14995
|
- \u{1F7E2} **\`AUTONOMOUS\`**: Low risk. Implement directly, omit handoff block.
|
|
@@ -14736,6 +15160,14 @@ npx tsx packages/cli/src/index.ts sdd integrate --change <chg-id>
|
|
|
14736
15160
|
- **Mission**: Maintain, evolve, and audit automated project infrastructure: CI/CD workflows, Docker containers, IaC manifests, and support scripts.
|
|
14737
15161
|
- **NON-INVASION GUARDRAIL**: STRICTLY FORBIDDEN from modifying application source code (\`src/\`, \`packages/*/src/\`).
|
|
14738
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
|
+
|
|
14739
15171
|
---
|
|
14740
15172
|
|
|
14741
15173
|
## 4. Task Autonomy Modes (\`tasks.md\`)
|
|
@@ -14870,6 +15302,8 @@ Non-Negotiable Quality Thresholds (\`quality-policy.yaml\`):
|
|
|
14870
15302
|
| \`agent-expert-user\` | Bimodal MVP evaluation (design) and functional validation against \`UC-*\` and \`FR-*\` (pre-PR). |
|
|
14871
15303
|
| \`agent-code-reviewer\` | PR audit (SOLID, DRY, YAGNI): \`[BLOCKING]\` / \`[CLEAN_CODE_SUGGESTION]\` / \`[COMPLIANT]\`. |
|
|
14872
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. |
|
|
14873
15307
|
|
|
14874
15308
|
---
|
|
14875
15309
|
|
|
@@ -16031,6 +16465,522 @@ var STARTER_BASE_TEMPLATES = [
|
|
|
16031
16465
|
{ relPath: "process/README.md", content: STARTER_PROCESS_README },
|
|
16032
16466
|
{ relPath: "compliance/license-manifest.yaml", content: STARTER_COMPLIANCE_LICENSE_MANIFEST_YAML }
|
|
16033
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
|
+
}
|
|
16034
16984
|
|
|
16035
16985
|
// src/init/index.ts
|
|
16036
16986
|
var VALID_CI_PROVIDERS = ["github", "gitlab", "azure", "bitbucket"];
|
|
@@ -16740,7 +17690,12 @@ function resolveAgentTargets(agents) {
|
|
|
16740
17690
|
}
|
|
16741
17691
|
function appendAntigravityFiles(dirs, files) {
|
|
16742
17692
|
dirs.push(".agent/rules", ".agent/agents", ".agent/skills");
|
|
16743
|
-
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
|
+
);
|
|
16744
17699
|
for (const agent of SPECIALIZED_AGENT_TEMPLATES) {
|
|
16745
17700
|
const content = renderAntigravityAgentFile(agent);
|
|
16746
17701
|
files.push({ relPath: `.agent/agents/${agent.id}.md`, content });
|
|
@@ -16811,24 +17766,25 @@ function collectAgentFiles(targets) {
|
|
|
16811
17766
|
appendMcpFiles(dirs, files);
|
|
16812
17767
|
return { dirs, files };
|
|
16813
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
|
+
}
|
|
16814
17780
|
function writeSingleFile(fullFilePath, content, relPath, opts, results) {
|
|
16815
17781
|
const exists = fs8__namespace.existsSync(fullFilePath);
|
|
17782
|
+
const canOverwrite = Boolean(opts.force && !PROTECTED_CODING_RULES_FILES.includes(relPath));
|
|
16816
17783
|
if (opts.dryRun) {
|
|
16817
|
-
|
|
16818
|
-
else if (!exists) results.filesCreated.push(relPath);
|
|
17784
|
+
recordDryRunFile(exists, canOverwrite, relPath, results);
|
|
16819
17785
|
return;
|
|
16820
17786
|
}
|
|
16821
|
-
|
|
16822
|
-
if (!fs8__namespace.existsSync(parentDir)) {
|
|
16823
|
-
fs8__namespace.mkdirSync(parentDir, { recursive: true });
|
|
16824
|
-
}
|
|
16825
|
-
if (!exists) {
|
|
16826
|
-
fs8__namespace.writeFileSync(fullFilePath, content, "utf-8");
|
|
16827
|
-
results.filesCreated.push(relPath);
|
|
16828
|
-
} else if (opts.force) {
|
|
16829
|
-
fs8__namespace.writeFileSync(fullFilePath, content, "utf-8");
|
|
16830
|
-
results.filesUpdated.push(relPath);
|
|
16831
|
-
}
|
|
17787
|
+
if (!exists || canOverwrite) persistFileToDisk(fullFilePath, content, exists, relPath, results);
|
|
16832
17788
|
}
|
|
16833
17789
|
function writeProjectFiles(destDir, files, dryRun, force) {
|
|
16834
17790
|
const results = { filesCreated: [], filesUpdated: [] };
|
|
@@ -16884,6 +17840,7 @@ var BASE_DIRECTORIES = [
|
|
|
16884
17840
|
"templates/sdd",
|
|
16885
17841
|
"templates/manuals",
|
|
16886
17842
|
"templates/ci",
|
|
17843
|
+
"templates/coding-rules",
|
|
16887
17844
|
"templates/workflow",
|
|
16888
17845
|
"specs",
|
|
16889
17846
|
"reports",
|
|
@@ -16918,25 +17875,32 @@ function createDirectoriesOnDisk(destDir, directories, dryRun) {
|
|
|
16918
17875
|
}
|
|
16919
17876
|
return created;
|
|
16920
17877
|
}
|
|
16921
|
-
function
|
|
16922
|
-
|
|
17878
|
+
function collectPolicyAndSchemaFiles() {
|
|
17879
|
+
return [
|
|
16923
17880
|
{ relPath: "quality-policy.yaml", content: STARTER_QUALITY_POLICY },
|
|
16924
17881
|
{ relPath: "license-policy.yaml", content: STARTER_LICENSE_POLICY },
|
|
16925
17882
|
{ relPath: "privacy-policy.yaml", content: STARTER_PRIVACY_POLICY },
|
|
16926
17883
|
...STARTER_BASE_TEMPLATES,
|
|
16927
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),
|
|
16928
17898
|
...getCiWorkflowFiles(ciProvider),
|
|
16929
17899
|
...agentFiles,
|
|
16930
|
-
...
|
|
16931
|
-
relPath: path5__namespace.join("templates", "architecture", t.filename).replace(/\\/g, "/"),
|
|
16932
|
-
content: t.content
|
|
16933
|
-
}))
|
|
17900
|
+
...collectArchitectureTemplateFiles(archGranularity)
|
|
16934
17901
|
];
|
|
16935
17902
|
if (ciProvider === "github" || !ciProvider) {
|
|
16936
|
-
files.push({
|
|
16937
|
-
relPath: ".github/PULL_REQUEST_TEMPLATE.md",
|
|
16938
|
-
content: STARTER_GITHUB_PULL_REQUEST_TEMPLATE
|
|
16939
|
-
});
|
|
17903
|
+
files.push({ relPath: ".github/PULL_REQUEST_TEMPLATE.md", content: STARTER_GITHUB_PULL_REQUEST_TEMPLATE });
|
|
16940
17904
|
}
|
|
16941
17905
|
return files;
|
|
16942
17906
|
}
|
|
@@ -17004,7 +17968,7 @@ function mergeDirectories(base, extra) {
|
|
|
17004
17968
|
}
|
|
17005
17969
|
return result;
|
|
17006
17970
|
}
|
|
17007
|
-
function buildInitSuccessResult(destDir, directoriesCreated, filesCreated, filesUpdated, ciProvider, agentsConfigured, architectureGranularity, gitHookInstalled) {
|
|
17971
|
+
function buildInitSuccessResult(destDir, directoriesCreated, filesCreated, filesUpdated, ciProvider, agentsConfigured, architectureGranularity, stacksConfigured, gitHookInstalled) {
|
|
17008
17972
|
return {
|
|
17009
17973
|
success: true,
|
|
17010
17974
|
targetDir: destDir,
|
|
@@ -17014,6 +17978,7 @@ function buildInitSuccessResult(destDir, directoriesCreated, filesCreated, files
|
|
|
17014
17978
|
ciProvider,
|
|
17015
17979
|
agentsConfigured,
|
|
17016
17980
|
architectureGranularity,
|
|
17981
|
+
stacksConfigured,
|
|
17017
17982
|
gitHookInstalled
|
|
17018
17983
|
};
|
|
17019
17984
|
}
|
|
@@ -17024,182 +17989,37 @@ function validateInitOptions(options) {
|
|
|
17024
17989
|
if (!archRes.valid) return { valid: false, archGranularity: "minimal", error: archRes.error };
|
|
17025
17990
|
return { valid: true, ciProvider: ciRes.provider, archGranularity: archRes.granularity };
|
|
17026
17991
|
}
|
|
17027
|
-
function assembleScaffoldingPlan(ciProvider, agents, archGranularity) {
|
|
17992
|
+
function assembleScaffoldingPlan(ciProvider, agents, archGranularity, stacks = []) {
|
|
17028
17993
|
const agentTargets = resolveAgentTargets(agents);
|
|
17029
17994
|
const { dirs: agentDirs, files: agentFiles } = collectAgentFiles(agentTargets);
|
|
17030
17995
|
const directories = mergeDirectories(getBaseDirectories(ciProvider), agentDirs);
|
|
17031
|
-
const starterFiles = collectStarterFiles(ciProvider, agentFiles, archGranularity);
|
|
17996
|
+
const starterFiles = collectStarterFiles(ciProvider, agentFiles, archGranularity, stacks);
|
|
17032
17997
|
return { agentTargets, directories, starterFiles };
|
|
17033
17998
|
}
|
|
17034
|
-
function
|
|
17035
|
-
const
|
|
17036
|
-
const validated = validateInitOptions(options);
|
|
17037
|
-
if (!validated.valid) return buildInitError(destDir, validated.error);
|
|
17038
|
-
const { agentTargets, directories, starterFiles } = assembleScaffoldingPlan(
|
|
17039
|
-
validated.ciProvider,
|
|
17040
|
-
options.agents,
|
|
17041
|
-
validated.archGranularity
|
|
17042
|
-
);
|
|
17999
|
+
function executeScaffoldingOnDisk(destDir, options, ciProvider, archGranularity, stacks) {
|
|
18000
|
+
const { agentTargets, directories, starterFiles } = assembleScaffoldingPlan(ciProvider, options.agents, archGranularity, stacks);
|
|
17043
18001
|
const dirsCreated = createDirectoriesOnDisk(destDir, directories, options.dryRun);
|
|
17044
18002
|
const { filesCreated, filesUpdated } = writeProjectFiles(destDir, starterFiles, options.dryRun, options.force);
|
|
17045
|
-
if (updateConsumerPackageJson(destDir, options.dryRun))
|
|
17046
|
-
filesCreated.push("package.json");
|
|
17047
|
-
}
|
|
18003
|
+
if (updateConsumerPackageJson(destDir, options.dryRun)) filesCreated.push("package.json");
|
|
17048
18004
|
return buildInitSuccessResult(
|
|
17049
18005
|
destDir,
|
|
17050
18006
|
dirsCreated,
|
|
17051
18007
|
filesCreated,
|
|
17052
18008
|
filesUpdated,
|
|
17053
|
-
|
|
18009
|
+
ciProvider,
|
|
17054
18010
|
formatAgentsConfigured(agentTargets),
|
|
17055
|
-
|
|
18011
|
+
archGranularity,
|
|
18012
|
+
stacks,
|
|
17056
18013
|
tryInstallGitHook(destDir, options.dryRun)
|
|
17057
18014
|
);
|
|
17058
18015
|
}
|
|
17059
|
-
|
|
17060
|
-
|
|
17061
|
-
|
|
17062
|
-
|
|
17063
|
-
|
|
17064
|
-
|
|
17065
|
-
|
|
17066
|
-
},
|
|
17067
|
-
{
|
|
17068
|
-
id: "DLP-002-API-TOKEN",
|
|
17069
|
-
description: "Cloud, GitHub, Slack, OpenAI, Stripe, and AWS Access Tokens",
|
|
17070
|
-
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",
|
|
17071
|
-
replacement: "[REDACTED:API_TOKEN]",
|
|
17072
|
-
enabled: true
|
|
17073
|
-
},
|
|
17074
|
-
{
|
|
17075
|
-
id: "DLP-003-JWT",
|
|
17076
|
-
description: "Plaintext JSON Web Token (JWT)",
|
|
17077
|
-
pattern: "\\beyJ[A-Za-z0-9_-]{10,}\\.eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\b",
|
|
17078
|
-
replacement: "[REDACTED:JWT_TOKEN]",
|
|
17079
|
-
enabled: true
|
|
17080
|
-
},
|
|
17081
|
-
{
|
|
17082
|
-
id: "DLP-004-CREDIT-CARD",
|
|
17083
|
-
description: "Payment Card Number (13-19 digits formatted)",
|
|
17084
|
-
pattern: "\\b(?:\\d{4}[- ]\\d{4}[- ]\\d{4}[- ]\\d{4}|\\d{16})\\b",
|
|
17085
|
-
replacement: "[REDACTED:CREDIT_CARD]",
|
|
17086
|
-
enabled: true
|
|
17087
|
-
},
|
|
17088
|
-
{
|
|
17089
|
-
id: "DLP-005-EMAIL",
|
|
17090
|
-
description: "Personal or Corporate Email Address",
|
|
17091
|
-
pattern: "\\b[A-Za-z0-9._%+-]+@(?!example\\.com|localhost|test\\.local)[A-Za-z0-9.-]+\\.[A-Za-z]{2,}\\b",
|
|
17092
|
-
replacement: "[REDACTED:EMAIL]",
|
|
17093
|
-
enabled: true
|
|
17094
|
-
},
|
|
17095
|
-
{
|
|
17096
|
-
id: "DLP-006-INTERNAL-URL",
|
|
17097
|
-
description: "Internal Intranet / Corp Service URL",
|
|
17098
|
-
pattern: "https?://(?:[A-Za-z0-9._-]+:[A-Za-z0-9._-]+@|[A-Za-z0-9.-]+\\.(?:internal|corp|intranet|local)\\b)[^\\s\"'`<>]*",
|
|
17099
|
-
replacement: "[REDACTED:INTERNAL_URL]",
|
|
17100
|
-
enabled: true
|
|
17101
|
-
}
|
|
17102
|
-
];
|
|
17103
|
-
function createDefaultDlpPolicy() {
|
|
17104
|
-
return {
|
|
17105
|
-
version: "1.0",
|
|
17106
|
-
enabled: true,
|
|
17107
|
-
zero_data_retention_required: true,
|
|
17108
|
-
rules: [...DEFAULT_DLP_RULES]
|
|
17109
|
-
};
|
|
17110
|
-
}
|
|
17111
|
-
function normalizeParsedRule(raw, idx) {
|
|
17112
|
-
if (typeof raw.pattern !== "string" || !raw.pattern) return null;
|
|
17113
|
-
return {
|
|
17114
|
-
id: typeof raw.id === "string" ? raw.id : `DLP-CUSTOM-${idx + 1}`,
|
|
17115
|
-
description: typeof raw.description === "string" ? raw.description : "Custom DLP rule",
|
|
17116
|
-
pattern: raw.pattern,
|
|
17117
|
-
replacement: typeof raw.replacement === "string" ? raw.replacement : "[REDACTED]",
|
|
17118
|
-
enabled: raw.enabled !== false
|
|
17119
|
-
};
|
|
17120
|
-
}
|
|
17121
|
-
function parseDlpDoc(yamlContent) {
|
|
17122
|
-
let doc;
|
|
17123
|
-
try {
|
|
17124
|
-
doc = yaml3__default.default.load(yamlContent);
|
|
17125
|
-
} catch (err) {
|
|
17126
|
-
throw new Error(`[AI-SDLC Fail-Closed] Invalid YAML in dlp-policy: ${err instanceof Error ? err.message : String(err)}`);
|
|
17127
|
-
}
|
|
17128
|
-
if (!doc || typeof doc !== "object" || Array.isArray(doc)) {
|
|
17129
|
-
throw new Error(`[AI-SDLC Fail-Closed] Invalid dlp-policy structure: root must be a YAML mapping`);
|
|
17130
|
-
}
|
|
17131
|
-
const record = doc;
|
|
17132
|
-
if (record.rules !== void 0 && !Array.isArray(record.rules)) {
|
|
17133
|
-
throw new Error(`[AI-SDLC Fail-Closed] Invalid dlp-policy: rules must be an array`);
|
|
17134
|
-
}
|
|
17135
|
-
return record;
|
|
17136
|
-
}
|
|
17137
|
-
function parseDlpPolicy(yamlContent) {
|
|
17138
|
-
const fallback = createDefaultDlpPolicy();
|
|
17139
|
-
if (!yamlContent || !yamlContent.trim()) return fallback;
|
|
17140
|
-
const record = parseDlpDoc(yamlContent);
|
|
17141
|
-
const rawRules = Array.isArray(record.rules) ? record.rules : [];
|
|
17142
|
-
const parsedRules = rawRules.map((r, i) => normalizeParsedRule(r, i)).filter((r) => r !== null);
|
|
17143
|
-
return {
|
|
17144
|
-
version: typeof record.version === "string" ? record.version : "1.0",
|
|
17145
|
-
enabled: record.enabled !== false,
|
|
17146
|
-
zero_data_retention_required: Boolean(record.zero_data_retention_required ?? true),
|
|
17147
|
-
rules: parsedRules.length > 0 ? parsedRules : fallback.rules
|
|
17148
|
-
};
|
|
17149
|
-
}
|
|
17150
|
-
function loadDlpPolicy(rootDir, customPolicyPath) {
|
|
17151
|
-
const base = rootDir || process.cwd();
|
|
17152
|
-
const filePath = customPolicyPath ? path5__namespace.isAbsolute(customPolicyPath) ? customPolicyPath : path5__namespace.join(base, customPolicyPath) : path5__namespace.join(base, "dlp-policy.yaml");
|
|
17153
|
-
if (!fs8__namespace.existsSync(filePath)) return createDefaultDlpPolicy();
|
|
17154
|
-
return parseDlpPolicy(fs8__namespace.readFileSync(filePath, "utf-8"));
|
|
17155
|
-
}
|
|
17156
|
-
function applySingleDlpRule(text, rule) {
|
|
17157
|
-
if (rule.enabled === false) return { output: text, matches: 0 };
|
|
17158
|
-
try {
|
|
17159
|
-
const regex = new RegExp(rule.pattern, "g");
|
|
17160
|
-
let matches = 0;
|
|
17161
|
-
const output = text.replace(regex, () => {
|
|
17162
|
-
matches++;
|
|
17163
|
-
return rule.replacement;
|
|
17164
|
-
});
|
|
17165
|
-
return { output, matches };
|
|
17166
|
-
} catch {
|
|
17167
|
-
return { output: text, matches: 0 };
|
|
17168
|
-
}
|
|
17169
|
-
}
|
|
17170
|
-
function sanitizeDlpText(text, policy = createDefaultDlpPolicy()) {
|
|
17171
|
-
if (!policy.enabled || !text) {
|
|
17172
|
-
return { sanitizedText: text, redactionCount: 0, triggeredRuleIds: [] };
|
|
17173
|
-
}
|
|
17174
|
-
let current = text;
|
|
17175
|
-
let totalRedactions = 0;
|
|
17176
|
-
const triggered = [];
|
|
17177
|
-
for (const rule of policy.rules) {
|
|
17178
|
-
const res = applySingleDlpRule(current, rule);
|
|
17179
|
-
if (res.matches > 0) {
|
|
17180
|
-
current = res.output;
|
|
17181
|
-
totalRedactions += res.matches;
|
|
17182
|
-
triggered.push(rule.id);
|
|
17183
|
-
}
|
|
17184
|
-
}
|
|
17185
|
-
return {
|
|
17186
|
-
sanitizedText: current,
|
|
17187
|
-
redactionCount: totalRedactions,
|
|
17188
|
-
triggeredRuleIds: triggered
|
|
17189
|
-
};
|
|
17190
|
-
}
|
|
17191
|
-
function sanitizeDlpPayload(payload, policy = createDefaultDlpPolicy()) {
|
|
17192
|
-
if (!policy.enabled || payload === null || payload === void 0) return payload;
|
|
17193
|
-
if (typeof payload === "string") {
|
|
17194
|
-
return sanitizeDlpText(payload, policy).sanitizedText;
|
|
17195
|
-
}
|
|
17196
|
-
const serialized = JSON.stringify(payload);
|
|
17197
|
-
const { sanitizedText } = sanitizeDlpText(serialized, policy);
|
|
17198
|
-
try {
|
|
17199
|
-
return JSON.parse(sanitizedText);
|
|
17200
|
-
} catch {
|
|
17201
|
-
return payload;
|
|
17202
|
-
}
|
|
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);
|
|
17203
18023
|
}
|
|
17204
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;
|
|
17205
18025
|
function parseTasksFromDir(changeDirPath, rootDir) {
|
|
@@ -17667,13 +18487,20 @@ function formatInspectResultMarkdown(result) {
|
|
|
17667
18487
|
exports.ALL_ARCHITECTURE_TEMPLATES = ALL_ARCHITECTURE_TEMPLATES;
|
|
17668
18488
|
exports.BRANCH_PATTERNS = BRANCH_PATTERNS;
|
|
17669
18489
|
exports.BddStepRegistry = BddStepRegistry;
|
|
18490
|
+
exports.CPP_CLANG_TIDY = CPP_CLANG_TIDY;
|
|
18491
|
+
exports.CPP_CMAKE_STRICT = CPP_CMAKE_STRICT;
|
|
17670
18492
|
exports.DEFAULT_DLP_RULES = DEFAULT_DLP_RULES;
|
|
17671
18493
|
exports.DEFAULT_EXCLUDED_PATTERNS = DEFAULT_EXCLUDED_PATTERNS;
|
|
17672
18494
|
exports.DEFAULT_EXCLUDES = DEFAULT_EXCLUDES;
|
|
17673
18495
|
exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
|
|
17674
18496
|
exports.DEFAULT_PRIVACY_POLICY = DEFAULT_PRIVACY_POLICY;
|
|
17675
18497
|
exports.DEFAULT_SAST_EXCLUDES = DEFAULT_SAST_EXCLUDES;
|
|
18498
|
+
exports.DOTNET_DIRECTORY_BUILD_PROPS = DOTNET_DIRECTORY_BUILD_PROPS;
|
|
17676
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;
|
|
17677
18504
|
exports.KPI_SUMMARY_END_TAG = KPI_SUMMARY_END_TAG;
|
|
17678
18505
|
exports.KPI_SUMMARY_START_TAG = KPI_SUMMARY_START_TAG;
|
|
17679
18506
|
exports.LIFECYCLE_SKILL_TEMPLATES = LIFECYCLE_SKILL_TEMPLATES;
|
|
@@ -17683,6 +18510,11 @@ exports.PREPARE_COMMIT_MSG_SCRIPT = PREPARE_COMMIT_MSG_SCRIPT;
|
|
|
17683
18510
|
exports.PRE_COMMIT_SCRIPT = PRE_COMMIT_SCRIPT;
|
|
17684
18511
|
exports.PROMPT_INJECTION_SIGNATURES = PROMPT_INJECTION_SIGNATURES;
|
|
17685
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;
|
|
17686
18518
|
exports.SARIF_SCHEMA_2_1_0 = SARIF_SCHEMA_2_1_0;
|
|
17687
18519
|
exports.SARIF_VERSION = SARIF_VERSION;
|
|
17688
18520
|
exports.SAST_RULES = SAST_RULES;
|
|
@@ -17722,6 +18554,8 @@ exports.SCHEMA_SCHEMAS_SECURITY_THREAT_ACTOR_SCHEMA_JSON = SCHEMA_SCHEMAS_SECURI
|
|
|
17722
18554
|
exports.SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON = SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON;
|
|
17723
18555
|
exports.SECRET_RULES = SECRET_RULES;
|
|
17724
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;
|
|
17725
18559
|
exports.STARTER_ANTIGRAVITY_MCP = STARTER_ANTIGRAVITY_MCP;
|
|
17726
18560
|
exports.STARTER_ANTIGRAVITY_RULES = STARTER_ANTIGRAVITY_RULES;
|
|
17727
18561
|
exports.STARTER_ARCH_ADR = STARTER_ARCH_ADR;
|
|
@@ -17753,6 +18587,7 @@ exports.STARTER_GITHUB_PR_KPI = STARTER_GITHUB_PR_KPI;
|
|
|
17753
18587
|
exports.STARTER_GITHUB_PULL_REQUEST_TEMPLATE = STARTER_GITHUB_PULL_REQUEST_TEMPLATE;
|
|
17754
18588
|
exports.STARTER_GITHUB_SDD_INTEGRATE = STARTER_GITHUB_SDD_INTEGRATE;
|
|
17755
18589
|
exports.STARTER_GITLAB_CI = STARTER_GITLAB_CI;
|
|
18590
|
+
exports.STARTER_GUARD_BRANCH_CJS = STARTER_GUARD_BRANCH_CJS;
|
|
17756
18591
|
exports.STARTER_LICENSE_POLICY = STARTER_LICENSE_POLICY;
|
|
17757
18592
|
exports.STARTER_PRIVACY_POLICY = STARTER_PRIVACY_POLICY;
|
|
17758
18593
|
exports.STARTER_PROCESS_README = STARTER_PROCESS_README;
|
|
@@ -17801,6 +18636,8 @@ exports.STARTER_VSCODE_MCP = STARTER_VSCODE_MCP;
|
|
|
17801
18636
|
exports.STARTER_WORKFLOW_HANDOFF_TEMPLATE = STARTER_WORKFLOW_HANDOFF_TEMPLATE;
|
|
17802
18637
|
exports.STARTER__GITHUB_PULL_REQUEST_TEMPLATE_MD = STARTER__GITHUB_PULL_REQUEST_TEMPLATE_MD;
|
|
17803
18638
|
exports.SpecKitAdapter = SpecKitAdapter;
|
|
18639
|
+
exports.TS_ESLINT_CONFIG_MJS = TS_ESLINT_CONFIG_MJS;
|
|
18640
|
+
exports.TS_STRICT_TSCONFIG = TS_STRICT_TSCONFIG;
|
|
17804
18641
|
exports.TYPE_TO_SCHEMA_MAP = TYPE_TO_SCHEMA_MAP;
|
|
17805
18642
|
exports.UNIT_TEST_SUFFIXES = UNIT_TEST_SUFFIXES;
|
|
17806
18643
|
exports.VALID_AGENT_TARGETS = VALID_AGENT_TARGETS;
|
|
@@ -17808,6 +18645,7 @@ exports.VALID_ARCHITECTURE_GRANULARITIES = VALID_ARCHITECTURE_GRANULARITIES;
|
|
|
17808
18645
|
exports.VALID_AUTONOMY_MODES = VALID_AUTONOMY_MODES;
|
|
17809
18646
|
exports.VALID_CHANGE_PROFILES = VALID_CHANGE_PROFILES;
|
|
17810
18647
|
exports.VALID_CI_PROVIDERS = VALID_CI_PROVIDERS;
|
|
18648
|
+
exports.VALID_CODING_RULE_STACKS = VALID_CODING_RULE_STACKS;
|
|
17811
18649
|
exports.aggregateCommitKpiRecords = aggregateCommitKpiRecords;
|
|
17812
18650
|
exports.aggregatePrKpis = aggregatePrKpis;
|
|
17813
18651
|
exports.aggregateReleaseKpis = aggregateReleaseKpis;
|
|
@@ -17841,6 +18679,7 @@ exports.detectActiveChangeForIntegration = detectActiveChangeForIntegration;
|
|
|
17841
18679
|
exports.detectAuthorIdentity = detectAuthorIdentity;
|
|
17842
18680
|
exports.detectLanguage = detectLanguage;
|
|
17843
18681
|
exports.detectProfileFromChange = detectProfileFromChange;
|
|
18682
|
+
exports.detectProjectStacks = detectProjectStacks;
|
|
17844
18683
|
exports.detectPromptInjection = detectPromptInjection;
|
|
17845
18684
|
exports.emitCiOutput = emitCiOutput;
|
|
17846
18685
|
exports.evaluateCompoundLicense = evaluateCompoundLicense;
|
|
@@ -17889,9 +18728,11 @@ exports.generateTestingCoverageReportMarkdown = generateTestingCoverageReportMar
|
|
|
17889
18728
|
exports.generateThirdPartyNotices = generateThirdPartyNotices;
|
|
17890
18729
|
exports.generateTraceabilityReportMarkdown = generateTraceabilityReportMarkdown;
|
|
17891
18730
|
exports.getArchitectureTemplates = getArchitectureTemplates;
|
|
18731
|
+
exports.getCodingRulesFilesForStacks = getCodingRulesFilesForStacks;
|
|
17892
18732
|
exports.getCytoscapeScript = getCytoscapeScript;
|
|
17893
18733
|
exports.getGitDiffLines = getGitDiffLines;
|
|
17894
18734
|
exports.getNextCorrelativeNumber = getNextCorrelativeNumber;
|
|
18735
|
+
exports.getReferenceCodingRulesTemplates = getReferenceCodingRulesTemplates;
|
|
17895
18736
|
exports.getSddAdapter = getSddAdapter;
|
|
17896
18737
|
exports.inferArtifactTypeFromId = inferArtifactTypeFromId;
|
|
17897
18738
|
exports.inferMissingTrailers = inferMissingTrailers;
|
|
@@ -17906,8 +18747,10 @@ exports.isGitleaksInstalled = isGitleaksInstalled;
|
|
|
17906
18747
|
exports.isMetricWorsened = isMetricWorsened;
|
|
17907
18748
|
exports.isPathProtectedFromPatch = isPathProtectedFromPatch;
|
|
17908
18749
|
exports.isPlaceholderOrIgnored = isPlaceholderOrIgnored;
|
|
18750
|
+
exports.isProtectedCodingRulesFile = isProtectedCodingRulesFile;
|
|
17909
18751
|
exports.isReportContentSemanticallyEqual = isReportContentSemanticallyEqual;
|
|
17910
18752
|
exports.isRequirementArtifact = isRequirementArtifact2;
|
|
18753
|
+
exports.isReviewerRole = isReviewerRole;
|
|
17911
18754
|
exports.isSemgrepInstalled = isSemgrepInstalled;
|
|
17912
18755
|
exports.isToolAvailable = isToolAvailable;
|
|
17913
18756
|
exports.loadDlpPolicy = loadDlpPolicy;
|
|
@@ -17953,6 +18796,7 @@ exports.renderManualsTab = renderManualsTab;
|
|
|
17953
18796
|
exports.resolveAgentTargets = resolveAgentTargets;
|
|
17954
18797
|
exports.resolveBranchHierarchy = resolveBranchHierarchy;
|
|
17955
18798
|
exports.resolveCiEnvironment = resolveCiEnvironment;
|
|
18799
|
+
exports.resolveCodingRuleStacks = resolveCodingRuleStacks;
|
|
17956
18800
|
exports.resolveCytoscapePath = resolveCytoscapePath;
|
|
17957
18801
|
exports.resolveDefaultBranchBase = resolveDefaultBranchBase;
|
|
17958
18802
|
exports.resolveDeterministicDate = resolveDeterministicDate;
|
|
@@ -17989,6 +18833,7 @@ exports.scanWithTrivy = scanWithTrivy;
|
|
|
17989
18833
|
exports.serializeSarifDocument = serializeSarifDocument;
|
|
17990
18834
|
exports.slugify = slugify2;
|
|
17991
18835
|
exports.stripVolatileReportMetadata = stripVolatileReportMetadata;
|
|
18836
|
+
exports.submitReviewReport = submitReviewReport;
|
|
17992
18837
|
exports.syncPdacDigests = syncPdacDigests;
|
|
17993
18838
|
exports.tokenizeTitle = tokenizeTitle;
|
|
17994
18839
|
exports.updateCitationsInContent = updateCitationsInContent;
|