Skip to content

feat(hatchet): complete Effect-first Hatchet integration slices#47

Open
kattsushi wants to merge 24 commits intodevfrom
hatchet
Open

feat(hatchet): complete Effect-first Hatchet integration slices#47
kattsushi wants to merge 24 commits intodevfrom
hatchet

Conversation

@kattsushi
Copy link
Copy Markdown
Contributor

@kattsushi kattsushi commented Apr 13, 2026

Closes #46

PR Type

  • New feature
  • Bug fix
  • Documentation only
  • Code refactoring
  • Maintenance/tooling
  • Breaking change

Summary

  • complete the Effect-first Hatchet integration track across package APIs, React Router demo flows, and supporting tests
  • add client/demo slices for events, schedules, crons, observability, webhooks, rate limits, filters, and workflow management
  • harden SDK integration with browser test harness, coverage tooling, coverage improvements, and architectural cleanups around TaggedError and Duration boundaries

Changes

File Change
packages/hatchet/src/clients/* Added/expanded Effect-first Hatchet client wrappers for the implemented slices
packages/hatchet/src/core/* Aligned error handling and supporting Hatchet infrastructure
packages/hatchet/src/testing/* Expanded mock infrastructure for new client surfaces
packages/hatchet/tests/unit/* Added and hardened unit coverage across slices and infrastructure
apps/react-router-example/app/routes/hatchet-demo* Extended the demo route with slice-specific UI, server actions/loaders, and render/route tests
apps/react-router-example/test/browser/* Added reusable browser harness infrastructure
apps/react-router-example/vitest.browser.config.ts Added browser-mode Vitest configuration
pnpm-workspace.yaml, package.json, app/package manifests Aligned workspace dependency/tooling configuration including coverage support
AGENTS.md Documented Hatchet + Effect conventions discovered during implementation

Test Plan

  • Ran Nx test targets across @effectify/hatchet and @effectify/react-router-example
  • Ran typecheck/build validation for affected projects
  • Verified Vitest coverage reporting for package and example app
  • Exercised browser harness validation paths with system Chromium/WebdriverIO

Contributor Checklist

  • Linked an approved issue
  • Added exactly one type:* label
  • Ran relevant validation for affected functionality
  • Updated docs/conventions when behavior or architecture changed
  • Used conventional commits only
  • No Co-Authored-By trailers

…et package

- Created hatchet-spec.md to define requirements and scenarios for the @effectify/hatchet package, covering core, effectifier, workflow, logging, schema, testing, monorepo setup, and integration specs.
- Added hatchet-tasks.md to outline implementation tasks for the package, detailing phases from monorepo setup to documentation and release, with a total of 47 tasks.
- Introduced `workflow` module for defining Hatchet workflows using Effect.
- Implemented `registerWorkflow` and `registerWorkflowWithConfig` for workflow registration with Hatchet workers.
- Added task helper functions to create tasks with options and effects.
- Defined types for workflow and task options to enhance type safety.
- Created integration and unit tests for workflow registration, task creation, and error handling.
- Set up Docker Compose for local development and testing of Hatchet Lite.
- Added TypeScript configuration files for building and testing the package.
…space exploration

- Created `nx-plugins` skill for discovering and installing Nx plugins.
- Introduced `nx-run-tasks` skill to assist with executing tasks in an Nx workspace.
- Developed `nx-workspace` skill for exploring workspace structure, project configurations, and available targets.
- Added reference documentation for affected projects in the Nx workspace.
- Updated agent guidelines to emphasize the use of new skills and best practices for Nx commands.
- Enhanced documentation for the Hatchet package with improved examples and architecture details.
- Implemented unit tests for the effectifier module in the Hatchet package.
@kattsushi kattsushi added the type:feature New feature work label Apr 13, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 63bc9be6-8604-448a-a7c9-90b187a646a3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hatchet

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kattsushi kattsushi changed the base branch from master to dev April 13, 2026 13:28
… and workspace exploration

- Deleted VITE.md, SKILL.md for nx-plugins, nx-run-tasks, and nx-workspace to streamline the agent's knowledge base.
- Removed references to affected projects and CI monitor subagent configuration.
- Added package-lock.json for opencode with dependencies for @opencode-ai/plugin and related packages.
const AppLayer = Layer.mergeAll(
Layer.merge(BaseAppLayer, HatchetConfigLayer),
HatchetClientLive,
) as unknown as Layer.Layer<any, any, never>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this casting is bad pattern mostly in the application layer, with this lost the typesafety.

import { renderToStaticMarkup } from "react-dom/server"
import { HatchetDemoCronsSection } from "./hatchet-demo-crons.js"

describe("HatchetDemoCronsSection", () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test e2e or integration test should live in other folder for the app.

@@ -0,0 +1,55 @@
export const parseEventPayload = (input: string): Record<string, unknown> => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should be live in lib/hatchet

runWorkflow,
upsertRateLimit,
} from "@effectify/hatchet"
import { Form, useActionData } from "react-router"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each section should be a new page inside hatchet-demo/* and have a litter natigation with tabs or sidebar, each page should handle his senario with the action and loader

* )
* ```
*/
// TODO: Fix type issue with HatchetStepContext
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review more todos

import { getHatchetClient } from "../core/client.js"
import { HatchetCronError } from "../core/error.js"

interface CronWorkflowMetadata {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see for each client you are defined all necesary types or interfaces this is really necessary we can use already hatchet SDK provides? this is tranversal

* Effect-first wrappers around the Hatchet SDK crons surface.
*/

import * as Effect from "effect/Effect"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i cant see the utilization of Effect Duration module i think is very important to keep Effect first Api interface to interact with hatchet SDK

@@ -0,0 +1,39 @@
import { webdriverio } from "@vitest/browser-webdriverio"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also the test e2e must considerate make test against to the hatchet UI to verify all is working accordingly

Effect.gen(function*() {
const config = yield* HatchetConfig

console.log("[Hatchet] Initializing with host:", config.host)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log is not right we must use yield* Console from Effect

*/
export class HatchetStepContext extends ServiceMap.Service<
HatchetStepContext,
HatchetContext<any, any>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why here is <any, any> ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(hatchet): track integrated Hatchet branch work

1 participant