LearnNewsExamplesServices
Frontmatter
id14186
titlekbSync embedViaShadowSwap: between-batch heavy-lease yield-point (torn-read-free via #14146 resume)
stateClosed
labels
enhancementaiarchitecture
assigneesneo-opus-ada
createdAtJun 27, 2026, 4:22 AM
updatedAtJun 28, 2026, 1:22 AM
githubUrlhttps://github.com/neomjs/neo/issues/14186
authorneo-opus-ada
commentsCount2
parentIssue14144
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[x] 14185 Lease-service: maxActiveHoldMs fairness bound + wire shouldYieldHeavyMaintenanceLease for holders
blocking[]
closedAtJun 28, 2026, 1:22 AM

kbSync embedViaShadowSwap: between-batch heavy-lease yield-point (torn-read-free via #14146 resume)

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

Sub of #14144 (heavy-maintenance lease fairness). The kbSync yield-point side — co-shaped with @neo-opus-ada (lease-service sub provides the trigger).

Scope

In embedViaShadowSwap's batch loop, a cooperative yield-point between batches: on the lease-service yield-trigger (shouldYieldHeavyLease(lease), sub #A), release the heavy-maintenance lease → a starved heavy task (githubWorkflowSync) interleaves → the next periodic sweep re-acquires → resume from the #14146 resume-marker.

Why it's torn-read-free

During the yield the shadow is preserved-not-promoted and the LIVE collection is untouched until the final atomic promote — so githubWorkflowSync can write resources/content/ freely while kbSync is yielded, and kbSync re-reads the (now-updated) corpus on resume. #14146's resume-marker + shadow are exactly what make release-and-resume safe.

Acceptance Criteria

  • embedViaShadowSwap consults the lease-service yield-trigger between batches; on true, releases the lease (preserving the shadow + resume-marker) and exits the cycle.
  • The next sweep re-acquires + resumes from the marker (no progress lost).
  • Test: a simulated yield-trigger between batches → release observed, shadow preserved, resume from marker on the next run.

Depends on sub #A (the lease-service yield-trigger + maxActiveHoldMs). Refs #14144 (epic), #14146, #14161.


🤖 Filed by Ada (@neo-opus-ada) for @neo-opus-grace per the #14144 co-shape (she owns this sub).

tobiu referenced in commit fc3532d - "feat(ai): heavyMaintenance.maxActiveHoldMs lease-fairness leaf (#14185) (#14187) on Jun 27, 2026, 8:52 AM
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
tobiu referenced in commit b703c66 - "feat(ai): wire heavy-maintenance lease cooperative-yield mechanism (#14144) (#14261) on Jun 27, 2026, 8:01 PM
tobiu referenced in commit 07549a7 - "feat(ai): kbSync cooperative heavy-maintenance-lease yield-point (#14186) (#14273) on Jun 28, 2026, 1:22 AM
tobiu closed this issue on Jun 28, 2026, 1:22 AM