openui-rails 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 348e7ebd421344dd62f6f5449c09fa477de3374dc1803c51aa8bc1415ad0fcfc
4
- data.tar.gz: 6b82e02f137a9bff26b5b8c9dfd3e6a6053593e5a75f66b87825486e2d667c67
3
+ metadata.gz: 1d89e42577f933fcb68ce1740bbc51496998c91f4f2f529880566e568f66543d
4
+ data.tar.gz: 8ee1ecfbef87fb51c07d5a85dc461555901f8dfc20c45da27093eabab82b5416
5
5
  SHA512:
6
- metadata.gz: 6f82e650f49c1b59912959c2e7d3d59d7b0c17088b0fb9dbcc9c97b235910645a5b026834cf509aa4b1915e55e9a2fafe20db57850b3a038dda144f2ce8572f2
7
- data.tar.gz: 59e46f83487ce218dcd0780d89fc1bbe5a86dd6483d239cffd572effa327b17f130375761cea02ab472865ebd4fa5f8cc6c8587f58dad0e0266bc2a467cec25a
6
+ metadata.gz: 36050c0b40b6bf4afac05329c4cf5e393156519922592a1486b0c95d76d9b995f2174317db863349795f6b1d7274267cc9040dfb74a39282683b4d7b1e8c336c
7
+ data.tar.gz: c4c5833187751750c71e999d6e6098139fb4e33bd12a56d146dcacd18df5ac06bc360f0b2b424ec03569123f2caa91a567440ca3c4caef28e2485362fac9c0f6
data/CHANGELOG.md CHANGED
@@ -6,6 +6,24 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.9.1] - 2026-10-28
10
+
11
+ ### Added
12
+
13
+ - `bin/demo` prepares a disposable Support Desk host, binds its foreground
14
+ server to loopback, and removes the host when the server stops.
15
+ - Independent public-API host checks, an optional old-gem upgrade and rollback
16
+ rehearsal, and an explicitly authorized single-request live qualification.
17
+ Live failure and retry limits are tested offline and never run in CI.
18
+ - Browser assertions for the reference's enforced script CSP and complete
19
+ keyboard navigation through its generated form and mutation.
20
+
21
+ ### Changed
22
+
23
+ - The opt-in Support Desk example uses nonce-authorized scripts and a
24
+ self-hosted content policy. Inline styles remain necessary for the pinned
25
+ renderer. No gem API, runtime pin, database migration, or dependency changes.
26
+
9
27
  ## [0.9.0] - 2026-10-21
10
28
 
11
29
  ### Added
@@ -188,7 +206,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
188
206
  - Gem-scoped RubyGems Trusted Publishing through GitHub OIDC, with a protected
189
207
  release environment and verified artifact handoff.
190
208
 
191
- [Unreleased]: https://github.com/yorzi/openui-rails/compare/v0.9.0...main
209
+ [Unreleased]: https://github.com/yorzi/openui-rails/compare/v0.9.1...main
210
+ [0.9.1]: https://github.com/yorzi/openui-rails/releases/tag/v0.9.1
192
211
  [0.9.0]: https://github.com/yorzi/openui-rails/releases/tag/v0.9.0
193
212
  [0.5.0]: https://github.com/yorzi/openui-rails/releases/tag/v0.5.0
194
213
  [0.4.0]: https://github.com/yorzi/openui-rails/releases/tag/v0.4.0
data/DEVELOPMENT.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Development and verification
2
2
 
3
+ Select a Ruby version covered by the CI matrix before running `bundle install`.
4
+ The qualification commands reuse that Ruby and its resolved Rails dependencies.
5
+
3
6
  Use `test/dummy` as the maintained local host. Temporary generated hosts verify
4
7
  the built gem. Keep examples synthetic and provider-free unless a task explicitly
5
8
  authorizes a live call. Follow this loop for each feature:
@@ -14,6 +17,19 @@ authorizes a live call. Follow this loop for each feature:
14
17
 
15
18
  ## Reference workflow
16
19
 
