ShtukbaseStandard
package file→ .shtukbase/packages/quality/checks/q06_outcome.ts

checks/q06_outcome.ts

19 lines, 1.2 KB.

  1. // QLT-R06. A benefit past «hypothesis» (category working or done) is described in full: formula, unit, expected
  2. // effect, horizon, who measures it in operation and where the data comes from; and the goal, when the project has
  3. // a goals collection (without the layer "Business" the goal is written in the body).
  4. import type { Project, Result } from '../../collections/checks/lib/speclib.ts';
  5. import { main } from '../../collections/checks/lib/runner.ts';
  6. import { checkFields } from './lib/qlib.ts';
  7. export const RULE = { id: 'qlt-r06', title: 'A benefit past the hypothesis is described in full', scope: 'benefit in operation in the states after "Hypothesis"' };
  8. export function check(p: Project, res: Result): void {
  9. const fields = ['formula', 'unit', 'expectedEffect', 'horizon', 'measuredInOpsBy', 'opsDataSource'];
  10. if (p.coll('GOAL')) fields.unshift('goal');
  11. checkFields(p, res, 'OUT', [
  12. { when: (r) => ['working', 'done'].includes(p.category(r, 'OUT') ?? ''), fields, why: 'the benefit is not described so that it could be measured',
  13. fix: 'fill in the fields or return the benefit to "Hypothesis"', code: 'not-described' },
  14. ]);
  15. }
  16. if (import.meta.main) main({ RULE, check });