IF Commons GitHub

GRC as-of view

0010Active

0010-grc-as-of · owner if · domain grc

The view

FR-001checkpassing

asOf(input, at) MUST be a pure, deterministic function that gives, for every control of the frameworks of the input, its status, coverage, freshness, the exceptions in force and its risk at the instant at, with the head and length of the ledger up to it; an at that is not an ISO 8601 instant MUST be an error value.

Enforced (check): .github: cd commons/grc && bun run verify — suite/as-of.test.ts

Proved by: grc/suite/as-of.test.ts

Written in: grc/src/logical/as-of.ts

Tests: passed: suite/as-of.test.ts every control has a state at an instant, with the head and length of the ledger; an instan

FR-002checkpassing

Events after the instant MUST be ignored: a result counts where its observedAt is not after at, a risk and a ledger entry where its createdAt is not after at, an exception where it is granted at or before at; the ledger up to the instant MUST be the longest prefix, in sequence order, of entries created at or before it.

Enforced (check): .github: cd commons/grc && bun run verify — suite/as-of.test.ts

Proved by: grc/suite/as-of.test.ts

Written in: grc/src/logical/as-of.ts

Tests: passed: suite/as-of.test.ts events after the instant are ignored: results, risks, exceptions and ledger entries

FR-003checkpassing

Expirations MUST be evaluated at the instant: an exception is in force where grantedAt <= at < expiresAt, freshness is that of freshness(newest, duration, at), and a risk is due where its reviewBy is not after at.

Enforced (check): .github: cd commons/grc && bun run verify — suite/as-of.test.ts

Proved by: grc/suite/as-of.test.ts

Written in: grc/src/logical/as-of.ts

Tests: passed: suite/as-of.test.ts expirations are evaluated at the instant: exceptions, freshness and the review of a risk

FR-004checkpassing

The status of a control MUST be the join of the newest results of the checks that show it, with the exceptions of the instant applied, gap where none shows it; the coverage MUST be coverage at the instant over the results up to it; the freshness MUST be the worst of its checks' (unobserved where there is none); the risk MUST be the highest level of the risks up to the instant that name the control.

Enforced (check): .github: cd commons/grc && bun run verify — suite/as-of.test.ts

Proved by: grc/suite/as-of.test.ts

Written in: grc/src/logical/as-of.ts

Tests: passed: suite/as-of.test.ts the status joins the newest results with the exceptions of the instant applied; the risk i

FR-005checkpassing

The view MUST be the same for any order of the results, entries, exceptions and risks, and currentView(input, now) MUST be the same computation without the filter of FR-002.

Enforced (check): .github: cd commons/grc && bun run verify — suite/as-of.test.ts

Proved by: grc/suite/as-of.test.ts

Written in: grc/src/logical/as-of.ts

Tests: passed: suite/as-of.test.ts the view is the same for any order of results, entries, exceptions and risks, and the curr

FR-006checkpassing

The as-of view at the end of the ledger, that is at the latest instant any event of the input has, MUST equal the current view at that instant, and adding an event later than at to the input MUST NOT change the as-of view at at.

Enforced (check): .github: cd commons/grc && bun run verify — suite/as-of.test.ts

Proved by: grc/suite/as-of.test.ts

Written in: grc/src/logical/as-of.ts

Tests: passed: suite/as-of.test.ts the as-of view at the end equals the current view, and adding events later than the instan

Scenarios

  • Given a failing result on the 10th and an exception granted on the 12th, When the view at the 11th is made, Then the control is fail and no exception is in force, per FR-002.
  • Given an exception that expires on the 20th, When the view at the 20th is made, Then it is not in force, per FR-003.

Out of scope

  • Where the events are read from: the caller gives them.

Edge cases

  • An instant before every event: every control is gap and unobserved, per FR-004.

Assumptions

  • The recording time of an event is its own instant, as above.

Open questions

OQ-1open question

Whether a bitemporal view (recorded versus observed) is needed.

Key entities

  • As-of view, Control state.

Success criteria

SC-001success criterion

The same events give the same view at an instant, in any order and with any later events.

Review & acceptance checklist

  • [x] Every requirement is testable (MUST / MUST NOT), not aspirational
  • [x] No company fact is asserted here
  • [x] Every open item is marked, not silently decided

Cited by

GRC, logical/as-of

Titles, headings, exports, tables, columns and requirements. Esc closes.