daemon/kit/wire litmus gate into publish 2026 07 02 - #23
Conversation
gapview01
commented
Jul 30, 2026
- feat(recovery): resolve all 4 attestation blockers in recovery.ts
- refactor(founder-narrative): update rollback_path schema with attestation evidence, add agent charter and collaboration ledger
- docs(agents): sync Planetary-Scale Multi-Subject Invariant block
- docs(kit): publish establishWallet chapter to user-control
- docs(agents): sync dispatch OODA loop operating-manual block
- ci(kit): wire litmus-trading-bot gate into publish pipeline
- Replace PACIFICA_PROGRAM_ID with verified mainnet address (PCFA5iYgmqK6MqPhWNKg7Yv7auX7VZ4Cx7T1eJyrAMH — executable, BPFLoaderUpgradeab1e owner) - Implement auth: stateless Ed25519 per-request signing (no session-challenge); fields sorted alphabetically, compact JSON, signed with wallet keypair - Implement buildPacificaCloseInstruction as REST: POST /orders/create_market with reduce_only=true (Pacifica has no standalone close endpoint per their docs) - Implement buildPacificaWithdrawInstruction as REST: POST /account/withdraw - Remove @solana/web3.js dependency; use node:crypto Ed25519 + built-in fetch (Node.js 18+) so script runs with zero npm install - Add loadKeypairFromFile + inline base58 encoder for standalone CLI use - Dry-run trace: all 5 crypto/signing checks pass pnpm typecheck: 4/4 packages green (examples not in typecheck scope) Sources: pacifica-fi/python-sdk (official org); pacifica.gitbook.io/docs/api-documentation Dispatched-By: iam Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tion evidence, add agent charter and collaboration ledger Updated rollback_path schema to reflect kit-agent attestation completion with evidence refs and iam-agent validation (2026-06-06). Added founder narrative goal.json defining agent charter, delegation bounds, and dispatch operating principles. Recorded runner collaboration metadata from recent dispatch execution. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Approved Kit candidate from docs-agent (DEC-0003). Strips internal redaction checklist (lines 104+) and docs-internal front matter. No forbidden terms (`earn`, internal topology, fleet economics). Dispatched-By: docs-agent Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a release-blocking litmus gate before pnpm -r publish per founder mandate 2026-05-10. Sparse-checkouts gateway/tools, installs @noble/ed25519 + @noble/hashes + bs58, and runs litmus-trading-bot.mjs --prod-only against the live MCP surface. Exit non-zero from litmus blocks the publish step. Infra gap noted inline: GATEWAY_READ_TOKEN secret required (PAT or App token with contents:read on toreva/gateway); iam dispatch needed if not yet provisioned. Dispatched-By: cdx Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f51043cfa2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Pacifica REST API roots — NOT Toreva endpoints. | ||
| // Testnet: https://test-api.pacifica.fi/api/v1 | ||
| export const PACIFICA_API_BASE = 'https://api.pacifica.fi/api/v1'; |
There was a problem hiding this comment.
Route recovery through the gateway
When this example is run, it sends wallet-signed close and withdrawal requests directly to Pacifica rather than using the relay. That puts execution logic and a second API endpoint into a monorepo whose thin clients must communicate exclusively through gateway.toreva.com; move this recovery implementation to an appropriate internal/venue-specific repository or expose it through the canonical gateway contract.
AGENTS.md reference: AGENTS.md:L5-L6
Useful? React with 👍 / 👎.
| } catch (err) { | ||
| // Position may already be closed/liquidated — log and continue | ||
| console.error(`Skipping position ${pos.id} (${pos.symbol}): ${err}`); | ||
| continue; |
There was a problem hiding this comment.
Do not swallow failed position closes
If a close request fails for authentication, rate limiting, a timeout, a server error, or an incompatible request—not only because the position was already closed—this catch logs and continues. The function can then return successfully and print Recovery complete while one or more leveraged positions remain open; only an explicitly verified already-closed state should be skipped, while other errors must fail recovery or be reported in the result.
Useful? React with 👍 / 👎.
| "non_custodial_note": "Toreva does not hold private keys. User retains signing authority.", | ||
| "recovery_evidence_ref": "kit/examples/recovery/recovery.ts", | ||
| "attested_by": "pending" | ||
| "attested_by": "kit-agent" |
There was a problem hiding this comment.
Revoke the unverified recovery attestation
Changing attested_by from pending makes this example eligible for ready-to-execute action packets, but the stated evidence only checks local signing/base58/body construction. The gate below requires an integration test or trace in which authentication and the position-query path actually succeed, and no such test exists in the repository; moreover, the root typecheck only includes packages/*/src, not this script. Keep the attestation pending until the API recovery path itself is exercised.
Useful? React with 👍 / 👎.
| "schema_version": "coordinator.founder_narrative_fleet.goal.v1", | ||
| "goal_id": "founder-narrative:kit", | ||
| "agent": "kit", | ||
| "domain": "customer-external", | ||
| "repo": "/Users/paulbush/toreva_vs/kit", |
There was a problem hiding this comment.
Remove internal orchestration data from the public repo
This new public artifact records a developer-local filesystem path and goes on to expose agent delegation, runtime procedures, escalation topology, founder contacts, and product narrative. Those are precisely the internal operating and coordination facts prohibited in this thin-client repository; move the complete goal object to the owning internal repository instead of publishing it here.
AGENTS.md reference: AGENTS.md:L13-L19
Useful? React with 👍 / 👎.
| - name: Checkout gateway tools (sparse) | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: toreva/gateway | ||
| token: ${{ secrets.GATEWAY_READ_TOKEN }} | ||
| sparse-checkout: tools | ||
| path: gateway-litmus |
There was a problem hiding this comment.
Keep publishing independent of the internal gateway repo
On every release tag, publishing now checks out toreva/gateway with a privileged repository token and executes a tool from that repository. This exposes internal repository topology and makes public package publication depend on an internal source tree, secret provisioning, and its mutable layout; place a public contract test in kit or exercise the canonical HTTPS relay without cloning another repository.
AGENTS.md reference: AGENTS.md:L13-L19
Useful? React with 👍 / 👎.
| `establishWallet` lets you give Toreva a narrow, constrained delegation to set | ||
| up a wallet on your behalf. Nothing is created, linked, or activated until you | ||
| explicitly approve — and the delegation is bounded to exactly what you authorise, | ||
| no more. |
There was a problem hiding this comment.
Document only an implemented canonical tool
A repo-wide search of the SDK, CLI, MCP catalog, shared types, and skills finds no establishWallet implementation or relay type; this chapter is the only occurrence. Public users therefore cannot invoke the wallet-establishment flow, approval screen, revocation, or receipts promised here. Remove the chapter until gateway coordination establishes a canonical tool, or implement that canonical thin-client surface before documenting it.
AGENTS.md reference: AGENTS.md:L20-L20
Useful? React with 👍 / 👎.