great-cto 2.83.0 → 2.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  "name": "great_cto",
3
3
  "id": "great_cto",
4
4
  "description": "Engineering process for solo founders and teams up to 50 engineers. Agents do architecture, code review, QA, and security. You make two decisions per feature.",
5
- "version": "2.83.0",
5
+ "version": "2.85.0",
6
6
  "author": {
7
7
  "name": "Great CTO",
8
8
  "url": "https://github.com/avelikiy/great_cto"
@@ -181,9 +181,34 @@ function getMetrics(cwd = process.cwd(), days = 30) {
181
181
  return s + v.cost_usd;
182
182
  }, 0);
183
183
 
184
+ // Trust gate for MEASURED cost (pxpipe discipline: measure, but only report
185
+ // measured when the measurement is trustworthy — else partial/synthetic verdict
186
+ // data distorts the ratio, so we fall back to the task estimate).
187
+ // Bar: enough windowed done-tasks carry a real verdict cost (coverage ≥ 50%,
188
+ // min 3), and the measured total is a real spend (≥ 1¢, not a synthetic $0).
189
+ const doneInWindowCount = done.filter(t => t.closed_at && (now - new Date(t.closed_at).getTime()) <= costWindowMs).length;
190
+ const verdictsWithCost = verdicts.filter(v => v.cost_usd != null && (!v.ts || (now - new Date(v.ts).getTime()) <= costWindowMs)).length;
191
+ const measuredTrustworthy = verdictLlmTotal >= 0.01
192
+ && verdictsWithCost >= Math.max(3, Math.ceil(0.5 * doneInWindowCount));
193
+
184
194
  let cost;
185
195
  if (costData.llm_usd > 0 || costData.human_usd > 0) {
186
196
  cost = { ...costData, real_llm_usd: verdictLlmTotal > 0 ? Math.round(verdictLlmTotal * 10000) / 10000 : null };
197
+ } else if (measuredTrustworthy) {
198
+ // Canonical = MEASURED verdict cost. Human leg is the independent task
199
+ // estimate (or a verdict-count baseline when there are no tasks), so the
200
+ // savings ratio compares measured spend against estimated human effort.
201
+ const humanLeg = taskHumanTotal > 0 ? taskHumanTotal : verdicts.length * (30 / 60) * HUMAN_RATE_PER_HR;
202
+ cost = {
203
+ llm_usd: Math.round(verdictLlmTotal * 100) / 100,
204
+ human_usd: Math.round(humanLeg),
205
+ savings_x: humanLeg > 0 ? Math.round(humanLeg / verdictLlmTotal) : null,
206
+ window_days: 30,
207
+ count: verdictsWithCost,
208
+ coverage: doneInWindowCount > 0 ? Math.round((verdictsWithCost / doneInWindowCount) * 100) : null,
209
+ source: 'measured',
210
+ real_llm_usd: Math.round(verdictLlmTotal * 10000) / 10000,
211
+ };
187
212
  } else if (taskLlmTotal > 0) {
188
213
  // savings_x intentionally NULL for source='tasks': it would always equal
189
214
  // HUMAN_RATE_PER_HR / LLM_RATE_PER_HR (e.g. 500) because both legs share
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "great-cto",
3
- "version": "2.83.0",
3
+ "version": "2.85.0",
4
4
  "description": "One command install for the great_cto Claude Code plugin. Auto-detects your stack, picks the right archetype, bootstraps PROJECT.md.",
5
5
  "keywords": [
6
6
  "claude-code",