Repository navigation
feat: add new models, contracts, and documentation [OMN-675] #180
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
Changes from all commits
9cf09ff
3e77ae7
0a16f9b
17aefde
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 | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,22 +1,15 @@ | ||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||
| node_type: REDUCER_GENERIC | ||||||||||||||||||||||||||||||||||
| contract_version: {major: 1, minor: 1, patch: 0} | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Contract fingerprint for drift detection (format: v{version}:{12-char-hash}) | ||||||||||||||||||||||||||||||||||
| # The 12-character hash is a truncated SHA256 of the normalized contract content | ||||||||||||||||||||||||||||||||||
| # (excluding the fingerprint field itself to avoid circular dependency) | ||||||||||||||||||||||||||||||||||
| # Regenerate when contract content changes using: poetry run python scripts/compute_contract_fingerprint.py | ||||||||||||||||||||||||||||||||||
| fingerprint: "v1.1.0:6cc216f5b6d9" | ||||||||||||||||||||||||||||||||||
| profile_tags: | ||||||||||||||||||||||||||||||||||
| - runtime | ||||||||||||||||||||||||||||||||||
| - node-graph | ||||||||||||||||||||||||||||||||||
| - lifecycle | ||||||||||||||||||||||||||||||||||
| - infrastructure | ||||||||||||||||||||||||||||||||||
| handlers: | ||||||||||||||||||||||||||||||||||
| required: [] # Reducers are pure state machines - no external I/O handlers | ||||||||||||||||||||||||||||||||||
| optional: [] | ||||||||||||||||||||||||||||||||||
| # Fingerprint: SHA-256 hash of canonical normalized contract content (excluding fingerprint field). | ||||||||||||||||||||||||||||||||||
| # See docs/architecture/CONTRACT_STABILITY_SPEC.md for normalization specification. | ||||||||||||||||||||||||||||||||||
| fingerprint: "1.1.0:a4f95b414375" | ||||||||||||||||||||||||||||||||||
| state_transitions: | ||||||||||||||||||||||||||||||||||
| version: {major: 1, minor: 1, patch: 0} | ||||||||||||||||||||||||||||||||||
| # NOTE: FSM version (1.0.0) intentionally differs from contract_version (1.1.0). | ||||||||||||||||||||||||||||||||||
| # The contract version tracks overall contract changes (handlers, metadata, profile_tags), | ||||||||||||||||||||||||||||||||||
| # while the FSM version only increments when states, transitions, or conditions change. | ||||||||||||||||||||||||||||||||||
| # This separation allows metadata updates without implying FSM structural changes. | ||||||||||||||||||||||||||||||||||
| version: {major: 1, minor: 0, patch: 0} | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+8
to
+12
Contributor
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. 🧩 Analysis chain🏁 Script executed: # First, explore the repository structure
git ls-files | head -30Repository: OmniNode-ai/omnibase_core Length of output: 908 🏁 Script executed: # Look for FSM-related files and the YAML file in question
find . -type f -name "*.yaml" -o -name "*.yml" | grep -E '(node_graph|FSM|runtime)' | head -20Repository: OmniNode-ai/omnibase_core Length of output: 306 🏁 Script executed: # Check if src/omnibase_core exists and explore its structure
find . -type d -name "omnibase_core" -o -name "src" | head -10Repository: OmniNode-ai/omnibase_core Length of output: 94 🏁 Script executed: # Explore src/omnibase_core structure
find src/omnibase_core -type f -name "*.py" | head -30Repository: OmniNode-ai/omnibase_core Length of output: 1440 🏁 Script executed: # Read the node_graph_reducer.yaml file
cat contracts/runtime/node_graph_reducer.yamlRepository: OmniNode-ai/omnibase_core Length of output: 13804 🏁 Script executed: # Search for FSM/state machine runtime implementation
find src/omnibase_core -type f -name "*.py" | xargs grep -l "state_machine\|state_transitions\|FSM" | head -20Repository: OmniNode-ai/omnibase_core Length of output: 1309 🏁 Script executed: # Search for expression evaluator implementation
find src/omnibase_core -type f -name "*.py" | xargs grep -l "expression\|evaluate.*condition\|parse.*expression" | head -20Repository: OmniNode-ai/omnibase_core Length of output: 1323 🏁 Script executed: # Search for action executor
find src/omnibase_core -type f -name "*.py" | xargs grep -l "action_type\|action_executor\|execute.*action" | head -20Repository: OmniNode-ai/omnibase_core Length of output: 1260 🏁 Script executed: # Read FSM execution mixin
cat -n src/omnibase_core/mixins/mixin_fsm_execution.pyRepository: OmniNode-ai/omnibase_core Length of output: 9171 🏁 Script executed: # Read FSM transition condition model
cat -n src/omnibase_core/models/fsm/model_fsm_transition_condition.pyRepository: OmniNode-ai/omnibase_core Length of output: 10487 🏁 Script executed: # Read FSM transition action model
cat -n src/omnibase_core/models/contracts/subcontracts/model_fsmtransitionaction.pyRepository: OmniNode-ai/omnibase_core Length of output: 4025 🏁 Script executed: # Search for expression evaluator
find src/omnibase_core -type f -name "*.py" | xargs grep -l "evaluate.*expression\|parse.*expression\|is_not_empty\|equals" | head -20Repository: OmniNode-ai/omnibase_core Length of output: 360 🏁 Script executed: # Search for FSM executor to find the actual expression evaluation
find src/omnibase_core -type f -name "*fsm*executor*"Repository: OmniNode-ai/omnibase_core Length of output: 108 🏁 Script executed: # Search for action_type enum or constants
find src/omnibase_core -type f -name "*.py" | xargs grep -l "action_type.*enum\|ActionType\|VALID_ACTION_TYPES\|action_type.*event\|action_type.*logging" | head -20Repository: OmniNode-ai/omnibase_core Length of output: 1179 🏁 Script executed: # Search for wildcard transition handling
find src/omnibase_core -type f -name "*.py" | xargs grep -n "from_state.*\*\|wildcard.*transition" | head -20Repository: OmniNode-ai/omnibase_core Length of output: 2413 🏁 Script executed: # Read fsm_executor.py to see expression evaluation
cat -n src/omnibase_core/utils/fsm_executor.py | head -400Repository: OmniNode-ai/omnibase_core Length of output: 16641 🏁 Script executed: # Check comparison operators enum
cat -n src/omnibase_core/enums/enum_comparison_operators.pyRepository: OmniNode-ai/omnibase_core Length of output: 690 🏁 Script executed: # Check condition operator enum
cat -n src/omnibase_core/enums/enum_condition_operator.pyRepository: OmniNode-ai/omnibase_core Length of output: 876 🏁 Script executed: # Continue reading fsm_executor.py from line 400 onwards
cat -n src/omnibase_core/utils/fsm_executor.py | sed -n '400,550p'Repository: OmniNode-ai/omnibase_core Length of output: 7112 🏁 Script executed: # Search for action executor implementation
find src/omnibase_core -type f -name "*.py" | xargs grep -l "execute.*action\|action_executor" | grep -v test | head -10Repository: OmniNode-ai/omnibase_core Length of output: 306 🏁 Script executed: # Read more of fsm_executor to find action execution
cat -n src/omnibase_core/utils/fsm_executor.py | sed -n '549,700p'Repository: OmniNode-ai/omnibase_core Length of output: 4103 🏁 Script executed: # Search for what action types are actually supported
find src/omnibase_core -type f -name "*.py" | xargs grep -n "action_type.*event\|action_type.*logging\|action_type.*alert\|action_type.*data_capture\|action_type.*persistence\|action_type.*cleanup" | head -30Repository: OmniNode-ai/omnibase_core Length of output: 51 🏁 Script executed: # Look for handler resolution and defaults
find src/omnibase_core -type f -name "*.py" | xargs grep -n "ProtocolLogger\|ProtocolEventBus\|handler.*default\|required.*\[\]" | head -30Repository: OmniNode-ai/omnibase_core Length of output: 3724 🏁 Script executed: # Extract the actual expressions from the YAML file
grep -n "expression:" contracts/runtime/node_graph_reducer.yamlRepository: OmniNode-ai/omnibase_core Length of output: 336 🏁 Script executed: # Search for any special handling of is_not_empty or exists operators
find src/omnibase_core -type f -name "*.py" | xargs grep -n "is_not_empty\|exists\|NOT_EXISTS\|EXISTS" | grep -v test | head -20Repository: OmniNode-ai/omnibase_core Length of output: 2235 🏁 Script executed: # Read the exact VALID_OPERATORS whitelist from the condition model
cat -n src/omnibase_core/models/fsm/model_fsm_transition_condition.py | sed -n '99,101p'Repository: OmniNode-ai/omnibase_core Length of output: 226 🏁 Script executed: # Confirm what operators are actually handled in the executor
grep -n "elif operator ==" src/omnibase_core/utils/fsm_executor.py | head -20Repository: OmniNode-ai/omnibase_core Length of output: 388 🏁 Script executed: # Check if there's any override or additional handling for expressions
rg -A5 "is_not_empty|exists" src/omnibase_core/utils/fsm_executor.pyRepository: OmniNode-ai/omnibase_core Length of output: 798 FSM contract expressions will fail validation— The contract declares expressions using unsupported operators that will cause validation/execution failures:
The executor does handle Suggested fixes:
Also verify:
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| state_machine_version: {major: 1, minor: 0, patch: 0} | ||||||||||||||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||
| state_machine_name: node_graph_fsm | ||||||||||||||||||||||||||||||||||
| description: Maintains instantiated node graph state with FSM-driven lifecycle management | ||||||||||||||||||||||||||||||||||
|
|
@@ -304,6 +297,38 @@ state_transitions: | |||||||||||||||||||||||||||||||||
| trigger: undo_rewire | ||||||||||||||||||||||||||||||||||
| version: {major: 1, minor: 0, patch: 0} | ||||||||||||||||||||||||||||||||||
| operation_type: administrative | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # v1.1.0 Required Fields | ||||||||||||||||||||||||||||||||||
| # NOTE: The `handlers` section defines protocol-based dependencies injected via DI container. | ||||||||||||||||||||||||||||||||||
| # This is SEPARATE from FSM action types (event, logging, data_capture, persistence, alert, cleanup) | ||||||||||||||||||||||||||||||||||
| # which are defined in transition actions. | ||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||
| # FSM Action Type Execution: | ||||||||||||||||||||||||||||||||||
| # The runtime's built-in FSM action executor handles all action_type values. Each action_type | ||||||||||||||||||||||||||||||||||
| # maps to a runtime capability: | ||||||||||||||||||||||||||||||||||
| # - event: Publishes events via ProtocolEventBus (optional handler below) | ||||||||||||||||||||||||||||||||||
| # - logging: Logs via ProtocolLogger (optional handler below) | ||||||||||||||||||||||||||||||||||
| # - data_capture: Snapshots state to memory/persistence store | ||||||||||||||||||||||||||||||||||
| # - persistence: Persists FSM state for recovery (when persistence_enabled: true) | ||||||||||||||||||||||||||||||||||
| # - alert: Emits alerts via alerting subsystem (monitoring integration) | ||||||||||||||||||||||||||||||||||
| # - cleanup: Executes resource cleanup procedures | ||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||
| # The `required: []` means no handlers are MANDATORY for this node to function, since the | ||||||||||||||||||||||||||||||||||
| # runtime provides default implementations. Optional handlers allow custom implementations. | ||||||||||||||||||||||||||||||||||
| handlers: | ||||||||||||||||||||||||||||||||||
| required: [] | ||||||||||||||||||||||||||||||||||
| optional: | ||||||||||||||||||||||||||||||||||
| - type: ProtocolLogger | ||||||||||||||||||||||||||||||||||
| version: {major: 1, minor: 0, patch: 0} | ||||||||||||||||||||||||||||||||||
| - type: ProtocolEventBus | ||||||||||||||||||||||||||||||||||
| version: {major: 1, minor: 0, patch: 0} | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
Comment on lines
+301
to
+325
Contributor
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. Make required handlers consistent with the transition action types.
Suggested edit: handlers:
- required: []
- optional:
- - type: ProtocolLogger
- version: {major: 1, minor: 0, patch: 0}
- - type: ProtocolEventBus
- version: {major: 1, minor: 0, patch: 0}
+ required:
+ - type: ProtocolEventBus
+ version: {major: 1, minor: 0, patch: 0}
+ - type: ProtocolLogger
+ version: {major: 1, minor: 0, patch: 0}
+ optional: []📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| profile_tags: | ||||||||||||||||||||||||||||||||||
| - runtime | ||||||||||||||||||||||||||||||||||
| - reducer | ||||||||||||||||||||||||||||||||||
| - node-graph | ||||||||||||||||||||||||||||||||||
| - lifecycle | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||||
| version: {major: 1, minor: 1, patch: 0} | ||||||||||||||||||||||||||||||||||
| author: ONEX Framework Team | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.