fix(contexts): stabilize FileManifest identity and timestamps - #45
Merged
Conversation
Deploying shepherd-agents-docs with
|
| Latest commit: |
b05b733
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1db1ea62.shepherd-agents-docs.pages.dev |
| Branch Preview URL: | https://fix-file-manifest-identity.shepherd-agents-docs.pages.dev |
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
FileManifest.created_atas a timezone-aware UTC timestamp.FileManifestequality and hashing so identical snapshots have stable identity.Motivation / Context
A manifest capture timestamp is provenance metadata, not part of the identity of the captured file snapshot. Including it in equality and hashing makes otherwise identical manifests compare unequal merely because they were captured at different times, while a naive timestamp also leaves timezone interpretation ambiguous.
Delta Breakdown
created_atnow usesdatetime.now(timezone.utc)and is markedcompare=False, hash=False. Reviewers should verify that capture time remains serialized and inspectable while no longer affecting snapshot identity.Entry Point
FileManifestinsimple_workspace/manifest.py→ equality/hash regression tests intest_simple_workspace_content_hash.py→ Unreleased changelog entry.The affected API surface is construction, comparison, and hashing of
FileManifestinstances; serialization fields remain present.Review Guide
The key judgment is whether
created_atshould be treated as metadata rather than snapshot identity. The principal compatibility change is that manifests differing only by capture time now compare equal and produce the same hash. No architecture or durable-runtime changes are included.Validation
uv lock --checkpassed.created_at.make baselinecompleted 27 tests with 5 skips, then hit its existing Linux/macOS mismatch because the test config selects the APFS-onlyclonefilebackend.Documentation / Changelog / Decisions
Updated the Unreleased Fixed section in
shepherd/packages/meta/CHANGELOG.md. No architecture decision record is needed for this contained dataclass semantics fix.Risk / Rollback / Migration
Risk is low but behavioral: code using manifests as dictionary keys or set members will now coalesce snapshots that differ only by capture time. That is the intended identity contract. Rollback is a normal revert; no data migration is required, and serialized manifests retain
created_at.Follow-ups
None.