apache / apache/maka

refactor(runtime-host): convert protocol export * to named re-exports

Open
#3,913 2 comments 0 reactions 1 assignee Claimed by @rengran233 View on GitHub
good first issue help wanted
Dominant language
TypeScript
Stars
5.4k
Forks
502
Avg merge
1d 2h
Merged PRs (30d)
716

Description

## Summary

`packages/runtime-host/src/protocol/index.ts` uses `export *` re-exports from 30+ modules, making the protocol boundary type surface hard to audit. An accidental re-export of an internal type becomes a protocol commitment, but the `RUNTIME_HOST_COMPATIBILITY_EPOCH` system only catches explicit wire-breaking changes.

## Evidence

- `packages/runtime-host/src/protocol/index.ts:64-89` — 25 `export * from` statements
- `protocol/` has 49 files
- `RUNTIME_HOST_COMPATIBILITY_EPOCH` is currently at 50, incremented for wire-breaking changes
- An internal type accidentally re-exported through `export *` becomes part of the public protocol surface

## Proposed Solution

Convert `export *` to named re-exports in `protocol/index.ts`. This makes every exported symbol explicit and auditable.

Benefits:
- Every new protocol export requires an intentional decision
- Prevents accidental leakage of internal types
- Makes protocol surface area reviewable in code review
- Compatible with the existing compatibility epoch system

## Acceptance Criteria

- [ ] `protocol/index.ts` uses named re-exports instead of `export *`
- [ ] All existing public protocol types are preserved
- [ ] No internal types are accidentally exported
- [ ] Protocol surface area diff is visible in PR reviews

## Labels

refactor, help wanted

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.