filegrc 0.9.1 → 0.10.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/src/workflow.js CHANGED
@@ -2,6 +2,7 @@ import { cp, mkdtemp, rm } from "node:fs/promises";
2
2
  import { tmpdir } from "node:os";
3
3
  import { join } from "node:path";
4
4
  import { modelSupports } from "../model/index.js";
5
+ import { applicabilityReviewIsCurrent } from "./applicability-scope.js";
5
6
  import { assessRequiredAppointments } from "./appointments.js";
6
7
  import { assessSourceCoverageReadiness } from "./source-coverage.js";
7
8
  import { coverageEnd, coverageStart } from "./coverage.js";
@@ -110,8 +111,8 @@ async function assessWorkflowUnmeasured(input, options = {}) {
110
111
  audit.id,
111
112
  await assessAuditPreparation(loaded, {
112
113
  auditId: audit.id,
113
- generatedAt: evaluatedAt,
114
- programReadiness: program
114
+ asOf,
115
+ generatedAt: evaluatedAt
115
116
  })
116
117
  ])
117
118
  ));
@@ -363,7 +364,7 @@ function recordFinalizationFindings(loaded, program) {
363
364
  if (incomplete) {
364
365
  findings.push(finalizationFinding(record, incomplete));
365
366
  }
366
- for (const missing of finalizationFields(record, loaded.model)) {
367
+ for (const missing of finalizationFields(record, loaded.model, loaded.resources, program)) {
367
368
  findings.push(fieldFinding(record, missing));
368
369
  }
369
370
  }
@@ -498,16 +499,16 @@ function recordFinalizationRequiredness(record, loaded, program) {
498
499
  return "conditional";
499
500
  }
500
501
 
501
- function finalizationFields(record, model) {
502
+ function finalizationFields(record, model, resources, program) {
502
503
  const fields = [];
503
504
  const needsReview = ["requirement", "commitment", "complementary-control", "control"].includes(record.type)
504
505
  && model.resources[record.type]?.fields?.applicabilityReview
505
- && !record.applicabilityReview;
506
+ && !applicabilityReviewIsCurrent(record.applicabilityReview, record, program, resources, model);
506
507
  if (needsReview) {
507
508
  fields.push({
508
509
  field: "applicabilityReview",
509
510
  requiredness: "required",
510
- message: "Record the reviewed applicability decision, rationale, reviewer, and date. FileGRC records the current scope automatically."
511
+ message: "Record or refresh the reviewed applicability decision, rationale, reviewer, and date. FileGRC records the current material scope automatically."
511
512
  });
512
513
  }
513
514
  if (record.type === "policy" && model.resources.policy?.fields?.programRole && !record.programRole) {