Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/api/oapi-codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@
# spec stays consumable by the pinned generator; the Go module (Phase 1,
# internal/api) reuses the same config so CI and codegen cannot drift.
# The generator version is pinned in scripts/check-api-codegen.sh.
#
# Models only: internal/rest hand-writes the chi handlers and marshals these
# generated types, so response shapes are compile-checked against the frozen
# spec while goldens + the route-coverage test remain the value-level oracle.
# If the spec unfreezes post-cutover and strict-server becomes worth its
# routing rewrite, re-enable chi-server/strict-server here.
package: api
generate:
models: true
chi-server: true
strict-server: true
output-options:
# Go-binding overlay (date-time -> string; see that file's header). Path is
# relative to the go:generate working directory (internal/api).
overlay:
path: ../../docs/api/openapi-go-overlay.yaml
strict: true
21 changes: 21 additions & 0 deletions docs/api/openapi-go-overlay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-License-Identifier: LicenseRef-FSL-1.1-Apache-2.0
#
# OpenAPI Overlay applied by oapi-codegen (docs/api/oapi-codegen.yaml) before
# generating internal/api. Go-binding concerns only — this file must never
# change the wire contract, which lives exclusively in openapi.yaml.
#
# Why: Go's time.Time marshals as RFC3339Nano (variable fractional digits),
# but Node emits Date.toISOString() — always exactly ".000Z" millis. The
# goldens fold timestamps to placeholders by key, so a format drift would be
# invisible to the parity oracle. Binding date-time properties to plain Go
# strings forces handlers to format explicitly (rest.isoMillis), keeping the
# wire bytes identical to Node.
overlay: 1.0.0
info:
title: Go type bindings for the frozen ShellWatch wire contract
version: 1.0.0
actions:
- target: $..[?(@.format == "date-time")]
description: Bind all date-time properties to plain strings (see header).
update:
x-go-type: string
10 changes: 9 additions & 1 deletion docs/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,15 @@ components:
properties:
status: { type: string, enum: [created] }
id: { type: string }
required: [status, id]
StatusUpdated:
type: object
properties: { status: { type: string, enum: [updated] } }
required: [status]
StatusDeleted:
type: object
properties: { status: { type: string, enum: [deleted] } }
required: [status]

TerminalStatus:
type: string
Expand Down Expand Up @@ -193,7 +196,9 @@ components:
mcpReason: { type: string }
mcpClientName: { type: string }
mcpClientVersion: { type: string }
required: [sessionId, endpointId, accountId, status, createdAt, source]
# lastActivityAt is always emitted: types.ts TerminalSession declares it
# non-optional and the manager sets it at create time.
required: [sessionId, endpointId, accountId, status, createdAt, lastActivityAt, source]

Endpoint:
type: object
Expand Down Expand Up @@ -227,6 +232,9 @@ components:
current:
type: boolean
description: True for the first-party web-UI client.
# All keys are always emitted (auth-sessions.ts AuthSessionView declares
# every field non-optional; the two dates are explicit nulls when absent).
required: [clientId, clientName, scopes, authorizedAt, createdAt, current]

PendingActionView:
type: object
Expand Down
98 changes: 57 additions & 41 deletions docs/go-backend-architecture.md

Large diffs are not rendered by default.

Loading