ShtukbaseStandard
包文件→ .shtukbase/packages/risks/checks/r01_risk_held.ts

checks/r01_risk_held.ts

16 行, 1.0 KB.

文件按包中的原样显示:代码及其注释不做翻译。

  1. // RSK-R01. A live risk (open or mitigated: category arriving or working) can be held: it has an owner, a likelihood
  2. // and an impact, a signal (how we notice it) and a mitigation (how we lower it).
  3. import type { Project, Result } from '../../collections/checks/lib/speclib.ts';
  4. import { main } from '../../collections/checks/lib/runner.ts';
  5. import { checkFields, live } from '../../quality/checks/lib/qlib.ts';
  6. export const RULE = { id: 'rsk-r01', title: 'A risk has an owner, an assessment, a signal and a measure', scope: 'risks in the states "Open" and "Mitigated"' };
  7. export function check(p: Project, res: Result): void {
  8. checkFields(p, res, 'RISK', [
  9. { when: (r) => live(p, r, 'RISK'), fields: ['owner', 'likelihood', 'impact', 'signal', 'mitigation'], why: 'nobody holds the risk, or there is nothing to hold it with',
  10. fix: 'write who is responsible (owner), the likelihood and the impact, how we will notice (signal) and how we reduce it (mitigation)', code: 'not-held' },
  11. ]);
  12. }
  13. if (import.meta.main) main({ RULE, check });