20
+ For an interactive, provider-free demo:
21
+
22
+ ```sh
23
+ bundle exec rake "app:openui:runtime:fetch[$PWD/tmp/real-runtime]"
24
+ bin/demo --runtime tmp/real-runtime --port 3000
25
+ ```
26
+
27
+ Open `http://127.0.0.1:3000/support`. The server runs in the foreground and binds
28
+ loopback only. Ctrl-C stops it and removes the newly generated host and database.
29
+ No browser suite or provider runs during startup. Use `bin/check-reference`
30
+ for automated browser verification. Add `--prepare-only` with `--gem --host`
31
+ when you want a retained review host without running the browser suite.
32
+
17
33
  ```sh
18
34
  bin/check-reference
19
35
  bin/check-reference --runtime tmp/real-runtime
@@ -60,6 +76,45 @@ a browser network sandbox. The stub suite exercises bridge failure cases; the
60
76
  real-runtime suite verifies the pinned renderer, library identity, actions,
61
77
  tools, and keyboard behavior. Neither proves live-provider compatibility.
62
78
 
79
+ ## Independent host and release qualification
80
+
81
+ The independent host uses public gem APIs and its own SQLite record, view,
82
+ authorization, and action. It loads no Support Desk or dummy application code.
83
+ The default path runs in `bin/check --runtime` and CI. To rehearse an upgrade,
84
+ provide a checksum-verified historical gem explicitly:
85
+
86
+ ```sh
87
+ bin/check-host --gem tmp/package/openui-rails-0.9.1.gem --runtime tmp/real-runtime
88
+ bin/check-host --gem tmp/package/openui-rails-0.9.1.gem --runtime tmp/real-runtime \
89
+ --upgrade-from tmp/qualification/openui-rails-0.1.0.gem
90
+ ```
91
+
92
+ The optional rehearsal boots the old artifact, the candidate, and the old
93
+ artifact again against the same database. It checks saved source, a draft,
94
+ authorized effects, reload, library mismatch fallback, and rollback. Its
95
+ synthetic fixed actor is a test boundary, not production authentication.
96
+
97
+ Live qualification always requires explicit owner authorization and uses
98
+ `OPENROUTER_API_KEY` from the existing environment. Never put a credential in
99
+ a command argument. After authorization:
100
+
101
+ The `drafts/` paths below are local, optional materials. The gem, `bin/check`,
102
+ and CI do not depend on them and never commit them.
103
+
104
+ ```sh
105
+ bin/check-live --authorized --output drafts/live-qualification
106
+ bin/check-host --gem tmp/package/openui-rails-0.9.1.gem --runtime tmp/real-runtime \
107
+ --source drafts/live-qualification/source.openui
108
+ ```
109
+
110
+ The live command uses one `openai/gpt-4.1-mini` request, a 1024-output-token
111
+ limit, and a conservative US$0.25 token-cost preflight. SDK retries and provider
112
+ fallbacks are disabled. An existing output directory is refused, including a
113
+ failed attempt; do not automatically repeat it. Usage-based cost estimates do
114
+ not prove the billed charge. Generated output becomes browser evidence only
115
+ after `bin/check-host --source` passes. CI tests this command with mocked HTTP;
116
+ it never reads a live key or calls a paid provider.
117
+
63
118
  ## Refresh the default library exports
64
119
 
65
120
  When changing the pinned runtime, regenerate from its checksum-verified bundle:
data/README.md CHANGED
@@ -32,7 +32,7 @@ The runtime-fetch task also needs npm. RubyLLM is optional.
32
32
 
33
33
  ```ruby
34
34
  # Gemfile
35
- gem "openui-rails", "~> 0.9.0"
35
+ gem "openui-rails", "~> 0.9.1"
36
36
  ```
37
37
 
38
38
  ```sh
@@ -65,7 +65,8 @@ The documentation site contains the full guides and API reference:
65
65
  - [RubyLLM](https://openui-rails.wangyaodi.com/ruby-llm/) and [production setup](https://openui-rails.wangyaodi.com/production/)
66
66
  - [Upgrading](https://openui-rails.wangyaodi.com/upgrading/) and [API reference](https://openui-rails.wangyaodi.com/api-reference/)
67
67
 
68
- Version `0.9.0` freezes the candidate API for 1.0 and fixes stream and recovery defects.
68
+ Version `0.9.1` improves the demo, CSP, keyboard checks, and host qualification
69
+ without changing the public gem API or pinned runtime.
69
70
  See [What's New](https://openui-rails.wangyaodi.com/whats-new-in-0-9/) for the upgrade and
70
71
  [Supported API](https://openui-rails.wangyaodi.com/supported-api/) for the compatibility boundary.
71
72
  The API may change during `0.x`; see the
@@ -74,7 +75,9 @@ The site's stable channel follows the latest release; [/next/](https://openui-ra
74
75
  follows `main`.
75
76
 
76
77
  For repository work, use [Contributing](CONTRIBUTING.md),
77
- [Releasing](RELEASING.md), and the [0.5.0 release record](RELEASE_0_5.md).
78
+ [Releasing](RELEASING.md), and the [0.9.0 release record](RELEASE_0_9.md).
79
+ Run the disposable demo with `bin/demo --runtime tmp/real-runtime` after the
80
+ runtime setup in [Development](DEVELOPMENT.md).
78
81
  Report vulnerabilities through the [security policy](SECURITY.md).
79
82
 
80
83
  ## License
data/RELEASING.md CHANGED
@@ -32,6 +32,12 @@ The live smoke completed on 2026-10-18 through OpenRouter with RubyLLM 2.1.1
32
32
  and `openai/gpt-4.1-mini`. It used a synthetic prompt, `:complete` streaming,
33
33
  and a 16-token output cap. See [AUDIT.md](AUDIT.md) for the result and limits.
34
34
 
35
+ The fuller, explicitly authorized qualification on 2026-10-28 generated complete
36
+ UI through RubyLLM, rendered its persisted output, and executed an authorized
37
+ action in an independent host. See [QUALIFICATION_1_0.md](QUALIFICATION_1_0.md)
38
+ for its budget, upgrade rehearsal, and limits. Release CI remains provider-free;
39
+ publishing does not require repeating a paid call.
40
+
35
41
  ## Prepare the candidate
36
42
 
37
43
  During development, keep `released: false`, document delivered work under
@@ -10,17 +10,17 @@ The Gem itself is licensed under the MIT License (see `LICENSE`).
10
10
 
11
11
  ## Referenced upstream packages
12
12
 
13
- The following `@openuidev/*` packages are published by Thesys under the MIT
14
- License and are loaded by the browser at runtime (self-hosted by the host app,
15
- or referenced at an exact pinned version):
13
+ The integration references these official MIT-licensed packages. The browser
14
+ bundle and the maintainer CLI have exact pins. The other rows describe the
15
+ browser bundle's declared dependency ranges, not proven compiled versions.
16
+ The CLI is a development tool and is not loaded in the browser.
16
17
 
17
- | Package | Pinned version | License |
18
+ | Package | Version reference | License |
18
19
  | --- | --- | --- |
19
- | `@openuidev/browser-bundle` | 0.2.1 | MIT |
20
- | `@openuidev/react-lang` | 1.0.1 | MIT |
21
- | `@openuidev/lang-core` | 1.0.1 | MIT |
22
- | `@openuidev/react-ui` | 0.18.1 | MIT |
23
- | `@openuidev/cli` | 0.6.0 | MIT |
20
+ | `@openuidev/browser-bundle` | 0.2.1 exact runtime pin | MIT |
21
+ | `@openuidev/react-lang` | ^1.0.1 declared range | MIT |
22
+ | `@openuidev/react-ui` | ^0.18.1 declared range | MIT |
23
+ | `@openuidev/cli` | 0.6.0 exact guide pin | MIT |
24
24
 
25
25
  The OpenUI repository is licensed MIT: "Copyright (c) 2011-2024 Thesys Inc."
26
26
 
@@ -36,6 +36,25 @@ prompt instructions, not the browser renderer implementation.
36
36
 
37
37
  ## Transitive browser dependencies
38
38
 
39
+ The 2026-10-28 review checks the exact checksum-locked 0.2.1 JavaScript, CSS,
40
+ and upstream license used by the demo. Its JavaScript's final bundled-notices
41
+ block names these package groups:
42
+
43
+ | Embedded package group | Notice |
44
+ | --- | --- |
45
+ | `react`, `react-dom`, `scheduler`, `use-sync-external-store` | Meta copyright and MIT references. |
46
+ | `lucide-react` | Version 0.562.0 and ISC references across its bundled icon modules. |
47
+ | `@tanstack/table-core`, `@tanstack/react-table` | TanStack copyright and MIT references. |
48
+
49
+ These are the groups named by the embedded notices, not a reconstructed lockfile
50
+ or complete dependency inventory. The npm browser-bundle manifest declares
51
+ ranges for React, React DOM, react-ui, and react-lang. Those ranges do not
52
+ identify every resolved transitive version. Preserve the fetched files intact;
53
+ do not strip their legal comments. A host that redistributes the bundle must
54
+ still establish its complete dependency and license inventory.
55
+
56
+ The reviewed manifest is the [immutable npm version record](https://registry.npmjs.org/@openuidev/browser-bundle/0.2.1).
57
+
39
58
  The official browser bundle inlines dependencies, including React 19. They do
40
59
  not all share one license. The pinned bundle's embedded notices identify
41
60
  `lucide-react` 0.562.0 as ISC-licensed. React and TanStack identify MIT licenses.
@@ -15,10 +15,15 @@ From the repository:
15
15
 
16
16
  ```sh
17
17
  mkdir -p tmp/package
18
- bundle exec gem build openui-rails.gemspec --output tmp/package/openui-rails-0.9.0.gem
19
- bin/check-reference --gem tmp/package/openui-rails-0.9.0.gem --runtime tmp/real-runtime
18
+ bundle exec gem build openui-rails.gemspec --output tmp/package/openui-rails-0.9.1.gem
19
+ bin/check-reference --gem tmp/package/openui-rails-0.9.1.gem --runtime tmp/real-runtime
20
20
  ```
21
21
 
22
+ For an interactive disposable demo, use `bin/demo --runtime tmp/real-runtime`.
23
+ It starts a foreground server on `127.0.0.1:3000` and removes the new host and
24
+ database when you stop it with Ctrl-C. No provider call is made. Its script CSP
25
+ uses importmap nonces; inline styles remain enabled for the pinned renderer.
26
+
22
27
  Fetch the runtime first. See the [complete guide](https://openui-rails.wangyaodi.com/reference-workflow/)
23
28
  for setup, retained-host review, failure checks, and evidence limits. The
24
29
  reference is not enabled by requiring the gem. Keep the demo loopback-only;
@@ -3,6 +3,17 @@
3
3
  module SupportDesk # :nodoc:
4
4
  class BaseController < ::ApplicationController
5
5
  protect_from_forgery with: :exception
6
+ content_security_policy do |policy|
7
+ policy.default_src :self
8
+ policy.script_src :self
9
+ # The pinned renderer inserts styles and uses style attributes.
10
+ policy.style_src :self, :unsafe_inline
11
+ policy.img_src :self, :data
12
+ policy.object_src :none
13
+ policy.base_uri :self
14
+ policy.form_action :self
15
+ policy.frame_ancestors :none
16
+ end
6
17
  layout "support_desk/application"
7
18
  before_action :local_demo_only
8
19
  before_action :authenticate
@@ -4,6 +4,7 @@
4
4
  <title>Support Desk · OpenUI Rails reference</title>
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
7
8
  <%= openui_stylesheet_tag %>
8
9
  <%= javascript_importmap_tags "support_desk" %>
9
10
  <style>
@@ -1,6 +1,13 @@
1
1
  <h1>Support Desk reference host</h1>
2
2
  <p class="notice">Synthetic accounts and tickets. Local demo only. No model provider is called.</p>
3
3
  <p>Sign in to stream a ticket, save a private draft, continue the conversation, and close the ticket.</p>
4
+ <h2>Try the workflow</h2>
5
+ <ol>
6
+ <li>Choose Alice, enter a private note, and wait for “Draft saved”. Reload to check the saved note.</li>
7
+ <li>Continue the conversation, then close the ticket. Reload to review its persisted status.</li>
8
+ <li>Try Reader for read-only access, or Bob for a separate tenant.</li>
9
+ </ol>
10
+ <p>Alice and Reader belong to the north tenant. Bob belongs to the south tenant. These are local synthetic accounts.</p>
4
11
  <% %w[Alice Bob Reader].each do |name| %>
5
12
  <%= button_to "Sign in as #{name}", session_path, params: { name: name } %>
6
13
  <% end %>
@@ -11,6 +11,8 @@ module SupportDesk # :nodoc:
11
11
  # form tags and the shared action endpoint protected in that environment too.
12
12
  initializer "support_desk.csrf", before: "action_controller.set_configs" do |app|
13
13
  app.config.action_controller.allow_forgery_protection = true
14
+ app.config.content_security_policy_nonce_generator ||= ->(_request) { SecureRandom.base64(16) }
15
+ app.config.content_security_policy_nonce_directives ||= %w[script-src]
14
16
  end
15
17
 
16
18
  initializer "support_desk.assets", before: "importmap" do |app|
@@ -1,5 +1,5 @@
1
1
  module OpenUI
2
2
  module Rails
3
- VERSION = "0.9.0"
3
+ VERSION = "0.9.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openui-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Wang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-21 00:00:00.000000000 Z
11
+ date: 2026-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails