Skip to content
1 change: 1 addition & 0 deletions docs/internal/COMPONENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ rule 14); a single-file component's surface is what the file exports.
| `DaemonEndpointHost` | `src/daemon/connection-host.ts` | Claiming the socket, recovering a stale entry, the listener lifecycle. | Anything after a connection is accepted. |
| `AdminSecretManager`, session resolver | `src/daemon/admin-secret.ts`, `src/daemon/session.ts` | The per-start admin secret, its hash and persistence; turning a credential into `{ principal, role }`. | Decide what a role may do. |
| `GatewayUplink` | `src/daemon/gateway-uplink.ts` | When a worker dials its gateway: one outbound connection, redialled with backoff, handed to `DaemonServer`. | What travels over the link. |
| Link module | `src/link/` (surface: `index.ts`) | Wrapping one uplink transport connection (ADR 0028 §1-3): text messages passed through unchanged and ahead of bulk bytes, byte channels with credit, the envelope, the two-lane scheduler and the channel rules, the 64 channel limit and the waits it bounds (30 s accept, 60 s credit). Nothing uses it yet; #558 wraps the uplink with it. | Know what a channel carries, or touch a socket (the transport port does). |
| Relay targets | `src/daemon/relay.ts` | A worker's `relayTargets` (capability name to a function that takes a `Request`, a tenant and a lease id and answers a `Response`), and per uplink connection the relays it carries: the request body fed by `relay.body`, the response sent as `relay-head` and `relay-chunk` pushes, cancel and abort on close. Nothing registers a target yet. | Name a target: the core knows none; modules register through the option. |
| `OwnerRoutedFactBus` | `src/daemon/owner-routed-facts.ts` | Re-emitting lease-scoped facts with the lease's owner attached, for pushes and HTTP notices. | Emit a business fact of its own. |

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0028. The uplink carries byte channels beside its messages, and small messages go first

- **Status:** Accepted — not yet implemented
- **Status:** Accepted — partly implemented: §1–3 (the link module and the transport port, #556); §4–6 (relays on channels, the download cap, the protocol bump) follow
- **Date:** 2026-10-14
- **Issue:** [#552](https://github.com/callstackincubator/simlock/issues/552)
- **Narrows:** [ADR 0026](0026-agent-device-through-a-gateway-relays-over-the-uplink.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/internal/adr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ the status is stale.
| [0025](0025-simlock-ships-android-profiles-and-a-model-pairs-only-with-images-that-fit.md) | Simlock ships Android device profiles, and a model pairs only with images that fit it | Accepted — not yet implemented |
| [0026](0026-agent-device-through-a-gateway-relays-over-the-uplink.md) | agent-device through a gateway: workers advertise capabilities, and the host link relays over the uplink | Accepted — not yet implemented; §2 narrowed by 0028 for relayed bodies |
| [0027](0027-dependency-cruiser-checks-every-component-boundary.md) | dependency-cruiser checks every component's boundary and the module graph | Accepted |
| [0028](0028-the-uplink-carries-byte-channels-and-small-messages-go-first.md) | The uplink carries byte channels beside its messages, and small messages go first | Accepted — not yet implemented |
| [0028](0028-the-uplink-carries-byte-channels-and-small-messages-go-first.md) | The uplink carries byte channels beside its messages, and small messages go first | Accepted — partly implemented (§1–3) |
7 changes: 4 additions & 3 deletions src/daemon/gateway-uplink.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
type IpcConnection,
type UplinkConnector,
type UplinkDialOptions,
type UplinkTransportConnection,
} from "../ports/index.js";
import { GatewayUplink } from "./gateway-uplink.js";

Expand All @@ -22,7 +23,7 @@ class ScriptedConnector implements UplinkConnector {
this.#outcomes.push(...outcomes);
}

async connect(options: UplinkDialOptions): Promise<IpcConnection> {
async connect(options: UplinkDialOptions): Promise<UplinkTransportConnection> {
this.dials.push(options);
const outcome = this.#outcomes.shift() ?? "connect";
if (outcome !== "connect") throw outcome;
Expand Down Expand Up @@ -260,8 +261,8 @@ describe("GatewayUplink", () => {
});

it("closes a connection that lands after a stop rather than serving it", async () => {
let release: ((connection: IpcConnection) => void) | undefined;
const pending = new Promise<IpcConnection>((resolve) => {
let release: ((connection: UplinkTransportConnection) => void) | undefined;
const pending = new Promise<UplinkTransportConnection>((resolve) => {
release = resolve;
});
const connector: UplinkConnector = { connect: async () => pending };
Expand Down
Loading
Loading