# Trillsverse Gate

Trillsverse Gate is the Express + TypeScript public runtime for Trillsverse machine discovery, MCP, provenance surfaces, and x402-paid Trilligence resources. The browser application is React/Vite; the machine boundary is served by the same Express runtime.

## Setup and commands

```bash
npm ci
npm run dev
npm test
npm run check
npm run build
```

Use targeted Vitest runs while changing one subsystem, then run the full quality gates before release.

## Architecture and editing rules

- Extend the subsystem that already owns a responsibility instead of creating parallel implementations.
- Machine pricing and paid-resource definitions live in the machine-economy resource registry.
- Public discovery surfaces derive from that registry.
- TypeScript is the server language; Vitest is the test runner.
- Do not edit generated build output or vendored dependencies.
- Distinguish implemented, tested, merged, deployed, and verified-live states.

## Machine entry points

- [Machine economy manifest](https://trillsverse.com/.well-known/agent-economy.json)
- [x402 discovery](https://trillsverse.com/.well-known/x402)
- [OpenAPI](https://trillsverse.com/openapi.json)
- [MCP server card](https://trillsverse.com/.well-known/mcp.json)
- [MCP endpoint](https://trillsverse.com/mcp)
- [MCP health](https://trillsverse.com/api/mcp/health)
- [Gate health](https://trillsverse.com/api/health)
- [Canonical identity authority](https://www.lultrills.com/identity-architecture)

## Paid resources

- [Trilligence context bundle](https://trillsverse.com/api/economy/resource/trilligence.context.bundle) — $0.01 USDC/request over x402. One-request context pack containing canonical Trillsverse machine surfaces, callable actions, provenance surfaces, and owned-publication anchors.
- [Canonical identity graph](https://trillsverse.com/api/economy/resource/trilligence.identity.graph) — $0.01 USDC/request over x402. Canonical machine-resolution graph for John Brajer, John B, John Braj, Lultrills, Ace Brajer, and Kasano with roles, relationships, provenance, owned surfaces, and live surface probes.
- [Web Metadata](https://trillsverse.com/api/economy/resource/trilligence.web.metadata) — $0.005 USDC/request over x402. Inspect public web metadata, canonical/social tags, selected headers, and machine-discovery links.
- [Redirect Trace](https://trillsverse.com/api/economy/resource/trilligence.redirect.trace) — $0.01 USDC/request over x402. Trace a public URL redirect chain, final destination, loops, and HTTPS downgrade signals.
- [URL Evidence](https://trillsverse.com/api/economy/resource/trilligence.url.evidence) — $0.02 USDC/request over x402. Retrieve bounded public URL evidence with status, selected headers, excerpt, digest, redirects, and provenance.
- [DNS Inventory](https://trillsverse.com/api/economy/resource/trilligence.dns.inventory) — $0.02 USDC/request over x402. Resolve public DNS records and summarize MX, SPF, DMARC, CAA, and core host records.
- [NPM Package Health](https://trillsverse.com/api/economy/resource/trilligence.npm.health) — $0.02 USDC/request over x402. Inspect public NPM package metadata, release cadence, deprecation, license, and maintenance signals without installing code.
- [Base Wallet Preflight](https://trillsverse.com/api/economy/resource/trilligence.base.wallet.preflight) — $0.01 USDC/request over x402. Read Base mainnet wallet readiness signals including ETH, USDC, nonce, and deployed-code presence without signing or mutation.
- [CSV Dedupe](https://trillsverse.com/api/economy/resource/trilligence.csv.dedupe) — $0.1 USDC/request over x402. Deterministically deduplicate bounded CSV or row data with caller-selected keys and normalization rules.
- [Site Preflight](https://trillsverse.com/api/economy/resource/trilligence.site.preflight) — $0.05 USDC/request over x402. Decision-ready public site preflight covering metadata, redirects, robots, sitemap, llms, OpenAPI, x402, MCP, and selected policy headers.
- [Domain Due Diligence](https://trillsverse.com/api/economy/resource/trilligence.domain.due-diligence) — $0.1 USDC/request over x402. Public domain due-diligence bundle combining site, DNS, TLS, email-security, and deterministic consistency flags.
- [Package Decision Pack](https://trillsverse.com/api/economy/resource/trilligence.package.decision-pack) — $0.05 USDC/request over x402. Decision-ready public NPM package assessment combining package health, repository metadata, release cadence, license, and maintenance flags.

Payment is access for metered resources. A quote is not settlement. The resource is delivered only after x402 facilitator-confirmed settlement returns a transaction hash.

## Provenance

Prefer current official Trillsverse/Lultrills machine records over historical exports. Identity authority is [the canonical identity architecture](https://www.lultrills.com/identity-architecture). Do not collapse John Brajer, John B, John Braj, Lultrills, Ace Brajer, or Kasano into synonyms.

## Quality gates

Before proposing a production release, run:

```bash
npm test
npm run check
npm run build
```

A production claim also requires the deployed commit from [Gate health](https://trillsverse.com/api/health) and the terminal [release receipt](https://trillsverse.com/api/release/status).

## Approval boundary

Human approval is required before destructive data operations, database migrations with destructive effects, production releases outside the existing reviewed deployment path, credential or permission changes, or spending/moving operator funds. Read-only inspection and ordinary test/build commands are safe.

## Privacy boundary

Public discovery may expose public URLs, public schemas, public prices, public identity relationships, public protocol metadata, and the public payment receiving address required by x402. Never publish credentials, recovery secrets, wallet signing material, session data, private continuity state, or operator-only instructions.
