tokra 0.0.1.pre.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.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.pre-commit-config.yaml +16 -0
  3. data/AGENTS.md +126 -0
  4. data/CHANGELOG.md +21 -0
  5. data/CODE_OF_CONDUCT.md +16 -0
  6. data/Cargo.toml +23 -0
  7. data/LICENSE +661 -0
  8. data/LICENSES/AGPL-3.0-or-later.txt +235 -0
  9. data/LICENSES/Apache-2.0.txt +73 -0
  10. data/LICENSES/CC-BY-SA-4.0.txt +170 -0
  11. data/LICENSES/CC0-1.0.txt +121 -0
  12. data/LICENSES/MIT.txt +18 -0
  13. data/README.md +45 -0
  14. data/README.rdoc +4 -0
  15. data/REUSE.toml +11 -0
  16. data/Rakefile +27 -0
  17. data/Steepfile +15 -0
  18. data/clippy.toml +5 -0
  19. data/clippy_exceptions.rb +59 -0
  20. data/doc/contributors/adr/001.md +187 -0
  21. data/doc/contributors/adr/002.md +132 -0
  22. data/doc/contributors/adr/003.md +116 -0
  23. data/doc/contributors/chats/001.md +3874 -0
  24. data/doc/contributors/plan/001.md +271 -0
  25. data/examples/verify_hello_world/app.rb +114 -0
  26. data/examples/verify_hello_world/index.html +88 -0
  27. data/examples/verify_ping_pong/README.md +0 -0
  28. data/examples/verify_ping_pong/app.rb +132 -0
  29. data/examples/verify_ping_pong/public/styles.css +182 -0
  30. data/examples/verify_ping_pong/views/index.erb +94 -0
  31. data/examples/verify_ping_pong/views/layout.erb +22 -0
  32. data/exe/semantic-highlight +0 -0
  33. data/ext/tokra/Cargo.toml +23 -0
  34. data/ext/tokra/extconf.rb +12 -0
  35. data/ext/tokra/src/lib.rs +719 -0
  36. data/lib/tokra/native.rb +79 -0
  37. data/lib/tokra/rack/handler.rb +177 -0
  38. data/lib/tokra/version.rb +12 -0
  39. data/lib/tokra.rb +19 -0
  40. data/mise.toml +8 -0
  41. data/rustfmt.toml +4 -0
  42. data/sig/tokra.rbs +7 -0
  43. data/tasks/lint.rake +151 -0
  44. data/tasks/rust.rake +63 -0
  45. data/tasks/steep.rake +11 -0
  46. data/tasks/test.rake +26 -0
  47. data/test_native.rb +37 -0
  48. data/vendor/goodcop/base.yml +1047 -0
  49. metadata +112 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 03ac925098b4f619aa6b58e6f8b4ddf08c09cd3f85dd8e3c0a2a33e22821f0c2
