惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
C
Cisco Blogs
博客园 - 叶小钗
P
Privacy International News Feed
Jina AI
Jina AI
Apple Machine Learning Research
Apple Machine Learning Research
T
Threatpost
IT之家
IT之家
博客园 - 聂微东
Know Your Adversary
Know Your Adversary
Help Net Security
Help Net Security
罗磊的独立博客
I
Intezer
S
Schneier on Security
博客园_首页
C
CERT Recently Published Vulnerability Notes
雷峰网
雷峰网
Cisco Talos Blog
Cisco Talos Blog
宝玉的分享
宝玉的分享
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Webroot Blog
Webroot Blog
TaoSecurity Blog
TaoSecurity Blog
MyScale Blog
MyScale Blog
P
Privacy & Cybersecurity Law Blog
T
The Exploit Database - CXSecurity.com
PCI Perspectives
PCI Perspectives
Security Latest
Security Latest
H
Heimdal Security Blog
S
Secure Thoughts
Hacker News: Ask HN
Hacker News: Ask HN
Y
Y Combinator Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Microsoft Security Blog
Microsoft Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
SecWiki News
SecWiki News
The GitHub Blog
The GitHub Blog
A
Arctic Wolf
A
About on SuperTechFans
aimingoo的专栏
aimingoo的专栏
T
Threat Research - Cisco Blogs
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor GitHub - GenAI-Gurus/awesome-eu-ai-act: Curated tools, official sources, OSS, templates, and guides for EU AI Act compliance. Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders How to Switch AI Chatbots and Why You Might Want To GitHub - MattMessinger1/agentic_refund_guardrail: Safe refund policy layer for AI agents — Python + TypeScript. Same behavior, shared tests. Adam/papers/emergent_values_whitepaper.md at master · strangeadvancedmarketing/Adam Ask HN: How do you stop playing 20 questions with your AI coding tools How far can automation and AI support psychotherapy? - @theU GitHub - stagas/rtdiff: realtime git diff gui and AI-assisted commits A Mac Studio for Local AI — 6 Months Later A History of the Early Years of AI at the University of Edinburgh Why AI Coding Tools Still Feel Stuck on Localhost MSN AI Datacenters Are Becoming Strategic Targets twitter.com Penn Researchers Use AI to Surface Unreported GLP-1 Side Effects in Reddit Posts Show HN: MoodSense AI (ML and FastAPI and Gradio, Deployed on Hugging Face) Moodsense Ai - a Hugging Face Space by aman179102 AI models are terrible at betting on soccer—especially xAI Grok GitHub - xialeistudio/echoic GitHub - HimashaHerath/github-dev-wrapped: AI-powered weekly GitHub activity reports deployed to GitHub Pages GitHub - alejandrobalderas/claude-code-from-source: Architecture, patterns & internals of Anthropic's AI coding agent — reverse-engineered from source maps AI and Tech brief: Ireland ascendant GitHub - Titovilal/context0: Context0 - Never Surrender Training for a Marathon with an AI Coach: What Worked and What Didn't Cyber Pulse: Agentic Intel - Apps on Google Play I Built an AI PR Reviewer That Catches Bugs by Not Looking for Bugs Gen Z workers are so fearful AI will take their job they’re intentionally sabotaging their company’s AI rollout | Fortune How AI Is Reimagining the Game of Golf–For Both Players and Courses GitHub - nattergabriel/reseed: A CLI tool for managing and distributing agent skills across projects Is SVG the final frontier? My AI workflow evolved from prompts to a near-autonomous workflow MLSharp Help - 3DGS Viewer & Generator I put my cognitive field based AI's runtime on GitHub Is Numble the first AI-proof game? A3: Kubernetes for autonomous AI agent fleets | Emergent Principles Deepali Vyas ("The Elite Recruiter") GitHub - msmarkgu/RelayFreeLLM: A restful API designed to route user prompts to various AI model providers. Unionized ProPublica staff are on strike over AI, layoffs, and wages Unleashing the Advantage of Quantum AI We're heading for an AI-fueled 'dementia crisis,' brain scientist warns The AI-Assisted Breach of Mexico's Government Infrastructure [pdf] GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. MSN GitHub - visionscaper/collabmem: Enabling long-term collaboration with Agentic AI - building up episodic and world model memory over time with in-context awareness We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs AI Code is Hollowing Out Open Source, and Maintainers are Looking the Other Way What leaked "SteamGPT" files could mean for the PC gaming platform's use of AI AI is the boss at this retail store. What could go wrong? GitHub - Wuzu11517/agentic-proxy: Local proxy meant to help reduce With Drones, Geophysics and ArtificiaI Intelligence, Researchers Prepare to Do Battle Against Land Mines A Single Operator, Two AI Platforms, Nine Government Agencies: The Full Technical Report 在 Steam 上购买 FriedrichAI: Offline AI 立省 10% GitHub - inevolin/resume-cli: Hit Claude usage limits? Resume any AI coding session elsewhere. Switch tools at zero friction. GitHub - atripati/ark: AI Runtime Kernel — a context operating system for AI agents. Eliminates tool bloat, loads only what’s needed, and gives LLMs their reasoning space back. How to Build a Secure AI PR Reviewer with Claude, GitHub Actions, and JavaScript This Startup Wants You to Pay Up to Talk With AI Versions of Human Experts Intel Arc Pro B70 Brings 32GB VRAM to Local AI for $949 WordPress 7.0: The Good, the AI, and the Still Missing AI on the couch: Anthropic gives Claude 20 hours of psychiatry IatroBench: Pre-Registered Evidence of Iatrogenic Harm from AI Safety Measures AI Agents Know About Supabase. They Don't Always Use It Right. The history and future of AI at Google, with Sundar Pichai Inside an AI‑enabled device code phishing campaign How Meta Used AI to Map Tribal Knowledge in Large-Scale Data Pipelines AI for Systems: Using LLMs to Optimize Database Query Execution Forecasting the Economic Effects of AI Introducing Tinker: Play with AI, bring your ideas to life AI sheds light on an ancient gaming mystery People really hate AI but not as much as Iran—or Democrats | Fortune What is an AI Product Engineer? Phoebe Gates wants her $185 million AI startup to succeed with 'no ties to my privilege or my last name': 'I have a chip on my shoulder' | Fortune
GitHub - akitaonrails/pact-lang: An AI opinionated ideal language that ignores human-friendliness
pelasaco · 2026-05-28 · via Hacker News - Newest: "AI"

A compiler for Pact — a programming language designed for AI agents, not humans.

Pact inverts the usual ratio: programs are mostly specification, provenance, and constraints with a thin layer of computation. The logic is the easy part. Knowing why something exists, what else is affected, and what guarantees must hold is where the language spends its budget.

What is Pact?

Pact is an S-expression based language where every function carries rich, machine-readable metadata:

(fn get-user-by-id
  :provenance {req: "SPEC-2024-0042#section-3", test: ["T-101" "T-102" "T-103"]}
  :effects    [db-read http-respond]
  :total      true
  :latency-budget 50ms
  :called-by  [api-router/handle-request admin-panel/user-detail]

  (param id UUID :source http-path-param :validated-at boundary)

  (returns (union
    (ok   User   :http 200 :serialize :json)
    (err  :not-found {:id id} :http 404)
    (err  :invalid-id {:id id} :http 400)))

  (let [validated-id (validate-uuid id)]
    (match validated-id
      (err _)    (err :invalid-id {:id id})
      (ok  uuid) (match (query user-store {:id uuid})
                   (none)   (err :not-found {:id uuid})
                   (some u) (ok u)))))

Key language features:

  • Provenance — every function and type knows why it exists (spec reference, author, tests)
  • Effect tracking — functions declare exactly what I/O they perform (reads, writes, sends)
  • Totality — functions marked :total true must handle all cases exhaustively
  • Latency budgets — performance constraints are part of the code, not tribal knowledge
  • Dependency graphs:called-by makes impact analysis instant
  • Union return types — every possible outcome is enumerated with HTTP status mappings
  • Type invariants — constraints like :min-len, :max-len, :format are first-class

Building

No external dependencies. Just Rust's standard library.

Usage

# Generate a .pct file from a YAML spec (human intent → machine format)
pact generate examples/user-service.spec.yaml -o user-service.pct

# Compile a Pact file to Rust source code
pact compile examples/user-service.pct -o output/

# Compile targeting pact-runtime (produces code that compiles against pact-runtime crate)
pact compile --runtime examples/user-service.pct -o output/

# Scaffold an Axum web project from a Pact file
pact scaffold examples/user-service.pct -o ../user-service-web/

# Check for errors without generating code
pact check examples/user-service.pct

# Parse only (show the concrete syntax tree)
pact parse examples/minimal.pct

Codegen backends

The compiler ships two codegen backends:

Backend Flag Output Use case
v1 (rust.rs) (default) Standalone Rust with trait-based effects Inspection, documentation
v2 (rust_v2.rs) --runtime Rust targeting pact-runtime crate Compilable, runnable applications

