@aisdlc/core 2.5.0 → 3.0.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 +653 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -14
- package/dist/index.d.ts +60 -14
- package/dist/index.js +651 -67
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2612,11 +2612,13 @@ function isProposalRequirementId(id) {
|
|
|
2612
2612
|
}
|
|
2613
2613
|
function buildSubgraphFromProposalIds(ids) {
|
|
2614
2614
|
const reqs = ids.filter(isProposalRequirementId);
|
|
2615
|
+
const ucs = ids.filter((id) => id.startsWith("UC-"));
|
|
2615
2616
|
const privReqs = ids.filter((id) => id.startsWith("PRIV-REQ-"));
|
|
2616
2617
|
const dataAssets = ids.filter((id) => id.startsWith("DATA-ASSET-"));
|
|
2617
2618
|
const ropaEntries = ids.filter((id) => id.startsWith("PRIV-ROPA-"));
|
|
2618
2619
|
return {
|
|
2619
2620
|
requirements: reqs,
|
|
2621
|
+
...ucs.length > 0 ? { useCases: ucs } : {},
|
|
2620
2622
|
...privReqs.length > 0 ? { privacyRequirements: privReqs } : {},
|
|
2621
2623
|
...dataAssets.length > 0 ? { dataAssets } : {},
|
|
2622
2624
|
...ropaEntries.length > 0 ? { ropaEntries } : {}
|
|
@@ -2729,23 +2731,45 @@ function collectCitedComponents(citations) {
|
|
|
2729
2731
|
}
|
|
2730
2732
|
return cited;
|
|
2731
2733
|
}
|
|
2732
|
-
function
|
|
2734
|
+
function collectDesignComponents(changeDir) {
|
|
2735
|
+
const designFile = path5.join(changeDir, "design.md");
|
|
2736
|
+
if (!fs8.existsSync(designFile)) return [];
|
|
2737
|
+
try {
|
|
2738
|
+
const { frontmatter } = parseFrontmatter(fs8.readFileSync(designFile, "utf-8"));
|
|
2739
|
+
const single = typeof frontmatter["architecture-component"] === "string" ? [frontmatter["architecture-component"]] : [];
|
|
2740
|
+
const multi = Array.isArray(frontmatter["architecture-components"]) ? frontmatter["architecture-components"].map(String) : [];
|
|
2741
|
+
return [...single, ...multi].filter(isArchitectureComponentId);
|
|
2742
|
+
} catch {
|
|
2743
|
+
return [];
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
function matchesComponentScope(fm, targetReqs, targetUcs) {
|
|
2747
|
+
const satisfies = Array.isArray(fm["satisfies-requirements"]) ? fm["satisfies-requirements"] : [];
|
|
2748
|
+
const implementsUcs = Array.isArray(fm["implements-use-cases"]) ? fm["implements-use-cases"] : [];
|
|
2749
|
+
return targetReqs.some((r) => satisfies.includes(r)) || targetUcs.some((u) => implementsUcs.includes(u));
|
|
2750
|
+
}
|
|
2751
|
+
function collectSatisfyingComponents(canonicalArtifacts, targetReqs, targetUcs, cited) {
|
|
2733
2752
|
for (const [artId, art] of canonicalArtifacts.entries()) {
|
|
2734
2753
|
if (!artId.startsWith("CMP-") || !art.frontmatter) continue;
|
|
2735
|
-
|
|
2736
|
-
if (targetReqs.some((r) => satisfies.includes(r)) && !cited.includes(artId)) {
|
|
2754
|
+
if (matchesComponentScope(art.frontmatter, targetReqs, targetUcs) && !cited.includes(artId)) {
|
|
2737
2755
|
cited.push(artId);
|
|
2738
2756
|
}
|
|
2739
2757
|
}
|
|
2740
2758
|
}
|
|
2741
|
-
function collectArchitectureComponents(handoff, canonicalArtifacts, targetReqs) {
|
|
2759
|
+
function collectArchitectureComponents(handoff, canonicalArtifacts, targetReqs, targetUcs, changeDir) {
|
|
2742
2760
|
const cited = collectCitedComponents(handoff.citations);
|
|
2743
|
-
|
|
2761
|
+
for (const comp of collectDesignComponents(changeDir)) {
|
|
2762
|
+
if (!cited.includes(comp)) cited.push(comp);
|
|
2763
|
+
}
|
|
2764
|
+
collectSatisfyingComponents(canonicalArtifacts, targetReqs, targetUcs, cited);
|
|
2744
2765
|
return cited;
|
|
2745
2766
|
}
|
|
2746
2767
|
function isSatisfiableRequirementId(id) {
|
|
2747
2768
|
return id.startsWith("FR-") || id.startsWith("QR-") || id.startsWith("CON-") || id.startsWith("SEC-REQ-") || id.startsWith("PRIV-REQ-");
|
|
2748
2769
|
}
|
|
2770
|
+
function isImplementableUseCaseId(id) {
|
|
2771
|
+
return id.startsWith("UC-");
|
|
2772
|
+
}
|
|
2749
2773
|
function mergeSatisfiesRequirements(fm, targetReqs) {
|
|
2750
2774
|
const existing = Array.isArray(fm["satisfies-requirements"]) ? [...fm["satisfies-requirements"]] : [];
|
|
2751
2775
|
let modified = false;
|
|
@@ -2759,9 +2783,27 @@ function mergeSatisfiesRequirements(fm, targetReqs) {
|
|
|
2759
2783
|
fm["satisfies-requirements"] = existing;
|
|
2760
2784
|
return modified;
|
|
2761
2785
|
}
|
|
2762
|
-
function
|
|
2786
|
+
function mergeImplementsUseCases(fm, targetUcs) {
|
|
2787
|
+
const existing = Array.isArray(fm["implements-use-cases"]) ? [...fm["implements-use-cases"]] : [];
|
|
2788
|
+
let modified = false;
|
|
2789
|
+
for (const uc of targetUcs) {
|
|
2790
|
+
if (!isImplementableUseCaseId(uc)) continue;
|
|
2791
|
+
if (!existing.includes(uc)) {
|
|
2792
|
+
existing.push(uc);
|
|
2793
|
+
modified = true;
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
fm["implements-use-cases"] = existing;
|
|
2797
|
+
return modified;
|
|
2798
|
+
}
|
|
2799
|
+
function syncComponentRelations(fm, targetReqs, targetUcs) {
|
|
2800
|
+
const reqMod = mergeSatisfiesRequirements(fm, targetReqs);
|
|
2801
|
+
const ucMod = mergeImplementsUseCases(fm, targetUcs);
|
|
2802
|
+
return reqMod || ucMod;
|
|
2803
|
+
}
|
|
2804
|
+
function updateSingleArchitectureComponent(canonical, cmpId, targetReqs, targetUcs, changeId, date, author) {
|
|
2763
2805
|
const fm = canonical.frontmatter;
|
|
2764
|
-
const modified = cmpId.startsWith("CMP-") ?
|
|
2806
|
+
const modified = cmpId.startsWith("CMP-") ? syncComponentRelations(fm, targetReqs, targetUcs) : false;
|
|
2765
2807
|
const updatedBody = appendRevisionHistoryRow(canonical.body, {
|
|
2766
2808
|
version: String(fm.version || "1.0.0"),
|
|
2767
2809
|
date,
|
|
@@ -2775,13 +2817,13 @@ function updateSingleArchitectureComponent(canonical, cmpId, targetReqs, changeI
|
|
|
2775
2817
|
}
|
|
2776
2818
|
return false;
|
|
2777
2819
|
}
|
|
2778
|
-
function updateArchitectureComponents(citedComponents, canonicalArtifacts, targetReqs, changeId, date, author, errors) {
|
|
2820
|
+
function updateArchitectureComponents(citedComponents, canonicalArtifacts, targetReqs, targetUcs, changeId, date, author, errors) {
|
|
2779
2821
|
const updated = [];
|
|
2780
2822
|
for (const cmpId of citedComponents) {
|
|
2781
2823
|
const canonical = canonicalArtifacts.get(cmpId);
|
|
2782
2824
|
if (!canonical) continue;
|
|
2783
2825
|
try {
|
|
2784
|
-
if (updateSingleArchitectureComponent(canonical, cmpId, targetReqs, changeId, date, author)) {
|
|
2826
|
+
if (updateSingleArchitectureComponent(canonical, cmpId, targetReqs, targetUcs, changeId, date, author)) {
|
|
2785
2827
|
updated.push(cmpId);
|
|
2786
2828
|
}
|
|
2787
2829
|
} catch (err) {
|
|
@@ -2899,13 +2941,34 @@ function resolveTargetRequirements(handoff, changeDir) {
|
|
|
2899
2941
|
])
|
|
2900
2942
|
);
|
|
2901
2943
|
}
|
|
2944
|
+
function collectSpecUseCases(changeDir) {
|
|
2945
|
+
const specFile = path5.join(changeDir, "spec.md");
|
|
2946
|
+
if (!fs8.existsSync(specFile)) return [];
|
|
2947
|
+
try {
|
|
2948
|
+
const { affectedItems, newItems } = parseSpecCatalogScope(fs8.readFileSync(specFile, "utf-8"));
|
|
2949
|
+
return [...affectedItems, ...newItems].map((i) => i.id).filter((id) => id && id.startsWith("UC-"));
|
|
2950
|
+
} catch {
|
|
2951
|
+
return [];
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
function collectTargetUseCases(handoff, changeDir) {
|
|
2955
|
+
const subUcs = (handoff.subgraph?.useCases || []).filter((uc) => uc.startsWith("UC-"));
|
|
2956
|
+
const citeUcs = (handoff.citations || []).map((c) => c.targetId || c.id).filter((id) => typeof id === "string" && id.startsWith("UC-"));
|
|
2957
|
+
const specUcs = collectSpecUseCases(changeDir);
|
|
2958
|
+
return Array.from(/* @__PURE__ */ new Set([...subUcs, ...citeUcs, ...specUcs]));
|
|
2959
|
+
}
|
|
2960
|
+
function syncArchitectureArtifacts(handoff, canonicalArtifacts, targetReqs, targetUcs, changeDir, ctx, errors) {
|
|
2961
|
+
const cited = collectArchitectureComponents(handoff, canonicalArtifacts, targetReqs, targetUcs, changeDir);
|
|
2962
|
+
return updateArchitectureComponents(cited, canonicalArtifacts, targetReqs, targetUcs, ctx.changeId, ctx.date, ctx.author, errors);
|
|
2963
|
+
}
|
|
2902
2964
|
function applyArtifactUpdates(ctx, changeDir, handoff, completedTasks, errors) {
|
|
2903
2965
|
const targetReqs = resolveTargetRequirements(handoff, changeDir);
|
|
2966
|
+
const targetUcs = collectTargetUseCases(handoff, changeDir);
|
|
2904
2967
|
const createdArtifacts = materializeNewCatalogArtifacts(changeDir, ctx.rootDir, ctx.changeId, ctx.author, ctx.date, errors);
|
|
2905
2968
|
const canonicalArtifacts = loadCanonicalArtifacts(ctx.rootDir);
|
|
2906
|
-
const
|
|
2907
|
-
const
|
|
2908
|
-
const updatedArch =
|
|
2969
|
+
const productIds = Array.from(/* @__PURE__ */ new Set([...targetReqs, ...targetUcs]));
|
|
2970
|
+
const updatedProduct = updateRequirementsArtifacts(productIds, createdArtifacts, canonicalArtifacts, completedTasks, ctx.changeId, ctx.date, ctx.author, errors);
|
|
2971
|
+
const updatedArch = syncArchitectureArtifacts(handoff, canonicalArtifacts, targetReqs, targetUcs, changeDir, ctx, errors);
|
|
2909
2972
|
return { targetReqs, updatedProduct, updatedArch, createdArtifacts };
|
|
2910
2973
|
}
|
|
2911
2974
|
function integrateSddChange(options) {
|
|
@@ -3457,7 +3520,7 @@ function syncPdacDigests(options = {}) {
|
|
|
3457
3520
|
// src/init/starter-schemas.ts
|
|
3458
3521
|
var SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/architecture/adr.schema.json",\r\n "title": "Architecture Decision Record Schema (Versionable)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "deciders", "decision-date"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^ADR-[0-9]{3,4}(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "architecture-decision-record"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Decision record semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["proposed", "accepted", "rejected", "deprecated", "superseded"]\r\n },\r\n "deciders": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": { "type": "string" }\r\n },\r\n "decision-date": {\r\n "type": "string",\r\n "format": "date"\r\n },\r\n "affects-components": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^ADR-[0-9]{3,4}(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^ADR-[0-9]{3,4}(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
3459
3522
|
var SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/architecture/component.schema.json",\r\n "title": "NAF v4 / arc42 Architecture Component Schema (Multilevel)",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "level",\r\n "implementation-type",\r\n "implements-use-cases"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "component"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Architecture component semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["proposed", "accepted", "deprecated", "retired"]\r\n },\r\n "level": {\r\n "type": "integer",\r\n "minimum": 1,\r\n "description": "Hierarchical architecture level (1: Bounded Context / Root System, 2: Subsystem / Container, 3: Executable Unit / DLL / Function)."\r\n },\r\n "bounded-context": {\r\n "type": "string",\r\n "description": "Domain-Driven Design (DDD) Bounded Context name this component belongs to."\r\n },\r\n "parent-component": {\r\n "type": ["string", "null"],\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Parent component identifier (null if Level 1)."\r\n },\r\n "implementation-type": {\r\n "type": "string",\r\n "enum": ["service", "dll", "function", "composite"],\r\n "description": "Technical implementation paradigm: distributed service (service), dynamic/native library (dll), in-process module/function (function), or logical aggregator/Bounded Context (composite)."\r\n },\r\n "implements-use-cases": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "satisfies-requirements": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^(FR|QR|CON|SEC-REQ|SAF-REQ|PRIV-REQ)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "hosted-in-enclave": {\r\n "type": "string",\r\n "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Security enclave where the component resides (optional for DLLs or in-process functions)."\r\n },\r\n "interfaces": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "required": ["name", "protocol"],\r\n "properties": {\r\n "name": { "type": "string" },\r\n "protocol": {\r\n "type": "string",\r\n "enum": [\r\n "REST/HTTP",\r\n "gRPC",\r\n "WebSocket",\r\n "Kafka",\r\n "MQTT",\r\n "C-ABI",\r\n "Native-ABI",\r\n "FFI",\r\n "In-Process API",\r\n "Function-Call",\r\n "CLI",\r\n "GUI",\r\n "IPC"\r\n ]\r\n },\r\n "contract-spec": { "type": "string" }\r\n }\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
3460
|
-
var SCHEMA_SCHEMAS_ARCHITECTURE_INTRODUCTION_AND_GOALS_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/architecture/introduction-and-goals.schema.json",\r\n "title": "NAF v4 Enterprise & Capability / arc42 Introduction and System Goals Schema",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "naf-perspective",\r\n "cites-product-actors",\r\n "cites-quality-goals",\r\n "cites-
|
|
3523
|
+
var SCHEMA_SCHEMAS_ARCHITECTURE_INTRODUCTION_AND_GOALS_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/architecture/introduction-and-goals.schema.json",\r\n "title": "NAF v4 Enterprise & Capability / arc42 Introduction and System Goals Schema",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "naf-perspective",\r\n "cites-product-actors",\r\n "cites-quality-goals",\r\n "cites-journeys"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^ARCH-INTRO-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "architecture-introduction"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Artifact semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "proposed", "accepted", "approved", "deprecated", "superseded"]\r\n },\r\n "owner": {\r\n "type": "string"\r\n },\r\n "arc42-section": {\r\n "type": "integer",\r\n "const": 1\r\n },\r\n "naf-perspective": {\r\n "type": "string",\r\n "const": "Enterprise & Capability"\r\n },\r\n "cites-product-actors": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "cites-quality-goals": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^(QR|SEC-REQ|PRIV-REQ)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "cites-journeys": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^JRN-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Product journey identifiers (JRN-*) envisioned in this system capability scope."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^ARCH-INTRO-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^ARCH-INTRO-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
3461
3524
|
var SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_MANIFEST_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/compliance/license-manifest.schema.json",\r\n "title": "Static Dependencies License Manifest Schema",\r\n "type": "object",\r\n "required": ["evaluated_dependencies"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(MAN-LIC|LIC-MAN|LIC)-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Optional canonical artifact identifier."\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "license-manifest"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+(\\\\.[0-9]+)?(-[0-9A-Za-z.-]+)?$",\r\n "description": "Manifest format version."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "description": {\r\n "type": "string"\r\n },\r\n "generated_at": {\r\n "type": "string"\r\n },\r\n "evaluated_dependencies": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "object",\r\n "required": ["package", "version", "spdx_license", "status"],\r\n "properties": {\r\n "package": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "version": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "spdx_license": {\r\n "type": "string",\r\n "minLength": 1\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": [\r\n "APPROVED",\r\n "REJECTED",\r\n "REVIEW_REQUIRED",\r\n "COMMERCIAL_APPROVAL_REQUIRED",\r\n "PENDING"\r\n ]\r\n },\r\n "reason": {\r\n "type": "string"\r\n },\r\n "approved_by": {\r\n "type": "string"\r\n }\r\n },\r\n "additionalProperties": false\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
3462
3525
|
var SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_POLICY_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/compliance/license-policy.schema.json",\r\n "title": "Open Source License Policy Schema",\r\n "type": "object",\r\n "required": ["version", "project", "default_action", "categories", "agent_guardrails", "ci_gates"],\r\n "properties": {\r\n "version": {\r\n "type": "string"\r\n },\r\n "project": {\r\n "type": "string"\r\n },\r\n "default_action": {\r\n "type": "string",\r\n "enum": ["ALLOW", "DENY", "REVIEW_REQUIRED"]\r\n },\r\n "categories": {\r\n "type": "object"\r\n },\r\n "agent_guardrails": {\r\n "type": "object",\r\n "required": ["enforce_pre_check", "reject_unknown_licenses"],\r\n "properties": {\r\n "enforce_pre_check": { "type": "boolean" },\r\n "reject_unknown_licenses": { "type": "boolean" },\r\n "auto_reject_categories": { "type": "array", "items": { "type": "string" } },\r\n "on_commercial_detected": { "type": "object" }\r\n }\r\n },\r\n "ci_gates": {\r\n "type": "object",\r\n "required": ["fail_on_denied", "generate_sbom"],\r\n "properties": {\r\n "fail_on_denied": { "type": "boolean" },\r\n "fail_on_missing_license": { "type": "boolean" },\r\n "generate_sbom": { "type": "boolean" },\r\n "sbom_format": { "type": "string" },\r\n "output_notices_file": { "type": "string" },\r\n "allowed_depth": { "type": "string", "enum": ["DIRECT", "TRANSITIVE"] }\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
3463
3526
|
var SCHEMA_SCHEMAS_COMPLIANCE_QUALITY_POLICY_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/compliance/quality-policy.schema.json",\r\n "title": "Software Quality Policy Schema (Polyglot)",\r\n "type": "object",\r\n "required": ["version", "project", "enforcement_mode", "coding_rules", "release_thresholds", "agent_guardrails"],\r\n "properties": {\r\n "version": { "type": "string" },\r\n "project": { "type": "string" },\r\n "enforcement_mode": { "type": "string", "enum": ["STRICT", "PERMISSIVE"] },\r\n "ratchet_mode": { "type": "boolean" },\r\n "scope": {\r\n "type": "object",\r\n "properties": {\r\n "target_directories": { "type": "array", "items": { "type": "string" } },\r\n "supported_extensions": { "type": "array", "items": { "type": "string" } },\r\n "exclude_patterns": { "type": "array", "items": { "type": "string" } }\r\n }\r\n },\r\n "language_toolchains": {\r\n "type": "object"\r\n },\r\n "coding_rules": {\r\n "type": "object",\r\n "required": ["standards", "enforce_formatting", "rules"],\r\n "properties": {\r\n "standards": { "type": "array", "items": { "type": "string" } },\r\n "enforce_formatting": { "type": "boolean" },\r\n "formatting_engine": { "type": "string" },\r\n "linter_engine": { "type": "string" },\r\n "rules": { "type": "object" }\r\n }\r\n },\r\n "release_thresholds": {\r\n "type": "object",\r\n "required": ["cyclomatic_complexity", "cognitive_complexity", "maintainability_index", "code_duplication", "test_coverage"],\r\n "properties": {\r\n "cyclomatic_complexity": {\r\n "type": "object",\r\n "required": ["max_per_function", "action_on_breach"],\r\n "properties": {\r\n "max_per_function": { "type": "integer" },\r\n "warning_at": { "type": "integer" },\r\n "action_on_breach": { "type": "string" }\r\n }\r\n },\r\n "cognitive_complexity": {\r\n "type": "object",\r\n "required": ["max_per_function", "action_on_breach"],\r\n "properties": {\r\n "max_per_function": { "type": "integer" },\r\n "warning_at": { "type": "integer" },\r\n "action_on_breach": { "type": "string" }\r\n }\r\n },\r\n "maintainability_index": {\r\n "type": "object",\r\n "required": ["min_acceptable_score", "action_on_breach"],\r\n "properties": {\r\n "min_acceptable_score": { "type": "number" },\r\n "target_score": { "type": "number" },\r\n "action_on_breach": { "type": "string" }\r\n }\r\n },\r\n "code_duplication": {\r\n "type": "object",\r\n "required": ["max_percentage", "action_on_breach"],\r\n "properties": {\r\n "max_percentage": { "type": "number" },\r\n "action_on_breach": { "type": "string" }\r\n }\r\n },\r\n "test_coverage": {\r\n "type": "object",\r\n "required": ["min_line_coverage_percent", "action_on_breach"],\r\n "properties": {\r\n "min_line_coverage_percent": { "type": "number" },\r\n "min_branch_coverage_percent": { "type": "number" },\r\n "min_function_coverage_percent": { "type": "number" },\r\n "action_on_breach": { "type": "string" }\r\n }\r\n },\r\n "technical_debt": {\r\n "type": "object"\r\n }\r\n }\r\n },\r\n "agent_guardrails": {\r\n "type": "object",\r\n "required": ["enforce_pre_commit_linter", "prevent_suppression_comments"],\r\n "properties": {\r\n "enforce_pre_commit_linter": { "type": "boolean" },\r\n "prevent_suppression_comments": { "type": "boolean" },\r\n "auto_refactor_on_high_complexity": { "type": "boolean" }\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
@@ -3469,7 +3532,7 @@ var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON = '{\r\n "$schema": "http
|
|
|
3469
3532
|
var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-req.schema.json",\r\n "title": "Privacy Requirement & Technical Control Schema (PRIV-REQ-*)",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "privacy-principle",\r\n "linddun-category",\r\n "governs-ropa"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "privacy-requirement"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Privacy requirement semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "privacy-principle": {\r\n "type": "string",\r\n "enum": [\r\n "data-minimization",\r\n "purpose-limitation",\r\n "storage-limitation",\r\n "accuracy",\r\n "integrity-and-confidentiality",\r\n "transparency-and-consent",\r\n "data-subject-rights-arco",\r\n "pseudonymization-anonymization"\r\n ]\r\n },\r\n "linddun-category": {\r\n "type": "string",\r\n "enum": [\r\n "linkability",\r\n "identifiability",\r\n "non-repudiation",\r\n "detectability",\r\n "disclosure-of-information",\r\n "unawareness",\r\n "non-compliance"\r\n ],\r\n "description": "LINDDUN privacy threat category mitigated by this control."\r\n },\r\n "governs-ropa": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Upstream ROPA records (PRIV-ROPA-*) governed by this privacy requirement."\r\n },\r\n "protects-data-assets": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "enforced-in-enclave": {\r\n "type": "string",\r\n "pattern": "^SEC-ENC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "compliance-references": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "acceptance-format": {\r\n "type": "string",\r\n "enum": ["gherkin", "declarative-prose"]\r\n },\r\n "cucumber-tags": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^@[a-zA-Z0-9_-]+$"\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
3470
3533
|
var SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/privacy/privacy-ropa.schema.json",\r\n "title": "Record of Processing Activities Schema (PRIV-ROPA-* / GDPR Art. 30)",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "lawful-basis",\r\n "processing-purpose",\r\n "use-cases",\r\n "data-assets",\r\n "data-subjects",\r\n "retention-ttl"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "privacy-ropa"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "ROPA record semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "lawful-basis": {\r\n "type": "string",\r\n "enum": [\r\n "consent",\r\n "contract",\r\n "legal-obligation",\r\n "vital-interests",\r\n "public-task",\r\n "legitimate-interests"\r\n ],\r\n "description": "Lawful basis for processing under GDPR Art. 6.1."\r\n },\r\n "special-category-condition": {\r\n "type": ["string", "null"],\r\n "enum": [\r\n null,\r\n "explicit-consent",\r\n "employment-social-security",\r\n "vital-interests",\r\n "public-interest",\r\n "preventive-medicine",\r\n "public-health"\r\n ],\r\n "description": "GDPR Art. 9.2 condition when processing special category data."\r\n },\r\n "processing-purpose": {\r\n "type": "string",\r\n "minLength": 10\r\n },\r\n "use-cases": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Upstream Use Cases (UC-*) that trigger this data processing activity."\r\n },\r\n "data-assets": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^DATA-ASSET-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Personal Data Assets (DATA-ASSET-*) processed in this activity."\r\n },\r\n "data-subjects": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "retention-ttl": {\r\n "type": "string",\r\n "pattern": "^([0-9]+(d|m|y)|session-only|indefinite-anonymized)$"\r\n },\r\n "cross-border-transfer": {\r\n "type": "boolean"\r\n },\r\n "transfer-safeguards": {\r\n "type": ["string", "null"],\r\n "enum": [null, "adequacy-decision", "scc", "bcr", "derogation"]\r\n },\r\n "subprocessors": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "dpia-required": {\r\n "type": "boolean"\r\n },\r\n "dpia-reference": {\r\n "type": ["string", "null"],\r\n "pattern": "^DPIA-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "mitigated-by": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^PRIV-REQ-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Privacy requirements (PRIV-REQ-*) governing and enforcing this processing activity."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^PRIV-ROPA-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
3471
3534
|
var SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/actor.schema.json",\r\n "title": "ProductShape Actor Schema (Versionable)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "role-type"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "actor"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Artifact semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string",\r\n "description": "Schema specification version used."\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "role-type": {\r\n "type": "string",\r\n "enum": ["human-user", "ai-agent", "external-system", "sensor-iot"]\r\n },\r\n "description": {\r\n "type": "string"\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Identifier of the actor superseded by this version or artifact."\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Identifier of the new actor superseding this one upon deprecation/retirement."\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
3472
|
-
var SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON = '{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://ai-sdlc.org/schemas/product/bounded-context.schema.json",\n "title": "Domain-Driven Design (DDD) Bounded Context Schema",\n "type": "object",\n "required": [\n "id",\n "type",\n "title",\n "status",\n "version",\n "domain-type",\n "responsibilities"\n ],\n "properties": {\n "id": {\n "type": "string",\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$",\n "description": "Immutable Bounded Context identifier (e.g. BC-AI-SDLC-GOVERNANCE)."\n },\n "type": {\n "type": "string",\n "const": "bounded-context"\n },\n "version": {\n "type": "string",\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\n "description": "Bounded context document semantic version (SemVer)."\n },\n "schema-version": {\n "type": "string",\n "description": "Template schema version."\n },\n "title": {\n "type": "string",\n "minLength": 3,\n "description": "Descriptive title of the Bounded Context."\n },\n "status": {\n "type": "string",\n "enum": ["draft", "active", "deprecated", "retired"]\n },\n "domain-type": {\n "type": "string",\n "enum": ["core", "supporting", "generic"],\n "description": "DDD subdomain classification: core differentiator, supporting capability, or generic commodity."\n },\n "strategic-classification": {\n "type": "object",\n "properties": {\n "evolutionary-stage": {\n "type": "string",\n "enum": ["genesis", "custom-built", "product-rental", "commodity"]\n },\n "business-model-role": {\n "type": "string",\n "enum": ["differentiator", "operational", "enabler"]\n }\n },\n "additionalProperties": false\n },\n "responsibilities": {\n "type": "array",\n "items": {\n "type": "string",\n "minLength": 3\n },\n "minItems": 1,\n "description": "List of functional boundaries and core domain responsibilities encapsulated within this context."\n },\n "ubiquitous-language-terms": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Ubiquitous language terms (TERM-*) governed within this bounded context."\n },\n "context-mapping": {\n "type": "object",\n "properties": {\n "upstream-dependencies": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "downstream-dependents": {\n "type": "array",\n "items": {\n "type": "string"\n }\n },\n "integration-patterns": {\n "type": "array",\n "items": {\n "type": "object",\n "properties": {\n "pattern": {\n "type": "string"\n },\n "related-context": {\n "type": "string"\n }\n },\n "additionalProperties": false\n }\n }\n },\n "additionalProperties": false\n },\n "components-involved": {\n "type": "array",\n "items": {\n "type": "string",\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "description": "Architecture components (CMP-*) implementing this bounded context."\n },\n "supersedes": {\n "type": ["string", "null"],\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n },\n "superseded-by": {\n "type": ["string", "null"],\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\n }\n },\n "additionalProperties": false\n}\n';
|
|
3535
|
+
var SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/bounded-context.schema.json",\r\n "title": "Domain-Driven Design (DDD) Bounded Context Schema",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "domain-type",\r\n "responsibilities"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Immutable Bounded Context identifier (e.g. BC-AI-SDLC-GOVERNANCE)."\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "bounded-context"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Bounded context document semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string",\r\n "description": "Template schema version."\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3,\r\n "description": "Descriptive title of the Bounded Context."\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "domain-type": {\r\n "type": "string",\r\n "enum": ["core", "supporting", "generic"],\r\n "description": "DDD subdomain classification: core differentiator, supporting capability, or generic commodity."\r\n },\r\n "strategic-classification": {\r\n "type": "object",\r\n "properties": {\r\n "evolutionary-stage": {\r\n "type": "string",\r\n "enum": ["genesis", "custom-built", "product-rental", "commodity"]\r\n },\r\n "business-model-role": {\r\n "type": "string",\r\n "enum": ["differentiator", "operational", "enabler"]\r\n }\r\n },\r\n "additionalProperties": false\r\n },\r\n "responsibilities": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "minItems": 1,\r\n "description": "List of functional boundaries and core domain responsibilities encapsulated within this context."\r\n },\r\n "ubiquitous-language-terms": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Ubiquitous language terms (TERM-*) governed within this bounded context."\r\n },\r\n "context-mapping": {\r\n "type": "object",\r\n "properties": {\r\n "upstream-dependencies": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "downstream-dependents": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n }\r\n },\r\n "integration-patterns": {\r\n "type": "array",\r\n "items": {\r\n "type": "object",\r\n "properties": {\r\n "pattern": {\r\n "type": "string"\r\n },\r\n "related-context": {\r\n "type": "string"\r\n }\r\n },\r\n "additionalProperties": false\r\n }\r\n }\r\n },\r\n "additionalProperties": false\r\n },\r\n "components-involved": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^CMP-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Architecture components (CMP-*) implementing this bounded context."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
3473
3536
|
var SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/business-rule.schema.json",\r\n "title": "ProductShape Business Rule Schema (Versionable)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "enforcement-level"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^BR-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "business-rule"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Business rule semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "enforcement-level": {\r\n "type": "string",\r\n "enum": ["strict-invariant", "override-with-approval", "guideline"]\r\n },\r\n "defined-in": {\r\n "type": "string",\r\n "pattern": "^BC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "uses-terms": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^TERM-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^BR-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^BR-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
3474
3537
|
var SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/journey.schema.json",\r\n "title": "Customer / Operator Journey Schema",\r\n "type": "object",\r\n "required": [\r\n "id",\r\n "type",\r\n "title",\r\n "status",\r\n "version",\r\n "persona",\r\n "stages",\r\n "touchpoints"\r\n ],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^JRN-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "journey"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Journey semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "persona": {\r\n "type": "string",\r\n "pattern": "^ACT-[A-Z0-9]+(-[A-Z0-9]+)*$",\r\n "description": "Actor (persona) starring in this journey."\r\n },\r\n "stages": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string"\r\n },\r\n "description": "Sequential journey stages (e.g. Awareness, Onboarding, Activation, Retention)."\r\n },\r\n "touchpoints": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string"\r\n },\r\n "description": "Touchpoints between persona and system at each stage."\r\n },\r\n "related-use-cases": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^UC-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "System use cases related to this journey."\r\n },\r\n "pain-points": {\r\n "type": "array",\r\n "items": {\r\n "type": "string"\r\n },\r\n "description": "Frictions or issues detected along the user journey."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"]\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"]\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
3475
3538
|
var SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON = '{\r\n "$schema": "https://json-schema.org/draft/2020-12/schema",\r\n "$id": "https://ai-sdlc.org/schemas/product/requirement.schema.json",\r\n "title": "ProductShape Requirement Schema (Strict Test Validation Enforced)",\r\n "type": "object",\r\n "required": ["id", "type", "title", "status", "version", "category", "derives-from", "verifiable-by"],\r\n "properties": {\r\n "id": {\r\n "type": "string",\r\n "pattern": "^(FR|QR|CON)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "type": {\r\n "type": "string",\r\n "const": "requirement"\r\n },\r\n "version": {\r\n "type": "string",\r\n "pattern": "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9A-Za-z.-]+)?$",\r\n "description": "Requirement semantic version (SemVer)."\r\n },\r\n "schema-version": {\r\n "type": "string"\r\n },\r\n "title": {\r\n "type": "string",\r\n "minLength": 3\r\n },\r\n "status": {\r\n "type": "string",\r\n "enum": ["draft", "active", "deprecated", "retired"]\r\n },\r\n "category": {\r\n "type": "string",\r\n "enum": ["functional", "quality", "constraint"]\r\n },\r\n "derives-from": {\r\n "type": "array",\r\n "minItems": 1,\r\n "items": {\r\n "type": "string",\r\n "pattern": "^(UC|BR|CON|CAP|GOAL)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "description": "Product Traceability: Origin Use Cases, Rules, Constraints, or Capabilities."\r\n },\r\n "verifiable-by": {\r\n "type": "string",\r\n "enum": ["cucumber-bdd", "automated-unit-test", "integration-test", "performance-benchmark", "security-audit", "inspection"],\r\n "description": "Mandatory formal verification method."\r\n },\r\n "acceptance-format": {\r\n "type": "string",\r\n "enum": ["gherkin", "declarative-prose"],\r\n "description": "Acceptance criteria format."\r\n },\r\n "cucumber-tags": {\r\n "type": "array",\r\n "items": {\r\n "type": "string",\r\n "pattern": "^@[a-zA-Z0-9_-]+$"\r\n },\r\n "description": "Cucumber tags for filtering and executing BDD tests."\r\n },\r\n "enforce-bdd-variants": {\r\n "type": "boolean",\r\n "description": "When true, enforces all 3 BDD scenario categories (@nominal, @boundary, @invalid)."\r\n },\r\n "supersedes": {\r\n "type": ["string", "null"],\r\n "pattern": "^(FR|QR|CON)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n },\r\n "superseded-by": {\r\n "type": ["string", "null"],\r\n "pattern": "^(FR|QR|CON)-[A-Z0-9]+(-[A-Z0-9]+)*$"\r\n }\r\n },\r\n "additionalProperties": false\r\n}\r\n';
|
|
@@ -6818,7 +6881,7 @@ function resolveProjectIdentity(options) {
|
|
|
6818
6881
|
function buildBomMetadata(name, version, rootDir) {
|
|
6819
6882
|
return {
|
|
6820
6883
|
timestamp: resolveDeterministicDate(rootDir).toISOString(),
|
|
6821
|
-
tools: [{ vendor: "AI-SDLC", name: "@aisdlc/core", version: "
|
|
6884
|
+
tools: [{ vendor: "AI-SDLC", name: "@aisdlc/core", version: "3.0.0" }],
|
|
6822
6885
|
component: { type: "application", name, version }
|
|
6823
6886
|
};
|
|
6824
6887
|
}
|
|
@@ -7329,7 +7392,7 @@ function isPathProtectedFromPatch(filePath) {
|
|
|
7329
7392
|
const normalized = filePath.replace(/\\/g, "/");
|
|
7330
7393
|
return PROTECTED_BYPASS_PATTERNS.some((pattern) => pattern.test(normalized));
|
|
7331
7394
|
}
|
|
7332
|
-
function
|
|
7395
|
+
function detectCurrentBranch(rootDir) {
|
|
7333
7396
|
let branch = "";
|
|
7334
7397
|
if (fs8.existsSync(path5.join(rootDir, ".git"))) {
|
|
7335
7398
|
try {
|
|
@@ -7341,20 +7404,25 @@ function detectBranchChangeMatch(rootDir, dirs) {
|
|
|
7341
7404
|
} catch {
|
|
7342
7405
|
}
|
|
7343
7406
|
}
|
|
7344
|
-
if (!branch) {
|
|
7407
|
+
if (!branch && path5.resolve(rootDir) === path5.resolve(process.cwd())) {
|
|
7345
7408
|
const ciBranch = (process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME || process.env.CI_COMMIT_REF_NAME || process.env.BRANCH_NAME || "").toLowerCase();
|
|
7346
7409
|
branch = ciBranch;
|
|
7347
7410
|
}
|
|
7348
|
-
|
|
7349
|
-
return dirs.find((d) => branch.includes(path5.basename(d).toLowerCase()));
|
|
7411
|
+
return branch;
|
|
7350
7412
|
}
|
|
7351
7413
|
function resolveActiveChangeDir(rootDir) {
|
|
7352
7414
|
const activeRoot = path5.join(rootDir, "specs", "changes", "active");
|
|
7353
7415
|
if (!fs8.existsSync(activeRoot)) return void 0;
|
|
7354
7416
|
try {
|
|
7355
7417
|
const dirs = fs8.readdirSync(activeRoot, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => path5.join(activeRoot, d.name)).sort((a, b) => canonicalSort(a, b));
|
|
7356
|
-
const
|
|
7357
|
-
if (
|
|
7418
|
+
const branch = detectCurrentBranch(rootDir);
|
|
7419
|
+
if (branch) {
|
|
7420
|
+
const branchMatch = dirs.find((d) => branch.includes(path5.basename(d).toLowerCase()));
|
|
7421
|
+
if (branchMatch) return branchMatch;
|
|
7422
|
+
if (!branch.startsWith("patch")) {
|
|
7423
|
+
return void 0;
|
|
7424
|
+
}
|
|
7425
|
+
}
|
|
7358
7426
|
return dirs.find((d) => detectProfileFromChange(d) === "patch") || dirs[0];
|
|
7359
7427
|
} catch {
|
|
7360
7428
|
return void 0;
|
|
@@ -10395,6 +10463,35 @@ function detectAuthorIdentity(options = {}) {
|
|
|
10395
10463
|
activeTimeSeconds: 0
|
|
10396
10464
|
};
|
|
10397
10465
|
}
|
|
10466
|
+
var PRE_COMMIT_SCRIPT = `#!/usr/bin/env bash
|
|
10467
|
+
# ==============================================================================
|
|
10468
|
+
# AI-SDLC: Universal Protected Branches Guard (pre-commit)
|
|
10469
|
+
# ==============================================================================
|
|
10470
|
+
|
|
10471
|
+
CURRENT_BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
|
|
10472
|
+
|
|
10473
|
+
if [ -z "$CURRENT_BRANCH" ] || [ "$CURRENT_BRANCH" = "HEAD" ]; then
|
|
10474
|
+
exit 0
|
|
10475
|
+
fi
|
|
10476
|
+
|
|
10477
|
+
# Protected branches regex: main, master, release/*, release/v*
|
|
10478
|
+
if echo "$CURRENT_BRANCH" | grep -qE "^(main|master|release/.*)$"; then
|
|
10479
|
+
echo "" >&2
|
|
10480
|
+
echo "\u274C [AI-SDLC Security Guard] BLOCKED: Direct commits to protected branch '$CURRENT_BRANCH' are forbidden!" >&2
|
|
10481
|
+
echo "--------------------------------------------------------------------------------" >&2
|
|
10482
|
+
echo "Direct commits on protected branches violate the AI-SDLC 4-Tier Branching Policy." >&2
|
|
10483
|
+
echo "You must create and switch to a dedicated working branch before committing:" >&2
|
|
10484
|
+
echo "" >&2
|
|
10485
|
+
echo " git checkout -b feat/<CHG-ID>-<slug>" >&2
|
|
10486
|
+
echo " or" >&2
|
|
10487
|
+
echo " git checkout -b task/<PARENT-ID>/<TSK-ID>-<slug>" >&2
|
|
10488
|
+
echo "--------------------------------------------------------------------------------" >&2
|
|
10489
|
+
echo "" >&2
|
|
10490
|
+
exit 1
|
|
10491
|
+
fi
|
|
10492
|
+
|
|
10493
|
+
exit 0
|
|
10494
|
+
`;
|
|
10398
10495
|
var PREPARE_COMMIT_MSG_SCRIPT = `#!/usr/bin/env bash
|
|
10399
10496
|
# ==============================================================================
|
|
10400
10497
|
# AI-SDLC: Automated Commit Trailers Injection Hook
|
|
@@ -10408,7 +10505,7 @@ if [ "$COMMIT_SOURCE" = "merge" ]; then
|
|
|
10408
10505
|
exit 0
|
|
10409
10506
|
fi
|
|
10410
10507
|
|
|
10411
|
-
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
|
|
10508
|
+
CURRENT_BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
|
|
10412
10509
|
if [ -z "$CURRENT_BRANCH" ]; then
|
|
10413
10510
|
exit 0
|
|
10414
10511
|
fi
|
|
@@ -10509,18 +10606,21 @@ function installGitHooks(rootDir = process.cwd()) {
|
|
|
10509
10606
|
if (!fs8.existsSync(hooksDir)) {
|
|
10510
10607
|
fs8.mkdirSync(hooksDir, { recursive: true });
|
|
10511
10608
|
}
|
|
10512
|
-
const
|
|
10609
|
+
const prepareCommitMsgPath = path5.join(hooksDir, "prepare-commit-msg");
|
|
10610
|
+
const preCommitPath = path5.join(hooksDir, "pre-commit");
|
|
10513
10611
|
try {
|
|
10514
|
-
fs8.writeFileSync(
|
|
10612
|
+
fs8.writeFileSync(prepareCommitMsgPath, PREPARE_COMMIT_MSG_SCRIPT, { encoding: "utf-8", mode: 493 });
|
|
10613
|
+
fs8.writeFileSync(preCommitPath, PRE_COMMIT_SCRIPT, { encoding: "utf-8", mode: 493 });
|
|
10515
10614
|
return {
|
|
10516
10615
|
success: true,
|
|
10517
|
-
hookPath
|
|
10616
|
+
hookPath: prepareCommitMsgPath,
|
|
10617
|
+
installedHooks: [prepareCommitMsgPath, preCommitPath]
|
|
10518
10618
|
};
|
|
10519
10619
|
} catch (err) {
|
|
10520
10620
|
const msg = err instanceof Error ? err.message : String(err);
|
|
10521
10621
|
return {
|
|
10522
10622
|
success: false,
|
|
10523
|
-
error: `Error al escribir
|
|
10623
|
+
error: `Error al escribir hooks en '${hooksDir}': ${msg}`
|
|
10524
10624
|
};
|
|
10525
10625
|
}
|
|
10526
10626
|
}
|
|
@@ -11199,7 +11299,7 @@ function connectTargets(sourceId, rawTargets, relation, nodeMap, addEdge, defaul
|
|
|
11199
11299
|
function connectIntroRelationships(art, nodeMap, addEdge) {
|
|
11200
11300
|
const fm = art.frontmatter;
|
|
11201
11301
|
connectTargets(art.id, fm["cites-product-actors"], "identifies", nodeMap, addEdge, "actor", "product");
|
|
11202
|
-
connectTargets(art.id, fm["cites-
|
|
11302
|
+
connectTargets(art.id, fm["cites-journeys"], "envisions", nodeMap, addEdge, "journey", "product");
|
|
11203
11303
|
const citedGoals = fm["cites-quality-goals"];
|
|
11204
11304
|
const list = Array.isArray(citedGoals) ? citedGoals : [];
|
|
11205
11305
|
for (const qrId of list) {
|
|
@@ -13789,6 +13889,7 @@ var SPECIALIZED_AGENT_TEMPLATES = [
|
|
|
13789
13889
|
- Document critical technological decisions using immutable \`ADR-*\` records conforming to \`schemas/architecture/adr.schema.json\`.
|
|
13790
13890
|
- Validate that architectural choices comply with legal constraints in \`license-policy.yaml\` and data protection constraints in \`privacy-policy.yaml\`.
|
|
13791
13891
|
- **Technical Security & Privacy Feedback Loop**: If architectural decisions (databases, queues, distributed caching, third-party APIs, LLM providers, authentication schemes) introduce new attack vectors or PII data flows, emit a return handoff to \`agent-threat-modeler\` (which chains to \`agent-privacy-officer\`) for technical modeling prior to the testing phase.
|
|
13892
|
+
- **Mandatory Observability Component (\`CMP-OBSERVABILITY\`)**: In every system architecture modeled under arc42/NAF v4, the system architect MUST define an explicit building block \`CMP-OBSERVABILITY\` (Level 2/3) in Section 5 alongside Section 8 Cross-Cutting Concepts (\`ARCH-CROSS-*\`) and an immutable ADR for Runtime Observability, standardizing on: (1) Structured JSON logging with configurable granularity (\`LOG_LEVEL\`), (2) Distributed tracing via OpenTelemetry with W3C Trace Context (\`traceparent\`), and (3) Operational metrics (RED: Rate, Errors, Duration) in Prometheus / OpenMetrics format for Grafana scraping, satisfying \`QR-OBS-*\`.
|
|
13792
13893
|
- If autonomy is $\\ge$ \`HUMAN_REVIEW_PLAN\`, conclude by emitting the Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) suggesting \`agent-qa-engineer\` (or \`agent-threat-modeler\` if technical security/privacy loop is required) and opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
|
|
13793
13894
|
},
|
|
13794
13895
|
{
|
|
@@ -13848,9 +13949,12 @@ Execute every implementation task following this strict sequential order:
|
|
|
13848
13949
|
- **Zero Fake-Wiring Guardrail**: Strictly forbidden from marking a task \`COMPLETED\` with hardcoded \`mockData\` arrays in production views, \`setTimeout\` simulating network calls, or empty UI event handlers (\`onClick={() => {}}\`, \`onSubmit={() => {}}\`). Frontend components must wire directly to the shared contract and real Backend endpoints.
|
|
13849
13950
|
- **Mandatory 4 UI States Matrix**: Every data-driven UI component or screen must explicitly implement all 4 usability states: \`Loading\` (spinner/skeleton + disabled submit), \`Empty\` (clear message + CTA), \`Error\` (visible error recovery banner, never silent failure), and \`Nominal/Success\` (accessible semantic DOM + keyboard navigation).
|
|
13850
13951
|
- **Live Runtime Smoke Verification**: For tasks touching UI or UI-to-Backend integration, unit tests alone are insufficient. Before emitting handoff, boot the real Backend and Frontend servers and verify (via Playwright E2E or Chrome DevTools MCP) that browser \`console.error\` and \`pageerror\` counts are \`0\` and API calls return real \`2xx\` responses without CORS or schema mismatches.
|
|
13952
|
+
- **Mandatory Structured Logging & Observability**: Never emit unstructured console logs (\`console.log\`) in production code (\`no_console_logs_in_prod\`). Integrate the structured logger (\`ILogger\`) with configurable \`LOG_LEVEL\`, propagate W3C distributed trace context (\`trace_id\`), and record RED operational metrics compatible with Prometheus and Grafana.
|
|
13851
13953
|
- Before adding any external dependency, verify its SPDX license is permitted in \`license-policy.yaml\`.
|
|
13852
13954
|
- Respect non-negotiable \`quality-policy.yaml\` thresholds: Cyclomatic Complexity $\\le 10$, Cognitive Complexity $\\le 15$, Maintainability Index $\\ge 50$, Function Length $\\le 40$ lines.
|
|
13853
13955
|
- Run unified pre-flight with auto-fix (\`pnpm run check:fix\`) and full verification (\`pnpm run verify:all\`).
|
|
13956
|
+
- **Mandatory Regression Verification**: Never declare build, typecheck, or bug fixes complete without executing the relevant automated test suite (\`pnpm test\`, \`dotnet test\`) and confirming zero regressions.
|
|
13957
|
+
- **Global Styles Protection**: When touching or refactoring frontend views, verify that global stylesheet/asset imports remain intact and that layouts suffer no visual disruption.
|
|
13854
13958
|
- Upon completing green implementation, suggest handoff to \`agent-expert-user\` for Post-Development Functional Validation prior to security and privacy audit.`
|
|
13855
13959
|
},
|
|
13856
13960
|
{
|
|
@@ -14278,7 +14382,7 @@ This file defines the operational rules and specialized role mappings for Google
|
|
|
14278
14382
|
- FORBIDDEN to include production code or anticipate implementations.
|
|
14279
14383
|
- **Agreed Project Technology**: Always use the testing frameworks, E2E/UI runners, and technology stack agreed upon for the project (if any), without requiring the user to specify it in the prompt.
|
|
14280
14384
|
- **Mandatory E2E & UI Testing**: Never forget or omit End-to-End (E2E) and User Interface (UI) tests.
|
|
14281
|
-
- **Per-Interactive-Element Coverage**: Create specific tests for every UI element the user can interact with, covering Happy Path, Sad Path, and Boundary Values for each one.
|
|
14385
|
+
- **Per-Interactive-Element Coverage**: Create specific tests for every UI element the user can interact with, using external tools such as Playwright or FlatUI (or the agreed project testing technology), covering Happy Path, Sad Path, and Boundary Values for each one.
|
|
14282
14386
|
- Every \`FR-*\` must have at least nominal + boundary + out-of-range scenarios; missing these blocks handoff to \`agent-developer\`.
|
|
14283
14387
|
- Mandatory tags: \`@<FR-ID> @automated @regression\`.
|
|
14284
14388
|
- Run \`pnpm run verify:testing\` before emitting handoff.
|
|
@@ -14291,6 +14395,8 @@ This file defines the operational rules and specialized role mappings for Google
|
|
|
14291
14395
|
- Make tests delivered by \`agent-qa-engineer\` pass green without altering them to accommodate code.
|
|
14292
14396
|
- Respect \`quality-policy.yaml\` thresholds: CC $\\le 10$, Cognitive $\\le 15$, MI $\\ge 50$, LOC $\\le 40$.
|
|
14293
14397
|
- Run pre-flight with auto-fix: \`pnpm run check:fix\` and full verification: \`pnpm run verify:all\`.
|
|
14398
|
+
- **Mandatory Regression Verification**: Never declare build, typecheck, or bug fixes complete without executing the relevant automated test suite (\`pnpm test\`, \`dotnet test\`) and confirming zero regressions.
|
|
14399
|
+
- **Global Styles Protection**: When touching or refactoring frontend views, verify that global stylesheet/asset imports remain intact and that layouts suffer no visual disruption.
|
|
14294
14400
|
- Upon completing green implementation, suggest handoff to \`agent-expert-user\` for post-development functional validation prior to security and privacy audit.
|
|
14295
14401
|
|
|
14296
14402
|
### 7. \`agent-security-auditor\` (Adversarial Code Auditor)
|
|
@@ -14463,6 +14569,8 @@ Canonical Reference: [\`process/09_agent_protocols.md\`](process/09_agent_protoc
|
|
|
14463
14569
|
- Apply Test-Driven Development: generate unit tests before or alongside component logic.
|
|
14464
14570
|
- Tag tests linked to requirements with header comments citing the ID (\`FR-*\`, \`SEC-REQ-*\`, or \`PRIV-REQ-*\`) to enable reverse traceability.
|
|
14465
14571
|
- Suppressing types (\`any\`), linter rules (\`eslint-disable\`), or unit tests to force pipeline passage is prohibited.
|
|
14572
|
+
- **Mandatory Regression Verification**: Never declare build, typecheck, or bug fixes complete without executing the relevant automated test suite (\`pnpm test\`, \`dotnet test\`) and confirming zero regressions.
|
|
14573
|
+
- **Global Styles Protection**: When touching or refactoring frontend views, verify that global stylesheet/asset imports remain intact and that layouts suffer no visual disruption.
|
|
14466
14574
|
|
|
14467
14575
|
## 3. Open Source License Policy (\`license-policy.yaml\`)
|
|
14468
14576
|
- Before adding any dependency to \`package.json\`, verify its SPDX identifier.
|
|
@@ -14537,11 +14645,11 @@ npx tsx packages/cli/src/index.ts sdd integrate --change <chg-id>
|
|
|
14537
14645
|
|
|
14538
14646
|
### 5. \`agent-qa-engineer\` (QA Engineer and SDET)
|
|
14539
14647
|
- **Mission**: Translate approved requirements (\`FR-*\`, \`SEC-REQ-*\`, \`PRIV-REQ-*\`, \`QR-*\`) into comprehensive FAILING (red) BDD/Gherkin, End-to-End (E2E), UI, and unit test suites, before \`agent-developer\` writes production code.
|
|
14540
|
-
- **Guardrails**: Always use the agreed project technology/testing stack (if any). Never omit End-to-End (E2E) and UI tests. Create specific tests for every interactive UI element covering Happy Path, Sad Path, and Boundary Values. FORBIDDEN to include production code. Mandatory tags: \`@<FR-ID> @automated @regression\`.
|
|
14648
|
+
- **Guardrails**: Always use the agreed project technology/testing stack (if any). Never omit End-to-End (E2E) and UI tests. Create specific tests for every interactive UI element using external tools such as Playwright or FlatUI (or the agreed project testing technology), covering Happy Path, Sad Path, and Boundary Values. FORBIDDEN to include production code. Mandatory tags: \`@<FR-ID> @automated @regression\`.
|
|
14541
14649
|
|
|
14542
14650
|
### 6. \`agent-developer\` (Software Developer)
|
|
14543
14651
|
- **Mission**: Implement atomic tasks from SDD specifications (\`tasks.md\`) with clean, strictly typed code and thorough tests.
|
|
14544
|
-
- **Directives**: Execute the mandatory 4-step order: (1) Modular & Hexagonal Architecture (Ports & Adapters) definition/redefinition, (2) Inter-module interfaces first, (3) Component implementation, (4) Per-function unit tests (Happy Path, Sad Path, Boundary Values, Unexpected/Null/Empty values). Respect the autonomy mode. Make tests delivered by \`agent-qa-engineer\` pass green. Run \`pnpm run check:fix\` and \`pnpm run verify:all\`.
|
|
14652
|
+
- **Directives**: Execute the mandatory 4-step order: (1) Modular & Hexagonal Architecture (Ports & Adapters) definition/redefinition, (2) Inter-module interfaces first, (3) Component implementation, (4) Per-function unit tests (Happy Path, Sad Path, Boundary Values, Unexpected/Null/Empty values). Respect the autonomy mode. Make tests delivered by \`agent-qa-engineer\` pass green. Run \`pnpm run check:fix\` and \`pnpm run verify:all\`. Enforce Mandatory Regression Verification (\`pnpm test\`) with zero regressions before declaring completion, and enforce Global Styles Protection on frontend views.
|
|
14545
14653
|
|
|
14546
14654
|
### 7. \`agent-security-auditor\` (Adversarial Code Auditor)
|
|
14547
14655
|
- **Mission**: Examine Pull Requests for business logic vulnerabilities, injection vectors, secret leaks, and authorization flaws as part of the Pre-Merge Audit Triad.
|
|
@@ -15138,8 +15246,8 @@ cites-product-actors:
|
|
|
15138
15246
|
cites-quality-goals:
|
|
15139
15247
|
- QR-LATENCY-001
|
|
15140
15248
|
- QR-AVAILABILITY-001
|
|
15141
|
-
cites-
|
|
15142
|
-
-
|
|
15249
|
+
cites-journeys:
|
|
15250
|
+
- JRN-MAIN-001
|
|
15143
15251
|
supersedes: null
|
|
15144
15252
|
superseded-by: null
|
|
15145
15253
|
---
|
|
@@ -15740,19 +15848,19 @@ pipelines:\r
|
|
|
15740
15848
|
- step: *build-and-verify\r
|
|
15741
15849
|
- step: *sdd-integrate\r
|
|
15742
15850
|
`;
|
|
15743
|
-
var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML = "name: CI - AI-SDLC Quality Gates & Testing\r\n\r\non:\r\n push:\r\n branches: [ main ]\r\n pull_request:\r\n branches: [ main ]\r\n\r\njobs:\r\n verify-and-test:\r\n runs-on: ubuntu-latest\r\n strategy:\r\n matrix:\r\n node-version: [
|
|
15851
|
+
var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML = "name: CI - AI-SDLC Quality Gates & Testing\r\n\r\non:\r\n push:\r\n branches: [ main ]\r\n pull_request:\r\n branches: [ main ]\r\n\r\njobs:\r\n verify-and-test:\r\n runs-on: ubuntu-latest\r\n strategy:\r\n matrix:\r\n node-version: [ 20.x, 22.x ]\r\n\r\n steps:\r\n - name: Checkout Code\r\n uses: actions/checkout@v4\r\n\r\n - name: Install pnpm\r\n uses: pnpm/action-setup@v4\r\n with:\r\n version: 10\r\n\r\n - name: Setup Node.js ${{ matrix.node-version }}\r\n uses: actions/setup-node@v4\r\n with:\r\n node-version: ${{ matrix.node-version }}\r\n\r\n - name: Install Dependencies\r\n run: |\r\n pnpm install --frozen-lockfile\r\n pnpm approve-builds --all\r\n\r\n - name: Build Packages\r\n run: pnpm run build\r\n\r\n - name: Run Vitest Unit & Integration Suites\r\n run: pnpm test\r\n\r\n - name: AI-SDLC Quality Gate & Full Verification\r\n run: npx @aisdlc/cli verify all\r\n";
|
|
15744
15852
|
var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML = 'name: Deploy AI-SDLC Dashboard to GitHub Pages\r\n\r\non:\r\n push:\r\n branches:\r\n - main\r\n workflow_dispatch:\r\n\r\npermissions:\r\n contents: read\r\n pages: write\r\n id-token: write\r\n\r\nconcurrency:\r\n group: pages\r\n cancel-in-progress: false\r\n\r\njobs:\r\n deploy-dashboard:\r\n name: Build & Publish Interactive Dashboard\r\n runs-on: ubuntu-latest\r\n environment:\r\n name: github-pages\r\n url: ${{ steps.deployment.outputs.page_url }}\r\n\r\n steps:\r\n - name: Checkout Code\r\n uses: actions/checkout@v4\r\n with:\r\n fetch-depth: 0 # Full git history required for historical KPIs and telemetry\r\n\r\n - name: Setup Node.js\r\n uses: actions/setup-node@v4\r\n with:\r\n node-version: 20\r\n\r\n - name: Generate AI-SDLC Interactive Dashboard\r\n run: |\r\n mkdir -p reports\r\n npx --yes @aisdlc/cli report dashboard --output reports/index.html\r\n cp reports/index.html reports/dashboard.html\r\n touch reports/.nojekyll\r\n\r\n - name: Setup GitHub Pages\r\n uses: actions/configure-pages@v5\r\n\r\n - name: Upload Pages Artifact\r\n uses: actions/upload-pages-artifact@v3\r\n with:\r\n path: reports\r\n\r\n - name: Deploy to GitHub Pages\r\n id: deployment\r\n uses: actions/deploy-pages@v4\r\n\r\n - name: Emit Summary to GitHub Actions\r\n if: always() && steps.deployment.outcome == \'success\'\r\n run: |\r\n echo "### \u{1F310} AI-SDLC Interactive Dashboard Published" >> $GITHUB_STEP_SUMMARY\r\n echo "" >> $GITHUB_STEP_SUMMARY\r\n echo "The interactive PDaC / RTM graph, Quality Gate telemetry, and release metrics are live at:" >> $GITHUB_STEP_SUMMARY\r\n echo "" >> $GITHUB_STEP_SUMMARY\r\n echo "\u{1F449} **[Open Live Dashboard](${{ steps.deployment.outputs.page_url }})**" >> $GITHUB_STEP_SUMMARY\r\n';
|
|
15745
15853
|
var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML = "name: AI-SDLC PR KPI Aggregator\r\n\r\non:\r\n pull_request:\r\n types: [opened, synchronize, reopened]\r\n\r\npermissions:\r\n contents: read\r\n pull-requests: write\r\n\r\njobs:\r\n aggregate-kpis:\r\n name: Aggregate PR KPIs & Telemetry\r\n runs-on: ubuntu-latest\r\n\r\n steps:\r\n - name: Checkout Repository\r\n uses: actions/checkout@v4\r\n with:\r\n fetch-depth: 0\r\n\r\n - name: Install pnpm\r\n uses: pnpm/action-setup@v4\r\n with:\r\n version: 10\r\n\r\n - name: Setup Node.js\r\n uses: actions/setup-node@v4\r\n with:\r\n node-version: 20\r\n\r\n - name: Install Dependencies\r\n run: |\r\n pnpm install --frozen-lockfile\r\n\r\n - name: Calculate and Emit PR KPIs\r\n id: kpi\r\n run: |\r\n npx @aisdlc/cli kpi pr --base origin/${{ github.base_ref }} --head HEAD >> $GITHUB_STEP_SUMMARY\r\n";
|
|
15746
15854
|
var STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML = 'name: SDD Canonical Integration on Merge\r\n\r\non:\r\n pull_request:\r\n types: [closed]\r\n branches:\r\n - main\r\n - \'release/**\'\r\n workflow_dispatch:\r\n inputs:\r\n change_id:\r\n description: \'SDD change ID to integrate manually (e.g. chg-001-telemetry)\'\r\n required: false\r\n type: string\r\n\r\npermissions:\r\n contents: write\r\n pull-requests: read\r\n\r\nconcurrency:\r\n group: sdd-integrate-${{ github.event.pull_request.base.ref || github.ref_name }}\r\n cancel-in-progress: false\r\n\r\njobs:\r\n integrate-sdd:\r\n name: SDD Canonical Integration\r\n if: github.event.pull_request.merged == true || github.event_name == \'workflow_dispatch\'\r\n runs-on: ubuntu-latest\r\n\r\n steps:\r\n - name: Checkout Repository\r\n uses: actions/checkout@v4\r\n with:\r\n ref: ${{ github.event.pull_request.base.ref || github.ref_name }}\r\n fetch-depth: 0\r\n token: ${{ secrets.GITHUB_TOKEN }}\r\n\r\n - name: Install pnpm\r\n uses: pnpm/action-setup@v4\r\n with:\r\n version: 10\r\n\r\n - name: Setup Node.js\r\n uses: actions/setup-node@v4\r\n with:\r\n node-version: 20\r\n\r\n - name: Install Dependencies\r\n run: |\r\n pnpm install --frozen-lockfile\r\n pnpm approve-builds --all\r\n\r\n - name: Build Packages\r\n run: pnpm run build\r\n\r\n - name: Detect and Integrate SDD Change\r\n id: integrate\r\n env:\r\n PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}\r\n PR_TITLE: ${{ github.event.pull_request.title }}\r\n PR_BODY: ${{ github.event.pull_request.body }}\r\n MANUAL_CHANGE_ID: ${{ github.event.inputs.change_id }}\r\n run: |\r\n npx @aisdlc/cli sdd integrate --auto || true\r\n\r\n - name: Commit and Push Canonical Baseline Changes\r\n run: |\r\n git config user.name "github-actions[bot]"\r\n git config user.email "github-actions[bot]@users.noreply.github.com"\r\n git add -A\r\n if ! git diff --cached --quiet; then\r\n git commit -m "chore(sdd): integrate changes into canonical baseline [skip ci]"\r\n TARGET_BRANCH="${{ github.event.pull_request.base.ref || github.ref_name }}"\r\n MAX_RETRIES=3\r\n RETRY_COUNT=0\r\n DELAY=2\r\n\r\n while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do\r\n echo "Synchronizing with remote branch $TARGET_BRANCH (pull --rebase)..."\r\n git pull --rebase origin "$TARGET_BRANCH"\r\n if git push origin "$TARGET_BRANCH"; then\r\n echo "\u2714 Canonical integration committed and synchronized to repository."\r\n exit 0\r\n fi\r\n RETRY_COUNT=$((RETRY_COUNT + 1))\r\n if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then\r\n echo "\u26A0 Push rejected (concurrency detected). Retrying in ${DELAY}s (attempt $RETRY_COUNT/$MAX_RETRIES)..."\r\n sleep $DELAY\r\n DELAY=$((DELAY * 2))\r\n fi\r\n done\r\n\r\n echo "\u274C Error: Failed to push canonical integration after $MAX_RETRIES attempts."\r\n exit 1\r\n else\r\n echo "\u2139 No pending changes generated in working tree."\r\n fi\r\n';
|
|
15747
15855
|
var STARTER_TEMPLATES_COMPLIANCE_COMMERCIAL_ACQUISITION_REQUEST_TEMPLATE_MD = '---\r\nid: REQ-LIC-ACQUISITION-001\r\ntype: license-acquisition-request\r\ntitle: Commercial License Acquisition Request for [Library]\r\nstatus: pending-approval # pending-approval, approved, rejected\r\nrequested-package: "@vendor/commercial-package"\r\nspdx-license: "BSL-1.1" # or Commercial, SSPL-1.0\r\nlicense-category: commercial_acquisition_required\r\nestimated-cost: "$1,200 / year"\r\nbusiness-justification: "Accelerates critical telemetry module development avoiding 4 months of in-house implementation."\r\n---\r\n\r\n# Commercial License Acquisition Request\r\n\r\n## 1. Package and Vendor\r\n- **Package**: `@vendor/commercial-package`\r\n- **Version**: `2.4.0`\r\n- **License Type**: BSL 1.1 / Commercial\r\n- **Official Website**: `https://vendor.example.com`\r\n\r\n## 2. Technical Justification and Evaluated Alternatives\r\n- **Why a permissive alternative (MIT/Apache 2.0) is not used**:\r\n - Open-source alternatives lack required hardware encryption protocol support.\r\n- **Impact of not acquiring the license**:\r\n - 4-month delay on product delivery milestone.\r\n\r\n## 3. Human Authorization Signatures\r\n- [ ] Tech Lead: Technical approval\r\n- [ ] Legal / IP Counsel: EULA clauses validation\r\n- [ ] Procurement / Budget Owner: Payment authorization\r\n';
|
|
15748
|
-
var STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD = '---\r\nid: MAN-PROD-001\r\ntype: production-manual\r\ntitle: "Production & Operations Manual: Application Name"\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\napplies-to-version: "v1.0.0"\r\ntarget-audience:\r\n - devops-engineer\r\n - sre-engineer\r\n - release-manager\r\n - secops\r\ncomponents-covered:\r\n - CMP-NAME-001\r\nenclaves-involved:\r\n - SEC-ENC-DMZ-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# MAN-PROD-001: Production & Operations Manual - Application Name\r\n\r\n## 1. Deterministic Release Regeneration (Reproducible Builds)\r\n\r\nThis section contains the specifications and directives required to deterministically reproduce identical bit-by-bit application artifacts or releases from their Git tag.\r\n\r\n### 1.1 Source Code Baseline\r\n\r\n- **Canonical Repository**: `https://github.com/organization/repo-name.git`\r\n- **Immutable Git Release Tag**: `v1.0.0`\r\n- **Commit SHA-256 / SHA-1**: `[VERIFIED_HEXADECIMAL_COMMIT_SHA]`\r\n- **Clean Checkout Command**:\r\n ```bash\r\n git clone --recurse-submodules https://github.com/organization/repo-name.git\r\n cd repo-name\r\n git checkout tags/v1.0.0\r\n git submodule update --init --recursive\r\n ```\r\n\r\n### 1.2 Frozen Toolchains and Build Tool Matrix\r\n\r\nTo prevent discrepancies in binary or package generation, strict usage of pinned versions of the following utilities is enforced:\r\n\r\n| Tool / Runtime | Exact Version | Toolchain Checksum / Digest | Purpose |\r\n| :--- | :--- | :--- | :--- |\r\n| **Node.js LTS** | `v22.12.0` | `sha256:node-v22.12.0-linux-x64.tar.xz` | Execution and transpilation runtime |\r\n| **pnpm** | `9.15.0` | `sha256:pnpm-v9.15.0` | Deterministic monorepo package manager |\r\n| **TypeScript (tsc)** | `5.7.2` | Pinned in `devDependencies` | Strict ECMAScript compiler |\r\n| **Docker BuildKit** | `v0.18.0` | `moby/buildkit:v0.18.0` | Hermetic OCI packaging engine |\r\n\r\n### 1.3 Libraries, Dependencies, and Vertex Graph\r\n\r\n- **Immutable Lockfile**: `pnpm-lock.yaml` (or `Cargo.lock`, `go.sum`, `requirements.lock`). Installations with open resolution are forbidden (`pnpm install --frozen-lockfile` mandatory).\r\n- **SBOM (Software Bill of Materials) Inventory**:\r\n - Format: CycloneDX JSON v1.5 / SPDX v2.3.\r\n - Compiled SBOM path: `reports/sbom-cyclonedx.json`.\r\n- **OSS License Governance**:\r\n - Binding policy: `license-policy.yaml`.\r\n - Library vertex pre-verification:\r\n ```bash\r\n pnpm verify:licenses\r\n ```\r\n\r\n### 1.4 Step-by-Step Deterministic Build Procedure\r\n\r\n1. **Step 1: Hermetic Dependency Installation**\r\n ```bash\r\n pnpm install --frozen-lockfile --ignore-scripts\r\n ```\r\n\r\n2. **Step 2: Integrity and Strict Type Checking**\r\n ```bash\r\n pnpm typecheck\r\n ```\r\n\r\n3. **Step 3: Artifact Compilation**\r\n ```bash\r\n export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)\r\n pnpm build\r\n ```\r\n\r\n4. **Step 4: Cryptographic Verification of Generated Artifact**\r\n ```bash\r\n sha256sum dist/app.bundle.js\r\n # Compare against the canonical checksum registered in official release:\r\n # Expected: [CANONICAL_SHA256_CHECKSUM]\r\n ```\r\n\r\n\n\n5. **Step 5: Sigstore / Cosign Signature and SLSA Provenance Verification**\n ```bash\n # Verify npm package provenance from registry\n npm audit signatures\n\n # Verify package tarball with Sigstore / Cosign (Keyless via OIDC identity)\n cosign verify-blob \\\n --bundle release-artifacts/package.tgz.bundle \\\n --certificate-identity-regexp "^https://github.com/organization/repo-name/.*$" \\\n --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \\\n release-artifacts/package.tgz\n\n # Verify SLSA Build Provenance Attestation using GitHub CLI\n gh attestation verify release-artifacts/package.tgz --repo organization/repo-name\n ```\n\n---\r\n\r\n## 2. Version, Infrastructure, and Migration Compatibility Matrix\r\n\r\nThis section defines technical interoperability boundaries between the release version and the deployment ecosystem, ensuring safe Zero-Downtime transitions.\r\n\r\n### 2.1 Platform and Execution Runtime Compatibility\r\n\r\n| Infrastructure Component | Approved Version Range | Recommended Version | Support Status |\r\n| :--- | :--- | :--- | :---: |\r\n| **Kubernetes Cluster (K8s)** | `>= 1.28` and `<= 1.31` | `1.30.2` | \u2705 Certified |\r\n| **Container Runtime (CRI)** | containerd `>= 1.7` / CRI-O `>= 1.28` | containerd `1.7.15` | \u2705 Certified |\r\n| **Base Operating System (Host)** | Ubuntu 22.04 LTS / RHEL 9.2+ | Ubuntu 22.04 LTS (Kernel 6.x) | \u2705 Homologated |\r\n| **Language Runtime (Production)** | Node.js `>= 20.x` and `<= 22.x` | `v22.12.0 LTS` | \u2705 Hermetic |\r\n\r\n### 2.2 Data Schema and Migration Compatibility (N-1 Support)\r\n\r\nTo enable Canary or Blue-Green continuous deployments without transaction loss:\r\n\r\n| Release Version | DB Schema Version | Compatible with $N-1$ Code | Schema Migration Status |\r\n| :---: | :---: | :---: | :--- |\r\n| **`v1.0.0`** (Current) | `SCHEMA-v1.0` | \u2705 Yes (supports `v0.9.x` code) | Non-destructive additive migration (no column renaming). |\r\n| **`v0.9.x`** | `SCHEMA-v0.9` | \u2705 Previous baseline | Fully compatible during Canary drain period. |\r\n\r\n### 2.3 Interoperability Between Architecture Components (`CMP-*`)\r\n\r\n| Dependent Component | Consumed Component | Minimum Compatible Versions | Binding Protocol / Contract |\r\n| :--- | :--- | :---: | :--- |\r\n| `CMP-NAME-001` (Gateway) | `CMP-NAME-002` (Backend) | `>= v1.0.0` | gRPC / Protobuf v3 (`contract_spec.proto`) |\r\n| `CMP-NAME-001` (Gateway) | Messaging Bus / Kafka | `>= 3.5.0` | Kafka v2 Protocol with TLS mTLS |\r\n\r\n### 2.4 Homologated Upgrade & Rollback Paths\r\n\r\n| Source Version | Direct Jump to `v1.0.0` | Intermediate Migration Required | Direct Rollback Procedure |\r\n| :---: | :---: | :---: | :---: |\r\n| **`v0.9.1`** | \u2705 Allowed | \u274C Not required | `kubectl rollout undo` without data loss. |\r\n| **`v0.9.0`** | \u2705 Allowed | \u274C Not required | `kubectl rollout undo` without data loss. |\r\n| **`< v0.9.0`** | \u274C Blocked | \u2705 Must upgrade to `v0.9.1` first | Requires restore from backup snapshot. |\r\n\r\n---\r\n\r\n## 3. CI/CD Architecture and Pipelines\r\n\r\n### 3.1 Hierarchical Branching Model and Integration Triggers\r\n\r\nFollowing the AI-SDLC 4-tier standard:\r\n\r\n```text\r\nTIER 1: main (Production)\r\n \u25B2\r\n \u2514\u2500\u2500 PR Release Gate (Manual Tech Lead / Release Manager Approval)\r\n \u2502\r\nTIER 2: release/v1.0.0 (Open Version Branch)\r\n \u25B2\r\n \u2514\u2500\u2500 PR Feature Gate (Lint + Tests + Quality Gate + SAST + SBOM)\r\n \u2502\r\nTIER 3: feat/CHG-001-* (Feature / Bug)\r\n```\r\n\r\n- **Pull Request Trigger**: Executes linters, full test battery, and governance verifications without deployment.\r\n- **Release Tag Trigger (`v*.*.*`)**: Executes the full hermetic build pipeline, image signing, and continuous deployment.\r\n\r\n### 3.2 CI/CD Pipeline Flowchart\r\n\r\n```mermaid\r\nflowchart LR\r\n A["Git Push / Tag v1.0.0"] --> B["Hermetic Checkout"]\r\n B --> C["Linters & Typecheck"]\r\n C --> D["Vitest: Unit & BDD"]\r\n D --> E["Quality Gate: CC & MI"]\r\n E --> F["SAST & Secret Scan"]\r\n F --> G["SBOM & License Gate"]\r\n G --> H["Deterministic Build"]\r\n H --> I["Cosign / SLSA Signing"]\r\n I --> J["Push to OCI Registry"]\r\n J --> K["Deploy to DMZ Enclave"]\r\n```\r\n\r\n### 3.3 Release Gate Contracts and Thresholds\r\n\r\n| Quality Gate | Tool / Command | Required Threshold | Action on Non-Compliance |\r\n| :--- | :--- | :--- | :--- |\r\n| **Lint & Typecheck** | `pnpm typecheck` | Zero errors, zero `any` | **Immediate failure** |\r\n| **Automated Tests** | `pnpm test:all` | 100% passed, Coverage >= 85% | **Immediate failure** |\r\n| **Cyclomatic Complexity** | `aisdlc verify quality` | CC <= 10 per function | **Release blocked** |\r\n| **Maintainability Index** | `aisdlc verify quality` | MI >= 50.0 / 100 | **Release blocked** |\r\n| **360\xB0 Traceability** | `aisdlc verify traceability` | 100% of requirements linked | **Release blocked** |\r\n| **OSS Licenses** | `aisdlc verify licenses` | Zero forbidden/viral licenses | **Release blocked** |\r\n| **Cryptographic Signature & SLSA** | `cosign verify-blob` / `gh attestation verify` | Valid signature and SLSA provenance from GitHub Actions OIDC | **Deployment rejected** |\r\n\r\n---\r\n\r\n## 4. Production Deployment Strategy and Procedure\r\n\r\n### 4.1 Infrastructure Prerequisites and Network Enclaves\r\n\r\n- **Target Enclave**: `SEC-ENC-DMZ-001` (Strict segmentation without direct uncontrolled outbound internet access).\r\n- **Enabled Network Ports**:\r\n - Port `8443/TCP`: Secure WebSocket ingestion with mutual TLS (mTLS) authentication.\r\n - Port `9090/TCP`: Prometheus metrics (internal management network only).\r\n- **Secrets and Certificate Management**:\r\n - Server TLS and client root CA certificates mounted via immutable secret at `/etc/pki/tls/`.\r\n - Embedding cryptographic keys in environment variables or images is strictly forbidden.\r\n\r\n### 4.2 Rollout Strategy\r\n\r\nA **Canary strategy with progressive telemetry metrics analysis** is utilized:\r\n1. 10% of traffic is routed to the new version for 15 minutes.\r\n2. If the 5xx error rate is `<= 0.01%` and p99 latency is `<= 50ms`, traffic is promoted to 100%.\r\n\r\n### 4.3 Step-by-Step Deployment Procedure\r\n\r\n1. **Step 1: Pre-deployment and State Snapshot**\r\n ```bash\r\n # Check cluster health and record baseline\r\n kubectl get pods -n production -l app=system\r\n kubectl exec -it system-db-0 -- /backup/create-snapshot.sh\r\n ```\r\n\r\n2. **Step 2: Deployment Manifest Application**\r\n ```bash\r\n kubectl apply -f deploy/production/canary-deployment.yaml\r\n kubectl rollout status deployment/system-service -n production --timeout=180s\r\n ```\r\n\r\n3. **Step 3: Health Verification and Smoke Tests**\r\n ```bash\r\n curl -f --cacert /etc/pki/tls/ca.crt https://127.0.0.1:8443/healthz\r\n curl -f --cacert /etc/pki/tls/ca.crt https://127.0.0.1:8443/readyz\r\n pnpm test:example\r\n ```\r\n\r\n### 4.4 Rollback Plan (Immediate Rollback)\r\n\r\n- **Objective Rollback Activation Criteria**:\r\n - mTLS handshake failure rate `> 1.0%`.\r\n - Ingestion p99 latency `> 100ms` for 2 continuous minutes.\r\n - Critical `CrashLoopBackOff` alert on more than 20% of instances.\r\n- **Rollback Execution Command**:\r\n ```bash\r\n kubectl rollout undo deployment/system-service -n production\r\n kubectl rollout status deployment/system-service -n production\r\n ```\r\n\r\n---\r\n\r\n## 5. Likely Errors Resolution and Troubleshooting (Runbooks)\r\n\r\nThis section documents the most frequent runtime and deployment failures along with diagnosis and immediate mitigation procedures.\r\n\r\n### 5.1 Frequent Incidents and Solutions Matrix\r\n\r\n#### Incident 1: Dependency Vertex Inconsistency or Drift (Build Failure)\r\n- **Symptom**: `pnpm install --frozen-lockfile` command fails in CI with error `ERR_PNPM_LOCKFILE_OUTDATED`.\r\n- **Root Cause**: `package.json` was modified without updating `pnpm-lock.yaml`.\r\n- **Diagnosis**:\r\n ```bash\r\n git diff HEAD^ package.json pnpm-lock.yaml\r\n ```\r\n- **Mitigation**:\r\n 1. On the feature branch, run `pnpm install` locally to regenerate the deterministic lockfile.\r\n 2. Verify no restricted-license dependencies were introduced via `pnpm verify:licenses`.\r\n 3. Commit both files together in an atomic commit.\r\n\r\n---\r\n\r\n#### Incident 2: mTLS Handshake Failure or Enclave Certificate Rejected\r\n- **Symptom**: Clients receive error `ERR_TLS_CERT_ALTNAME_INVALID` or connection closed with TLS alert `certificate_unknown (46)`.\r\n- **Root Cause**: Internal root CA mounted on server does not match the client certificate issuer CA, or certificate expired.\r\n- **Diagnosis**:\r\n ```bash\r\n openssl s_client -connect 127.0.0.1:8443 -CAfile /etc/pki/tls/ca.crt -cert /etc/pki/tls/client.crt -key /etc/pki/tls/client.key\r\n openssl x509 -in /etc/pki/tls/ca.crt -noout -dates -issuer -subject\r\n ```\r\n- **Mitigation**:\r\n 1. Verify expiration date of certificate mounted in cluster Secret.\r\n 2. If expired, rotate the certificate by injecting the new pair from HSM / Vault storage.\r\n 3. Orderly restart pods with `kubectl rollout restart deployment/system-service`.\r\n\r\n---\r\n\r\n#### Incident 3: Release Gate Rejection in CI/CD Due to Quality Metrics\r\n- **Symptom**: Pipeline aborts with verdict `Quality Gate REJECTED` (Cyclomatic Complexity > 10 or Maintainability < 50).\r\n- **Root Cause**: Introduction of complex nested logic (multiple `if/else`, extensive `switch`, or branching loops).\r\n- **Diagnosis**:\r\n ```bash\r\n pnpm verify:quality\r\n ```\r\n- **Mitigation**:\r\n 1. Inspect the violation report in `reports/QUALITY_GATE_REPORT.md` to identify the offending function.\r\n 2. Decompose function into cohesive private helper methods following the rule of maximum 40 lines per function.\r\n 3. Re-run `pnpm verify:quality` until green verdict is confirmed. Adding suppression comments (`// @ts-ignore`) is forbidden.\r\n\r\n---\r\n\r\n#### Incident 4: CrashLoopBackOff Due to Memory Leak or Connection Limit\r\n- **Symptom**: Pod is terminated with exit code `ExitCode: 137` (`OOMKilled`) after a load spike.\r\n- **Root Cause**: Undrained socket buffer accumulation during high-frequency bursts.\r\n- **Diagnosis**:\r\n ```bash\r\n kubectl describe pod system-service-xxx -n production | grep -i oom\r\n kubectl logs system-service-xxx -n production --previous\r\n ```\r\n- **Mitigation**:\r\n 1. Temporarily adjust memory limits in Kubernetes manifest (`resources.limits.memory`) if the load burst is legitimate.\r\n 2. Apply backpressure or discard expired packets in accordance with business rules (`BR-*`).\r\n 3. Run local benchmark with `pnpm test:all` to audit memory consumption.\r\n\r\n---\r\n\r\n### 5.2 Escalation Protocol and Critical Incident Management\r\n\r\n| Severity Level | Impact Criterion | Maximum Response Time | Roles Involved |\r\n| :--- | :--- | :---: | :--- |\r\n| **SEV-1 (Critical)** | Complete service outage or security breach in enclave. | 15 minutes | On-call SRE + Lead Architect + SecOps |\r\n| **SEV-2 (Major)** | Severe service degradation, massive retries without outage. | 1 hour | On-call SRE + Tech Lead |\r\n| **SEV-3 (Minor)** | Isolated node incident without global SLA impact. | 4 hours | Support Engineer / DevOps |\r\n\r\n---\r\n\r\n## 6. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-15 | Operations & DevOps Team | Initial Production Manual generation | CHG-009 |\r\n';
|
|
15856
|
+
var STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD = '---\r\nid: MAN-PROD-001\r\ntype: production-manual\r\ntitle: "Production & Operations Manual: Application Name"\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\napplies-to-version: "v1.0.0"\r\ntarget-audience:\r\n - devops-engineer\r\n - sre-engineer\r\n - release-manager\r\n - secops\r\ncomponents-covered:\r\n - CMP-NAME-001\r\nenclaves-involved:\r\n - SEC-ENC-DMZ-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# MAN-PROD-001: Production & Operations Manual - Application Name\r\n\r\n## 1. Deterministic Release Regeneration (Reproducible Builds)\r\n\r\nThis section contains the specifications and directives required to deterministically reproduce identical bit-by-bit application artifacts or releases from their Git tag.\r\n\r\n### 1.1 Source Code Baseline\r\n\r\n- **Canonical Repository**: `https://github.com/organization/repo-name.git`\r\n- **Immutable Git Release Tag**: `v1.0.0`\r\n- **Commit SHA-256 / SHA-1**: `[VERIFIED_HEXADECIMAL_COMMIT_SHA]`\r\n- **Clean Checkout Command**:\r\n ```bash\r\n git clone --recurse-submodules https://github.com/organization/repo-name.git\r\n cd repo-name\r\n git checkout tags/v1.0.0\r\n git submodule update --init --recursive\r\n ```\r\n\r\n### 1.2 Frozen Toolchains and Build Tool Matrix\r\n\r\nTo prevent discrepancies in binary or package generation, strict usage of pinned versions of the following utilities is enforced:\r\n\r\n| Tool / Runtime | Exact Version | Toolchain Checksum / Digest | Purpose |\r\n| :--- | :--- | :--- | :--- |\r\n| **Node.js LTS** | `v22.12.0` | `sha256:node-v22.12.0-linux-x64.tar.xz` | Execution and transpilation runtime |\r\n| **pnpm** | `9.15.0` | `sha256:pnpm-v9.15.0` | Deterministic monorepo package manager |\r\n| **TypeScript (tsc)** | `5.7.2` | Pinned in `devDependencies` | Strict ECMAScript compiler |\r\n| **Docker BuildKit** | `v0.18.0` | `moby/buildkit:v0.18.0` | Hermetic OCI packaging engine |\r\n\r\n### 1.3 Libraries, Dependencies, and Vertex Graph\r\n\r\n- **Immutable Lockfile**: `pnpm-lock.yaml` (or `Cargo.lock`, `go.sum`, `requirements.lock`). Installations with open resolution are forbidden (`pnpm install --frozen-lockfile` mandatory).\r\n- **SBOM (Software Bill of Materials) Inventory**:\r\n - Format: CycloneDX JSON v1.5 / SPDX v2.3.\r\n - Compiled SBOM path: `reports/sbom-cyclonedx.json`.\r\n- **OSS License Governance**:\r\n - Binding policy: `license-policy.yaml`.\r\n - Library vertex pre-verification:\r\n ```bash\r\n pnpm verify:licenses\r\n ```\r\n\r\n### 1.4 Step-by-Step Deterministic Build Procedure\r\n\r\n1. **Step 1: Hermetic Dependency Installation**\r\n ```bash\r\n pnpm install --frozen-lockfile --ignore-scripts\r\n ```\r\n\r\n2. **Step 2: Integrity and Strict Type Checking**\r\n ```bash\r\n pnpm typecheck\r\n ```\r\n\r\n3. **Step 3: Artifact Compilation**\r\n ```bash\r\n export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)\r\n pnpm build\r\n ```\r\n\r\n4. **Step 4: Cryptographic Verification of Generated Artifact**\r\n ```bash\r\n sha256sum dist/app.bundle.js\r\n # Compare against the canonical checksum registered in official release:\r\n # Expected: [CANONICAL_SHA256_CHECKSUM]\r\n ```\r\n\r\n\r\n\r\n5. **Step 5: Sigstore / Cosign Signature and SLSA Provenance Verification**\r\n ```bash\r\n # Verify npm package provenance from registry\r\n npm audit signatures\r\n\r\n # Verify package tarball with Sigstore / Cosign (Keyless via OIDC identity)\r\n cosign verify-blob \\\r\n --bundle release-artifacts/package.tgz.bundle \\\r\n --certificate-identity-regexp "^https://github.com/organization/repo-name/.*$" \\\r\n --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \\\r\n release-artifacts/package.tgz\r\n\r\n # Verify SLSA Build Provenance Attestation using GitHub CLI\r\n gh attestation verify release-artifacts/package.tgz --repo organization/repo-name\r\n ```\r\n\r\n---\r\n\r\n## 2. Version, Infrastructure, and Migration Compatibility Matrix\r\n\r\nThis section defines technical interoperability boundaries between the release version and the deployment ecosystem, ensuring safe Zero-Downtime transitions.\r\n\r\n### 2.1 Platform and Execution Runtime Compatibility\r\n\r\n| Infrastructure Component | Approved Version Range | Recommended Version | Support Status |\r\n| :--- | :--- | :--- | :---: |\r\n| **Kubernetes Cluster (K8s)** | `>= 1.28` and `<= 1.31` | `1.30.2` | \u2705 Certified |\r\n| **Container Runtime (CRI)** | containerd `>= 1.7` / CRI-O `>= 1.28` | containerd `1.7.15` | \u2705 Certified |\r\n| **Base Operating System (Host)** | Ubuntu 22.04 LTS / RHEL 9.2+ | Ubuntu 22.04 LTS (Kernel 6.x) | \u2705 Homologated |\r\n| **Language Runtime (Production)** | Node.js `>= 20.x` and `<= 22.x` | `v22.12.0 LTS` | \u2705 Hermetic |\r\n\r\n### 2.2 Data Schema and Migration Compatibility (N-1 Support)\r\n\r\nTo enable Canary or Blue-Green continuous deployments without transaction loss:\r\n\r\n| Release Version | DB Schema Version | Compatible with $N-1$ Code | Schema Migration Status |\r\n| :---: | :---: | :---: | :--- |\r\n| **`v1.0.0`** (Current) | `SCHEMA-v1.0` | \u2705 Yes (supports `v0.9.x` code) | Non-destructive additive migration (no column renaming). |\r\n| **`v0.9.x`** | `SCHEMA-v0.9` | \u2705 Previous baseline | Fully compatible during Canary drain period. |\r\n\r\n### 2.3 Interoperability Between Architecture Components (`CMP-*`)\r\n\r\n| Dependent Component | Consumed Component | Minimum Compatible Versions | Binding Protocol / Contract |\r\n| :--- | :--- | :---: | :--- |\r\n| `CMP-NAME-001` (Gateway) | `CMP-NAME-002` (Backend) | `>= v1.0.0` | gRPC / Protobuf v3 (`contract_spec.proto`) |\r\n| `CMP-NAME-001` (Gateway) | Messaging Bus / Kafka | `>= 3.5.0` | Kafka v2 Protocol with TLS mTLS |\r\n\r\n### 2.4 Homologated Upgrade & Rollback Paths\r\n\r\n| Source Version | Direct Jump to `v1.0.0` | Intermediate Migration Required | Direct Rollback Procedure |\r\n| :---: | :---: | :---: | :---: |\r\n| **`v0.9.1`** | \u2705 Allowed | \u274C Not required | `kubectl rollout undo` without data loss. |\r\n| **`v0.9.0`** | \u2705 Allowed | \u274C Not required | `kubectl rollout undo` without data loss. |\r\n| **`< v0.9.0`** | \u274C Blocked | \u2705 Must upgrade to `v0.9.1` first | Requires restore from backup snapshot. |\r\n\r\n---\r\n\r\n## 3. CI/CD Architecture and Pipelines\r\n\r\n### 3.1 Hierarchical Branching Model and Integration Triggers\r\n\r\nFollowing the AI-SDLC 4-tier standard:\r\n\r\n```text\r\nTIER 1: main (Production)\r\n \u25B2\r\n \u2514\u2500\u2500 PR Release Gate (Manual Tech Lead / Release Manager Approval)\r\n \u2502\r\nTIER 2: release/v1.0.0 (Open Version Branch)\r\n \u25B2\r\n \u2514\u2500\u2500 PR Feature Gate (Lint + Tests + Quality Gate + SAST + SBOM)\r\n \u2502\r\nTIER 3: feat/CHG-001-* (Feature / Bug)\r\n```\r\n\r\n- **Pull Request Trigger**: Executes linters, full test battery, and governance verifications without deployment.\r\n- **Release Tag Trigger (`v*.*.*`)**: Executes the full hermetic build pipeline, image signing, and continuous deployment.\r\n\r\n### 3.2 CI/CD Pipeline Flowchart\r\n\r\n```mermaid\r\nflowchart LR\r\n A["Git Push / Tag v1.0.0"] --> B["Hermetic Checkout"]\r\n B --> C["Linters & Typecheck"]\r\n C --> D["Vitest: Unit & BDD"]\r\n D --> E["Quality Gate: CC & MI"]\r\n E --> F["SAST & Secret Scan"]\r\n F --> G["SBOM & License Gate"]\r\n G --> H["Deterministic Build"]\r\n H --> I["Cosign / SLSA Signing"]\r\n I --> J["Push to OCI Registry"]\r\n J --> K["Deploy to DMZ Enclave"]\r\n```\r\n\r\n### 3.3 Release Gate Contracts and Thresholds\r\n\r\n| Quality Gate | Tool / Command | Required Threshold | Action on Non-Compliance |\r\n| :--- | :--- | :--- | :--- |\r\n| **Lint & Typecheck** | `pnpm typecheck` | Zero errors, zero `any` | **Immediate failure** |\r\n| **Automated Tests** | `pnpm test:all` | 100% passed, Coverage >= 85% | **Immediate failure** |\r\n| **Cyclomatic Complexity** | `aisdlc verify quality` | CC <= 10 per function | **Release blocked** |\r\n| **Maintainability Index** | `aisdlc verify quality` | MI >= 50.0 / 100 | **Release blocked** |\r\n| **360\xB0 Traceability** | `aisdlc verify traceability` | 100% of requirements linked | **Release blocked** |\r\n| **OSS Licenses** | `aisdlc verify licenses` | Zero forbidden/viral licenses | **Release blocked** |\r\n| **Cryptographic Signature & SLSA** | `cosign verify-blob` / `gh attestation verify` | Valid signature and SLSA provenance from GitHub Actions OIDC | **Deployment rejected** |\r\n\r\n---\r\n\r\n## 4. Production Deployment Strategy and Procedure\r\n\r\n### 4.1 Infrastructure Prerequisites and Network Enclaves\r\n\r\n- **Target Enclave**: `SEC-ENC-DMZ-001` (Strict segmentation without direct uncontrolled outbound internet access).\r\n- **Enabled Network Ports**:\r\n - Port `8443/TCP`: Secure WebSocket ingestion with mutual TLS (mTLS) authentication.\r\n - Port `9090/TCP`: Prometheus metrics (internal management network only).\r\n- **Secrets and Certificate Management**:\r\n - Server TLS and client root CA certificates mounted via immutable secret at `/etc/pki/tls/`.\r\n - Embedding cryptographic keys in environment variables or images is strictly forbidden.\r\n\r\n### 4.2 Rollout Strategy\r\n\r\nA **Canary strategy with progressive telemetry metrics analysis** is utilized:\r\n1. 10% of traffic is routed to the new version for 15 minutes.\r\n2. If the 5xx error rate is `<= 0.01%` and p99 latency is `<= 50ms`, traffic is promoted to 100%.\r\n\r\n### 4.3 Step-by-Step Deployment Procedure\r\n\r\n1. **Step 1: Pre-deployment and State Snapshot**\r\n ```bash\r\n # Check cluster health and record baseline\r\n kubectl get pods -n production -l app=system\r\n kubectl exec -it system-db-0 -- /backup/create-snapshot.sh\r\n ```\r\n\r\n2. **Step 2: Deployment Manifest Application**\r\n ```bash\r\n kubectl apply -f deploy/production/canary-deployment.yaml\r\n kubectl rollout status deployment/system-service -n production --timeout=180s\r\n ```\r\n\r\n3. **Step 3: Health Verification and Smoke Tests**\r\n ```bash\r\n curl -f --cacert /etc/pki/tls/ca.crt https://127.0.0.1:8443/healthz\r\n curl -f --cacert /etc/pki/tls/ca.crt https://127.0.0.1:8443/readyz\r\n pnpm test:example\r\n ```\r\n\r\n### 4.4 Rollback Plan (Immediate Rollback)\r\n\r\n- **Objective Rollback Activation Criteria**:\r\n - mTLS handshake failure rate `> 1.0%`.\r\n - Ingestion p99 latency `> 100ms` for 2 continuous minutes.\r\n - Critical `CrashLoopBackOff` alert on more than 20% of instances.\r\n- **Rollback Execution Command**:\r\n ```bash\r\n kubectl rollout undo deployment/system-service -n production\r\n kubectl rollout status deployment/system-service -n production\r\n ```\r\n\r\n---\r\n\r\n## 5. Likely Errors Resolution and Troubleshooting (Runbooks)\r\n\r\nThis section documents the most frequent runtime and deployment failures along with diagnosis and immediate mitigation procedures.\r\n\r\n### 5.1 Frequent Incidents and Solutions Matrix\r\n\r\n#### Incident 1: Dependency Vertex Inconsistency or Drift (Build Failure)\r\n- **Symptom**: `pnpm install --frozen-lockfile` command fails in CI with error `ERR_PNPM_LOCKFILE_OUTDATED`.\r\n- **Root Cause**: `package.json` was modified without updating `pnpm-lock.yaml`.\r\n- **Diagnosis**:\r\n ```bash\r\n git diff HEAD^ package.json pnpm-lock.yaml\r\n ```\r\n- **Mitigation**:\r\n 1. On the feature branch, run `pnpm install` locally to regenerate the deterministic lockfile.\r\n 2. Verify no restricted-license dependencies were introduced via `pnpm verify:licenses`.\r\n 3. Commit both files together in an atomic commit.\r\n\r\n---\r\n\r\n#### Incident 2: mTLS Handshake Failure or Enclave Certificate Rejected\r\n- **Symptom**: Clients receive error `ERR_TLS_CERT_ALTNAME_INVALID` or connection closed with TLS alert `certificate_unknown (46)`.\r\n- **Root Cause**: Internal root CA mounted on server does not match the client certificate issuer CA, or certificate expired.\r\n- **Diagnosis**:\r\n ```bash\r\n openssl s_client -connect 127.0.0.1:8443 -CAfile /etc/pki/tls/ca.crt -cert /etc/pki/tls/client.crt -key /etc/pki/tls/client.key\r\n openssl x509 -in /etc/pki/tls/ca.crt -noout -dates -issuer -subject\r\n ```\r\n- **Mitigation**:\r\n 1. Verify expiration date of certificate mounted in cluster Secret.\r\n 2. If expired, rotate the certificate by injecting the new pair from HSM / Vault storage.\r\n 3. Orderly restart pods with `kubectl rollout restart deployment/system-service`.\r\n\r\n---\r\n\r\n#### Incident 3: Release Gate Rejection in CI/CD Due to Quality Metrics\r\n- **Symptom**: Pipeline aborts with verdict `Quality Gate REJECTED` (Cyclomatic Complexity > 10 or Maintainability < 50).\r\n- **Root Cause**: Introduction of complex nested logic (multiple `if/else`, extensive `switch`, or branching loops).\r\n- **Diagnosis**:\r\n ```bash\r\n pnpm verify:quality\r\n ```\r\n- **Mitigation**:\r\n 1. Inspect the violation report in `reports/QUALITY_GATE_REPORT.md` to identify the offending function.\r\n 2. Decompose function into cohesive private helper methods following the rule of maximum 40 lines per function.\r\n 3. Re-run `pnpm verify:quality` until green verdict is confirmed. Adding suppression comments (`// @ts-ignore`) is forbidden.\r\n\r\n---\r\n\r\n#### Incident 4: CrashLoopBackOff Due to Memory Leak or Connection Limit\r\n- **Symptom**: Pod is terminated with exit code `ExitCode: 137` (`OOMKilled`) after a load spike.\r\n- **Root Cause**: Undrained socket buffer accumulation during high-frequency bursts.\r\n- **Diagnosis**:\r\n ```bash\r\n kubectl describe pod system-service-xxx -n production | grep -i oom\r\n kubectl logs system-service-xxx -n production --previous\r\n ```\r\n- **Mitigation**:\r\n 1. Temporarily adjust memory limits in Kubernetes manifest (`resources.limits.memory`) if the load burst is legitimate.\r\n 2. Apply backpressure or discard expired packets in accordance with business rules (`BR-*`).\r\n 3. Run local benchmark with `pnpm test:all` to audit memory consumption.\r\n\r\n---\r\n\r\n### 5.2 Escalation Protocol and Critical Incident Management\r\n\r\n| Severity Level | Impact Criterion | Maximum Response Time | Roles Involved |\r\n| :--- | :--- | :---: | :--- |\r\n| **SEV-1 (Critical)** | Complete service outage or security breach in enclave. | 15 minutes | On-call SRE + Lead Architect + SecOps |\r\n| **SEV-2 (Major)** | Severe service degradation, massive retries without outage. | 1 hour | On-call SRE + Tech Lead |\r\n| **SEV-3 (Minor)** | Isolated node incident without global SLA impact. | 4 hours | Support Engineer / DevOps |\r\n\r\n---\r\n\r\n## 6. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-15 | Operations & DevOps Team | Initial Production Manual generation | CHG-009 |\r\n';
|
|
15749
15857
|
var STARTER_TEMPLATES_MANUALS_USER_MANUAL_TEMPLATE_MD = '---\r\nid: MAN-USER-001\r\ntype: user-manual\r\ntitle: "User Manual: Application Name"\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\napplies-to-version: "v1.0.0"\r\ntarget-audience:\r\n - ACT-ROLE-USER-001\r\n - ACT-OPERATOR-002\r\nallowed-roles:\r\n - ACT-ROLE-USER-001\r\n - ACT-OPERATOR-002\r\njourneys-covered:\r\n - JRN-JOURNEY-001\r\nuse-cases-covered:\r\n - UC-ACTION-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# MAN-USER-001: User Manual - Application Name\r\n\r\n## 1. System Purpose and Audience\r\n\r\nConcisely describes the software\'s purpose, the operational value it delivers to end users, and the general context in which it operates.\r\n\r\n- **Application / System**: `[System Name or Bounded Context]`\r\n- **Software Version**: `v1.0.0`\r\n- **Target Audience**: `[Functional roles and user profiles addressed]`\r\n\r\n---\r\n\r\n## 2. User Role Catalog and Permissions Matrix (RBAC)\r\n\r\nThis section formally defines the roles authorized to access and operate the application, as well as the privileges assigned to each.\r\n\r\n### 2.1 Authorized Role Catalog\r\n\r\n| Role Identifier | Role Name | Associated Actor | Description & Responsibility | Enclave / Access Level |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **`ROLE_USER`** | Standard User | `ACT-ROLE-USER-001` | Data queries and nominal business flow execution. | Corporate Network / Web UI |\r\n| **`ROLE_OPERATOR`** | System Operator | `ACT-OPERATOR-002` | Streaming supervision, alert management, and command control. | DMZ Enclave / Operational Console |\r\n\r\n### 2.2 Access and Capabilities Matrix by Role\r\n\r\n| Application Capability / Module | `ROLE_USER` | `ROLE_OPERATOR` | Authentication Mode |\r\n| :--- | :---: | :---: | :--- |\r\n| Status Query and Dashboard Visualizations | \u2705 Allowed | \u2705 Allowed | Bearer Token (OIDC/JWT) |\r\n| Business Journey Execution (`JRN-JOURNEY-001`) | \u2705 Allowed | \u2705 Allowed | Bearer Token (OIDC/JWT) |\r\n| Real-Time Streaming and Operational Control | \u274C Denied | \u2705 Allowed | mTLS + Device X.509 Certificate |\r\n| Global Parameters Configuration & Connectivity | \u274C Denied | \u2705 Allowed | Administrator Credential |\r\n\r\n---\r\n\r\n## 3. Version and User Platform Compatibility Matrix\r\n\r\nThis section specifies cross-compatibility between the current application version and user environments, clients, and formats.\r\n\r\n### 3.1 Client-Server Compatibility (APIs and SDKs)\r\n\r\n| Application Version (Backend) | Compatible CLI Version | Compatible SDK Version | Compatibility Status | Migration Notes |\r\n| :---: | :---: | :---: | :---: | :--- |\r\n| **`v1.0.0`** (Current) | `>= v1.0.0` | `>= v1.0.0` | \u2705 Fully Supported | Active canonical version. |\r\n| **`v1.0.0`** (Current) | `v0.9.x` | `v0.9.x` | \u26A0\uFE0F Degraded Mode | Requires upgrade before next minor. |\r\n| **`v1.0.0`** (Current) | `< v0.9.0` | `< v0.9.0` | \u274C Incompatible / Deprecated | Legacy endpoints decommissioned. |\r\n\r\n### 3.2 Homologated Browsers and Client Platforms\r\n\r\n| Platform / Environment | Minimum Supported Versions | Support Level | Known Constraints |\r\n| :--- | :--- | :---: | :--- |\r\n| **Google Chrome / Chromium** | Version `>= 120` | Tier 1 (Official) | Optimal WebSockets and WebGL performance. |\r\n| **Mozilla Firefox** | Version `>= 115 ESR` | Tier 1 (Official) | Full client certificate support. |\r\n| **Safari / WebKit** | Version `>= 17.0` | Tier 2 (Functional) | Requires explicit mTLS enablement in macOS Keychain. |\r\n| **Terminal / CLI (Linux / macOS / Windows)** | Node.js `>= 18` or Bash `>= 5.0` | Tier 1 (Official) | Full support on PowerShell 7+ and bash. |\r\n\r\n### 3.3 Configuration Files and Data Formats Compatibility\r\n\r\n| Format / Artifact | Source Version Supported | Automatic Conversion | User Action Required |\r\n| :--- | :---: | :---: | :--- |\r\n| **`config.yaml`** | `v0.9.x` | \u2705 Yes | None. Application migrates deprecated keys on startup. |\r\n| **Export Profiles (`.json`)** | `v0.9.x` | \u2705 Yes | 100% backward compatible. |\r\n\r\n---\r\n\r\n## 4. Application Installation, Access, and Configuration\r\n\r\n### 4.1 Access Channels and Prerequisites\r\n\r\n- **Web Portal / UI**: Access URL (e.g., `https://app.system.internal`).\r\n- **Command Line (CLI)**: Executable binary or package (e.g., `npx system-cli` or `./system-client`).\r\n- **Supported Browsers or Platforms**: Chrome >= 120, Firefox >= 120, Linux/macOS/Windows terminal.\r\n\r\n### 4.2 Client Configuration and Environment Variables\r\n\r\nThe application allows parameterizing its behavior via environment variables or local configuration files:\r\n\r\n| Parameter / Variable | Type | Default Value | Required | Description |\r\n| :--- | :--- | :--- | :---: | :--- |\r\n| `API_ENDPOINT` | URL | `https://api.system.internal/v1` | Yes | Base backend API endpoint. |\r\n| `WS_STREAM_URL` | WSS URL | `wss://stream.system.internal/telemetry` | No | Real-time telemetry or notifications socket. |\r\n| `CLIENT_TIMEOUT_MS` | Integer | `5000` | No | Network response timeout in milliseconds. |\r\n| `AUTH_PROFILE` | String | `production` | No | Active authentication profile (`development`, `staging`, `production`). |\r\n\r\n### 4.3 Local Configuration File (`config.yaml` / `.env`)\r\n\r\nExample recommended configuration for operator workstations:\r\n\r\n```yaml\r\n# Client configuration file: config.yaml\r\nprofile: production\r\nnetwork:\r\n api_endpoint: "https://api.system.internal/v1"\r\n stream_url: "wss://stream.system.internal/telemetry"\r\n timeout_ms: 5000\r\n retry_attempts: 3\r\n\r\nsecurity:\r\n tls_verify: true\r\n client_cert_path: "/etc/pki/client/operator.crt"\r\n client_key_path: "/etc/pki/client/operator.key"\r\n\r\nui:\r\n theme: "dark"\r\n refresh_interval_sec: 1\r\n```\r\n\r\n---\r\n\r\n## 5. Step-by-Step Journey Execution Guide (`JRN-*`)\r\n\r\nEach subsection documents an end-to-end Journey, specifying authorized execution roles, starting conditions, and the step-by-step operating procedure.\r\n\r\n### 5.1 `JRN-JOURNEY-001`: User Journey Name\r\n\r\n- **Linked Use Case**: `UC-ACTION-001`\r\n- **Primary Actor**: `ACT-ROLE-USER-001`\r\n- **Authorized Roles**: `ROLE_USER`, `ROLE_OPERATOR`\r\n- **Required Execution Enclave**: Corporate Intranet or VPN access\r\n\r\n#### A. Preconditions\r\n1. User must have an active and authenticated session with their authorized role.\r\n2. The base entity or resource must be in `ACTIVE` state.\r\n\r\n#### B. Step-by-Step Procedure\r\n\r\n1. **Step 1: Operation Initiation**\r\n - **Action**: User navigates to the execution section or invokes the corresponding command:\r\n ```bash\r\n system-cli execute --journey JRN-JOURNEY-001 --input payload.json\r\n ```\r\n - **Required Input**: Resource identifier and validated parameters.\r\n - **Expected On-Screen Response**: System displays confirmation dialog with operation summary.\r\n\r\n2. **Step 2: Validation and Submission**\r\n - **Action**: User reviews parameters and confirms execution.\r\n - **System Behavior**: Client locally validates data schema and transmits signed request.\r\n\r\n3. **Step 3: Observable Outcome Verification**\r\n - **Success Outcome**: Console / interface displays success message `MSG-SUCCESS-001` with generated unique transaction ID.\r\n - **Final State**: Resource transitions to `PROCESSED` state.\r\n\r\n#### C. Alternative Flows and Exception Handling\r\n- **Unauthorized Access**: If an unauthorized role attempts to invoke the journey, the system blocks the action, outputs code `MSG-ERR-AUTH-403`, and records the access attempt in the audit trail.\r\n- **Connection Loss in Transit**: If connection is lost during step 2, client retries with exponential backoff up to 3 times before notifying user.\r\n\r\n---\r\n\r\n## 6. System Messages Catalog and Response Codes\r\n\r\nStructured matrix of key informational, warning, and error messages emitted by the application during its operational lifecycle:\r\n\r\n| Code | Severity | Literal Screen Message | Trigger / Context | Meaning for User | Recommended Corrective Action |\r\n| :--- | :--- | :--- | :--- | :--- | :--- |\r\n| **`MSG-SYS-100`** | `INFO` | `"Connection established successfully with server"` | Successful network handshake upon initializing session. | Application is online and ready to process commands. | None. Normal operation. |\r\n| **`MSG-SYS-200`** | `INFO` | `"Operation completed successfully. Transaction ID: [TX-ID]"` | Successful completion of a Journey or Use Case. | Transaction was persisted and acknowledged by backend. | Save `TX-ID` for tracking if required. |\r\n| **`MSG-WARN-301`** | `WARN` | `"High link latency (>500ms). Degraded mode active"` | Response metric exceeds real-time threshold. | Screen data may experience slight refresh delays. | Check network connection quality or bandwidth. |\r\n| **`MSG-WARN-302`** | `WARN` | `"Session expiring in 5 minutes"` | Authentication token approaching TTL expiry. | User will be logged out unless credential is refreshed. | Renew session by clicking alert or re-authenticating. |\r\n| **`MSG-ERR-401`** | `ERR-USER` | `"Invalid credentials or expired token. Access denied"` | Login authentication failure or expired token. | User identity could not be validated. | Re-enter credentials or request a new token. |\r\n| **`MSG-ERR-403`** | `ERR-USER` | `"Unauthorized action for assigned role [ROLE]"` | Attempted execution of Journey or command outside RBAC. | User role lacks permissions for this resource. | Contact administrator to request permission expansion. |\r\n| **`MSG-ERR-422`** | `ERR-USER` | `"Invalid payload: field [FIELD] does not match schema"` | Syntactic validation or business rule (`BR-*`) failure. | User-supplied data is invalid. | Correct indicated fields according to business rule. |\r\n| **`MSG-ERR-503`** | `ERR-SYS` | `"Service temporarily unavailable. Retrying..."` | Backend gateway unreachable or under scheduled maintenance. | Central server is not responding to requests. | Await automatic retries or check system status page. |\r\n\r\n---\r\n\r\n## 7. Frequently Asked Questions (FAQ) and Support\r\n\r\n- **What should I do if I lose connectivity while executing a Journey?** \r\n The application implements idempotency mechanisms. Once network connectivity is restored, verify resource status before retrying to prevent duplicate transactions.\r\n- **How do I request a user role change?** \r\n Contact the Security Administrator (`SecOps`) referencing your user ID and operational justification for the role change.\r\n\r\n---\r\n\r\n## 8. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-15 | Documentation & Product Team | Initial User Manual generation | CHG-009 |\r\n';
|
|
15750
15858
|
var STARTER_TEMPLATES_PRIVACY_DATA_ASSET_TEMPLATE_MD = '---\r\nid: DATA-ASSET-USER-PROFILE-001\r\ntype: data-asset\r\ntitle: User Profile & Identity Personal Data Asset\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nclassification: confidential-pii # public, internal, confidential-pii, special-category-sensitive\r\npii-categories:\r\n - identifiers\r\n - contact\r\ndata-subjects:\r\n - ACT-USER-001\r\nfields:\r\n - name: email\r\n sensitivity: pii\r\n masking-strategy: sha256-salt\r\n - name: phone_number\r\n sensitivity: pii\r\n masking-strategy: redact\r\n - name: operator_callsign\r\n sensitivity: internal\r\n masking-strategy: none\r\nretention-period: 365d\r\nerasure-method: crypto-shredding\r\nowner-bounded-context: CMP-IDENTITY-SERVICE-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# DATA-ASSET-USER-PROFILE-001: User Profile & Identity Personal Data Asset\r\n\r\n## 1. Data Asset Inventory & Purpose\r\nDescribes the structure, storage medium, and operational boundary of the personal data asset governed under GDPR / ISO 27701.\r\n\r\n## 2. Field-Level Sensitivity & Masking Policy\r\n\r\n| Field Name | Sensitivity | Masking / Pseudonymization Strategy | Allowed in Logs | Allowed in AI Prompts |\r\n| :--- | :--- | :--- | :---: | :---: |\r\n| `email` | `pii` | `sha256-salt` | \u274C No | \u274C No |\r\n| `phone_number` | `pii` | `redact` | \u274C No | \u274C No |\r\n| `operator_callsign` | `internal` | `none` | \u2705 Yes | \u2705 Yes |\r\n\r\n## 3. Storage Limitation & Right to Erasure (GDPR Art. 17)\r\n- **Maximum Retention TTL**: `365d` after account deactivation.\r\n- **Erasure Mechanism**: `crypto-shredding` (destruction of per-subject encryption key and PII column purge).\r\n\r\n---\r\n\r\n## 4. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial personal data asset inventory | CHG-PRIV-001 |\r\n';
|
|
15751
15859
|
var STARTER_TEMPLATES_PRIVACY_DPIA_REQUEST_TEMPLATE_MD = '---\r\nid: DPIA-ASSESSMENT-001\r\ntype: dpia-request\r\ntitle: Data Protection Impact Assessment (DPIA / EIPD) Request\r\nstatus: pending-dpo-approval # pending-dpo-approval, approved, rejected\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nropa-reference: PRIV-ROPA-USER-AUTH-001\r\ndata-assets:\r\n - DATA-ASSET-USER-PROFILE-001\r\nspecial-category-triggers:\r\n - "GDPR Art. 9 Special Category Data or Automated Profiling"\r\nresidual-risk-level: MEDIUM # LOW, MEDIUM, HIGH\r\n---\r\n\r\n# Data Protection Impact Assessment (DPIA / EIPD \u2014 GDPR Art. 35)\r\n\r\n## 1. Trigger & Necessity Assessment\r\n- **Associated ROPA**: `PRIV-ROPA-USER-AUTH-001`\r\n- **Data Assets Affected**: `DATA-ASSET-USER-PROFILE-001`\r\n- **Why a DPIA is Mandatory**: Processing involves `special_category_sensitive` data (biometrics, health, precise geolocation) or systematic automated profiling under GDPR Art. 35.\r\n\r\n## 2. Necessity, Proportionality & LINDDUN Risk Matrix\r\n\r\n| LINDDUN Threat Category | Identified Privacy Risk | Intrinsic Risk | Technical Mitigation (`PRIV-REQ-*`) | Residual Risk |\r\n| :--- | :--- | :---: | :--- | :---: |\r\n| **Identifiability** | Re-identification of operator from telemetry streams | HIGH | `PRIV-REQ-MASKING-001` (SHA-256 salted pseudonymization) | LOW |\r\n| **Disclosure of Information** | Plaintext PII leakage in error logs | HIGH | `PRIV-REQ-MASKING-001` (Redaction middleware) | LOW |\r\n\r\n## 3. Mandatory Human Sovereign Signatures (DPO & Legal)\r\n- [ ] **Data Protection Officer (DPO)**: Necessity, proportionality, and GDPR Art. 35 validation\r\n- [ ] **Legal / Privacy Counsel**: Lawful basis and cross-border transfer clauses verified\r\n- [ ] **Security Officer (CISO) / System Architect**: Cryptographic and enclave controls verified\r\n';
|
|
15752
15860
|
var STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD = '---\r\nid: PRIV-REQ-MASKING-001\r\ntype: privacy-requirement\r\ntitle: Mandatory Pseudonymization and Log Redaction of Operator PII\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nprivacy-principle: data-minimization # data-minimization, purpose-limitation, storage-limitation, accuracy, integrity-and-confidentiality, transparency-and-consent, data-subject-rights-arco, pseudonymization-anonymization\r\nlinddun-category: identifiability # linkability, identifiability, non-repudiation, detectability, disclosure-of-information, unawareness, non-compliance\r\ngoverns-ropa:\r\n - PRIV-ROPA-USER-AUTH-001\r\nprotects-data-assets:\r\n - DATA-ASSET-USER-PROFILE-001\r\nenforced-in-enclave: SEC-ENC-DMZ-001\r\ncompliance-references:\r\n - "GDPR-Art-25-Privacy-by-Design"\r\n - "GDPR-Art-32-Pseudonymization"\r\n - "ISO-27701-A.7.4"\r\nacceptance-format: gherkin\r\ncucumber-tags:\r\n - "@PRIV-REQ-MASKING-001"\r\n - "@privacy"\r\n - "@linddun"\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# PRIV-REQ-MASKING-001: Mandatory Pseudonymization and Log Redaction of Operator PII\r\n\r\n## 1. Technical Privacy Control Statement\r\nThe system MUST pseudonymize or redact all `confidential-pii` fields (`email`, `phone_number`) prior to emitting structured application logs, telemetry traces, or external AI prompts, and MUST enforce automated TTL purge after `365d`.\r\n\r\n---\r\n\r\n## 2. Upstream Privacy Traceability (PDaC)\r\n\r\n| Dimension | Link / Artifact | Relationship Type | Status |\r\n| :--- | :--- | :--- | :--- |\r\n| **Record of Processing (ROPA)** | `PRIV-ROPA-USER-AUTH-001` | Governs Processing Activity | Validated |\r\n| **Protected Data Asset** | `DATA-ASSET-USER-PROFILE-001` | Enforces Field Masking & TTL | Validated |\r\n\r\n---\r\n\r\n## 3. Privacy Verification Criteria in Gherkin Format (Cucumber Privacy Tests)\r\n\r\n```gherkin\r\n@PRIV-REQ-MASKING-001 @privacy @linddun\r\nFeature: Personal Data Pseudonymization and Zero-PII Telemetry Logging\r\n As a Data Protection Officer (DPO)\r\n I want all personal identifiers to be redacted or salted-hashed before logging\r\n So that application logs and telemetry never expose raw personal data\r\n\r\n Scenario: Structured logger redacts PII fields automatically (Nominal Privacy Control)\r\n Given an authenticated operator session with email "operator@example.com" and phone "+34600112233"\r\n When the telemetry ingestion service emits an audit log entry\r\n Then the serialized log payload must not contain the literal string "operator@example.com"\r\n And the serialized log payload must not contain the literal string "+34600112233"\r\n And the email field must be replaced by a deterministic SHA-256 salted pseudonym\r\n\r\n Scenario: Right to erasure purges expired or revoked subject records\r\n Given a personal data record for subject "ACT-USER-001" exceeding the "365d" retention TTL\r\n When the automated retention enforcement job executes\r\n Then the personal data fields must be irreversibly erased via crypto-shredding\r\n```\r\n\r\n---\r\n\r\n## 4. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial privacy control specification | CHG-PRIV-001 |\r\n';
|
|
15753
15861
|
var STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD = '---\r\nid: PRIV-ROPA-USER-AUTH-001\r\ntype: privacy-ropa\r\ntitle: Record of Processing Activity for Operator Authentication and Session Audit\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nlawful-basis: contract # consent, contract, legal-obligation, vital-interests, public-task, legitimate-interests\r\nspecial-category-condition: null\r\nprocessing-purpose: "Authenticate authorized operators and maintain tamper-evident operational session audit trails."\r\nuse-cases:\r\n - UC-ACTION-001\r\ndata-assets:\r\n - DATA-ASSET-USER-PROFILE-001\r\ndata-subjects:\r\n - ACT-USER-001\r\nretention-ttl: 365d\r\ncross-border-transfer: false\r\ntransfer-safeguards: null\r\nsubprocessors: []\r\ndpia-required: false\r\ndpia-reference: null\r\nmitigated-by:\r\n - PRIV-REQ-MASKING-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# PRIV-ROPA-USER-AUTH-001: Record of Processing Activity (GDPR Art. 30)\r\n\r\n## 1. Processing Activity Summary & Lawful Basis\r\n- **Lawful Basis (GDPR Art. 6.1)**: `contract` \u2014 Necessary for the performance of the operator service agreement.\r\n- **Purpose of Processing**: Authenticate authorized operators and maintain tamper-evident operational session audit trails.\r\n\r\n## 2. Linked Product & Data Artifacts\r\n\r\n| Dimension | Artifact ID | Relationship |\r\n| :--- | :--- | :--- |\r\n| **Triggering Use Cases** | `UC-ACTION-001` | Initiates personal data collection/processing |\r\n| **Data Assets Processed** | `DATA-ASSET-USER-PROFILE-001` | Personal data fields subject to minimization |\r\n| **Data Subjects** | `ACT-USER-001` | Natural persons whose data is processed |\r\n| **Governing Privacy Controls** | `PRIV-REQ-MASKING-001` | Technical privacy-by-design controls |\r\n\r\n## 3. International Transfers & Subprocessors\r\n- **Cross-Border Transfer Outside EEA**: `false`\r\n- **Authorized Subprocessors**: None (In-house processing within `SEC-ENC-DMZ-001`).\r\n\r\n---\r\n\r\n## 4. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-10-17 | Privacy Officer (`agent-privacy-officer`) | Initial GDPR Art. 30 ROPA entry | CHG-PRIV-001 |\r\n';
|
|
15754
15862
|
var STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD = '---\r\nid: ACT-NAME-001\r\ntype: actor\r\ntitle: Descriptive Actor Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nrole-type: human-user # human-user, ai-agent, external-system, sensor-iot\r\ndescription: One-sentence summary of the role this actor performs in the system.\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# ACT-NAME-001: Descriptive Actor Title\r\n\r\n## 1. Profile and Responsibility\r\nDescribes who this actor is, their operational context, and what goals they pursue when interacting with the product.\r\n\r\n## 2. System Touchpoints\r\n- Interaction channels (Web UI, REST API, WebSocket, Messaging).\r\n- Privilege level and latency/availability expectations.\r\n\r\n---\r\n\r\n## 3. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-03 | Product Owner / Analyst | Initial actor profile creation | CHG-INIT-001 |\r\n';
|
|
15755
|
-
var STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD = '---\nid: BC-NAME-001\ntype: bounded-context\ntitle: "Bounded Context Name"\nstatus: draft\nversion: "1.0.0"\nschema-version: "1.0"\ndomain-type: core\nstrategic-classification:\n evolutionary-stage: custom-built\n business-model-role: differentiator\nresponsibilities:\n - "Primary domain capability or boundary responsibility"\nubiquitous-language-terms:\n - TERM-NAME-001\ncontext-mapping:\n upstream-dependencies: []\n downstream-dependents: []\n integration-patterns:\n - pattern: Open Host Service / Published Language\n related-context: BC-ANOTHER-001\ncomponents-involved:\n - CMP-NAME-001\nsupersedes: null\nsuperseded-by: null\n---\n\n# BC-NAME-001: Bounded Context Name\n\n## 1. Context Purpose and Scope\nExecutive summary and clear linguistic boundary defining what is inside vs. outside this Bounded Context according to Domain-Driven Design (DDD).\n\n### 1.1 Strategic Domain Classification\n- **Domain Type**: `core` (Core Domain / Supporting Subdomain / Generic Subdomain)\n- **Evolutionary Stage**: `custom-built` (Genesis / Custom-Built / Product / Commodity - Wardley Mapping)\n- **Business Role**: Key differentiator creating competitive advantage for the product.\n\n---\n\n## 2. Ubiquitous Language & Domain Invariants\n- **Core Entities & Aggregates**: High-level domain concepts encapsulated within this boundary.\n- **Glossary References**:\n - `TERM-NAME-001`: Primary ubiquitous term definition.\n- **Domain Invariants**: Critical business rules (`BR-*`) enforced exclusively within this boundary.\n\n---\n\n## 3. Context Mapping & Integration Relationships\nRelationships with adjacent Bounded Contexts:\n- **Upstream Contexts**: Contexts providing domain events, APIs, or contracts.\n- **Downstream Contexts**: Contexts consuming models from this boundary.\n- **Anti-Corruption Layers (ACL)**: Translations safeguarding ubiquitous language from external contamination.\n\n---\n\n## 4. Architecture Mapping\n- **Physical Components (`CMP-*`)**: Components implementing aggregates, services, or adapters within this context.\n- **Security Enclaves (`SEC-ENC-*`)**: Execution boundary or isolation tier.\n\n---\n\n## 5. Revision History\n\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\n| :--- | :--- | :--- | :--- | :--- |\n| **1.0.0** | YYYY-MM-DD | Product Analyst / Architect | Initial Bounded Context definition | CHG-INIT-001 |\n';
|
|
15863
|
+
var STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD = '---\r\nid: BC-NAME-001\r\ntype: bounded-context\r\ntitle: "Bounded Context Name"\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\ndomain-type: core\r\nstrategic-classification:\r\n evolutionary-stage: custom-built\r\n business-model-role: differentiator\r\nresponsibilities:\r\n - "Primary domain capability or boundary responsibility"\r\nubiquitous-language-terms:\r\n - TERM-NAME-001\r\ncontext-mapping:\r\n upstream-dependencies: []\r\n downstream-dependents: []\r\n integration-patterns:\r\n - pattern: Open Host Service / Published Language\r\n related-context: BC-ANOTHER-001\r\ncomponents-involved:\r\n - CMP-NAME-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# BC-NAME-001: Bounded Context Name\r\n\r\n## 1. Context Purpose and Scope\r\nExecutive summary and clear linguistic boundary defining what is inside vs. outside this Bounded Context according to Domain-Driven Design (DDD).\r\n\r\n### 1.1 Strategic Domain Classification\r\n- **Domain Type**: `core` (Core Domain / Supporting Subdomain / Generic Subdomain)\r\n- **Evolutionary Stage**: `custom-built` (Genesis / Custom-Built / Product / Commodity - Wardley Mapping)\r\n- **Business Role**: Key differentiator creating competitive advantage for the product.\r\n\r\n---\r\n\r\n## 2. Ubiquitous Language & Domain Invariants\r\n- **Core Entities & Aggregates**: High-level domain concepts encapsulated within this boundary.\r\n- **Glossary References**:\r\n - `TERM-NAME-001`: Primary ubiquitous term definition.\r\n- **Domain Invariants**: Critical business rules (`BR-*`) enforced exclusively within this boundary.\r\n\r\n---\r\n\r\n## 3. Context Mapping & Integration Relationships\r\nRelationships with adjacent Bounded Contexts:\r\n- **Upstream Contexts**: Contexts providing domain events, APIs, or contracts.\r\n- **Downstream Contexts**: Contexts consuming models from this boundary.\r\n- **Anti-Corruption Layers (ACL)**: Translations safeguarding ubiquitous language from external contamination.\r\n\r\n---\r\n\r\n## 4. Architecture Mapping\r\n- **Physical Components (`CMP-*`)**: Components implementing aggregates, services, or adapters within this context.\r\n- **Security Enclaves (`SEC-ENC-*`)**: Execution boundary or isolation tier.\r\n\r\n---\r\n\r\n## 5. Revision History\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | YYYY-MM-DD | Product Analyst / Architect | Initial Bounded Context definition | CHG-INIT-001 |\r\n';
|
|
15756
15864
|
var STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD = '---\r\nid: BR-DOMAIN-001\r\ntype: business-rule\r\ntitle: Business Rule Name\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\nenforcement-level: strict-invariant # strict-invariant, override-with-approval, guideline\r\ndefined-in: BC-CONTEXT-001\r\nuses-terms:\r\n - TERM-TERM-001\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# BR-DOMAIN-001: Business Rule Name\r\n\r\n## 1. Rule Definition\r\nFormally establishes the business invariant that must not be violated under any circumstance.\r\n\r\n## 2. Business Rationale and Consequences\r\n- **Why it exists**: Economic, regulatory, or technical justification for the constraint.\r\n- **Action upon violation**: Immediate transaction rejection with a formal error code.\r\n\r\n---\r\n\r\n## 3. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-03 | Product Owner / Analyst | Initial business rule definition | CHG-INIT-001 |\r\n';
|
|
15757
15865
|
var STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD = '---\r\nid: JRN-NAME-001\r\ntype: journey\r\ntitle: Descriptive User or Operator Journey Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\npersona: ACT-OPERATOR-001\r\nstages:\r\n - "Discovery and Planning"\r\n - "Configuration and Pre-flight"\r\n - "Mission Execution"\r\n - "Post-Analysis and Wrap-up"\r\ntouchpoints:\r\n - "Mission planning web portal"\r\n - "Ground control station (GCS)"\r\n - "Real-time telemetry dashboard"\r\n - "Flight report exporter"\r\nrelated-use-cases:\r\n - UC-PLAN-MISSION-001\r\n - UC-MONITOR-FLIGHT-001\r\npain-points:\r\n - "Latency when loading offline navigation maps"\r\n - "Complexity in manual flight plan reconciliation"\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# JRN-NAME-001: Descriptive User or Operator Journey Title\r\n\r\n## 1. Actor / Primary Persona Profile\r\n- **Protagonist Actor**: `ACT-OPERATOR-001`\r\n- **Main Goal**: Complete operational workflow with high efficiency, safety, and real-time visibility.\r\n\r\n---\r\n\r\n## 2. Journey Stages Map\r\n\r\n| Stage | User Goal | Touchpoints | Frictions / Pain Points |\r\n| :--- | :--- | :--- | :--- |\r\n| **1. Discovery and Planning** | Design route and validate operational constraints | Mission planning web portal | Complexity in manual flight plan reconciliation |\r\n| **2. Configuration and Pre-flight** | Verify subsystem health and link integrity | Ground control station (GCS) | Latency when loading offline navigation maps |\r\n| **3. Mission Execution** | Supervise telemetry and respond to alerts | Real-time telemetry dashboard | None detected in nominal flow |\r\n| **4. Post-Analysis and Wrap-up** | Export mission logs and performance metrics | Flight report exporter | Telemetry consolidation latency |\r\n\r\n---\r\n\r\n## 3. Traceability to Use Cases and Product\r\n\r\n- `UC-PLAN-MISSION-001`: Planning and validation of safe corridors.\r\n- `UC-MONITOR-FLIGHT-001`: Ingestion and visualization of real-time telemetry.\r\n\r\n---\r\n\r\n## 4. Revision History\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-23 | Product Manager / UX Lead | Initial operator journey definition | CHG-INIT-001 |\r\n';
|
|
15758
15866
|
var STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD = '---\r\n# Valid prefixes: FR- (Functional), QR- (Quality), CON- (Constraint)\r\nid: FR-FEATURE-001\r\ntype: requirement\r\ntitle: Concise Requirement Title\r\nstatus: draft\r\nversion: "1.0.0"\r\nschema-version: "1.0"\r\ncategory: functional # functional, quality, constraint\r\n\r\n# 1. PRODUCT TRACEABILITY (Upstream)\r\nderives-from:\r\n - UC-ACTION-001\r\n\r\n# 2. METHOD AND ACCEPTANCE CRITERIA\r\nverifiable-by: cucumber-bdd # cucumber-bdd, automated-unit-test, integration-test, performance-benchmark\r\nacceptance-format: gherkin # gherkin, declarative-prose\r\ncucumber-tags:\r\n - "@FR-FEATURE-001"\r\n - "@automated"\r\n - "@regression"\r\n\r\nsupersedes: null\r\nsuperseded-by: null\r\n---\r\n\r\n# FR-FEATURE-001: Concise Requirement Title\r\n\r\n## 1. Normative Statement\r\nThe system MUST [unambiguous and atomic description of expected behavior under specific conditions].\r\n\r\n---\r\n\r\n## 2. Upstream Traceability\r\n\r\n| Dimension | Link / Artifact | Relationship Type | Status |\r\n| :--- | :--- | :--- | :--- |\r\n| **Product (Upstream)** | `UC-ACTION-001` | Derived from Use Case | Validated |\r\n\r\n> *Note: Traceability toward Architecture and Testing is maintained inversely; services declare `satisfies-requirements` and test suites tag or reference this requirement.*\r\n\r\n---\r\n\r\n## 3. Acceptance Criteria in Gherkin (Cucumber) Format\r\n\r\n```gherkin\r\n@FR-FEATURE-001 @automated @regression\r\nFeature: Concise Requirement Title\r\n As a [primary actor / user role]\r\n I want [functional system capability]\r\n So that [obtain expected business benefit or value]\r\n\r\n Background:\r\n Given the system is in operational state\r\n And the actor is authenticated with valid permissions\r\n\r\n Scenario: Successful nominal flow\r\n Given the system has initial precondition configured\r\n When the actor submits a request with valid parameters\r\n Then the system processes the operation successfully\r\n And the resource status updates to "ACTIVE"\r\n And the corresponding domain event is emitted\r\n\r\n Scenario Outline: Business rule validation and edge cases\r\n Given data input with value "<input>"\r\n When requirement validation is processed\r\n Then the response must return status code "<status_code>"\r\n And the descriptive message must be "<message>"\r\n\r\n Examples:\r\n | input | status_code | message |\r\n | correct_value | 200 | SUCCESSFUL_OPERATION |\r\n | invalid_value | 400 | ERROR_INVALID_PARAMETER |\r\n | limit_exceeded | 422 | ERROR_LIMIT_EXCEEDED |\r\n```\r\n\r\n---\r\n\r\n## 4. Revision History and Version Control\r\n\r\n| Version | Date | Author / Agent | Change Description | Change Reference (Change/PR) |\r\n| :--- | :--- | :--- | :--- | :--- |\r\n| **1.0.0** | 2026-09-03 | Product Owner / QA | Initial specification with complete 360\xB0 traceability | CHG-INIT-001 |\r\n';
|
|
@@ -16280,7 +16388,7 @@ jobs:
|
|
|
16280
16388
|
runs-on: ubuntu-latest
|
|
16281
16389
|
strategy:
|
|
16282
16390
|
matrix:
|
|
16283
|
-
node-version: [
|
|
16391
|
+
node-version: [ 20.x, 22.x ]
|
|
16284
16392
|
|
|
16285
16393
|
steps:
|
|
16286
16394
|
- name: Checkout Code
|
|
@@ -16542,11 +16650,7 @@ function appendAntigravityFiles(dirs, files) {
|
|
|
16542
16650
|
files.push({ relPath: ".agent/rules/ai-sdlc.md", content: STARTER_ANTIGRAVITY_RULES });
|
|
16543
16651
|
for (const agent of SPECIALIZED_AGENT_TEMPLATES) {
|
|
16544
16652
|
const content = renderAntigravityAgentFile(agent);
|
|
16545
|
-
|
|
16546
|
-
files.push(
|
|
16547
|
-
{ relPath: `.agent/agents/${agent.id}.md`, content },
|
|
16548
|
-
{ relPath: `.agent/skills/${agent.id}/SKILL.md`, content }
|
|
16549
|
-
);
|
|
16653
|
+
files.push({ relPath: `.agent/agents/${agent.id}.md`, content });
|
|
16550
16654
|
}
|
|
16551
16655
|
for (const skill of LIFECYCLE_SKILL_TEMPLATES) {
|
|
16552
16656
|
dirs.push(`.agent/skills/${skill.id}`);
|
|
@@ -16614,24 +16718,32 @@ function collectAgentFiles(targets) {
|
|
|
16614
16718
|
appendMcpFiles(dirs, files);
|
|
16615
16719
|
return { dirs, files };
|
|
16616
16720
|
}
|
|
16617
|
-
function
|
|
16618
|
-
const
|
|
16721
|
+
function writeSingleFile(fullFilePath, content, relPath, opts, results) {
|
|
16722
|
+
const exists = fs8.existsSync(fullFilePath);
|
|
16723
|
+
if (opts.dryRun) {
|
|
16724
|
+
if (exists && opts.force) results.filesUpdated.push(relPath);
|
|
16725
|
+
else if (!exists) results.filesCreated.push(relPath);
|
|
16726
|
+
return;
|
|
16727
|
+
}
|
|
16728
|
+
const parentDir = path5.dirname(fullFilePath);
|
|
16729
|
+
if (!fs8.existsSync(parentDir)) {
|
|
16730
|
+
fs8.mkdirSync(parentDir, { recursive: true });
|
|
16731
|
+
}
|
|
16732
|
+
if (!exists) {
|
|
16733
|
+
fs8.writeFileSync(fullFilePath, content, "utf-8");
|
|
16734
|
+
results.filesCreated.push(relPath);
|
|
16735
|
+
} else if (opts.force) {
|
|
16736
|
+
fs8.writeFileSync(fullFilePath, content, "utf-8");
|
|
16737
|
+
results.filesUpdated.push(relPath);
|
|
16738
|
+
}
|
|
16739
|
+
}
|
|
16740
|
+
function writeProjectFiles(destDir, files, dryRun, force) {
|
|
16741
|
+
const results = { filesCreated: [], filesUpdated: [] };
|
|
16619
16742
|
for (const f of files) {
|
|
16620
16743
|
const fullFilePath = path5.join(destDir, f.relPath);
|
|
16621
|
-
|
|
16622
|
-
if (!dryRun) {
|
|
16623
|
-
if (!fs8.existsSync(parentDir)) {
|
|
16624
|
-
fs8.mkdirSync(parentDir, { recursive: true });
|
|
16625
|
-
}
|
|
16626
|
-
if (!fs8.existsSync(fullFilePath)) {
|
|
16627
|
-
fs8.writeFileSync(fullFilePath, f.content, "utf-8");
|
|
16628
|
-
filesCreated.push(f.relPath);
|
|
16629
|
-
}
|
|
16630
|
-
} else {
|
|
16631
|
-
filesCreated.push(f.relPath);
|
|
16632
|
-
}
|
|
16744
|
+
writeSingleFile(fullFilePath, f.content, f.relPath, { dryRun, force }, results);
|
|
16633
16745
|
}
|
|
16634
|
-
return
|
|
16746
|
+
return results;
|
|
16635
16747
|
}
|
|
16636
16748
|
function validateCiProvider(ci) {
|
|
16637
16749
|
if (!ci) return { valid: true };
|
|
@@ -16786,6 +16898,7 @@ function buildInitError(targetDir, error) {
|
|
|
16786
16898
|
targetDir,
|
|
16787
16899
|
directoriesCreated: [],
|
|
16788
16900
|
filesCreated: [],
|
|
16901
|
+
filesUpdated: [],
|
|
16789
16902
|
agentsConfigured: [],
|
|
16790
16903
|
gitHookInstalled: false,
|
|
16791
16904
|
error
|
|
@@ -16798,12 +16911,13 @@ function mergeDirectories(base, extra) {
|
|
|
16798
16911
|
}
|
|
16799
16912
|
return result;
|
|
16800
16913
|
}
|
|
16801
|
-
function buildInitSuccessResult(destDir, directoriesCreated, filesCreated, ciProvider, agentsConfigured, architectureGranularity, gitHookInstalled) {
|
|
16914
|
+
function buildInitSuccessResult(destDir, directoriesCreated, filesCreated, filesUpdated, ciProvider, agentsConfigured, architectureGranularity, gitHookInstalled) {
|
|
16802
16915
|
return {
|
|
16803
16916
|
success: true,
|
|
16804
16917
|
targetDir: destDir,
|
|
16805
16918
|
directoriesCreated,
|
|
16806
16919
|
filesCreated,
|
|
16920
|
+
filesUpdated,
|
|
16807
16921
|
ciProvider,
|
|
16808
16922
|
agentsConfigured,
|
|
16809
16923
|
architectureGranularity,
|
|
@@ -16817,24 +16931,32 @@ function validateInitOptions(options) {
|
|
|
16817
16931
|
if (!archRes.valid) return { valid: false, archGranularity: "minimal", error: archRes.error };
|
|
16818
16932
|
return { valid: true, ciProvider: ciRes.provider, archGranularity: archRes.granularity };
|
|
16819
16933
|
}
|
|
16934
|
+
function assembleScaffoldingPlan(ciProvider, agents, archGranularity) {
|
|
16935
|
+
const agentTargets = resolveAgentTargets(agents);
|
|
16936
|
+
const { dirs: agentDirs, files: agentFiles } = collectAgentFiles(agentTargets);
|
|
16937
|
+
const directories = mergeDirectories(getBaseDirectories(ciProvider), agentDirs);
|
|
16938
|
+
const starterFiles = collectStarterFiles(ciProvider, agentFiles, archGranularity);
|
|
16939
|
+
return { agentTargets, directories, starterFiles };
|
|
16940
|
+
}
|
|
16820
16941
|
function initProject(options = {}) {
|
|
16821
|
-
const
|
|
16822
|
-
const destDir = path5.resolve(baseDir, options.targetDir || ".");
|
|
16942
|
+
const destDir = path5.resolve(options.rootDir || process.cwd(), options.targetDir || ".");
|
|
16823
16943
|
const validated = validateInitOptions(options);
|
|
16824
16944
|
if (!validated.valid) return buildInitError(destDir, validated.error);
|
|
16825
|
-
const agentTargets =
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
const
|
|
16945
|
+
const { agentTargets, directories, starterFiles } = assembleScaffoldingPlan(
|
|
16946
|
+
validated.ciProvider,
|
|
16947
|
+
options.agents,
|
|
16948
|
+
validated.archGranularity
|
|
16949
|
+
);
|
|
16950
|
+
const dirsCreated = createDirectoriesOnDisk(destDir, directories, options.dryRun);
|
|
16951
|
+
const { filesCreated, filesUpdated } = writeProjectFiles(destDir, starterFiles, options.dryRun, options.force);
|
|
16831
16952
|
if (updateConsumerPackageJson(destDir, options.dryRun)) {
|
|
16832
16953
|
filesCreated.push("package.json");
|
|
16833
16954
|
}
|
|
16834
16955
|
return buildInitSuccessResult(
|
|
16835
16956
|
destDir,
|
|
16836
|
-
|
|
16957
|
+
dirsCreated,
|
|
16837
16958
|
filesCreated,
|
|
16959
|
+
filesUpdated,
|
|
16838
16960
|
validated.ciProvider,
|
|
16839
16961
|
formatAgentsConfigured(agentTargets),
|
|
16840
16962
|
validated.archGranularity,
|
|
@@ -16986,7 +17108,469 @@ function sanitizeDlpPayload(payload, policy = createDefaultDlpPolicy()) {
|
|
|
16986
17108
|
return payload;
|
|
16987
17109
|
}
|
|
16988
17110
|
}
|
|
17111
|
+
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;
|
|
17112
|
+
function parseTasksFromDir(changeDirPath, rootDir) {
|
|
17113
|
+
const tasksPath = path5.join(changeDirPath, "tasks.md");
|
|
17114
|
+
if (!fs8.existsSync(tasksPath)) return [];
|
|
17115
|
+
try {
|
|
17116
|
+
const raw = fs8.readFileSync(tasksPath, "utf-8");
|
|
17117
|
+
const { frontmatter } = parseTasksDoc(raw);
|
|
17118
|
+
const changeId = typeof frontmatter["change-id"] === "string" ? frontmatter["change-id"] : path5.basename(changeDirPath);
|
|
17119
|
+
const list = [];
|
|
17120
|
+
if (Array.isArray(frontmatter.tasks)) {
|
|
17121
|
+
const relPath = path5.relative(rootDir, tasksPath).replace(/\\/g, "/");
|
|
17122
|
+
for (const t of frontmatter.tasks) {
|
|
17123
|
+
list.push({ task: t, changeId, tasksFilePath: relPath });
|
|
17124
|
+
}
|
|
17125
|
+
}
|
|
17126
|
+
return list;
|
|
17127
|
+
} catch {
|
|
17128
|
+
return [];
|
|
17129
|
+
}
|
|
17130
|
+
}
|
|
17131
|
+
function scanTasksInBaseDir(baseDir, rootDir) {
|
|
17132
|
+
if (!fs8.existsSync(baseDir)) return [];
|
|
17133
|
+
const acc = [];
|
|
17134
|
+
try {
|
|
17135
|
+
const entries = fs8.readdirSync(baseDir, { withFileTypes: true });
|
|
17136
|
+
for (const e of entries) {
|
|
17137
|
+
if (e.isDirectory()) {
|
|
17138
|
+
acc.push(...parseTasksFromDir(path5.join(baseDir, e.name), rootDir));
|
|
17139
|
+
}
|
|
17140
|
+
}
|
|
17141
|
+
} catch {
|
|
17142
|
+
}
|
|
17143
|
+
return acc;
|
|
17144
|
+
}
|
|
17145
|
+
function scanAllTasks(rootDir) {
|
|
17146
|
+
const activeDir = path5.join(rootDir, "specs", "changes", "active");
|
|
17147
|
+
const completedDir = path5.join(rootDir, "specs", "changes", "completed");
|
|
17148
|
+
return [
|
|
17149
|
+
...scanTasksInBaseDir(activeDir, rootDir),
|
|
17150
|
+
...scanTasksInBaseDir(completedDir, rootDir)
|
|
17151
|
+
];
|
|
17152
|
+
}
|
|
17153
|
+
function isSkippableLine(trimmed) {
|
|
17154
|
+
return trimmed.startsWith("#") || trimmed.startsWith("---") || trimmed.startsWith("|") || trimmed.startsWith("```");
|
|
17155
|
+
}
|
|
17156
|
+
function collectTextParagraphs(body) {
|
|
17157
|
+
const lines = body.split(/\r?\n/);
|
|
17158
|
+
const paragraphs = [];
|
|
17159
|
+
let current = [];
|
|
17160
|
+
for (const line of lines) {
|
|
17161
|
+
const trimmed = line.trim();
|
|
17162
|
+
if (isSkippableLine(trimmed) || !trimmed) {
|
|
17163
|
+
if (current.length > 0) {
|
|
17164
|
+
paragraphs.push(current.join(" "));
|
|
17165
|
+
current = [];
|
|
17166
|
+
}
|
|
17167
|
+
continue;
|
|
17168
|
+
}
|
|
17169
|
+
current.push(trimmed);
|
|
17170
|
+
}
|
|
17171
|
+
if (current.length > 0) {
|
|
17172
|
+
paragraphs.push(current.join(" "));
|
|
17173
|
+
}
|
|
17174
|
+
return paragraphs;
|
|
17175
|
+
}
|
|
17176
|
+
function extractTechnicalSummary(body, fallbackTitle) {
|
|
17177
|
+
if (!body || !body.trim()) {
|
|
17178
|
+
return fallbackTitle ? `Elemento ${fallbackTitle}.` : "Sin descripci\xF3n detallada.";
|
|
17179
|
+
}
|
|
17180
|
+
const paras = collectTextParagraphs(body);
|
|
17181
|
+
const firstGood = paras.find((p) => p.length > 20 && !p.startsWith(">"));
|
|
17182
|
+
if (firstGood) {
|
|
17183
|
+
return firstGood.length > 350 ? firstGood.substring(0, 347) + "..." : firstGood;
|
|
17184
|
+
}
|
|
17185
|
+
return paras[0] || fallbackTitle || "Sin resumen disponible.";
|
|
17186
|
+
}
|
|
17187
|
+
function resolveCitationType(cit) {
|
|
17188
|
+
if (cit.startsWith("CMP-")) return "component";
|
|
17189
|
+
if (cit.startsWith("FR-") || cit.startsWith("QR-")) return "requirement";
|
|
17190
|
+
if (cit.startsWith("SEC-REQ-")) return "security-requirement";
|
|
17191
|
+
if (cit.startsWith("PRIV-REQ-")) return "privacy-requirement";
|
|
17192
|
+
if (cit.startsWith("UC-")) return "use-case";
|
|
17193
|
+
if (cit.startsWith("ADR-")) return "adr";
|
|
17194
|
+
return "artifact";
|
|
17195
|
+
}
|
|
17196
|
+
function buildCitationRelations(citations) {
|
|
17197
|
+
return citations.map((cit) => ({
|
|
17198
|
+
id: cit,
|
|
17199
|
+
type: resolveCitationType(cit),
|
|
17200
|
+
direction: "upstream",
|
|
17201
|
+
relation: cit.startsWith("CMP-") ? "implements" : "satisfies"
|
|
17202
|
+
}));
|
|
17203
|
+
}
|
|
17204
|
+
function findTasksForCitations(citations, allTasks) {
|
|
17205
|
+
const relations = [];
|
|
17206
|
+
for (const dt of allTasks) {
|
|
17207
|
+
const t = dt.task;
|
|
17208
|
+
const matchesReq = t.satisfiesRequirements?.some((r) => citations.includes(r));
|
|
17209
|
+
const matchesCmp = t.implementsComponents?.some((c) => citations.includes(c));
|
|
17210
|
+
if (matchesReq || matchesCmp) {
|
|
17211
|
+
relations.push({
|
|
17212
|
+
id: `${t.id} (${dt.changeId})`,
|
|
17213
|
+
type: "task",
|
|
17214
|
+
direction: "upstream",
|
|
17215
|
+
relation: "developed-by-task",
|
|
17216
|
+
title: t.title,
|
|
17217
|
+
filePath: dt.tasksFilePath
|
|
17218
|
+
});
|
|
17219
|
+
}
|
|
17220
|
+
}
|
|
17221
|
+
return relations;
|
|
17222
|
+
}
|
|
17223
|
+
function isTestNode(e) {
|
|
17224
|
+
if (e.group !== "nodes") return false;
|
|
17225
|
+
const d = e.data;
|
|
17226
|
+
return d.layer === "test" || d.type === "bdd-feature" || d.type === "code-test";
|
|
17227
|
+
}
|
|
17228
|
+
function findTestNodesForCitations(citations, graphElements) {
|
|
17229
|
+
const downstream = [];
|
|
17230
|
+
const testNodes = graphElements.filter(isTestNode).map((e) => e.data);
|
|
17231
|
+
for (const tn of testNodes) {
|
|
17232
|
+
const isMatched = citations.some((c) => tn.content?.includes(c) || tn.title?.includes(c) || tn.id?.includes(c));
|
|
17233
|
+
if (isMatched) {
|
|
17234
|
+
downstream.push({
|
|
17235
|
+
id: tn.label || tn.id,
|
|
17236
|
+
type: tn.type || "test",
|
|
17237
|
+
direction: "downstream",
|
|
17238
|
+
relation: "verified-by",
|
|
17239
|
+
title: tn.title,
|
|
17240
|
+
filePath: tn.filePath
|
|
17241
|
+
});
|
|
17242
|
+
}
|
|
17243
|
+
}
|
|
17244
|
+
return downstream;
|
|
17245
|
+
}
|
|
17246
|
+
function extractKeySymbols(content) {
|
|
17247
|
+
const fns = Array.from(content.matchAll(/export\s+(?:async\s+)?function\s+([a-zA-Z0-9_]+)/g)).map((m) => m[1]);
|
|
17248
|
+
const cls = Array.from(content.matchAll(/export\s+class\s+([a-zA-Z0-9_]+)/g)).map((m) => m[1]);
|
|
17249
|
+
const cst = Array.from(content.matchAll(/export\s+const\s+([a-zA-Z0-9_]+)/g)).map((m) => m[1]);
|
|
17250
|
+
return [...fns, ...cls, ...cst].slice(0, 6);
|
|
17251
|
+
}
|
|
17252
|
+
function buildSourceSummary(ext, loc, symbols, citations) {
|
|
17253
|
+
const parts = [
|
|
17254
|
+
`M\xF3dulo de c\xF3digo fuente (${ext || "c\xF3digo"}).`,
|
|
17255
|
+
`Tama\xF1o: ${loc} l\xEDneas de c\xF3digo.`
|
|
17256
|
+
];
|
|
17257
|
+
if (symbols.length > 0) parts.push(`S\xEDmbolos clave: ${symbols.join(", ")}.`);
|
|
17258
|
+
if (citations.length > 0) parts.push(`Trazabilidad: ${citations.join(", ")}.`);
|
|
17259
|
+
return parts.join(" ");
|
|
17260
|
+
}
|
|
17261
|
+
function deduplicateRelations(items) {
|
|
17262
|
+
const map = /* @__PURE__ */ new Map();
|
|
17263
|
+
for (const item of items) {
|
|
17264
|
+
map.set(item.id, item);
|
|
17265
|
+
}
|
|
17266
|
+
return Array.from(map.values());
|
|
17267
|
+
}
|
|
17268
|
+
function buildSourceInspectResult(relPath, summary, upstream, downstream, content, metrics) {
|
|
17269
|
+
const relatedItems = deduplicateRelations([...upstream, ...downstream]);
|
|
17270
|
+
return {
|
|
17271
|
+
found: true,
|
|
17272
|
+
query: relPath,
|
|
17273
|
+
id: path5.basename(relPath),
|
|
17274
|
+
title: relPath,
|
|
17275
|
+
type: "source-file",
|
|
17276
|
+
layer: "code",
|
|
17277
|
+
filePath: relPath,
|
|
17278
|
+
status: "ACTIVE",
|
|
17279
|
+
summary,
|
|
17280
|
+
upstream,
|
|
17281
|
+
downstream,
|
|
17282
|
+
relatedItems,
|
|
17283
|
+
metrics: {
|
|
17284
|
+
loc: metrics.loc,
|
|
17285
|
+
extension: metrics.ext,
|
|
17286
|
+
exportedSymbolsCount: metrics.symbolsCount,
|
|
17287
|
+
citationsCount: metrics.citationsCount
|
|
17288
|
+
},
|
|
17289
|
+
contentPreview: content.substring(0, 1e3)
|
|
17290
|
+
};
|
|
17291
|
+
}
|
|
17292
|
+
function inspectSourceCodeFile(fullPath, relPath, graphElements, allTasks) {
|
|
17293
|
+
const content = fs8.readFileSync(fullPath, "utf-8");
|
|
17294
|
+
const loc = content.split("\n").length;
|
|
17295
|
+
const ext = path5.extname(fullPath).toLowerCase();
|
|
17296
|
+
const citations = Array.from(new Set(content.match(CITATION_REGEX) || []));
|
|
17297
|
+
const upstream = [
|
|
17298
|
+
...buildCitationRelations(citations),
|
|
17299
|
+
...findTasksForCitations(citations, allTasks)
|
|
17300
|
+
];
|
|
17301
|
+
const downstream = findTestNodesForCitations(citations, graphElements);
|
|
17302
|
+
const keySymbols = extractKeySymbols(content);
|
|
17303
|
+
const summary = buildSourceSummary(ext, loc, keySymbols, citations);
|
|
17304
|
+
return buildSourceInspectResult(relPath, summary, upstream, downstream, content, {
|
|
17305
|
+
loc,
|
|
17306
|
+
ext,
|
|
17307
|
+
symbolsCount: keySymbols.length,
|
|
17308
|
+
citationsCount: citations.length
|
|
17309
|
+
});
|
|
17310
|
+
}
|
|
17311
|
+
function buildTaskUpstreamRelations(t, changeId, filePath, graphNodes) {
|
|
17312
|
+
const list = [
|
|
17313
|
+
{ id: changeId, type: "change-proposal", direction: "upstream", relation: "part-of-change", filePath }
|
|
17314
|
+
];
|
|
17315
|
+
for (const cmp of t.implementsComponents || []) {
|
|
17316
|
+
const node = graphNodes.get(cmp);
|
|
17317
|
+
list.push({ id: cmp, type: "component", direction: "upstream", relation: "implements", title: node?.title, filePath: node?.filePath });
|
|
17318
|
+
}
|
|
17319
|
+
for (const req of t.satisfiesRequirements || []) {
|
|
17320
|
+
const node = graphNodes.get(req);
|
|
17321
|
+
list.push({ id: req, type: node?.type || "requirement", direction: "upstream", relation: "satisfies", title: node?.title, filePath: node?.filePath });
|
|
17322
|
+
}
|
|
17323
|
+
return list;
|
|
17324
|
+
}
|
|
17325
|
+
function buildTaskVerificationDownstream(t) {
|
|
17326
|
+
if (!t.verification?.criteria && !t.verification?.method) return [];
|
|
17327
|
+
return [{
|
|
17328
|
+
id: `${t.verification.method || "verification"}: ${t.verification.criteria || "passed"}`,
|
|
17329
|
+
type: "verification-criteria",
|
|
17330
|
+
direction: "downstream",
|
|
17331
|
+
relation: "verified-by-criteria"
|
|
17332
|
+
}];
|
|
17333
|
+
}
|
|
17334
|
+
function buildTaskSummary(t) {
|
|
17335
|
+
const mode = t.autonomyMode || "AUTONOMOUS";
|
|
17336
|
+
const assigned = t.assignedTo || "agent-developer";
|
|
17337
|
+
const c = t.complexity || "MEDIUM";
|
|
17338
|
+
const r = t.riskLevel || "LOW";
|
|
17339
|
+
const s = t.status || "PENDING";
|
|
17340
|
+
return `Tarea [${mode}] asignada a ${assigned}. Complejidad: ${c}, Riesgo: ${r}. Estado: ${s}.`;
|
|
17341
|
+
}
|
|
17342
|
+
function inspectDiscoveredTask(dt, graphNodes) {
|
|
17343
|
+
const t = dt.task;
|
|
17344
|
+
const upstream = buildTaskUpstreamRelations(t, dt.changeId, dt.tasksFilePath, graphNodes);
|
|
17345
|
+
const downstream = buildTaskVerificationDownstream(t);
|
|
17346
|
+
const summary = buildTaskSummary(t);
|
|
17347
|
+
const relatedItems = deduplicateRelations([...upstream, ...downstream]);
|
|
17348
|
+
return {
|
|
17349
|
+
found: true,
|
|
17350
|
+
query: t.id,
|
|
17351
|
+
id: t.id,
|
|
17352
|
+
title: t.title || t.id,
|
|
17353
|
+
type: "task",
|
|
17354
|
+
layer: "governance",
|
|
17355
|
+
filePath: dt.tasksFilePath,
|
|
17356
|
+
status: t.status || "ACTIVE",
|
|
17357
|
+
summary,
|
|
17358
|
+
upstream,
|
|
17359
|
+
downstream,
|
|
17360
|
+
relatedItems,
|
|
17361
|
+
metrics: { autonomyMode: t.autonomyMode, complexity: t.complexity, riskLevel: t.riskLevel, status: t.status }
|
|
17362
|
+
};
|
|
17363
|
+
}
|
|
17364
|
+
function inspectDirectFile(directPath, rootDir, options) {
|
|
17365
|
+
if (!fs8.existsSync(directPath) || !fs8.statSync(directPath).isFile()) {
|
|
17366
|
+
return null;
|
|
17367
|
+
}
|
|
17368
|
+
const relFile = path5.relative(rootDir, directPath).replace(/\\/g, "/");
|
|
17369
|
+
const ext = path5.extname(directPath).toLowerCase();
|
|
17370
|
+
if (ext === ".md") {
|
|
17371
|
+
try {
|
|
17372
|
+
const rawContent = fs8.readFileSync(directPath, "utf-8");
|
|
17373
|
+
const { frontmatter } = parseFrontmatter(rawContent);
|
|
17374
|
+
if (frontmatter.id && typeof frontmatter.id === "string") {
|
|
17375
|
+
const sub = inspectElement(frontmatter.id, options);
|
|
17376
|
+
sub.filePath = relFile;
|
|
17377
|
+
return sub;
|
|
17378
|
+
}
|
|
17379
|
+
} catch {
|
|
17380
|
+
}
|
|
17381
|
+
}
|
|
17382
|
+
const graphRes = buildGraphElements(rootDir);
|
|
17383
|
+
const allTasks = scanAllTasks(rootDir);
|
|
17384
|
+
return inspectSourceCodeFile(directPath, relFile, graphRes.elements, allTasks);
|
|
17385
|
+
}
|
|
17386
|
+
function findTargetNode(normQuery, nodeMap) {
|
|
17387
|
+
const direct = nodeMap.get(normQuery) || Array.from(nodeMap.values()).find((n) => n.id.toLowerCase() === normQuery);
|
|
17388
|
+
if (direct) return direct;
|
|
17389
|
+
return Array.from(nodeMap.values()).find(
|
|
17390
|
+
(n) => n.title && n.title.toLowerCase().includes(normQuery) || n.filePath && n.filePath.toLowerCase().includes(normQuery)
|
|
17391
|
+
);
|
|
17392
|
+
}
|
|
17393
|
+
function collectIncomingEdges(nodeId, edges, nodeMap) {
|
|
17394
|
+
const upstream = [];
|
|
17395
|
+
for (const e of edges) {
|
|
17396
|
+
if (e.target === nodeId) {
|
|
17397
|
+
const srcNode = nodeMap.get(e.source);
|
|
17398
|
+
upstream.push({
|
|
17399
|
+
id: e.source,
|
|
17400
|
+
type: srcNode?.type || "artifact",
|
|
17401
|
+
direction: "upstream",
|
|
17402
|
+
relation: e.relation || "derives-from",
|
|
17403
|
+
title: srcNode?.title,
|
|
17404
|
+
filePath: srcNode?.filePath
|
|
17405
|
+
});
|
|
17406
|
+
}
|
|
17407
|
+
}
|
|
17408
|
+
return upstream;
|
|
17409
|
+
}
|
|
17410
|
+
function collectOutgoingEdges(nodeId, edges, nodeMap) {
|
|
17411
|
+
const downstream = [];
|
|
17412
|
+
for (const e of edges) {
|
|
17413
|
+
if (e.source === nodeId) {
|
|
17414
|
+
const tgtNode = nodeMap.get(e.target);
|
|
17415
|
+
downstream.push({
|
|
17416
|
+
id: e.target,
|
|
17417
|
+
type: tgtNode?.type || "artifact",
|
|
17418
|
+
direction: "downstream",
|
|
17419
|
+
relation: e.relation || "satisfies",
|
|
17420
|
+
title: tgtNode?.title,
|
|
17421
|
+
filePath: tgtNode?.filePath
|
|
17422
|
+
});
|
|
17423
|
+
}
|
|
17424
|
+
}
|
|
17425
|
+
return downstream;
|
|
17426
|
+
}
|
|
17427
|
+
function collectNodeEdges(nodeId, edges, nodeMap) {
|
|
17428
|
+
return {
|
|
17429
|
+
upstream: collectIncomingEdges(nodeId, edges, nodeMap),
|
|
17430
|
+
downstream: collectOutgoingEdges(nodeId, edges, nodeMap)
|
|
17431
|
+
};
|
|
17432
|
+
}
|
|
17433
|
+
function attachTasksToNodeRelations(nodeId, allTasks, downstream) {
|
|
17434
|
+
for (const dt of allTasks) {
|
|
17435
|
+
const t = dt.task;
|
|
17436
|
+
const satisfiesThis = t.satisfiesRequirements?.includes(nodeId);
|
|
17437
|
+
const implementsThis = t.implementsComponents?.includes(nodeId);
|
|
17438
|
+
if (satisfiesThis || implementsThis) {
|
|
17439
|
+
downstream.push({
|
|
17440
|
+
id: `${t.id} (${dt.changeId})`,
|
|
17441
|
+
type: "task",
|
|
17442
|
+
direction: "downstream",
|
|
17443
|
+
relation: implementsThis ? "implements-component" : "satisfies-requirement",
|
|
17444
|
+
title: t.title,
|
|
17445
|
+
filePath: dt.tasksFilePath
|
|
17446
|
+
});
|
|
17447
|
+
}
|
|
17448
|
+
}
|
|
17449
|
+
}
|
|
17450
|
+
function buildNotFoundResult(trimmed, nodeMap) {
|
|
17451
|
+
const normQuery = trimmed.toLowerCase();
|
|
17452
|
+
const suggestions = Array.from(nodeMap.values()).filter((n) => n.id.toLowerCase().includes(normQuery.substring(0, 4)) || n.title && n.title.toLowerCase().includes(normQuery.substring(0, 4))).slice(0, 5).map((n) => ({
|
|
17453
|
+
id: n.id,
|
|
17454
|
+
type: n.type,
|
|
17455
|
+
direction: "bidirectional",
|
|
17456
|
+
relation: "suggestion",
|
|
17457
|
+
title: n.title,
|
|
17458
|
+
filePath: n.filePath
|
|
17459
|
+
}));
|
|
17460
|
+
return {
|
|
17461
|
+
found: false,
|
|
17462
|
+
query: trimmed,
|
|
17463
|
+
summary: `No se encontr\xF3 ning\xFAn elemento o archivo coincidente con "${trimmed}". Revisa el identificador o la ruta relativa.`,
|
|
17464
|
+
upstream: [],
|
|
17465
|
+
downstream: [],
|
|
17466
|
+
relatedItems: suggestions
|
|
17467
|
+
};
|
|
17468
|
+
}
|
|
17469
|
+
function inspectMatchedNode(matchedNode, trimmed, edges, nodeMap, allTasks) {
|
|
17470
|
+
const { upstream, downstream } = collectNodeEdges(matchedNode.id, edges, nodeMap);
|
|
17471
|
+
attachTasksToNodeRelations(matchedNode.id, allTasks, downstream);
|
|
17472
|
+
const summary = extractTechnicalSummary(matchedNode.content || "", matchedNode.title);
|
|
17473
|
+
const relatedItems = deduplicateRelations([...upstream, ...downstream]);
|
|
17474
|
+
return {
|
|
17475
|
+
found: true,
|
|
17476
|
+
query: trimmed,
|
|
17477
|
+
id: matchedNode.id,
|
|
17478
|
+
title: matchedNode.title || matchedNode.label || matchedNode.id,
|
|
17479
|
+
type: matchedNode.type,
|
|
17480
|
+
layer: matchedNode.layer,
|
|
17481
|
+
filePath: matchedNode.filePath,
|
|
17482
|
+
status: matchedNode.status || "COMPLIANT",
|
|
17483
|
+
summary,
|
|
17484
|
+
upstream,
|
|
17485
|
+
downstream,
|
|
17486
|
+
relatedItems,
|
|
17487
|
+
contentPreview: matchedNode.content ? matchedNode.content.substring(0, 1500) : void 0
|
|
17488
|
+
};
|
|
17489
|
+
}
|
|
17490
|
+
function resolveTargetMatch(normQuery, nodeMap, allTasks, edges, trimmed) {
|
|
17491
|
+
const matchedTask = allTasks.find(
|
|
17492
|
+
(dt) => dt.task.id.toLowerCase() === normQuery || `${dt.changeId}/${dt.task.id}`.toLowerCase() === normQuery
|
|
17493
|
+
);
|
|
17494
|
+
if (matchedTask && normQuery.startsWith("tsk-")) {
|
|
17495
|
+
return inspectDiscoveredTask(matchedTask, nodeMap);
|
|
17496
|
+
}
|
|
17497
|
+
const matchedNode = findTargetNode(normQuery, nodeMap);
|
|
17498
|
+
if (matchedNode) {
|
|
17499
|
+
return inspectMatchedNode(matchedNode, trimmed, edges, nodeMap, allTasks);
|
|
17500
|
+
}
|
|
17501
|
+
if (matchedTask) {
|
|
17502
|
+
return inspectDiscoveredTask(matchedTask, nodeMap);
|
|
17503
|
+
}
|
|
17504
|
+
return buildNotFoundResult(trimmed, nodeMap);
|
|
17505
|
+
}
|
|
17506
|
+
function inspectElement(query, options = {}) {
|
|
17507
|
+
const rootDir = options.rootDir || process.cwd();
|
|
17508
|
+
const trimmed = query.trim();
|
|
17509
|
+
const directPath = path5.isAbsolute(trimmed) ? trimmed : path5.join(rootDir, trimmed);
|
|
17510
|
+
const fileRes = inspectDirectFile(directPath, rootDir, options);
|
|
17511
|
+
if (fileRes) return fileRes;
|
|
17512
|
+
const graphRes = buildGraphElements(rootDir);
|
|
17513
|
+
const nodeMap = /* @__PURE__ */ new Map();
|
|
17514
|
+
for (const e of graphRes.elements) {
|
|
17515
|
+
if (e.group === "nodes") {
|
|
17516
|
+
const d = e.data;
|
|
17517
|
+
nodeMap.set(d.id, d);
|
|
17518
|
+
}
|
|
17519
|
+
}
|
|
17520
|
+
const edges = graphRes.elements.filter((e) => e.group === "edges").map((e) => e.data);
|
|
17521
|
+
const allTasks = scanAllTasks(rootDir);
|
|
17522
|
+
return resolveTargetMatch(trimmed.toLowerCase(), nodeMap, allTasks, edges, trimmed);
|
|
17523
|
+
}
|
|
17524
|
+
function formatRelationsBlock(title, list, arrow) {
|
|
17525
|
+
if (list.length === 0) return [];
|
|
17526
|
+
const lines = [title];
|
|
17527
|
+
for (const item of list) {
|
|
17528
|
+
const titleSuffix = item.title ? ` \u2014 *${item.title}*` : "";
|
|
17529
|
+
lines.push(`- ${arrow} **\`${item.id}\`** (\`${item.type}\`) [${item.relation}]${titleSuffix}`);
|
|
17530
|
+
}
|
|
17531
|
+
lines.push("");
|
|
17532
|
+
return lines;
|
|
17533
|
+
}
|
|
17534
|
+
function formatRelatedNavBlock(list) {
|
|
17535
|
+
if (list.length === 0) return [];
|
|
17536
|
+
const lines = ["#### \u{1F4CB} Elementos Navegables (Seleccionables para continuar navegaci\xF3n):"];
|
|
17537
|
+
let index = 1;
|
|
17538
|
+
for (const item of list) {
|
|
17539
|
+
const arrow = item.direction === "upstream" ? "\u2197\uFE0F" : item.direction === "downstream" ? "\u2198\uFE0F" : "\u2194\uFE0F";
|
|
17540
|
+
lines.push(`${index}. ${arrow} **\`${item.id}\`** (\`${item.type}\` \u2014 *${item.relation}*)`);
|
|
17541
|
+
index++;
|
|
17542
|
+
}
|
|
17543
|
+
lines.push("");
|
|
17544
|
+
return lines;
|
|
17545
|
+
}
|
|
17546
|
+
function formatNotFoundMarkdown(result) {
|
|
17547
|
+
const lines = [`### \u274C Elemento no encontrado: \`${result.query}\``, "", result.summary];
|
|
17548
|
+
if (result.relatedItems.length > 0) {
|
|
17549
|
+
lines.push("", "#### Sugerencias cercanas:");
|
|
17550
|
+
for (const s of result.relatedItems) {
|
|
17551
|
+
lines.push(`- **\`${s.id}\`** (${s.type}): ${s.title || "Sin t\xEDtulo"}`);
|
|
17552
|
+
}
|
|
17553
|
+
}
|
|
17554
|
+
return lines.join("\n");
|
|
17555
|
+
}
|
|
17556
|
+
function formatInspectResultMarkdown(result) {
|
|
17557
|
+
if (!result.found) return formatNotFoundMarkdown(result);
|
|
17558
|
+
const lines = [
|
|
17559
|
+
`### \u{1F50D} Inspecci\xF3n: \`${result.id || result.query}\`${result.title && result.title !== result.id ? ` \u2014 ${result.title}` : ""}`,
|
|
17560
|
+
"",
|
|
17561
|
+
`- **Tipo:** \`${result.type || "N/A"}\` | **Capa:** \`${result.layer || "N/A"}\` | **Estado:** \`${result.status || "COMPLIANT"}\``,
|
|
17562
|
+
result.filePath ? `- **Ubicaci\xF3n:** \`${result.filePath}\`` : "",
|
|
17563
|
+
"",
|
|
17564
|
+
"#### \u{1F4DD} Resumen T\xE9cnico:",
|
|
17565
|
+
result.summary,
|
|
17566
|
+
"",
|
|
17567
|
+
...formatRelationsBlock("#### \u{1F517} Relaciones Upstream (Deriva de / Mitiga / Alineado con):", result.upstream, "\u2197\uFE0F"),
|
|
17568
|
+
...formatRelationsBlock("#### \u{1F517} Relaciones Downstream (Satisfecho por / Verificado por / Implementado en):", result.downstream, "\u2198\uFE0F"),
|
|
17569
|
+
...formatRelatedNavBlock(result.relatedItems)
|
|
17570
|
+
].filter((l) => l !== "");
|
|
17571
|
+
return lines.join("\n");
|
|
17572
|
+
}
|
|
16989
17573
|
|
|
16990
|
-
export { ALL_ARCHITECTURE_TEMPLATES, BRANCH_PATTERNS, BddStepRegistry, DEFAULT_DLP_RULES, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_PRIVACY_POLICY, DEFAULT_SAST_EXCLUDES, GENERAL_SOURCE_EXTENSIONS, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, LIFECYCLE_SKILL_TEMPLATES, OpenSpecAdapter, PII_SAST_RULES, PREPARE_COMMIT_MSG_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, SARIF_SCHEMA_2_1_0, SARIF_VERSION, SAST_RULES, SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_INTRODUCTION_AND_GOALS_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_MANIFEST_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_QUALITY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_IDE_MCP_CONFIG_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_PRODUCTION_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_USER_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_DATA_ASSET_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_TERM_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_USE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_HAZARD_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_SAFETY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_DESIGN_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_HANDOFF_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_PROPOSAL_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_RELEASE_KPIS_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SESSION_TELEMETRY_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SPEC_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_TASKS_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ABUSE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ENCLAVE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_SECURITY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_THREAT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BASE_TEMPLATES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COMPLIANCE_LICENSE_MANIFEST_YAML, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_DEPLOY_DASHBOARD, STARTER_GITHUB_PR_KPI, STARTER_GITHUB_PULL_REQUEST_TEMPLATE, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_LICENSE_POLICY, STARTER_PRIVACY_POLICY, STARTER_PROCESS_README, STARTER_PULL_REQUEST_TEMPLATE, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_SCHEMAS, STARTER_SCHEMAS_MAP, STARTER_TASK_TEMPLATE, STARTER_TEMPLATES_CI_AZURE_PIPELINES_YML, STARTER_TEMPLATES_CI_BITBUCKET_PIPELINES_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML, STARTER_TEMPLATES_CI__GITLAB_CI_YML, STARTER_TEMPLATES_COMPLIANCE_COMMERCIAL_ACQUISITION_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_USER_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DATA_ASSET_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DPIA_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_TERM_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USER_DESIGN_FEEDBACK_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_HAZARD_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_SAFETY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SDD_DESIGN_TEMPLATE_MD, STARTER_TEMPLATES_SDD_HANDOFF_TEMPLATE_YAML, STARTER_TEMPLATES_SDD_PROPOSAL_TEMPLATE_MD, STARTER_TEMPLATES_SDD_PULL_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_SDD_SPEC_TEMPLATE_MD, STARTER_TEMPLATES_SDD_TASKS_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ABUSE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ENCLAVE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_SECURITY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_THREAT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_WORKFLOW_AGENT_HANDOFF_TEMPLATE_MD, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, STARTER__GITHUB_PULL_REQUEST_TEMPLATE_MD, SpecKitAdapter, TYPE_TO_SCHEMA_MAP, UNIT_TEST_SUFFIXES, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, aggregateCommitKpiRecords, aggregatePrKpis, aggregateReleaseKpis, analyzeBddVariantsForRequirement, appendRevisionHistoryRow, applyRatchetMode, buildCycloneDxComponent, buildCycloneDxVulnerabilities, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, canonicalSort, checkGherkinInSync, checkoutTaskBranch, classifyBranch, classifyMetricFromMessage, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeRawSha256, computeSha256, computeViolationSignature, createDefaultDlpPolicy, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, evaluateVulnerabilityThresholds, executeBddFeature, extractBaselineEntriesFromResults, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsPythonAst, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, extractPythonFunctionsPolyglot, extractSemanticContent, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDeterministicUuidV5, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generatePrivacyReportMarkdown, generateQualityReport, generateRopaInventoryMarkdown, generateSastReportMarkdown, generateSecretsReportMarkdown, generateSecuritySarifReport, generateSuppressionsAuditReport, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, installGitHooks, integrateSddChange, isCliInstalled, isFunctionReferencedInTests, isGitleaksInstalled, isMetricWorsened, isPathProtectedFromPatch, isPlaceholderOrIgnored, isReportContentSemanticallyEqual, isRequirementArtifact2 as isRequirementArtifact, isSemgrepInstalled, isToolAvailable, loadDlpPolicy, loadPrivacyPolicy, loadProductHandoffSidecar, loadQualityBaseline, locateTaskInActiveChanges, mapSastSeverityToSarifLevel, maskSecret, normalizePath, normalizeSpdxLicense, normalizeUri, orchestrateNativeAstAnalysis, parseCommitTrailers, parseDlpPolicy, parseFeatureDocument, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSecuritySuppression, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, parseTrivyVulnerabilities, processPackageDir, readCodeCoverageSummary, readPackageJson, renderAntigravityAgentFile, renderAntigravitySkillFile, renderAutonomyModeSection, renderClaudeAgentFile, renderClaudeSkillFile, renderCopilotAgentFile, renderCopilotSkillFile, renderCursorAgentFile, renderCursorSkillFile, renderDashboardHtml, renderManualsTab, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCytoscapePath, resolveDefaultBranchBase, resolveDeterministicDate, resolveFeatureFilePath, resolveGitRef, resolveLicenseFromFile, resolveReleaseBaseBranch, resolveSastCwe, resolveSastOwasp, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, sanitizeDlpPayload, sanitizeDlpText, sanitizeTestCorpus, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForPrivacyViolations, scanFileForSast, scanGoDependencies, scanInstalledLicenses, scanManualsInWorkspace, scanMavenDependencies, scanPnpmStore, scanPythonDependencies, scanRustDependencies, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, serializeSarifDocument, slugify2 as slugify, stripVolatileReportMetadata, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateAnchorExistence, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyManuals, verifyPdacGraph, verifyPrivacy, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCucumberJsonReport, writeCycloneDxSbom, writeQualityBaseline, writeReleaseKpiReport, writeReportFileIfChanged, writeSecuritySarifReport, writeThirdPartyNotices };
|
|
17574
|
+
export { ALL_ARCHITECTURE_TEMPLATES, BRANCH_PATTERNS, BddStepRegistry, DEFAULT_DLP_RULES, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_PRIVACY_POLICY, DEFAULT_SAST_EXCLUDES, GENERAL_SOURCE_EXTENSIONS, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, LIFECYCLE_SKILL_TEMPLATES, OpenSpecAdapter, PII_SAST_RULES, PREPARE_COMMIT_MSG_SCRIPT, PRE_COMMIT_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, SARIF_SCHEMA_2_1_0, SARIF_VERSION, SAST_RULES, SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_INTRODUCTION_AND_GOALS_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_MANIFEST_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_QUALITY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_IDE_MCP_CONFIG_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_PRODUCTION_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_USER_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_DATA_ASSET_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_TERM_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_USE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_HAZARD_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_SAFETY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_DESIGN_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_HANDOFF_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_PROPOSAL_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_RELEASE_KPIS_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SESSION_TELEMETRY_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SPEC_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_TASKS_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ABUSE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ENCLAVE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_SECURITY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_THREAT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BASE_TEMPLATES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COMPLIANCE_LICENSE_MANIFEST_YAML, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_DEPLOY_DASHBOARD, STARTER_GITHUB_PR_KPI, STARTER_GITHUB_PULL_REQUEST_TEMPLATE, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_LICENSE_POLICY, STARTER_PRIVACY_POLICY, STARTER_PROCESS_README, STARTER_PULL_REQUEST_TEMPLATE, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_SCHEMAS, STARTER_SCHEMAS_MAP, STARTER_TASK_TEMPLATE, STARTER_TEMPLATES_CI_AZURE_PIPELINES_YML, STARTER_TEMPLATES_CI_BITBUCKET_PIPELINES_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML, STARTER_TEMPLATES_CI__GITLAB_CI_YML, STARTER_TEMPLATES_COMPLIANCE_COMMERCIAL_ACQUISITION_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_USER_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DATA_ASSET_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DPIA_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_TERM_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USER_DESIGN_FEEDBACK_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_HAZARD_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_SAFETY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SDD_DESIGN_TEMPLATE_MD, STARTER_TEMPLATES_SDD_HANDOFF_TEMPLATE_YAML, STARTER_TEMPLATES_SDD_PROPOSAL_TEMPLATE_MD, STARTER_TEMPLATES_SDD_PULL_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_SDD_SPEC_TEMPLATE_MD, STARTER_TEMPLATES_SDD_TASKS_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ABUSE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ENCLAVE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_SECURITY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_THREAT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_WORKFLOW_AGENT_HANDOFF_TEMPLATE_MD, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, STARTER__GITHUB_PULL_REQUEST_TEMPLATE_MD, SpecKitAdapter, TYPE_TO_SCHEMA_MAP, UNIT_TEST_SUFFIXES, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, aggregateCommitKpiRecords, aggregatePrKpis, aggregateReleaseKpis, analyzeBddVariantsForRequirement, appendRevisionHistoryRow, applyRatchetMode, buildCycloneDxComponent, buildCycloneDxVulnerabilities, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, canonicalSort, checkGherkinInSync, checkoutTaskBranch, classifyBranch, classifyMetricFromMessage, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeRawSha256, computeSha256, computeViolationSignature, createDefaultDlpPolicy, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, evaluateVulnerabilityThresholds, executeBddFeature, extractBaselineEntriesFromResults, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsPythonAst, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, extractPythonFunctionsPolyglot, extractSemanticContent, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatInspectResultMarkdown, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDeterministicUuidV5, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generatePrivacyReportMarkdown, generateQualityReport, generateRopaInventoryMarkdown, generateSastReportMarkdown, generateSecretsReportMarkdown, generateSecuritySarifReport, generateSuppressionsAuditReport, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, inspectElement, installGitHooks, integrateSddChange, isCliInstalled, isFunctionReferencedInTests, isGitleaksInstalled, isMetricWorsened, isPathProtectedFromPatch, isPlaceholderOrIgnored, isReportContentSemanticallyEqual, isRequirementArtifact2 as isRequirementArtifact, isSemgrepInstalled, isToolAvailable, loadDlpPolicy, loadPrivacyPolicy, loadProductHandoffSidecar, loadQualityBaseline, locateTaskInActiveChanges, mapSastSeverityToSarifLevel, maskSecret, normalizePath, normalizeSpdxLicense, normalizeUri, orchestrateNativeAstAnalysis, parseCommitTrailers, parseDlpPolicy, parseFeatureDocument, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSecuritySuppression, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, parseTrivyVulnerabilities, processPackageDir, readCodeCoverageSummary, readPackageJson, renderAntigravityAgentFile, renderAntigravitySkillFile, renderAutonomyModeSection, renderClaudeAgentFile, renderClaudeSkillFile, renderCopilotAgentFile, renderCopilotSkillFile, renderCursorAgentFile, renderCursorSkillFile, renderDashboardHtml, renderManualsTab, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCytoscapePath, resolveDefaultBranchBase, resolveDeterministicDate, resolveFeatureFilePath, resolveGitRef, resolveLicenseFromFile, resolveReleaseBaseBranch, resolveSastCwe, resolveSastOwasp, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, sanitizeDlpPayload, sanitizeDlpText, sanitizeTestCorpus, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForPrivacyViolations, scanFileForSast, scanGoDependencies, scanInstalledLicenses, scanManualsInWorkspace, scanMavenDependencies, scanPnpmStore, scanPythonDependencies, scanRustDependencies, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, serializeSarifDocument, slugify2 as slugify, stripVolatileReportMetadata, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateAnchorExistence, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyManuals, verifyPdacGraph, verifyPrivacy, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCucumberJsonReport, writeCycloneDxSbom, writeQualityBaseline, writeReleaseKpiReport, writeReportFileIfChanged, writeSecuritySarifReport, writeThirdPartyNotices };
|
|
16991
17575
|
//# sourceMappingURL=index.js.map
|
|
16992
17576
|
//# sourceMappingURL=index.js.map
|