What problem does this solve?
Linearis promises JSON-only output, but outputSuccess accepts unknown. That means the compiler allows non-JSON values such as functions, undefined, symbols, class instances, or cyclic objects to reach the output boundary.
Proposed solution
Define a JsonValue type and evaluate whether outputSuccess can require it directly.
Example:
export type JsonPrimitive = string | number | boolean | null;
export type JsonValue =
| JsonPrimitive
| { readonly [key: string]: JsonValue }
| readonly JsonValue[];
export function outputSuccess<T extends JsonValue>(data: T): void;
If generated GraphQL result objects are too noisy initially, add a transitional output type or runtime-safe stringify helper and document the path to full JsonValue enforcement.
Acceptance criteria:
- A project-level JsonValue type exists.
- The output boundary is stricter than unknown or has a documented transitional plan.
- Add tests for undefined/non-serializable output behavior if runtime validation is introduced.
Alternatives considered
Keep unknown for ergonomics. This is permissive but does not encode the project's JSON-only contract in types.
Primary use case
LLM agent integration
What problem does this solve?
Linearis promises JSON-only output, but outputSuccess accepts unknown. That means the compiler allows non-JSON values such as functions, undefined, symbols, class instances, or cyclic objects to reach the output boundary.
Proposed solution
Define a JsonValue type and evaluate whether outputSuccess can require it directly.
Example:
If generated GraphQL result objects are too noisy initially, add a transitional output type or runtime-safe stringify helper and document the path to full JsonValue enforcement.
Acceptance criteria:
Alternatives considered
Keep unknown for ergonomics. This is permissive but does not encode the project's JSON-only contract in types.
Primary use case
LLM agent integration