Skip to content

Generate validated v19 Intent and Observer SDKs - #797

Merged
flyingrobots merged 2 commits into
mainfrom
v19-generated-sdks
Jul 27, 2026
Merged

Generate validated v19 Intent and Observer SDKs#797
flyingrobots merged 2 commits into
mainfrom
v19-generated-sdks

Conversation

@flyingrobots

Copy link
Copy Markdown
Member

Summary

  • Generate a deterministic Wesley/GraphQL SDK fixture with validated runtime-backed Intents and bounded Observers.
  • Prove the packed public/expert surfaces against a disposable real-Git Runtime.

Issue

Closes #790

Test plan

  • npm run test:local
  • npm run test:coverage -- --maxWorkers=2
  • npm run test:sdk-fixture
  • npm run check:sdk-fixture -- --wesley /tmp/git-warp-wesley-4891a631/bin/wesley

ADR checks

  • This PR does not implement ADR 2 without satisfying ADR 3
  • No persisted op formats are changed
  • No wire compatibility behavior is changed
  • No patch or checkpoint schema constants are changed

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@flyingrobots, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9a8cd385-88cb-4c9a-927d-b1b1fe1c50c6

📥 Commits

Reviewing files that changed from the base of the PR and between d8adb01 and 933bc48.

📒 Files selected for processing (2)
  • scripts/generated-sdk/RenderUsersSdkFixture.ts
  • test/unit/scripts/generated-sdk-renderer.test.ts
📝 Walkthrough

Walkthrough

Adds a deterministic generated Users SDK fixture with validated intent and observer handlers, exposes supporting advanced APIs, verifies packed-consumer behavior, updates type checks and documentation, and enforces generation and smoke checks in CI.

Changes

Generated SDK validation

