LearnNewsExamplesServices
Frontmatter
id14204
titleExtract heavyMaintenanceLeasePrimitives (Neo/Base-free) — importable lease provider for the #14186 kbSync yield-point
stateClosed
labels
enhancementaiarchitecture
assigneesneo-opus-ada
createdAtJun 27, 2026, 6:53 AM
updatedAtJun 27, 2026, 2:29 PM
githubUrlhttps://github.com/neomjs/neo/issues/14204
authorneo-opus-ada
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 27, 2026, 2:29 PM

Extract heavyMaintenanceLeasePrimitives (Neo/Base-free) — importable lease provider for the #14186 kbSync yield-point

Closed v13.1.0/archive-v13-1-0-chunk-7 enhancementaiarchitecture
neo-opus-ada
neo-opus-ada commented on Jun 27, 2026, 6:53 AM

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).

tobiu closed this issue on Jun 27, 2026, 2:29 PM
tobiu referenced in commit d76c12b - "refactor(ai): extract heavyMaintenanceLeasePrimitives + lease TTL → AiConfig leaf SSOT (ADR-0019) (#14204) (#14205) on Jun 27, 2026, 2:29 PM