---
id: 05-scaffold-optional-cores
epic: platform-retrofit
title: Scaffold core-events and core-realtime
type: technical-story
status: todo
feature: core-events, core-realtime
depends-on: []
blocks: [08-rewrite-agent-docs]
created: 2026-07-12T10:22:00Z
---

## Goal

`@repo/core-events` and `@repo/core-realtime` exist as workspace packages, scaffolded via `pnpm turbo gen core-package`, each with its generator-emitted test suite and pre-shipped library trace (ADR-022 "pre-shipped trace" mechanism). No consumers are wired yet beyond compile-green.

## Why

The walking-skeleton PRD needs runner status events and pushes; scaffolding the two optional cores now means that PRD lands on a floor where the bus and realtime substrate already compile and pass gates (PRD in-scope item).

## Done when

- `packages/core-events` and `packages/core-realtime` exist and build.
- Generator-emitted test suites pass; pre-shipped traces satisfy the ADR-022 pre-commit hook.
- No consumers wired — nothing in `auth` or the apps depends on them yet.
- `pnpm typecheck && pnpm lint && pnpm test && pnpm conformance && pnpm fallow:audit && pnpm coverage:diff` pass on each commit.

## Out of scope

- Wiring any publisher/consumer or realtime channel (walking-skeleton PRD).
- Additional test coverage beyond the generator-emitted suites (PRD testing decision: none required until consumers exist).

## Tasks

- [ ] Run `pnpm turbo gen core-package events` to scaffold `@repo/core-events` with its generator-emitted tests and pre-shipped trace (ADR-022) — compile-green, no consumers wired, one commit, all gates pass.
- [ ] Run `pnpm turbo gen core-package realtime` to scaffold `@repo/core-realtime` with its generator-emitted tests and pre-shipped trace (ADR-022) — compile-green, no consumers wired, one commit, all gates pass.
