History

Drop em-dashes from new comments

Rhys Sullivan committed 4 months ago

Commit 69499191 parent 6a494f97 files · +13 −13Browse files

Unified · Split

7 files
  1. apps/cloud/drizzle/0010_ndjson_output_arrays.sql +1 −1
  2. e2e/scenarios/openapi-ndjson-output.test.ts +6 −6
  3. packages/plugins/openapi/src/sdk/extract.test.ts +1 −1
  4. packages/plugins/openapi/src/sdk/extract.ts +1 −1
  5. packages/plugins/openapi/src/sdk/ndjson-output-migration.ts +2 −2
  6. packages/plugins/openapi/src/sdk/openapi-utils.ts +1 −1
  7. packages/plugins/openapi/src/sdk/streaming-response.test.ts +1 −1
apps/cloud/drizzle/0010_ndjson_output_arrays.sql+1−1
@@ -1,6 +1,6 @@
11 -- Extraction used to persist an NDJSON operation's PER-LINE response schema
22 -- as the tool's output schema, while the invoke path returns an ARRAY of
3−-- parsed lines — so describe previews promised a single object invocations
3+-- parsed lines, so describe previews promised a single object invocations
44 -- never returned. The producer now wraps those schemas in an array. Persisted
55 -- `tool` rows can't be recognized as NDJSON-derived from their schema alone,
66 -- but the stored operation bindings kept the response content type, so the
e2e/scenarios/openapi-ndjson-output.test.ts+6−6
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 // NDJSON endpoints (Vercel's getRuntimeLogs is the motivating real case) are
55 // spec'd with a PER-LINE schema under `application/stream+json`: the schema
66 // describes one log line, the body is many of them. Executor's invoke path
7−// already understands this — it collects the stream and returns an ARRAY of
7+// already understands this: it collects the stream and returns an ARRAY of
88 // parsed rows. But extraction stores the per-line schema as the operation's
99 // outputSchema unchanged, so `tools.schema` / `tools.describe.tool()` advertise
1010 // `data: { level; message; ... }` (a single object) while the runtime value is
@@ -31,7 +31,7 @@ const api = composePluginApi([openApiHttpPlugin()] as const); · 20 unmodified lines
3131
3232 const unique = (prefix: string) => `${prefix}_${randomBytes(4).toString("hex")}`;
3333
34−// Three real-shaped runtime-log lines, one JSON document per line — exactly
34+// Three real-shaped runtime-log lines, one JSON document per line, exactly
3535 // what Vercel's runtime-logs endpoint sends over application/stream+json.
3636 const LOG_LINES = [
3737 { level: "info", message: "build started", rowId: "r1", timestampInMs: 1_700_000_000_000 },
@@ -63,7 +63,7 @@ const serveNdjsonLogs = Effect.acquireRelease( · 25 unmodified lines
6363 (server) => Effect.sync(server.close),
6464 );
6565
66−// The response declares the schema of ONE line under application/stream+json —
66+// The response declares the schema of ONE line under application/stream+json,
6767 // the same convention Vercel's spec uses for getRuntimeLogs.
6868 const runtimeLogsSpec = (baseUrl: string): string =>
6969 JSON.stringify({
@@ -219,7 +219,7 @@ scenario( · 149 unmodified lines
219219
220220 // THE CONTRACT UNDER TEST: the advertised type must describe that
221221 // array. Today extraction stores the per-line schema unwrapped, so
222− // the typedef claims `data` is a single log-line object — the exact
222+ // the typedef claims `data` is a single log-line object, the exact
223223 // mismatch that pushes agents into JSON.stringify shape-probing.
224224 const advertised = schema.outputTypeScript ?? "";
225225 expect(
@@ -229,7 +229,7 @@ scenario( · 3 unmodified lines
229229 ` runtime: Array<{ level; message; rowId; timestampInMs }> (${rows.length} rows)`,
230230 ).toBe(true);
231231
232− // And the sandbox's describe.tool must tell the same story — it is
232+ // And the sandbox's describe.tool must tell the same story: it is
233233 // the surface agents actually consult before writing code.
234234 const sandboxAdvertised = String(invoked.outputTypeScript ?? "");
235235 expect(
@@ -238,7 +238,7 @@ scenario( · 2 unmodified lines
238238 ` advertised: ${sandboxAdvertised}`,
239239 ).toBe(true);
240240 }),
241− // Selfhost shares one workspace identity — leaked connections fail
241+ // Selfhost shares one workspace identity; leaked connections fail
242242 // other scenarios' zero-state assertions.
243243 Effect.gen(function* () {
244244 yield* executeJson(session, removeConnectionsCode(slug)).pipe(Effect.ignore);
packages/plugins/openapi/src/sdk/extract.test.ts+1−1
@@ -93,7 +93,7 @@ describe("OpenAPI extract response bodies", () => { · 92 unmodified lines
9393 // NDJSON endpoints (e.g. Vercel's runtime-logs) declare the schema of
9494 // ONE line under application/stream+json; the invoke path returns an
9595 // array of parsed lines, so the advertised output schema must be that
96− // array — not the per-line object.
96+ // array, not the per-line object.
9797 const lineSchema = {
9898 type: "object",
9999 properties: { level: { type: "string" }, message: { type: "string" } },
packages/plugins/openapi/src/sdk/extract.ts+1−1
@@ -265,7 +265,7 @@ const extractResponseBody = ( · 264 unmodified lines
265265 * Derive an operation's output schema from its response body. NDJSON bodies
266266 * (`application/stream+json` and friends) are spec'd per LINE but returned by
267267 * the invoke path as an array of parsed lines, so the advertised schema wraps
268− * the line schema in an array — otherwise describe previews promise a single
268+ * the line schema in an array; otherwise describe previews promise a single
269269 * object that invocations never return. Used by both the whole-tree extract
270270 * and the serve path's stored-binding rebuild so the two stay in lockstep.
271271 */
packages/plugins/openapi/src/sdk/ndjson-output-migration.ts+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 //
44 // Extraction used to persist an NDJSON operation's PER-LINE response schema as
55 // the tool's output schema, while the invoke path returns an ARRAY of parsed
6−// lines — so describe previews promised a single object that invocations never
6+// lines, so describe previews promised a single object that invocations never
77 // returned. The producer now wraps those schemas in an array; the per-line
88 // shape can't be recognized from a persisted `tool` row alone (it's just a
99 // JSON schema), but the stored operation bindings kept the response content
@@ -52,7 +52,7 @@ const tableExists = (client: SqliteDataMigrationClient, table: string) => · 42 unmodified lines
5252 /** Stale-mark every connection whose integration has at least one stored
5353 * operation binding with an NDJSON response, so the next read rebuilds its
5454 * tool rows (with array-wrapped output schemas). Returns the number of
55− * connections marked. Fresh databases may lack either table — nothing to
55+ * connections marked. Fresh databases may lack either table; nothing to
5656 * migrate. */
5757 export const runSqliteNdjsonOutputMigration = (
5858 client: SqliteDataMigrationClient,
packages/plugins/openapi/src/sdk/openapi-utils.ts+1−1
@@ -138,7 +138,7 @@ export const normalizeMediaType = (mediaType: string | null | undefined): string · 137 unmodified lines
138138
139139 /** Media types whose bodies are newline-delimited JSON documents. The invoke
140140 * path collects these streams and returns an ARRAY of parsed lines, so every
141− * schema surface must describe that array — the spec convention is to declare
141+ * schema surface must describe that array: the spec convention is to declare
142142 * the schema of ONE line (e.g. Vercel's runtime-logs endpoint). */
143143 export const NDJSON_MEDIA_TYPES: ReadonlySet<string> = new Set([
144144 "application/stream+json",
packages/plugins/openapi/src/sdk/streaming-response.test.ts+1−1
@@ -279,7 +279,7 @@ describe("OpenAPI streaming responses", () => { · 278 unmodified lines
279279 // The spec declares the schema of ONE line (Vercel's runtime-logs
280280 // convention); the runtime returns an array of parsed lines. The
281281 // advertised output schema must describe that array on BOTH serve
282− // paths — the add-time compile and the stored-binding rebuild — or
282+ // paths (the add-time compile and the stored-binding rebuild) or
283283 // agents write code against a shape that never comes back.
284284 const lineSchema = {
285285 type: "object",