Layer / File(s) Summary
SDK schema and generated contract
test/fixtures/generated-sdk/users.graphql, scripts/generated-sdk/RenderUsersSdkFixture.ts
Defines Users intent and observer metadata, validates generated operation contracts, and renders runtime-backed SDK handlers.
Deterministic fixture generation
scripts/generated-sdk/GenerateUsersSdkFixture.ts, package.json, scripts/check-source-backed-reference.ts, test/fixtures/generated-sdk/README.md
Adds version-pinned generation, byte-for-byte drift checking, regeneration commands, and fixture provenance documentation.
Packed consumer smoke flow
scripts/smoke-generated-sdk.sh, test/fixtures/generated-sdk/consumer-*.ts, test/fixtures/generated-sdk/tsconfig.json, tsconfig.test.json
Packs and installs the SDK, compiles a temporary consumer, performs writes and reads, and validates runtime receipts and input bounds.
Advanced API surface and type coverage
advanced.ts, docs/topics/api/README.md, docs/topics/reference.md, test/type-check/*, test/unit/scripts/v19-public-api-boundary.test.ts, vitest.config.ts
Exports intent, reading, and observer constructors and updates documentation, type-check fixtures, API boundary expectations, and coverage thresholds.
CI firewall enforcement
.github/workflows/ci.yml
Adds the generated-SDK firewall lane and includes its result in the aggregate gate.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CI
  participant Wesley
  participant FixtureGenerator
  participant PackedConsumer
  participant Runtime
  CI->>Wesley: install pinned generator revision
  CI->>FixtureGenerator: check generated fixture drift
  FixtureGenerator->>PackedConsumer: provide generated SDK fixture
  PackedConsumer->>Runtime: write users and roles
  PackedConsumer->>Runtime: read role observations
  Runtime-->>CI: smoke test result
Loading

Possibly related PRs

Poem

A bunny checks the SDK by moonlight,
Pins each fixture crisp and right.
Intents hop in, observers peek,
CI guards the path each week.
Pack, run, read—what a delight! 🐇

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The Vitest coverage threshold change in vitest.config.ts is unrelated to the SDK generation objectives. Remove the coverage threshold tweak unless it is required by an explicit acceptance criterion.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed It clearly summarizes the main change: generating validated v19 Intent and Observer SDKs.
Description check ✅ Passed It follows the template with Summary, Issue, Test plan, and completed ADR checks, and references #790.
Linked Issues check ✅ Passed The changes satisfy the #790 acceptance criteria for deterministic generation, validation, bounded observers, packing, and CI drift checks.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/generated-sdk/RenderUsersSdkFixture.ts`:
- Around line 1-8: Update the generated SDK consumer configuration associated
with RenderUsersSdkFixture to enable .js-to-.ts resolution, using either
rewriteRelativeImportExtensions or allowImportingTsExtensions in the packed
consumer tsconfig. Preserve the existing NodeNext module configuration and
generated import behavior.
- Around line 223-230: Update requireOutputPath to report a missing or
incomplete --out CLI argument with a distinct usage-error type or message
instead of GeneratedSdkContractError. Keep the existing validation and returned
output behavior unchanged when a valid path is provided.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 02516bd0-7276-4549-a5a4-17f64cf58eb3

📥 Commits

Reviewing files that changed from the base of the PR and between a5d49a6 and d8adb01.

⛔ Files ignored due to path filters (2)
  • test/fixtures/generated-sdk/users.generated.ts is excluded by !**/*.generated.*
  • test/fixtures/generated-sdk/users.wesley.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (22)
  • .github/workflows/ci.yml
  • advanced.ts
  • docs/topics/api/README.md
  • docs/topics/reference.md
  • package.json
  • scripts/check-source-backed-reference.ts
  • scripts/generated-sdk/GenerateUsersSdkFixture.ts
  • scripts/generated-sdk/RenderUsersSdkFixture.ts
  • scripts/smoke-generated-sdk.sh
  • test/fixtures/generated-sdk/README.md
  • test/fixtures/generated-sdk/consumer-read.ts
  • test/fixtures/generated-sdk/consumer-write.ts
  • test/fixtures/generated-sdk/tsconfig.json
  • test/fixtures/generated-sdk/users.graphql
  • test/type-check/generated-users.ts
  • test/type-check/tsconfig.json
  • test/type-check/v19-consumer.ts
  • test/type-check/v19-first-use.ts
  • test/type-check/v19-subpaths.ts
  • test/unit/scripts/v19-public-api-boundary.test.ts
  • tsconfig.test.json
  • vitest.config.ts