The --runtime backend produces Rust that compiles against pact-runtime and can be used directly in applications like pact-web. It handles:

  • use pact_runtime::prelude::*; imports
  • #[derive(Serialize, Deserialize)] on structs
  • Named input structs for map-typed parameters (e.g., CreateUserInput)
  • Named fields in error enum variants (not inline structs)
  • Store<T> trait bounds instead of per-store effect traits
  • Builtin mapping (querystore.query_by_id(), insert!store.insert(), etc.)
  • HasId, HasUniqueFields, from_input(), validate_input() implementations

Web Project Scaffolding

The scaffold command generates a complete Axum web project from a .pct file — routes, handlers, HTML templates, and Cargo.toml. This is a one-time generation intended as a starting point that you customize afterward.

# 1. Scaffold the web project
pact scaffold examples/user-service.pct -o ../user-service-web/

# 2. Generate the domain code into it
pact compile --runtime examples/user-service.pct -o ../user-service-web/src/generated/

# 3. Build and run
cd ../user-service-web && cargo run

This produces:

user-service-web/
├── Cargo.toml              # Dependencies (axum, tokio, serde, pact-runtime)
└── src/
    ├── main.rs             # AppState, Router with HTML + JSON API routes
    ├── handlers.rs         # HTML handlers (list, show, create, delete) + JSON API handlers
    ├── html.rs             # Tailwind CSS HTML helpers (page, nav, table, form, alert)
    └── generated/
        └── mod.rs          # "pub mod user_service;"

Route inference

Routes are inferred from the AST — no configuration needed:

AST signal Generated route
EffectKind::Reads/Writes on a store GET /{plural} (list), GET /{plural}/new (form), POST /{plural}/{id}/delete
FnDef with UUID :source http-path-param + reads-only GET /{plural}/{id} (show) + GET /api/{plural}/{id}
FnDef with Map :source http-body + writes POST /{plural} (create) + POST /api/{plural}
FieldDef :format :email <input type="email"> in forms
FieldDef :min-len, :max-len minlength/maxlength attributes
Variant :http 404 StatusCode::NOT_FOUND in match arms

Generated handler patterns

The generated handlers follow the same patterns as the hand-written pact-web:

  • Liststore.list_all() → HTML table with Tailwind styling
  • Show — calls domain function → matches Ok/Err variants with correct HTTP status codes
  • Create (HTML)Form<CreateTypeForm> → calls domain function → redirect on success, error alert on failure
  • Create (API)Json<CreateTypeInput> → calls domain function → JSON response with status
  • Deletestore.delete(&uuid) → redirect to list

Spec-to-Pct Generator

The generate command translates human-readable YAML specs (Layer 0 — human intent) into .pct files (Layer 1 — AI-native format) that feed into the compiler pipeline:

Spec (.yaml) → YamlParser → SpecAST → PctEmitter → .pct file → [compiler]

YAML Spec Format

Write requirements in plain English:

spec: SPEC-2024-0042
title: "User service"
owner: platform-team
domain:
  User:
    fields:
      - name: required, string, 1-200 chars
      - email: required, email format, unique
      - id: auto-generated, immutable
endpoints:
  get-user:
    description: "Returns a user by ID"
    input: user id (from URL)
    outputs:
      - success: the user found (200)
      - not found: when the ID doesn't exist (404)
    constraints:
      - max response time: 50ms
      - read-only
  create-user:
    description: "Creates a new user"
    input: user data (from body)
    outputs:
      - created: the new user (201)
      - duplicate email: email already exists (409)
      - validation failed: invalid input (422)
    constraints:
      - idempotent by: email
      - max response time: 200ms
quality:
  - all functions must be total
traceability:
  known dependencies: api-router, admin-panel

What Gets Mapped

Spec descriptor Generated .pct
required, string, 1-200 chars (field name String :min-len 1 :max-len 200) + invariant
email format, unique (field email String :format :email :unique-within <store>)
auto-generated, immutable (field id UUID :immutable :generated)
read-only constraint effect set db-read [:reads <store>]
max response time: 50ms :latency-budget 50ms
idempotent by: email :idempotency-key (hash (. input email))
output success (200) (ok Type :http 200 :serialize :json)
output not found (404) (err :not-found {:id id} :http 404)
all functions must be total :total true on every function

The generator also scaffolds function bodies: read endpoints get validate-query-match logic, write endpoints get validate-insert-match logic.

The generated .pct is validated by round-tripping through lexer, parser, and lowerer before writing to disk.

Scope and Limitations

The generator is designed for service contract specifications — CRUD endpoints, API contracts, input validation, error variants. It handles the domain well:

  • Domain types with field constraints
  • Read/write endpoints with HTTP status mappings
  • Effect tracking, latency budgets, idempotency keys
  • Traceability and provenance metadata

It is not designed for algorithmic specifications (data structures, sorting algorithms, state machines). Those require language features Pact doesn't yet have: generic types, recursive types, trait bounds, and algorithmic body templates.

Compiler Pipeline

The compiler has 6 phases:

Source (.pct) → Lexer → Parser (CST) → Lowering (AST) → Semantic Analysis → Codegen (Rust)
Phase What it does
Lexer Tokenizes source into symbols, keywords, strings, integers, durations, regex literals
Parser Builds a generic S-expression tree (lists, vectors, maps, atoms) — no semantic knowledge
Lowering Converts CST to typed AST (Module, TypeDef, FnDef, Expr, Pattern, etc.)
Semantic analysis Name resolution, effect checking, match exhaustiveness
Codegen Emits Rust source: structs, traits, enums, functions with doc comments

What Gets Generated

v1 backend (default)

Given a Pact module, the compiler produces Rust code with:

Pact construct Rust output
(type User ...) pub struct User with validate() method
(effect-set db-read ...) pub trait DbRead with typed methods
(fn get-user ...) pub fn get_user<Ctx: DbRead + ...>() with trait-bounded context
(returns (union ...)) pub enum GetUserResult with http_status() and Display
:provenance, :called-by, etc. Doc comments preserving all metadata
:invariants, :min-len, :max-len Validation logic in validate()

v2 backend (--runtime)

The runtime-targeting backend produces code that compiles and runs:

Pact construct Rust output
(type User ...) pub struct User with HasId, HasUniqueFields, validate(), validate_input(), from_input()
(param input {:name String}) pub struct CreateUserInput (named struct)
(effect-set db-read ...) Store<User> trait bound on function
(fn get-user ...) pub fn get_user(store: &impl Store<User>, ...)
(err :not-found {:id id}) NotFound { id: String } (named fields)
(query store {:id uuid}) store.query_by_id(&uuid)
(insert! store (build User input)) store.insert(User::from_input(input.clone()))
(validate-against User input) User::validate_input(&input)
(non-empty? errors) non_empty(&errors)

Examples

The examples/ directory contains several Pact modules:

minimal.pct — Starting point

The smallest valid module. One type, one effect set, one function.

pact compile examples/minimal.pct -o output/

user-service.pct — Canonical example

The reference example from the language spec. A user CRUD service with two functions (get-user-by-id, create-user), full provenance, effect tracking, and union return types.

pact compile examples/user-service.pct -o output/

auth-service.pct — Authentication

Token-based authentication with session management. Demonstrates multiple effect sets (session reads/writes, user lookup, audit logging), expiration handling, and password verification flows.

pact compile examples/auth-service.pct -o output/

inventory.pct — Inventory management

Stock tracking with reservations. Multiple types (Product, StockEntry, Reservation), cross-type queries, quantity constraints, and write-heavy operations.

pact compile examples/inventory.pct -o output/

notification.pct — Notifications

Multi-channel delivery with template rendering. Shows send effects (email-gateway, sms-gateway), long latency budgets (2000ms), and chained operations (render → deliver → persist).

pact compile examples/notification.pct -o output/

Language Reference

Module

Every .pct file contains a single module:

(module module-name
  :provenance {req: "SPEC-ID", author: "agent:name", created: "ISO-8601"}
  :version 7
  :parent-version 6
  :delta (operation target "description")

  ;; declarations: types, effect-sets, functions
  ...)

Types

Types have named fields with constraints:

