Skip to content

Enforce one generated v19 vocabulary contract - #799

Merged
flyingrobots merged 6 commits into
mainfrom
v19-generated-vocabulary-contract
Jul 27, 2026
Merged

Enforce one generated v19 vocabulary contract#799
flyingrobots merged 6 commits into
mainfrom
v19-generated-vocabulary-contract

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jul 27, 2026

Copy link
Copy Markdown
Member

Closes #791.

Generates CLI, MCP, SDK, docs, public-error, and conformance vocabulary from one GraphQL/Wesley contract. Runs all 12 v19 public-API acceptance gates in CI and removes the stale public storage-composition subpath.

Validation: 129/129 acceptance assertions, exact Wesley/capability/SDK checks, packed-consumer smoke, full lint/typecheck/build, v19 BATS 8/8, and all pre-push shards green.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

V19 vocabulary contract

Layer / File(s) Summary
Define and lower the vocabulary contract
schemas/v19-public-vocabulary.graphql, scripts/GenerateV19VocabularyIr.ts, scripts/V19VocabularyContract.ts
Adds the GraphQL registry, lowers it through Wesley, and validates noun, capability, ordering, and forbidden-term metadata.
Generate artifacts and enforce vocabulary conformance
scripts/V19VocabularyArtifacts.ts, scripts/V19VocabularyConformance.ts, scripts/GenerateV19CapabilityContract.ts, scripts/v19-root-declaration-gate.ts
Generates synchronized JSON, TypeScript, and glossary artifacts and enforces scoped forbidden vocabulary checks.
Synchronize public metadata and wording
bin/cli/capabilities/v19-capabilities.json, bin/cli/v19/*, scripts/generated-sdk/*, docs/topics/*, package.json
Updates generated capability schemas, contract-driven CLI errors, SDK summaries, documentation, and generation commands.
Validate the contract in tests and CI
.github/workflows/ci.yml, scripts/RunV19AcceptanceGates.ts, test/unit/scripts/*, test/unit/cli/*
Adds contract consistency tests, twelve acceptance-gate execution, drift checks, and consumer typechecking in CI.

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

Possibly related issues

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant V19GraphQLSchema
  participant Wesley
  participant V19CapabilityContract
  participant GeneratedArtifacts
  participant CI
  V19GraphQLSchema->>Wesley: Lower schema to vocabulary IR
  Wesley->>V19CapabilityContract: Provide registry metadata
  V19CapabilityContract->>GeneratedArtifacts: Generate JSON, TypeScript, and glossary artifacts
  CI->>GeneratedArtifacts: Check artifact drift
  CI->>V19CapabilityContract: Run twelve acceptance gates
Loading

Poem

A rabbit bounds through nouns so bright,
From GraphQL dawn to gates of light.
Wesley hums, the artifacts grow,
Clean words bloom in every flow.
“Twelve gates passed!” I twitch my ear—
V19 is hopping near! 🐇

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
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.
Description check ⚠️ Warning The description has summary, issue, and validation text, but it omits the required template headings and the ADR checks section. Reformat it into Summary, Issue, Test plan, and ADR checks sections, and complete each checkbox or mark it not applicable.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes appear to satisfy the v19 contract goals: one source drives generators, public-surface gates, docs, and all 12 CI acceptance gates.
Out of Scope Changes check ✅ Passed The diff stays on the v19 contract, generators, gates, docs, and tests, with no unrelated scope visible.
Title check ✅ Passed The title clearly captures the main change: enforcing a single generated v19 vocabulary contract.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@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.

@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: 5

🤖 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 `@schemas/v19-public-vocabulary.graphql`:
- Around line 34-36: Rename the custom `@oneOf` directive to a project-scoped name
such as `@allowedValues`, then update the argumentJsonSchema lookup and the action
argument usage in schemas/v19-public-vocabulary.graphql to reference the new
directive while preserving its existing values behavior.

In `@scripts/GenerateV19VocabularyIr.ts`:
- Around line 43-50: Update the execFileSync call in lowerVocabularySchema to
set an explicitly larger maxBuffer and a finite timeout, while preserving its
fixed argument array and UTF-8 output handling.

In `@scripts/V19VocabularyArtifacts.ts`:
- Around line 91-109: Update requireCurrent to include the offending artifact
path in the CapabilityContractError message, distinguishing whether the artifact
is missing or its contents differ when possible. Preserve emitArtifact’s
check-mode behavior and ensure the failure identifies the specific path before
emitV19VocabularyArtifacts stops on the first mismatch.

In `@scripts/V19VocabularyConformance.ts`:
- Around line 95-126: Extract containsPhrase, tokenMatches, and vocabularyTokens
from scripts/V19VocabularyConformance.ts lines 95-126 into a shared matching
module, then import and reuse them in both gates. In
scripts/v19-root-declaration-gate.ts lines 92-118, remove
containsForbiddenPhrase and vocabularyTokenMatches; also remove its
vocabularyTokens helper at lines 197-203 and update callers to use the shared
helpers, preserving the existing tokenizer and plural-tolerant matching
behavior.

In `@scripts/V19VocabularyContract.ts`:
- Around line 183-227: Update the field-processing flow so
`field.directives['capability']` is parsed once and the resulting metadata is
passed to `orderedCli` and `orderedMcp` instead of re-parsing inside each
function. Handle a missing capability directive by raising the established
`CapabilityContractError` with the field name, rather than allowing
`CAPABILITY_SCHEMA.parse(undefined)` to expose a raw `ZodError`.
🪄 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: 6fdacaf8-d950-4c0e-94a2-f8cbac0a37c8

📥 Commits

Reviewing files that changed from the base of the PR and between 781ee92 and 15b5b8d.

⛔ Files ignored due to path filters (6)
  • bin/cli/capabilities/V19CapabilityContract.generated.ts is excluded by !**/*.generated.*
  • bin/cli/capabilities/V19McpCapabilities.generated.ts is excluded by !**/*.generated.*
  • bin/cli/capabilities/V19PublicVocabulary.generated.ts is excluded by !**/*.generated.*
  • docs/topics/vocabulary.generated.md is excluded by !**/*.generated.*
  • schemas/v19-public-vocabulary.wesley.generated.json is excluded by !**/*.generated.*
  • test/fixtures/generated-sdk/users.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (19)
  • .github/workflows/ci.yml
  • bin/cli/capabilities/v19-capabilities.json
  • bin/cli/v19/V19DomainInput.ts
  • bin/cli/v19/V19SettlementReview.ts
  • docs/topics/README.md
  • docs/topics/api/README.md
  • package.json
  • schemas/v19-public-vocabulary.graphql
  • scripts/GenerateV19CapabilityContract.ts
  • scripts/GenerateV19VocabularyIr.ts
  • scripts/RunV19AcceptanceGates.ts
  • scripts/V19VocabularyArtifacts.ts
  • scripts/V19VocabularyConformance.ts
  • scripts/V19VocabularyContract.ts
  • scripts/generated-sdk/RenderUsersSdkFixture.ts
  • scripts/v19-root-declaration-gate.ts
  • test/unit/cli/v19-input-errors.test.ts
  • test/unit/scripts/v19-root-declaration-gate.test.ts
  • test/unit/scripts/v19-vocabulary-contract.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (6)
  • GitHub Check: v19 base/head performance
  • GitHub Check: test-node (22)
  • GitHub Check: coverage-threshold
  • GitHub Check: type-firewall-lint
  • GitHub Check: type-firewall-generated-sdk
  • GitHub Check: preflight
