@@ -115,8 +115,8 @@ impl RootedDir {
115115 self . open_file_with ( relative, |_| { } )
116116 }
117117
118- /// Pin one ancestor chain for a bounded group of sibling reads. The caller
119- /// must finish the batch and revalidate its returned evidence at publication .
118+ /// Pin one ancestor chain for a bounded group of sibling reads. Finishing
119+ /// releases the pins; the returned IDs are observations, not lifetime proof .
120120 pub ( crate ) fn batch ( & self , parent : & Path ) -> io:: Result < RootedBatch < ' _ > > {
121121 let names = if parent. as_os_str ( ) . is_empty ( ) {
122122 Vec :: new ( )
@@ -158,7 +158,7 @@ impl RootedDir {
158158 let resolved = final_path_of ( guards. last ( ) . unwrap_or ( & self . directory ) ) ?;
159159 Ok ( RootedBatch {
160160 root : self ,
161- evidence : ParentEvidence {
161+ observation : ParentObservation {
162162 path : parent. into ( ) ,
163163 identities,
164164 } ,
@@ -243,14 +243,17 @@ impl RootedDir {
243243 }
244244}
245245
246- /// Stores identities, not open handles: completed batches must not keep
247- /// checkout directories pinned while later batches or checkpoints run.
248- pub ( crate ) struct ParentEvidence {
246+ /// Native IDs observed during a rooted batch, not an ancestor lifetime pin.
247+ ///
248+ /// IDs may be reused after handles close. A later comparison can reject an
249+ /// observed substitution, but cannot prove continuity through publication.
250+ /// Read containment relies on live rooted handles, not these retained IDs.
251+ pub ( crate ) struct ParentObservation {
249252 path : PathBuf ,
250253 identities : Vec < crate :: managed:: FileIdentity > ,
251254}
252255
253- impl ParentEvidence {
256+ impl ParentObservation {
254257 pub ( crate ) fn verification_memory_bytes ( & self , root : & RootedDir ) -> u64 {
255258 root. batch_memory_bytes ( & self . path )
256259 }
@@ -259,9 +262,9 @@ impl ParentEvidence {
259262 RootedDir :: batch_handles ( & self . path )
260263 }
261264
262- pub ( crate ) fn verify ( & self , root : & RootedDir ) -> io:: Result < ( ) > {
265+ pub ( crate ) fn check_current_ids ( & self , root : & RootedDir ) -> io:: Result < ( ) > {
263266 let current = root. batch ( & self . path ) ?;
264- if current. evidence . identities != self . identities {
267+ if current. observation . identities != self . identities {
265268 return Err ( Error :: new (
266269 ErrorKind :: InvalidInput ,
267270 "batch ancestor identity changed" ,
@@ -279,7 +282,7 @@ impl ParentEvidence {
279282
280283pub ( crate ) struct RootedBatch < ' a > {
281284 root : & ' a RootedDir ,
282- evidence : ParentEvidence ,
285+ observation : ParentObservation ,
283286 guards : Vec < File > ,
284287 #[ cfg( windows) ]
285288 path : PathBuf ,
@@ -301,7 +304,7 @@ impl RootedBatch<'_> {
301304 }
302305
303306 pub ( crate ) fn open_observed ( & self , relative : & Path ) -> io:: Result < OpenedFile > {
304- if relative. parent ( ) != Some ( self . evidence . path . as_path ( ) ) {
307+ if relative. parent ( ) != Some ( self . observation . path . as_path ( ) ) {
305308 return Err ( Error :: new (
306309 ErrorKind :: InvalidInput ,
307310 "file is not a batch sibling" ,
@@ -347,16 +350,16 @@ impl RootedBatch<'_> {
347350 }
348351 }
349352
350- pub ( crate ) fn finish ( self ) -> io:: Result < ParentEvidence > {
353+ pub ( crate ) fn finish ( self ) -> io:: Result < ParentObservation > {
351354 #[ cfg( windows) ]
352- debug_assert_eq ! ( self . guards. len( ) , self . evidence . identities. len( ) ) ;
355+ debug_assert_eq ! ( self . guards. len( ) , self . observation . identities. len( ) ) ;
353356 #[ cfg( unix) ]
354357 debug_assert_eq ! (
355358 self . guards. len( ) ,
356- usize :: from( !self . evidence . identities. is_empty( ) )
359+ usize :: from( !self . observation . identities. is_empty( ) )
357360 ) ;
358- self . evidence . verify ( self . root ) ?;
359- Ok ( self . evidence )
361+ self . observation . check_current_ids ( self . root ) ?;
362+ Ok ( self . observation )
360363 }
361364}
362365
0 commit comments