Skip to content

feat: Agnostic Pipeline Kinds & Internal Runner Refactor#392

Merged
pipewrk merged 6 commits intowpkernel:mainfrom
theGeekist:feat/pipeline
Dec 12, 2025
Merged

feat: Agnostic Pipeline Kinds & Internal Runner Refactor#392
pipewrk merged 6 commits intowpkernel:mainfrom
theGeekist:feat/pipeline

Conversation

@pipewrk
Copy link
Contributor

@pipewrk pipewrk commented Dec 11, 2025

This PR introduces the 

makePipeline API, enabling fully agnostic helper kinds (beyond just fragment and builder). It also refactors the monolithic 

pipeline-runner.ts into a modular architecture (contextexecutionprogram) and implements synchronous execution optimizations.

Key Changes

1. New 

makePipeline API

  • Agnostic Kinds: Replaced hardcoded fragment/builder logic with a generic registry. Pipelines can now define arbitrary stages (e.g., ETL: extracttransformload).

  • Generic Registration: Updated Pipeline.use() to accept any valid 

    Helper type.

  • Type Safety: Strictly typed generic implementation without any casts.

2. Runner Refactor

  • Modularization: Split 

    pipeline-runner.ts into:

    • internal/runner/context.ts: Dependency graph creation and context preparation.
    • internal/runner/program.ts: Program composition (pipeline steps).
    • internal/runner/execution.ts: Runtime execution logic.
  • Sync Optimization: Implemented 

    maybeThen / 

    maybeTry patterns to ensure synchronous pipelines execute without Promise overheads.

3. Features

  • Helper Overrides: Implemented override mode support to replace existing helpers properly.

  • Eager Validation: Dependency graphs are now validated eagerly during 

    prepareContext.

Verification

Automated Tests

  • New ETL Test Case

    src/tests/agnostic-kinds.test.ts validates custom extracttransformload stages.

  • Sync Execution

    src/tests/sync-execution.test.ts proves that purely sync pipelines return values synchronously.

  • Regression: Passed full pnpm test suite and repo-wide type check.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

...state,
artifact: extensionState.artifact,
extensionCoordinator,
extensionState,
})

P1 Badge Commit only final extension lifecycle results

When multiple extension lifecycles are configured (see lifecycles array built at lines 577‑579), each call to executeLifecycle overwrites state.extensionCoordinator/extensionState with the current lifecycle’s data (lines 392‑396), but the commit stage later operates on a single extensionState (312‑319). As a result, if you enable more than one lifecycle (e.g., ['prepare','after-fragments']), hooks executed in earlier lifecycles never have their commit/rollback callbacks invoked, leaving their side-effects uncommitted and unrolled. This breaks multi-lifecycle extensions even though this commit advertises supporting them.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@pipewrk
Copy link
Contributor Author

pipewrk commented Dec 11, 2025

@codex review

@wpkernel wpkernel deleted a comment from chatgpt-codex-connector bot Dec 11, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@pipewrk
Copy link
Contributor Author

pipewrk commented Dec 11, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@pipewrk pipewrk merged commit bc24817 into wpkernel:main Dec 12, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant