sigrank 0.0.195 → 0.0.196

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.
Files changed (2) hide show
  1. package/adapters/index.mjs +16 -3
  2. package/package.json +1 -1
@@ -747,8 +747,16 @@ export const hermesAdapter = {
747
747
  // Native 4-pillar: metrics.input_tokens is FRESH input (does NOT include cache
748
748
  // read or cache creation — verified against live data where input=3 alongside
749
749
  // cache_creation_tokens=23500). cache_read_tokens and cache_creation_tokens are
750
- // separate fields (nullable → treat null as 0). output_tokens includes any
751
- // reasoning tokens (no separate reasoning field in metrics). No estimation needed.
750
+ // separate fields. output_tokens includes any reasoning tokens.
751
+ //
752
+ // CACHE_CREATION FALLBACK: the Devin CLI records cache_creation_tokens natively
753
+ // for Claude models (claude-sonnet-4-6, claude-opus-4-6) but writes NULL for
754
+ // GLM-5-2 and other non-Claude models. When the field is NULL, estimate
755
+ // cacheCreate from cache_read using the construction ratio (cw/cr = 0.0635)
756
+ // calibrated from the 8K Claude-era rows (50.3M cw / 792M cr). This preserves
757
+ // the compounding signal — without it, cacheCreate=0 makes every window look
758
+ // like a "stateless pipe" (no cache commits), which is a data gap, not reality.
759
+ const DEVIN_CONSTRUCTION_RATIO = 0.0635;
752
760
  export const devinAdapter = {
753
761
  platform: "devin",
754
762
  defaultRoot: () => join(homedir(), ".local", "share", "devin", "cli"),
@@ -773,7 +781,12 @@ export const devinAdapter = {
773
781
  const input = Number(row.input_tokens || 0);
774
782
  const output = Number(row.output_tokens || 0);
775
783
  const cacheRead = Number(row.cache_read_tokens || 0);
776
- const cacheCreate = Number(row.cache_creation_tokens || 0);
784
+ // Use native cache_creation_tokens when present; estimate from cache_read
785
+ // when NULL (GLM-5-2 era doesn't record the field).
786
+ const cacheCreate =
787
+ row.cache_creation_tokens != null
788
+ ? Number(row.cache_creation_tokens || 0)
789
+ : Math.round(cacheRead * DEVIN_CONSTRUCTION_RATIO);
777
790
  if (input + output + cacheRead + cacheCreate === 0) continue;
778
791
  yield {
779
792
  id: `devin:${row.row_id}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigrank",
3
- "version": "0.0.195",
3
+ "version": "0.0.196",
4
4
  "author": "SunrisesIllNeverSee (https://github.com/SunrisesIllNeverSee)",
5
5
  "description": "SigRank MCP server — the yield cascade + live leaderboard as MCP tools any agent can call",
6
6
  "mcpName": "io.github.SunrisesIllNeverSee/sigrank-mcp",