Skip to content

feat(core): PipelineState.shared + Stage.local_state#37

Merged
CocoRoF merged 1 commit intomainfrom
feat/pipeline-state-shared-and-local
Apr 21, 2026
Merged

feat(core): PipelineState.shared + Stage.local_state#37
CocoRoF merged 1 commit intomainfrom
feat/pipeline-state-shared-and-local

Conversation

@CocoRoF
Copy link
Copy Markdown
Owner

@CocoRoF CocoRoF commented Apr 21, 2026

Summary

PR-1 of the 20260421_4 cycle — foundational state interfaces. Purely additive.

  • PipelineState.shared: Dict[str, Any] — cross-stage communication bucket, fresh per run.
  • Stage.local_state(state) -> Dict[str, Any] — per-stage scratchpad backed by state.metadata[self.name], auto-created.

No shipped stage uses either helper yet; downstream PRs in this cycle (resolve_model_config, unified llm_client, s06_api migration, memory stages) will be the first consumers. See Geny/dev_docs/20260421_4/index.md for the full sequence.

Rationale

  • metadata has accumulated a mix of legacy pipeline signals and stage-local bookkeeping. Splitting cross-stage data into shared and per-stage data into local_state makes intent explicit without breaking any existing reader/writer.
  • Keeps the change minimal so later PRs can revert or refine without ripping code.

Test plan

  • 8 new unit tests in tests/unit/test_state_shared_and_local.py cover empty defaults, per-state isolation, roundtrip, idempotence, inter-stage disjointness, and shared/metadata separation — all passing locally.
  • Full pytest tests/ suite: 1061 passed, 18 skipped (no regressions).
  • ruff check and ruff format --check on touched files — clean.

🤖 Generated with Claude Code

Two additive state interfaces for cross-stage and per-stage data:

- `PipelineState.shared: Dict[str, Any]` — per-run bucket any stage
  can read/write for cross-stage communication. Resets each run.
- `Stage.local_state(state)` — returns `state.metadata[self.name]`
  (auto-created), giving each stage a private scratchpad without
  key-prefixing.

Both are purely additive: no shipped stage uses them yet. The 16
existing stages continue to operate unchanged; downstream PRs in this
cycle (resolve_model_config, unified llm_client, s06_api migration,
memory stages) will be the first consumers.

Tests: 8 new unit tests cover empty defaults, per-state isolation,
roundtrip, idempotence, inter-stage disjointness, and bucket
separation from legacy `metadata`.
@CocoRoF CocoRoF merged commit 143214a into main Apr 21, 2026
7 checks passed
@CocoRoF CocoRoF deleted the feat/pipeline-state-shared-and-local branch April 21, 2026 09:19
@CocoRoF CocoRoF mentioned this pull request Apr 21, 2026
3 tasks
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