feat: @hashpower/collateral-abi package + semver-aware auto-publish - #47
Merged
Conversation
…eline Publishes viem-ready vault/margin-engine/points ABIs plus a testnet/mainnet deployments manifest (addresses verified on-chain). CI computes the semver bump by diffing the ABI surface against the last published version and publishes via npm Trusted Publishing (OIDC, tokenless) with Slack announce. v1.0.0 published manually to bootstrap the trust. Co-authored-by: Cursor <cursoragent@cursor.com>
Guarantees committed ABIs in contracts/abi/ always match compiled output — the publish pipeline and semver classifier depend on them being truthful. Ported from hashprice-oracle. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pillar 1 of the Agent Access Layer — same template as Lumerin-protocol/hashprice-oracle#83.
collateral-abi/— publishable@hashpower/collateral-abi(v1.0.0 live; published manually to bootstrap npm Trusted Publishing). Vault, PortfolioMarginEngine, and Points ABIs with fullas constliteral types for viem, plus raw JSON underjson/. Zero runtime dependencies.collateral-abi/deployments.json— testnet addresses taken from the GitHubdevenvironment and verified on-chain (vault'smarginEngine()returns the PME address; collateral token matches testnet USDC).mainnetempty until deploy. Vault subgraph omitted — no dev deployment exists yet (filling it in later auto-publishes a patch)..github/workflows/publish-collateral-abi.yml— auto-publish ondevpushes touchingcontracts/abi/**orcollateral-abi/**: computed semver via ABI-surface diff (removed/changed → major, added → minor, metadata → patch, identical → skip), tokenless OIDC publish in thenpm-publishenvironment, Slack announce via the shared action. Trigger flips tomainat GA.Also included:
check-contracts-abi.yml— the ABI drift check this repo was missing (ported from hashprice-oracle, triggers ondev/main). The publish pipeline trustscontracts/abi/; this makes that trust CI-enforced.Test plan
cd collateral-abi && pnpm install && pnpm build— 10 ABI modules, clean tscnpm-publishGitHub environment created (deployment branch rule:dev)publish-collateral-abi.yml+ envnpm-publishMade with Cursor