Skip to content

feat(transition): bounded revise transitions with auto feedback injection#87

Merged
alxsuv merged 2 commits into
mainfrom
feat/73-bounded-revise-and-feedback-injection
Jun 28, 2026
Merged

feat(transition): bounded revise transitions with auto feedback injection#87
alxsuv merged 2 commits into
mainfrom
feat/73-bounded-revise-and-feedback-injection

Conversation

@alxsuv

@alxsuv alxsuv commented Jun 28, 2026

Copy link
Copy Markdown
Member

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.

alxsuv added 2 commits June 29, 2026 01:25
…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>
@alxsuv alxsuv merged commit 33a6b0c into main Jun 28, 2026
7 checks passed
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