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