filegrc 0.15.0 → 0.15.2

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/src/workflow.js CHANGED
@@ -3,6 +3,7 @@ import { tmpdir } from "node:os";
3
3
  import { join } from "node:path";
4
4
  import { modelSupports } from "../model/index.js";
5
5
  import { applicabilityReviewIsCurrent } from "./applicability-scope.js";
6
+ import { retentionScheduleIsAuthoritative } from "./collection-review.js";
6
7
  import { assessRequiredAppointments } from "./appointments.js";
7
8
  import { assessSourceCoverageReadiness } from "./source-coverage.js";
8
9
  import { coverageEnd, coverageStart } from "./coverage.js";
@@ -918,6 +919,7 @@ async function auditLifecycleFindings(loaded, audits, program) {
918
919
  const byId = new Map(loaded.resources.map((record) => [record.id, record]));
919
920
  const retentionRules = loaded.resources.filter((record) => record.type === "retention-schedule-item");
920
921
  const retentionRevisions = await resourceReviewRevisions(loaded, retentionRules.flatMap((rule) => retentionReviewResourceIds(rule, loaded)));
922
+ const retentionScheduleApproved = retentionScheduleIsAuthoritative(loaded, target);
921
923
  const findings = [];
922
924
  for (const audit of audits) {
923
925
  if (!(audit.controlIds || []).length) {
@@ -1045,7 +1047,7 @@ async function auditLifecycleFindings(loaded, audits, program) {
1045
1047
  `${records.length} ${noun} remain open, so this engagement cannot be treated as closed.`
1046
1048
  ));
1047
1049
  }
1048
- const linkedRetentionCurrent = (audit.retentionScheduleItemIds || []).some((id) => {
1050
+ const linkedRetentionCurrent = retentionScheduleApproved && (audit.retentionScheduleItemIds || []).some((id) => {
1049
1051
  const rule = byId.get(id);
1050
1052
  return rule?.type === "retention-schedule-item"
1051
1053
  && rule.status === "active"
@@ -1125,6 +1127,8 @@ function normalizeFinding(code, item, context) {
1125
1127
  ...(item.createResourceType ? { createResourceType: item.createResourceType } : {}),
1126
1128
  ...(item.sourceResourceIds ? { sourceResourceIds: item.sourceResourceIds } : {}),
1127
1129
  ...(item.informationTypeId ? { informationTypeId: item.informationTypeId } : {}),
1130
+ ...(item.affectedResourceIds ? { affectedResourceIds: item.affectedResourceIds } : {}),
1131
+ ...(item.retentionScopeResourceIds ? { retentionScopeResourceIds: item.retentionScopeResourceIds } : {}),
1128
1132
  ...(item.retentionScheduleItemIds ? { retentionScheduleItemIds: item.retentionScheduleItemIds } : {}),
1129
1133
  ...(item.staleResourceIds ? { staleResourceIds: item.staleResourceIds } : {}),
1130
1134
  ...(subject ? { subject } : {}),