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

推荐订阅源

The Last Watchdog
The Last Watchdog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
S
Schneier on Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
Recorded Future
Recorded Future
I
Intezer
云风的 BLOG
云风的 BLOG
博客园 - Franky
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
T
Tenable Blog
The Hacker News
The Hacker News
T
The Blog of Author Tim Ferriss
Attack and Defense Labs
Attack and Defense Labs
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
The Cloudflare Blog
Webroot Blog
Webroot Blog
W
WeLiveSecurity
H
Heimdal Security Blog
博客园 - 三生石上(FineUI控件)
V
Vulnerabilities – Threatpost
G
Google Developers Blog
O
OpenAI News
V
V2EX
罗磊的独立博客
博客园_首页
N
News | PayPal Newsroom
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
TaoSecurity Blog
TaoSecurity Blog
Cloudbric
Cloudbric
H
Hacker News: Front Page
博客园 - 叶小钗
T
Tor Project blog
AI
AI

Hacker News: Front Page

SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads GitHub - GainSec/AutoProber: Hardware hacker’s flying probe automation stack for agent-driven target discovery, microscope mapping, safety-monitored CNC motion, probe review, and controlled pin probing. Introducing Claude Opus 4.7 Qwen Studio The Future of Everything is Lies, I Guess: Where Do We Go From Here? GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh Virginia Bans Sale of Geolocation Data Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Ancient DNA reveals pervasive directional selection across West Eurasia [pdf] AI cybersecurity is not proof of work Moving a large-scale metrics pipeline from StatsD to OpenTelemetry / Prometheus GitHub - Nightmare-Eclipse/RedSun: The Red Sun vulnerability repository GitHub - SethPyle376/hiraeth: Local AWS emulator focused on fast integration testing, with SQS support, SQLite-backed state, and a debug-friendly web UI. A Better Ludum Dare; Or, How to Ruin a Legacy GitHub - macOS26/Agent: Any AI, replaces Claude Code, Cursor, OpenClaw. Over 18 LLM providers (Claude, OpenAI, Gemini, Ollama, Zai, HF, Qwen) wired into a native Mac app that writes code, builds Xcode projects, bumps versions, manages git, automates Safari, use AppleScript, JS or Accessibility, extend Agent! w/ MCP Servers, run tasks from your iPhone via Messages. YouTube now lets you turn off Shorts I Made a Terminal Pager Burgers | マクドナルド公式 Commands — HackerNews CLI documentation ChatGPT for Excel PiCore - Raspberry Pi Port of Tiny Core Linux Live Nation illegally monopolized ticketing market, jury finds Google Broke Its Promise to Me. Now ICE Has My Data. Founding Engineer at Adaptional | Y Combinator CRISPR takes important step toward silencing Down syndrome’s extra chromosome GitHub - saffron-health/libretto: The AI toolkit for building reliable browser automations US v. Heppner (S.D.N.Y. 2026) no attorney-client privilege for AI chats [pdf] Unexpected €54k billing spike in 13 hours: Firebase browser key without API restrictions used for Gemini requests Fragments: April 14 Cal.com Goes Closed Source: Why AI Security Is Forcing Our Decision | Cal.com - Scheduling Software for Online Bookings Laravel raised money and now injects ads directly into your agent Codex Hacked a Samsung TV Tech Valuations Back to Pre-AI Boom Levels A perfectable programming language — Soter GitHub - halfwhey/claudraband: Claude Code for the Power User Partnership through Play: Investigating How Long-Distance Couples Use Digital Games to Facilitate Intimacy Textbooks and Methods of Note-Taking in Early Modern Europe (2008) Eternity in six hours: Intergalactic spreading of intelligent life (2013) Seven countries now generate 100% of their electricity from renewable energy Tell HN: OpenAI silently removed Study Mode from ChatGPT Pro Max 5x Quota Exhausted in 1.5 Hours Despite Moderate Usage Show HN: Oberon System 3 runs natively on Raspberry Pi 3 (with ready SD card) Tell HN: docker pull fails in spain due to football cloudflare block Bring Back Idiomatic Design No one owes you supply-chain security GitHub - xsawyerx/curl-doom: DOOM, played over cURL Apple update turns Czech mate for locked-out iPhone user The Grand Line Cache TTL silently regressed from 1h to 5m around early March 2026, causing quota and cost inflation Building a Z-Machine in the worst possible language The peril of laziness lost Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda AI Will Be Met With Violence, and Nothing Good Will Come of It GitHub - duguyue100/midnight-captain: Inspired by Midnight Commander, tailored to my taste. How to build a `git diff` driver · Jamie Tanna | Software Engineer Center for Responsible, Decentralized Intelligence at Berkeley The Local Universe’s Expansion Rate Is Clearer Than Ever, but Still Doesn’t Add Up - A new synthesis of astronomical measurements confirms a persistent mismatch that could point to physics beyond current models The disturbing white paper Red Hat is trying to erase from the internet – OSnews NetBlocks (@netblocks@mastodon.social) The Future of Everything is Lies, I Guess: Annoyances ‘Abhorrent’: the inside story of the Polymarket gamblers betting millions on war Productive procrastination — Max van IJsselmuiden maps, territory and LMs 447 Terabytes per Square Centimetre at Zero Retention Energy: Non-Volatile Memory at the Atomic Scale on Fluorographane Show HN: Pardonned.com – A searchable database of US Pardons 20 Years on AWS and Never Not My Job The Seasons are Wrong The FAA wants gamers to apply for air traffic control jobs Artemis II crew splashes down near San Diego after historic moon mission Why weekends are under threat We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs How a dancer with ALS used brainwaves to perform live On filing the corners off my MacBooks Installing every* Firefox extension OpenClaw’s memory is unreliable, and you don’t know when it will break Steve Blank Nowhere Is Safe Chimpanzees in Uganda locked in vicious 'civil war', say researchers watgo - a WebAssembly Toolkit for Go linux/Documentation/process/coding-assistants.rst at master · torvalds/linux GitHub - callumlocke/json-formatter: Makes JSON easy to read. Founding Product Engineer at Bild AI | Y Combinator A compelling title that is cryptic enough to get you to take action on it GitHub - Keychron/Keychron-Keyboards-Hardware-Design: Industrial design files for Keychron keyboards and mice. 100+ models with CAD assets in STEP, DXF, DWG, and PDF. Source-available, with commercial use allowed for original compatible accessories within the license terms. [ANNOUNCE] WireGuardNT v0.11 and WireGuard for Windows v0.6 Released 1D-Chess Helium Is Hard to Replace Keeping a Postgres queue healthy — PlanetScale Serenity Forge (@serenityforge.com) Our response to the Axios developer tool compromise Do Americans read print books, e-books or audiobooks more? Uncharted island soon to appear on nautical charts The Problem That Built an Industry Fragments: April 2 Python Release Python install manager 26.1 Bitcoin miners are losing $19,000 on every BTC produced as difficulty drops 7.8% God sleeps in the minerals Harness engineering: leveraging Codex in an agent-first world Apple Silicon and Virtual Machines: Beating the 2 VM Limit What have been the greatest intellectual achievements? The APL Programming Language Source Code
GitHub - justhamade/triadjs: Triad is a TypeScript/Node.js framework where API specification, implementation, validation, and testing are a single source of truth.
justhamade · 2026-06-11 · via Hacker News: Front Page

CI

One TypeScript definition. Validation, OpenAPI, AsyncAPI, BDD tests, Gherkin, and database schemas — all generated from the same source of truth.

Triad is a TypeScript-first API framework built on the idea that an API's specification, implementation, validation, and tests should never drift apart, because they are the same thing. You write TypeScript once using Triad's declarative DSL, and you get:

  • Runtime validation at the edges (parse + reject with structured errors)
  • Static types derived from the same schemas (t.infer<typeof X>)
  • OpenAPI 3.1 documentation for HTTP endpoints
  • AsyncAPI 3.0 documentation for WebSocket channels
  • Executable BDD scenarios that run as tests (triad test)
  • Automatic adversarial tests derived from your schema constraints (scenario.auto())
  • Gherkin .feature files generated for non-technical stakeholders
  • Typed frontend hooks for React Query, Solid Query, Vue Query, Svelte Query (triad frontend generate)
  • Database schemas via a dialect-neutral Drizzle bridge (triad db generate)

No codegen round-trips. No hand-maintained OpenAPI YAML. No duplicate Zod + OpenAPI + test-fixture schemas that fall out of sync.

Built for humans and AI

Triad's north star is that an AI coding assistant should be able to understand an entire API by reading one place. When schemas, handlers, responses, channel payloads, tests, and docs all live in the same typed definitions, an LLM (or a new engineer) doesn't have to stitch context together from a Zod file, an OpenAPI YAML, a separate test fixture, and a README that's three commits out of date. There is one source of truth, and every other artifact is a deterministic projection of it. That's what keeps humans productive — and it's what lets AI reason about your API without guessing.


Get started with Claude Code

This repo doubles as a Claude Code marketplace, so the fastest path to a working TriadJS backend is to let Claude do the scaffolding.

1. Add the TriadJS marketplace and install the plugin (one time, in any Claude Code session):

/plugin marketplace add justhamade/triad
/plugin install triadjs@triadjs

This installs 10 skills (schema DSL, endpoints, channels, BDD behaviors with the authoritative assertion phrase table, testing, adapters, Drizzle, CLI, DI) and 8 slash commands (/triadjs:new, /triadjs:model, /triadjs:endpoint, /triadjs:channel, /triadjs:scenario, /triadjs:test, /triadjs:docs, /triadjs:validate).

2. Scaffold your first project:

/triadjs:new a petstore API with pets, adoptions, and a chat room channel

Claude will create the full project layout — package.json, triad.config.ts, schemas, endpoints with behaviors, a Fastify server, and a test setup — then run triad test to confirm every scenario passes. Run npm run dev and Swagger UI is immediately live at http://localhost:3000/api-docs with the live OpenAPI spec at /api-docs/openapi.json. No extra step.

3. Iterate:

/triadjs:endpoint add a soft-delete endpoint for pets
/triadjs:scenario cover the 404 case on getPet
/triadjs:test
/triadjs:docs

Each command loads only the skills it needs, writes idiomatic TriadJS code that matches the phrase table the parser expects, and verifies its own output. See plugin/README.md for the full skill and command catalog.

Don't use Claude Code? Skip to Taste of it below for a plain-TypeScript walkthrough, or the full Quickstart.


Taste of it

import { t, endpoint, scenario, createRouter } from '@triadjs/core';

const Pet = t.model('Pet', {
  id: t.string().format('uuid').identity(),
  name: t.string().minLength(1).example('Buddy'),
  species: t.enum('dog', 'cat', 'bird', 'fish'),
  age: t.int32().min(0).max(100),
});

const CreatePet = Pet.pick('name', 'species', 'age').named('CreatePet');

const createPet = endpoint({
  method: 'POST',
  path: '/pets',
  summary: 'Create a pet',
  body: CreatePet,
  responses: { 201: Pet, 400: ApiError },
  handler: async (ctx) => {
    const pet = await ctx.services.petRepo.create(ctx.body);
    return ctx.respond[201](pet);
  },
  behaviors: [
    scenario('creates a pet with valid input')
      .when('POST /pets', { body: { name: 'Rex', species: 'dog', age: 3 } })
      .then('status is 201')
      .and('response body matches { name: "Rex", species: "dog" }'),

    // One line — the framework generates ~20 boundary/adversarial
    // tests from the schema constraints you already declared above.
    ...scenario.auto(),
  ],
});

const router = createRouter({ title: 'Petstore', version: '1.0.0' });
router.add(createPet);

From this single file:

  • triad test runs your hand-written scenario AND the auto-generated boundary tests
  • triad fuzz generates adversarial tests for every endpoint without touching any file
  • triad docs emits openapi.yaml
  • triad gherkin emits features/pets.feature
  • triad frontend generate emits typed React/Solid/Vue/Svelte Query hooks
  • ctx.body is fully typed — { name: string; species: 'dog' | 'cat' | ... }

scenario.auto() reads minLength(1), max(100), enum('dog', 'cat') and generates missing-field, boundary-value, invalid-enum, type-confusion, and random-fuzzing scenarios automatically. You write the business logic tests; the framework generates the boundary tests.

For WebSocket channels, channel() works the same way and produces AsyncAPI + typed client libraries.


Packages

