feat(transition): bounded revise transitions with auto feedback injection#87
Merged
Merged
Conversation
…tion Add generic per-node retry budgeting and informed-backtrack semantics across all loop-prone triggers, plus automatic surfacing of prior feedback to the node that reruns. Transitions - Introduce BoundedTransition decorator: wraps any pure trigger rule with a namespaced retry budget and an escalation target. Namespaces are scoped per node and per trigger (approval, consensus, score, failure), fixing the prior global counter bug where sequential nodes shared one budget. - Add NoConsensusTransition so parallel-node consensus failure routes to the producer node for revision instead of re-running reviewers on the same input. - Add TransitionTargets / NodeTargets helpers and a requiredEngineVars() capability method on TransitionRule, removing instanceof introspection from the enricher and post-processor sites. - FailureTransition shrinks to a pure trigger; the retry-count increment moves out of evaluate() into TransitionPostProcessor. - DSL: one shared ReviseBuilder chain — `revise "producer" retry N otherwise "escalate"` — usable from onRejection, onNoConsensus, and score arms. The `retry` verb stays a blind self-loop; `revise` is an informed backtrack. - Serialization: recursive "bounded" / "noConsensus" rule types with round-trip tests. Feedback injection - Add FeedbackContextInjector as the first injector in EngineVariablePromptEnricher.DEFAULT. When the context carries a non-blank recommendation, it appends a "### Previous Feedback" section so the rerun node sees why it was sent back. - A backtracking revise arm preserves engine variables; a plain forward goto clears them unless marked withFeedback. Persistence - V3__add_retry_counters.sql adds the JSONB retry-counter column; JDBC repo read/write and WorkflowExecutionService constructor updated to match. Docs & housekeeping - Sync AGENTS.md, README, unified-architecture, core/dsl/server guides, and module READMEs with the new transition model, the 7-injector enricher order, and the corrected MCP split-pipe terminology (Hensu Server as MCP client; tenant client is a bridge to the tenant's own MCP servers, no inbound ports). - Refresh example workflows under working-dir to the revise DSL. Resolve: #73 Signed-off-by: Aleksandr Suvorov <asuvorov@hensu.io>
Resolve: #73 Signed-off-by: Aleksandr Suvorov <asuvorov@hensu.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add generic per-node retry budgeting and informed-backtrack semantics across all loop-prone triggers, plus automatic surfacing of prior feedback to the node that reruns.
Transitions
revise "producer" retry N otherwise "escalate"— usable from onRejection, onNoConsensus, and score arms. Theretryverb stays a blind self-loop;reviseis an informed backtrack.Feedback injection
Persistence
Docs & housekeeping