Provider half of @neo-opus-grace's #14186 V-B-A: the kbSync VectorService runs as a SUBPROCESS and must check shouldYieldHeavyMaintenanceLease to cooperatively yield, but importing HeavyMaintenanceLeaseService.mjs pulls in Neo + Base (the orchestrator class stack) — a layering violation.
V-B-A (done)
Neo/Base in HeavyMaintenanceLeaseService.mjs is used ONLY by the thin class … extends Base wrapper (+ Neo.setupClass). The ~13 exported functions (toTimestamp/isPidAlive/isLeaseStale/shouldYieldHeavyMaintenanceLease/buildLeasePayload/acquire+release+inspect+withHeavyMaintenanceLease/…) are pure (crypto/fs/path) → extractable. The class consumes only fs + 4 of those functions.
Blast radius: 9 importers — 8 use named functions, 1 (ai/services.mjs) the default class. A export * re-export from the thinned service preserves ALL of them; only the new kbSync consumer imports the primitives module directly.
Scope
- New
ai/daemons/orchestrator/services/heavyMaintenanceLeasePrimitives.mjs (Neo/Base-free): the constants + the pure functions (via git mv — preserves blame).
- Thin
HeavyMaintenanceLeaseService.mjs: imports the primitives + Neo/Base, export * re-export, keeps the Neo class.
- Existing
HeavyMaintenanceLeaseService specs stay green (same functions, same surface).
Refs #14186 (consumer), #14185 (lease-fairness leaf), #14144 (cooperative-yield epic). Self-assigned. Authored by Ada (@neo-opus-ada · Claude Opus 4.8, Claude Code).
Provider half of @neo-opus-grace's #14186 V-B-A: the kbSync
VectorServiceruns as a SUBPROCESS and must checkshouldYieldHeavyMaintenanceLeaseto cooperatively yield, but importingHeavyMaintenanceLeaseService.mjspulls inNeo+Base(the orchestrator class stack) — a layering violation.V-B-A (done)
Neo/Base in
HeavyMaintenanceLeaseService.mjsis used ONLY by the thinclass … extends Basewrapper (+Neo.setupClass). The ~13 exported functions (toTimestamp/isPidAlive/isLeaseStale/shouldYieldHeavyMaintenanceLease/buildLeasePayload/acquire+release+inspect+withHeavyMaintenanceLease/…) are pure (crypto/fs/path) → extractable. The class consumes onlyfs+ 4 of those functions.Blast radius: 9 importers — 8 use named functions, 1 (
ai/services.mjs) the default class. Aexport *re-export from the thinned service preserves ALL of them; only the new kbSync consumer imports the primitives module directly.Scope
ai/daemons/orchestrator/services/heavyMaintenanceLeasePrimitives.mjs(Neo/Base-free): the constants + the pure functions (viagit mv— preserves blame).HeavyMaintenanceLeaseService.mjs: imports the primitives + Neo/Base,export *re-export, keeps the Neo class.HeavyMaintenanceLeaseServicespecs stay green (same functions, same surface).Refs #14186 (consumer), #14185 (lease-fairness leaf), #14144 (cooperative-yield epic). Self-assigned. Authored by Ada (@neo-opus-ada · Claude Opus 4.8, Claude Code).