sigrank 1.0.19 → 1.0.25

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.
package/README.md CHANGED
@@ -330,14 +330,18 @@ Or if installed globally:
330
330
  ## Cascade math
331
331
 
332
332
  ```
333
- Υ Yield = (cache_read × output) / input²
334
- SNR = output / (input + output)
335
- Leverage = cache_read / input
336
- Velocity = output / input
337
- 10xDEV = log₁₀(leverage)
333
+ Υ Yield = (cache_read × output) / input² (TTEOP canonical)
334
+ SNR = output / (input + output) (display alias for output_fraction)
335
+ Leverage = cache_read / input (TTEOP canonical)
336
+ Velocity = output / input (TTEOP canonical)
337
+ 10xDEV = log₁₀(leverage) (display alias for log_leverage)
338
338
  ```
339
339
 
340
- Math is in `cascade.mjs`, dependency-free. Mirrors `sigrank-app/lib/ingest/bridge.ts`.
340
+ Canonical metric computation is delegated to [`tteop-spec`](https://www.npmjs.com/package/tteop-spec)
341
+ via [`@sigrank/cascade`](https://www.npmjs.com/package/@sigrank/cascade). SNR
342
+ and 10xDEV are SigRank display aliases for the TTEOP metrics `output_fraction`
343
+ and `log_leverage` respectively. See `TTEOP-IMPLEMENTATION-PROFILE.md` for the
344
+ full authority chain.
341
345
  Canon check: `MO§ES (1251211, 11296121, 128196310, 2555179769) → Υ 18436.98`.
342
346
 
343
347
  ---
@@ -455,7 +459,7 @@ Tests verify (14 groups, 313 assertions):
455
459
  | `proxy.mjs` | Opt-in loopback Anthropic/OpenAI proxy and usage capture |
456
460
  | `cli.mjs` | CLI commands: board, compare, watch, enroll, submit, help |
457
461
  | `tui.mjs` | Full tabbed TUI: Dashboard / Trends / Compare / Board / Watch / Connect |
458
- | `cascade.mjs` | Pure cascade math (Υ, SNR, leverage, velocity, 10xDEV, class) |
462
+ | `cascade.mjs` | Cascade facade — delegates to `@sigrank/cascade` → `tteop-spec` (Υ, SNR, leverage, velocity, 10xDEV, class) |
459
463
  | `tokenpull.mjs` | On-device log scanner — Claude, Codex, multi-platform |
460
464
  | `adapters.mjs` | Platform adapter registry (16+ platforms) |
461
465
  | `tools.mjs` | MCP tool table + dispatcher |
@@ -2,8 +2,9 @@
2
2
  * cascade.mjs — SigRank yield cascade facade.
3
3
  *
4
4
  * The canonical cascade math (Υ Yield, SNR, Leverage, Velocity, 10xDEV, and the
5
- * 24-stage RS05 class taxonomy) now lives in the `@sigrank/cascade` package.
6
- * This file re-exports the canonical functions and adds local-only helpers that
5
+ * 24-stage RS05 class taxonomy) lives in the `@sigrank/cascade` package, which
6
+ * delegates canonical TTEOP metric computation to `tteop-spec`. This file
7
+ * re-exports the canonical functions and adds local-only helpers that
7
8
  * are presentation/MCP-specific and intentionally NOT part of the canonical
8
9
  * math package:
9
10
  * - CLASS_TIERS, SIGNAL_CLASSES, UNCLASSED (display taxonomy)
@@ -11,6 +12,8 @@
11
12
  * - detectMode(), MODE_EXPECTED_YIELD, qualityScore() (mode/quality layer)
12
13
  * - parsePillars() (text → 4 pillars extractor)
13
14
  *
15
+ * Authority chain: sigrank-mcp → @sigrank/cascade → tteop-spec
16
+ *
14
17
  * The cascade() wrapper preserves the object-signature
15
18
  * ({ input, output, cacheCreate, cacheRead }) used throughout this repo and
16
19
  * re-attaches the `mode` field (detectMode) that the canonical package
@@ -19,7 +22,7 @@
19
22
  *
20
23
  * Canonical reference: MO§ES Υ 18436.98 from (1251211, 11296121, 128196310, 2555179769).
21
24
  *
22
- * Degenerate-input policy (inherited from the canonical package):
25
+ * Degenerate-input policy (inherited from tteop-spec via @sigrank/cascade):
23
26
  * - Any pillar that collapses a denominator (i=0, o=0, cw=0, cr=0) returns null for
24
27
  * the affected metrics rather than Infinity/NaN.
25
28
  * - A `warnings[]` array is attached when any metric is null so callers can surface the
@@ -57,10 +60,15 @@ export {
57
60
  * The four raw token pillars → the cascade.
58
61
  *
59
62
  * Object-signature wrapper around the canonical `@sigrank/cascade` cascade()
60
- * (which takes positional args). Re-attaches the `mode` field via detectMode()
61
- * so the 20+ call sites in this repo that read `result.mode` keep working.
63
+ * (which takes positional args). Accepts null for cacheCreate/cacheRead
64
+ * (unavailable cache) and passes null through to tteop-spec via cascade.
65
+ * Re-attaches the `mode` field via detectMode() so the 20+ call sites in
66
+ * this repo that read `result.mode` keep working.
62
67
  */
63
68
  export function cascade({ input, output, cacheCreate, cacheRead }) {
69
+ // Pass null through to cascade (→ tteop-spec) for canonical null semantics.
70
+ // detectMode receives the raw values (Number(null) = 0, which is fine for
71
+ // mode classification).
64
72
  const result = cascadeCanonical(input, output, cacheCreate, cacheRead);
65
73
  // Re-attach mode — the canonical package intentionally omits it (mode is a
66
74
  // presentation-layer concern, not canonical math).
package/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/anthropics/mcpb/main/schemas/mcpb-manifest-v0.4.schema.json",
3
3
  "manifest_version": "0.4",
4
4
  "name": "sigrank",
5
- "version": "1.0.18",
5
+ "version": "1.0.24",
6
6
  "description": "Ranks AI coding operators by token cascade efficiency (Yield = cache_read \u00d7 output / input\u00b2). 25 tools including SigRank Standard record, yield calculation, local token usage pulls, signed submission, and tokscale-powered analytics (market share, developer profiles, model trends, cost analysis, device profiles, MCP usage, competitive intelligence). Privacy-first: runs locally, only four token counts leave the machine.",
7
7
  "author": {
8
8
  "name": "SunrisesIllNeverSee",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigrank",
3
- "version": "1.0.19",
3
+ "version": "1.0.25",
4
4
  "author": "SunrisesIllNeverSee (https://github.com/SunrisesIllNeverSee)",
5
5
  "description": "Upsilon measurement engine distributed through the sigrank CLI/MCP compatibility package, with SigRank public leaderboard tools.",
6
6
  "mcpName": "io.github.SunrisesIllNeverSee/sigrank-mcp",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "scripts": {
26
26
  "start": "node index.mjs",
27
- "test": "node test.mjs && node __tests__/sign.test.mjs && node --test __tests__/cascade.test.mjs __tests__/badges.test.mjs __tests__/tui-input.test.mjs __tests__/standard-record.test.mjs __tests__/standard-cli.test.mjs __tests__/product-architecture.test.mjs",
27
+ "test": "node test.mjs && node --test __tests__/sign.test.mjs __tests__/cascade.test.mjs __tests__/badges.test.mjs __tests__/tui-input.test.mjs __tests__/standard-record.test.mjs __tests__/standard-cli.test.mjs __tests__/product-architecture.test.mjs __tests__/tteop-delegation.test.mjs",
28
28
  "test:packaged": "node scripts/packed-artifact-smoke.mjs",
29
29
  "sync:platforms": "node scripts/sync-platforms.mjs",
30
30
  "sync:spine": "node scripts/sync-spine.mjs",
@@ -85,9 +85,10 @@
85
85
  ],
86
86
  "dependencies": {
87
87
  "@modelcontextprotocol/sdk": "^1.0.0",
88
- "@sigrank/cascade": "^0.1.1",
88
+ "@sigrank/cascade": "^0.2.1",
89
89
  "ccusage": "^20.0.19",
90
- "tokscale": "^4.7.0"
90
+ "tokscale": "^4.7.0",
91
+ "tteop-spec": "0.1.5-draft"
91
92
  },
92
93
  "devDependencies": {
93
94
  "@resvg/resvg-js": "^2.6.2",
@@ -55,7 +55,7 @@ export async function handleDescribePowerUser() {
55
55
  metrics_explained: {
56
56
  yield_: "Yield (Υ) measures how well you compound signal, not how much you burn. High yield = your cached context is doing work for you.",
57
57
  leverage: "Leverage (Cr/I) measures how much you reuse prior work vs starting fresh. High leverage = you're building on cached results, not re-explaining everything.",
58
- velocity: "Velocity (O/I) measures how much output you get per token spent. High velocity = you're productive, not just active.",
58
+ velocity: "Velocity (O/I) measures how much output you get per token spent. High velocity = you're efficient, not just active.",
59
59
  },
60
60
  // The 8 base tiers + UNCLASSED, in descending cut order (matches
61
61
  // analytics/cascade.mjs CLASS_TIERS). Each tier has 3 sub-stages (I/II/III)
@@ -10,7 +10,7 @@ import { LEADERBOARD_METRIC } from "../lib/constants.mjs";
10
10
  export const TOOL_DEF = {
11
11
  name: "get_best_operator",
12
12
  description:
13
- "Returns the top N operators on the SigRank leaderboard with behavioral framing in power-user language. Wraps get_leaderboard and adds plain-language interpretation of each top operator's cascade: what their yield, leverage, and velocity mean in terms of AI power-user behavior (cache reuse, input economy, output productivity). Use this when users ask 'who is the best AI user?' or 'who tops the SigRank leaderboard?' or 'show me the AI user leaderboard'. Do NOT use get_leaderboard if you want the raw array without interpretation — use this for the power-user framing. Intent: BEST_OPERATOR.",
13
+ "Returns the top N operators on the SigRank leaderboard with behavioral framing in operator-language. Wraps get_leaderboard and adds plain-language interpretation of each top operator's cascade: what their yield, leverage, and velocity mean in terms of AI operator behavior (cache reuse, input economy, output efficiency). Use this when users ask 'who is the best AI user?' or 'who tops the SigRank leaderboard?' or 'show me the AI user leaderboard'. Do NOT use get_leaderboard if you want the raw array without interpretation — use this for the operator-behavior framing. Intent: BEST_OPERATOR.",
14
14
  annotations: { title: "Get best operator", ...ANNOTATIONS.readOnlyHint, ...ANNOTATIONS.openWorldHint },
15
15
  inputSchema: {
16
16
  type: "object",
@@ -2,12 +2,16 @@ import { cascade } from "../analytics/cascade.mjs";
2
2
  import { ANNOTATIONS } from "./_schemas.mjs";
3
3
 
4
4
  export const SIGRANK_STANDARD_VERSION = "sigrank/0.1-draft";
5
+ export const TTEOP_PROTOCOL_VERSION = "tteop/0.1-draft";
6
+ export const TTEOP_SPEC_VERSION = "tteop-spec@0.1.5-draft";
5
7
  export const PRODUCT_ARCHITECTURE = Object.freeze({
6
8
  brand: "SignalAF",
7
9
  governance: "MO§ES™",
8
10
  product: "Upsilon",
9
11
  leaderboard: "SigRank",
10
12
  wire_spec: SIGRANK_STANDARD_VERSION,
13
+ protocol: TTEOP_PROTOCOL_VERSION,
14
+ protocol_authority: TTEOP_SPEC_VERSION,
11
15
  });
12
16
 
13
17
  export const TOOL_DEF = {
@@ -39,9 +43,20 @@ export const TOOL_DEF = {
39
43
  outputSchema: {
40
44
  type: "object",
41
45
  additionalProperties: false,
42
- required: ["spec", "timestamp", "source", "telemetry", "metrics", "warnings"],
46
+ required: ["spec", "spec_status", "protocol", "timestamp", "source", "telemetry", "metrics", "warnings"],
43
47
  properties: {
44
- spec: { const: SIGRANK_STANDARD_VERSION, description: "SigRank specification version." },
48
+ spec: { const: SIGRANK_STANDARD_VERSION, description: "Legacy wire identifier. Resolves to TTEOP tteop/0.1-draft." },
49
+ spec_status: { const: "legacy_alias", description: "Indicates this spec identifier is a legacy alias, not a current protocol." },
50
+ protocol: {
51
+ type: "object",
52
+ additionalProperties: false,
53
+ required: ["name", "version", "authority"],
54
+ properties: {
55
+ name: { const: "TTEOP", description: "Canonical protocol name." },
56
+ version: { const: TTEOP_PROTOCOL_VERSION, description: "Current TTEOP protocol version." },
57
+ authority: { const: TTEOP_SPEC_VERSION, description: "Canonical executable/reference implementation." }
58
+ }
59
+ },
45
60
  timestamp: { type: "string", format: "date-time", description: "ISO-8601 record timestamp." },
46
61
  source: {
47
62
  type: "object",
@@ -110,24 +125,24 @@ export async function handleGetSigRankStandardRecord(args) {
110
125
  const cacheWrite = tokenCount(args?.cache_write, "cache_write", false);
111
126
  const cacheRead = tokenCount(args?.cache_read, "cache_read", false);
112
127
 
128
+ // Pass null through to cascade (→ tteop-spec) so canonical null semantics
129
+ // apply directly. Passing 0 would produce 0-valued metrics instead of null,
130
+ // losing the unavailable/zero distinction. No manual null override needed.
113
131
  const c = cascade({
114
132
  input,
115
133
  output,
116
- cacheCreate: cacheWrite ?? 0,
117
- cacheRead: cacheRead ?? 0,
134
+ cacheCreate: cacheWrite,
135
+ cacheRead: cacheRead,
118
136
  });
119
- // Standard warning order: cache-unavailability warnings precede the
120
- // dev10x_undefined warning (the "why" before the "what"). The standalone
121
- // conformance runner validates warnings as ordered arrays.
122
- const warnings = [];
123
- if (cacheWrite === null) warnings.push("cache_write is unavailable; 10xDEV is undefined.");
124
- if (cacheRead === null) warnings.push("cache_read is unavailable; Yield, Leverage, and 10xDEV are undefined.");
125
- for (const w of (c.warnings || [])) {
126
- if (!warnings.includes(w)) warnings.push(w);
127
- }
128
137
 
129
138
  return {
130
139
  spec: SIGRANK_STANDARD_VERSION,
140
+ spec_status: "legacy_alias",
141
+ protocol: {
142
+ name: "TTEOP",
143
+ version: TTEOP_PROTOCOL_VERSION,
144
+ authority: TTEOP_SPEC_VERSION,
145
+ },
131
146
  timestamp: recordTimestamp(args?.timestamp),
132
147
  source: {
133
148
  provider: args?.provider || "unknown",
@@ -141,12 +156,12 @@ export async function handleGetSigRankStandardRecord(args) {
141
156
  cache_read: cacheRead,
142
157
  },
143
158
  metrics: {
144
- yield: cacheRead === null ? null : c.yield,
145
- leverage: cacheRead === null ? null : c.leverage,
159
+ yield: c.yield,
160
+ leverage: c.leverage,
146
161
  velocity: c.velocity,
147
162
  snr: c.snr,
148
- dev10x: cacheWrite === null || cacheRead === null ? null : c.dev10x,
163
+ dev10x: c.dev10x,
149
164
  },
150
- warnings,
165
+ warnings: c.warnings || [],
151
166
  };
152
167
  }