Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "filegrc-monorepo",
"version": "0.18.14",
"version": "0.18.15",
"private": true,
"workspaces": [
"packages/filegrc",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-filegrc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-filegrc",
"version": "0.18.14",
"version": "0.18.15",
"description": "Create a filegrc workspace for a SOC 2 program",
"license": "MIT",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/create-filegrc/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,13 @@ async function runCombinedSetup(target, input) {
async function writeMinimalLockfile(target, name, versionRange) {
const lock = {
name,
version: "0.18.14",
version: "0.18.15",
lockfileVersion: 3,
requires: true,
packages: {
"": {
name,
version: "0.18.14",
version: "0.18.15",
dependencies: { filegrc: versionRange }
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-filegrc/template/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "{{project_name}}",
"version": "0.18.14",
"version": "0.18.15",
"private": true,
"description": "filegrc workspace for a SOC 2 program",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/filegrc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "filegrc",
"version": "0.18.14",
"version": "0.18.15",
"description": "Zero-dependency Git-native GRC engine",
"license": "MIT",
"repository": {
Expand Down
11 changes: 6 additions & 5 deletions packages/filegrc/src/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,12 +782,13 @@ function validateOccurrenceScheduleBinding(record, obligation, rule, resources,
const byId = new Map(resources.map((candidate) => [candidate.id, candidate]));
const cutover = [obligationActivationDate(obligation, byId, rule, rule.timezone || "UTC"),
obligationActivationDate(obligation, byId, model, rule.timezone || "UTC")].filter(Boolean).sort().at(-1);
if (modelSupports(model, "operating-preparation") && cutover && expectedStart < cutover && expectedEnd >= cutover
if (modelSupports(model, "operating-preparation") && cutover && expectedStart < cutover
&& start !== expectedStart) {
// Original full windows retain their published binding. A previously
// committed partial window also survives later governed-content cutovers.
expectedStart = start > expectedStart && start < cutover
&& committedOccurrenceWindowMatches(root, record, resources) ? start : cutover;
// A committed partial window keeps its binding even when a later content
// cutover falls after its end. New partial windows still require overlap.
if (start > expectedStart && start < cutover
&& committedOccurrenceWindowMatches(root, record, resources)) expectedStart = start;
else if (expectedEnd >= cutover) expectedStart = cutover;
}
const expectedCutoff = rule.selector?.cutoff === "window-end" ? expectedEnd : expectedStart;
const program = resources.find(({ type, id }) => type === "program" && id === record.programId);
Expand Down
23 changes: 23 additions & 0 deletions packages/filegrc/test/completion-reconciliation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,29 @@ test("committed partial windows survive later content activation without duplica
assert.equal(items[0].dueWindowStart, "2026-07-05");
});

test("closed committed partial windows survive later content cutovers without accepting edited dates", async (context) => {
const f = await fixture(context);
const result = await completeObligationOccurrence(f.root, { obligationId: f.obligation.id,
expectedRevision: f.revision, record: f.record });
assert.deepEqual(result.linked.coverage, { kind: "range", startsOn: "2026-07-05", endsOn: "2026-07-21" });
const loaded = await loadWorkspace(f.root);
const policy = loaded.entries.find(({ record }) => record.id === f.obligation.policyIds[0]);
await writeJson(policy.path, { ...policy.record, effectiveOn: "2026-08-10" });
let validation = await validateWorkspace(f.root);
assert.ok(validation.diagnostics.some(({ code }) => code === "invalid-obligation-occurrence-schedule-binding"), "Uncommitted dates cannot establish a historical window");
await writeJson(policy.path, policy.record);
await initializeGitWorkspace(f.root, "Retain the completed initial partial window");
await writeJson(policy.path, { ...policy.record, effectiveOn: "2026-08-10" });
validation = await validateWorkspace(f.root);
assert.equal(validation.diagnostics.some(({ code }) => code === "invalid-obligation-occurrence-schedule-binding"), false);
const current = await loadWorkspace(f.root);
const occurrence = current.entries.find(({ record }) => record.id === result.linked.id);
assert.deepEqual(occurrence.record, result.linked, "Activation preserves all frozen occurrence facts");
await writeJson(occurrence.path, { ...occurrence.record, coverage: { ...occurrence.record.coverage, startsOn: "2026-07-06" } });
validation = await validateWorkspace(f.root);
assert.ok(validation.diagnostics.some(({ code }) => code === "invalid-obligation-occurrence-schedule-binding"), "An edited historical start remains invalid");
});

test("CLI and browser retain the selected Program when multiple Programs are active", async (context) => {
const cli = await fixture(context);
const browser = await fixture(context);
Expand Down
Loading