ShtukbaseStandard
archivo del paquete→ .shtukbase/packages/quality/checks/q05_assumption.ts

checks/q05_assumption.ts

21 líneas, 1.4 KB.

El archivo tal como está en el paquete: el código y sus comentarios no se traducen.

  1. // QLT-R05. An assumption can be checked: a live one names who controls it and how to check it; one being checked
  2. // also says what we do (ourLevers); a finished one (confirmed or refuted, category done) has the result and the date.
  3. import type { Project, Result } from '../../collections/checks/lib/speclib.ts';
  4. import { main } from '../../collections/checks/lib/runner.ts';
  5. import { checkFields } from './lib/qlib.ts';
  6. export const RULE = { id: 'qlt-r05', title: 'An assumption can be checked', scope: 'all assumptions' };
  7. export function check(p: Project, res: Result): void {
  8. const c = (r: Parameters<typeof p.category>[0]) => p.category(r, 'ASM');
  9. checkFields(p, res, 'ASM', [
  10. { when: (r) => c(r) !== 'dropped', fields: ['whoControls', 'howToCheck'], why: 'it is unclear who holds the assumption and how to check it',
  11. fix: 'write who holds it (whoControls) and how to check it (howToCheck)', code: 'not-checkable' },
  12. { when: (r) => c(r) === 'working', fields: ['ourLevers'], why: 'the assumption is being checked, but what we do is not said',
  13. fix: 'write our levers (ourLevers)', code: 'no-levers' },
  14. { when: (r) => c(r) === 'done', fields: ['outcome', 'checkedOn'], why: 'the check is finished without a result',
  15. fix: 'write the result of the check (outcome) and the date (checkedOn) or return it to "Checking"', code: 'no-outcome' },
  16. ]);
  17. }
  18. if (import.meta.main) main({ RULE, check });