great-cto 2.85.0 → 2.85.2
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.85.
|
|
5
|
+
"version": "2.85.2",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Great CTO",
|
|
8
8
|
"url": "https://github.com/avelikiy/great_cto"
|
|
@@ -81,18 +81,28 @@ function readVerdicts(cwd = null) {
|
|
|
81
81
|
}
|
|
82
82
|
} // end verdictDirs loop
|
|
83
83
|
|
|
84
|
-
// Fallback: enrich verdicts that lack cost_usd from
|
|
85
|
-
// Format: "<ISO-ts> <agent> <cost_usd>" per line
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
// Fallback: enrich verdicts that lack cost_usd from cost-history.log.
|
|
85
|
+
// Format: "<ISO-ts> <agent> <cost_usd>" per line. Both scripts/log-verdict.sh
|
|
86
|
+
// and the SubagentStop measured-cost hook write it PROJECT-LOCAL
|
|
87
|
+
// (<cwd>/.great_cto/cost-history.log) — reading only the global ~/.great_cto
|
|
88
|
+
// copy (as this did before) meant the enrichment never fired for real
|
|
89
|
+
// projects. Read project-local first, global second. Match by ts (minute
|
|
90
|
+
// precision) + agent to avoid double-counting.
|
|
91
|
+
const histPaths = [
|
|
92
|
+
cwd ? path.join(cwd, '.great_cto', 'cost-history.log') : null,
|
|
93
|
+
path.join(GREAT_CTO_DIR, 'cost-history.log'),
|
|
94
|
+
].filter(Boolean);
|
|
95
|
+
{
|
|
89
96
|
const costByKey = new Map();
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
for (const histPath of histPaths) {
|
|
98
|
+
if (!fs.existsSync(histPath)) continue;
|
|
99
|
+
const lines = fs.readFileSync(histPath, 'utf8').split('\n').filter(Boolean);
|
|
100
|
+
for (const line of lines) {
|
|
101
|
+
const m = line.match(/^(\S+)\s+(\S+)\s+(\d+\.?\d*)/);
|
|
102
|
+
if (!m) continue;
|
|
103
|
+
const key = `${m[1].slice(0, 16)}|${m[2]}`; // minute + agent
|
|
104
|
+
if (!costByKey.has(key)) costByKey.set(key, parseFloat(m[3])); // project wins
|
|
105
|
+
}
|
|
96
106
|
}
|
|
97
107
|
for (const v of results) {
|
|
98
108
|
if (v.cost_usd != null) continue;
|
package/package.json
CHANGED