@@ -46,7 +46,7 @@ import { realpath } from "node:fs/promises";
4646import { basename , isAbsolute , relative , resolve } from "node:path" ;
4747import { DurableContext } from "@executablemd/durable-streams" ;
4848import { lazily , locatorFingerprint , type AmbientRepository } from "@executablemd/git/deno" ;
49- import { useObservationLease } from "./leases.ts" ;
49+ import { useObservationLock } from "./leases.ts" ;
5050import { currentCoroutine } from "./local.ts" ;
5151import {
5252 parseReplPlacementRecord ,
@@ -130,7 +130,7 @@ export interface ReplObservationEntry {
130130 /** The native repository work this entry asks for, credential-free. */
131131 readonly operations : DenoRepositoryOperations ;
132132 prepare ?( path : string ) : Operation < void > ;
133- ownObservation ? ( target : ReplGitCheckout ) : Operation < void > ;
133+ ownObservation ( target : ReplGitCheckout ) : Operation < void > ;
134134 /** Hold a managed slot for the entry, single-flight per root and slot. */
135135 holdSlot ( root : string , kind : SlotKind , path : string , subject : string ) : Operation < void > ;
136136 /** Run live native Git for one shared Git directory in order within this entry. */
@@ -440,9 +440,6 @@ function* route(
440440function * own ( entry : ReplObservationEntry , target : ReplGitCheckout ) : Operation < void > {
441441 const registration = target . registration ;
442442 if ( registration . placement . kind === "observation-worktree" ) {
443- if ( entry . ownObservation === undefined ) {
444- throw observationPlacementRefusal ( ) ;
445- }
446443 yield * entry . ownObservation ( target ) ;
447444 return ;
448445 }
@@ -586,16 +583,16 @@ const observationCoordinator: LiveDurableOperationCoordinator = {
586583 } ,
587584} ;
588585
589- /** Entry-private routing for the one host-selected observation checkout. */
590- export function * useObservationWorktrees ( options : {
586+ /** Validate and register one host-selected checkout for Git reads . */
587+ export function * useObservationWorktree ( options : {
591588 readonly path : string | undefined ;
592589 readonly cwd : string ;
593590 readonly operations : DenoRepositoryOperations ;
594591 ambient ( ) : Operation < AmbientRepository | undefined > ;
595592 serialize < T > ( key : string , work : ( ) => Operation < T > ) : Operation < T > ;
596593} ) : Operation < {
597594 prepare ( path : string ) : Operation < void > ;
598- guard ( path : string ) : Operation < void > ;
595+ validateObservationTarget ( path : string ) : Operation < void > ;
599596 own ( target : ReplGitCheckout ) : Operation < void > ;
600597 checkouts ( ) : readonly ReplGitCheckout [ ] ;
601598} > {
@@ -615,7 +612,7 @@ export function* useObservationWorktrees(options: {
615612 const key = common + "\0" + checkout ;
616613 let acquire = holds . get ( key ) ;
617614 if ( acquire === undefined ) {
618- acquire = lazily ( owner , ( ) => useObservationLease ( common , checkout ) ) ;
615+ acquire = lazily ( owner , ( ) => useObservationLock ( common , checkout ) ) ;
619616 holds . set ( key , acquire ) ;
620617 }
621618 return acquire ( ) ;
@@ -785,7 +782,7 @@ export function* useObservationWorktrees(options: {
785782 prepare,
786783 own,
787784 checkouts : ( ) => routes ,
788- * guard ( path ) {
785+ * validateObservationTarget ( path ) {
789786 yield * prepare ( path ) ;
790787 const target = routes . find (
791788 ( route ) =>
0 commit comments