Package Purpose
@triadjs/core Schema DSL, endpoint(), channel(), scenario(), scenario.auto(), createRouter()
@triadjs/openapi Router → OpenAPI 3.1 (YAML/JSON)
@triadjs/asyncapi Router → AsyncAPI 3.0 (YAML/JSON)
@triadjs/gherkin Behaviors → .feature files
@triadjs/test-runner In-process BDD runner + schema-derived auto-scenario generation
@triadjs/fastify Fastify HTTP + WebSocket adapter
@triadjs/express Express HTTP adapter
@triadjs/hono Hono adapter (Node, Deno, Bun, Cloudflare Workers)
@triadjs/lambda AWS Lambda adapter (API Gateway v1/v2, ALB, Function URL)
@triadjs/drizzle Triad schemas → Drizzle tables + SQL migrations (SQLite, Postgres, MySQL)
@triadjs/tanstack-query Router → typed React Query hooks
@triadjs/solid-query Router → typed Solid Query hooks
@triadjs/vue-query Router → typed Vue Query composables
@triadjs/svelte-query Router → typed Svelte Query store factories
@triadjs/channel-client Router → typed WebSocket clients (vanilla TS, React, Solid, Vue, Svelte)
@triadjs/forms Router → form validators (react-hook-form, @tanstack/form)
@triadjs/jwt requireJWT BeforeHandler factory wrapping jose
@triadjs/otel OpenTelemetry tracing (opt-in router wrapper)
@triadjs/metrics Prometheus metrics (opt-in router wrapper)
@triadjs/logging Structured logging with AsyncLocalStorage (opt-in router wrapper)
@triadjs/security-headers Security headers middleware (Fastify, Express, Hono)
@triadjs/cli triad test, triad fuzz, triad docs, triad new, triad mock, triad db, triad validate, triad frontend

Documentation

Start at the docs index — it points at everything below based on what you're trying to do.

Learn by building

  • Tutorial — Build the "Bookshelf" app from hello-world to production-ready in 7 steps

Pick your stack

Work with AI

Reference

Project

Four reference implementations live under examples/petstore (Fastify + channels), tasktracker (Express + auth + pagination), bookshelf (all features combined — the tutorial's final state), and supabase-edge (Hono + Supabase + Deno edge deployment). Each has both in-process behavior tests and real HTTP/WebSocket e2e tests.


Status

Triad is pre-1.0 and under active development. Feature-complete through Phase 26:

  • ✅ Schema DSL with full DDD composition (t.model, t.value, t.file, 14 primitive types)
  • ✅ Endpoint + router + beforeHandler auth extension + checkOwnership helper
  • scenario.auto() — schema-derived adversarial test generation (missing fields, boundary values, type confusion, random fuzzing)
  • ✅ OpenAPI 3.1 + AsyncAPI 3.0 generators
  • ✅ Gherkin generator (HTTP + channels)
  • ✅ In-process BDD test runner + triad fuzz CLI fuzzer + triad validate --coverage linter
  • ✅ Four HTTP adapters: Fastify (+ channels), Express, Hono (edge runtimes), Lambda (AWS)
  • ✅ Drizzle bridge with SQL migration codegen (SQLite, Postgres, MySQL)
  • ✅ Frontend codegen: TanStack Query, Solid Query, Vue Query, Svelte Query, form validators, typed WebSocket clients
  • ✅ Observability: OpenTelemetry tracing, Prometheus metrics, structured logging (all opt-in router wrappers)
  • ✅ Auth: @triadjs/jwt with JWKS/HS256 + security headers middleware
  • ✅ Developer tooling: triad new scaffolding, triad mock server, triad docs check breaking-change detection

21 packages, 4 reference examples, 83 behavior scenarios, 1000+ unit/integration/property tests. APIs may still shift before 1.0 — pin exact versions if you adopt early.

See ROADMAP.md for phase-by-phase detail.


Why Triad?

Most TypeScript API stacks stitch together four or five libraries to get what Triad gives you in one:

Need Typical stack Triad
Runtime validation Zod / Yup t.model()
Static types z.infer<> t.infer<>
OpenAPI zod-to-openapi + hand edits triad docs
BDD tests Cucumber + step defs + fixtures scenario().when().then()
Boundary/fuzz tests Schemathesis (external, Python) scenario.auto() (built-in, zero-config)
Frontend hooks hand-written fetch wrappers triad frontend generate
WebSocket clients hand-written WS wrappers triad frontend generate --target channel-client-react
WebSocket docs hand-written AsyncAPI triad docs
DB schema Drizzle (separate definitions) triad db generate
Breaking-change detection manual OpenAPI diff triad docs check

The point isn't just fewer dependencies — it's that a change to a schema is impossible to forget to propagate, because there is nothing to propagate to. And the boundary tests you'd never think to write? The framework writes them for you from the constraints you already declared.


License

MIT