TypeAgent Studio (part 5): two-mode Impact Report replay#2561
Closed
TalZaccai wants to merge 1 commit into
Closed
Conversation
…ache) Make the replay's deterministic dispatch model explicit instead of implicitly mixing two paths that never coexist in a real dispatcher config. Level A (core gating): add StudioReplayMode = "nfa-grammar" | "completionBased-cache" and mode? on StudioReplayRequest (default nfa-grammar); gate the live construction-cache consult behind completionBased-cache. Default runs are now grammar-only and A/B-symmetric. Level B (plumbing + UI + test): - Thread mode through the webview run message; parseWebviewMessage validates it (unknown/missing -> nfa-grammar). The host forwards it into replayCorpus; the channel/RPC layers ride on StudioReplayRequest unchanged. - Add a two-state Grammar/Cache toggle to the Impact Report action bar with explanatory tooltips, persisted/restored with the version selection. - Add an injectable resolveConstructionCache seam to CreateStudioRuntimeOptions so the gating is testable without a live cache. - Tests: 3 runtime gating tests over a scaffolded agent (cache skipped in nfa-grammar / when mode omitted, consulted in completionBased-cache); update webview protocol run-message expectations to include mode. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Stacked on #2553 (part 4). Makes the Impact Report replay's deterministic dispatch model explicit instead of implicitly mixing two paths that never coexist in a real dispatcher config.
Two modes, surfaced as a toggle in the report's action bar:
nfa-grammar(default) — both versions match against the compiled grammar only; the construction cache is never consulted, so A and B stay symmetric. The cleanest signal for what a grammar/schema edit changed. Faithful to the dispatcher'snfagrammar system.completionBased-cache(opt-in) — the working-tree side consults the live construction cache before the grammar (the default-dispatcher path). A B-side cache hit reflects what the dispatcher would serve, but the run is asymmetric.Changes
Level A — core gating
StudioReplayMode = "nfa-grammar" | "completionBased-cache"andmode?onStudioReplayRequest(defaultnfa-grammar).completionBased-cache. Default runs are now grammar-only and A/B-symmetric; theconstruction-cachemethod label no longer auto-appears.Level B — plumbing + UI + test
modethrough the webviewrunmessage;parseWebviewMessagevalidates it (unknown/missing →nfa-grammar). The host forwards it intoreplayCorpus; the channel/RPC layers ride onStudioReplayRequestunchanged.resolveConstructionCacheseam toCreateStudioRuntimeOptions(mirrorsreplayResolver/collisionScanner) so the gating is testable without a live cache.Testing
pnpm run build typeagent-core— greenreplay|grammarReplay|constructionCache) — 40/40nfa-grammar(and when mode omitted), consulted incompletionBased-cacheNotes
grammarResolver.ts/constructionCacheResolver.tsunchanged — the gate lives at the runtime call site.validateWildcardMatch/validateEntityWildcardMatch.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com