-
Notifications
You must be signed in to change notification settings - Fork 0
feat(core,cli): time-series checkpoint persistence with delta computation #46
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
- Add Time service with Clock capture pattern for testable timestamps - Add ProcessInfo service for Effect-first env/cwd access - Time.Default captures Clock once at construction to prevent leaking - Export service helpers (nowMillis, now, nowUtc, checkpointId, formatCheckpointId) - Schema.decodeUnknownSync pattern for DateTime.Utc creation without casting Amp-Thread-ID: https://ampcode.com/threads/T-a15b90b3-d708-46f1-a20d-188db13bc420 Co-authored-by: Amp <amp@ampcode.com>
- Replace direct Clock usage with Time service in context-writer and thread-manager - Replace process.cwd() with ProcessInfo.cwd in thread command - Establish ThreadLayer pattern combining NodeContext, ProcessInfo, Time, Clock - Update CLI entry point with AppLayer providing all required services - Fix package-meta error handling to use Effect-native string failures - Update thread tests to use proper layer construction with Clock provision Amp-Thread-ID: https://ampcode.com/threads/T-a15b90b3-d708-46f1-a20d-188db13bc420 Co-authored-by: Amp <amp@ampcode.com>
- Add mock-filesystem.ts with makeMockFileSystem, MockPathLayer, MockProcessInfoLayer - Add helpers.ts with readJson utility for schema-validated test reads - Refactor context-writer tests to use new test helper infrastructure - Refactor thread-manager tests with makeThreadTestContext pattern - Simplify RuleRunner tests using helper utilities - MockProcessInfoLayer reads actual process.env for dynamic test control Amp-Thread-ID: https://ampcode.com/threads/T-a15b90b3-d708-46f1-a20d-188db13bc420 Co-authored-by: Amp <amp@ampcode.com>
- Add checkpoint-manager.ts implementing time-series audit snapshots - Add CheckpointSummary, CheckpointMetadata, CheckpointManifest schemas - Add AuditCheckpoint schema for individual checkpoint files - Implement generateCheckpointId, computeDelta, createCheckpoint, readCheckpoint - Implement manifest management (readManifest, writeManifest, listCheckpoints) - Export RuleKindSchema for checkpoint validation - Update AmpContextIndex schema with checkpoint navigation fields - Update tsconfig with exactOptionalPropertyTypes workaround comment Amp-Thread-ID: https://ampcode.com/threads/T-a15b90b3-d708-46f1-a20d-188db13bc420 Co-authored-by: Amp <amp@ampcode.com>
- Add checkpoints.ts with list, show, latest, diff subcommands - Implement checkpoint navigation UI with tables and formatted output - Add delta visualization showing progress trends - Support JSON output for programmatic access - Integrate with existing ThreadLayer for service provision Amp-Thread-ID: https://ampcode.com/threads/T-a15b90b3-d708-46f1-a20d-188db13bc420 Co-authored-by: Amp <amp@ampcode.com>
- Update pr3-json-checkpoints.md with actual implementation details - Add Time and ProcessInfo to vscode sortImports ignore list Amp-Thread-ID: https://ampcode.com/threads/T-a15b90b3-d708-46f1-a20d-188db13bc420 Co-authored-by: Amp <amp@ampcode.com>
Add detailed plan for automating @SInCE tag management in TSDoc comments: - Convention: Use @SInCE NEXT placeholder for new exports - Automation: Script replaces NEXT with actual versions during changeset bumps - Validation: ESLint rule + CI checks enforce tag presence - Integration with existing Changesets workflow Amp-Thread-ID: https://ampcode.com/threads/T-a15b90b3-d708-46f1-a20d-188db13bc420 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-ba142799-56ed-4e1f-bbf1-de0184c11957 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-ba142799-56ed-4e1f-bbf1-de0184c11957 Co-authored-by: Amp <amp@ampcode.com>
Generated detailed Amp review covering: - Architecture and implementation quality analysis - File-by-file code review with strengths and observations - Test coverage assessment - Security and performance considerations - Pre-merge checklist verification - Future enhancement suggestions All checks passing, ready for merge. Amp-Thread-ID: https://ampcode.com/threads/T-f8c50070-3fad-49b9-8a26-c7ddb08fd6f3 Co-authored-by: Amp <amp@ampcode.com>
15 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
amp:audit
Audit context and structured violation output
changeset:next-minor
Changes planned for next minor version
effect-ts
Effect-TS patterns and usage
migration
Migration tooling and patterns
pkg:cli
Issues related to @effect-migrate/cli package
pkg:core
Issues related to @effect-migrate/core package
pr:size:large
Large PR (> 500 lines)
priority:high
High priority
services
Service layers and dependency injection
type:docs
Documentation improvements
type:feature
New feature or request
type:refactor
Code refactoring
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.
What
Time-Series Checkpoints: Implement JSON checkpoint system for tracking audit history with automatic thread linking, delta computation, and O(1) access to latest audit via symlink.
New Services: Add Time and ProcessInfo services for testable date/time and environment variable access.
Why
Enable migration progress tracking by preserving audit snapshots instead of overwriting. Each checkpoint:
AMP_CURRENT_THREAD_IDScope
Packages affected:
@effect-migrate/core- Checkpoint manager, Time/ProcessInfo services, checkpoint schemas@effect-migrate/cli- Checkpoints command for history navigationChangeset
Changeset summary:
Testing
All checks pass: ✅
New tests added:
packages/core/test/amp/checkpoint-manager.test.ts(24 tests) - ID generation, manifest management, delta computationpackages/core/test/services/Time.test.ts(5 tests) - Time service layer validationpackages/core/test/services/ProcessInfo.test.ts(5 tests) - Environment variable accesspackages/cli/test/commands/checkpoints.test.ts(9 tests) - CLI command validationManual testing verified:
list,latest,show,diffCheckpoint Structure
Schema Changes
New schemas in
@effect-migrate/core/src/schema/amp.ts:AuditCheckpoint- Full audit snapshot with checkpointIdCheckpointMetadata- Manifest entry with delta and thread infoCheckpointManifest- Complete history indexCheckpointSummary- Navigation summary for index.jsonUpdated schemas:
AmpContextIndex- AddedlatestCheckpointandcheckpointsfieldsCLI Commands
Key Features
Automatic Thread Linking:
AMP_CURRENT_THREAD_IDenvironment variableDelta Computation:
Efficient Storage:
Test Infrastructure:
Checklist
Agent Context
Implementation approach:
Time/ProcessInfo services:
Checkpoint manager:
CLI integration:
--jsonflagTest infrastructure:
Amp Threads:
Related docs:
Migration Impact
For external consumers: None (pre-1.0, no published versions)
For internal development:
.amp/effect-migrate/audit.jsonpreserved via symlinkCommits
7 commits organized in 2 phases: