Skip to content

[codex] Expose string fields as char spans#27

Merged
anthonyprintup merged 2 commits into
mainfrom
codex/string-view-kernel-driver-example
May 1, 2026
Merged

[codex] Expose string fields as char spans#27
anthonyprintup merged 2 commits into
mainfrom
codex/string-view-kernel-driver-example

Conversation

@anthonyprintup
Copy link
Copy Markdown
Owner

@anthonyprintup anthonyprintup commented May 1, 2026

Summary

  • Returns Span<const char> from generated string accessors while keeping bytes fields on byte spans.
  • Adds optional std::string_view interoperability for char spans and runtime strings behind PROTOCYTE_ENABLE_STD_STRING_VIEW.
  • Updates smoke coverage, generated checked outputs, and plugin tests for the string-view API.
  • Documents a discouraged MSVC/STL-specific Windows kernel-driver _Xout_of_range shim for exceptional compatibility cases.

Validation

  • Regenerated checked smoke outputs with uv run python smoke/tools/generate_checked_outputs.py.
  • Ran uv run pytest -q (96 passed).

Add a discouraged Windows kernel driver example for satisfying MSVC STL's internal _Xout_of_range helper so std::string_view::at() can compile without exceptions.

Clarify that the shim should bugcheck on accidental checked access and that kernel or freestanding users should prefer Protocyte's Span API.
Return Span<const char> from generated string accessors while leaving bytes fields as byte spans.

Add optional std::string_view conversions for char spans and runtime strings behind PROTOCYTE_ENABLE_STD_STRING_VIEW.

Update smoke coverage, tests, and regenerated checked outputs for the string-view API.
@anthonyprintup anthonyprintup changed the title [codex] Document string_view kernel fallback [codex] Expose string fields as char spans May 1, 2026
@anthonyprintup anthonyprintup deleted the codex/string-view-kernel-driver-example branch May 1, 2026 00:55
@anthonyprintup anthonyprintup restored the codex/string-view-kernel-driver-example branch May 1, 2026 00:56
@anthonyprintup anthonyprintup reopened this May 1, 2026
@anthonyprintup anthonyprintup marked this pull request as ready for review May 1, 2026 00:58
@anthonyprintup anthonyprintup marked this pull request as draft May 1, 2026 00:58
@anthonyprintup
Copy link
Copy Markdown
Owner Author

@codex review

@anthonyprintup anthonyprintup marked this pull request as ready for review May 1, 2026 01:02
@anthonyprintup anthonyprintup self-assigned this May 1, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ 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".

@anthonyprintup anthonyprintup merged commit f0a8691 into main May 1, 2026
14 of 16 checks passed
@anthonyprintup anthonyprintup deleted the codex/string-view-kernel-driver-example branch May 1, 2026 01:07
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