(type User
  :invariants [(> (strlen name) 0) (matches email #/.+@.+/)]
  (field id    UUID   :immutable :generated)
  (field name  String :min-len 1 :max-len 200)
  (field email String :format :email :unique-within user-store))

Supported field annotations: :immutable, :generated, :min-len, :max-len, :format, :unique-within.

Effect Sets

Effect sets declare what I/O operations a group of capabilities performs:

(effect-set db-read  [:reads  user-store])
(effect-set db-write [:writes user-store :reads user-store])
(effect-set notify   [:sends  email-gateway])

Effect kinds: :reads, :writes, :sends.

Functions

Functions carry metadata, parameters, return types, and a body:

(fn function-name
  :provenance {req: "SPEC-ID", test: ["T-001" "T-002"]}
  :effects    [effect-set-1 effect-set-2]
  :total      true
  :latency-budget 50ms
  :called-by  [caller/function-name]
  :idempotency-key (hash (. input email))

  (param name Type :source http-path-param :validated-at boundary)

  (returns (union
    (ok  Type    :http 200 :serialize :json)
    (err :tag    payload-type :http 404)))

  body-expression)

Expressions

;; Let binding
(let [x (some-fn arg)] body)

;; Pattern matching
(match expr
  (ok value)   (ok value)
  (err _)      (err :tag {}))

;; Conditionals
(if condition then-expr else-expr)

;; Function calls
(function-name arg1 arg2)

;; Field access
(. object field-name)

;; Constructors
(ok value)
(err :tag payload)

;; Map literals
{:key value, :key2 value2}

Literals

Type Examples
Symbols foo, bar-baz, non-empty?, insert!, api-router/handle-request
Keywords :provenance, :effects, :total, :not-found
Strings "hello", "SPEC-2024-0042"
Integers 42, -7, 0
Booleans true, false
Durations 50ms, 200ms, 10s, 1h
Regex #/.+@.+/
Comments ;; line comment

Design Rationale

See LANGUAGE.pt-BR.md (Portuguese) or LANGUAGE.md (English) for the full design document. The core insight:

The language ideal for AI is the one humans keep rejecting.

Every feature that helps an LLM reason about code — formal specs, effect tracking, totality checking, rich AST manipulation, exhaustive returns — adds cognitive load for humans. Pact embraces that trade-off: it's a language where the metadata-to-logic ratio is 3:1, because knowing why, what's affected, and what guarantees must hold is where AI agents spend their reasoning budget.

Project Structure

pact-lang/
├── Cargo.toml
├── grammar.ebnf                  # Formal EBNF grammar
├── doc/
│   ├── LANGUAGE.md               # Language design document (English)
│   └── LANGUAGE.pt-BR.md         # Language design document (Portuguese)
├── src/
│   ├── main.rs                   # CLI entry point (compile, generate, scaffold, check, parse)
│   ├── lib.rs                    # Module exports
│   ├── lexer.rs                  # Tokenizer (16 tests)
│   ├── parser.rs                 # S-expression CST parser (8 tests)
│   ├── ast.rs                    # Typed AST definitions
│   ├── lower.rs                  # CST → AST conversion (5 tests)
│   ├── diagnostics.rs            # Error/warning formatting
│   ├── semantic/
│   │   ├── mod.rs                # Analysis orchestration
│   │   ├── resolve.rs            # Name resolution
│   │   ├── effects.rs            # Effect checking (2 tests)
│   │   └── totality.rs           # Match exhaustiveness (2 tests)
│   ├── codegen/
│   │   ├── mod.rs
│   │   ├── rust.rs               # Rust v1 code emission (6 tests)
│   │   └── rust_v2.rs            # Rust v2 codegen targeting pact-runtime (11 tests)
│   ├── generate/
│   │   ├── mod.rs                # Module wiring + integration tests (4 tests)
│   │   ├── yaml_ast.rs           # YamlValue enum (Scalar, Mapping, Sequence)
│   │   ├── yaml_parser.rs        # Indentation-based YAML subset parser (12 tests)
│   │   ├── spec_ast.rs           # Typed spec structures (SpecDoc, Endpoint, etc.)
│   │   ├── spec_parser.rs        # YamlValue → SpecDoc conversion (11 tests)
│   │   └── pct_emitter.rs        # SpecDoc → .pct text emission (11 tests)
│   └── scaffold/
│       ├── mod.rs                # Orchestration + integration tests (4 tests)
│       ├── route_analysis.rs     # AST → RouteTable intermediate representation (7 tests)
│       ├── main_emitter.rs       # Generates main.rs (AppState, Router) (4 tests)
│       ├── handlers_emitter.rs   # Generates handlers.rs (HTML + JSON) (8 tests)
│       ├── html_emitter.rs       # Generates html.rs (Tailwind helpers) (3 tests)
│       └── cargo_emitter.rs      # Generates Cargo.toml (2 tests)
└── examples/
    ├── minimal.pct               # Smallest valid module
    ├── user-service.pct          # Canonical example (hand-written)
    ├── user-service.spec.yaml    # Example YAML spec for generate
    ├── inventory.spec.yaml       # Inventory service spec
    ├── auth-service.pct          # Authentication & sessions
    ├── inventory.pct             # Stock management & reservations
    └── notification.pct          # Multi-channel notifications

Tests

117 tests across all phases: lexer (16), parser (8), lowering (5), semantic analysis (4), codegen v1 (6), codegen v2 (11), generate (38), scaffold (29). Plus 8 tests in the pact-runtime crate.

Related Crates

  • pact-runtime — Runtime types, Store<T> trait, and builtins that generated code depends on
  • pact-web — Axum web application that serves generated CRUD services with HTML and JSON APIs