-
Notifications
You must be signed in to change notification settings - Fork 1.8k
refactor(agent-snapshot): improve architecture and api design #1593
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
Conversation
✅ Deploy Preview for agent-tars-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for tarko ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| } | ||
|
|
||
| private ensureSnapshotDirectory(): void { | ||
| if (!fs.existsSync(this.snapshotPath)) { |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
This path depends on a
user-provided value
|
|
||
| private ensureSnapshotDirectory(): void { | ||
| if (!fs.existsSync(this.snapshotPath)) { | ||
| fs.mkdirSync(this.snapshotPath, { recursive: true }); |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
This path depends on a
user-provided value
- Simplify AgentSnapshot class by removing prototype manipulation - Rename test() method from replay() for clearer semantics - Add comprehensive README with examples and best practices - Improve type safety and error handling - Streamline AgentSnapshotRunner CLI interface
c0c6e16 to
d314b1b
Compare
|
Closing this since the regression cost introduced by this reconstruction is too high |
Summary
Refactor
@tarko/agent-snapshotpackage to improve architecture, API design, and maintainability while maintaining backward compatibility.Key Improvements
🏗️ Architecture Simplification
AgentSnapshotclass🎯 API Design Enhancement
replay()totest()for clearer semantics (with backward compatibility)generate()for snapshot creation,test()for verification🔒 Type Safety Improvements
📚 Documentation Overhaul
🧹 Code Quality
AgentSnapshotRunnerCLI interfaceBefore/After Comparison
Before:
After:
Backward Compatibility
replay()method preserved as deprecated alias fortest()Technical Details
snapshot-diffdependencyChecklist