ES
Coming soon · still cooking

Let AI do the work.
You stay in control.

A backend framework for Bun where you still know what your system does, and why.

The question

How do you answer for something you don’t know?

You approved it, so it’s yours: in production, at three in the morning, in front of a customer. Read or not.

Nobody spends an afternoon on every PR.

  1. 1

    Volume

    Thousands of plausible lines. They compile, pass the tests, look fine.

  2. 2

    Skimmed reviews

    You read line by line… until you don’t. You approve what you haven’t read.

  3. 3

    Silent erosion

    A module writes another’s table. A timer outside any transaction. Nobody saw it.

  4. 4

    Loss of control

    Nobody, neither you nor the agent, knows what the system does or why.

OpenAdd due dates to cards #212
agent opened this 6 minutes ago23 commits+3,184 −4123 / 47 viewed
Approved by you0To read it all ~4 hTime you spent 6 min

Illustrative pull request

The answer

Review the shape, not the lines.

Four tools, one for each moment of a change. Each feeds the next, and production feeds the plan.

  1. Plan

    @newt-js/plan

    The change, agreed before a line is written.

  2. Framework

    @newt-js/core

    Opinionated DDD, batteries included. The lint holds the shape.

  3. Review

    @newt-js/review

    The branch, drawn against its plan.

  4. Monitor

    @newt-js/monitor

    Production, in the domain’s own words.

↺What production shows becomes the next plan

@newt-js/plan

First, the plan. Before a line is written.

The agent proposes the story in steps: the modules it touches, the use cases and events it adds, how they meet. It is checked against the code and the rules, and you agree to it before the code exists.

stories/12.plan.json
context · boardsmodule · cardcontext · notificationsmodule · notificationmodule · reminderemitstriggerscard.setDueDate()use casenewcard.dueDateSeteventnewnotification.schedule()use casereminder.scheduleFor()use casenew

Add due dates to cards

Steps

  1. 1

    A card has a due date

    card.setDueDate saves the date and emits card.dueDateSet.

  2. 2

    Its reminder is scheduled

    card.dueDateSet triggers reminder.scheduleFor.

Rules

  • ✓notifications listens to boards; boards knows nothing of notifications.
  • ✓scheduleFor is idempotent: a changed date never leaves two reminders.
$ newt map --plan stories/12.plan.json✓ Checked against the code and the rules

@newt-js/core

All the artifacts. Each in its place.

Routes, use cases, entities, repositories, events, workers and schedulers, following what happens in a task app when someone deletes one.

context · boardsmodule · cardmodule · attachmentDatabasecard · outboxoutboxRouteDELETE /cards/:idUse casecard.delete()EntityCardRepositoryCard_RepositoryEventcard.deletedUse caseremoveOfCard()Workeron card.deletedSchedulerattachment.hourly
01 / 08RouteThe API only reaches a use case. It never touches the database.
card/card.routes.ts
export function registerCardRoutes(
  base: BoardsBase,
  cards: Card_Module,
  deps: Card_Deps,
) {
  const workspace =
    workspaceRoutes(base, deps.member)
  …
  workspace.delete('/cards/:cardId',
    async request => {
      await cards.delete(request.params.cardId)
      return new Response(null, { status: 204 })
    })
}

@newt-js/review

The branch, against its plan. You review what matters.

When the agent is done, the branch is held against the plan by what is in the code: what is done, what is missing, and what nobody planned. That 47-file pull request, in a few lines.

Add due dates to cards #212

Review: Add due dates to cards

2 things to look at.

The plan’s steps

  1. 1.A card has a due date· done
  2. 2.Its reminder is scheduled· half done (1/2)

Against the plan

  • ✗ missingnotifications/reminder.scheduleFor
  • + not plannedboards → notifications
  • ✓ doneboards/card.setDueDate
  • ✓ doneboards/card.dueDateSet

Rules

  • !notifications/digest reads the card table of boards.
context · boardsmodule · cardcontext · notificationsmodule · notificationmodule · reminderemits✗ missing+ callscard.setDueDate()use case✓card.dueDateSetevent✓notification.schedule()use casereminder.scheduleFor()use case✗ missing
$ newt review --base main --plan stories/12.plan.jsonexit 1

@newt-js/monitor

An APM that speaks your domain. Not your URLs.

Traces, errors and latency, like any APM, but told by context, module and use case, not by endpoint and SQL query. Every request in production, on the map of your system.

askslistens toused by

backoffice

what the staff sees

boards

boards, columns and cards

auth

accounts, workspaces and access
This is a task app, drawn from what its modules declare. Between contexts, arrows only point down; inside each, a module always stands left of what it uses. None goes back.

Principles

“Let the machine write. Let a person decide the shape.”

Why every system an AI writes must be supervisable, backend or not, and what it takes.

Read the principles

Build something that lasts.