🧰 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:

  • scripts/generated-sdk/RenderUsersSdkFixture.ts
  • test/unit/scripts/v19-root-declaration-gate.test.ts
  • scripts/GenerateV19VocabularyIr.ts
  • scripts/GenerateV19CapabilityContract.ts
  • scripts/V19VocabularyContract.ts
  • test/unit/cli/v19-input-errors.test.ts
  • test/unit/scripts/v19-vocabulary-contract.test.ts
  • scripts/V19VocabularyConformance.ts
  • scripts/V19VocabularyArtifacts.ts
  • bin/cli/v19/V19DomainInput.ts
  • bin/cli/v19/V19SettlementReview.ts
  • scripts/RunV19AcceptanceGates.ts
  • scripts/v19-root-declaration-gate.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/GenerateV19VocabularyIr.ts

[warning] 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)

scripts/RunV19AcceptanceGates.ts

[warning] 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)

🔇 Additional comments (20)
bin/cli/capabilities/v19-capabilities.json (1)

3-158: LGTM!

Also applies to: 198-198, 213-224, 234-249, 259-279, 289-305, 315-322, 332-339, 349-366, 376-383, 393-400, 410-424, 434-445

bin/cli/v19/V19DomainInput.ts (1)

8-10: LGTM!

Also applies to: 85-88, 115-115, 126-129, 153-156

bin/cli/v19/V19SettlementReview.ts (1)

10-12: LGTM!

Also applies to: 84-87, 102-102

docs/topics/README.md (1)

21-22: LGTM!

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

3-10: LGTM!

Also applies to: 727-729

package.json (1)

75-76: LGTM!

Also applies to: 103-103

test/unit/scripts/v19-vocabulary-contract.test.ts (1)

1-148: LGTM!

test/unit/cli/v19-input-errors.test.ts (1)

12-14: LGTM!

Also applies to: 50-60

test/unit/scripts/v19-root-declaration-gate.test.ts (1)

7-9: LGTM!

Also applies to: 20-48, 128-134

scripts/RunV19AcceptanceGates.ts (1)

1-138: LGTM!

.github/workflows/ci.yml (1)

127-143: LGTM!

schemas/v19-public-vocabulary.graphql (2)

47-108: LGTM!

Also applies to: 267-305


180-215: 🎯 Functional Correctness

No change needed. The root declaration gate only evaluates TypeScript declaration files, and the MCP capability schemas containing receiptRef/planRef are not part of the dist/index.d.ts declaration closure.

			> Likely an incorrect or invalid review comment.
scripts/GenerateV19VocabularyIr.ts (1)

17-41: LGTM!

Also applies to: 52-66

scripts/V19VocabularyContract.ts (1)

19-181: LGTM!

Also applies to: 229-293

scripts/V19VocabularyArtifacts.ts (1)

22-89: LGTM!

Also applies to: 111-148

scripts/V19VocabularyConformance.ts (1)

6-93: LGTM!

scripts/v19-root-declaration-gate.ts (1)

14-26: LGTM!

Also applies to: 61-69, 80-90

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

9-11: LGTM!

Also applies to: 102-102

scripts/GenerateV19CapabilityContract.ts (1)

10-18: 🗄️ Data Integrity & Integration

No change needed. CI runs both npm run check:vocabulary-ir and npm run check:capabilities in the same type-firewall job, so artifact consistency is checked against the current IR.

Comment thread schemas/v19-public-vocabulary.graphql Outdated
Comment thread scripts/GenerateV19VocabularyIr.ts
Comment thread scripts/V19VocabularyArtifacts.ts
Comment thread scripts/V19VocabularyConformance.ts Outdated
Comment thread scripts/V19VocabularyContract.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 f16e297 into main Jul 27, 2026
20 checks passed
@flyingrobots
flyingrobots deleted the v19-generated-vocabulary-contract branch July 27, 2026 07:27
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.

Enforce one generated v19 vocabulary contract

1 participant