| 111 | } |
| 112 | |
| 113 | function decideTrial(proof, criteria) { |
| 114 | if (proof.status === 'blocked' || criteria.some((item) => item.status === 'fail')) { |
| 115 | return { |
| 116 | status: 'blocked', |
| 117 | nextAction: 'Fix failed trial criteria before using this project as Citadel usefulness evidence.', |
| 118 | }; |
| 119 | } |
| 120 | if (proof.summary.setup === 'partial') { |
| 121 | return { |
| 122 | status: 'setup-needed', |
| 123 | nextAction: 'Run /do setup --express, then rerun node scripts/usefulness-trial.js --write --run-verification.', |
| 124 | }; |
| 125 | } |
| 126 | if (criteria.some((item) => item.status === 'partial')) { |
| 127 | return { |
| 128 | status: 'incomplete-evidence', |
| 129 | nextAction: 'Create or refresh the missing proof artifacts, then rerun the usefulness trial.', |
| 130 | }; |
| 131 | } |
| 132 | return { |
| 133 | status: 'ready-for-dogfood', |
| 134 | nextAction: 'Use this project for the post-landing first-use audit and capture the generated report.', |
| 135 | }; |
| 136 | } |
| 137 | |
| 138 | function score(criteria) { |
| 139 | const passed = criteria.filter((item) => item.status === 'pass').length; |