-
Notifications
You must be signed in to change notification settings - Fork 4
Replace flow validation step-index sentinels with named API #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| """Named step-index sentinels for flow-level validation records.""" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Adding Useful? React with 👍 / 👎. |
||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from collections.abc import Sized | ||
| from typing import Protocol | ||
|
|
||
|
|
||
| class _FlowLike(Protocol): | ||
| steps: Sized | ||
|
Comment on lines
+9
to
+10
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blocker — fails mypy (12 errors in CI). The Fix — make the member read-only so it's covariant: class _FlowLike(Protocol):
@property
def steps(self) -> Sized: ...Verified: this clears all 12 errors ( Generated by Claude Code |
||
|
|
||
|
|
||
| # Synthetic record emitted when flow input validation fails before step 0. | ||
| FLOW_INPUT_STEP_INDEX = -1 | ||
|
|
||
|
|
||
| def flow_output_step_index(flow: _FlowLike) -> int: | ||
| """Return the synthetic index used after the final flow step.""" | ||
| return len(flow.steps) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocker — documentation governance.
Adding
chainweaver/step_index.pyis a module-add. AGENTS.md requires add/remove/rename-module changes to update the repo-map tree anddocs/agent-context/architecture.mdin the same PR. Neither was updated (Codex flagged this too).Please add a repo-map line, e.g.:
and a matching module-boundary entry in
architecture.md. TheStepRecordtable update on L283 is correct — this is only about the repo map + architecture doc.Generated by Claude Code