@pactosigna/trace 0.1.5 → 0.1.6

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/cli.js CHANGED
@@ -771,6 +771,10 @@ function detectArchitectureNoParent(documents) {
771
771
  function isApprovedOrEffective(doc) {
772
772
  return doc.status === "approved" || doc.status === "effective";
773
773
  }
774
+ function extractDocumentId(ref) {
775
+ const hashIndex = ref.indexOf("#");
776
+ return hashIndex === -1 ? ref : ref.slice(0, hashIndex);
777
+ }
774
778
  function buildGap(doc, code, severity, message) {
775
779
  return {
776
780
  code,
@@ -925,7 +929,7 @@ function detectRiskControlNoVerification(documents, links) {
925
929
  }
926
930
  }
927
931
  for (const control of controls) {
928
- if (!verifiedDocIds.has(control)) {
932
+ if (!verifiedDocIds.has(extractDocumentId(control))) {
929
933
  gaps.push(
930
934
  buildGap(
931
935
  doc,
@@ -1027,7 +1031,7 @@ function collectAllHarms(doc) {
1027
1031
  function detectMitigationGaps(doc, docById, mitigations) {
1028
1032
  const gaps = [];
1029
1033
  for (const mitigation of mitigations) {
1030
- const controlDoc = docById.get(mitigation.control);
1034
+ const controlDoc = docById.get(extractDocumentId(mitigation.control));
1031
1035
  if (!controlDoc) {
1032
1036
  gaps.push(
1033
1037
  buildGap(
package/dist/index.js CHANGED
@@ -1737,6 +1737,10 @@ function detectArchitectureNoParent(documents) {
1737
1737
  function isApprovedOrEffective(doc) {
1738
1738
  return doc.status === "approved" || doc.status === "effective";
1739
1739
  }
1740
+ function extractDocumentId(ref) {
1741
+ const hashIndex = ref.indexOf("#");
1742
+ return hashIndex === -1 ? ref : ref.slice(0, hashIndex);
1743
+ }
1740
1744
  function buildGap(doc, code, severity, message) {
1741
1745
  return {
1742
1746
  code,
@@ -1891,7 +1895,7 @@ function detectRiskControlNoVerification(documents, links) {
1891
1895
  }
1892
1896
  }
1893
1897
  for (const control of controls) {
1894
- if (!verifiedDocIds.has(control)) {
1898
+ if (!verifiedDocIds.has(extractDocumentId(control))) {
1895
1899
  gaps.push(
1896
1900
  buildGap(
1897
1901
  doc,
@@ -1944,7 +1948,7 @@ function collectAllHarms(doc) {
1944
1948
  function detectMitigationGaps(doc, docById, mitigations) {
1945
1949
  const gaps = [];
1946
1950
  for (const mitigation of mitigations) {
1947
- const controlDoc = docById.get(mitigation.control);
1951
+ const controlDoc = docById.get(extractDocumentId(mitigation.control));
1948
1952
  if (!controlDoc) {
1949
1953
  gaps.push(
1950
1954
  buildGap(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pactosigna/trace",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "description": "QMS traceability engine — gap detection, risk analysis, impact analysis (IEC 62304, ISO 14971)",
6
6
  "publishConfig": {