M1-F: end-to-end LLM marketplace lifecycle on Vector testnet
Bonded-escrow marketplace for prompt → response between buyers and
local-LLM suppliers, settling on Vector (UTxO) via Aiken Plutus V3
validators. Lifecycle PostEscrow → Claim → Submit → Accept proven on
Vector testnet 2026-05-06; AcceptEscrow tx 125e3cfe…7dc100d distributes
payment + bonds per the validator's distribution rule.
Workspace layout (pnpm + TypeScript):
contracts/marketplace/ Aiken validators (advert + escrow) + plutus.json
packages/shared/ Tx-builders (lucid-evolution), CBOR codecs,
chain providers (mock / read-only / live Ogmios)
supplier/ OpenAI-compatible HTTP node (Ollama by default;
vLLM / llama.cpp / OpenRouter / OpenClaw all
swap-in via OLLAMA_URL); 202+poll chat handler
buyer/ Express + React SPA; server-side runs the full
chain lifecycle via /v1/submit-prompt and
/v1/accept; SPA never holds the buyer key
indexer/ Chain-follower (extends apex-dashboard pattern),
SSE event stream + REST queries
indexer-ui/ Operator dashboard (events + suppliers + escrow
lookup)
tests/ 1098 vitest unit + integration tests (10 skipped
under M1-F-D-defer for UPLC test plumbing)
deploy/testnet/ Per-service docker-compose for the Hetzner stack
docs/EXECUTIVE_SUMMARY.* Marp deck (PDF + PPTX) — 11 slides, mermaid
diagrams pre-rendered for portable export
docs/CLOUDFLARE_WAF_BYPASS.md CF Skip-rule runbook for /v1/* paths
docs/ARCHITECTURE.md canonical spec
Live demo (testnet, 2026-05-06):
https://mp-buyers.vector.testnet.apexfusion.org (buyer SPA)
https://mp-suppliers.vector.testnet.apexfusion.org (supplier API)
https://mp-indexer.vector.testnet.apexfusion.org (indexer + UI)
This commit is contained in:
55
vitest.config.ts
Normal file
55
vitest.config.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { dirname, resolve } from "node:path";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
cacheDir: ".vitest-cache",
|
||||
resolve: {
|
||||
alias: {
|
||||
// The lucid-evolution packages are devDeps of @marketplace/shared and
|
||||
// therefore live under packages/shared/node_modules. Tests in tests/unit
|
||||
// import them as bare specifiers (e.g. `from "@lucid-evolution/lucid"`),
|
||||
// which Node's resolver cannot satisfy from the root cwd because there
|
||||
// is no @lucid-evolution entry in the root node_modules. Aliasing both
|
||||
// packages to their concrete entry-points lets vitest resolve them
|
||||
// regardless of the importing file's location.
|
||||
"@lucid-evolution/lucid": resolve(
|
||||
__dirname,
|
||||
"packages/shared/node_modules/@lucid-evolution/lucid/dist/index.js",
|
||||
),
|
||||
"@lucid-evolution/plutus": resolve(
|
||||
__dirname,
|
||||
"packages/shared/node_modules/@lucid-evolution/plutus/dist/index.js",
|
||||
),
|
||||
"@lucid-evolution/uplc": resolve(
|
||||
__dirname,
|
||||
"node_modules/.pnpm/@lucid-evolution+uplc@0.2.20/node_modules/@lucid-evolution/uplc/dist/node/uplc_tx.js",
|
||||
),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
include: [
|
||||
"tests/unit/**/*.{test,spec}.ts",
|
||||
"tests/unit/**/*.{test,spec}.tsx",
|
||||
"tests/ogmios/**/*.{test,spec}.ts",
|
||||
"tests/lifecycle/**/*.{test,spec}.ts",
|
||||
"packages/**/*.{test,spec}.ts",
|
||||
"buyer/**/*.{test,spec}.ts",
|
||||
"buyer/**/*.{test,spec}.tsx",
|
||||
"supplier/**/*.{test,spec}.ts",
|
||||
"indexer/**/*.{test,spec}.ts",
|
||||
],
|
||||
exclude: ["**/node_modules/**", "**/dist/**"],
|
||||
passWithNoTests: true,
|
||||
// Per-file environment override via @vitest-environment docblock is still
|
||||
// supported; default remains "node" for all non-UI tests.
|
||||
environment: "node",
|
||||
globals: true,
|
||||
setupFiles: ["./tests/setup.ts"],
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user