From af3c080ace143d52f39687d6cda54912323542f3 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Tue, 27 Oct 2026 06:13:53 -0700 Subject: [PATCH] chore(repo): a workspace of one crate A cargo workspace with one member, `komorebi-recorder`, and the files a project needs around it: toolchain, rustfmt and cargo-deny configuration (both the macOS and the Windows target are in the dependency graph), a justfile whose `check` recipe is the one command CONTRIBUTING names, the license, and README and CONTRIBUTING. The crate is a skeleton that prints its version; the recorder arrives in the commits after it. --- .gitignore | 4 + CONTRIBUTING.md | 62 ++++++ Cargo.lock | 385 ++++++++++++++++++++++++++++++++++ Cargo.toml | 22 ++ LICENSE.md | 108 ++++++++++ README.md | 45 ++++ deny.toml | 52 +++++ dependencies.json | 93 ++++++++ justfile | 58 +++++ komorebi-recorder/Cargo.toml | 9 + komorebi-recorder/src/lib.rs | 10 + komorebi-recorder/src/main.rs | 15 ++ rust-toolchain.toml | 2 + rustfmt.toml | 1 + 14 files changed, 866 insertions(+) create mode 100644 .gitignore create mode 100644 CONTRIBUTING.md create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 deny.toml create mode 100644 dependencies.json create mode 100644 justfile create mode 100644 komorebi-recorder/Cargo.toml create mode 100644 komorebi-recorder/src/lib.rs create mode 100644 komorebi-recorder/src/main.rs create mode 100644 rust-toolchain.toml create mode 100644 rustfmt.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..29aa63bf --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/target +/result* +/.direnv +/.idea diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..3e9bea5f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,62 @@ +# Contributing to komorebi-recorder + +The project is a collection of contributions from both the project leaders and +community members. There are many ways to contribute, this can include content +in the project repositories, as well as contributing in public and private +conversation, assisting users, writing blog posts, and many other ways. + +## How contributions are made + +Contributions to the project primarily happen in the project source +repositories, but may also occur in other places, such as discussion forums and +public and private discourse. + +## Contributing content to the Project + +In order for the project leaders to manage sustained progress toward the +project goals and maintain project velocity, focus and quality, the project may +adjust the license terms over time. + +Content contributed to the project must therefore be provided under +sufficiently liberal terms to allow these operations to proceed unimpeded. As +such contributions are accepted with the following understanding: + +* Contributed content is licensed under the terms of the 0-BSD license +* Contributors accept the terms of the project license at the time of + contribution + +By making a contribution, you accept both the current project license terms, +and that all contributions that you have made are provided under the terms of +the 0-BSD license. + +## Zero-Clause BSD + +``` +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN +AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +``` + +## Development environment + +The project builds with the stable Rust toolchain, and is formatted with nightly `rustfmt` (`cargo +nightly fmt`). + +## Checks + +Before pushing, run `just check`, which runs formatting, clippy, the tests, rustdoc with its warnings as errors and +`cargo deny`. `just --list` shows the other recipes. + +## Commits + +Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/), as the pull request +template asks: the release notes are generated from them. + +A change that alters what the documentation says (the rustdoc, the README, `docs/`) updates the +documentation in the same commit, so that the documentation never describes code that is not there. diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..5ca549ce --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,385 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.60.2", +] + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", + "terminal_size", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "komorebi-recorder" +version = "0.1.0" +dependencies = [ + "clap", +] + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "terminal_size" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" +dependencies = [ + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..6bfde2c2 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,22 @@ +[workspace] +resolver = "2" +members = ["komorebi-recorder"] + +[workspace.package] +version = "0.1.0" +edition = "2024" +repository = "https://github.com/LGUG2Z/komorebi-recorder" + +[workspace.dependencies] +chrono = "0.4" +clap = { version = "4", features = ["derive", "wrap_help"] } +color-eyre = "0.6" +crossbeam-channel = "0.5" +dirs = "6" +dunce = "1" +eframe = "0.33" +parking_lot = "0.12" +schemars = "1.1" +serde = { version = "1", features = ["derive"] } +serde_json = { package = "serde_json_lenient", version = "0.2" } +sysinfo = "0.38" diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..8796dd2f --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,108 @@ +# Komorebi License + +Version 2.0.0 + +## Acceptance + +In order to get any license under these terms, you must agree +to them as both strict obligations and conditions to all +your licenses. + +## Copyright License + +The licensor grants you a copyright license for the software +to do everything you might do with the software that would +otherwise infringe the licensor's copyright in it for any +permitted purpose. However, you may only distribute the source +code of the software according to the [Distribution License]( +#distribution-license), you may only make changes according +to the [Changes License](#changes-license), and you may not +otherwise distribute the software or new works based on the +software. + +## Distribution License + +The licensor grants you an additional copyright license to +distribute copies of the source code of the software. Your +license to distribute covers distributing the source code of +the software with changes permitted by the [Changes License]( +#changes-license). + +## Changes License + +The licensor grants you an additional copyright license to +make changes for any permitted purpose. + +## Patent License + +The licensor grants you a patent license for the software that +covers patent claims the licensor can license, or becomes able +to license, that you would infringe by using the software. + +## Personal Uses + +Personal use for research, experiment, and testing for +the benefit of public knowledge, personal study, private +entertainment, hobby projects, amateur pursuits, or religious +observance, without any anticipated commercial application, +is use for a permitted purpose. + +## Fair Use + +You may have "fair use" rights for the software under the +law. These terms do not limit them. + +## No Other Rights + +These terms do not allow you to sublicense or transfer any of +your licenses to anyone else, or prevent the licensor from +granting licenses to anyone else. These terms do not imply +any other licenses. + +## Patent Defense + +If you make any written claim that the software infringes or +contributes to infringement of any patent, your patent license +for the software granted under these terms ends immediately. If +your company makes such a claim, your patent license ends +immediately for work on behalf of your company. + +## Violations + +The first time you are notified in writing that you have +violated any of these terms, or done anything with the software +not covered by your licenses, your licenses can nonetheless +continue if you come into full compliance with these terms, +and take practical steps to correct past violations, within +32 days of receiving notice. Otherwise, all your licenses +end immediately. + +## No Liability + +***As far as the law allows, the software comes as is, without +any warranty or condition, and the licensor will not be liable +to you for any damages arising out of these terms or the use +or nature of the software, under any kind of legal claim.*** + +## Definitions + +The **licensor** is the individual or entity offering these +terms, and the **software** is the software the licensor makes +available under these terms. + +**You** refers to the individual or entity agreeing to these +terms. + +**Your company** is any legal entity, sole proprietorship, +or other kind of organization that you work for, plus all +organizations that have control over, are under the control of, +or are under common control with that organization. **Control** +means ownership of substantially all the assets of an entity, +or the power to direct its management and policies by vote, +contract, or otherwise. Control can be direct or indirect. + +**Your licenses** are all the licenses granted to you for the +software under these terms. + +**Use** means anything you do with the software requiring one +of your licenses. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 00000000..9d7fdafb --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# komorebi-recorder + +Synchronized screen, log and trace capture for komorebi bug reproduction. `komorebi-recorder` records a bug while it +happens, on macOS and on Windows: the screen, komorebi's log, every event komorebi sends its subscribers and the +operating system's own trace, all on one clock, into a single _session directory_. It then answers, from that +directory alone, what komorebi and the OS were doing at any second of the video and where in the video any log line or +event is: for a person, with a window that plays the recording with everything that happened laid out on a timeline, +and for an agent, with commands that print JSON. + +## Install + +There are no releases yet: build it from source, below. + +### From source + +With a stable Rust toolchain, in a checkout: + +```sh +cargo install --path komorebi-recorder --locked +``` + +## How it fits together + +Two things vary independently: the _host_ the recorder runs on (macOS or Windows) and the _flavor_ of komorebi it +records (komorebi for Mac or komorebi for Windows). A session records both, so one recorded on Windows can be +investigated on a Mac. Every record in a session is stamped on one monotonic clock, and the files in it are never +rewritten after they are written. + +## Crates + +- [`komorebi-recorder`](komorebi-recorder): the library, the `komorebi-recorder` command and, with the same code, the + `komorebi-recorder-gui` executable (no console window on Windows). + +## Checks + +`just check` runs formatting, clippy, the tests, rustdoc with its warnings as errors, and `cargo deny`. +CI runs the same checks, builds both platforms and, for Windows, the installer. + +## Documentation + +`cargo doc --workspace --no-deps --open` for the code. [CONTRIBUTING.md](CONTRIBUTING.md) says how to work on it. + +## License + +[Komorebi License 2.0.0](LICENSE.md). diff --git a/deny.toml b/deny.toml new file mode 100644 index 00000000..5a4ab026 --- /dev/null +++ b/deny.toml @@ -0,0 +1,52 @@ +[graph] +targets = ["aarch64-apple-darwin", "x86_64-pc-windows-msvc"] +all-features = false +no-default-features = false + +[output] +feature-depth = 1 + +[advisories] +ignore = [ + { id = "RUSTSEC-2026-0192", reason = "ttf-parser is unmaintained and has no safe upgrade; it is reached only through egui's font stack (eframe, egui, epaint, ab_glyph, owned_ttf_parser)" }, +] + +[licenses] +allow = [ + "0BSD", + "Apache-2.0", + "Artistic-2.0", + # clipboard-win's error-code, which eframe pulls in on Windows + "BSL-1.0", + "BSD-2-Clause", + "BSD-3-Clause", + "CC0-1.0", + "ISC", + "MIT", + "MPL-2.0", + "OFL-1.1", + "Ubuntu-font-1.0", + "Unicode-3.0", + "Zlib", + + "LicenseRef-Komorebi-2.0", +] +confidence-threshold = 0.8 + +[[licenses.clarify]] +crate = "komorebi-recorder" +expression = "LicenseRef-Komorebi-2.0" +license-files = [] + +[bans] +multiple-versions = "allow" +wildcards = "allow" +highlight = "all" +workspace-default-features = "allow" +external-default-features = "allow" + +[sources] +unknown-registry = "deny" +unknown-git = "deny" +allow-registry = ["https://github.com/rust-lang/crates.io-index"] +allow-git = [] diff --git a/dependencies.json b/dependencies.json new file mode 100644 index 00000000..a0e3e2d7 --- /dev/null +++ b/dependencies.json @@ -0,0 +1,93 @@ +{ + "licenses": [ + [ + "Apache-2.0", + [ + "anstream 1.0.0 registry+https://github.com/rust-lang/crates.io-index", + "anstyle 1.0.14 registry+https://github.com/rust-lang/crates.io-index", + "anstyle-parse 1.0.0 registry+https://github.com/rust-lang/crates.io-index", + "anstyle-query 1.1.5 registry+https://github.com/rust-lang/crates.io-index", + "anstyle-wincon 3.0.11 registry+https://github.com/rust-lang/crates.io-index", + "bitflags 2.11.1 registry+https://github.com/rust-lang/crates.io-index", + "clap 4.6.1 registry+https://github.com/rust-lang/crates.io-index", + "clap_builder 4.6.0 registry+https://github.com/rust-lang/crates.io-index", + "clap_derive 4.6.1 registry+https://github.com/rust-lang/crates.io-index", + "clap_lex 1.1.0 registry+https://github.com/rust-lang/crates.io-index", + "colorchoice 1.0.5 registry+https://github.com/rust-lang/crates.io-index", + "errno 0.3.14 registry+https://github.com/rust-lang/crates.io-index", + "heck 0.5.0 registry+https://github.com/rust-lang/crates.io-index", + "is_terminal_polyfill 1.70.2 registry+https://github.com/rust-lang/crates.io-index", + "libc 0.2.186 registry+https://github.com/rust-lang/crates.io-index", + "once_cell_polyfill 1.70.2 registry+https://github.com/rust-lang/crates.io-index", + "proc-macro2 1.0.106 registry+https://github.com/rust-lang/crates.io-index", + "quote 1.0.45 registry+https://github.com/rust-lang/crates.io-index", + "rustix 1.1.4 registry+https://github.com/rust-lang/crates.io-index", + "syn 2.0.117 registry+https://github.com/rust-lang/crates.io-index", + "terminal_size 0.4.4 registry+https://github.com/rust-lang/crates.io-index", + "unicode-ident 1.0.24 registry+https://github.com/rust-lang/crates.io-index", + "utf8parse 0.2.2 registry+https://github.com/rust-lang/crates.io-index", + "windows-sys 0.52.0 registry+https://github.com/rust-lang/crates.io-index", + "windows-sys 0.59.0 registry+https://github.com/rust-lang/crates.io-index", + "windows-sys 0.60.2 registry+https://github.com/rust-lang/crates.io-index", + "windows-targets 0.52.6 registry+https://github.com/rust-lang/crates.io-index", + "windows-targets 0.53.5 registry+https://github.com/rust-lang/crates.io-index", + "windows_x86_64_msvc 0.52.6 registry+https://github.com/rust-lang/crates.io-index", + "windows_x86_64_msvc 0.53.1 registry+https://github.com/rust-lang/crates.io-index" + ] + ], + [ + "Apache-2.0 WITH LLVM-exception", + [ + "rustix 1.1.4 registry+https://github.com/rust-lang/crates.io-index" + ] + ], + [ + "LicenseRef-Komorebi-2.0", + [ + "komorebi-recorder 0.1.1 path+file:///Users/lgug2z/.cache/komorebi-recorder/lockwork/komorebi-recorder" + ] + ], + [ + "MIT", + [ + "anstream 1.0.0 registry+https://github.com/rust-lang/crates.io-index", + "anstyle 1.0.14 registry+https://github.com/rust-lang/crates.io-index", + "anstyle-parse 1.0.0 registry+https://github.com/rust-lang/crates.io-index", + "anstyle-query 1.1.5 registry+https://github.com/rust-lang/crates.io-index", + "anstyle-wincon 3.0.11 registry+https://github.com/rust-lang/crates.io-index", + "bitflags 2.11.1 registry+https://github.com/rust-lang/crates.io-index", + "clap 4.6.1 registry+https://github.com/rust-lang/crates.io-index", + "clap_builder 4.6.0 registry+https://github.com/rust-lang/crates.io-index", + "clap_derive 4.6.1 registry+https://github.com/rust-lang/crates.io-index", + "clap_lex 1.1.0 registry+https://github.com/rust-lang/crates.io-index", + "colorchoice 1.0.5 registry+https://github.com/rust-lang/crates.io-index", + "errno 0.3.14 registry+https://github.com/rust-lang/crates.io-index", + "heck 0.5.0 registry+https://github.com/rust-lang/crates.io-index", + "is_terminal_polyfill 1.70.2 registry+https://github.com/rust-lang/crates.io-index", + "libc 0.2.186 registry+https://github.com/rust-lang/crates.io-index", + "once_cell_polyfill 1.70.2 registry+https://github.com/rust-lang/crates.io-index", + "proc-macro2 1.0.106 registry+https://github.com/rust-lang/crates.io-index", + "quote 1.0.45 registry+https://github.com/rust-lang/crates.io-index", + "rustix 1.1.4 registry+https://github.com/rust-lang/crates.io-index", + "strsim 0.11.1 registry+https://github.com/rust-lang/crates.io-index", + "syn 2.0.117 registry+https://github.com/rust-lang/crates.io-index", + "terminal_size 0.4.4 registry+https://github.com/rust-lang/crates.io-index", + "unicode-ident 1.0.24 registry+https://github.com/rust-lang/crates.io-index", + "utf8parse 0.2.2 registry+https://github.com/rust-lang/crates.io-index", + "windows-sys 0.52.0 registry+https://github.com/rust-lang/crates.io-index", + "windows-sys 0.59.0 registry+https://github.com/rust-lang/crates.io-index", + "windows-sys 0.60.2 registry+https://github.com/rust-lang/crates.io-index", + "windows-targets 0.52.6 registry+https://github.com/rust-lang/crates.io-index", + "windows-targets 0.53.5 registry+https://github.com/rust-lang/crates.io-index", + "windows_x86_64_msvc 0.52.6 registry+https://github.com/rust-lang/crates.io-index", + "windows_x86_64_msvc 0.53.1 registry+https://github.com/rust-lang/crates.io-index" + ] + ], + [ + "Unicode-3.0", + [ + "unicode-ident 1.0.24 registry+https://github.com/rust-lang/crates.io-index" + ] + ] + ] +} diff --git a/justfile b/justfile new file mode 100644 index 00000000..7477692c --- /dev/null +++ b/justfile @@ -0,0 +1,58 @@ +export RUST_BACKTRACE := "full" + +# everything CI checks, in order +check: fmt-check clippy test doc deny + +# nightly rustfmt, which the devShell provides, and the macros this project does not allow +fmt-check: + test -z "$(rg 'eyre!' --type rust)" || (echo "eyre! macro not allowed"; false) + test -z "$(rg 'dbg!' --type rust)" || (echo "dbg! macro not allowed"; false) + cargo fmt --check + +# format everything: Rust, TOML, Nix and this file +fmt: + cargo clippy --workspace --all-targets --locked + nix fmt + +fix: + cargo clippy --workspace --all-targets --fix --allow-dirty + +clippy: + cargo clippy --workspace --all-targets --locked -- -D warnings + + +# lib, integration and doc tests; the ones that read komorebi's source need KOMOREBI_MAC_SRC, which `nix develop` sets +test: + cargo test --workspace --locked + +# rustdoc with its warnings as errors, for both hosts: links in `cfg(windows)` docs are only checked on Windows +doc: + RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --locked + +deny: + cargo deny check + +clean: + cargo clean + +install: + cargo install --path komorebi-recorder --locked + +build: + cargo build --package komorebi-recorder --locked --release + +run target: + cargo run --bin {{ target }} --locked + +# record a bug repro: screen + komorebi log/events + OS trace, then query it with `komorebi-recorder at` +record *args: + cargo run --bin komorebi-recorder --locked -- {{ args }} + + +deps: + cargo update + just depgen + +depgen: + cargo deny check + cargo deny list --format json | jq 'del(.unlicensed)' > dependencies.json diff --git a/komorebi-recorder/Cargo.toml b/komorebi-recorder/Cargo.toml new file mode 100644 index 00000000..2f21686b --- /dev/null +++ b/komorebi-recorder/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "komorebi-recorder" +version.workspace = true +description = "Synchronized screen, log and trace capture for komorebi bug reproduction" +edition.workspace = true +repository.workspace = true + +[dependencies] +clap = { workspace = true } diff --git a/komorebi-recorder/src/lib.rs b/komorebi-recorder/src/lib.rs new file mode 100644 index 00000000..a6d80956 --- /dev/null +++ b/komorebi-recorder/src/lib.rs @@ -0,0 +1,10 @@ +//! Synchronized screen, log and trace capture for komorebi bug reproduction. `komorebi-recorder` records a bug while it +//! happens, on macOS and on Windows: the screen, komorebi's log, every event komorebi sends its subscribers and the +//! operating system's own trace, all on one clock, into a single _session directory_. It then answers, from that +//! directory alone, what komorebi and the OS were doing at any second of the video and where in the video any log line or +//! event is: for a person, with a window that plays the recording with everything that happened laid out on a timeline, +//! and for an agent, with commands that print JSON. +//! +//! This crate is the library behind the `komorebi-recorder` command. A reader who wants to run it should start with the +//! [README](https://github.com/LGUG2Z/komorebi-recorder#readme); this documentation is for someone who is changing it, +//! or reading a session directory from a program of their own. diff --git a/komorebi-recorder/src/main.rs b/komorebi-recorder/src/main.rs new file mode 100644 index 00000000..709c8895 --- /dev/null +++ b/komorebi-recorder/src/main.rs @@ -0,0 +1,15 @@ +//! The `komorebi-recorder` command. + +use clap::Parser; + +#[derive(Parser)] +#[command( + author, + version, + about = "Synchronized screen, log and trace capture for komorebi bug reproduction" +)] +struct Opts; + +fn main() { + Opts::parse(); +} diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..292fe499 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "stable" diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 00000000..63df91e0 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +imports_granularity = "Item"