# Codes: A lightweight JVM library for stable application outcomes

Original title: Codes – typed application outcomes for Kotlin and Java

> Hacker News story 49434518 · language: en · submitted 2026-08-25
> Web version: https://zeli.app/story/49434518
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 16 · by [aalsanie](<https://news.ycombinator.com/user?id=aalsanie>) · 💬 4
[original](<https://github.com/aalsanie/codes>) · [HN discussion](<https://news.ycombinator.com/item?id=49434518>)

## Summary

Codes is a zero-dependency Java 17+ library that gives applications stable outcome identities and explicit mappings to protocols like HTTP and gRPC. It lets you define domain-specific outcomes (e.g., PAYMENT_DECLINED) and map them to status codes without coupling your domain model to a framework. Includes standard outcome catalogs, structured issues, and Kotlin-friendly APIs.

## Key quote

> A domain outcome can keep the same identity across boundaries: com.example.payments:PAYMENT_DECLINED | +-- HTTP 422 +-- gRPC FAILED_PRECONDITION +-- logs/metrics keep PAYMENT_DECLINED

---

## Cite

- Page: https://zeli.app/story/49434518
- Date: 2026-08-25
- Source: github.com (https://github.com/aalsanie/codes)
- Hacker News: https://news.ycombinator.com/item?id=49434518

## Other languages

- zh: https://zeli.app/zh/story/49434518 · markdown: https://zeli.app/zh/story/49434518.md
