-
Notifications
You must be signed in to change notification settings - Fork 0
feat(076): implement replay engine and parameter tuning #225
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
Merged
Conversation
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
Defines the replay/tune feature (E02 Phase 6): - Parameter tuning with positional replay of subsequent entries - Revert-to-here (permanent truncation) and revert-this (soft-delete + replay) - Cross-snapshot replay across snapshot boundaries - Tool version mismatch detection and halt - Typed parameter editing affordances in Log Panel - Artifact versioning on re-run Dependencies: #71 (Log Recording), #74 (Snapshots), #72 (Log Panel) https://claude.ai/code/session_01H84e8Tca6x9htU9hDaNS5N
Links to specs/076-replay-tune/spec.md https://claude.ai/code/session_01H84e8Tca6x9htU9hDaNS5N
Phase 0-2 artifacts: - plan.md: technical context, constitution check, project structure - research.md: 10 key design decisions with rationale - data-model.md: new types (ReplayPlan, ReplayResult, etc.) - contracts/replay-engine.ts: Replay Engine interface contract - quickstart.md: implementation order and verification steps - media/planning-post.md: blog post draft - media/linkedin-planning.md: LinkedIn summary https://claude.ai/code/session_01H84e8Tca6x9htU9hDaNS5N
82 tasks across 8 phases: - Phase 1: Setup (6 tasks) - Phase 2: Foundation/Replay Engine (11 tasks) - Phase 3: US1 Tune Parameter - MVP (21 tasks) - Phase 4: US2 Revert To (8 tasks) - Phase 5: US3 Revert This (11 tasks) - Phase 6: US4 Cross-Snapshot (7 tasks) - Phase 7: US5 Version Mismatch (6 tasks) - Phase 8: Polish, evidence, media, PR (12 tasks) https://claude.ai/code/session_01H84e8Tca6x9htU9hDaNS5N
…ations Add full replay and parameter tuning capability (Feature 076): Backend (session-state): - ReplayEngine: thin orchestrator with serializable JSON plans, DI callbacks for tool execution (designed for future Python migration) - Parameter validation: float, integer, duration, enum, boolean, string - LogService: tuneEntry, revertTo, revertThis, restoreEntry methods - Timeline: includeDeleted option for soft-delete support - Types: ReplayPlan, ReplayEntry, TuneTarget, ReplayResult, and more UI (shared/components): - ParameterEditor: inline editing with type-specific controls and validation - ReplayProgress: progress bar with phases and cancel button - LogEntry: deleted/tuned badges, tunable parameter click, restore button - Strings: i18n-ready replay and tuning messages VS Code integration: - logPanelView: tune/revert/restore message handlers with replay coordination - logPanel.tsx: replay state management and message forwarding Tests: 56 new tests (replayEngine, parameterValidation, tuneEntry, revertTo, revertThis) — all passing. https://claude.ai/code/session_01H84e8Tca6x9htU9hDaNS5N
- Add shipped blog post and LinkedIn summary - Add test summary evidence (56 tests, all passing) - Mark Phases 1-8 tasks complete in tasks.md https://claude.ai/code/session_01H84e8Tca6x9htU9hDaNS5N
# Conflicts: # BACKLOG.md # CLAUDE.md
🚀 Preview DeploymentsWeb Shell (Standalone App)Use this for Playwright testing and demos - runs outside Storybook. Storybook (Component Library)Browse all components, stories, and documentation. All Links
|
- Add curly braces to all single-line if-return statements (curly rule) - Use explicit comparisons for strict-boolean-expressions: entry.deleted === true, entry.tune != null https://claude.ai/code/session_01H84e8Tca6x9htU9hDaNS5N
- Fix eqeqeq: entry.tune != null → entry.tune !== null in logPanelView.ts - Update logService.test.ts stub tests: correct method signatures and error messages now that tuneEntry/revertTo/revertThis are implemented (was expecting "not implemented", now correctly expects "not available" when replay deps are missing) https://claude.ai/code/session_01H84e8Tca6x9htU9hDaNS5N
The main session-state index.ts was missing re-exports for all Phase 076 types (ReplayResult, ReplayEngine, etc.) and functions (createReplayEngine, validateParameter, isValidIsoDuration). This caused TS2459 in logPanelView.ts which imports ReplayResult. https://claude.ai/code/session_01H84e8Tca6x9htU9hDaNS5N
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
Implement replay and parameter tuning capabilities for the Log Service, enabling analysts to edit parameters on past tool executions and automatically replay all subsequent operations with the new values. This feature adds a Replay Engine module, parameter validation utilities, and extends the Log Service with tuning, revert, and restore operations.
Key Changes
Core Replay Infrastructure
services/session-state/src/log/replayEngine.ts): Pure function module that orchestrates sequential tool re-invocation via dependency-injected callbacks. Builds replay plans from timeline analysis, handles version checking, and manages execution with cancellation support.services/session-state/src/log/parameterValidation.ts): Type-specific validation for float, integer, duration, enum, boolean, and string parameters with constraint checking (min/max, patterns, allowed values).Type System Extensions
LogEntryinterface with optionaldeletedfield for soft-delete trackingReplayPlan,ReplayEntry,TuneTarget,ReplayResult,ReplayProgress,ArtifactVersion,ReplayHaltReasonParameterTypeInfoandParameterValuetypes for parameter metadataLog Service Methods
tuneEntry(): Edit a parameter on a past entry and cascade replay all subsequent operationsrevertTo(): Permanently truncate timeline at a specified entryrevertThis(): Soft-delete an entry and replay all subsequent operationsrestoreEntry(): Restore a previously soft-deleted entry and replayLogServiceDepswith optional replay dependencies:executeTool,loadSnapshot,resolveToolVersion,writeGeoJsonUI Components
shared/components/src/LogPanel/ParameterEditor.tsx): Inline parameter editing component with type-specific controls (number inputs, duration fields, enum dropdowns, boolean toggles, text inputs). Supports read-only display for non-tunable parameters.shared/components/src/LogPanel/ReplayProgress.tsx): Progress indicator showing replay phase, entry count, current tool, and cancel button.VS Code Extension Integration
logPanelView.tswith Phase 6 message handlers for tune, revert, restore, and cancel operationslogPanel.tsx) to forward replay progress and result messagesdeletedandtuneAnnotationfields to timeline entry serializationTimeline Assembly
assembleTimeline()withincludeDeletedoption to optionally include soft-deleted entries in timeline reconstructionTesting
replayEngine.test.ts): plan construction, entry filtering, parameter application, version checking, execution sequencing, cancellationparameterValidation.test.ts): all type validators with boundary conditionstuneEntry.test.ts,revertTo.test.ts,revertThis.test.ts): integration with replay engine and state managementDocumentation
specs/076-replay-tune/spec.md): user scenarios, acceptance criteria, design decisionsImplementation Details
deleted: trueare skipped during replay but preserved in provenance for audit trailsParameterValue) and rawhttps://claude.ai/code/session_01H84e8Tca6x9htU9hDaNS5N