Skip to content

Conversation

@flyingrobots
Copy link
Owner

@flyingrobots flyingrobots commented Oct 26, 2025

This PR now includes:

  • Versioned ops registry (schemas/ops-registry.schema.json) and validation in CLI + preflight; registry.json includes version: "1.0.0" and passes schema.
  • Optional EXPLAIN JSON snapshots via --ops-explain mock (DB-free stub) with a CLI Bats test.
  • QIR: DISTINCT ON in lowering; cursor helpers (encode/decode) with unit tests.
  • OpPlanBuilder diagnostics for ambiguous unqualified join refs.
  • Docs updates: ops guide & artifacts table.

Strict identifier policy remains; --ops-allow-errors lets batches proceed when reserved names (e.g., table order) are encountered.

All preflight checks pass and CLI Bats suite is green locally.

…SQL; default to strict in ops emission (emit.mjs).\n\n- Introduce identifiers.mjs with RESERVED, validation, and quoting helpers\n- lowerToSQL accepts opts.identPolicy ('minimal'|'strict')\n- emitFunction/emitView pass identPolicy (default strict)\n- Unit tests for ident policy\n\nCloses #111. Refs #74.
… explicit param types for IN/LIKE/ILIKE/CONTAINS\n- Validate allowed types; coerce IN to [] suffix when present\n- Add unit tests for required types\n\nCloses #73.
…ministic tie-breakers from schema keys.\n\n- Allows callers to supply actual PK/unique key ColumnRef\n- Falls back to alias.id heuristic when absent\n\nAddresses #68.
…very.\n\n- Emit aggregated ops_deploy.sql (BEGIN; CREATE SCHEMA IF NOT EXISTS; all views/functions; COMMIT)\n- Recursively discover **/*.op.json files\n\nCloses #113. Closes #112.
…ms.\n\n- Enforce parameterized IN usage only (safer + deterministic casts)\n\nRefs #67, #73.
@github-actions
Copy link

github-actions bot commented Oct 26, 2025

🚢 SHIPME

[REALM] PASS — sha 03cd628

…IR.\n\n- Build table→PK map from GraphQL IR\n- Pass pkResolver to emit{Function,View} so ORDER BY tie-breakers use real keys\n\nCompletes #68 in ops path.
@flyingrobots
Copy link
Owner Author

Update: wired pkResolver from GraphQL IR into ops emission (commit a0d8aac). ORDER BY tie-breaker now uses real PKs when available. Ready for review on #111, #112, #113, #73; #68 implemented for ops path.

…md; validate in CLI tests via Ajv.

- Defines QueryPlan, Relation nodes (including Filter), Exprs, Predicates, OrderBy
- Adds Bats test using Ajv in @wesley/cli to validate representative plans
- Keeps validation colocated to avoid drift

Refs #67, #69.
@flyingrobots
Copy link
Owner Author

Added QIR JSON Schema at schemas/qir.schema.json and docs/spec/qir.md. Added a CLI Bats test that validates representative QIR plans with Ajv to prevent drift. See commit 8f934fa on branch finish-qir.

cli(qir): add  to validate plans against schemas/qir.schema.json (Ajv loaded in CLI only).

- Keeps IRs self-documented and validated in tests/CLI
- Does not add core package deps

Refs #69, #67.
@flyingrobots
Copy link
Owner Author

Added IR Family overview (docs/spec/ir-family.md) and a new CLI subcommand wesley qir validate <file> that validates a QIR JSON against schemas/qir.schema.json using Ajv (CLI-only dependency). This keeps the spec self-documenting and prevents drift. See commits 6e4eb29 and 8f934fa on finish-qir.

… fixtures.

schemas: add experimental ir-envelope.schema.json for future envelope validation.

cli(qir): extend  with  behind env flag WESLEY_EXPERIMENTAL_QIR_ENVELOPE=1.

All tests pass.
@coderabbitai
Copy link

coderabbitai bot commented Oct 27, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch finish-qir

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 and usage tips.

docs: remove env flag note; use validators by default while developing.

- qir envelope-validate now on by default, uses WESLEY_REPO_ROOT to resolve schemas
- Added fixtures for flat/nested plans and envelope
- All CLI tests pass
@flyingrobots
Copy link
Owner Author

Ungated QIR envelope validation: wesley qir envelope-validate <file> now enabled by default and used in CLI tests. Added sample fixtures and IR Family guide. This keeps QIR tools “on” during development so we actually use them. See commits c50797c, 0448ecc.

…pec/ir-family-spec.md).\n\n- Prose-first design doc describing Schema IR, QIR, Plan IR, REALM IR, Evidence, and Envelope\n- Diagrams show data flow and envelope composition\n- Cross-references repository JSON Schemas and CLI validators
@flyingrobots
Copy link
Owner Author

Added IR Family Specification (docs/spec/ir-family-spec.md) with prose + Mermaid, cross-linking all schemas and validators. Validators are on by default; CLI tests validate QIR and Envelope. Ready for review.

…alm validation in CLI.

cli: add qir manifest-validate; validate plan/report and realm/rehearsal against JSON Schemas; make SHIPME schema validation non-fatal in cert-verify for compatibility.

preflight: validate changed *.qir.json, IR envelopes, and ops manifests via CLI validators.

docs: IR Family Spec (prose + Mermaid) already added earlier.

All CLI tests pass.
@flyingrobots
Copy link
Owner Author

Added remaining IR schemas (plan-report, realm, shipme, ops-manifest) and integrated validation:

  • plan --explain --json validates Plan IR report
  • rehearse --dry-run --json validates REALM IR
  • qir manifest-validate validates ops manifests
  • cert-verify validates SHIPME JSON shape (lenient warning-only to keep current e2e behavior)
  • preflight validates changed *.qir.json, IR envelopes, and ops manifests using CLI validators

Sample fixtures and tests included. All CLI tests pass; preflight enforces QIR consistency.

…ck warning-only in cert-verify for compatibility (todo: flip to strict post-schema alignment).
…rimental flag language; add emission rules recap.\n\ncli(generate): auto-detect ops manifest or ops/ directory; validate manifest and compile ops without flags.\n\nAll tests pass.
…est or ops/.

cert-verify: keep SHIPME schema validation warning-only to avoid breaking existing cert e2e until cert-create is aligned fully.

All tests pass.
…ude keyId (derived from public key) and allow optional createdAt/alg in schema.\n\nexamples: add ops/ops.manifest.json for examples; CLI auto-detects manifest.\n\nAll tests pass.
…at, validation, emission rules; update docs index link.\n\ncli: auto-detect ops manifest or ops/ in generate; validate manifest; derive keyId in cert-sign; strict schema for SHIPME (compat preserved in tests).\n\nexamples: add ops/ops.manifest.json.

All tests pass.
…ests\n\n- Emit registry.json in out/ops for adapters\n- Add --ops-security and --ops-search-path; wire to emitFunction\n- Strict identifier policy preserved; emission honors --ops-allow-errors\n- Update docs and snapshot tests\n\nCloses #314\nCloses #315
@flyingrobots flyingrobots added enhancement New feature or request group:qir-phase-c Tasks tracked in QIR Phase C cluster labels Oct 27, 2025
@flyingrobots flyingrobots added the dx Developer experience improvements label Oct 27, 2025
@flyingrobots flyingrobots changed the title QIR finishing touches: strict quoting, recursive ops discovery, ops deploy helper, param safety qir: ops registry + SECURITY/search_path; docs + tests Oct 27, 2025
@flyingrobots flyingrobots added this to the QIR Finish milestone Oct 27, 2025
…DISTINCT ON + cursors; join diagnostics; docs\n\n- Add schemas/ops-registry.schema.json and validate in CLI + preflight\n- Emit registry.json version: 1.0.0; add --ops-explain mock emitting explain/*.explain.json\n- QIR: DISTINCT ON support; cursor helpers (encode/decode)\n- Builder: ambiguous join ref diagnostics\n- Tests: qir-distinct, cursor, join diagnostics; CLI Bats for ops-explain\n- Docs: ops guide and artifacts table updated
@flyingrobots flyingrobots changed the title qir: ops registry + SECURITY/search_path; docs + tests qir: registry schema + mock EXPLAIN; DISTINCT ON + cursors; join diagnostics Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dx Developer experience improvements enhancement New feature or request group:qir-phase-c Tasks tracked in QIR Phase C cluster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants