Skip to content

Fix Wesley core and emitter syntax-model boundaries - #613

Merged
flyingrobots merged 12 commits into
mainfrom
fix/wesley-core-extension-boundary
Jun 20, 2026
Merged

flyingrobots merged 12 commits into
mainfrom
fix/wesley-core-extension-boundary

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jun 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Remove generic runtime dispatch ID helpers from wesley-core and stop exporting runtime OP_* constants from the generic LE binary TypeScript emitter.
  • Keep runtime/host authority vocabulary out of the generic core model while preserving compiler-owned optic artifact and witness evidence.
  • Refactor the LE binary TypeScript codec emitter to lower into a crate-local TypeScript syntax model before rendering through a dedicated printer.
  • Document the TypeScript and Rust emitter boundary: semantic lowering builds a syntax model first; raw source string writes stay at the printer boundary.

Why

Wesley core should stay domain-empty and runtime-neutral. Target-owned extensions should supply runtime operation identifiers and authority vocabulary instead of inheriting them from generic Wesley core.

The emitter side now matches the same discipline: TypeScript and Rust generation use syntax-model-to-printer pipelines, avoiding semantic lowering code that assembles source text directly.

Validation

  • bats -t test/domain-empty-boundary.bats
  • cargo test -p wesley-core -p wesley-emit-typescript
  • cargo test -p wesley-emit-rust
  • cargo clippy -p wesley-emit-typescript --all-targets -- -D warnings
  • pnpm run preflight
  • pre-push hook: cargo xtask preflight

Notes

This PR intentionally does not introduce runtime target-specific operation IDs into Wesley core. Echo, git-warp, or other target profiles should own those identifiers in their target-specific extension layer.

Summary by CodeRabbit

  • Changed
    • Refactored TypeScript and Rust generation to use AST-based pipelines with dedicated rendering for more consistent emitted output.
    • Updated operation dispatch identifier ownership: runtime dispatch identifiers are now supplied by target extensions rather than generated by core.
    • Updated runtime optic terminology and artifacts from “admission” to “requirements,” including the associated “north star” and evidence documentation language.
  • Fixed
    • Added an undici version override to eliminate audit/CI jsdom advisories.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

More reviews will be available in 1 minute and 37 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

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

🚦 How do rate limits work?

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

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bb762775-cd46-497f-b782-d2ecd77ddad0

📥 Commits

Reviewing files that changed from the base of the PR and between d842e22 and fba2795.

📒 Files selected for processing (2)
  • crates/wesley-emit-typescript/src/le_binary.rs
  • test/ci-workflows.bats
📝 Walkthrough

Walkthrough

Removes host-issued authority structs (CapabilityGrant, AdmissionTicket, ObserverClass, etc.) and stable runtime dispatch ID helpers (stable_op_id, operation_type_rank) from wesley-core, renames the optic "admission requirements" model to "requirements" throughout, refactors the TypeScript LE binary emitter from direct string concatenation to an AST+printer pipeline, adds a new codec fixture, updates tests and boundary enforcement, and adjusts CI workflows.

Changes

Core Boundary Cleanup and TS Emitter Refactor

Layer / File(s) Summary
Optic domain model: admission→requirements rename and host-authority type removal
crates/wesley-core/src/domain/optic.rs
Renames OPTIC_ADMISSION_REQUIREMENTS_ARTIFACT_CODEC → OPTIC_REQUIREMENTS_ARTIFACT_CODEC, introduces OpticRequirements and OpticRequirementsArtifact structs replacing the prior admission types, updates OpticArtifact field types, and removes CapabilityGrant, CapabilityPresentation, AdmissionTicket, BasisConstraint, ApertureConstraint, BudgetConstraint, ObserverClass, PermissionGrant, OpticArtifactHandle, OpticAdmissionRequirements, and OpticAdmissionRequirementsArtifact from the public surface.
Operation domain: remove stable op-id helpers
crates/wesley-core/src/domain/operation.rs
Removes the public stable_op_id, operation_type_rank, and internal fnv1a_step functions along with the cfg(test) module that pinned their expected outputs.
Apollo adapter: admission→requirements rename
crates/wesley-core/src/adapters/apollo.rs
Updates imports to OPTIC_REQUIREMENTS_ARTIFACT_CODEC, renames admission_requirements_from_footprint to requirements_from_footprint, changes the return type from OpticAdmissionRequirements to OpticRequirements, and updates canonical_requirements_artifact to return OpticRequirementsArtifact.
TypeScript LE binary emitter: AST+printer pipeline, remove OP_* emission
crates/wesley-emit-typescript/src/le_binary.rs, crates/wesley-emit-typescript/README.md, crates/wesley-emit-rust/README.md
Replaces direct string-concatenation codegen with a TsProgram AST model (TsDeclaration, TsFunction, TsStatement, TsExpr, TsTypeExpr) plus dedicated print_* renderer functions. Removes OP_* runtime operation-id constant emission. Extends string literal escaping. Adds "Emitter Boundary" sections to both emitter READMEs documenting the two-step pipeline rule.
TS emitter fixture: new GraphQL schema and generated codec golden file
test/fixtures/typescript-emitter/le-binary-codec.graphql, test/fixtures/typescript-emitter/le-binary-codec.generated.ts
Adds the le-binary-codec.graphql fixture with Solo/Color enums, MakeWidgetInput input object, Widget type, and Query/Mutation roots. Adds the corresponding golden .generated.ts file with exported codecs for all types. Updates the golden-fixture test to use exact string equality and asserts absence of runtime operation markers.
Test updates: op-id constants, codec constant refs, authority wire tests
crates/wesley-core/tests/operation_analysis.rs, crates/wesley-core/tests/runtime_optic_artifact.rs
Replaces assert_op_id_forms_agree/STACK_WITNESS_* constants with assert_target_op_id_forms_agree (hex/decimal consistency only). Updates three codec constant references to OPTIC_REQUIREMENTS_ARTIFACT_CODEC. Removes wire serialization assertions for removed handle/grant/presentation/ticket/ObserverClass types.
Runtime-smokes CI: switch Bun job from Bats to Bun host-contracts script
.github/workflows/runtime-smokes.yml, test/ci-workflows.bats
Updates bun-smoke job to run bun run scripts/host_contracts_bun.mjs directly instead of Bats-based flow. Verifies the Bun setup action uses a pinned digest and tightens install-bats usage expectation to exactly once.
Bats boundary enforcement and undici audit fix
test/domain-empty-boundary.bats, package.json
Adds four negative-content Bats tests asserting runtime dispatch ids, OP_* constants, and host-authority vocabulary are absent from relevant source files and docs. Updates BEARING.md section-heading assertion. Pins undici to 7.28.0 via pnpm.overrides to clear jsdom audit advisories.
Documentation updates
CHANGELOG.md, README.md, docs/NORTHSTAR.md, docs/TECHNICAL_TEARDOWN.md, docs/SDL.md, docs/JEDIT_CAPABILITY_PROGRESS.md
Updates all documentation to reflect removal of host-issued authority vocabulary, renaming of admission→requirements, target-owned operation identifiers replacing Wesley-computed OP_* constants, and the new two-step emitter pipeline rule.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • flyingrobots/wesley#499: Both PRs modify Stack Witness 0001 test/fixture validation around createBuffer/replaceRange/textWindow operation IDs and opId-related assertions in crates/wesley-core/tests/operation_analysis.rs.
  • flyingrobots/wesley#504: This PR renames and removes types introduced in PR #504 (OpticAdmissionRequirements* → OpticRequirements*) and removes several runtime authority/capability/witness structs from crates/wesley-core/src/domain/optic.rs.
  • flyingrobots/wesley#610: Both PRs modify test/domain-empty-boundary.bats and reference docs/BEARING.md section-heading assertions around the "Continuum YOLO Runtime-Neutral Edict" placement.

Suggested labels

enhancement, feature

🐇 Goodbye admission tickets and OP_* IDs,
The host's authority nowhere resides!
Requirements now speak in target-owned truth,
While AST printers handle the proof.
The boundary is clean, the law is the law—
No string soup in lowering, that was the flaw! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly summarizes the main change: refactoring Wesley core and emitter syntax-model boundaries to enforce separation of concerns.
Description check ✅ Passed The pull request description covers the required template sections with clear summary, rationale (why), validation steps, and notes on the approach, though some template checkboxes are not explicitly marked.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wesley-core-extension-boundary

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.

@github-actions

github-actions Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

🔍 The Case of Pull Request #613

Plain-English Readout

  • Holmes (evidence investigation): Holmes says this change looks ready to ship.
  • Watson (independent verification): Watson found verification concerns. Most important concern: No evidence citations were available for trust analysis.
  • Moriarty (trend forecast): Moriarty does not have enough historical data yet to forecast readiness.

Suggested next actions

  1. Resolve Watson’s verification concerns before trusting the Holmes verdict as final.
📚 Glossary (what the Holmes terms mean)
  • HOLMES: Wesley’s main evidence investigation. It decides whether the cited proof is strong enough to justify shipping this commit.
  • WATSON: An independent verification pass. It checks Holmes’s citations and score math instead of trusting them blindly.
  • MORIARTY: A readiness forecast over time. It is advisory trend analysis, not the release gate itself.
  • Schema coverage score (SCS): How much of the schema has direct supporting evidence across generated artifacts and cited proof.
  • Test confidence index (TCI): How much test evidence exists for constraints, policies, relationships, and operations.
  • Migration risk index (MRI): How risky the schema change is to roll out. Lower is better.
  • Evidence trust: Whether the report is backed by exact citations, whole-file citations, or coarse references. Weak trust means the claim may be directionally right but not specific enough to trust blindly.
  • Citation quality: A count of exact line-span citations versus whole-file or coarse references.
  • ELEMENTARY: Ready to ship based on the current evidence.
  • REQUIRES INVESTIGATION: More work or review is needed before shipping.
  • YOU SHALL NOT PASS: Do not ship this change in its current state.

🕵️ SHA-lock HOLMES full report (click to expand)

🕵️ SHA-lock HOLMES Investigation

  • Generated: 2026-01-01T00:00:00.000Z
  • Commit SHA: a3bfad0
  • Bundle Version: 2.0.0

⚠️ Evidence valid only for commit a3bfad0

🔍 Executive Deduction

"Watson, after careful examination of the evidence, I deduce..."

Weighted Completion: ██████████ 95.0%
Scores: SCS 95.0% · TCI 90.0% · MRI 10.0%
Verification Status: 2 claims verified
Citation Quality: 2 exact · 0 whole-file · 0 coarse
Evidence Trust: strong
Ship Verdict: ELEMENTARY

🧩 SCS Breakdown

Component Score Coverage
Sql 100.0% 1.00/1.00
Types 100.0% 1.00/1.00
Validation 100.0% 1.00/1.00
Tests 100.0% 1.00/1.00

🧪 TCI Breakdown

Component Score Coverage Note
Unit Constraints 100.0% 1/1 N/A
Unit Rls 100.0% 1/1 N/A
Integration Relations 100.0% 1/1 N/A
E2e Ops 90.0% 9/10 fixture

⚠️ MRI Breakdown

Component Risk Share Points Count
Drops 0.0% 0 0
Renames Without Uid 0.0% 0 0
Add Not Null Without Default 100.0% 1 1
Non Concurrent Indexes 0.0% 0 0

📊 The Weight of Evidence

"Observe, Watson, how not all features carry equal importance..."

Element Weight Status Evidence Strength Deduction
schema 5 ✅ Exact SQL & tests test/fixtures/examples/.wesley-cache/shipme-fixture/tests.sql:1-1@a3bfad0 exact Elementary!

🚪 Security & Performance Gates

"Elementary security measures, Watson..."

Gate Status Evidence Holmes's Ruling
Migration Risk ✅ MRI: 10.0% "Trivial risk"
Test Coverage ✅ TCI: 90.0% "Excellent coverage"
Sensitive Fields ✅ 0 fields "All secured"
Evidence Quality ✅ 2 exact · 0 whole-file · 0 coarse "All 2 citations resolve to exact line spans."

📋 The Verdict

✅ ELEMENTARY - Ship immediately!
"The evidence is conclusive. No mysteries remain."

Signed and sealed,

  • S. Holmes, Consulting Detective

[END OF INVESTIGATION FOR COMMIT a3bfad0]

🧵 Command Run

  • Run ID: run-c18268ba-d4e2-4574-b900-ad283a3ec5c2
  • Transmutation: holmes-investigate
  • Command: investigate
  • Status: completed
  • Ledger: /home/runner/work/wesley/wesley/test/fixtures/examples/.wesley-cache/ledger

🩺 Dr. WATSON full report (click to expand)

🩺 Dr. Watson's Independent Verification Report

Medical Examination of Evidence

  • Examination Date: 2026-06-19T19:00:11.597Z
  • Patient SHA: a3bfad0

🔬 Citation Verification

"Let me examine each piece of evidence independently..."

  • Citations Examined: 2
  • Verified: 0 ✅
  • Failed: 0 ❌
  • Unable to Verify: 2
  • Exact Subrange Citations: 0
  • Whole-file Citations: 0
  • Coarse Citations: 0
  • Evidence Trust: missing
  • Trust Note: No evidence citations were available for trust analysis.

Verification Rate: 0.0%

📊 Mathematical Verification

"I shall recalculate Holmes's arithmetic..."

Holmes claimed SCS: 95.0%
Watson calculates: 100.0%
Difference: ⚠️ Significant

🔍 Consistency Analysis

"Checking for contradictions in Holmes's deductions..."

✅ No logical inconsistencies detected

🩺 Dr. Watson's Medical Opinion

VERIFICATION: CONCERNS NOTED ⚠️

"While Holmes's methods are generally sound, I have noted some"
"discrepancies that warrant further investigation. No evidence citations were available for trust analysis."

Respectfully submitted,

  • Dr. J. Watson, M.D.
    Medical Examiner & Verification Specialist

🧵 Command Run

  • Run ID: run-c7880544-0680-4858-bdc3-20bad7909812
  • Transmutation: watson-verify
  • Command: verify
  • Status: completed
  • Ledger: /home/runner/work/wesley/wesley/test/fixtures/examples/.wesley-cache/ledger

🔮 Professor MORIARTY full report (click to expand)

🧠 Professor Moriarty's Temporal Predictions

The Mathematics of Inevitability

  • Analysis Date: 2026-06-19T19:00:43.242Z

INSUFFICIENT DATA

"I require at least two data points to predict the future."
"Run Wesley generate multiple times to build history."

🧵 Command Run

  • Run ID: run-b38b3cea-0627-4a27-8118-d8bb9b73e11f
  • Transmutation: moriarty-predict
  • Command: predict
  • Status: completed
  • Ledger: /home/runner/work/wesley/wesley/test/fixtures/examples/.wesley-cache/ledger

Machine-readable reports: holmes-report.json · watson-report.json · moriarty-report.json (see workflow artifacts).


Filed at 221B Repository Street

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

@flyingrobots

Copy link
Copy Markdown
Owner Author

Self-Code Review

Cc: @codex for second opinion.

Severity File / line Type Finding Recommended mitigation prompt
P2 crates/wesley-emit-typescript/src/le_binary.rs:217, crates/wesley-emit-typescript/src/le_binary.rs:713 Generated-output compatibility The new syntax-model printer changes single-variant enum output from the previous multiline union form to export type Solo = 'ONE';. That is valid TypeScript, but generated source bytes are part of Wesley's artifact surface; this creates undocumented byte drift for any singleton enum consumer while the refactor claims a structural boundary change. Fix the LE binary TypeScript syntax model so enum aliases preserve the previous emitter's multiline union layout for singleton and multi-variant enums. Prefer an explicit enum/string-literal-union AST node that does not collapse singleton unions, and add a singleton enum regression test.
P4 crates/wesley-emit-typescript/src/le_binary.rs:1115 Test coverage / codegen assurance The largest emitter refactor is still guarded mainly by contains assertions. That lets output-order, formatting, and full-module byte drift pass silently, including the singleton enum drift above. For a code generator with SHA-lock posture, substring checks are too weak as the primary assurance. Add a byte-exact golden fixture for the LE binary TypeScript emitter covering imports, enum aliases, input objects, operation vars, nullable/list codecs, and the absence of runtime OP constants. Keep focused contains tests only for narrow edge cases.

No P0/P1 issues found in this pass. git diff --check origin/main...HEAD is clean, and the local worktree was clean before review.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40a68130bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/wesley-emit-typescript/src/le_binary.rs
Comment thread crates/wesley-core/src/domain/optic.rs
@flyingrobots

Copy link
Copy Markdown
Owner Author

Activity Summary

# Source Severity File Commit Outcome
1 PR review P2 crates/wesley-emit-typescript/src/le_binary.rs 7600c96e, 713b15a6 Fixed singleton enum alias byte drift with StringLiteralUnion, byte-exact LE binary golden coverage, and guard-safe runtime-marker assertions. Thread resolved.
2 PR review P2 docs/SDL.md, test/domain-empty-boundary.bats 2d384d0a Updated active SDL reference from OpticAdmissionRequirements* / admission truth language to OpticRequirements* / target-owned policy language. Added regression guard. Thread resolved.

Self-audit found no additional unresolved defects beyond the PR review queue.

Validation:

  • git diff --check origin/main...HEAD
  • cargo fmt --check
  • cargo test -p wesley-emit-typescript
  • bats -t test/domain-empty-boundary.bats
  • pnpm prettier --check docs/SDL.md
  • git diff --check
  • pnpm run preflight
  • pre-push Rust product preflight
  • pre-push repo Bats smoke suite

@flyingrobots

Copy link
Copy Markdown
Owner Author

Code Lawyer Self-Review

Cc: @codex for confirmation.

Review basis: clean local worktree before review, git fetch --all --prune, and PR diff reviewed as origin/main...HEAD from fix/wesley-core-extension-boundary.

Severity File / line Type Finding Recommended mitigation prompt
P1 crates/wesley-emit-typescript/src/le_binary.rs:530, crates/wesley-emit-typescript/src/le_binary.rs:581, crates/wesley-emit-typescript/src/le_binary.rs:644 Generated-code correctness The LE binary TypeScript emitter still lowers every list as a single writeList / readList over scalar leaf values. That ignores both nullable list items (listItemNullable) and nested list wrappers (listWrappers / leafNullable), even though Wesley IR explicitly carries those facts at crates/wesley-core/src/domain/ir.rs:139-147. For [String]!, the emitted TypeScript type permits `(string null)[], but the encoder calls w.writeString(x)for each item, sonullpasses type generation and then fails or corrupts at runtime. For[[Int!]!]!, the encoder passes the inner array to writeI32Le`. This is a silent wrong-code generator path, not a rejected unsupported feature.
P3 crates/wesley-core/tests/operation_analysis.rs:352, crates/wesley-core/tests/operation_analysis.rs:405, crates/wesley-core/tests/operation_analysis.rs:461 Fixture consistency / coverage regression Removing generic stable_op_id is the right boundary move, but this patch also removed the only check that the remaining target-owned stack-witness vector keeps opIdHex and opIdDecimal in sync. The fixture still exposes both forms in test/fixtures/consumer-models/stack-witness-0001-vectors.json:14-15, :38-39, and :62-63, while the updated test only compares the SDL directive to opIdHex. A stale decimal would now pass even though downstream consumers may use either representation. Restore a target-owned fixture consistency helper that parses each vector opIdHex and asserts opIdDecimal equals the parsed value. Call it for createBuffer, replaceRange, and textWindow. Keep the helper independent of Wesley stable_op_id and avoid reintroducing generic operation-id derivation into core.

No P0 issues found. I do not consider the existing markdownlint baseline in CHANGELOG.md / README front matter a new PR defect; pnpm exec prettier --check passed on changed docs and fixtures, and git diff --check origin/main...HEAD is clean.

Merge-readiness note: GitHub currently reports this PR as BEHIND main after #614 landed. Use a regular merge from origin/main into this branch, not a rebase, before final validation.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d384d0a88

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/wesley-emit-typescript/src/le_binary.rs Outdated
Comment thread crates/wesley-core/tests/operation_analysis.rs
@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex Activity summary after resolving the strict self-review findings:

  • Fixed P1: LE binary TypeScript generation now recursively lowers TypeReference for type rendering, encode paths, and decode paths, so nullable list elements and nested lists are encoded with the correct option/list structure instead of being flattened into scalar writers.
  • Added LE binary golden fixture coverage for [String]!, [String], [[Int!]!]!, and [[Int!]] shapes.
  • Fixed P3: stack-witness tests now parse opIdHex and assert opIdDecimal matches for the target-owned fixture vectors without reintroducing generic core op-id derivation.
  • Merged origin/main normally into the branch after PR Point Edict packet to extracted repository #614, then aligned the domain boundary guard with the extracted Edict heading.
  • Added an undici 7.28.0 override after the fresh dependency audit surfaced advisories in the previously selected transitive version.

Local validation passed:

  • cargo test -p wesley-emit-typescript
  • cargo test -p wesley-core --test operation_analysis
  • bats -t test/domain-empty-boundary.bats
  • cargo fmt --check
  • cargo clippy -p wesley-emit-typescript --all-targets -- -D warnings
  • pnpm audit --prod=false --json
  • pnpm run preflight
  • pre-push hook, including Rust product preflight, JavaScript package preflight, and repo Bats smoke suite

The self-review threads for the P1/P3 findings have been resolved.

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

🤖 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 `@crates/wesley-emit-typescript/src/le_binary.rs`:
- Around line 1135-1147: The assert_no_runtime_operation_markers function
currently only checks for one specific constant (OP_MAKE_WIDGET) by joining
those exact strings, which allows other OP-style constants to slip through.
Instead of checking for the exact constant formed by joining ["OP", "MAKE",
"WIDGET"], broaden the pattern check to detect any OP-prefixed constant (for
example, by checking for the presence of "OP_" in the TypeScript string). This
ensures that any unexpected OP constant, regardless of what follows the OP_
prefix, will be caught as a regression.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 94174c6b-0fc1-4b87-b3dc-9d9af4bfa7f3

📥 Commits

Reviewing files that changed from the base of the PR and between e8ec958 and dea8ce6.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • CHANGELOG.md
  • README.md
  • crates/wesley-core/src/adapters/apollo.rs
  • crates/wesley-core/src/domain/operation.rs
  • crates/wesley-core/src/domain/optic.rs
  • crates/wesley-core/tests/operation_analysis.rs
  • crates/wesley-core/tests/runtime_optic_artifact.rs
  • crates/wesley-emit-rust/README.md
  • crates/wesley-emit-typescript/README.md
  • crates/wesley-emit-typescript/src/le_binary.rs
  • docs/JEDIT_CAPABILITY_PROGRESS.md
  • docs/NORTHSTAR.md
  • docs/SDL.md
  • docs/TECHNICAL_TEARDOWN.md
  • package.json
  • test/domain-empty-boundary.bats
  • test/fixtures/typescript-emitter/le-binary-codec.generated.ts
  • test/fixtures/typescript-emitter/le-binary-codec.graphql
💤 Files with no reviewable changes (1)
  • crates/wesley-core/src/domain/operation.rs

Comment thread crates/wesley-emit-typescript/src/le_binary.rs
@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • ✅ cargo test -p wesley-emit-typescript
  • ✅ cargo test -p wesley-core --test operation_analysis
  • ⚠️ bats -t test/domain-empty-boundary.bats — could not run because bats is not installed in this environment.
  • ✅ cargo fmt --check
  • ✅ cargo clippy -p wesley-emit-typescript --all-targets -- -D warnings
  • ⚠️ pnpm audit --prod=false --json — failed because the npm audit endpoint returned 403 Forbidden.
  • ⚠️ pnpm run preflight — reached cargo fmt --check and workspace clippy successfully, then failed at pnpm audit --prod=false --json with the same npm registry 403 Forbidden.
  • ⚠️ gh issue list --label lane:asap --limit 10 --json number,title,state — could not run because gh is not installed in this environment.

View task →

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex Phase III Activity Summary

# Source Severity File Issue Commit Outcome
1 PR P2 crates/wesley-emit-typescript/src/le_binary.rs Preserve singleton enum union layout 7600c96e Resolved; golden output preserves multiline singleton union layout.
2 PR P2 docs/SDL.md / crates/wesley-core/src/domain/optic.rs Update SDL docs for renamed requirements types 2d384d0a Resolved; docs and code use OpticRequirements* vocabulary.
3 Self P1 crates/wesley-emit-typescript/src/le_binary.rs Recursively lower nullable/nested list references 09471496 Resolved; recursive TypeReference lowering plus nullable/nested list fixtures.
4 Self P3 crates/wesley-core/tests/operation_analysis.rs Keep target opIdHex and opIdDecimal cross-checked 09471496 Resolved; target-owned vector helper checks decimal/hex consistency.
5 PR / CodeRabbit P4 crates/wesley-emit-typescript/src/le_binary.rs Broaden runtime-marker guard beyond one OP_* constant 6a064335 Resolved; RED regression added, helper now rejects any OP_ prefix.

Validation run for the final head:

  • RED: cargo test -p wesley-emit-typescript runtime_marker_assertion_rejects_any_op_prefixed_constant failed before the fix because the helper did not panic.
  • GREEN: focused regression passed after the fix.
  • cargo test -p wesley-emit-typescript passed.
  • bats -t test/domain-empty-boundary.bats passed.
  • cargo fmt --check passed.
  • git diff --check passed.
  • pnpm run preflight passed.
  • Pre-push hook passed Rust product preflight and pushed 6a064335.

Review-thread state after push: 5 total, 5 resolved. CodeRabbit currently reports pass; GitHub Actions are pending after the new commit.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Verified the current branch is already at PR head 6a064335 and contains the Phase III runtime-marker guard fix.
  • Confirmed assert_no_runtime_operation_markers now rejects any OP_-prefixed TypeScript marker rather than only one concrete constant. crates/wesley-emit-typescript/src/le_binary.rsL1135-L1147
  • Confirmed the focused regression test covers a non-OP_MAKE_WIDGET constant (OP_DELETE_WIDGET) and expects the broadened guard to panic. crates/wesley-emit-typescript/src/le_binary.rsL1149-L1155
  • Made no file changes, so I did not create a commit and did not call make_pr.

Testing

  • ✅ cargo test -p wesley-emit-typescript runtime_marker_assertion_rejects_any_op_prefixed_constant
  • ✅ cargo fmt --check
  • ✅ git diff --check
  • ⚠️ gh issue list --label lane:asap --limit 10 --json number,title,state — gh is not installed in this environment.

View task →

@github-actions

github-actions Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

🚢 SHIPME

[SHIPME] PASS · HOLMES fixture · sha a3bfad0

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

🤖 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 `@test/ci-workflows.bats`:
- Around line 18-26: The sed command in all three bash invocations uses the
range pattern `/^  bun-smoke:/,$p` which extracts from the bun-smoke job
definition all the way to the end of the file. This causes the assertions to
potentially match content from jobs that appear after bun-smoke, making the
tests brittle. Modify the sed range in all three run commands to terminate at
the end of the bun-smoke job block instead of EOF, by changing the range end
pattern from `$` to a pattern that matches the next job definition (such as
`/^[^ ]/ for a line starting at column 1, or use a more specific pattern that
captures the end of the bun-smoke stanza).
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d8f39afe-c154-47c1-a362-f270fc49536b

📥 Commits

Reviewing files that changed from the base of the PR and between dea8ce6 and d842e22.

📒 Files selected for processing (3)
  • .github/workflows/runtime-smokes.yml
  • crates/wesley-emit-typescript/src/le_binary.rs
  • test/ci-workflows.bats
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/wesley-emit-typescript/src/le_binary.rs

Comment thread test/ci-workflows.bats Outdated

Copy link
Copy Markdown
Owner Author

@codex Self-Code Review pass for PR #613.

Severity File Lines Type Finding Recommended mitigation
P4 Low test/ci-workflows.bats 18, 22, 26 Test robustness / future false positive The new Bun workflow guard uses sed -n '/^ bun-smoke:/,$p', which selects from the bun-smoke job to end-of-file, not just the Bun job. Today bun-smoke is the final job, so the test is green. If another job is appended after Bun and legitimately uses install-bats or a different runtime setup, this test will fail while blaming the Bun lane. Prompt: “Tighten test/ci-workflows.bats so the Bun workflow assertions extract only the bun-smoke YAML job block, stopping at the next top-level job key, then assert that block contains oven-sh/setup-bun and bun run scripts/host_contracts_bun.mjs and does not contain install-bats.”

Validation during review:

  • Clean worktree before review.
  • git fetch origin completed.
  • Reviewed git diff origin/main...HEAD.
  • pnpm exec prettier --check --ignore-unknown ... passed for touched docs/workflow/package files.
  • cargo test -p wesley-emit-typescript -- le_binary --nocapture passed.
  • cargo test -p wesley-core --test runtime_optic_artifact --test operation_analysis passed.
  • git diff --check origin/main...HEAD passed.

Notes:

  • Markdownlint still reports existing full-file baseline issues in README.md and historical duplicate-heading issues in CHANGELOG.md; the reported line numbers are not in this branch’s changed hunks, so I did not count them as branch regressions.
  • No P0/P1/P2/P3 findings found in this pass.

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex Activity Summary: resolved the self-discovered workflow guard issue from the strict review pass.

Source Severity File Issue Resolution Commit Validation
Self-review P4 Low test/ci-workflows.bats Bun workflow assertions selected from bun-smoke to EOF, so future jobs appended after the Bun job could create false positives. Added yaml_job_block extraction that stops at the next job key, scoped the Bun assertions to that block, and added a regression fixture proving the helper excludes a later Bats-using job. 70def9fe bats -t test/ci-workflows.bats; git diff --check; pnpm run preflight; pre-push Repo Bats smoke suite

Current state: branch pushed at 70def9fe; local worktree clean. GitHub checks have restarted on the new commit and are still pending at the time of this comment.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Verified the requested workflow guard fix is already present at current HEAD (70def9f Fix: scope Bun workflow guard), with a clean worktree.
  • Confirmed test/ci-workflows.bats now uses yaml_job_block to extract only the named YAML job stanza and stop at the next job key, instead of scanning from bun-smoke to EOF. test/ci-workflows.batsL6-L13
  • Confirmed the Bun workflow assertions are scoped to the extracted bun-smoke block and check that it does not use install-bats, while still requiring pinned setup-bun and the Bun host-contracts script. test/ci-workflows.batsL27-L32
  • Confirmed the regression fixture proves a later Bats-using job is excluded from the Bun job block. test/ci-workflows.batsL35-L53
  • Made no file changes in this turn, so I did not create a new commit and did not call make_pr.

Testing

  • ✅ git diff --check
  • ✅ git status --short
  • ⚠️ bats -t test/ci-workflows.bats — could not run because bats is not installed in this environment.
  • ⚠️ command -v gh >/dev/null && gh issue list --label lane:asap --limit 10 --json number,title,state || echo 'gh not installed' — gh is not installed in this environment.

View task →

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Tightened the Bun workflow assertions in test/ci-workflows.bats so each check extracts only the bun-smoke job block and stops at the next top-level job key, preventing future jobs appended after Bun from causing false positives or false failures. test/ci-workflows.batsL17-L28
  • Preserved the existing checks that the Bun lane does not use install-bats, uses the pinned oven-sh/setup-bun action, and runs bun run scripts/host_contracts_bun.mjs. test/ci-workflows.batsL18-L28
  • Committed the change on the current branch with commit 0170437 (Fix: bound Bun workflow guard) and created the follow-up PR via make_pr.

Testing

  • ✅ set -e; block="$(awk '/^ bun-smoke:/{flag=1} flag && /^ [a-z0-9-]+:/{if (seen++) exit} flag{print}' .github/workflows/runtime-smokes.yml)"; ! grep -F 'uses: ./.github/actions/install-bats' <<<"$block"; [ "$(grep -F 'oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6' <<<"$block" | wc -l)" -eq 1 ]; [ "$(grep -F 'bun run scripts/host_contracts_bun.mjs' <<<"$block" | wc -l)" -eq 1 ]; git diff --check
  • ⚠️ bats -t test/ci-workflows.bats — could not run because bats is not installed in this environment.
  • ⚠️ pnpm run preflight — Rust fmt/clippy progressed successfully, then preflight failed at pnpm audit --prod=false --json because the npm audit endpoint returned 403 Forbidden.

View task →

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex Self-audit round 2 found one still-actionable issue before merge.

Severity Source File Lines Infraction Evidence Recommended mitigation prompt
P4 Low Self-review crates/wesley-emit-typescript/src/le_binary.rs 1135-1145 Runtime-marker test guard is overbroad and can reject legitimate generated schema values. assert_no_runtime_operation_markers checks ts.contains("OP_") via let forbidden_constant_prefix = ["OP", ""].join("_");. A valid GraphQL enum value like STOP_NOW renders into generated TypeScript as 'STOP_NOW', which contains the substring OP_ even though it is not a runtime OP_* constant. Add a failing regression proving generated enum values containing OP_ as an internal substring are allowed, then tighten the guard to reject runtime operation constant declarations only, for example a declaration-shaped pattern such as export const OP_, without weakening the absence-of-runtime-operation-ids check.

I will resolve this with a focused regression and one commit.

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex Activity Summary: resolved self-audit round 2.

Source Severity File Issue RED evidence Resolution Commit Validation
Self-review P4 Low crates/wesley-emit-typescript/src/le_binary.rs Runtime-marker test guard rejected legitimate generated schema values containing OP_ as an internal substring, such as enum value STOP_NOW. Added runtime_marker_assertion_allows_schema_values_containing_op_sequence; it failed because generated TypeScript containing 'STOP_NOW' tripped the guard. Narrowed the guard to declaration-shaped runtime constants (export const OP_...) while keeping the negative runtime-constant regression and adding the STOP_NOW positive regression. fba27958 cargo test -p wesley-emit-typescript runtime_marker_assertion_allows_schema_values_containing_op_sequence -- --nocapture; cargo test -p wesley-emit-typescript -- le_binary --nocapture; bats -t test/domain-empty-boundary.bats test/ci-workflows.bats; git diff --check; pnpm run preflight; pre-push Rust product preflight

Console SitRep:

  • PR review threads were fetched with GraphQL; all current review threads are resolved.
  • Deep diff audit found one new P4 issue and no P0-P3 issues.
  • Worktree is clean after push; branch head is fba27958.
  • GitHub checks have restarted for the new commit and are pending at the time of this comment.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • ✅ cargo test -p wesley-emit-typescript runtime_marker_assertion_allows_schema_values_containing_op_sequence -- --nocapture
  • ✅ cargo test -p wesley-emit-typescript runtime_marker_assertion_rejects_any_op_prefixed_constant
  • ✅ git diff --check
  • ✅ git status --short

View task →

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • ✅ cargo test -p wesley-emit-typescript runtime_marker_assertion -- --nocapture
  • ✅ cargo fmt --check
  • ✅ git diff --check
  • ⚠️ pnpm run preflight — Rust fmt/clippy completed, but preflight failed at pnpm audit --prod=false --json because the npm audit endpoint returned 403 Forbidden.

View task →

@flyingrobots
flyingrobots merged commit 6065384 into main Jun 20, 2026
22 checks passed
@flyingrobots
flyingrobots deleted the fix/wesley-core-extension-boundary branch June 20, 2026 09:34
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