💤 Files with no reviewable changes (1)
  • test/type-check/generated-users.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (14)
  • GitHub Check: v19 base/head performance
  • GitHub Check: preflight
  • GitHub Check: typecheck-test-advisory
  • GitHub Check: test-deno
  • GitHub Check: coverage-threshold
  • GitHub Check: type-firewall-types
  • GitHub Check: test-node (22)
  • GitHub Check: type-firewall-docs
  • GitHub Check: test-bun
  • GitHub Check: type-firewall-lint
  • GitHub Check: type-firewall-surface
  • GitHub Check: type-firewall-semgrep
  • GitHub Check: type-firewall-generated-sdk
  • GitHub Check: type-firewall-quarantine
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Do not use direct imports from src/infrastructure/** in src/domain/** or src/ports/**; depend on a port instead.
Do not use direct Node built-ins in src/domain/** or src/ports/**; use a port instead.

Files:

  • vitest.config.ts
  • test/type-check/v19-consumer.ts
  • test/type-check/v19-first-use.ts
  • test/fixtures/generated-sdk/consumer-write.ts
  • test/fixtures/generated-sdk/consumer-read.ts
  • advanced.ts
  • test/unit/scripts/v19-public-api-boundary.test.ts
  • scripts/check-source-backed-reference.ts
  • scripts/generated-sdk/GenerateUsersSdkFixture.ts
  • test/type-check/v19-subpaths.ts
  • scripts/generated-sdk/RenderUsersSdkFixture.ts
🧠 Learnings (1)
📚 Learning: 2026-03-04T12:08:30.347Z
Learnt from: flyingrobots
Repo: git-stunts/git-warp PR: 63
File: package.json:126-126
Timestamp: 2026-03-04T12:08:30.347Z
Learning: Vitest 4 removes vite-node as a dependency and rewrites its pool system. Do not flag the absence of vite-node in package.json or lockfiles as an error for Vitest 4 projects. Use this as a general guideline: if a project uses Vitest 4, missing vite-node is expected and correct; only flag issues if there is evidence the project is not using Vitest 4 or if vite-node is explicitly required by the project.

Applied to files:

  • package.json
🪛 ast-grep (0.44.1)
scripts/generated-sdk/GenerateUsersSdkFixture.ts

[warning] 11-11: Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🪛 LanguageTool
test/fixtures/generated-sdk/README.md

[grammar] ~3-~3: Use a hyphen to join words.
Context: ...K fixture users.graphql is the single authored source for this fixture. Wesley...

(QB_NEW_EN_HYPHEN)

🪛 zizmor (1.26.1)
.github/workflows/ci.yml

[error] 122-122: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): this step

(cache-poisoning)


[info] 115-115: workflow or action definition without a name (anonymous-definition): this job

(anonymous-definition)


[warning] 193-193: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[warning] 194-194: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[warning] 196-196: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[warning] 197-197: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[warning] 198-198: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[warning] 199-199: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[warning] 200-200: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[warning] 201-201: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

🔇 Additional comments (22)
test/fixtures/generated-sdk/tsconfig.json (1)

1-18: LGTM!

test/fixtures/generated-sdk/consumer-write.ts (1)

1-48: LGTM!

test/fixtures/generated-sdk/consumer-read.ts (1)

1-67: LGTM!

scripts/smoke-generated-sdk.sh (1)

1-57: LGTM!

tsconfig.test.json (1)

15-15: LGTM!

.github/workflows/ci.yml (1)

115-138: LGTM!

Also applies to: 182-182, 193-201

advanced.ts (1)

12-17: LGTM!

docs/topics/reference.md (1)

98-112: LGTM!

Also applies to: 114-128

docs/topics/api/README.md (1)

8-10: LGTM!

Also applies to: 554-561

test/type-check/tsconfig.json (1)

4-19: LGTM!

test/type-check/v19-consumer.ts (1)

26-26: LGTM!

test/type-check/v19-first-use.ts (1)

4-4: LGTM!

test/type-check/v19-subpaths.ts (1)

9-23: LGTM!

Also applies to: 45-59, 86-87

test/unit/scripts/v19-public-api-boundary.test.ts (1)

203-216: LGTM!

vitest.config.ts (1)

33-33: LGTM!

test/fixtures/generated-sdk/users.graphql (1)

1-74: LGTM!

scripts/generated-sdk/RenderUsersSdkFixture.ts (1)

17-88: LGTM!

Also applies to: 110-220

scripts/generated-sdk/GenerateUsersSdkFixture.ts (2)

37-106: LGTM!


1-16: 🩺 Stability & Availability

No change needed. The project pins Node 22 across package.json engines and CI, which supports flagless native TypeScript execution for these scripts.

package.json (1)

76-77: LGTM!

Also applies to: 100-100

scripts/check-source-backed-reference.ts (1)

270-270: LGTM!

test/fixtures/generated-sdk/README.md (1)

1-22: LGTM!

Comment thread scripts/generated-sdk/RenderUsersSdkFixture.ts
Comment thread scripts/generated-sdk/RenderUsersSdkFixture.ts
@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.2.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Main Push Release Branch Check will run final preflight and create v18.2.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.2.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Main Push Release Branch Check will run final preflight and create v18.2.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@flyingrobots
flyingrobots merged commit 1d2613d into main Jul 27, 2026
19 checks passed
@flyingrobots
flyingrobots deleted the v19-generated-sdks branch July 27, 2026 00:54
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.

Generate validated v19 Intent and Observer SDKs

1 participant