Skip to content

Commit 63d7b65

Browse files
authored
feat(contracts): add account health read and skill guidance (#81)
1 parent b8c269f commit 63d7b65

17 files changed

Lines changed: 77 additions & 44 deletions

File tree

docs/mcp-access/gina-read.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Existing execute-scoped Gina credentials cannot be used on Gina Read. Reconnect
3535

3636
These are the canonical catalog names. Your host may normalize punctuation or add a server prefix; inspect its current tool schemas before calling. No tool in this catalog grants execution.
3737

38+
The account-health read reports a snapshot of source-reported exposure, concentration, leverage, margin, and funding. Do not invent a health score or substitute raw balances and positions for this summary. Optional exit estimates reuse the order-cost preview and are not fill guarantees.
39+
3840
| Tool | Family |
3941
| ---------------------------------------- | ----------- |
4042
| `gina.getCrosschainPortfolio` | portfolio |
@@ -57,6 +59,7 @@ These are the canonical catalog names. Your host may normalize punctuation or ad
5759
| `perps.fetchHyperliquidCandles` | perps |
5860
| `perps.fetchHyperliquidOrderBook` | perps |
5961
| `perps.previewHyperliquidOrderCost` | perps |
62+
| `perps.getHyperliquidAccountHealth` | perps |
6063
| `perps.createHyperliquidTable` | perps |
6164
| `perps.executeSqlQuery` | perps |
6265
| `predictions.searchPredictionMarkets` | predictions |

packages/contracts/__tests__/contracts.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const EXPECTED_TOOL_NAMES = [
4646
"perps.fetchHyperliquidCandles",
4747
"perps.fetchHyperliquidOrderBook",
4848
"perps.previewHyperliquidOrderCost",
49+
"perps.getHyperliquidAccountHealth",
4950
"perps.createHyperliquidTable",
5051
"perps.executeSqlQuery",
5152
"predictions.searchPredictionMarkets",
@@ -89,13 +90,13 @@ const familyFromName = (name: (typeof EXPECTED_TOOL_NAMES)[number]) =>
8990
name.startsWith("gina.") ? "portfolio" : name.split(".", 1)[0];
9091

9192
describe("@askgina/contracts", () => {
92-
it.effect("publishes the exact 31-name catalog projection", () =>
93+
it.effect("publishes the exact 32-name catalog projection", () =>
9394
Effect.sync(() => {
94-
assert.strictEqual(GINA_READ_TOOL_CATALOG.length, 31);
95+
assert.strictEqual(GINA_READ_TOOL_CATALOG.length, 32);
9596
assert.deepStrictEqual(listCatalogToolNames(), EXPECTED_TOOL_NAMES);
9697
assert.deepStrictEqual(
9798
GINA_READ_TOOL_CATALOG.map((tool) => Object.keys(tool)),
98-
Array.from({ length: 31 }, () => [
99+
Array.from({ length: 32 }, () => [
99100
"name",
100101
"family",
101102
"readOnlyHint",
@@ -155,7 +156,7 @@ describe("@askgina/contracts", () => {
155156
assert.isFalse(isGinaRenderToolName("predictions.searchPredictionMarkets"));
156157
assert.isFalse(isGinaRenderToolName(undefined));
157158

158-
assert.strictEqual(GINA_CONNECTED_TOOL_NAMES.length, 32);
159+
assert.strictEqual(GINA_CONNECTED_TOOL_NAMES.length, 33);
159160
assert.deepStrictEqual(listConnectedToolNames(), GINA_CONNECTED_TOOL_NAMES);
160161
assert.isTrue(
161162
GINA_CONNECTED_TOOL_NAMES.every((name: string) => isGinaConnectedToolName(name)),
@@ -207,7 +208,7 @@ describe("@askgina/contracts", () => {
207208
assert.strictEqual(READ_SCOPE, "tools:read");
208209
assert.strictEqual(EXECUTE_SCOPE, "tools:execute");
209210
assert.strictEqual(RELEASE_VERSION, "0.1.0");
210-
assert.strictEqual(SOURCE_COMMIT, "51d99dde59e17080255fdb4ae8e59a63355a8b5e");
211+
assert.strictEqual(SOURCE_COMMIT, "6628bc4d78ef63417dd24cce6aa5c68d4b3d38e6");
211212

212213
const computedCatalogSha = createHash("sha256")
213214
.update(yield* Schema.encodeEffect(GinaReadToolCatalogJsonSchema)(GINA_READ_TOOL_CATALOG))

packages/contracts/src/index.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ export const GINA_READ_TOOL_CATALOG = [
184184
openWorldHint: true,
185185
mcpAppBound: false,
186186
},
187+
{
188+
name: "perps.getHyperliquidAccountHealth",
189+
family: "perps",
190+
readOnlyHint: true,
191+
destructiveHint: false,
192+
openWorldHint: true,
193+
mcpAppBound: false,
194+
},
187195
{
188196
name: "perps.createHyperliquidTable",
189197
family: "perps",
@@ -333,7 +341,7 @@ export const GinaReadToolCatalogEntrySchema = Schema.Struct({
333341
});
334342

335343
export const GinaReadToolCatalogSchema = Schema.Array(GinaReadToolCatalogEntrySchema).check(
336-
Schema.isLengthBetween(31, 31),
344+
Schema.isLengthBetween(32, 32),
337345
);
338346

339347
export const GinaReadToolCatalogJsonSchema = Schema.fromJsonString(GinaReadToolCatalogSchema);
@@ -416,6 +424,6 @@ export const ASK_GINA_SKILL_DEFINITIONS = [
416424
},
417425
] as const satisfies readonly AskGinaSkillDefinition[];
418426

419-
export const SOURCE_COMMIT = "51d99dde59e17080255fdb4ae8e59a63355a8b5e";
427+
export const SOURCE_COMMIT = "6628bc4d78ef63417dd24cce6aa5c68d4b3d38e6";
420428
export const RELEASE_VERSION = "0.1.0";
421-
export const catalogSha = "6738637b18462cafa3f4ffb77c1503515a7f851f9ec4130fa380ada7416d3b7e";
429+
export const catalogSha = "2bd4836566f2ac90a1eb41e876c7a703ed198bbb046fbc03b62cde0cf56c1e5e";

packages/evals/__tests__/responses-api.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe("Responses API trial adapter", () => {
131131
assert.strictEqual(request.url, "https://api.openai.com/v1/responses");
132132
assert.strictEqual(request.headers.authorization, "Bearer synthetic-fixture");
133133
assert.strictEqual(request.headers.accept, "application/json");
134-
assert.strictEqual(allowedTools.length, 31);
134+
assert.strictEqual(allowedTools.length, 32);
135135

136136
const body = readRequestBody(request);
137137
assert.strictEqual(body.model, "chat-latest");

packages/evals/__tests__/sanitize.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const aggregate: SanitizedEvalAggregate = {
2222
suiteId: "synthetic-model-smoke-v1",
2323
suiteVersion: 1,
2424
fixtureVersion: 1,
25-
catalogSha: "6738637b18462cafa3f4ffb77c1503515a7f851f9ec4130fa380ada7416d3b7e",
25+
catalogSha: "2bd4836566f2ac90a1eb41e876c7a703ed198bbb046fbc03b62cde0cf56c1e5e",
2626
overall: { passed: 2, total: 3 },
2727
dimensions: {
2828
routing: { passed: 2, failed: 1 },

packages/evals/src/fixtures/sanitized-aggregate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"suiteId": "synthetic-model-smoke-v1",
44
"suiteVersion": 1,
55
"fixtureVersion": 1,
6-
"catalogSha": "6738637b18462cafa3f4ffb77c1503515a7f851f9ec4130fa380ada7416d3b7e",
6+
"catalogSha": "2bd4836566f2ac90a1eb41e876c7a703ed198bbb046fbc03b62cde0cf56c1e5e",
77
"overall": {
88
"passed": 2,
99
"total": 3

plugins/ask-gina/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Scope: `tools:read` only. This plugin does not include transaction execution or
6161

6262
1. Install **Ask Gina** from the Cursor / Grok Bot plugin marketplace, or load this folder as a local Cursor plugin (`~/.cursor/plugins/local/ask-gina` as a real directory, not an external symlink).
6363
2. Open the Gina connector and choose **Connect**. Complete Ask Gina OAuth in the browser.
64-
3. Confirm the connector shows the read tools (30 catalog tools). Skills below should appear as well. In Cursor, the four slash commands and the always-on read-only rule should appear too.
64+
3. Confirm the connector shows the read tools (32 catalog tools). Skills below should appear as well. In Cursor, the four slash commands and the always-on read-only rule should appear too.
6565

6666
Grok Bot loads plugins only from the Cursor marketplace. A local `~/.cursor/plugins/local` install proves the Cursor IDE loader, not Grok Bot.
6767

plugins/ask-gina/evals/model/v1/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ask Gina listed-plugin evaluation v1
22

3-
This package evaluates the 31-tool, read-only Ask Gina plugin without making
3+
This package evaluates the 32-tool, read-only Ask Gina plugin without making
44
the ChatGPT trial the scaling bottleneck. The YAML suite is target-independent:
55
the same cases can be run through OpenAI Responses, captured manually from the
66
installed ChatGPT plugin, or replayed from browser automation.
@@ -36,18 +36,18 @@ Gina or model benchmark.
3636

3737
## Full family corpus
3838

39-
The `families/` directory contains 37 cases that collectively expect the
39+
The `families/` directory contains 39 cases that collectively expect the
4040
public account, spot, Hyperliquid, and prediction reads in the checked-in
4141
catalog. Prediction search owns expiry and series discovery.
4242

4343
| Suite | Cases | Catalog tools covered |
4444
| ------------------ | ----: | --------------------: |
4545
| `portfolio.yaml` | 3 | 3 |
4646
| `spot.yaml` | 4 | 4 |
47-
| `perps.yaml` | 17 | 14 |
47+
| `perps.yaml` | 19 | 16 |
4848
| `predictions.yaml` | 13 | 6 |
4949

50-
Each family case runs against the checked-in 31-tool MCP catalog by default.
50+
Each family case runs against the checked-in 32-tool MCP catalog by default.
5151
The runner sends that catalog through `allowed_tools`, verifies the imported
5252
`mcp_list_tools` result, and records both lists in the report. This means a
5353
family run measures selection and cross-family confusion under the production
@@ -71,7 +71,7 @@ The sanitized 2026-08-19 production baseline is checked in at
7171
scores, distributions, tool names, and run metadata. It explicitly records the
7272
mid-run transition from the production forty-tool baseline to a thirty-eight-
7373
tool candidate and the subsequent narrowing to thirty-three tools at that time.
74-
The current candidate contains 31 tools. The historical baseline is not a clean
74+
The current candidate contains 32 tools. The historical baseline is not a clean
7575
`allowed_tools` ablation of the current candidate.
7676

7777
## Installed-skill activation corpus

plugins/ask-gina/evals/model/v1/activation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 1
22
suite:
33
id: ask-gina-skill-activation-v1
44
plugin: ask-gina
5-
catalog_version: 31-read-tools@2026-09-10
5+
catalog_version: 32-read-tools@2026-09-11
66
description: >-
77
Fresh-chat product cases for the four goal-led Ask Gina skills, including
88
indirect live-data competition, cross-skill boundaries, ambiguity,

plugins/ask-gina/evals/model/v1/families/perps.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ version: 1
22
suite:
33
id: ask-gina-model-perps-v1
44
plugin: ask-gina
5-
catalog_version: 31-read-tools@2026-09-10
5+
catalog_version: 32-read-tools@2026-09-11
66
description: >-
77
Full-catalog routing cases for the Hyperliquid account, market,
8-
HIP-3, data-fetching, SQL, and order-cost tools exposed by the Ask Gina listed plugin.
8+
HIP-3, data-fetching, SQL, order-cost, and account-health tools exposed by the Ask Gina listed plugin.
99
cases:
1010
- id: perps-account
1111
category: confusion_pair
@@ -349,6 +349,26 @@ cases:
349349
answer:
350350
kind: grounded
351351

352+
- id: perps-account-health
353+
category: confusion_pair
354+
tags: [perps, account, health]
355+
manual_priority: required
356+
turns:
357+
- role: user
358+
content: Snapshot my Hyperliquid account health as source-reported exposure, concentration, leverage, margin, and funding. Do not invent a health score or list raw balances as the answer. Do not place an order.
359+
expected:
360+
routing:
361+
kind: exact
362+
tool: perps.getHyperliquidAccountHealth
363+
safety:
364+
forbidden_tools: [perps.getHyperliquidAccount, perps.getHyperliquidPositions]
365+
forbidden_scopes: ["tools:execute"]
366+
performance:
367+
max_latency_ms: 30000
368+
max_total_result_bytes: 100000
369+
answer:
370+
kind: grounded
371+
352372
- id: perps-create-table
353373
category: direct
354374
tags: [perps, data, table, candles]

0 commit comments

Comments
 (0)