feat(ts): scenario revision flow — refine with feedback (AC-441)#542
Merged
jayscambler merged 2 commits intomainfrom Mar 27, 2026
Merged
feat(ts): scenario revision flow — refine with feedback (AC-441)#542jayscambler merged 2 commits intomainfrom
jayscambler merged 2 commits intomainfrom
Conversation
ccfd62d to
ff52687
Compare
…f starting over (AC-441) New module: ts/src/scenarios/scenario-revision.ts Spec-level revision (reviseSpec): - Takes current spec + user feedback + LLM provider - Produces updated spec via LLM designer - Preserves original on failure (changesApplied: false + error) - Works for all families (agent_task, simulation, workflow, etc.) Output-level revision (reviseAgentTaskOutput): - Builds revision prompts from judge feedback (ported from Python) - Highlights weak dimensions below threshold - Includes task-specific revision instructions when available Integration: - MCP tool: revise_scenario — accessible to agents and external tooling - Exported from scenarios/index.ts Tests: 10 new (1300 total passing, lint clean) - buildRevisionPrompt: spec context, family context, judge feedback - reviseSpec: successful revision, LLM failure recovery, multi-family - reviseAgentTaskOutput: judge feedback, revision instructions, weak dims - RevisionResult shape validation Linear: AC-441
ff52687 to
614b40d
Compare
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.
Summary
Adds scenario revision flow to TypeScript — users can refine created scenarios with feedback instead of starting over from scratch.
Problem
Python has
agent_task_revision.pyfor iterative spec refinement. TypeScript had nothing — once a scenario was created, the only option was delete and retry. Scenario creation is iterative; the first attempt rarely matches what the user wants.What's new
ts/src/scenarios/scenario-revision.ts— two levels of revision:1. Spec revision (
reviseSpec)Takes current spec + user feedback → LLM produces updated spec.
2. Output revision (
reviseAgentTaskOutput)Builds revision prompts from judge feedback for the ImprovementLoop.
build_revision_prompt()MCP integration
New
revise_scenariotool — agents and external tools can trigger revision:{ "currentSpec": {...}, "feedback": "Add error handling", "family": "simulation" }Tests
10 new tests covering:
1300 total tests pass, lint clean.
Linear: AC-441