4
+ data.tar.gz: 7d6ede8db20514fca26d36566e0df6d50903afe843edb1999a71ea8c5bb49ebb
5
+ SHA512:
6
+ metadata.gz: 28379aac8f6fd4941a37200d3595fef788f64f5155a31784bc98938b3c3746efde1ef3a782c1f26602282edaa5c04192ae1cad111681fc9cc4a877ec553efbe5
7
+ data.tar.gz: 5023710543f1de97b17c6c6ab0fd7176a1f6260f94365adf4b0cdf48506f7c09e3289bc6560ab52d2968a6cc7d9e3a1662c468c87a0dde5e13ca362efbc07a16
@@ -0,0 +1,16 @@
1
+ # SPDX-FileCopyrightText: 2020 Free Software Foundation Europe e.V.
2
+ # SPDX-License-Identifier: CC0-1.0
3
+ repos:
4
+ - repo: local
5
+ hooks:
6
+ - id: bundle-check
7
+ name: Check Gemfile.lock
8
+ entry: bundle check
9
+ language: system
10
+ files: (Gemfile|Gemfile\.lock|tokra\.gemspec)
11
+ pass_filenames: false
12
+ - id: rake
13
+ name: rake
14
+ entry: bundle exec rake
15
+ language: system
16
+ pass_filenames: false
data/AGENTS.md ADDED
@@ -0,0 +1,126 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
3
+ SPDX-License-Identifier: CC-BY-SA-4.0
4
+ -->
5
+
6
+ # AGENTS.md
7
+
8
+ ## Project Identity
9
+
10
+ Project Name: tokra
11
+
12
+ Description: A port of Tauri to Ruby, enabling you to build desktop applications with web technologies.
13
+
14
+ Architecture: [@/oop] for te [@/rubyist].
15
+
16
+ ## Stability & Compatibility
17
+
18
+ - **Project Status:** Pre-1.0.
19
+ - **User Base:** Zero external users.
20
+ - **Breaking Changes:** Backward compatibility is **NOT** a priority. Since there are no external users, you are encouraged to refactor APIs for better ergonomics and performance even if it breaks existing code.
21
+ - **Requirement:** All breaking changes **MUST** be explicitly documented in the [CHANGELOG.md](CHANGELOG.md)'s **Unreleased** section to ensure transparency.
22
+
23
+ ## 1. Standards
24
+
25
+ ### STRICT REQUIREMENTS
26
+
27
+ - Every file MUST begin with an SPDX-compliant header. Use `AGPL-3.0-or-later` for code; `CC-BY-SA-4.0` for documentation. `reuse annotate` can help you generate the header. **For Ruby files**, wrap SPDX comments in `#--` / `#++` to hide them from RDoc output.
28
+ - Every line of Ruby MUST be covered by tests that would stand up to mutation testing.
29
+ - Tests must be meaningful and verify specific behavior or rendering output; simply verifying that code "doesn't crash" is insufficient and unacceptable.
30
+ - **Pre-commit:** Use `bundle exec rake` to ensure commit-readiness. See Tools for detailed instructions.
31
+ - **Git Pager:** ALWAYS set `PAGER=cat` for ALL `git` commands (e.g., `PAGER=cat git diff`). This is mandatory.
32
+
33
+ ### Tools
34
+
35
+ - **ALWAYS** run `bundle exec ruby` to ensure libraries are loaded. **NEVER** run `ruby -Ilib:test ...` directly.
36
+ - **ALWAYS use `bundle exec rake`** for running tests, linting, or checking compilation.
37
+ - **Usage:**
38
+ - Runs default task (test + lint + typecheck): `bundle exec rake`. Do this before considering a commit ready.
39
+ - Runs specific task: `bin/agent_rake test:ruby` (for example). Do not run specific rake tasks for commit readiness.
40
+ - **Setup:** `bin/setup` must ensure all dependencies are installed.
41
+ - **Rake:** Our rake tasks use `git ls-files`, so errors happen when you move or delete files. In this case, ask the user to stage changes for you.
42
+
43
+ ### Ruby Standards
44
+
45
+ - Use `Data.define` for all value objects. (Prefer `class Foo < Data.define()` over `Foo = Data.define() do`).
46
+ - Use `class` for all entities.
47
+ - Define types in `.rbs` files. Don't use `untyped` just because it's easy; be comprehensive and accurate.
48
+ - Do not include `initialize` in `.rbs` files; use `self.new` for constructors instead.
49
+ - **Every** ruby class/method must have a corresponding `.rbs` type definition.
50
+ - Every public Ruby class/method must be documented for humans in RDoc (required)--**not** YARD--or markdown files.
51
+ - RDoc documentation **must** be written in `.rb` files, not their corresponding `.rbs` files. `.rbs` files should have **ZERO** comments.
52
+ - Every significant architectural and design decision must be documented for contributors in markdown files. Mermaid is allowed.
53
+
54
+ ## 2. Directory Structure Convention
55
+
56
+ The project follows a standard Gem layout with `examples/` added to show other rubyists how to `require` and use `lib/tokra`.
57
+
58
+ ## 3. Configuration & Tooling
59
+
60
+ ### Development Environment
61
+
62
+ - **Scripting Preference:** Simple `sed` or shell one-liners are fine. When a one-off script grows to multiple lines of logic, prefer a temporary rake task or `ruby -e '...'` over a multi-line shell script in a string. Ruby's `File.read`/`File.write`, `Dir.glob`, and regex handle complex transformations more cleanly.
63
+
64
+ ### Documentation
65
+
66
+ - **The `doc/` folder contains source markdown files** that are included in RDoc output.
67
+ - Documentation should separate "User Guide" (Ruby API for TUI developers) from "Contributor Guide" (Ruby/Rust/Magnus internals).
68
+ - Files within `doc/contributors/` are for library developers.
69
+ - Files within `doc/` outside of `conttributors/` are for application developers and users of this RubyGEm.
70
+ - **Style Guide:** You **MUST** follow the [Documentation Style Guide](doc/contributors/documentation_style.md). This dictates the Alexandrian/Zinsser prose style and strict RDoc formatting required for all public API documentation.
71
+ - DON'T write .md files for something RDoc (Ruby) can generate. DO use RDoc for documentation.
72
+
73
+
74
+ ## 4. Committing
75
+
76
+ - Who commits: DON'T stage (DON'T `git add`) unless explicitly instructed. DON'T commit unless explicitly instructed. DO suggest a commit message when you finish, even if not instructed..
77
+ - When: Before reporting the task as complete to the user, suggest the commit message.
78
+ - What: Consider not what you remember, but EVERYTHING in the `git diff` and `git diff --cached`.
79
+ - **Format:**
80
+ - Format: Use [Conventional Commits](https://www.conventionalcommits.org/).
81
+ - Body: Explanation if necessary (wrap at 72 chars).
82
+ - Explain why this is the implementation, as opposed to other possible implementations.
83
+ - Skip the body entirely if it's rote, a duplication of the diff, or otherwise unhelpful.
84
+ - **DON'T list the files changed or the edits made in the body.** Don't provide a bulleted list of changes. Use prose to explain the problem and the solution.
85
+ - **DON'T use markdown syntax** (no backticks, no bolding, no lists, no links). The commit message must be plain text.
86
+ - **Type conventions by directory:**
87
+ - `lib/`, `exe/`, `sig/`: Use `feat`, `fix`, `refactor`, `perf` as appropriate.
88
+ - `bin/`, `tasks/`, `.builds/`, CI/CD: Use `chore` for tooling internal to developing this gem. Use `feat`/`fix` for changes that affect downstream users.
89
+ - `examples/`: Always `docs` (documentation by example).
90
+ - `test/`: Use `test` for new/changed tests, or match the type of the code being tested.
91
+ - `doc/`: Always `docs`.
92
+
93
+ ### 5. Changelog
94
+
95
+ - Follow [Semantic Versioning](https://semver.org/)
96
+ - Follow the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) specification.
97
+ - **What belongs in CHANGELOG:** Only changes that affect **executable users** or **higher-level library developers** who use or depend on `tokra`:
98
+ - New public APIs or CLI flags
99
+ - Backwards-incompatible type signature changes, or behavioral additions to type signature changes
100
+ - Observable behavior changes (rendering, styling, layout)
101
+ - Deprecations and removals
102
+ - Breaking changes
103
+ - **What does NOT belong in CHANGELOG:** Internal or non-behavioral changes that don't affect downstream users:
104
+ - Test additions or improvements
105
+ - Documentation updates, RDoc fixes, markdown clarifications
106
+ - Refactors of internal code
107
+ - New or modified example code
108
+ - Internal tooling, CI/CD, or build configuration changes
109
+ - Code style or linting changes
110
+ - Performance improvements that affect applications
111
+ - Changelogs should be useful to downstream developers (both app and library developers), not simple restatements of diffs or commit messages.
112
+ - The Unreleased section MUST be considered "since the last git tag". Therefore, if a change was done in one commit and undone in another (both since the last tag), the second commit should remove its changelog entry.
113
+ - **Location:** New entries ALWAYS go in `## [Unreleased]`. Never edit past version sections (e.g., `## [0.4.0]`)—those are frozen history.
114
+
115
+ ## 6. Definition of Done (DoD)
116
+
117
+ Before considering a task complete and returning control to the user, you **MUST** ensure:
118
+
119
+ 0. **Production Ready:** RBS types are complete and accurate (no `untyped`), errors are handled with good DX, documentation follows guidelines, high code quality (no "pre-existing debt" excuses).
120
+ 1. **Default Rake Task Passes:** Run `bundle exec rake` (no args). Confirm it passes with ZERO errors **and ZERO warnings**.
121
+ - You will save time if you run `bundle exec rake rubocop:autocorrect` first.
122
+ - If you think the Rake is looking for deleted files, STOP EVERYTHING and tell the user.
123
+ 2. **Documentation Updated:** If public APIs or observable behavior changed, update relevant RDoc, RBS, `doc/` files, and/or `README.md`.
124
+ 3. **Changelog Updated:** If public APIs, observable behavior, or gemspec dependencies have changed, update [CHANGELOG.md](CHANGELOG.md)'s **Unreleased** section.
125
+ 4. **Commit Message Suggested:** You **MUST** ensure the final message to the user includes a suggested commit message block. This is NOT optional.
126
+ - You MUST also check `git log -n1` to see the current standard AI footer ("Generated with" and "Co-Authored-By") and include it in your suggested message.
data/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
3
+ SPDX-License-Identifier: CC-BY-SA-4.0
4
+ -->
5
+ # Changelog
6
+
7
+ All notable changes to this project will be documented in this file.
8
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
9
+ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
10
+
11
+ ## [Unreleased]
12
+
13
+ ### Added
14
+
15
+ ### Changed
16
+
17
+ ### Fixed
18
+
19
+ ### Removed
20
+
21
+ [Unreleased]: https://git.sr.ht/~kerrick/tokra/refs/HEAD
@@ -0,0 +1,16 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
3
+
4
+ SPDX-License-Identifier: CC-BY-SA-4.0
5
+ -->
6
+
7
+ # Code of Conduct
8
+
9
+ "tokra" follows [The Ruby Community Conduct Guideline](https://www.ruby-lang.org/en/conduct) in all "collaborative space", which is defined as community communications channels (such as mailing lists, submitted patches, commit comments, etc.):
10
+
11
+ * Participants will be tolerant of opposing views.
12
+ * Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
13
+ * When interpreting the words and actions of others, participants should always assume good intentions.
14
+ * Behaviour which can be reasonably considered harassment will not be tolerated.
15
+
16
+ If you have any concerns about behaviour within this project, please contact us at ["me@kerricklong.com"](mailto:"me@kerricklong.com").
data/Cargo.toml ADDED
@@ -0,0 +1,23 @@
1
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
2
+ #
3
+ # SPDX-License-Identifier: AGPL-3.0-or-later
4
+
5
+ # This Cargo.toml is here to let externals tools (IDEs, etc.) know that this is
6
+ # a Rust project. Your extensions dependencies should be added to the Cargo.toml
7
+ # in the ext/ directory.
8
+
9
+ [workspace]
10
+ members = ["./ext/tokra"]
11
+ resolver = "2"
12
+
13
+ # Strict linting: deny fails builds but allows targeted #[allow] for FFI constraints
14
+ [workspace.lints.clippy]
15
+ pedantic = { level = "deny", priority = -1 }
16
+ nursery = { level = "deny", priority = -1 }
17
+ all = { level = "deny", priority = -1 }
18
+
19
+ # Unsafe code is denied by default, but targeted exceptions are allowed with
20
+ # #[allow(unsafe_code)] annotations. Each exception must be documented in
21
+ # clippy_exceptions.rb with justification.
22
+ [workspace.lints.rust]
23
+ unsafe_code = "deny"