Skip to content

feat: add generated TypeScript client surface - #16

Merged
shivros merged 1 commit into
mainfrom
runner/COD-515-typescript-client
Sep 22, 2026
Merged

shivros merged 1 commit into
mainfrom
runner/COD-515-typescript-client

Conversation

@shivros

@shivros shivros commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements COD-515's fourth Hydra surface: a deterministic, zero-runtime-dependency TypeScript client generated from the same explicit API definition as CLI/HTTP/MCP.

  • Adds Surface::TsClient and generated/ts-client/index.ts freshness checking.
  • Emits typed operation params/results, explicit path/query/body mapping, JSON Schema unions/nullable fields, bearer auth, parsed ApiError responses, numeric precision documentation, and collision validation.
  • Keeps SSE out of the unary client unless a streaming TypeScript contract is defined.
  • Adds committed Notes/Security Scan generated artifacts and an Iris API fixture under examples/ts-client with strict TypeScript checking and a real acceptance script.
  • Adds CI tsc --noEmit coverage for the TypeScript example.

Review / verification

  • cargo build --all-targets
  • cargo test --all-targets — 58 codegen tests, 14 Notes surface tests, 6 Security Scan tests, all passing
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • creed diff
  • cargo run -p hydra-codegen --bin hydra-codegen -- check in examples/notes and examples/security-scan
  • npm ci --ignore-scripts --no-audit --no-fund in examples/ts-client
  • npm run typecheck, npm run build, and npm run check:generated in examples/ts-client
  • Live local Iris acceptance: IRIS_URL=http://127.0.0.1:19876 npm run acceptance returned {"health":{"status":"ok"},"threadCount":1}; the local server was stopped after the check.

The generated Iris fixture is a checked-in snapshot; COD-516 is the follow-up consumer wiring/publication ticket.

Closes COD-515.

@shivros

shivros commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Automated Review Panel

Reviewer A — GPT-5.6 (OpenAI Codex)

Verdict: APPROVE

No S0–S3 findings in the final reviewed artifact. The review confirmed:

  • standard JSON Schema nullability is preserved;
  • operation, output-model, client-class, and generated helper identifier collisions are rejected;
  • explicit path/query/body mapping is correct, including URI-encoded path values and guarded URLSearchParams query values;
  • bearer authentication and structured non-2xx ApiError parsing are correct;
  • SSE remains out of the unary TypeScript client;
  • generated domain models remain opaque rather than inventing fields.

Reviewer B — Gemini 3 Flash (OpenRouter)

Verdict: APPROVE

No major findings. The review confirmed the zero-runtime-dependency fetch design, explicit surface/location mapping, deterministic generated artifacts, collision protection, documented numeric precision boundary, strict TypeScript consumer fixture, and SSE safety. The only minor observations were addressed in the final tree: generation validation now has a structured CLI preflight, and the TypeScript example pins rootDir for its acceptance build layout.

Both reviewers inspected the task goal, Hydra conventions, source diff, generated TypeScript artifact, Iris fixture, and CI/config changes. Reviewers ran no commands and made no file changes.

@shivros
shivros marked this pull request as ready for review September 22, 2026 22:37
@shivros

shivros commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Auto-Merge Gate

Confidence: 0.84

Rationale: COD-515 has a clear, implemented goal: generate a deterministic, zero-runtime-dependency TypeScript fetch client from Hydra's explicit API definition. The diff adds the fourth surface, validates generated-identifier collisions and SSE exclusion, commits generated artifacts, documents the wire/precision boundary, and includes strict TypeScript consumer coverage plus a local Iris acceptance fixture. The linked Linear issue contains no manual-review or do-not-merge instruction, and the existing dual-model review panel found no unresolved correctness issue.

Checks observed: Test and Creed context drift completed successfully in GitHub Actions.

Scope limits: This merge delivers Hydra's generator and checked-in fixture only. It does not publish or wire an Iris consumer SDK; that remains COD-516.

@shivros
shivros merged commit b210ff5 into main Sep 22, 2026
2 checks passed
@shivros
shivros deleted the runner/COD-515-typescript-client branch September 22, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant