Skip to content

fix: sweep the skills, which nobody had swept - #86

Merged
VickyXAI merged 1 commit into
mainfrom
fix/remaining-stale-numbers
Jul 27, 2026
Merged

fix: sweep the skills, which nobody had swept#86
VickyXAI merged 1 commit into
mainfrom
fix/remaining-stale-numbers

Conversation

@VickyXAI

Copy link
Copy Markdown
Contributor

Found by sweeping for the shape of a claim — a number in front of the claim vocabulary — rather than for phrasings anyone remembered. Three earlier passes over these repos had each grepped differently and each missed a different subset.

What was stale

See the commit for the per-file list. All values now come from the published artifact, and sync-brand-numbers --check is clean outside CHANGELOG.md, which is history and stays as written.

Frontmatter takes literals, not markers

A SKILL.md YAML description: is a string an agent reads when deciding whether to load the skill — an HTML comment there is part of the string, not invisible. Same for headings, where it leaks into the anchor slug. Those counts are asserted in the test suite instead, the same trade already made for package.json and the shields badges.

skills/*/SKILL.md is loaded into an agent's context. Those files said "40+
chains" in four places for a list with exactly 40 entries, and CONTRIBUTING.md
told contributors a correct tools/list returns 18 — teaching the wrong
expectation to the next person who adds one.

Found by sweeping for the shape of a claim rather than for remembered
phrasings; skills/ had never been looked at in three earlier passes.

Frontmatter and headings take literals, not markers: a comment is part of the
YAML string an agent reads, and inside a heading it leaks into the anchor slug.
The frontmatter counts are asserted in test/brand-numbers.test.ts instead.

Remaining audit hits are all legitimate — the 19-tool badge, Surf's 13 on-chain
SQL chains, and dated planning docs under docs/plans, which are history.
@VickyXAI
VickyXAI merged commit c77ba38 into main Jul 27, 2026
1 check passed
@VickyXAI
VickyXAI deleted the fix/remaining-stale-numbers branch July 27, 2026 18:11
VickyXAI added a commit to KillerQueen-Z/blockrun-mcp that referenced this pull request Jul 27, 2026
BlockRunAI#86 added the br:mcp.tools marker to CONTRIBUTING.md with the then-current 19.
This branch ships a 20th tool, so the merge was textually clean but left the
marker stale, and CI's 'Brand numbers' step failed on it.

That step runs scripts/sync-brand-numbers.mjs --check, which npm test does not
cover — local green was not enough to catch this.
VickyXAI added a commit that referenced this pull request Jul 28, 2026
* Prepare Stanford signal-to-trade demo

* Harden Codex signal-to-trade demo flow

* Polish read-only trading demo preview

* fix(markets,errors): stop the pre-payment validator and error classifier from blocking valid work

Four defects found reviewing this branch, each verified against the gateway
source or reproduced directly.

markets-validation: the Gamma blocklist rejected `search`, `sort`, `end_after`,
and `end_before` on polymarket/markets{,/keyset}. All four are spec-backed
Predexon filters (blockrun/src/lib/predexon.ts POLYMARKET_MARKET_PARAMS, where
P_SEARCH is documented as "this param is `search` here, NOT `q`"), so the
validator refused the exact query the demo needs — open BTC markets ending
after a date, sorted by liquidity — before payment. Narrowed to the params
that really are Gamma-only: active, closed, order, ascending.

markets-validation: markets/listings was hard-blocked as "no longer exposed",
but the gateway still registers it (predexon.ts:155), maps its params (:348),
routes it (:527), and advertises it as a priced Tier-1 endpoint in the x402
manifest. Unblocked and restored in the tool description and skill tables.

errors: `/5[0-9]{2}/` matched any bare 5xx-shaped number, so "max_tokens 512 is
above the limit" was reported as a temporary outage with "try again in a few
minutes" — hiding a validation bug behind retry advice. A 5xx now has to be
labelled as a status (adjacency required) or carry an HTTP reason phrase.

errors: dropping "api error after payment" from isServerError sent post-payment
upstream failures with no parseable status into the payment branch, telling
users to fund a wallet that was never the problem. Restored for the non-4xx case.

payment-serialization: the queue is process-global and each waiter awaited its
predecessor unconditionally, so one x402 call that never settled would wedge
every paid tool until restart. Waiters now give up after a bounded wait
(BLOCKRUN_PAYMENT_QUEUE_MAX_WAIT_MS, default 120s) — losing serialization on one
call beats a permanently stuck server.

Tests updated where they asserted the old behavior; 274 pass, typecheck and
build clean.

* revert(polymarket): keep the Finland CLOB default; split the egress change into its own PR

The default CLOB host flip (Finland relay -> direct clob.polymarket.com) removes
order placement for every US/UK user by default — the repo's headline capability
— and it was landing as a side effect of demo prep. Reverted here so this PR
ships only the annotations, the read-only tool, pre-payment validation, and the
demo material. The egress question gets decided on its own merits.

Restored to main: CLOB_HOST default, setup's blocked-region guidance, the 403
mapClobError text, the tool description, the README Regions paragraph and env
table row, the setup guide's §3 and troubleshooting rows, and the skill's
regions section (plus the test that asserted the new 403 wording).

Kept from this branch, since they are independent of the default: the
blockrun_polymarket_read flow through the docs and skill, markets/search-based
discovery, and client.ts's comment cleanup.

The Stanford runbook now sets POLYMARKET_CLOB_HOST=https://clob.polymarket.com
explicitly on the presentation machine — with the Finland default restored,
setup would otherwise report a permitted region from the venue and the demo's
region-honesty claim would not hold. Also fixed the Claude Code install snippet,
which passed POLYMARKET_MAX_SESSION_USD without its own -e flag.

package.json: drop `docs` from files, so the internal Stanford runbook stops
shipping to every npx consumer (verified: 0 docs entries in npm pack).

274 tests pass, typecheck and build clean.

* fix(annotations,validation): annotate by effect, and stop enforcing unverified API contracts

Closes the four items left open by the review of this branch.

Annotations described price, not effect. `destructiveHint` means "irreversible
update" and is only meaningful when `readOnlyHint` is false — it says nothing
about money, and MCP has no cost hint. Marking blockrun_markets/search/exa/surf
destructive because they settle $0.0095 makes every annotation-honoring client
demand approval for a plain lookup, which cuts hardest against the research and
demo flows this branch adds. Spend control already lives in the budget ledger
(BLOCKRUN_BUDGET_LIMIT, reserveBudget, per-agent delegation).

Reassigned by what a tool actually does:
- paid reads (markets, search, exa, surf, defi, price) -> readOnly + openWorld
- generative (chat, image, video, music, speech, realface) -> write, not
  destructive; the shape MCP defines for a benign write
- rpc -> destructive. It was `paidPrivate`; eth_sendRawTransaction can broadcast
  a signed transaction, so this is an upgrade, not a relaxation
- modal -> destructive. Executes arbitrary code in a sandbox
Verified over stdio tools/list, not just at the registration call: 20 tools, 4
destructive (modal, phone, polymarket, rpc). Tests now pin the full matrix and
fail if a new tool ships unannotated — which under the spec would silently
default to destructive.

Serialization scope made deliberate rather than accidental. Added the two fast
paid data tools that were missed (search, exa) and documented why the
long-running ones are excluded: queueing a 5ms price lookup behind a 3-minute
video render trades a rare settlement race for a guaranteed stall. The race is
still reachable across a media call and a data call; that needs a wallet/nonce
fix, not a queue.

Two validator rules were enforcing guesses, and a wrong pre-payment rule blocks
an endpoint users are paying for:
- candlesticks: "1h fails" is observed, "interval is mandatory" is not. Now
  validates the value only when one is supplied.
- smart-money: the observed failure was the UNFILTERED call. Now requires any
  recognized cohort filter instead of invented magnitudes (min_trades >= 100,
  PnL >= $1000, ROI >= 0.15), which would have rejected a 7d window or a
  20-trade cohort with no override.

278 tests pass, typecheck and build clean.

* chore: sync brand numbers after merging main

#86 added the br:mcp.tools marker to CONTRIBUTING.md with the then-current 19.
This branch ships a 20th tool, so the merge was textually clean but left the
marker stale, and CI's 'Brand numbers' step failed on it.

That step runs scripts/sync-brand-numbers.mjs --check, which npm test does not
cover — local green was not enough to catch this.

---------

Co-authored-by: VickyXAI <115643921+VickyXAI@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant