@ref0/git 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access/private-refs.mjs +0 -2
- package/dist/auth/authorize.mjs +31 -24
- package/dist/auth/bridge.mjs +8 -8
- package/dist/auth/fences.d.mts +0 -1
- package/dist/auth/fences.mjs +1 -1
- package/dist/auth/grants.d.mts +0 -1
- package/dist/auth/grants.mjs +2 -2
- package/dist/auth/host-function.d.mts +1 -7
- package/dist/auth/host-function.mjs +38 -38
- package/dist/auth/identify.d.mts +0 -1
- package/dist/auth/identify.mjs +1 -1
- package/dist/auth/policy.d.mts +7 -4
- package/dist/auth/policy.mjs +13 -10
- package/dist/auth/token-rows.mjs +2 -5
- package/dist/auth/tokens-layer.d.mts +0 -2
- package/dist/auth/tokens-public.d.mts +3 -3
- package/dist/auth/tokens-public.mjs +4 -2
- package/dist/auth/tokens.d.mts +6 -1
- package/dist/auth/tokens.mjs +7 -1
- package/dist/client/client.d.mts +22 -15
- package/dist/client/client.mjs +31 -27
- package/dist/client/git-http.mjs +22 -5
- package/dist/client/local.mjs +1 -1
- package/dist/client/namespace.d.mts +2 -0
- package/dist/client/push-upload.d.mts +1 -0
- package/dist/client/push-upload.mjs +169 -2
- package/dist/client/remote-helper.mjs +2 -4
- package/dist/client/remote.mjs +37 -15
- package/dist/client/run-remote-helper.mjs +4 -4
- package/dist/client/transport.mjs +26 -19
- package/dist/contracts/actors.d.mts +57 -28
- package/dist/contracts/actors.mjs +38 -2
- package/dist/contracts/authorize.d.mts +21 -15
- package/dist/contracts/callers.mjs +40 -0
- package/dist/contracts/calls-spent.d.mts +2 -12
- package/dist/contracts/calls-spent.mjs +4 -5
- package/dist/contracts/client.d.mts +16 -9
- package/dist/contracts/events.d.mts +82 -14
- package/dist/contracts/events.mjs +35 -9
- package/dist/contracts/files.d.mts +42 -42
- package/dist/contracts/forks.d.mts +0 -24
- package/dist/contracts/git-hooks.d.mts +217 -0
- package/dist/contracts/git-hooks.mjs +3 -1
- package/dist/contracts/git.d.mts +13 -3
- package/dist/contracts/grants.d.mts +46 -27
- package/dist/contracts/lfs.d.mts +17 -4
- package/dist/contracts/merges.d.mts +7 -7
- package/dist/contracts/objects.d.mts +38 -4
- package/dist/contracts/opaque.mjs +19 -1
- package/dist/contracts/operations.d.mts +8 -1
- package/dist/contracts/operations.mjs +209 -0
- package/dist/contracts/queue.d.mts +6 -5
- package/dist/contracts/queue.mjs +9 -20
- package/dist/contracts/remote.d.mts +13 -4
- package/dist/contracts/remote.mjs +3 -3
- package/dist/contracts/repos.d.mts +11 -40
- package/dist/contracts/repos.mjs +11 -10
- package/dist/contracts/result.d.mts +28 -11
- package/dist/contracts/result.mjs +32 -2
- package/dist/contracts/rules.d.mts +706 -46
- package/dist/contracts/rules.mjs +81 -2
- package/dist/contracts/server.d.mts +5 -275
- package/dist/contracts/services.d.mts +0 -3
- package/dist/contracts/services.mjs +1 -3
- package/dist/contracts/signin.d.mts +2 -2
- package/dist/contracts/signin.mjs +4 -5
- package/dist/contracts/sync.d.mts +1 -4
- package/dist/contracts/tokens.d.mts +29 -17
- package/dist/contracts/tokens.mjs +14 -3
- package/dist/contracts/topics.d.mts +38 -11
- package/dist/contracts/topics.mjs +8 -2
- package/dist/core/access.d.mts +0 -2
- package/dist/core/access.mjs +15 -4
- package/dist/core/ancestry.mjs +5 -4
- package/dist/core/events/deliver.mjs +19 -1
- package/dist/core/forks.mjs +30 -11
- package/dist/core/hooks/groups.d.mts +0 -1
- package/dist/core/hooks/groups.mjs +8 -9
- package/dist/core/index-job.mjs +23 -1
- package/dist/core/index-lost.d.mts +11 -0
- package/dist/core/index-lost.mjs +55 -0
- package/dist/core/loose-tally.mjs +46 -0
- package/dist/core/objects/commit-writes.mjs +1 -1
- package/dist/core/objects/commits.mjs +10 -9
- package/dist/core/objects/merges.mjs +1 -1
- package/dist/core/objects/reading.mjs +28 -13
- package/dist/core/objects/trees.mjs +1 -1
- package/dist/core/objects/writing.mjs +1 -0
- package/dist/core/parts.d.mts +7 -0
- package/dist/core/promise.mjs +1 -15
- package/dist/core/publish.mjs +9 -5
- package/dist/core/purge.mjs +30 -12
- package/dist/core/push.mjs +39 -16
- package/dist/core/ref-view.mjs +14 -6
- package/dist/core/repack.mjs +54 -27
- package/dist/core/repo-info.mjs +8 -6
- package/dist/core/repos.mjs +1 -0
- package/dist/core/rules/check.mjs +10 -10
- package/dist/core/rules/context.d.mts +3 -1
- package/dist/core/rules/context.mjs +16 -13
- package/dist/core/rules/fetch.mjs +17 -23
- package/dist/core/tokens.mjs +2 -1
- package/dist/core/view.d.mts +10 -1
- package/dist/core/view.mjs +15 -6
- package/dist/effect.d.mts +3 -6
- package/dist/effect.mjs +3 -6
- package/dist/engine/commits.mjs +23 -50
- package/dist/engine/failures.d.mts +1 -2
- package/dist/engine/failures.mjs +1 -3
- package/dist/engine/merge-base-walk.mjs +57 -142
- package/dist/engine/merge-bases.mjs +9 -7
- package/dist/engine/merge.mjs +20 -17
- package/dist/engine/parts.d.mts +1 -0
- package/dist/engine/parts.mjs +1 -1
- package/dist/engine/walk.mjs +15 -11
- package/dist/extend.d.mts +1 -2
- package/dist/extend.mjs +1 -2
- package/dist/http/core-parts.mjs +18 -10
- package/dist/http/handler.mjs +11 -31
- package/dist/http/parts.d.mts +0 -1
- package/dist/index.d.mts +29 -22
- package/dist/index.mjs +5 -2
- package/dist/lfs/base.d.mts +6 -3
- package/dist/lfs/base.mjs +2 -1
- package/dist/lfs/layer.d.mts +4 -3
- package/dist/lfs/layer.mjs +23 -9
- package/dist/lfs/objects.mjs +93 -41
- package/dist/lfs/pointers.mjs +69 -18
- package/dist/lfs/purge.mjs +6 -2
- package/dist/lfs/rows.mjs +24 -7
- package/dist/lfs/service.d.mts +6 -3
- package/dist/lfs/service.mjs +8 -2
- package/dist/lfs/upkeep.mjs +47 -28
- package/dist/lfs/upload-most.mjs +47 -0
- package/dist/lfs/uploaded.mjs +59 -0
- package/dist/protocol/bytes/sha256-hasher.mjs +51 -0
- package/dist/protocol/bytes/streams.mjs +84 -2
- package/dist/protocol/bytes/text.mjs +6 -1
- package/dist/protocol/diff/read.d.mts +1 -0
- package/dist/protocol/diff/read.mjs +5 -2
- package/dist/protocol/objects/commit.d.mts +7 -0
- package/dist/protocol/objects/commit.mjs +5 -1
- package/dist/protocol/objects/fsck.mjs +6 -3
- package/dist/queue/advance.mjs +77 -18
- package/dist/queue/calls.mjs +4 -14
- package/dist/queue/host.d.mts +4 -0
- package/dist/queue/lanes.mjs +1 -1
- package/dist/queue/layer.mjs +4 -2
- package/dist/queue/limits.mjs +18 -2
- package/dist/queue/rows.mjs +10 -1
- package/dist/queue/schedule.mjs +1 -1
- package/dist/queue/search.mjs +3 -4
- package/dist/queue/trim.mjs +2 -2
- package/dist/rest/client-namespace.d.mts +2 -0
- package/dist/rest/client.d.mts +32 -8
- package/dist/rest/client.mjs +308 -382
- package/dist/rest/commits.d.mts +150 -150
- package/dist/rest/files.d.mts +18 -18
- package/dist/rest/forks.d.mts +77 -89
- package/dist/rest/handlers.mjs +2 -1
- package/dist/rest/listen.d.mts +8 -6
- package/dist/rest/listen.mjs +31 -75
- package/dist/rest/me.d.mts +2 -2
- package/dist/rest/merges.d.mts +7 -7
- package/dist/rest/refs.d.mts +27 -27
- package/dist/rest/repos.d.mts +40 -52
- package/dist/rest/tokens.d.mts +12 -12
- package/dist/rest/topics.d.mts +13 -13
- package/dist/rest/trees.d.mts +66 -66
- package/dist/rest/wire.d.mts +20 -2
- package/dist/rest/work.d.mts +39 -39
- package/dist/rest.d.mts +1 -7
- package/dist/rest.mjs +1 -5
- package/dist/server/git-layer.d.mts +10 -2
- package/dist/server/git-layer.mjs +29 -10
- package/dist/server/joined.d.mts +12 -6
- package/dist/server/joined.mjs +3 -2
- package/dist/server/registry.mjs +11 -5
- package/dist/server/server.d.mts +0 -1
- package/dist/server/server.mjs +42 -49
- package/dist/signin/context.d.mts +0 -1
- package/dist/signin/context.mjs +5 -9
- package/dist/storage/clean-up.mjs +3 -1
- package/dist/storage/fsck.mjs +12 -2
- package/dist/storage/graph-rebuild.mjs +262 -0
- package/dist/storage/index-bitmaps.mjs +16 -10
- package/dist/storage/index-build.mjs +160 -24
- package/dist/storage/index-graph.d.mts +1 -0
- package/dist/storage/index-graph.mjs +29 -5
- package/dist/storage/index-layers.d.mts +1 -0
- package/dist/storage/index-layers.mjs +5 -2
- package/dist/storage/index-reach.mjs +7 -5
- package/dist/storage/index-remap.mjs +5 -5
- package/dist/storage/index-visible.mjs +16 -5
- package/dist/storage/lfs-pointers.d.mts +5 -5
- package/dist/storage/lfs-pointers.mjs +37 -11
- package/dist/storage/links.mjs +3 -3
- package/dist/storage/loose.mjs +4 -1
- package/dist/storage/memory-budget.mjs +1 -1
- package/dist/storage/merge-fence.mjs +81 -19
- package/dist/storage/merge-most.mjs +1 -0
- package/dist/storage/merge-row.mjs +16 -4
- package/dist/storage/merge-stream.mjs +9 -6
- package/dist/storage/object-rows.mjs +17 -1
- package/dist/storage/pack-order.d.mts +1 -0
- package/dist/storage/pack-order.mjs +18 -1
- package/dist/storage/pack-receive.mjs +10 -6
- package/dist/storage/packs.mjs +58 -27
- package/dist/storage/prune-walk.mjs +5 -2
- package/dist/storage/prune.mjs +168 -70
- package/dist/storage/ready.d.mts +1 -1
- package/dist/storage/ready.mjs +12 -3
- package/dist/storage/receive-bounds.mjs +3 -2
- package/dist/storage/receive-state.mjs +1 -1
- package/dist/storage/repack-contained.mjs +22 -14
- package/dist/storage/repack.d.mts +1 -1
- package/dist/storage/repack.mjs +3 -2
- package/dist/storage/unpack.mjs +7 -0
- package/dist/storage/visible.mjs +3 -2
- package/dist/storage/walk.d.mts +1 -0
- package/dist/storage/walk.mjs +9 -5
- package/dist/storage/wants.mjs +17 -11
- package/dist/store/call-count.d.mts +31 -3
- package/dist/store/call-count.mjs +51 -20
- package/dist/store/errors.d.mts +7 -1
- package/dist/store/errors.mjs +7 -1
- package/dist/store/job-try.mjs +3 -1
- package/dist/store/records.mjs +26 -5
- package/dist/store/repo-record.mjs +36 -12
- package/dist/store/scopes.mjs +15 -2
- package/dist/sync/bound.d.mts +1 -1
- package/dist/sync/import.mjs +15 -3
- package/dist/sync/layer.d.mts +5 -1
- package/dist/sync/layer.mjs +11 -9
- package/dist/sync/mirror.mjs +1 -1
- package/dist/sync/step.mjs +15 -15
- package/dist/topics/advance.mjs +11 -10
- package/dist/topics/layer.mjs +1 -1
- package/dist/topics/members.mjs +38 -9
- package/package.json +3 -3
- package/dist/engine/merge-base-walk.d.mts +0 -3
- package/dist/server/routes.d.mts +0 -32
- package/dist/server/routes.mjs +0 -69
- package/dist/sync/bridge.d.mts +0 -6
- package/dist/sync/bridge.mjs +0 -29
package/dist/storage/packs.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { fail, gitError } from "../contracts/result.mjs";
|
|
2
2
|
import { PackTransportError } from "../protocol/packs/reader.mjs";
|
|
3
3
|
import { decodeRecord } from "../store/catalogue.mjs";
|
|
4
|
+
import { decodePacks } from "../store/git-store.mjs";
|
|
4
5
|
import { tryUnlessSpent } from "../contracts/calls-spent.mjs";
|
|
5
6
|
import { resultCall } from "../store/errors.mjs";
|
|
6
|
-
import {
|
|
7
|
+
import { decodeStats, repoStats } from "../store/repo-record.mjs";
|
|
7
8
|
import { collections, newChangeId, repoScope, selfKey } from "../store/scopes.mjs";
|
|
8
9
|
import { CallBudget, RequestCalls, callScope, checkedLimits, countInto, countedAs, heldCall, noScope, readScope, requestCount, stepBudget, withBound } from "../store/call-count.mjs";
|
|
9
10
|
import { forkIn, noCall, resultIn } from "../store/crossing.mjs";
|
|
@@ -21,21 +22,22 @@ import { ReachCache, indexReach } from "./index-reach.mjs";
|
|
|
21
22
|
import { indexedVisible, setReachOf } from "./index-visible.mjs";
|
|
22
23
|
import { pointersOfObjects } from "./lfs-pointers.mjs";
|
|
23
24
|
import { PackIndexes, packReader, seedBytes } from "./pack-reads.mjs";
|
|
24
|
-
import { copyRowsPage } from "./object-rows.mjs";
|
|
25
|
+
import { copyRowsPage, noRows } from "./object-rows.mjs";
|
|
25
26
|
import { pushedCommitsPage } from "./pushed-commits.mjs";
|
|
26
27
|
import { segmentTooLarge } from "./links.mjs";
|
|
27
28
|
import { walkWithin } from "./swap-walk.mjs";
|
|
28
29
|
import { receivePack, tooMany } from "./pack-receive.mjs";
|
|
29
|
-
import { mergesAlone, passDue, pruneStep, readPrune } from "./prune.mjs";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
30
|
+
import { mergesAlone, passDue, passScratch, pruneStartedKey, pruneStep, readPrune } from "./prune.mjs";
|
|
31
|
+
import { rebuildStep } from "./graph-rebuild.mjs";
|
|
32
|
+
import { liftedFences, unfenced } from "./merge-fence.mjs";
|
|
33
|
+
import { freshCalls, geometricStep, groupedPacks, membersOf, opensWithin, resumeMerge, streamHeld } from "./merge-stream.mjs";
|
|
32
34
|
import { droppedStep, mergeKey } from "./merge-row.mjs";
|
|
33
35
|
import { parksPass } from "./repack-job.mjs";
|
|
34
36
|
import { sharePacks } from "./quarantine.mjs";
|
|
35
37
|
import { burstOptions, defaultRepack, optionFor, readObjectRows } from "./repack.mjs";
|
|
36
38
|
import { containedPlan, containedWalk, countedMerge } from "./repack-contained.mjs";
|
|
37
39
|
import { refuseBacklog } from "./repack-backlog.mjs";
|
|
38
|
-
import { defaultShallow, readyAnswer, readyStep, untilEnded } from "./ready.mjs";
|
|
40
|
+
import { defaultShallow, readyAnswer, readyBytesOf, readyKey, readyStep, untilEnded } from "./ready.mjs";
|
|
39
41
|
import { defaultPrune, pruneWait, quarantineKey } from "./rows.mjs";
|
|
40
42
|
import { readAnswer, receiveStep, stageReceive } from "./receive-steps.mjs";
|
|
41
43
|
import { memoryOf, openBudget } from "./packs-memory.mjs";
|
|
@@ -136,22 +138,28 @@ const rejoined = (chunks, reader) => {
|
|
|
136
138
|
const stepLost = fail("UNAVAILABLE", "Another try of this receive's step committed first", { hint: "Try the step again" });
|
|
137
139
|
const tooManyToUnpack = (count) => gitError("INVALID_ARGUMENT", `The pack's header counts ${count} objects, past what its push said`, { hint: "Push again" });
|
|
138
140
|
/**
|
|
139
|
-
* A repo's stats, read for an option given as a function: its record, refs, `stats` times
|
|
140
|
-
*
|
|
141
|
+
* A repo's stats, read for an option given as a function: its record, refs, `stats` times, listed
|
|
142
|
+
* packs and ready shallow pack, all at one version, so the bytes are a total some version held.
|
|
143
|
+
* They're read again rather than taken from the step's `Listed`, which a repack may have moved on
|
|
144
|
+
* from before the ready pack's read.
|
|
141
145
|
*/
|
|
142
|
-
const statsOf = /* @__PURE__ */ Effect.fnUntraced(function* (store,
|
|
143
|
-
const
|
|
144
|
-
scope: repoScope(
|
|
146
|
+
const statsOf = /* @__PURE__ */ Effect.fnUntraced(function* (store, repo) {
|
|
147
|
+
const [selfRows = [], refRows = [], packRows = [], timeRows = [], readyRows = []] = (yield* store.read({
|
|
148
|
+
scope: repoScope(repo),
|
|
145
149
|
reads: [
|
|
146
150
|
selfKey,
|
|
147
151
|
{ collection: collections.refs },
|
|
148
|
-
{ collection: collections.
|
|
152
|
+
{ collection: collections.packs },
|
|
153
|
+
{ collection: collections.stats },
|
|
154
|
+
readyKey
|
|
149
155
|
]
|
|
150
|
-
});
|
|
151
|
-
const record = yield* decodeRecord(
|
|
156
|
+
})).results;
|
|
157
|
+
const record = yield* decodeRecord(selfRows[0]);
|
|
152
158
|
if (record === void 0) return yield* fail("NOT_FOUND", "The repo's record is gone");
|
|
153
|
-
const
|
|
154
|
-
|
|
159
|
+
const packs = yield* decodePacks(packRows);
|
|
160
|
+
const times = yield* decodeStats(timeRows);
|
|
161
|
+
const readyBytes = yield* readyBytesOf(readyRows);
|
|
162
|
+
return repoStats(record, refRows.length, packs, times, readyBytes);
|
|
155
163
|
});
|
|
156
164
|
const hasChange = (step) => {
|
|
157
165
|
const { add = [], remove = [], put = [], delete: deleted = [] } = step.change;
|
|
@@ -224,7 +232,10 @@ const receiveRows = /* @__PURE__ */ Effect.fnUntraced(function* (reader, unpack,
|
|
|
224
232
|
});
|
|
225
233
|
const quarantine = {
|
|
226
234
|
id: newChangeId(),
|
|
227
|
-
change: {
|
|
235
|
+
change: {
|
|
236
|
+
put: unpacked.rows,
|
|
237
|
+
rows: unpacked.moved
|
|
238
|
+
},
|
|
228
239
|
bytes: unpacked.bytes,
|
|
229
240
|
objects: unpacked.objects.length,
|
|
230
241
|
lfsPointers: yield* pointersOfObjects(unpacked.objects, pointers)
|
|
@@ -427,7 +438,7 @@ const packs = (options = {}) => {
|
|
|
427
438
|
const stage = Effect.fnUntraced(function* (listed, input) {
|
|
428
439
|
const past = segmentTooLarge(input);
|
|
429
440
|
if (past !== void 0) return yield* Effect.fail(past);
|
|
430
|
-
const { quarantine: prune } = optionsFor(chosen ? yield* statsOf(calls, listed) : void 0);
|
|
441
|
+
const { quarantine: prune } = optionsFor(chosen ? yield* statsOf(calls, listed.repo) : void 0);
|
|
431
442
|
const { boundary = [], needs = [], cutMost, length, atMost } = input;
|
|
432
443
|
return yield* stageReceive({
|
|
433
444
|
store: calls,
|
|
@@ -473,7 +484,7 @@ const packs = (options = {}) => {
|
|
|
473
484
|
};
|
|
474
485
|
}
|
|
475
486
|
};
|
|
476
|
-
const { quarantine: prune } = optionsFor(chosen ? yield* statsOf(calls, listed) : void 0);
|
|
487
|
+
const { quarantine: prune } = optionsFor(chosen ? yield* statsOf(calls, listed.repo) : void 0);
|
|
477
488
|
const { objects, needs } = input;
|
|
478
489
|
const receiving = {
|
|
479
490
|
store: input.store,
|
|
@@ -520,7 +531,7 @@ const packs = (options = {}) => {
|
|
|
520
531
|
*/
|
|
521
532
|
const seeded = (run) => Effect.scoped(Effect.flatMap(Effect.scope, (answered) => Effect.flatMap(Effect.scoped(run(answered)), (done) => done.seed === void 0 ? Effect.succeed(done.answer) : Effect.as(indexes.seed(done.seed), done.answer))));
|
|
522
533
|
const receiveWithin = Effect.fnUntraced(function* (listed, input, memory, visible) {
|
|
523
|
-
const { unpack, quarantine } = optionsFor(chosen ? yield* statsOf(calls, listed) : void 0);
|
|
534
|
+
const { unpack, quarantine } = optionsFor(chosen ? yield* statsOf(calls, listed.repo) : void 0);
|
|
524
535
|
const held = readerOf(listed, memory.reader, void 0, visible);
|
|
525
536
|
if (input.objects === 0) return yield* receiveRows(held, unpack, input, memory.pointers);
|
|
526
537
|
if (unpack === false || input.objects > unpack.maxObjects) return yield* asPack(listed, input, quarantine, memory, visible);
|
|
@@ -691,7 +702,7 @@ const packs = (options = {}) => {
|
|
|
691
702
|
more: true
|
|
692
703
|
};
|
|
693
704
|
return yield* Effect.flatMap(budget.upkeep(), (allotment) => upkeepSteps(listed, input, allotment, own, raw, cleaned)).pipe(Effect.catchIf((error) => error === readBusy, () => Effect.succeed({
|
|
694
|
-
change: {},
|
|
705
|
+
change: { rows: noRows },
|
|
695
706
|
more: false,
|
|
696
707
|
due: at + growWaitMs
|
|
697
708
|
})));
|
|
@@ -714,11 +725,16 @@ const packs = (options = {}) => {
|
|
|
714
725
|
allotment
|
|
715
726
|
};
|
|
716
727
|
const objectRows = yield* readObjectRows(upkeep);
|
|
717
|
-
const
|
|
728
|
+
const prior = yield* readPrune(upkeep);
|
|
729
|
+
const fences = liftedFences(prior.refused, freshCalls(counted?.most));
|
|
730
|
+
const read = {
|
|
731
|
+
...prior,
|
|
732
|
+
refused: fences.refused
|
|
733
|
+
};
|
|
718
734
|
const { repack: merging, prune: pruning } = read.merges;
|
|
719
735
|
const orphan = prune === false || input.deleted === true ? pruning : void 0;
|
|
720
736
|
if (orphan === void 0 && merging !== void 0 && pruning === void 0 && input.steps === "prune") return {
|
|
721
|
-
change: {},
|
|
737
|
+
change: { rows: noRows },
|
|
722
738
|
more: false,
|
|
723
739
|
yielded: true
|
|
724
740
|
};
|
|
@@ -737,6 +753,16 @@ const packs = (options = {}) => {
|
|
|
737
753
|
};
|
|
738
754
|
const step = yield* Effect.gen(function* () {
|
|
739
755
|
if (orphan !== void 0) return ending(droppedStep(orphan));
|
|
756
|
+
if (input.deleted === true && read.started !== void 0) return (yield* passScratch(upkeep, read.started.at)) === "more" ? {
|
|
757
|
+
change: { rows: noRows },
|
|
758
|
+
more: true
|
|
759
|
+
} : {
|
|
760
|
+
change: {
|
|
761
|
+
delete: [pruneStartedKey],
|
|
762
|
+
rows: noRows
|
|
763
|
+
},
|
|
764
|
+
more: true
|
|
765
|
+
};
|
|
740
766
|
if (merging !== void 0 && input.steps !== "prune") return yield* resumeMerge(upkeep, merging, chosen === false ? defaultRepack.maxPackSize : chosen.maxPackSize ?? defaultRepack.maxPackSize, counted === void 0 ? void 0 : {
|
|
741
767
|
made: counted.made,
|
|
742
768
|
most: counted.most
|
|
@@ -751,10 +777,15 @@ const packs = (options = {}) => {
|
|
|
751
777
|
more: true
|
|
752
778
|
};
|
|
753
779
|
if (input.steps === "prune") return pruned?.next === void 0 ? void 0 : {
|
|
754
|
-
change: {},
|
|
780
|
+
change: { rows: noRows },
|
|
755
781
|
more: false,
|
|
756
782
|
due: pruned.next
|
|
757
783
|
};
|
|
784
|
+
const rebuilt = yield* rebuildStep(upkeep, read.refused, counted === void 0 ? void 0 : {
|
|
785
|
+
made: counted.made,
|
|
786
|
+
most: counted.most
|
|
787
|
+
});
|
|
788
|
+
if (rebuilt !== void 0) return ending(rebuilt);
|
|
758
789
|
const held = new Set(pruning?.value.inputs);
|
|
759
790
|
const cruft = mergesAlone(read);
|
|
760
791
|
const alone = (pack) => cruft(pack) || held.has(pack.id);
|
|
@@ -808,14 +839,14 @@ const packs = (options = {}) => {
|
|
|
808
839
|
const behind = last === void 0 || last + wait <= at ? { pruneWait: wait } : {};
|
|
809
840
|
const ended = ready ?? cleaned;
|
|
810
841
|
const named = passAt === void 0 ? ended : {
|
|
811
|
-
change: {},
|
|
842
|
+
change: { rows: noRows },
|
|
812
843
|
more: false,
|
|
813
844
|
...ended,
|
|
814
845
|
prune: passAt,
|
|
815
846
|
...behind
|
|
816
847
|
};
|
|
817
848
|
const idle = named ?? {
|
|
818
|
-
change: {},
|
|
849
|
+
change: { rows: noRows },
|
|
819
850
|
more: false
|
|
820
851
|
};
|
|
821
852
|
if (due === void 0) return named;
|
|
@@ -824,7 +855,7 @@ const packs = (options = {}) => {
|
|
|
824
855
|
due
|
|
825
856
|
};
|
|
826
857
|
});
|
|
827
|
-
return unfenced(step, read.refused, listed.packs);
|
|
858
|
+
return unfenced(step, read.refused, listed.packs, fences.lifted);
|
|
828
859
|
});
|
|
829
860
|
/**
|
|
830
861
|
* The objects, every one, or with `visible`, only those it holds, as `seen` says. Each call
|
|
@@ -180,7 +180,7 @@ const droppedOnRefusal = (walk, input, pack, _start, _missing, options = {}) =>
|
|
|
180
180
|
* A refused fresh walk drops its runs; one given `saved` or `known` keeps them. A test sets
|
|
181
181
|
* `treesAtOnce` below its bound.
|
|
182
182
|
*/
|
|
183
|
-
const pruneWalk = /* @__PURE__ */ Effect.fnUntraced(function* (input, pack, start, missing, { rows = 0, treesAtOnce = pruneTreesAtOnce, calls, saved, known } = {}) {
|
|
183
|
+
const pruneWalk = /* @__PURE__ */ Effect.fnUntraced(function* (input, pack, start, missing, { rows = 0, treesAtOnce = pruneTreesAtOnce, calls, saved, known, roots } = {}) {
|
|
184
184
|
const { allotment, listed } = input;
|
|
185
185
|
const objects = listed.packs.reduce((sum, each) => sum + each.objects, 0) + rows;
|
|
186
186
|
const blocks = listed.packs.reduce((sum, each) => sum + Math.ceil(each.bytes / blockBytes), 0);
|
|
@@ -214,7 +214,10 @@ const pruneWalk = /* @__PURE__ */ Effect.fnUntraced(function* (input, pack, star
|
|
|
214
214
|
held -= bytes;
|
|
215
215
|
allotment.shrink(bytes);
|
|
216
216
|
});
|
|
217
|
-
const reads = countedReads(
|
|
217
|
+
const reads = countedReads(roots === void 0 ? reader : {
|
|
218
|
+
...reader,
|
|
219
|
+
roots
|
|
220
|
+
}, objects + 1e6, charged, void 0, release);
|
|
218
221
|
/** Where each of `oids` is for the seen set: its first listed pack and its rank there. */
|
|
219
222
|
const ranksOf = Effect.fnUntraced(function* (oids) {
|
|
220
223
|
const at = /* @__PURE__ */ new Map();
|