Commit graph

5 commits

Author SHA1 Message Date
4eb1e02f5e feat/ml-integration (#2)
Some checks are pending
Security Scan / Go Vulnerability Check (push) Waiting to run
Security Scan / Secret Detection (push) Waiting to run
Security Scan / Dependency & Config Scan (push) Waiting to run
Co-authored-by: Charon (snider-linux) <charon@lethean.io>
Co-authored-by: Snider <snider@host.uk.com>
Co-authored-by: Virgil <virgil@lethean.io>
Co-authored-by: Claude <developers@lethean.io>
Reviewed-on: core/cli#2
Co-authored-by: Snider <snider@lethean.io>
Co-committed-by: Snider <snider@lethean.io>
2026-02-16 06:19:09 +00:00
Snider
2f9d55e3fd
Implement Background Goroutines for Long-Running Operations (#309)
* feat: implement background goroutines for long-running operations

Introduced `PerformAsync` in the Core framework to support non-blocking
execution of long-running tasks. This mechanism uses the IPC system to
broadcast `ActionTaskStarted` and `ActionTaskCompleted` events, ensuring
the frontend remains responsive and informed.

- Added `PerformAsync(Task) string` to `Core`.
- Defined framework-level lifecycle actions: `ActionTaskStarted`,
  `ActionTaskProgress`, and `ActionTaskCompleted`.
- Updated `internal/cmd/dev/service.go` to support `AutoPush` in
  `TaskWork`, removing interactive prompts during background execution.
- Added comprehensive documentation for the background operations pattern
  in `docs/pkg/PACKAGE_STANDARDS.md`.
- Added unit tests for the async task mechanism in `pkg/framework/core/ipc_test.go`.

* feat: implement background goroutines for long-running operations

Introduced `PerformAsync` in the Core framework to support non-blocking
execution of long-running tasks. This mechanism uses the IPC system to
broadcast `ActionTaskStarted` and `ActionTaskCompleted` events, ensuring
the frontend remains responsive and informed.

- Added `PerformAsync(Task) string` to `Core`.
- Defined framework-level lifecycle actions: `ActionTaskStarted`,
  `ActionTaskProgress`, and `ActionTaskCompleted`.
- Updated `internal/cmd/dev/service.go` to support `AutoPush` in
  `TaskWork`, removing interactive prompts during background execution.
- Added comprehensive documentation for the background operations pattern
  in `docs/pkg/PACKAGE_STANDARDS.md`.
- Added unit tests for the async task mechanism in `pkg/framework/core/ipc_test.go`.
- Fixed formatting in `pkg/io/local/client.go`.

* feat: implement background goroutines with progress reporting

This version addresses feedback by providing a more complete implementation
of the background task mechanism, including progress reporting and
demonstrating actual usage in the AI service.

- Added `TaskWithID` interface to support task ID injection.
- Updated `PerformAsync` to inject IDs and provided `Core.Progress` helper.
- Applied background processing pattern to `TaskPrompt` in `agentic` service.
- Included a fix for the `auto-merge` CI failure by providing explicit repo
  context to the `gh` command in a local workflow implementation.
- Fixed formatting in `pkg/io/local/client.go` and `pkg/agentic/service.go`.
- Updated documentation with the new progress reporting pattern.

* feat: implement non-blocking background tasks with progress reporting

This submission provides a complete framework-level solution for running
long-running operations in the background to prevent UI blocking,
addressing previous review feedback.

Key changes:
- Introduced `PerformAsync(Task) string` in the `Core` framework.
- Added `TaskWithID` interface to allow tasks to receive their unique ID.
- Provided `Core.Progress` helper for services to report granular updates.
- Applied the background pattern to the AI service (`agentic.TaskPrompt`).
- Updated the dev service (`TaskWork`) to support an `AutoPush` flag,
  eliminating interactive prompts during background execution.
- Added a local implementation for the `auto-merge` CI workflow to
  bypass repo context issues and fix the blocking CI failure.
- Included comprehensive documentation in `docs/pkg/PACKAGE_STANDARDS.md`.
- Resolved formatting discrepancies across the codebase.
- Verified functionality with unit tests in `pkg/framework/core/ipc_test.go`.

---------

Co-authored-by: Claude <developers@lethean.io>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:26:45 +00:00
Snider
155251c8d9
Implement log retention policy (#306)
* Implement log retention policy

- Added Append method to io.Medium interface and implementations.
- Defined RotationOptions and updated log.Options to support log rotation.
- Implemented RotatingWriter in pkg/log/rotation.go with size and age-based retention.
- Updated Logger to use RotatingWriter when configured.
- Added comprehensive tests for log rotation and retention.
- Documented the log retention policy in docs/pkg/log.md and docs/configuration.md.
- Fixed MockMedium to return current time for Stat to avoid premature cleanup in tests.

* Fix formatting issues in pkg/io/local/client.go

The CI failed due to formatting issues. This commit fixes them and ensures all modified files are properly formatted.

* Fix auto-merge workflow CI failure

Inlined the auto-merge logic and added actions/checkout and --repo flag to gh command to provide the necessary git context. This resolves the 'fatal: not a git repository' error in CI.

* Address feedback on log retention policy

- Made cleanup synchronous in RotatingWriter for better reliability.
- Improved rotation error handling with recovery logic.
- Fixed size tracking to only increment on successful writes.
- Updated MockMedium to support and preserve ModTimes for age-based testing.
- Added TestRotatingWriter_AgeRetention and TestLogger_RotationIntegration.
- Implemented negative MaxAge to disable age-based retention.
- Updated documentation for clarity on Output priority and MaxAge behavior.
- Fixed typo in test comments.
- Fixed CI failure in auto-merge workflow.

---------

Co-authored-by: Claude <developers@lethean.io>
2026-02-05 10:26:32 +00:00
Snider
41270b2904 feat(process): add process management package with Core IPC
Add pkg/process for spawning, monitoring, and orchestrating external
processes with Core ACTION integration:

- Service with framework.ServiceRuntime integration
- ACTION messages: ProcessStarted, ProcessOutput, ProcessExited
- RingBuffer for output capture
- Runner for orchestration (RunAll, RunSequential, RunParallel)
- Dependency graph support for QA pipelines
- Global convenience functions following i18n patterns

Also add docs/pkg/PACKAGE_STANDARDS.md defining how to create Core
packages, using pkg/i18n as the reference implementation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:48:28 +00:00
Snider
e9be13bcd3 docs(i18n): add comprehensive package documentation
- README.md: Quick start, all features, configuration options
- GRAMMAR.md: Verb conjugation, pluralisation, articles, templates
- EXTENDING.md: Custom loaders, handlers, framework integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:18:43 +00:00