cli/docs/services/crypt.md

134 lines
2.7 KiB
Markdown
Raw Normal View History

# Crypt Service
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
The Crypt service (`pkg/crypt`) provides cryptographic utilities including hashing, checksums, RSA encryption, and PGP operations.
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
## Features
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
- Multiple hash algorithms (SHA512, SHA256, SHA1, MD5)
- Checksum functions (Fletcher, Luhn)
- RSA key generation and encryption
- PGP encryption, signing, and verification
- Symmetric PGP encryption
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
## Basic Usage
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
```go
import "github.com/Snider/Core/pkg/crypt"
// Standalone usage
crypto, err := crypt.New()
// With Core framework
c, _ := core.New(
core.WithService(crypt.Register),
)
crypto := core.MustServiceFor[*crypt.Service](c, "crypt")
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
```
## Hashing
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
```go
// Available algorithms: SHA512, SHA256, SHA1, MD5, LTHN
hash := crypto.Hash(crypt.SHA256, "hello world")
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
// Check if string is valid hash algorithm
isValid := crypto.IsHashAlgo("sha256")
```
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
## Checksums
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
```go
// Luhn validation (credit card numbers)
isValid := crypto.Luhn("4532015112830366")
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
// Fletcher checksums
f16 := crypto.Fletcher16("data")
f32 := crypto.Fletcher32("data")
f64 := crypto.Fletcher64("data")
```
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
## RSA Encryption
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
```go
// Generate key pair (2048 or 4096 bits recommended)
publicKey, privateKey, err := crypto.GenerateRSAKeyPair(2048)
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
// Encrypt with public key
ciphertext, err := crypto.EncryptRSA(publicKey, "secret message")
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
// Decrypt with private key
plaintext, err := crypto.DecryptRSA(privateKey, ciphertext)
```
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
## PGP Encryption
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
### Key Generation
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
```go
// Generate PGP key pair
publicKey, privateKey, err := crypto.GeneratePGPKeyPair(
"User Name",
"user@example.com",
"Key comment",
)
```
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
### Asymmetric Encryption
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
```go
// Encrypt for recipient
ciphertext, err := crypto.EncryptPGPToString(recipientPublicKey, "secret data")
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
// Decrypt with private key
plaintext, err := crypto.DecryptPGP(privateKey, ciphertext)
```
### Symmetric Encryption
```go
var buf bytes.Buffer
err := crypto.SymmetricallyEncryptPGP(&buf, "data", "passphrase")
```
Refactor library improvements (#18) * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` initialization. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * refactor: Rearchitect library to use runtime and pkg modules This commit introduces a major architectural refactoring to simplify the library's structure and improve its maintainability. Key changes include: - **Simplified Project Structure:** All top-level facade packages (config, crypt, display, etc.) and the root `core.go` have been removed. All library code now resides directly under the `pkg/` directory. - **Unified Runtime:** A new `pkg/runtime` module with a `New()` constructor has been introduced. This function initializes and wires together all core services, providing a single, convenient entry point for applications. The runtime now accepts the Wails application instance, ensuring proper integration with the GUI. - **Updated Entry Points:** The `cmd/core-gui` application and all examples have been updated to use the new `runtime.New()` constructor and correctly register the runtime as a Wails service. - **Internal Packages:** The `config` and `crypt` packages have been refactored to use an `internal` subdirectory for their implementation. This hides private details and exposes a clean, stable public API. - **Standardized Error Handling:** A new error handling package has been added at `pkg/e`. The `workspace` and `crypt` services have been updated to use this new standard. - **Improved Feature Flagging:** A `IsFeatureEnabled` method was added to the `config` service for more robust and centralized feature flag checks. - **CI and Dependencies:** - A GitHub Actions workflow has been added for continuous integration. - All Go dependencies have been updated to their latest versions. - **Documentation:** All documentation has been updated to reflect the new, simplified architecture, and obsolete files have been removed. * Feature tdd contract testing (#19) * feat: Implement TDD contract testing for public API This commit introduces a Test-Driven Development (TDD) workflow to enforce the public API contract. A new `tdd/` directory has been added to house these tests, which are intended to be the starting point for any new features or bug fixes that affect the public interface. The "Good, Bad, Ugly" testing methodology has been adopted for these tests: - `_Good` tests verify the "happy path" with valid inputs. - `_Bad` tests verify predictable errors with invalid inputs. - `_Ugly` tests verify edge cases and unexpected inputs to prevent panics. TDD contract tests have been implemented for the `core` and `config` packages, and the `core.New` function has been hardened to prevent panics from `nil` options. The `README.md` has been updated to document this new workflow. * feat: Add TDD contract tests for all services This commit expands the TDD contract testing framework to cover all services in the application. "Good, Bad, Ugly" tests have been added for the `help`, `i18n`, and `workspace` services. To facilitate testing, the following refactors were made: - `help`: Added a `SetDisplay` method to allow for mock injection. Hardened `Show` and `ShowAt` to prevent panics. - `i18n`: Added a `SetBundle` method to allow for loading test-specific localization files. - `workspace`: Made the `Config` field public and added a `SetMedium` method to allow for mock injection. The TDD tests for the `crypt` service have been skipped due to issues with PGP key generation in the test environment. * CLI code-docgen function (#16) * Refactor CLI structure: move commands to 'dev' package, add docstring generation command, and update Taskfile for new tasks Signed-off-by: Snider <snider@lt.hn> * Add CodeRabbit PR review badge to README Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * Update pkg/runtime/runtime.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Rearchitect library and add automated documentation This commit introduces a major architectural refactoring of the Core library and adds a new, automated documentation system. **Architectural Changes:** * **Unified Runtime:** A new `pkg/runtime` module provides a single `runtime.New()` constructor that initializes and manages all core services. This simplifies application startup and improves maintainability. * **Wails Integration:** The `Runtime` is now correctly integrated with the Wails application lifecycle, accepting the `*application.App` instance and being registered as a Wails service. * **Simplified Project Structure:** All top-level facade packages have been removed, and library code is now consolidated under the `pkg/` directory. * **Internal Packages:** The `config` and `crypt` services now use an `internal` package to enforce a clean separation between public API and implementation details. * **Standardized Error Handling:** The `pkg/e` package has been introduced and integrated into the `workspace` and `crypt` services for consistent error handling. * **Graceful Shutdown:** The shutdown process has been fixed to ensure shutdown signals are correctly propagated to all services. **Documentation:** * **Automated Doc Generation:** A new `docgen` command has been added to `cmd/core` to automatically generate Markdown documentation from the service source code. * **MkDocs Site:** A new MkDocs Material documentation site has been configured in the `/docs` directory. * **Deployment Workflow:** A new GitHub Actions workflow (`.github/workflows/docs.yml`) automatically builds and deploys the documentation site to GitHub Pages. **Quality Improvements:** * **Hermetic Tests:** The config service tests have been updated to be fully hermetic, running in a temporary environment to avoid side effects. * **Panic Fix:** A panic in the config service's `Set` method has been fixed, and "Good, Bad, Ugly" tests have been added to verify the fix. * **CI/CD:** The CI workflow has been updated to use the latest GitHub Actions. * **Code Quality:** Numerous smaller fixes and improvements have been made based on CI feedback. --------- Signed-off-by: Snider <snider@lt.hn> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 16:17:25 +00:00
### Signing & Verification
```go
// Sign data
signature, err := crypto.SignPGP(privateKey, "data to sign")
// Verify signature
err := crypto.VerifyPGP(publicKey, "data to sign", signature)
if err != nil {
// Signature invalid
}
```
## Hash Types
| Constant | Algorithm |
|----------|-----------|
| `crypt.SHA512` | SHA-512 |
| `crypt.SHA256` | SHA-256 |
| `crypt.SHA1` | SHA-1 |
| `crypt.MD5` | MD5 |
| `crypt.LTHN` | Custom LTHN hash |
## Frontend Usage (TypeScript)
```typescript
import {
Hash,
GenerateRSAKeyPair,
EncryptRSA,
DecryptRSA
} from '@bindings/crypt/service';
// Hash data
const hash = await Hash("SHA256", "hello world");
// RSA encryption
const { publicKey, privateKey } = await GenerateRSAKeyPair(2048);
const encrypted = await EncryptRSA(publicKey, "secret");
const decrypted = await DecryptRSA(privateKey, encrypted);
```