Skip to content

Commit b8dce5a

Browse files
committed
refactor: implement Pipeline v2 execution model with declarative step metadata, YAML configuration, and unified engine delegation.
1 parent 21452b7 commit b8dce5a

14 files changed

Lines changed: 1013 additions & 639 deletions

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.17.0] - 2026-04-05
9+
10+
### Added
11+
12+
- **Step Metadata**: Four declarative fields on `BaseStep`: `match_modules` (glob patterns for selective execution), `ignore_errors` (fault-tolerant steps), `pure` (safe for `validate()` dry-run), `timeout_ms` (per-step timeout).
13+
- **YAML Pipeline Configuration**: `register_step_type()`, `unregister_step_type()`, `registered_step_types()`, `build_strategy_from_config()` — configure pipeline steps via `apcore.yaml` at startup.
14+
- **PipelineContext fields**: `dry_run`, `version_hint`, `executed_middlewares` for pipeline-aware execution.
15+
- **StepTrace**: `skip_reason` field for understanding why steps were skipped ("no_match", "dry_run", "error_ignored").
16+
17+
### Changed
18+
19+
- **Step order**: `middleware_before` now runs BEFORE `input_validation` (was after). Middleware input transforms are now validated by the schema check.
20+
- **Executor delegation**: `call()`, `call_async()`, `validate()`, and `stream()` fully delegate to `PipelineEngine.run()`. Removed ~300 lines of duplicated inline step code.
21+
- **Renamed**: `safety_check` step → `call_chain_guard` (accurately describes call-chain depth/cycle/repeat checking).
22+
- **Renamed**: `BuiltinSafetyCheck` class → `BuiltinCallChainGuard`.
23+
24+
### Fixed
25+
26+
- Middleware input transforms were never re-validated against the schema (now validated after middleware runs).
27+
- `validate()` was hardcoded to 7 inline checks; now uses `dry_run=True` pipeline mode — user-added `pure=True` steps automatically participate.
28+
29+
---
30+
831
## [0.16.0] - 2026-04-05
932

1033
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A schema-enforced module standard for the AI-Perceivable era.
1717
## Features
1818

1919
- **Schema-driven modules** -- Define input/output contracts using Pydantic models (with automatic validation) or plain JSON Schema dicts
20-
- **Execution Pipeline** -- Context creation, safety checks, ACL enforcement, approval gate, validation, middleware chains, and execution with timeout support
20+
- **Execution Pipeline** -- Context creation, call chain guard, ACL enforcement, approval gate, middleware before, validation, execution, output validation, middleware after, and return -- with step metadata (`match_modules`, `ignore_errors`, `pure`, `timeout_ms`) and YAML pipeline configuration
2121
- **`@module` decorator** -- Turn plain functions into fully schema-aware modules with zero boilerplate
2222
- **YAML bindings** -- Register modules declaratively without modifying source code
2323
- **Access control (ACL)** -- Pattern-based, first-match-wins rules with wildcard support

src/apcore/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,14 @@
198198
StrategyNotFoundError,
199199
)
200200

201+
# Pipeline Configuration
202+
from apcore.pipeline_config import (
203+
build_strategy_from_config,
204+
register_step_type,
205+
registered_step_types,
206+
unregister_step_type,
207+
)
208+
201209
# Trace Context
202210
from apcore.trace_context import TraceContext, TraceParent
203211

@@ -544,6 +552,11 @@ def enable(module_id: str, reason: str = "Enabled via APCore client") -> dict[st
544552
"StepNotReplaceableError",
545553
"StepNameDuplicateError",
546554
"StrategyNotFoundError",
555+
# Pipeline Configuration
556+
"register_step_type",
557+
"unregister_step_type",
558+
"registered_step_types",
559+
"build_strategy_from_config",
547560
# System Modules
548561
"register_sys_modules",
549562
"register_subscriber_type",

0 commit comments

Comments
 (0)