@nervur.org/genome 0.37.4 → 0.37.6
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/contracts/carriers/contract.js +1 -1
- package/docs/authoring.md +3 -1
- package/docs/changelog.md +12 -20
- package/genome/brain/brain.js +1 -1
- package/genome/brain/far.d.ts +0 -1
- package/genome/brain/far.js +2 -4
- package/genome/brain/genome.js +1 -1
- package/genome/brain/guide.js +1 -1
- package/genome/brain/index.d.ts +1 -1
- package/genome/brain/index.js +1 -1
- package/genome/brain/kit.js +2 -2
- package/genome/brain/life.d.ts +1 -1
- package/genome/brain/life.js +6 -4
- package/genome/brain/limits.d.ts +1 -0
- package/genome/brain/limits.js +2 -0
- package/genome/brain/methods.js +1 -1
- package/genome/brain/notes.d.ts +2 -1
- package/genome/brain/notes.js +2 -2
- package/genome/brain/space.d.ts +3 -2
- package/genome/brain/space.js +24 -3
- package/genome/brain/version.js +1 -1
- package/genome/cache/cache.d.ts +3 -3
- package/genome/cache/cache.js +9 -4
- package/genome/cache/index.d.ts +1 -1
- package/genome/cache/index.js +1 -1
- package/genome/cache/spaces.d.ts +8 -1
- package/genome/cache/spaces.js +54 -3
- package/genome/carry/carry.js +4 -1
- package/genome/carry/gear.js +3 -3
- package/genome/carry/held.js +1 -1
- package/genome/carry/organ.js +1 -1
- package/genome/faculties/ear/blueprint.js +1 -1
- package/genome/faculties/ear/text.js +1 -1
- package/genome/faculties/library/blueprint.js +1 -1
- package/genome/faculties/library/text.js +1 -1
- package/genome/faculties/mouth/blueprint.js +1 -1
- package/genome/faculties/mouth/text.js +1 -1
- package/genome/faculties/scheduler/blueprint.js +1 -1
- package/genome/faculties/scheduler/text.js +1 -1
- package/genome/log/open.js +5 -3
- package/genome/log/record.d.ts +1 -0
- package/genome/log/record.js +19 -5
- package/genome/log/store.d.ts +1 -0
- package/genome/log/store.js +35 -6
- package/genome/organism/body.js +2 -2
- package/genome/organism/made.js +2 -1
- package/genome/pure/frozen.js +15 -7
- package/genome/store/reading.js +19 -6
- package/genome/store/store.js +4 -4
- package/kit/core/foundation.js +2 -2
- package/kit/presence/screen-half.js +1 -1
- package/package.json +1 -1
- package/quo/ward/link.d.ts +0 -1
- package/quo/ward/link.js +0 -2
- package/seams/carriers/carriers.js +2 -2
- package/seams/entry/configuration.js +1 -1
- package/standard/blueprint/blueprint.js +1 -1
- package/standard/version.js +1 -1
package/genome/brain/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export { capsIn, carriersIn, LIFTED, limitIn, worded } from './limits.js';
|
|
|
22
22
|
export { placeOrgan, type Halves } from './organ.js';
|
|
23
23
|
export { everyOrgan, putOrgan, type Added } from './organs.js';
|
|
24
24
|
export { makeReflex, type Level, type Reflex } from './reflex.js';
|
|
25
|
-
export { countedRow, spaceOver, type Space } from './space.js';
|
|
25
|
+
export { chargedRows, countedRow, spaceOver, type Space } from './space.js';
|
|
26
26
|
export { roadOf, type Road } from './road.js';
|
|
27
27
|
export { assetsFor } from './assets.js';
|
|
28
28
|
export { givenOf, putGiven } from './given.js';
|
package/genome/brain/index.js
CHANGED
|
@@ -23,7 +23,7 @@ export { capsIn, carriersIn, LIFTED, limitIn, worded } from './limits.js';
|
|
|
23
23
|
export { placeOrgan, } from './organ.js';
|
|
24
24
|
export { everyOrgan, putOrgan, } from './organs.js';
|
|
25
25
|
export { makeReflex, } from './reflex.js';
|
|
26
|
-
export { countedRow, spaceOver, } from './space.js';
|
|
26
|
+
export { chargedRows, countedRow, spaceOver, } from './space.js';
|
|
27
27
|
export { roadOf, } from './road.js';
|
|
28
28
|
export { assetsFor } from './assets.js';
|
|
29
29
|
export { givenOf, putGiven } from './given.js';
|
package/genome/brain/kit.js
CHANGED
package/genome/brain/life.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ type Life = {
|
|
|
20
20
|
};
|
|
21
21
|
export declare const backup: (kit: Life, fields: Fields, settled: (answer: Answer) => void) => void;
|
|
22
22
|
export declare const move: (kit: Kit, asker: string, fields: Fields, { done, settled }: Reply) => void;
|
|
23
|
-
export declare const backupPiece: (kit: Kit, fields: Fields, reply: Reply) => void;
|
|
23
|
+
export declare const backupPiece: (kit: Kit, asker: string, fields: Fields, reply: Reply) => void;
|
|
24
24
|
export {};
|
package/genome/brain/life.js
CHANGED
|
@@ -159,8 +159,10 @@ export const move = (kit , asker , fields , { done, settled }
|
|
|
159
159
|
});
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
-
const lastPiece = (kit , leaving , bytes , { done, joined } ) => {
|
|
163
|
-
const heirs = everyRelation(kit.gear.cells()).flatMap(({ heir, node }) =>
|
|
162
|
+
const lastPiece = (kit , asker , leaving , bytes , { done, joined } ) => {
|
|
163
|
+
const heirs = everyRelation(kit.gear.cells()).flatMap(({ heir, node, far }) =>
|
|
164
|
+
node === BRAIN && far === asker ? [heir] : [],
|
|
165
|
+
);
|
|
164
166
|
const ending = kit.gear.backupEnd({ bytes, heirs, joined });
|
|
165
167
|
void ending.then(
|
|
166
168
|
(ended) => {
|
|
@@ -185,7 +187,7 @@ const lastPiece = (kit , leaving , bytes , { done, joined }
|
|
|
185
187
|
);
|
|
186
188
|
};
|
|
187
189
|
|
|
188
|
-
export const backupPiece = (kit , fields , reply ) => {
|
|
190
|
+
export const backupPiece = (kit , asker , fields , reply ) => {
|
|
189
191
|
const asked = { mark: textAt(fields, 'mark'), at: numberAt(fields, 'at'), length: numberAt(fields, 'length') };
|
|
190
192
|
const found = kit.leaving.current;
|
|
191
193
|
const leaving = found !== null && asked.mark === found.mark ? found : null;
|
|
@@ -194,7 +196,7 @@ export const backupPiece = (kit , fields , reply ) => {
|
|
|
194
196
|
return kit.gear.leave(NOT_SEALED);
|
|
195
197
|
}
|
|
196
198
|
if (leaving !== null && leaving.bytes !== null && asked.at === leaving.bytes)
|
|
197
|
-
return lastPiece(kit, leaving, leaving.bytes, reply);
|
|
199
|
+
return lastPiece(kit, asker, leaving, leaving.bytes, reply);
|
|
198
200
|
void kit.gear.backupPiece(asked).then((taken) => {
|
|
199
201
|
if ('why' in taken) return reply.settled(error('refused', taken.why));
|
|
200
202
|
const { piece, made } = taken;
|
package/genome/brain/limits.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type Answer, type Caps, type Data, type Fields } from '#standard';
|
|
|
3
3
|
import { type Cells } from '#cage';
|
|
4
4
|
import type { Change } from './changes.js';
|
|
5
5
|
export declare const LIFTED: number;
|
|
6
|
+
export declare const NOTE_LIMIT = 4096;
|
|
6
7
|
export declare const limitIn: (cells: Cells, name: string, lobe?: string | null) => number | undefined;
|
|
7
8
|
export declare const capsIn: (cells: Cells, lobe: string) => Caps;
|
|
8
9
|
export declare const lobeWordOf: (cells: Cells, name: string, lobe: string) => Answer;
|
package/genome/brain/limits.js
CHANGED
package/genome/brain/methods.js
CHANGED
|
@@ -177,7 +177,7 @@ const HANDLERS = {
|
|
|
177
177
|
joined,
|
|
178
178
|
),
|
|
179
179
|
move: (kit, asker, fields, reply) => move(kit, asker, fields, reply),
|
|
180
|
-
backupPiece: (kit,
|
|
180
|
+
backupPiece: (kit, asker, fields, reply) => backupPiece(kit, asker, fields, reply),
|
|
181
181
|
upgrade: (kit, _asker, fields, { settled }) => upgrade(kit.gear, fields, settled),
|
|
182
182
|
state: (kit, asker, fields, { settled, binds }) => {
|
|
183
183
|
const cursor = typeof fields['cursor'] === 'string' ? fields['cursor'] : undefined;
|
package/genome/brain/notes.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type Data, type Fields } from '#standard';
|
|
2
2
|
import type { Cells } from '#cage';
|
|
3
3
|
import type { Change } from './changes.js';
|
|
4
|
-
|
|
4
|
+
import { NOTE_LIMIT } from './limits.js';
|
|
5
|
+
export { NOTE_LIMIT };
|
|
5
6
|
export declare const noteIn: (args: Fields) => Data;
|
|
6
7
|
export declare const noteRefusal: (cells: Cells, lobe: string, note: Data) => string | null;
|
|
7
8
|
export declare const saysRefusal: (cells: Cells, lobe: string, says: Data) => string | null;
|
package/genome/brain/notes.js
CHANGED
|
@@ -6,10 +6,10 @@ import { mapOf } from '../map/index.js';
|
|
|
6
6
|
import { textAt } from './fields.js';
|
|
7
7
|
import { putGrant } from './grants.js';
|
|
8
8
|
import { heldDirection, setNote } from './holds.js';
|
|
9
|
-
import { limitIn } from './limits.js';
|
|
9
|
+
import { limitIn, NOTE_LIMIT } from './limits.js';
|
|
10
10
|
import { BRAIN } from '../ids/index.js';
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export { NOTE_LIMIT };
|
|
13
13
|
|
|
14
14
|
export const noteIn = (args ) => args['note'] ?? null;
|
|
15
15
|
|
package/genome/brain/space.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Cache } from '../cache/index.js';
|
|
1
|
+
import type { Cache, Charged } from '../cache/index.js';
|
|
2
2
|
import { type CellKey, type Batch, type Reader } from '#cage';
|
|
3
|
-
export declare const RELATION =
|
|
3
|
+
export declare const RELATION = 4096;
|
|
4
|
+
export declare const chargedRows: Charged;
|
|
4
5
|
export declare const countedRow: ([partition, row, node]: CellKey) => CellKey | null;
|
|
5
6
|
export type SpaceGear = {
|
|
6
7
|
readonly spaces: Cache['spaces'];
|
package/genome/brain/space.js
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
// SPDX-License-Identifier: FSL-1.1-ALv2
|
|
2
|
-
|
|
2
|
+
import { dataOfBytes, isFields } from '#standard';
|
|
3
|
+
|
|
3
4
|
import { weightOver, } from '#cage';
|
|
4
5
|
import { BRAIN } from '../ids/index.js';
|
|
5
6
|
import { LIFTED } from './limits.js';
|
|
6
7
|
|
|
7
|
-
export const RELATION =
|
|
8
|
+
export const RELATION = 4096;
|
|
9
|
+
|
|
10
|
+
export const chargedRows = {
|
|
11
|
+
prefixes: [
|
|
12
|
+
[BRAIN, 'holds'],
|
|
13
|
+
[BRAIN, 'grant'],
|
|
14
|
+
[BRAIN, 'letter'],
|
|
15
|
+
[BRAIN, 'dead'],
|
|
16
|
+
],
|
|
17
|
+
of: (key, value) => {
|
|
18
|
+
const [, row, first, second] = key;
|
|
19
|
+
if (row === 'holds') return typeof first === 'string' ? first : null;
|
|
20
|
+
if (row === 'grant') return typeof second === 'string' ? second : null;
|
|
21
|
+
const read = dataOfBytes(value);
|
|
22
|
+
if ('why' in read || !isFields(read.data)) return null;
|
|
23
|
+
const { asker } = read.data;
|
|
24
|
+
return typeof asker === 'string' ? asker : null;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
8
27
|
|
|
9
28
|
const HOLDS = 'holds';
|
|
10
29
|
const INVITED = 'invited';
|
|
@@ -44,7 +63,9 @@ const WAITING =
|
|
|
44
63
|
export const spaceOver = (gear ) => {
|
|
45
64
|
const { spaces, reader, limit, room, core } = gear;
|
|
46
65
|
const held = (node ) =>
|
|
47
|
-
spaces.bytes(node) +
|
|
66
|
+
spaces.bytes(node) +
|
|
67
|
+
spaces.charged(node) +
|
|
68
|
+
(spaces.rows([BRAIN, HOLDS, node]) + spaces.rows([BRAIN, GRANTED, node])) * RELATION;
|
|
48
69
|
const limitOf = (node ) => (core(node) ? LIFTED : (limit('space', node) ?? room()));
|
|
49
70
|
const growth = (writes ) =>
|
|
50
71
|
writes.reduce(
|
package/genome/brain/version.js
CHANGED
package/genome/cache/cache.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Committed, type Store } from '../store/index.js';
|
|
2
2
|
import { type Batch, type Reader } from '#cage';
|
|
3
3
|
import { type Snapshot } from './snapshot.js';
|
|
4
|
-
import { type Counted, type Spaces } from './spaces.js';
|
|
4
|
+
import { type Charged, type Counted, type Spaces } from './spaces.js';
|
|
5
5
|
export type Cache = Reader & {
|
|
6
6
|
commit(batches: readonly Batch[]): Promise<Committed | {
|
|
7
7
|
readonly why: string;
|
|
@@ -11,10 +11,10 @@ export type Cache = Reader & {
|
|
|
11
11
|
limit(bytes: number): void;
|
|
12
12
|
held(): number;
|
|
13
13
|
kept(): number;
|
|
14
|
-
readonly spaces: Pick<Spaces, 'bytes' | 'rows'>;
|
|
14
|
+
readonly spaces: Pick<Spaces, 'bytes' | 'rows' | 'charged'>;
|
|
15
15
|
};
|
|
16
16
|
export type Watch = {
|
|
17
17
|
needs(key: Uint8Array): boolean;
|
|
18
18
|
shown(batches: readonly Batch[], olders: ReadonlyMap<string, Uint8Array | null>): void;
|
|
19
19
|
};
|
|
20
|
-
export declare const makeCache: (store: Store, bytes: number, watch?: Watch | null, counted?: Counted) => Cache;
|
|
20
|
+
export declare const makeCache: (store: Store, bytes: number, watch?: Watch | null, counted?: Counted, charged?: Charged) => Cache;
|
package/genome/cache/cache.js
CHANGED
|
@@ -3,7 +3,7 @@ import { hex } from '#standard';
|
|
|
3
3
|
import { Damaged, once, unlessDamaged, } from '../store/index.js';
|
|
4
4
|
import { countOver, nthOver, weightOver, } from '#cage';
|
|
5
5
|
import { makeHistory, } from './snapshot.js';
|
|
6
|
-
import { spacesOver,
|
|
6
|
+
import { NONE_CHARGED, spacesOver, } from './spaces.js';
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -19,7 +19,7 @@ import { spacesOver, } from './spaces.js';
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -172,6 +172,7 @@ export const makeCache = (
|
|
|
172
172
|
bytes ,
|
|
173
173
|
watch = null,
|
|
174
174
|
counted = () => null,
|
|
175
|
+
charged = NONE_CHARGED,
|
|
175
176
|
) => {
|
|
176
177
|
checkLimit(bytes);
|
|
177
178
|
const heat = { keys: new Map(), ceiling: bytes, held: 0 };
|
|
@@ -182,7 +183,7 @@ export const makeCache = (
|
|
|
182
183
|
count: (from, to) => countOver(store, from, to),
|
|
183
184
|
nth: (from, to, index) => nthOver(store, from, to, index),
|
|
184
185
|
};
|
|
185
|
-
const spaces = spacesOver(store, counted);
|
|
186
|
+
const spaces = spacesOver(store, counted, charged);
|
|
186
187
|
const parts = { store, watch, heat, history, spaces, reader, stopped: false, flight: null };
|
|
187
188
|
let line = Promise.resolve();
|
|
188
189
|
return {
|
|
@@ -208,6 +209,10 @@ export const makeCache = (
|
|
|
208
209
|
},
|
|
209
210
|
held: () => heat.held,
|
|
210
211
|
kept: () => history.count(),
|
|
211
|
-
spaces: {
|
|
212
|
+
spaces: {
|
|
213
|
+
bytes: (partition) => spaces.bytes(partition),
|
|
214
|
+
rows: (prefix) => spaces.rows(prefix),
|
|
215
|
+
charged: (node) => spaces.charged(node),
|
|
216
|
+
},
|
|
212
217
|
};
|
|
213
218
|
};
|
package/genome/cache/index.d.ts
CHANGED
package/genome/cache/index.js
CHANGED
package/genome/cache/spaces.d.ts
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { type CellKey, type Batch, type Reader } from '#cage';
|
|
2
2
|
export type Counted = (key: CellKey) => CellKey | null;
|
|
3
|
+
export type Charged = {
|
|
4
|
+
readonly prefixes: readonly CellKey[];
|
|
5
|
+
of(key: CellKey, value: Uint8Array): string | null;
|
|
6
|
+
};
|
|
7
|
+
export declare const NONE_CHARGED: Charged;
|
|
3
8
|
export type Moved = {
|
|
4
9
|
readonly bytes: ReadonlyMap<string, number>;
|
|
5
10
|
readonly rows: ReadonlyMap<string, number>;
|
|
11
|
+
readonly charged: ReadonlyMap<string, number>;
|
|
6
12
|
};
|
|
7
13
|
export type Spaces = {
|
|
8
14
|
bytes(partition: string): number;
|
|
9
15
|
rows(prefix: CellKey): number;
|
|
16
|
+
charged(node: string): number;
|
|
10
17
|
moving(batches: readonly Batch[]): Moved;
|
|
11
18
|
landed(moved: Moved): void;
|
|
12
19
|
forget(): void;
|
|
13
20
|
};
|
|
14
|
-
export declare const spacesOver: (store: Reader, counted: Counted) => Spaces;
|
|
21
|
+
export declare const spacesOver: (store: Reader, counted: Counted, charged?: Charged) => Spaces;
|
package/genome/cache/spaces.js
CHANGED
|
@@ -16,13 +16,26 @@ import { unlessDamaged } from '../store/index.js';
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export const NONE_CHARGED = { prefixes: [], of: () => null };
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
20
31
|
|
|
21
32
|
|
|
22
33
|
|
|
23
34
|
|
|
24
35
|
|
|
25
36
|
|
|
37
|
+
|
|
38
|
+
|
|
26
39
|
|
|
27
40
|
|
|
28
41
|
|
|
@@ -39,9 +52,34 @@ const added = (moved , name , by ) => {
|
|
|
39
52
|
moved.set(name, (moved.get(name) ?? 0) + by);
|
|
40
53
|
};
|
|
41
54
|
|
|
42
|
-
|
|
55
|
+
const PAGE = 256;
|
|
56
|
+
|
|
57
|
+
export const spacesOver = (store , counted , charged = NONE_CHARGED) => {
|
|
43
58
|
const bytes = new Map ();
|
|
44
59
|
const rows = new Map ();
|
|
60
|
+
let charges = null;
|
|
61
|
+
const chargesOf = () => {
|
|
62
|
+
if (charges !== null) return charges;
|
|
63
|
+
const summed = new Map ();
|
|
64
|
+
unlessDamaged(() => {
|
|
65
|
+
for (const prefix of charged.prefixes) {
|
|
66
|
+
const { from, to } = prefixRange(prefix);
|
|
67
|
+
for (let after = null; ;) {
|
|
68
|
+
const pairs = store.range(from, to, PAGE, after);
|
|
69
|
+
for (const pair of pairs) {
|
|
70
|
+
const found = keyOf(pair.key)?.key;
|
|
71
|
+
const node = found === undefined ? null : charged.of(found, pair.value);
|
|
72
|
+
if (node !== null) added(summed, node, weightOver(store, pair.key));
|
|
73
|
+
}
|
|
74
|
+
if (pairs.length < PAGE) break;
|
|
75
|
+
after = pairs.at(-1)?.key ?? null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}, null);
|
|
80
|
+
charges = summed;
|
|
81
|
+
return summed;
|
|
82
|
+
};
|
|
45
83
|
const bytesOf = (partition ) => {
|
|
46
84
|
const known = bytes.get(partition);
|
|
47
85
|
if (known !== undefined) return known;
|
|
@@ -62,9 +100,11 @@ export const spacesOver = (store , counted ) => {
|
|
|
62
100
|
return {
|
|
63
101
|
bytes: bytesOf,
|
|
64
102
|
rows: rowsOf,
|
|
103
|
+
charged: (node) => chargesOf().get(node) ?? 0,
|
|
65
104
|
moving: (batches) => {
|
|
66
105
|
const movedBytes = new Map ();
|
|
67
106
|
const movedRows = new Map ();
|
|
107
|
+
const movedCharged = new Map ();
|
|
68
108
|
for (const { key, value } of lastWrites(batches)) {
|
|
69
109
|
const found = keyOf(key)?.key;
|
|
70
110
|
const partition = found?.[0];
|
|
@@ -72,20 +112,31 @@ export const spacesOver = (store , counted ) => {
|
|
|
72
112
|
bytesOf(partition);
|
|
73
113
|
const older = unlessDamaged(() => weightOver(store, key), 0);
|
|
74
114
|
added(movedBytes, partition, (value === null ? 0 : key.length + value.length) - older);
|
|
115
|
+
if (charged.prefixes.some((prefix) => prefix.every((part, at) => found[at] === part))) {
|
|
116
|
+
chargesOf();
|
|
117
|
+
const was = older === 0 ? null : unlessDamaged(() => store.get(key), null);
|
|
118
|
+
const from = was === null ? null : charged.of(found, was);
|
|
119
|
+
const to = value === null ? null : charged.of(found, value);
|
|
120
|
+
if (from !== null) added(movedCharged, from, -older);
|
|
121
|
+
if (to !== null && value !== null) added(movedCharged, to, key.length + value.length);
|
|
122
|
+
}
|
|
75
123
|
const prefix = counted(found);
|
|
76
124
|
if (prefix === null) continue;
|
|
77
125
|
rowsOf(prefix);
|
|
78
126
|
added(movedRows, hex(keyBytes(prefix)), (value === null ? 0 : 1) - (older === 0 ? 0 : 1));
|
|
79
127
|
}
|
|
80
|
-
return { bytes: movedBytes, rows: movedRows };
|
|
128
|
+
return { bytes: movedBytes, rows: movedRows, charged: movedCharged };
|
|
81
129
|
},
|
|
82
130
|
landed: (moved) => {
|
|
83
131
|
for (const [partition, by] of moved.bytes) added(bytes, partition, by);
|
|
84
132
|
for (const [prefix, by] of moved.rows) added(rows, prefix, by);
|
|
133
|
+
const summed = chargesOf();
|
|
134
|
+
for (const [node, by] of moved.charged) added(summed, node, by);
|
|
85
135
|
},
|
|
86
136
|
forget: () => {
|
|
87
137
|
bytes.clear();
|
|
88
138
|
rows.clear();
|
|
139
|
+
charges = null;
|
|
89
140
|
},
|
|
90
141
|
};
|
|
91
142
|
};
|
package/genome/carry/carry.js
CHANGED
|
@@ -111,7 +111,10 @@ const cutOff = (hold , held , message , why
|
|
|
111
111
|
const ended = (hold , held , ending ) => {
|
|
112
112
|
if ('answered' in ending) {
|
|
113
113
|
const writes = held.cells?.batch() ?? [];
|
|
114
|
-
const
|
|
114
|
+
const judged = [...writes, ...held.posted];
|
|
115
|
+
const posted = held.posted.reduce((sum, { key, value }) => sum + key.length + (value?.length ?? 0), 0);
|
|
116
|
+
const full =
|
|
117
|
+
judged.length === 0 ? null : (hold.gear.refused?.(held.lobe, judged, (held.cells?.held() ?? 0) + posted) ?? null);
|
|
115
118
|
if (full !== null) return settle(hold, held, error('busy', full), []);
|
|
116
119
|
ringAgain(hold, held, ending.answered, enqueue(hold));
|
|
117
120
|
settle(hold, held, ending.answered, [...writes, ...held.taken, ...postedBy(hold, held)]);
|
package/genome/carry/gear.js
CHANGED
package/genome/carry/held.js
CHANGED
package/genome/carry/organ.js
CHANGED